allyhub 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
  2. package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
  3. package/dist/node_modules/@allyhub-next/build/package.json +1 -1
  4. package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
  5. package/dist/node_modules/@allyhub-next/check/package.json +1 -1
  6. package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
  7. package/dist/node_modules/@allyhub-next/components/package.json +1 -1
  8. package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
  9. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.js +2 -2
  10. package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
  11. package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
  12. package/dist/node_modules/@allyhub-next/export/package.json +1 -1
  13. package/dist/node_modules/@allyhub-next/formats/package.json +1 -1
  14. package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
  15. package/dist/node_modules/@allyhub-next/media/package.json +1 -1
  16. package/dist/node_modules/@allyhub-next/model/package.json +1 -1
  17. package/dist/node_modules/@allyhub-next/ooxml/package.json +1 -1
  18. package/dist/node_modules/@allyhub-next/project/package.json +1 -1
  19. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +19 -0
  20. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +1 -1
  21. package/dist/node_modules/@allyhub-next/protocol/package.json +1 -1
  22. package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
  23. package/dist/node_modules/@allyhub-next/render/package.json +1 -1
  24. package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
  25. package/dist/node_modules/@allyhub-next/runtimes/dist/download.d.ts +19 -1
  26. package/dist/node_modules/@allyhub-next/runtimes/dist/download.js +1 -1
  27. package/dist/node_modules/@allyhub-next/runtimes/dist/index.d.ts +2 -2
  28. package/dist/node_modules/@allyhub-next/runtimes/dist/index.js +1 -1
  29. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
  30. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.js +1 -1
  31. package/dist/node_modules/@allyhub-next/runtimes/dist/packages.d.ts +19 -2
  32. package/dist/node_modules/@allyhub-next/runtimes/dist/packages.js +3 -3
  33. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +3 -0
  34. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -3
  35. package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
  36. package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
  37. package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
  38. package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  39. package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
  40. package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
  41. package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/slides-runtime/package.json +1 -1
  43. package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
  44. package/dist/node_modules/@allyhub-next/stage-page/package.json +1 -1
  45. package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
  46. package/dist/node_modules/@allyhub-next/website/package.json +1 -1
  47. package/editor-web/assets/{dist-B3UoDUa5.js → dist-B-BI8jma.js} +1 -1
  48. package/editor-web/assets/{dist-DNZ8PQ-E.js → dist-CS-Z5JSF.js} +1 -1
  49. package/editor-web/assets/{dist-CTQIm8Im.js → dist-ClE1xUdI.js} +1 -1
  50. package/editor-web/assets/{dist-Bc5iA5k1.js → dist-Cqu9f1N5.js} +1 -1
  51. package/editor-web/assets/{dist-0emakyZE.js → dist-CsDICOqP.js} +1 -1
  52. package/editor-web/assets/{dist-B6KzR3pN.js → dist-DegNYCaB.js} +1 -1
  53. package/editor-web/assets/{dist-CiHNHwyq.js → dist-EotuIcA_.js} +1 -1
  54. package/editor-web/assets/index-CwDs3z43.js +69 -0
  55. package/editor-web/assets/minus-DLhpe7h_.js +1 -0
  56. package/editor-web/assets/{react-C_-rEEBU.js → react-CT8OUeCe.js} +1 -1
  57. package/editor-web/assets/{tabs-Den4gHrU.js → tabs-BEPTOFm5.js} +1 -1
  58. package/editor-web/assets/{text-align-start-CsW4nqqL.js → text-align-start-CfqIQSWH.js} +1 -1
  59. package/editor-web/index.html +2 -2
  60. package/package.json +2 -2
  61. package/editor-web/assets/index-CFt3ovRY.js +0 -69
  62. package/editor-web/assets/minus-BhoPZC5P.js +0 -1
@@ -1,4 +1,4 @@
1
- import{nn as e}from"./react-C_-rEEBU.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),n=e(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),r=e(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),i=e(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),a=e(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),o=e(`text-align-justify`,[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]]),s=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);function c(e){this.content=e}c.prototype={constructor:c,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new c(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new c(n)},addToStart:function(e,t){return new c([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new c(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new c(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=c.from(e),e.size?new c(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=c.from(e),e.size?new c(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=c.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},c.from=function(e){if(e instanceof c)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new c(t)};function l(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&f(e.charCodeAt(r-1))&&d(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=l(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function u(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&f(e.charCodeAt(i-1))&&d(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=u(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function d(e){return e>=56320&&e<57344}function f(e){return e>=55296&&e<56320}var p=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return l(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return u(this,e,t,n)}findIndex(e){if(e==0)return h(0,e);if(e==this.size)return h(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?h(t+1,i):h(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};p.empty=new p([],0);var m={index:0,offset:0};function h(e,t){return m.index=e,m.offset=t,m}function g(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!g(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!g(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var _=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&g(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};_.none=[];var v=class extends Error{},y=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=ee(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(b(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(p.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};y.empty=new y(p.empty,0,0);function b(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(b(a.content,t-i-1,n-i-1)))}function ee(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=ee(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function te(e,t,n){if(n.openStart>e.depth)throw new v(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new v(`Inconsistent open depths`);return ne(e,t,n,0)}function ne(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=ne(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return se(a,le(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return se(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ue(n,e);return se(a,ce(e,i,o,t,r))}}function re(e,t){if(!t.type.compatibleContent(e.type))throw new v(`Cannot join `+t.type.name+` onto `+e.type.name)}function ie(e,t,n){let r=e.node(n);return re(r,t.node(n)),r}function ae(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function oe(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ae(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ae(i.child(e),r);t&&t.depth==n&&t.textOffset&&ae(t.nodeBefore,r)}function se(e,t){if(!e.type.validContent(t))throw new v(`Invalid content for node `+e.type.name);return e.copy(t)}function ce(e,t,n,r,i){let a=e.depth>i&&ie(e,t,i+1),o=r.depth>i&&ie(n,r,i+1),s=[];return oe(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(re(a,o),ae(se(a,ce(e,t,n,r,i+1)),s)):(a&&ae(se(a,le(e,t,i+1)),s),oe(t,n,i,s),o&&ae(se(o,le(n,r,i+1)),s)),oe(r,null,i,s),new p(s)}function le(e,t,n){let r=[];return oe(null,e,n,r),e.depth>n&&ae(se(ie(e,t,n+1),le(e,t,n+1)),r),oe(t,null,n,r),new p(r)}function ue(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(p.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var de=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new he(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=me.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else me.set(t,r=new fe);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%pe,i}},fe=class{constructor(){this.elts=[],this.i=0}},pe=12,me=new WeakMap,he=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},ge=Object.create(null),_e=class e{constructor(e,t,n,r=_.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||p.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&g(this.attrs,t||e.defaultAttrs||ge)&&_.sameSet(this.marks,n||_.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return y.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new y(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return te(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return de.resolveCached(this,e)}resolveNoCache(e){return de.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),ye(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=p.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),be(this.type.attrs,this.attrs,`node`,this.type.name);let e=_.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];be(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!_.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=p.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};_e.prototype.text=void 0;var ve=class e extends _e{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ye(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function ye(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function be(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var xe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Se(t,n);if(r.next==null)return e.empty;let i=Ce(r);r.next&&r.err(`Unexpected trailing text`);let a=Ne(Ae(i));return Pe(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return p.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ import{nn as e}from"./react-CT8OUeCe.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),n=e(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),r=e(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),i=e(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),a=e(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),o=e(`text-align-justify`,[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]]),s=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);function c(e){this.content=e}c.prototype={constructor:c,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new c(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new c(n)},addToStart:function(e,t){return new c([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new c(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new c(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=c.from(e),e.size?new c(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=c.from(e),e.size?new c(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=c.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},c.from=function(e){if(e instanceof c)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new c(t)};function l(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&f(e.charCodeAt(r-1))&&d(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=l(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function u(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&f(e.charCodeAt(i-1))&&d(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=u(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function d(e){return e>=56320&&e<57344}function f(e){return e>=55296&&e<56320}var p=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return l(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return u(this,e,t,n)}findIndex(e){if(e==0)return h(0,e);if(e==this.size)return h(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?h(t+1,i):h(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};p.empty=new p([],0);var m={index:0,offset:0};function h(e,t){return m.index=e,m.offset=t,m}function g(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!g(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!g(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var _=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&g(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};_.none=[];var v=class extends Error{},y=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=ee(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(b(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(p.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};y.empty=new y(p.empty,0,0);function b(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(b(a.content,t-i-1,n-i-1)))}function ee(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=ee(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function te(e,t,n){if(n.openStart>e.depth)throw new v(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new v(`Inconsistent open depths`);return ne(e,t,n,0)}function ne(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=ne(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return se(a,le(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return se(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ue(n,e);return se(a,ce(e,i,o,t,r))}}function re(e,t){if(!t.type.compatibleContent(e.type))throw new v(`Cannot join `+t.type.name+` onto `+e.type.name)}function ie(e,t,n){let r=e.node(n);return re(r,t.node(n)),r}function ae(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function oe(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ae(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ae(i.child(e),r);t&&t.depth==n&&t.textOffset&&ae(t.nodeBefore,r)}function se(e,t){if(!e.type.validContent(t))throw new v(`Invalid content for node `+e.type.name);return e.copy(t)}function ce(e,t,n,r,i){let a=e.depth>i&&ie(e,t,i+1),o=r.depth>i&&ie(n,r,i+1),s=[];return oe(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(re(a,o),ae(se(a,ce(e,t,n,r,i+1)),s)):(a&&ae(se(a,le(e,t,i+1)),s),oe(t,n,i,s),o&&ae(se(o,le(n,r,i+1)),s)),oe(r,null,i,s),new p(s)}function le(e,t,n){let r=[];return oe(null,e,n,r),e.depth>n&&ae(se(ie(e,t,n+1),le(e,t,n+1)),r),oe(t,null,n,r),new p(r)}function ue(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(p.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var de=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new he(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=me.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else me.set(t,r=new fe);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%pe,i}},fe=class{constructor(){this.elts=[],this.i=0}},pe=12,me=new WeakMap,he=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},ge=Object.create(null),_e=class e{constructor(e,t,n,r=_.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||p.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&g(this.attrs,t||e.defaultAttrs||ge)&&_.sameSet(this.marks,n||_.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return y.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new y(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return te(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return de.resolveCached(this,e)}resolveNoCache(e){return de.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),ye(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=p.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),be(this.type.attrs,this.attrs,`node`,this.type.name);let e=_.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];be(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!_.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=p.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};_e.prototype.text=void 0;var ve=class e extends _e{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ye(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function ye(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function be(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var xe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Se(t,n);if(r.next==null)return e.empty;let i=Ce(r);r.next&&r.err(`Unexpected trailing text`);let a=Ne(Ae(i));return Pe(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return p.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};xe.empty=new xe(!0);var Se=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Ce(e){let t=[];do t.push(we(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function we(e){let t=[];do t.push(Te(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Te(e){let t=ke(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=De(e,t);else break;return t}function Ee(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function De(e,t){let n=Ee(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Ee(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Oe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function ke(e){if(e.eat(`(`)){let t=Ce(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Oe(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Ae(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function je(e,t){return t-e}function Me(e,t){let n=[];return r(t),n.sort(je);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Ne(e){let t=Object.create(null);return n(Me(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Me(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new xe(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(je);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Pe(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Fe(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ie(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function Le(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Be(e,r,t[r]);return n}var Re=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Le(e,n.attrs),this.defaultAttrs=Fe(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xe.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ie(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new _e(this,this.computeAttrs(e),p.from(t),_.setFrom(n))}createChecked(e=null,t,n){return t=p.from(t),this.checkContent(t),new _e(this,this.computeAttrs(e),t,_.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=p.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(p.empty,!0);return i?new _e(this,e,t.append(i),_.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:_.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ze(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Be=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ze(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Ve=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Le(e,r.attrs),this.excluded=null;let i=Fe(this.attrs);this.instance=i?new _(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _(this,Ie(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}},He=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=c.from(e.nodes),t.marks=c.from(e.marks||{}),this.nodes=Re.compile(this.spec.nodes,this),this.marks=Ve.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=xe.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Ue(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Ue(this,n.split(` `))}this.nodeFromJSON=e=>_e.fromJSON(this,e),this.markFromJSON=e=>_.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Re))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ve(n,n.defaultAttrs,e,_.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Ue(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function We(e){return e.tag!=null}function Ge(e){return e.style!=null}var Ke=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(We(e))this.tags.push(e);else if(Ge(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new tt(this,t,!1);return n.addAll(e,_.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new tt(this,t,!0);return n.addAll(e,_.none,t.from,t.to),y.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(rt(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=it(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=it(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},qe={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Je={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ye={ol:!0,ul:!0},Xe=1,Ze=2,Qe=4;function $e(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Xe:0)|(t===`full`?Ze:0)}var et=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=_.none,this.match=i||(a&Qe?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(p.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Xe)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=p.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(p.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},tt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=$e(null,t.preserveWhitespace,0)|(n?Qe:0);i=r?new et(r.type,r.attrs,_.none,!0,t.topMatch||r.type.contentMatch,a):n?new et(null,null,_.none,!0,null,a):new et(e.schema.topNodeType,null,_.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Ze?`full`:this.localPreserveWS||(r.options&Xe)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
3
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Ye.hasOwnProperty(a)&&this.parser.normalizeLists&&nt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Je.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(qe.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=_.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):at(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=$e(e,i,a.options);a.options&Qe&&a.content.length==0&&(o|=Qe);let s=_.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):at(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new et(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Xe);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function nt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Ye.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function rt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function it(e){let t={};for(let n in e)t[n]=e[n];return t}function at(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var ot=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=ct(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name])a++;else{if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return ct(t).createTextNode(e.text);let{dom:n,contentDOM:r}=ft(ct(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ft(ct(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:ft(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=st(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return st(e.marks)}};function st(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ct(e){return e.document||window.document}var lt=new WeakMap;function ut(e){let t=lt.get(e);return t===void 0&&lt.set(e,t=dt(e)),t}function dt(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function ft(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=ut(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=ft(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var pt=65535,mt=2**16;function ht(e,t){return e+t*mt}function gt(e){return e&pt}function _t(e){return(e-(e&pt))/mt}var vt=1,yt=2,bt=4,xt=8,St=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&xt)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&bt)>0}},Ct=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=gt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+_t(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ht(o/3,e-s),f=0;return c&&(f|=e==s?yt:e==u?vt:bt,(t<0?e!=s:e!=u)&&(f|=xt)),new St(a,f,d)}r+=l-c}return n?e+r:new St(e+r,0,null)}touches(e,t){let n=0,r=gt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Ct.empty=new Ct([]);var wt=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new St(e,r,null)}},Tt=Object.create(null),x=class{getMap(){return Ct.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Tt[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Tt)throw RangeError(`Duplicate use of step JSON ID `+e);return Tt[e]=t,t.prototype.jsonID=e,t}},S=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof v)return e.fail(t.message);throw t}}};function Et(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Et(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return p.fromArray(r)}var Dt=class e extends x{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new y(Et(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return S.fromReplace(e,this.from,this.to,i)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(t,r)=>{if(t.isInline&&t.isAtom){let i=this.mark.addToSet(t.marks);if(!_.sameSet(i,t.marks)){let a=Math.max(this.from,r),o=Math.min(this.to,r+t.nodeSize);kt(Ot,a,o,this.mark,n);for(let r of t.marks)r.isInSet(i)||kt(e,a,o,r,n)}}}),n.length==1?n[0]:new At(n)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};x.jsonID(`addMark`,Dt);var Ot=class e extends x{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new y(Et(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return S.fromReplace(e,this.from,this.to,n)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(e,n)=>{e.isInline&&e.isAtom&&this.mark.isInSet(e.marks)&&kt(Dt,Math.max(this.from,n),Math.min(this.to,n+e.nodeSize),this.mark,t)}),t.length==1?t[0]:new At(t)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};x.jsonID(`removeMark`,Ot);function kt(e,t,n,r,i){let a=i.length?i[i.length-1]:null;a&&a instanceof e&&a.to==t&&a.mark.eq(r)?i[i.length-1]=new e(a.from,n,r):i.push(new e(t,n,r))}var At=class e extends x{constructor(e){super(),this.steps=e}apply(e){for(let t of this.steps){let n=t.apply(e);if(!n.doc)return n;e=n.doc}return new S(e,null)}invert(t){return new e(this.steps.map(e=>e.invert(t)))}map(t){let n=[];for(let e of this.steps){let r=e.map(t);r&&n.push(r)}return n.length?new e(n):null}toJSON(){return{stepType:`markSet`,steps:this.steps.map(e=>e.toJSON())}}static fromJSON(t,n){if(!Array.isArray(n.steps)||!n.steps.every(e=>e.stepType==`addMark`||e.stepType==`removeMark`))throw RangeError(`Invalid JSON for MarkSetStep`);return new e(n.steps.map(e=>x.fromJSON(t,e)))}};x.jsonID(`markSet`,At);var jt=class e extends x{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return S.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return S.fromReplace(e,this.pos,this.pos+1,new y(p.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Mt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};x.jsonID(`addNodeMark`,jt);var Mt=class e extends x{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return S.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return S.fromReplace(e,this.pos,this.pos+1,new y(p.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new jt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};x.jsonID(`removeNodeMark`,Mt);var C=class e extends x{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Nt(e,this.from,this.to)?S.fail(`Structure replace would overwrite content`):S.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ct([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?y.empty:new y(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?y.empty:new y(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,y.fromJSON(t,n.slice),!!n.structure)}};C.MAP_BIAS=1,x.jsonID(`replace`,C);var w=class e extends x{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Nt(e,this.from,this.gapFrom)||Nt(e,this.gapTo,this.to)))return S.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return S.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?S.fromReplace(e,this.from,this.to,n):S.fail(`Content does not fit in gap`)}getMap(){return new Ct([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,y.fromJSON(t,n.slice),n.insert,!!n.structure)}};x.jsonID(`replaceAround`,w);function Nt(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Pt(e,t,n,r){let i=[];e.doc.nodesBetween(t,n,(e,a,o)=>{if(!e.isInline)return;let s=e.marks;!r.isInSet(s)&&o.type.allowsMarkType(r.type)&&kt(Dt,Math.max(a,t),Math.min(a+e.nodeSize,n),r,i)}),i.forEach(t=>e.step(t))}function Ft(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline||!e.isAtom)return;a++;let s=null;if(r instanceof Ve){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Ot(t.from,t.to,t.style)))}function It(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new C(s,l,y.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Ot(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new y(p.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new C(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(p.empty,!0);e.replace(s,s,new y(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Lt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Rt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Lt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function zt(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=p.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=p.from(r.node(e).copy(u)),d++):c--;let f=p.empty,m=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=p.from(i.node(e).copy(f)),m++):l++;e.step(new w(c,l,o,s,new y(u.append(f),d,m),u.size-d,!0))}function Bt(e,t,n=null,r=e){let i=Ht(e,t),a=i&&Ut(r,t);return a?i.map(Vt).concat({type:t,attrs:n}).concat(a.map(Vt)):null}function Vt(e){return{type:e,attrs:null}}function Ht(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Ut(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Wt(e,t,n){let r=p.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=p.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new w(i,a,i,a,new y(r,0,0),n.length,!0))}function Gt(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Jt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&qt(e,t,n,a),It(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new w(c,l,c+1,l-1,new y(p.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Kt(e,t,n,a),!1}})}function Kt(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function qt(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
@@ -1,2 +1,2 @@
1
- import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{$n as n,$t as r,Bt as i,F as a,Gt as o,Ht as s,I as c,It as l,Kt as u,L as d,Lt as f,Nt as p,Ot as m,Qt as h,R as g,Rt as _,Ut as v,Yt as y,a as b,an as x,fn as S,i as C,in as w,n as T,nn as E,on as D,r as O,rn as k,s as ee,x as A,z as te,zt as ne}from"./react-C_-rEEBU.js";import{C as j,E as re,F as ie,M as ae,N as oe,O as se,T as ce,a as le,i as ue,j as de,k as fe,n as pe,w as me}from"./dist-CTQIm8Im.js";import{p as he}from"./index-CFt3ovRY.js";var ge=E(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),_e=E(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),M=E(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),N=E(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),ve=E(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),P=t(n(),1),F=k(),I=Object.defineProperty,L=(e,t)=>I(e,`name`,{value:t,configurable:!0}),[R,ye]=s(`Tooltip`,[te]),z=te(),be=`TooltipProvider`,B=700,V=`tooltip.open`,[xe,H]=R(be),Se=L(e=>{let{__scopeTooltip:t,delayDuration:n=B,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(xe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),U=`Tooltip`,[Ce,W]=R(U),we=L(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,u=H(U,e.__scopeTooltip),d=z(t),[f,p]=P.useState(null),[m,h]=P.useState(void 0),g=l(),v=P.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,x=P.useRef(!1),[S,C]=_({prop:r,defaultProp:i??!1,onChange:L(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(V))):u.onClose(),o?.(e)},`onChange`),caller:U}),w=P.useMemo(()=>S?x.current?`delayed-open`:`instant-open`:`closed`,[S]),T=P.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x.current=!1,C(!0)},[C]),E=P.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C(!1)},[C]),D=P.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,C(!0),v.current=0},b)},[b,C]);P.useEffect(()=>()=>{v.current&&=(window.clearTimeout(v.current),0)},[]);let O=m??g;return(0,F.jsx)(a,{...d,children:(0,F.jsx)(Ce,{scope:t,contentId:O,setContentId:h,open:S,stateAttribute:w,trigger:f,onTriggerChange:p,onTriggerEnter:P.useCallback(()=>{u.isOpenDelayedRef.current?D():T()},[u.isOpenDelayedRef,D,T]),onTriggerLeave:P.useCallback(()=>{y?E():(window.clearTimeout(v.current),v.current=0)},[E,y]),onOpen:T,onClose:E,disableHoverableContent:y,children:n})})},`Tooltip`),Te=`TooltipTrigger`,Ee=P.forwardRef(L(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...a}=e,o=W(Te,n),s=H(Te,n),l=z(n),d=P.useRef(null),f=u(t,d,o.onTriggerChange),p=P.useRef(!1),m=P.useRef(!1),h=P.useCallback(()=>p.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener(`pointerup`,h),[h]),(0,F.jsx)(c,{asChild:!0,...l,children:(0,F.jsx)(v.button,{"aria-describedby":o.open?Be(r,o.contentId):r,"data-state":o.stateAttribute,...a,ref:f,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener(`pointerup`,h,{once:!0})}),onFocus:i(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})},`TooltipTrigger`)),De=`TooltipPortal`,[Oe,G]=R(De,{forceMount:void 0}),ke=L(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=W(De,t);return(0,F.jsx)(Oe,{scope:t,forceMount:n,children:(0,F.jsx)(f,{present:n||a.open,children:(0,F.jsx)(m,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),K=`TooltipContent`,Ae=P.forwardRef(L(function(e,t){let n=G(K,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=W(K,e.__scopeTooltip);return(0,F.jsx)(f,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(Me,{side:i,...a,ref:t}):(0,F.jsx)(je,{side:i,...a,ref:t})})},`TooltipContent`)),je=P.forwardRef(L(function(e,t){let n=W(K,e.__scopeTooltip),r=H(K,e.__scopeTooltip),i=P.useRef(null),a=u(t,i),[o,s]=P.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=P.useCallback(()=>{s(null),f(!1)},[f]),m=P.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Fe(r,Pe(r,n.getBoundingClientRect())),a=Ie(t.getBoundingClientRect()),o=Re([...i,...a]);s(o),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(c&&d){let e=L(e=>m(e,d),`handleTriggerLeave`),t=L(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),P.useEffect(()=>{if(o){let e=L(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!Le(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,F.jsx)(Me,{...e,ref:a})},`TooltipContentHoverable`)),q=o(`TooltipContent`),Me=P.forwardRef(L(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=W(K,n),u=z(n),{onClose:d}=l;P.useEffect(()=>(document.addEventListener(V,d),()=>document.removeEventListener(V,d)),[d]),P.useEffect(()=>{if(l.trigger){let e=L(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return ne(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,F.jsx)(p,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,F.jsxs)(g,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(q,{children:r}),i?(0,F.jsx)(fe,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Ne=P.forwardRef(L(function(e,t){let{__scopeTooltip:n,...r}=e,i=z(n);return(0,F.jsx)(d,{...i,...r,ref:t})},`TooltipArrow`));function Pe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}L(Pe,`getExitSideFromRect`);function Fe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}L(Fe,`getPaddedExitPoints`);function Ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}L(Ie,`getPointsFromRect`);function Le(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}L(Le,`isPointInPolygon`);function Re(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ze(t)}L(Re,`getHull`);function ze(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}L(ze,`getHullPresorted`);function Be(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}L(Be,`concatAriaDescribedby`);function Ve({className:e,...t}){return(0,F.jsx)(`span`,{className:y(`text-muted-foreground font-mono text-micro leading-4 font-normal tracking-label uppercase`,e),...t})}function He({label:e,count:t=4,size:n=10,className:r}){return(0,F.jsx)(`span`,{role:`status`,"aria-label":e,className:y(`inline-flex items-end gap-[3px]`,r),children:Array.from({length:t},(e,t)=>(0,F.jsx)(`span`,{className:`bg-foreground animate-squares-drop block`,style:{width:n,height:n,animationDelay:`${String(t*120)}ms`}},t))})}function Ue({title:e,children:t,action:n,className:r}){return(0,F.jsxs)(`div`,{className:y(`animate-set-in flex flex-col items-center gap-5 px-6 py-16 text-center`,r),children:[(0,F.jsxs)(`div`,{className:`flex max-w-sm flex-col gap-1.5`,children:[(0,F.jsx)(`h2`,{className:`font-serif text-heading font-semibold`,children:e}),t?(0,F.jsx)(`div`,{className:`text-muted-foreground text-sm leading-relaxed`,children:t}):null]}),n]})}var We=e=>Number.isFinite(e)&&e>0?e:0,J=e=>{let t=We(e);return`${String(Math.floor(t/60))}:${String(Math.floor(t%60)).padStart(2,`0`)}`},Y=e=>{let t=We(e);return`${String(Math.floor(t/60))}:${(t%60).toFixed(1).padStart(4,`0`)}`},Ge=(e,t)=>Math.floor(e*t+1e-9)/t,Ke=e=>e.split(/[/\\]/u).at(-1)??e,qe={loading:`Vorschau wird geladen`,loadFailed:`Die Vorschau wurde nicht geladen`,noVideo:`Das ist kein Video`,previewTitle:`Vorschau`,denoising:`Sprache wird entrauscht; Wiedergabe wie aufgenommen`,uncut:e=>`Noch keine Personenmaske für ${e}: Ebenen hinter der Person erscheinen davor`,play:`Abspielen`,pause:`Pause`,seek:`Springen`,prevPage:`Vorherige Seite`,nextPage:`Nächste Seite`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,timeOf:(e,t,n)=>`${e} von ${t}${n?`, ${n}`:``}`,hideTimeline:`Zeitleiste ausblenden`,showTimeline:`Zeitleiste einblenden`,rows:{scenes:`Szenen`,voice:`Sprache`,music:`Musik`,sound:`Ton`},noVoice:`Keine Sprache`,noMusic:`Keine Musik`,noCues:`Keine Soundeffekte`,ducked:`unter Sprache abgesenkt`,version:`Sprache`,close:`Schließen`,previewFailed:`Mit diesem Video ist etwas schiefgelaufen.`,previewFailedKept:`Bei der letzten Änderung ist etwas schiefgelaufen. Das ist die letzte Version, die funktioniert hat.`,problemsHere:e=>e===1?`1 Problem in dieser Version`:`${String(e)} Probleme in dieser Version`,levelError:`Muss behoben werden`,levelWarn:`Vorschlag`},Je={loading:`Loading the preview`,loadFailed:`The preview did not load`,noVideo:`This is not a video`,previewTitle:`Preview`,denoising:`Denoising the speech; playing it as recorded`,uncut:e=>`No person matte for ${e} yet: layers behind the person show in front`,play:`Play`,pause:`Pause`,seek:`Seek`,prevPage:`Previous page`,nextPage:`Next page`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,timeOf:(e,t,n)=>`${e} of ${t}${n?`, ${n}`:``}`,hideTimeline:`Hide timeline`,showTimeline:`Show timeline`,rows:{scenes:`Scenes`,voice:`Speech`,music:`Music`,sound:`Sound`},noVoice:`No speech`,noMusic:`No music`,noCues:`No sound cues`,ducked:`lowered under speech`,version:`Language`,close:`Close`,previewFailed:`Something went wrong with this video.`,previewFailedKept:`Something went wrong with the latest change. This is the last version that worked.`,problemsHere:e=>`${String(e)} problem${e===1?``:`s`} in this version`,levelError:`Must fix`,levelWarn:`Suggestion`},Ye={loading:`Cargando la vista previa`,loadFailed:`La vista previa no se cargó`,noVideo:`Esto no es un video`,previewTitle:`Vista previa`,denoising:`Reduciendo el ruido de la voz; se reproduce tal como se grabó`,uncut:e=>`Aún no hay máscara de persona para ${e}: las capas detrás de la persona se ven delante`,play:`Reproducir`,pause:`Pausa`,seek:`Buscar`,prevPage:`Página anterior`,nextPage:`Página siguiente`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar la línea de tiempo`,showTimeline:`Mostrar la línea de tiempo`,rows:{scenes:`Escenas`,voice:`Voz`,music:`Música`,sound:`Sonido`},noVoice:`Sin voz`,noMusic:`Sin música`,noCues:`Sin efectos de sonido`,ducked:`bajada bajo la voz`,version:`Idioma`,close:`Cerrar`,previewFailed:`Algo salió mal con este video.`,previewFailedKept:`Algo salió mal con el último cambio. Esta es la última versión que funcionó.`,problemsHere:e=>e===1?`1 problema en esta versión`:`${String(e)} problemas en esta versión`,levelError:`Corregir`,levelWarn:`Sugerencia`},Xe={loading:`Chargement de l’aperçu`,loadFailed:`L’aperçu ne s’est pas chargé`,noVideo:`Ce n’est pas une vidéo`,previewTitle:`Aperçu`,denoising:`Débruitage de la voix\xA0; lecture telle qu’enregistrée`,uncut:e=>`Pas encore de masque de personne pour ${e}\u00a0: les calques derrière la personne passent devant`,play:`Lire`,pause:`Pause`,seek:`Position`,prevPage:`Page précédente`,nextPage:`Page suivante`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,timeOf:(e,t,n)=>`${e} sur ${t}${n?`, ${n}`:``}`,hideTimeline:`Masquer la timeline`,showTimeline:`Afficher la timeline`,rows:{scenes:`Scènes`,voice:`Voix`,music:`Musique`,sound:`Son`},noVoice:`Pas de voix`,noMusic:`Pas de musique`,noCues:`Pas d’effets sonores`,ducked:`baissée sous la voix`,version:`Langue`,close:`Fermer`,previewFailed:`Un problème est survenu avec cette vidéo.`,previewFailedKept:`Un problème est survenu avec la dernière modification. Voici la dernière version qui fonctionnait.`,problemsHere:e=>e===1?`1 problème dans cette version`:`${String(e)} problèmes dans cette version`,levelError:`À corriger`,levelWarn:`Suggestion`},Ze=new Intl.PluralRules(`hi`),Qe=(e,t,n)=>`${String(e)} ${Ze.select(e)===`one`?t:n}`,$e={loading:`प्रीव्यू लोड हो रहा है`,loadFailed:`प्रीव्यू लोड नहीं हुआ`,noVideo:`यह वीडियो नहीं है`,previewTitle:`प्रीव्यू`,denoising:`आवाज़ से शोर हटाया जा रहा है; तब तक रिकॉर्डिंग जैसी है वैसी चल रही है`,uncut:e=>`${e} के लिए अभी पर्सन मैट नहीं है: व्यक्ति के पीछे वाली लेयर आगे दिखती हैं`,play:`चलाएँ`,pause:`रोकें`,seek:`आगे-पीछे करें`,prevPage:`पिछला पेज`,nextPage:`अगला पेज`,pageOf:(e,t)=>`पेज ${String(e)} / ${String(t)}`,timeOf:(e,t,n)=>`${t} में से ${e}${n?`, ${n}`:``}`,hideTimeline:`टाइमलाइन छिपाएँ`,showTimeline:`टाइमलाइन दिखाएँ`,rows:{scenes:`सीन`,voice:`आवाज़`,music:`संगीत`,sound:`साउंड`},noVoice:`कोई आवाज़ नहीं`,noMusic:`कोई संगीत नहीं`,noCues:`कोई साउंड इफ़ेक्ट नहीं`,ducked:`बोलते समय धीमा`,version:`भाषा`,close:`बंद करें`,previewFailed:`इस वीडियो में कुछ गड़बड़ हो गई।`,previewFailedKept:`सबसे नए बदलाव में कुछ गड़बड़ हो गई। यह आखिरी चलने वाला वर्शन है।`,problemsHere:e=>`इस वर्शन में ${Qe(e,`समस्या`,`समस्याएँ`)}`,levelError:`ठीक करना ज़रूरी`,levelWarn:`सुझाव`},et={loading:`Caricamento dell'anteprima`,loadFailed:`L'anteprima non si è caricata`,noVideo:`Questo non è un video`,previewTitle:`Anteprima`,denoising:`Riduzione del rumore della voce; riprodotta così come è stata registrata`,uncut:e=>`Ancora nessuna maschera della persona per ${e}: i livelli dietro la persona appaiono davanti`,play:`Riproduci`,pause:`Pausa`,seek:`Vai a`,prevPage:`Pagina precedente`,nextPage:`Pagina successiva`,pageOf:(e,t)=>`Pagina ${String(e)} di ${String(t)}`,timeOf:(e,t,n)=>`${e} di ${t}${n?`, ${n}`:``}`,hideTimeline:`Nascondi la timeline`,showTimeline:`Mostra la timeline`,rows:{scenes:`Scene`,voice:`Voce`,music:`Musica`,sound:`Suono`},noVoice:`Nessuna voce`,noMusic:`Nessuna musica`,noCues:`Nessun effetto sonoro`,ducked:`abbassata sotto la voce`,version:`Lingua`,close:`Chiudi`,previewFailed:`Qualcosa è andato storto con questo video.`,previewFailedKept:`Qualcosa è andato storto con l'ultima modifica. Questa è l'ultima versione che funzionava.`,problemsHere:e=>e===1?`1 problema in questa versione`:`${String(e)} problemi in questa versione`,levelError:`Da correggere`,levelWarn:`Suggerimento`},tt={loading:`プレビューを読み込み中`,loadFailed:`プレビューを読み込めませんでした`,noVideo:`これは動画ではありません`,previewTitle:`プレビュー`,denoising:`音声のノイズを除去中。録音のまま再生しています`,uncut:e=>`${e} の人物マットはまだありません。人物の後ろのレイヤーが前に表示されます`,play:`再生`,pause:`一時停止`,seek:`再生位置`,prevPage:`前のページ`,nextPage:`次のページ`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,timeOf:(e,t,n)=>`${e} / ${t}${n?`、${n}`:``}`,hideTimeline:`タイムラインを隠す`,showTimeline:`タイムラインを表示`,rows:{scenes:`シーン`,voice:`音声`,music:`音楽`,sound:`効果音`},noVoice:`音声なし`,noMusic:`音楽なし`,noCues:`効果音なし`,ducked:`音声の間は音量を下げる`,version:`言語`,close:`閉じる`,previewFailed:`この動画で問題が起きました。`,previewFailedKept:`最新の変更で問題が起きました。これは最後に正しく動いたバージョンです。`,problemsHere:e=>`このバージョンに ${String(e)} 件の問題`,levelError:`要修正`,levelWarn:`提案`},nt={loading:`미리보기를 불러오는 중`,loadFailed:`미리보기를 불러오지 못했습니다`,noVideo:`동영상이 아닙니다`,previewTitle:`미리보기`,denoising:`음성의 잡음을 제거하는 중입니다. 녹음된 그대로 재생합니다`,uncut:e=>`${e}의 인물 매트가 아직 없습니다. 인물 뒤 레이어가 앞에 보입니다`,play:`재생`,pause:`일시정지`,seek:`재생 위치`,prevPage:`이전 페이지`,nextPage:`다음 페이지`,pageOf:(e,t)=>`${String(t)}페이지 중 ${String(e)}페이지`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`타임라인 숨기기`,showTimeline:`타임라인 보기`,rows:{scenes:`장면`,voice:`음성`,music:`음악`,sound:`사운드`},noVoice:`음성 없음`,noMusic:`음악 없음`,noCues:`효과음 없음`,ducked:`음성 아래로 낮춤`,version:`언어`,close:`닫기`,previewFailed:`이 동영상에 문제가 생겼습니다.`,previewFailedKept:`최근 변경에서 문제가 생겼습니다. 마지막으로 정상 작동한 버전입니다.`,problemsHere:e=>`이 버전의 문제 ${String(e)}개`,levelError:`수정 필요`,levelWarn:`제안`},rt={loading:`Carregando a prévia`,loadFailed:`A prévia não carregou`,noVideo:`Isto não é um vídeo`,previewTitle:`Prévia`,denoising:`Removendo o ruído da fala; tocando como foi gravada`,uncut:e=>`Ainda não há máscara de pessoa para ${e}: as camadas atrás da pessoa aparecem na frente`,play:`Reproduzir`,pause:`Pausar`,seek:`Posição`,prevPage:`Página anterior`,nextPage:`Próxima página`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar a linha do tempo`,showTimeline:`Mostrar a linha do tempo`,rows:{scenes:`Cenas`,voice:`Fala`,music:`Música`,sound:`Som`},noVoice:`Sem fala`,noMusic:`Sem música`,noCues:`Sem efeitos sonoros`,ducked:`abaixada sob a fala`,version:`Idioma`,close:`Fechar`,previewFailed:`Algo deu errado com este vídeo.`,previewFailedKept:`Algo deu errado com a última alteração. Esta é a última versão que funcionou.`,problemsHere:e=>e===1?`1 problema nesta versão`:`${String(e)} problemas nesta versão`,levelError:`Corrigir`,levelWarn:`Sugestão`},it=new Intl.PluralRules(`ru`),at=(e,t,n,r)=>{let i=it.select(e);return`${String(e)} ${i===`one`?t:i===`many`?r:n}`},ot=x({en:Je,"zh-cn":{loading:`正在加载预览`,loadFailed:`预览没能加载`,noVideo:`这不是视频`,previewTitle:`预览`,denoising:`正在降噪,先播原声`,uncut:e=>`${e} 还没有人像遮罩:人物后面的图层暂时画在人物前面`,play:`播放`,pause:`暂停`,seek:`进度`,prevPage:`上一页`,nextPage:`下一页`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收起时间线`,showTimeline:`展开时间线`,rows:{scenes:`分段`,voice:`说话`,music:`音乐`,sound:`音效`},noVoice:`没有人说话`,noMusic:`没有音乐`,noCues:`没有音效`,ducked:`有人说话时压低`,version:`语言`,close:`关闭`,previewFailed:`这个视频出了点问题。`,previewFailedKept:`最新的改动出了点问题,这里是上一版正常的画面。`,problemsHere:e=>`这个版本有 ${String(e)} 个问题`,levelError:`必须改`,levelWarn:`建议`},"zh-tw":{loading:`正在載入預覽`,loadFailed:`預覽未能載入`,noVideo:`這不是影片`,previewTitle:`預覽`,denoising:`正在降噪,先播放原始錄音`,uncut:e=>`${e} 還沒有人像遮罩:人物後方的圖層暫時顯示在人物前面`,play:`播放`,pause:`暫停`,seek:`播放位置`,prevPage:`上一頁`,nextPage:`下一頁`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收合時間軸`,showTimeline:`展開時間軸`,rows:{scenes:`段落`,voice:`語音`,music:`音樂`,sound:`音效`},noVoice:`沒有語音`,noMusic:`沒有音樂`,noCues:`沒有音效`,ducked:`有語音時降低音量`,version:`語言`,close:`關閉`,previewFailed:`這部影片出了點問題。`,previewFailedKept:`最新的修改出了點問題,這裡是上一個正常的版本。`,problemsHere:e=>`這個版本有 ${String(e)} 個問題`,levelError:`必須修正`,levelWarn:`建議`},ja:tt,ko:nt,es:Ye,fr:Xe,de:qe,it:et,pt:rt,ru:{loading:`Загрузка предпросмотра`,loadFailed:`Предпросмотр не загрузился`,noVideo:`Это не видео`,previewTitle:`Предпросмотр`,denoising:`Шумоподавление речи; пока звучит исходная запись`,uncut:e=>`Для ${e} ещё нет маски человека: слои за человеком показаны перед ним`,play:`Воспроизвести`,pause:`Пауза`,seek:`Перемотка`,prevPage:`Предыдущая страница`,nextPage:`Следующая страница`,pageOf:(e,t)=>`Страница ${String(e)} из ${String(t)}`,timeOf:(e,t,n)=>`${e} из ${t}${n?`, ${n}`:``}`,hideTimeline:`Скрыть таймлайн`,showTimeline:`Показать таймлайн`,rows:{scenes:`Сцены`,voice:`Речь`,music:`Музыка`,sound:`Звук`},noVoice:`Нет речи`,noMusic:`Нет музыки`,noCues:`Нет звуковых эффектов`,ducked:`приглушено под речью`,version:`Язык`,close:`Закрыть`,previewFailed:`С этим видео что-то пошло не так.`,previewFailedKept:`С последним изменением что-то пошло не так. Это последняя рабочая версия.`,problemsHere:e=>`${at(e,`проблема`,`проблемы`,`проблем`)} в этой версии`,levelError:`Нужно исправить`,levelWarn:`Совет`},tr:{loading:`Önizleme yükleniyor`,loadFailed:`Önizleme yüklenmedi`,noVideo:`Bu bir video değil`,previewTitle:`Önizleme`,denoising:`Konuşmadaki gürültü temizleniyor; kaydedildiği gibi çalınıyor`,uncut:e=>`${e} için henüz kişi maskesi yok: kişinin arkasındaki katmanlar önde görünür`,play:`Oynat`,pause:`Duraklat`,seek:`Konum`,prevPage:`Önceki sayfa`,nextPage:`Sonraki sayfa`,pageOf:(e,t)=>`Sayfa ${String(e)} / ${String(t)}`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`Zaman çizelgesini gizle`,showTimeline:`Zaman çizelgesini göster`,rows:{scenes:`Sahneler`,voice:`Konuşma`,music:`Müzik`,sound:`Ses`},noVoice:`Konuşma yok`,noMusic:`Müzik yok`,noCues:`Ses efekti yok`,ducked:`konuşmanın altında kısıldı`,version:`Dil`,close:`Kapat`,previewFailed:`Bu videoda bir şeyler ters gitti.`,previewFailedKept:`Son değişiklikte bir şeyler ters gitti. Bu, çalışan son sürüm.`,problemsHere:e=>`Bu sürümde ${String(e)} sorun var`,levelError:`Düzeltilmeli`,levelWarn:`Öneri`},vi:{loading:`Đang tải bản xem trước`,loadFailed:`Không tải được bản xem trước`,noVideo:`Đây không phải video`,previewTitle:`Xem trước`,denoising:`Đang khử nhiễu giọng nói; tạm phát như bản thu gốc`,uncut:e=>`Chưa có mặt nạ người cho ${e}: các lớp phía sau người hiện ở phía trước`,play:`Phát`,pause:`Tạm dừng`,seek:`Tua`,prevPage:`Trang trước`,nextPage:`Trang sau`,pageOf:(e,t)=>`Trang ${String(e)}/${String(t)}`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`Ẩn dòng thời gian`,showTimeline:`Hiện dòng thời gian`,rows:{scenes:`Cảnh`,voice:`Lời nói`,music:`Nhạc`,sound:`Âm thanh`},noVoice:`Không có lời nói`,noMusic:`Không có nhạc`,noCues:`Không có hiệu ứng âm thanh`,ducked:`giảm âm lượng khi có lời nói`,version:`Ngôn ngữ`,close:`Đóng`,previewFailed:`Video này đã gặp sự cố.`,previewFailedKept:`Thay đổi mới nhất đã gặp sự cố. Đây là phiên bản chạy được gần nhất.`,problemsHere:e=>`${String(e)} vấn đề trong phiên bản này`,levelError:`Cần sửa`,levelWarn:`Gợi ý`},th:{loading:`กำลังโหลดตัวอย่าง`,loadFailed:`โหลดตัวอย่างไม่สำเร็จ`,noVideo:`นี่ไม่ใช่วิดีโอ`,previewTitle:`ตัวอย่าง`,denoising:`กำลังลดเสียงรบกวนของเสียงพูด ระหว่างนี้จะเล่นตามที่บันทึกไว้`,uncut:e=>`ยังไม่มีมาสก์บุคคลสำหรับ ${e}: เลเยอร์ที่อยู่หลังบุคคลจะแสดงอยู่ด้านหน้า`,play:`เล่น`,pause:`หยุดชั่วคราว`,seek:`เลื่อนตำแหน่ง`,prevPage:`หน้าก่อนหน้า`,nextPage:`หน้าถัดไป`,pageOf:(e,t)=>`หน้า ${String(e)} จาก ${String(t)}`,timeOf:(e,t,n)=>`${e} จาก ${t}${n?`, ${n}`:``}`,hideTimeline:`ซ่อนไทม์ไลน์`,showTimeline:`แสดงไทม์ไลน์`,rows:{scenes:`ฉาก`,voice:`เสียงพูด`,music:`เพลง`,sound:`เสียง`},noVoice:`ไม่มีเสียงพูด`,noMusic:`ไม่มีเพลง`,noCues:`ไม่มีเอฟเฟกต์เสียง`,ducked:`ลดเสียงลงขณะมีเสียงพูด`,version:`ภาษา`,close:`ปิด`,previewFailed:`วิดีโอนี้เกิดข้อผิดพลาด`,previewFailedKept:`การเปลี่ยนแปลงล่าสุดเกิดข้อผิดพลาด นี่คือเวอร์ชันล่าสุดที่ใช้ได้`,problemsHere:e=>`มีปัญหา ${String(e)} รายการในเวอร์ชันนี้`,levelError:`ต้องแก้ไข`,levelWarn:`คำแนะนำ`},hi:$e});function X(){return ot.of(O()?.locale)}function st(e,t,n){let r=T(),[i,a]=(0,P.useState)(),o=JSON.stringify([e,t,...n]);return(0,P.useEffect)(()=>{if(t===void 0)return;let n=!0;return S(r,e,t).then(e=>{n&&a({key:o,data:e})},e=>{n&&a({key:o,error:e instanceof Error?e:Error(String(e))})}),()=>{n=!1}},[r,o]),{data:i?.data,error:i?.key===o?i.error:void 0}}function ct(){let[e,t]=(0,P.useState)(0);return C(`project/changed`,e=>{t(e.revision)}),e}function lt(){let e=T(),[t,n]=(0,P.useState)();return(0,P.useEffect)(()=>{let t=!0;return S(e,`check/results`,{}).then(e=>{t&&n(t=>t??e)},()=>void 0),()=>{t=!1}},[e]),C(`check/changed`,n),t}function ut(e,t){let n=T(),[r,i]=(0,P.useState)();(0,P.useEffect)(()=>{let r=!0;return n[`storage/get`]({key:e}).then(n=>{r&&i({key:e,value:n.value===null?t:n.value})},()=>{r&&i({key:e,value:t})}),()=>{r=!1}},[n,e]);let a=(0,P.useCallback)(t=>{i({key:e,value:t}),n[`storage/set`]({key:e,value:t}).catch(()=>void 0)},[n,e]);return[r?.key===e?r.value:void 0,a]}async function dt(e,t){try{return(await e[`files/url`]({path:t})).url}catch{return}}function ft(e,t){return e.versions.find(e=>e.key===t)??e.versions[0]}function pt(e,t,n){return e.filter(e=>e.piece===t&&(e.combo===void 0||n.lang===void 0||e.combo.lang===n.lang))}function mt(e,t){try{return new Intl.DisplayNames([t],{type:`language`}).of(e)??e}catch{return e}}function ht(e){if(typeof e==`object`&&e&&e.allyhub===!0&&typeof e.type==`string`)return e}function gt(e,t){e?.postMessage({allyhub:!0,...t},`*`)}function _t({delayDuration:e=0,...t}){return(0,F.jsx)(Se,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function vt({...e}){return(0,F.jsx)(we,{"data-slot":`tooltip`,...e})}function yt({...e}){return(0,F.jsx)(Ee,{"data-slot":`tooltip-trigger`,...e})}function bt({className:e,sideOffset:t=0,children:n,...r}){return(0,F.jsx)(ke,{children:(0,F.jsxs)(Ae,{"data-slot":`tooltip-content`,sideOffset:t,className:y(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,F.jsx)(Ne,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function xt(e,t,n,r=4){let i=e.map(({x:e,width:n},r)=>{let i=e+n>t&&e-n>=0?`before`:`after`;return i===`after`?{i:r,side:i,from:e,to:e+n}:{i:r,side:i,from:e-n,to:e}}),a=[],o=e.map(()=>null);for(let e of[...i].sort((e,t)=>e.from-t.from||e.i-t.i)){let t=0;for(;t<n&&(a[t]??-1/0)+r>e.from;)t++;t!==n&&(a[t]=e.to,o[e.i]={lane:t,side:e.side})}return o}var St=.01,Ct=new Map;async function wt(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.arrayBuffer(),r=await new OfflineAudioContext(1,1,44100).decodeAudioData(n),i=r.sampleRate/50,a=Math.ceil(r.length/i),o=new Float32Array(a),s=0;for(let e=0;e<r.numberOfChannels;e++){let t=r.getChannelData(e);for(let e=0;e<a;e++){let n=Math.min(t.length,Math.floor((e+1)*i)),r=o[e]??0;for(let a=Math.floor(e*i);a<n;a++){let e=Math.abs(t[a]??0);e>r&&(r=e)}o[e]=r,r>s&&(s=r)}}if(s<St)return;let c=Float32Array.from(o).sort(),l=c[Math.floor(c.length*.95)]??s;return{duration:r.duration,data:o,max:l>0?l:s}}catch{return}}function Tt(e){let t=Ct.get(e);return t||(t=wt(e),Ct.set(e,t)),t}function Et(e){let[t,n]=(0,P.useState)();(0,P.useEffect)(()=>{if(e===void 0)return;let t=!0;return Tt(e).then(r=>{t&&n({url:e,peaks:r})}),()=>{t=!1}},[e]);let r=t?.url===e?t:void 0;return{peaks:r?.peaks,settled:e===void 0||r!==void 0}}function Dt(e,t,n){let r=Math.max(0,Math.floor(t*50)),i=Math.min(e.data.length,Math.max(r+1,Math.ceil(n*50))),a=0;for(let t=r;t<i;t++){let n=e.data[t]??0;n>a&&(a=n)}return a}function Ot(e,t){if(e.length===0)return 0;let n=e[0];if(!n||t<=n.t)return n?.db??0;for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];if(r&&i&&t<=i.t)return i.t===r.t?i.db:r.db+(i.db-r.db)*(t-r.t)/(i.t-r.t)}return e.at(-1)?.db??0}function kt(e,t,n){let r=new Map(t.map(e=>[e.key,e])),i=e.parts.flatMap(e=>{let t=e.speech;if(!t)return[];let n=r.get(e.key);return[{...n?.speechKey===void 0?{}:{key:n.speechKey},part:e.key,start:t.start,end:t.end,text:n?.spoken??``,file:t.file,from:t.from,speed:t.speed??1,...t.cuts?{cuts:t.cuts}:{}}]}),a=n?.music,o;if(a&&a.segments.length>0){let t=a.segments[0],n=a.segments.at(-1),r=Math.min(e.duration,a.until??(n?n.at+n.dur:e.duration)),i=[];for(let e=1;e<a.duck.length;e++){let t=a.duck[e-1],n=a.duck[e];if(t&&n&&t.db<0&&n.db<0){let e=i.at(-1);e&&Math.abs(e.end-t.t)<1e-9?e.end=n.t:i.push({start:t.t,end:n.t})}}o={file:a.file,start:t?.at??0,end:r,stretches:a.segments.map(e=>({at:e.at,from:e.from,dur:e.dur})),ducked:i,duck:a.duck,fadeIn:a.fadeIn,fadeOut:a.fadeOut}}return{cues:e.cues,speech:i,music:o}}function At(e,t){if(t<e.start||t>=e.end)return;let n=e.start,r=e.from;for(let i of e.cuts??[]){if(i.at>t)break;n=i.at,r=i.from}return r+(t-n)*e.speed}function jt(e,t){for(let n=e.stretches.length-1;n>=0;n--){let r=e.stretches[n];if(r&&t>=r.at&&t<r.at+r.dur)return r.from+(t-r.at)}}function Mt(e,t){let n=10**(Ot(e.duck,t)/20);return e.fadeIn>0&&t-e.start<e.fadeIn&&(n*=Math.max(0,t-e.start)/e.fadeIn),e.fadeOut>0&&e.end-t<e.fadeOut&&(n*=Math.max(0,e.end-t)/e.fadeOut),Math.max(0,n)}function Nt(e){let t=new Set((e.index??[]).filter(e=>e.matte).map(e=>e.file));return e.parts.flatMap(n=>{let r=(e.footage??[]).find(e=>e.part===n.key&&t.has(e.file));return r?[{part:n.key,file:r.file}]:[]})}var Pt={scenes:`text-track-scene`,voice:`text-track-voice`,music:`text-track-music`,sound:`text-track-sound`},Z={ruler:20,scenes:36,voice:40,music:32,sound:28};function Ft(e){return Z.ruler+1+Z.scenes+1+e.reduce((e,t)=>e+Z[t]+1,0)}var It=6;function Lt(e,t){let n=e=>e.join(` `).replace(/\s+([.,!?;:。,!?;:、])/g,`$1`).trim(),[r,...i]=e;if(r===t&&i.length>0){let e=n(i);if(/^[^a-z]/.test(e))return e}return n(e)}function Rt(e){return e<=60?{minor:1,major:5}:e<=180?{minor:1,major:10}:e<=600?{minor:5,major:30}:e<=1800?{minor:10,major:60}:{minor:60,major:300}}var Q=(e,t)=>`${String(e/Math.max(t,1e-6)*100)}%`;function zt({title:e,mono:t=!1,time:n,line:r,children:i}){return(0,F.jsxs)(vt,{children:[(0,F.jsx)(yt,{asChild:!0,children:i}),(0,F.jsx)(bt,{side:`top`,sideOffset:6,className:`max-w-[20rem]`,children:(0,F.jsxs)(`span`,{className:`flex flex-col gap-0.5 text-left`,children:[(0,F.jsx)(`span`,{className:y(t&&`font-mono text-micro`),children:e}),(0,F.jsx)(`span`,{className:`font-mono text-micro tabular-nums opacity-70`,children:n}),r?(0,F.jsx)(`span`,{className:`opacity-80`,children:r}):null]})})]})}function Bt(e){let t=T(),[n,r]=(0,P.useState)();return(0,P.useEffect)(()=>{let n=!0;return dt(t,e).then(t=>{n&&r({file:e,url:t})}),()=>{n=!1}},[t,e]),n?.file===e?n.url:void 0}function Vt({file:e,from:t,to:n,sample:r,alpha:i,className:a}){let o=(0,P.useRef)(null),{peaks:s,settled:c}=Et(Bt(e)),[l,u]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{let e=o.current;if(!e||!s)return;let a=()=>{let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),c=Math.round(e.clientHeight*a);if(!o||!c)return;e.width=o,e.height=c;let l=e.getContext(`2d`);if(!l)return;l.fillStyle=getComputedStyle(e).color,l.globalAlpha=i;let d=1/Math.max(s.max,.05),f=n-t,p=c-2*Math.round(2*a);for(let e=0;e<o;e+=2){let n=r(t+e/o*f);if(!n)continue;let i=Dt(s,n.at,n.at+2/o*f)*d*n.gain,a=Math.max(1,Math.round(Math.min(1,i)**Ht*p));l.fillRect(e,Math.round((c-a)/2),1,a)}u(!0)};a();let c=new ResizeObserver(a);c.observe(e);let l=new MutationObserver(a);return l.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{c.disconnect(),l.disconnect()}},[s,t,n,r,i]),(0,F.jsx)(`canvas`,{ref:o,"aria-hidden":!0,"data-wave":l?`ready`:c?`none`:`pending`,className:y(`pointer-events-none absolute inset-0 size-full opacity-0 transition-opacity data-[wave=ready]:opacity-100`,a)})}var Ht=.7,Ut=`focus-visible:outline-ring absolute inset-y-1 overflow-hidden rounded-xs border focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`;function Wt({line:e,duration:t,onSeek:n}){let r=(0,P.useCallback)(t=>{let n=At(e,t);return n===void 0?void 0:{at:n,gain:1}},[e]);return(0,F.jsx)(zt,{title:e.text,time:`${Y(e.start)} – ${Y(e.end)} · ${Ke(e.file)}`,children:(0,F.jsxs)(`button`,{type:`button`,"data-sentence":e.key??e.part,"data-start":e.start.toFixed(4),className:y(Ut,`bg-track-voice/15 border-track-voice/60 hover:bg-track-voice/25 text-left`),style:{left:Q(e.start,t),width:Q(e.end-e.start,t)},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{n(e.start)},children:[(0,F.jsx)(`span`,{className:`absolute inset-x-1.5 top-0 block h-[14px] truncate text-micro leading-[14px]`,children:e.text}),(0,F.jsx)(`span`,{className:`absolute inset-x-0 top-[14px] bottom-0`,children:(0,F.jsx)(Vt,{file:e.file,from:e.start,to:e.end,sample:r,alpha:.7,className:`text-track-voice`})})]})})}var Gt=2,Kt=.75;function qt({parts:e,duration:t}){let n=(0,P.useRef)(null),r=(0,P.useRef)(new Map),[i,a]=(0,P.useState)(0),[o,s]=(0,P.useState)(()=>new Map),c=e.flatMap(e=>(e.anchors??[]).map(t=>({id:`${e.key}@${t.name}`,part:e.key,anchor:t}))),l=c.map(e=>e.id).join(`
1
+ import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{$n as n,$t as r,Bt as i,F as a,Gt as o,Ht as s,I as c,It as l,Kt as u,L as d,Lt as f,Nt as p,Ot as m,Qt as h,R as g,Rt as _,Ut as v,Yt as y,a as b,an as x,fn as S,i as C,in as w,n as T,nn as E,on as D,r as O,rn as k,s as ee,x as A,z as te,zt as ne}from"./react-CT8OUeCe.js";import{C as j,E as re,F as ie,M as ae,N as oe,O as se,T as ce,a as le,i as ue,j as de,k as fe,n as pe,w as me}from"./dist-ClE1xUdI.js";import{p as he}from"./index-CwDs3z43.js";var ge=E(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),_e=E(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),M=E(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),N=E(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),ve=E(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),P=t(n(),1),F=k(),I=Object.defineProperty,L=(e,t)=>I(e,`name`,{value:t,configurable:!0}),[R,ye]=s(`Tooltip`,[te]),z=te(),be=`TooltipProvider`,B=700,V=`tooltip.open`,[xe,H]=R(be),Se=L(e=>{let{__scopeTooltip:t,delayDuration:n=B,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(xe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),U=`Tooltip`,[Ce,W]=R(U),we=L(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,u=H(U,e.__scopeTooltip),d=z(t),[f,p]=P.useState(null),[m,h]=P.useState(void 0),g=l(),v=P.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,x=P.useRef(!1),[S,C]=_({prop:r,defaultProp:i??!1,onChange:L(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(V))):u.onClose(),o?.(e)},`onChange`),caller:U}),w=P.useMemo(()=>S?x.current?`delayed-open`:`instant-open`:`closed`,[S]),T=P.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x.current=!1,C(!0)},[C]),E=P.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C(!1)},[C]),D=P.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,C(!0),v.current=0},b)},[b,C]);P.useEffect(()=>()=>{v.current&&=(window.clearTimeout(v.current),0)},[]);let O=m??g;return(0,F.jsx)(a,{...d,children:(0,F.jsx)(Ce,{scope:t,contentId:O,setContentId:h,open:S,stateAttribute:w,trigger:f,onTriggerChange:p,onTriggerEnter:P.useCallback(()=>{u.isOpenDelayedRef.current?D():T()},[u.isOpenDelayedRef,D,T]),onTriggerLeave:P.useCallback(()=>{y?E():(window.clearTimeout(v.current),v.current=0)},[E,y]),onOpen:T,onClose:E,disableHoverableContent:y,children:n})})},`Tooltip`),Te=`TooltipTrigger`,Ee=P.forwardRef(L(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...a}=e,o=W(Te,n),s=H(Te,n),l=z(n),d=P.useRef(null),f=u(t,d,o.onTriggerChange),p=P.useRef(!1),m=P.useRef(!1),h=P.useCallback(()=>p.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener(`pointerup`,h),[h]),(0,F.jsx)(c,{asChild:!0,...l,children:(0,F.jsx)(v.button,{"aria-describedby":o.open?Be(r,o.contentId):r,"data-state":o.stateAttribute,...a,ref:f,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener(`pointerup`,h,{once:!0})}),onFocus:i(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})},`TooltipTrigger`)),De=`TooltipPortal`,[Oe,G]=R(De,{forceMount:void 0}),ke=L(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=W(De,t);return(0,F.jsx)(Oe,{scope:t,forceMount:n,children:(0,F.jsx)(f,{present:n||a.open,children:(0,F.jsx)(m,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),K=`TooltipContent`,Ae=P.forwardRef(L(function(e,t){let n=G(K,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=W(K,e.__scopeTooltip);return(0,F.jsx)(f,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(Me,{side:i,...a,ref:t}):(0,F.jsx)(je,{side:i,...a,ref:t})})},`TooltipContent`)),je=P.forwardRef(L(function(e,t){let n=W(K,e.__scopeTooltip),r=H(K,e.__scopeTooltip),i=P.useRef(null),a=u(t,i),[o,s]=P.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=P.useCallback(()=>{s(null),f(!1)},[f]),m=P.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Fe(r,Pe(r,n.getBoundingClientRect())),a=Ie(t.getBoundingClientRect()),o=Re([...i,...a]);s(o),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(c&&d){let e=L(e=>m(e,d),`handleTriggerLeave`),t=L(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),P.useEffect(()=>{if(o){let e=L(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!Le(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,F.jsx)(Me,{...e,ref:a})},`TooltipContentHoverable`)),q=o(`TooltipContent`),Me=P.forwardRef(L(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=W(K,n),u=z(n),{onClose:d}=l;P.useEffect(()=>(document.addEventListener(V,d),()=>document.removeEventListener(V,d)),[d]),P.useEffect(()=>{if(l.trigger){let e=L(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return ne(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,F.jsx)(p,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,F.jsxs)(g,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(q,{children:r}),i?(0,F.jsx)(fe,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Ne=P.forwardRef(L(function(e,t){let{__scopeTooltip:n,...r}=e,i=z(n);return(0,F.jsx)(d,{...i,...r,ref:t})},`TooltipArrow`));function Pe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}L(Pe,`getExitSideFromRect`);function Fe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}L(Fe,`getPaddedExitPoints`);function Ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}L(Ie,`getPointsFromRect`);function Le(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}L(Le,`isPointInPolygon`);function Re(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ze(t)}L(Re,`getHull`);function ze(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}L(ze,`getHullPresorted`);function Be(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}L(Be,`concatAriaDescribedby`);function Ve({className:e,...t}){return(0,F.jsx)(`span`,{className:y(`text-muted-foreground font-mono text-micro leading-4 font-normal tracking-label uppercase`,e),...t})}function He({label:e,count:t=4,size:n=10,className:r}){return(0,F.jsx)(`span`,{role:`status`,"aria-label":e,className:y(`inline-flex items-end gap-[3px]`,r),children:Array.from({length:t},(e,t)=>(0,F.jsx)(`span`,{className:`bg-foreground animate-squares-drop block`,style:{width:n,height:n,animationDelay:`${String(t*120)}ms`}},t))})}function Ue({title:e,children:t,action:n,className:r}){return(0,F.jsxs)(`div`,{className:y(`animate-set-in flex flex-col items-center gap-5 px-6 py-16 text-center`,r),children:[(0,F.jsxs)(`div`,{className:`flex max-w-sm flex-col gap-1.5`,children:[(0,F.jsx)(`h2`,{className:`font-serif text-heading font-semibold`,children:e}),t?(0,F.jsx)(`div`,{className:`text-muted-foreground text-sm leading-relaxed`,children:t}):null]}),n]})}var We=e=>Number.isFinite(e)&&e>0?e:0,J=e=>{let t=We(e);return`${String(Math.floor(t/60))}:${String(Math.floor(t%60)).padStart(2,`0`)}`},Y=e=>{let t=We(e);return`${String(Math.floor(t/60))}:${(t%60).toFixed(1).padStart(4,`0`)}`},Ge=(e,t)=>Math.floor(e*t+1e-9)/t,Ke=e=>e.split(/[/\\]/u).at(-1)??e,qe={loading:`Vorschau wird geladen`,loadFailed:`Die Vorschau wurde nicht geladen`,noVideo:`Das ist kein Video`,previewTitle:`Vorschau`,denoising:`Sprache wird entrauscht; Wiedergabe wie aufgenommen`,uncut:e=>`Noch keine Personenmaske für ${e}: Ebenen hinter der Person erscheinen davor`,play:`Abspielen`,pause:`Pause`,seek:`Springen`,prevPage:`Vorherige Seite`,nextPage:`Nächste Seite`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,timeOf:(e,t,n)=>`${e} von ${t}${n?`, ${n}`:``}`,hideTimeline:`Zeitleiste ausblenden`,showTimeline:`Zeitleiste einblenden`,rows:{scenes:`Szenen`,voice:`Sprache`,music:`Musik`,sound:`Ton`},noVoice:`Keine Sprache`,noMusic:`Keine Musik`,noCues:`Keine Soundeffekte`,ducked:`unter Sprache abgesenkt`,version:`Sprache`,close:`Schließen`,previewFailed:`Mit diesem Video ist etwas schiefgelaufen.`,previewFailedKept:`Bei der letzten Änderung ist etwas schiefgelaufen. Das ist die letzte Version, die funktioniert hat.`,problemsHere:e=>e===1?`1 Problem in dieser Version`:`${String(e)} Probleme in dieser Version`,levelError:`Muss behoben werden`,levelWarn:`Vorschlag`},Je={loading:`Loading the preview`,loadFailed:`The preview did not load`,noVideo:`This is not a video`,previewTitle:`Preview`,denoising:`Denoising the speech; playing it as recorded`,uncut:e=>`No person matte for ${e} yet: layers behind the person show in front`,play:`Play`,pause:`Pause`,seek:`Seek`,prevPage:`Previous page`,nextPage:`Next page`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,timeOf:(e,t,n)=>`${e} of ${t}${n?`, ${n}`:``}`,hideTimeline:`Hide timeline`,showTimeline:`Show timeline`,rows:{scenes:`Scenes`,voice:`Speech`,music:`Music`,sound:`Sound`},noVoice:`No speech`,noMusic:`No music`,noCues:`No sound cues`,ducked:`lowered under speech`,version:`Language`,close:`Close`,previewFailed:`Something went wrong with this video.`,previewFailedKept:`Something went wrong with the latest change. This is the last version that worked.`,problemsHere:e=>`${String(e)} problem${e===1?``:`s`} in this version`,levelError:`Must fix`,levelWarn:`Suggestion`},Ye={loading:`Cargando la vista previa`,loadFailed:`La vista previa no se cargó`,noVideo:`Esto no es un video`,previewTitle:`Vista previa`,denoising:`Reduciendo el ruido de la voz; se reproduce tal como se grabó`,uncut:e=>`Aún no hay máscara de persona para ${e}: las capas detrás de la persona se ven delante`,play:`Reproducir`,pause:`Pausa`,seek:`Buscar`,prevPage:`Página anterior`,nextPage:`Página siguiente`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar la línea de tiempo`,showTimeline:`Mostrar la línea de tiempo`,rows:{scenes:`Escenas`,voice:`Voz`,music:`Música`,sound:`Sonido`},noVoice:`Sin voz`,noMusic:`Sin música`,noCues:`Sin efectos de sonido`,ducked:`bajada bajo la voz`,version:`Idioma`,close:`Cerrar`,previewFailed:`Algo salió mal con este video.`,previewFailedKept:`Algo salió mal con el último cambio. Esta es la última versión que funcionó.`,problemsHere:e=>e===1?`1 problema en esta versión`:`${String(e)} problemas en esta versión`,levelError:`Corregir`,levelWarn:`Sugerencia`},Xe={loading:`Chargement de l’aperçu`,loadFailed:`L’aperçu ne s’est pas chargé`,noVideo:`Ce n’est pas une vidéo`,previewTitle:`Aperçu`,denoising:`Débruitage de la voix\xA0; lecture telle qu’enregistrée`,uncut:e=>`Pas encore de masque de personne pour ${e}\u00a0: les calques derrière la personne passent devant`,play:`Lire`,pause:`Pause`,seek:`Position`,prevPage:`Page précédente`,nextPage:`Page suivante`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,timeOf:(e,t,n)=>`${e} sur ${t}${n?`, ${n}`:``}`,hideTimeline:`Masquer la timeline`,showTimeline:`Afficher la timeline`,rows:{scenes:`Scènes`,voice:`Voix`,music:`Musique`,sound:`Son`},noVoice:`Pas de voix`,noMusic:`Pas de musique`,noCues:`Pas d’effets sonores`,ducked:`baissée sous la voix`,version:`Langue`,close:`Fermer`,previewFailed:`Un problème est survenu avec cette vidéo.`,previewFailedKept:`Un problème est survenu avec la dernière modification. Voici la dernière version qui fonctionnait.`,problemsHere:e=>e===1?`1 problème dans cette version`:`${String(e)} problèmes dans cette version`,levelError:`À corriger`,levelWarn:`Suggestion`},Ze=new Intl.PluralRules(`hi`),Qe=(e,t,n)=>`${String(e)} ${Ze.select(e)===`one`?t:n}`,$e={loading:`प्रीव्यू लोड हो रहा है`,loadFailed:`प्रीव्यू लोड नहीं हुआ`,noVideo:`यह वीडियो नहीं है`,previewTitle:`प्रीव्यू`,denoising:`आवाज़ से शोर हटाया जा रहा है; तब तक रिकॉर्डिंग जैसी है वैसी चल रही है`,uncut:e=>`${e} के लिए अभी पर्सन मैट नहीं है: व्यक्ति के पीछे वाली लेयर आगे दिखती हैं`,play:`चलाएँ`,pause:`रोकें`,seek:`आगे-पीछे करें`,prevPage:`पिछला पेज`,nextPage:`अगला पेज`,pageOf:(e,t)=>`पेज ${String(e)} / ${String(t)}`,timeOf:(e,t,n)=>`${t} में से ${e}${n?`, ${n}`:``}`,hideTimeline:`टाइमलाइन छिपाएँ`,showTimeline:`टाइमलाइन दिखाएँ`,rows:{scenes:`सीन`,voice:`आवाज़`,music:`संगीत`,sound:`साउंड`},noVoice:`कोई आवाज़ नहीं`,noMusic:`कोई संगीत नहीं`,noCues:`कोई साउंड इफ़ेक्ट नहीं`,ducked:`बोलते समय धीमा`,version:`भाषा`,close:`बंद करें`,previewFailed:`इस वीडियो में कुछ गड़बड़ हो गई।`,previewFailedKept:`सबसे नए बदलाव में कुछ गड़बड़ हो गई। यह आखिरी चलने वाला वर्शन है।`,problemsHere:e=>`इस वर्शन में ${Qe(e,`समस्या`,`समस्याएँ`)}`,levelError:`ठीक करना ज़रूरी`,levelWarn:`सुझाव`},et={loading:`Caricamento dell'anteprima`,loadFailed:`L'anteprima non si è caricata`,noVideo:`Questo non è un video`,previewTitle:`Anteprima`,denoising:`Riduzione del rumore della voce; riprodotta così come è stata registrata`,uncut:e=>`Ancora nessuna maschera della persona per ${e}: i livelli dietro la persona appaiono davanti`,play:`Riproduci`,pause:`Pausa`,seek:`Vai a`,prevPage:`Pagina precedente`,nextPage:`Pagina successiva`,pageOf:(e,t)=>`Pagina ${String(e)} di ${String(t)}`,timeOf:(e,t,n)=>`${e} di ${t}${n?`, ${n}`:``}`,hideTimeline:`Nascondi la timeline`,showTimeline:`Mostra la timeline`,rows:{scenes:`Scene`,voice:`Voce`,music:`Musica`,sound:`Suono`},noVoice:`Nessuna voce`,noMusic:`Nessuna musica`,noCues:`Nessun effetto sonoro`,ducked:`abbassata sotto la voce`,version:`Lingua`,close:`Chiudi`,previewFailed:`Qualcosa è andato storto con questo video.`,previewFailedKept:`Qualcosa è andato storto con l'ultima modifica. Questa è l'ultima versione che funzionava.`,problemsHere:e=>e===1?`1 problema in questa versione`:`${String(e)} problemi in questa versione`,levelError:`Da correggere`,levelWarn:`Suggerimento`},tt={loading:`プレビューを読み込み中`,loadFailed:`プレビューを読み込めませんでした`,noVideo:`これは動画ではありません`,previewTitle:`プレビュー`,denoising:`音声のノイズを除去中。録音のまま再生しています`,uncut:e=>`${e} の人物マットはまだありません。人物の後ろのレイヤーが前に表示されます`,play:`再生`,pause:`一時停止`,seek:`再生位置`,prevPage:`前のページ`,nextPage:`次のページ`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,timeOf:(e,t,n)=>`${e} / ${t}${n?`、${n}`:``}`,hideTimeline:`タイムラインを隠す`,showTimeline:`タイムラインを表示`,rows:{scenes:`シーン`,voice:`音声`,music:`音楽`,sound:`効果音`},noVoice:`音声なし`,noMusic:`音楽なし`,noCues:`効果音なし`,ducked:`音声の間は音量を下げる`,version:`言語`,close:`閉じる`,previewFailed:`この動画で問題が起きました。`,previewFailedKept:`最新の変更で問題が起きました。これは最後に正しく動いたバージョンです。`,problemsHere:e=>`このバージョンに ${String(e)} 件の問題`,levelError:`要修正`,levelWarn:`提案`},nt={loading:`미리보기를 불러오는 중`,loadFailed:`미리보기를 불러오지 못했습니다`,noVideo:`동영상이 아닙니다`,previewTitle:`미리보기`,denoising:`음성의 잡음을 제거하는 중입니다. 녹음된 그대로 재생합니다`,uncut:e=>`${e}의 인물 매트가 아직 없습니다. 인물 뒤 레이어가 앞에 보입니다`,play:`재생`,pause:`일시정지`,seek:`재생 위치`,prevPage:`이전 페이지`,nextPage:`다음 페이지`,pageOf:(e,t)=>`${String(t)}페이지 중 ${String(e)}페이지`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`타임라인 숨기기`,showTimeline:`타임라인 보기`,rows:{scenes:`장면`,voice:`음성`,music:`음악`,sound:`사운드`},noVoice:`음성 없음`,noMusic:`음악 없음`,noCues:`효과음 없음`,ducked:`음성 아래로 낮춤`,version:`언어`,close:`닫기`,previewFailed:`이 동영상에 문제가 생겼습니다.`,previewFailedKept:`최근 변경에서 문제가 생겼습니다. 마지막으로 정상 작동한 버전입니다.`,problemsHere:e=>`이 버전의 문제 ${String(e)}개`,levelError:`수정 필요`,levelWarn:`제안`},rt={loading:`Carregando a prévia`,loadFailed:`A prévia não carregou`,noVideo:`Isto não é um vídeo`,previewTitle:`Prévia`,denoising:`Removendo o ruído da fala; tocando como foi gravada`,uncut:e=>`Ainda não há máscara de pessoa para ${e}: as camadas atrás da pessoa aparecem na frente`,play:`Reproduzir`,pause:`Pausar`,seek:`Posição`,prevPage:`Página anterior`,nextPage:`Próxima página`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar a linha do tempo`,showTimeline:`Mostrar a linha do tempo`,rows:{scenes:`Cenas`,voice:`Fala`,music:`Música`,sound:`Som`},noVoice:`Sem fala`,noMusic:`Sem música`,noCues:`Sem efeitos sonoros`,ducked:`abaixada sob a fala`,version:`Idioma`,close:`Fechar`,previewFailed:`Algo deu errado com este vídeo.`,previewFailedKept:`Algo deu errado com a última alteração. Esta é a última versão que funcionou.`,problemsHere:e=>e===1?`1 problema nesta versão`:`${String(e)} problemas nesta versão`,levelError:`Corrigir`,levelWarn:`Sugestão`},it=new Intl.PluralRules(`ru`),at=(e,t,n,r)=>{let i=it.select(e);return`${String(e)} ${i===`one`?t:i===`many`?r:n}`},ot=x({en:Je,"zh-cn":{loading:`正在加载预览`,loadFailed:`预览没能加载`,noVideo:`这不是视频`,previewTitle:`预览`,denoising:`正在降噪,先播原声`,uncut:e=>`${e} 还没有人像遮罩:人物后面的图层暂时画在人物前面`,play:`播放`,pause:`暂停`,seek:`进度`,prevPage:`上一页`,nextPage:`下一页`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收起时间线`,showTimeline:`展开时间线`,rows:{scenes:`分段`,voice:`说话`,music:`音乐`,sound:`音效`},noVoice:`没有人说话`,noMusic:`没有音乐`,noCues:`没有音效`,ducked:`有人说话时压低`,version:`语言`,close:`关闭`,previewFailed:`这个视频出了点问题。`,previewFailedKept:`最新的改动出了点问题,这里是上一版正常的画面。`,problemsHere:e=>`这个版本有 ${String(e)} 个问题`,levelError:`必须改`,levelWarn:`建议`},"zh-tw":{loading:`正在載入預覽`,loadFailed:`預覽未能載入`,noVideo:`這不是影片`,previewTitle:`預覽`,denoising:`正在降噪,先播放原始錄音`,uncut:e=>`${e} 還沒有人像遮罩:人物後方的圖層暫時顯示在人物前面`,play:`播放`,pause:`暫停`,seek:`播放位置`,prevPage:`上一頁`,nextPage:`下一頁`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收合時間軸`,showTimeline:`展開時間軸`,rows:{scenes:`段落`,voice:`語音`,music:`音樂`,sound:`音效`},noVoice:`沒有語音`,noMusic:`沒有音樂`,noCues:`沒有音效`,ducked:`有語音時降低音量`,version:`語言`,close:`關閉`,previewFailed:`這部影片出了點問題。`,previewFailedKept:`最新的修改出了點問題,這裡是上一個正常的版本。`,problemsHere:e=>`這個版本有 ${String(e)} 個問題`,levelError:`必須修正`,levelWarn:`建議`},ja:tt,ko:nt,es:Ye,fr:Xe,de:qe,it:et,pt:rt,ru:{loading:`Загрузка предпросмотра`,loadFailed:`Предпросмотр не загрузился`,noVideo:`Это не видео`,previewTitle:`Предпросмотр`,denoising:`Шумоподавление речи; пока звучит исходная запись`,uncut:e=>`Для ${e} ещё нет маски человека: слои за человеком показаны перед ним`,play:`Воспроизвести`,pause:`Пауза`,seek:`Перемотка`,prevPage:`Предыдущая страница`,nextPage:`Следующая страница`,pageOf:(e,t)=>`Страница ${String(e)} из ${String(t)}`,timeOf:(e,t,n)=>`${e} из ${t}${n?`, ${n}`:``}`,hideTimeline:`Скрыть таймлайн`,showTimeline:`Показать таймлайн`,rows:{scenes:`Сцены`,voice:`Речь`,music:`Музыка`,sound:`Звук`},noVoice:`Нет речи`,noMusic:`Нет музыки`,noCues:`Нет звуковых эффектов`,ducked:`приглушено под речью`,version:`Язык`,close:`Закрыть`,previewFailed:`С этим видео что-то пошло не так.`,previewFailedKept:`С последним изменением что-то пошло не так. Это последняя рабочая версия.`,problemsHere:e=>`${at(e,`проблема`,`проблемы`,`проблем`)} в этой версии`,levelError:`Нужно исправить`,levelWarn:`Совет`},tr:{loading:`Önizleme yükleniyor`,loadFailed:`Önizleme yüklenmedi`,noVideo:`Bu bir video değil`,previewTitle:`Önizleme`,denoising:`Konuşmadaki gürültü temizleniyor; kaydedildiği gibi çalınıyor`,uncut:e=>`${e} için henüz kişi maskesi yok: kişinin arkasındaki katmanlar önde görünür`,play:`Oynat`,pause:`Duraklat`,seek:`Konum`,prevPage:`Önceki sayfa`,nextPage:`Sonraki sayfa`,pageOf:(e,t)=>`Sayfa ${String(e)} / ${String(t)}`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`Zaman çizelgesini gizle`,showTimeline:`Zaman çizelgesini göster`,rows:{scenes:`Sahneler`,voice:`Konuşma`,music:`Müzik`,sound:`Ses`},noVoice:`Konuşma yok`,noMusic:`Müzik yok`,noCues:`Ses efekti yok`,ducked:`konuşmanın altında kısıldı`,version:`Dil`,close:`Kapat`,previewFailed:`Bu videoda bir şeyler ters gitti.`,previewFailedKept:`Son değişiklikte bir şeyler ters gitti. Bu, çalışan son sürüm.`,problemsHere:e=>`Bu sürümde ${String(e)} sorun var`,levelError:`Düzeltilmeli`,levelWarn:`Öneri`},vi:{loading:`Đang tải bản xem trước`,loadFailed:`Không tải được bản xem trước`,noVideo:`Đây không phải video`,previewTitle:`Xem trước`,denoising:`Đang khử nhiễu giọng nói; tạm phát như bản thu gốc`,uncut:e=>`Chưa có mặt nạ người cho ${e}: các lớp phía sau người hiện ở phía trước`,play:`Phát`,pause:`Tạm dừng`,seek:`Tua`,prevPage:`Trang trước`,nextPage:`Trang sau`,pageOf:(e,t)=>`Trang ${String(e)}/${String(t)}`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`Ẩn dòng thời gian`,showTimeline:`Hiện dòng thời gian`,rows:{scenes:`Cảnh`,voice:`Lời nói`,music:`Nhạc`,sound:`Âm thanh`},noVoice:`Không có lời nói`,noMusic:`Không có nhạc`,noCues:`Không có hiệu ứng âm thanh`,ducked:`giảm âm lượng khi có lời nói`,version:`Ngôn ngữ`,close:`Đóng`,previewFailed:`Video này đã gặp sự cố.`,previewFailedKept:`Thay đổi mới nhất đã gặp sự cố. Đây là phiên bản chạy được gần nhất.`,problemsHere:e=>`${String(e)} vấn đề trong phiên bản này`,levelError:`Cần sửa`,levelWarn:`Gợi ý`},th:{loading:`กำลังโหลดตัวอย่าง`,loadFailed:`โหลดตัวอย่างไม่สำเร็จ`,noVideo:`นี่ไม่ใช่วิดีโอ`,previewTitle:`ตัวอย่าง`,denoising:`กำลังลดเสียงรบกวนของเสียงพูด ระหว่างนี้จะเล่นตามที่บันทึกไว้`,uncut:e=>`ยังไม่มีมาสก์บุคคลสำหรับ ${e}: เลเยอร์ที่อยู่หลังบุคคลจะแสดงอยู่ด้านหน้า`,play:`เล่น`,pause:`หยุดชั่วคราว`,seek:`เลื่อนตำแหน่ง`,prevPage:`หน้าก่อนหน้า`,nextPage:`หน้าถัดไป`,pageOf:(e,t)=>`หน้า ${String(e)} จาก ${String(t)}`,timeOf:(e,t,n)=>`${e} จาก ${t}${n?`, ${n}`:``}`,hideTimeline:`ซ่อนไทม์ไลน์`,showTimeline:`แสดงไทม์ไลน์`,rows:{scenes:`ฉาก`,voice:`เสียงพูด`,music:`เพลง`,sound:`เสียง`},noVoice:`ไม่มีเสียงพูด`,noMusic:`ไม่มีเพลง`,noCues:`ไม่มีเอฟเฟกต์เสียง`,ducked:`ลดเสียงลงขณะมีเสียงพูด`,version:`ภาษา`,close:`ปิด`,previewFailed:`วิดีโอนี้เกิดข้อผิดพลาด`,previewFailedKept:`การเปลี่ยนแปลงล่าสุดเกิดข้อผิดพลาด นี่คือเวอร์ชันล่าสุดที่ใช้ได้`,problemsHere:e=>`มีปัญหา ${String(e)} รายการในเวอร์ชันนี้`,levelError:`ต้องแก้ไข`,levelWarn:`คำแนะนำ`},hi:$e});function X(){return ot.of(O()?.locale)}function st(e,t,n){let r=T(),[i,a]=(0,P.useState)(),o=JSON.stringify([e,t,...n]);return(0,P.useEffect)(()=>{if(t===void 0)return;let n=!0;return S(r,e,t).then(e=>{n&&a({key:o,data:e})},e=>{n&&a({key:o,error:e instanceof Error?e:Error(String(e))})}),()=>{n=!1}},[r,o]),{data:i?.data,error:i?.key===o?i.error:void 0}}function ct(){let[e,t]=(0,P.useState)(0);return C(`project/changed`,e=>{t(e.revision)}),e}function lt(){let e=T(),[t,n]=(0,P.useState)();return(0,P.useEffect)(()=>{let t=!0;return S(e,`check/results`,{}).then(e=>{t&&n(t=>t??e)},()=>void 0),()=>{t=!1}},[e]),C(`check/changed`,n),t}function ut(e,t){let n=T(),[r,i]=(0,P.useState)();(0,P.useEffect)(()=>{let r=!0;return n[`storage/get`]({key:e}).then(n=>{r&&i({key:e,value:n.value===null?t:n.value})},()=>{r&&i({key:e,value:t})}),()=>{r=!1}},[n,e]);let a=(0,P.useCallback)(t=>{i({key:e,value:t}),n[`storage/set`]({key:e,value:t}).catch(()=>void 0)},[n,e]);return[r?.key===e?r.value:void 0,a]}async function dt(e,t){try{return(await e[`files/url`]({path:t})).url}catch{return}}function ft(e,t){return e.versions.find(e=>e.key===t)??e.versions[0]}function pt(e,t,n){return e.filter(e=>e.piece===t&&(e.combo===void 0||n.lang===void 0||e.combo.lang===n.lang))}function mt(e,t){try{return new Intl.DisplayNames([t],{type:`language`}).of(e)??e}catch{return e}}function ht(e){if(typeof e==`object`&&e&&e.allyhub===!0&&typeof e.type==`string`)return e}function gt(e,t){e?.postMessage({allyhub:!0,...t},`*`)}function _t({delayDuration:e=0,...t}){return(0,F.jsx)(Se,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function vt({...e}){return(0,F.jsx)(we,{"data-slot":`tooltip`,...e})}function yt({...e}){return(0,F.jsx)(Ee,{"data-slot":`tooltip-trigger`,...e})}function bt({className:e,sideOffset:t=0,children:n,...r}){return(0,F.jsx)(ke,{children:(0,F.jsxs)(Ae,{"data-slot":`tooltip-content`,sideOffset:t,className:y(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,F.jsx)(Ne,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function xt(e,t,n,r=4){let i=e.map(({x:e,width:n},r)=>{let i=e+n>t&&e-n>=0?`before`:`after`;return i===`after`?{i:r,side:i,from:e,to:e+n}:{i:r,side:i,from:e-n,to:e}}),a=[],o=e.map(()=>null);for(let e of[...i].sort((e,t)=>e.from-t.from||e.i-t.i)){let t=0;for(;t<n&&(a[t]??-1/0)+r>e.from;)t++;t!==n&&(a[t]=e.to,o[e.i]={lane:t,side:e.side})}return o}var St=.01,Ct=new Map;async function wt(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.arrayBuffer(),r=await new OfflineAudioContext(1,1,44100).decodeAudioData(n),i=r.sampleRate/50,a=Math.ceil(r.length/i),o=new Float32Array(a),s=0;for(let e=0;e<r.numberOfChannels;e++){let t=r.getChannelData(e);for(let e=0;e<a;e++){let n=Math.min(t.length,Math.floor((e+1)*i)),r=o[e]??0;for(let a=Math.floor(e*i);a<n;a++){let e=Math.abs(t[a]??0);e>r&&(r=e)}o[e]=r,r>s&&(s=r)}}if(s<St)return;let c=Float32Array.from(o).sort(),l=c[Math.floor(c.length*.95)]??s;return{duration:r.duration,data:o,max:l>0?l:s}}catch{return}}function Tt(e){let t=Ct.get(e);return t||(t=wt(e),Ct.set(e,t)),t}function Et(e){let[t,n]=(0,P.useState)();(0,P.useEffect)(()=>{if(e===void 0)return;let t=!0;return Tt(e).then(r=>{t&&n({url:e,peaks:r})}),()=>{t=!1}},[e]);let r=t?.url===e?t:void 0;return{peaks:r?.peaks,settled:e===void 0||r!==void 0}}function Dt(e,t,n){let r=Math.max(0,Math.floor(t*50)),i=Math.min(e.data.length,Math.max(r+1,Math.ceil(n*50))),a=0;for(let t=r;t<i;t++){let n=e.data[t]??0;n>a&&(a=n)}return a}function Ot(e,t){if(e.length===0)return 0;let n=e[0];if(!n||t<=n.t)return n?.db??0;for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];if(r&&i&&t<=i.t)return i.t===r.t?i.db:r.db+(i.db-r.db)*(t-r.t)/(i.t-r.t)}return e.at(-1)?.db??0}function kt(e,t,n){let r=new Map(t.map(e=>[e.key,e])),i=e.parts.flatMap(e=>{let t=e.speech;if(!t)return[];let n=r.get(e.key);return[{...n?.speechKey===void 0?{}:{key:n.speechKey},part:e.key,start:t.start,end:t.end,text:n?.spoken??``,file:t.file,from:t.from,speed:t.speed??1,...t.cuts?{cuts:t.cuts}:{}}]}),a=n?.music,o;if(a&&a.segments.length>0){let t=a.segments[0],n=a.segments.at(-1),r=Math.min(e.duration,a.until??(n?n.at+n.dur:e.duration)),i=[];for(let e=1;e<a.duck.length;e++){let t=a.duck[e-1],n=a.duck[e];if(t&&n&&t.db<0&&n.db<0){let e=i.at(-1);e&&Math.abs(e.end-t.t)<1e-9?e.end=n.t:i.push({start:t.t,end:n.t})}}o={file:a.file,start:t?.at??0,end:r,stretches:a.segments.map(e=>({at:e.at,from:e.from,dur:e.dur})),ducked:i,duck:a.duck,fadeIn:a.fadeIn,fadeOut:a.fadeOut}}return{cues:e.cues,speech:i,music:o}}function At(e,t){if(t<e.start||t>=e.end)return;let n=e.start,r=e.from;for(let i of e.cuts??[]){if(i.at>t)break;n=i.at,r=i.from}return r+(t-n)*e.speed}function jt(e,t){for(let n=e.stretches.length-1;n>=0;n--){let r=e.stretches[n];if(r&&t>=r.at&&t<r.at+r.dur)return r.from+(t-r.at)}}function Mt(e,t){let n=10**(Ot(e.duck,t)/20);return e.fadeIn>0&&t-e.start<e.fadeIn&&(n*=Math.max(0,t-e.start)/e.fadeIn),e.fadeOut>0&&e.end-t<e.fadeOut&&(n*=Math.max(0,e.end-t)/e.fadeOut),Math.max(0,n)}function Nt(e){let t=new Set((e.index??[]).filter(e=>e.matte).map(e=>e.file));return e.parts.flatMap(n=>{let r=(e.footage??[]).find(e=>e.part===n.key&&t.has(e.file));return r?[{part:n.key,file:r.file}]:[]})}var Pt={scenes:`text-track-scene`,voice:`text-track-voice`,music:`text-track-music`,sound:`text-track-sound`},Z={ruler:20,scenes:36,voice:40,music:32,sound:28};function Ft(e){return Z.ruler+1+Z.scenes+1+e.reduce((e,t)=>e+Z[t]+1,0)}var It=6;function Lt(e,t){let n=e=>e.join(` `).replace(/\s+([.,!?;:。,!?;:、])/g,`$1`).trim(),[r,...i]=e;if(r===t&&i.length>0){let e=n(i);if(/^[^a-z]/.test(e))return e}return n(e)}function Rt(e){return e<=60?{minor:1,major:5}:e<=180?{minor:1,major:10}:e<=600?{minor:5,major:30}:e<=1800?{minor:10,major:60}:{minor:60,major:300}}var Q=(e,t)=>`${String(e/Math.max(t,1e-6)*100)}%`;function zt({title:e,mono:t=!1,time:n,line:r,children:i}){return(0,F.jsxs)(vt,{children:[(0,F.jsx)(yt,{asChild:!0,children:i}),(0,F.jsx)(bt,{side:`top`,sideOffset:6,className:`max-w-[20rem]`,children:(0,F.jsxs)(`span`,{className:`flex flex-col gap-0.5 text-left`,children:[(0,F.jsx)(`span`,{className:y(t&&`font-mono text-micro`),children:e}),(0,F.jsx)(`span`,{className:`font-mono text-micro tabular-nums opacity-70`,children:n}),r?(0,F.jsx)(`span`,{className:`opacity-80`,children:r}):null]})})]})}function Bt(e){let t=T(),[n,r]=(0,P.useState)();return(0,P.useEffect)(()=>{let n=!0;return dt(t,e).then(t=>{n&&r({file:e,url:t})}),()=>{n=!1}},[t,e]),n?.file===e?n.url:void 0}function Vt({file:e,from:t,to:n,sample:r,alpha:i,className:a}){let o=(0,P.useRef)(null),{peaks:s,settled:c}=Et(Bt(e)),[l,u]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{let e=o.current;if(!e||!s)return;let a=()=>{let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),c=Math.round(e.clientHeight*a);if(!o||!c)return;e.width=o,e.height=c;let l=e.getContext(`2d`);if(!l)return;l.fillStyle=getComputedStyle(e).color,l.globalAlpha=i;let d=1/Math.max(s.max,.05),f=n-t,p=c-2*Math.round(2*a);for(let e=0;e<o;e+=2){let n=r(t+e/o*f);if(!n)continue;let i=Dt(s,n.at,n.at+2/o*f)*d*n.gain,a=Math.max(1,Math.round(Math.min(1,i)**Ht*p));l.fillRect(e,Math.round((c-a)/2),1,a)}u(!0)};a();let c=new ResizeObserver(a);c.observe(e);let l=new MutationObserver(a);return l.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{c.disconnect(),l.disconnect()}},[s,t,n,r,i]),(0,F.jsx)(`canvas`,{ref:o,"aria-hidden":!0,"data-wave":l?`ready`:c?`none`:`pending`,className:y(`pointer-events-none absolute inset-0 size-full opacity-0 transition-opacity data-[wave=ready]:opacity-100`,a)})}var Ht=.7,Ut=`focus-visible:outline-ring absolute inset-y-1 overflow-hidden rounded-xs border focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`;function Wt({line:e,duration:t,onSeek:n}){let r=(0,P.useCallback)(t=>{let n=At(e,t);return n===void 0?void 0:{at:n,gain:1}},[e]);return(0,F.jsx)(zt,{title:e.text,time:`${Y(e.start)} – ${Y(e.end)} · ${Ke(e.file)}`,children:(0,F.jsxs)(`button`,{type:`button`,"data-sentence":e.key??e.part,"data-start":e.start.toFixed(4),className:y(Ut,`bg-track-voice/15 border-track-voice/60 hover:bg-track-voice/25 text-left`),style:{left:Q(e.start,t),width:Q(e.end-e.start,t)},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{n(e.start)},children:[(0,F.jsx)(`span`,{className:`absolute inset-x-1.5 top-0 block h-[14px] truncate text-micro leading-[14px]`,children:e.text}),(0,F.jsx)(`span`,{className:`absolute inset-x-0 top-[14px] bottom-0`,children:(0,F.jsx)(Vt,{file:e.file,from:e.start,to:e.end,sample:r,alpha:.7,className:`text-track-voice`})})]})})}var Gt=2,Kt=.75;function qt({parts:e,duration:t}){let n=(0,P.useRef)(null),r=(0,P.useRef)(new Map),[i,a]=(0,P.useState)(0),[o,s]=(0,P.useState)(()=>new Map),c=e.flatMap(e=>(e.anchors??[]).map(t=>({id:`${e.key}@${t.name}`,part:e.key,anchor:t}))),l=c.map(e=>e.id).join(`
2
2
  `);(0,P.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{a(e.clientWidth);let t=new Map;for(let[e,n]of r.current)t.set(e,n.offsetWidth);s(e=>e.size===t.size&&[...t].every(([t,n])=>e.get(t)===n)?e:t)};t();let i=new ResizeObserver(t);i.observe(e);for(let e of r.current.values())i.observe(e);return()=>{i.disconnect()}},[l]);let u=xt(c.map(e=>({x:e.anchor.at/Math.max(t,1e-6)*i,width:o.get(e.id)??0})),i,Gt);return(0,F.jsx)(`div`,{ref:n,className:`pointer-events-none absolute inset-0`,children:c.map((e,n)=>(0,F.jsx)(Jt,{part:e.part,anchor:e.anchor,duration:t,place:u[n]??null,nameRef:t=>(r.current.set(e.id,t),()=>{r.current.delete(e.id)})},e.id))})}function Jt({part:e,anchor:t,duration:n,place:r,nameRef:i}){let{at:a,end:o}=t,s=(a,o)=>(0,F.jsx)(`span`,{"data-anchor":`${e}:${t.name}${a?`:end`:``}`,"data-time":o.toFixed(4),title:t.name,className:`before:bg-foreground/70 absolute inset-y-0 z-10 -ml-1 w-2 before:absolute before:inset-y-0 before:left-1/2 before:w-px`,style:{left:Q(o,n)},children:!a&&(0,F.jsx)(`span`,{ref:i,"data-anchor-lane":r?String(r.lane):void 0,className:y(`bg-background text-muted-foreground absolute rounded-xs px-0.5 font-mono text-micro leading-3 whitespace-nowrap`,r?.side===`before`?`right-1/2 mr-px`:`left-1/2 ml-px`,!r&&`invisible`),style:{bottom:`${String((r?.lane??0)*Kt)}rem`},children:t.name})},a?`end`:`at`);return(0,F.jsxs)(F.Fragment,{children:[o!==void 0&&o>a&&(0,F.jsx)(`span`,{className:`bg-foreground/50 pointer-events-none absolute bottom-0 z-10 h-px`,style:{left:Q(a,n),width:Q(o-a,n)}}),s(!1,a),o!==void 0&&s(!0,o)]})}function Yt({music:e,duration:t,ducked:n}){let{start:r,end:i}=e,a=(0,P.useCallback)(t=>{let n=jt(e,t);return n===void 0?void 0:{at:n,gain:Mt(e,t)}},[e]),o=Ke(e.file);return(0,F.jsx)(zt,{mono:!0,title:o,time:`${Y(r)} – ${Y(i)}`,line:e.ducked.length?n:void 0,children:(0,F.jsxs)(`div`,{"data-music":o,className:y(Ut,`bg-track-music/15 border-track-music/60`),style:{left:Q(r,t),width:Q(i-r,t)},children:[(0,F.jsx)(Vt,{file:e.file,from:r,to:i,sample:a,alpha:.6,className:`text-track-music`}),(0,F.jsx)(`span`,{className:`bg-background/85 text-foreground absolute top-1/2 left-1.5 -translate-y-1/2 rounded-xs px-1 font-mono text-micro leading-[14px]`,children:o})]})})}var Xt=(0,P.memo)(function({timeline:e,texts:t,tracks:n,rows:r,current:i,second:a,onSeek:o}){let s=X(),{duration:c,parts:l}=e,u=e=>(0,F.jsx)(`span`,{className:`text-muted-foreground bg-background pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 px-1 text-xs leading-4`,children:e}),d=n.speech,f=n.music?[n.music]:[],p=n.cues,m=e=>l.find(t=>t.key===e)?.title??e;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`relative border-t`,style:{height:Z.scenes+1},"data-row":`scenes`,children:l.map((e,n)=>{let r=e.key===i,s=e.title??e.key,l=t.find(t=>t.key===e.key),u=l?.spoken??Lt(l?.onScreen??[],s),d=(e.end-e.start)*a<56;return(0,F.jsx)(zt,{title:(0,F.jsx)(`span`,{className:`font-serif text-dense`,children:s}),time:`${Y(e.start)} – ${Y(e.end)}`,line:u||void 0,children:(0,F.jsxs)(`button`,{type:`button`,"data-chapter":e.key,"data-start":e.start.toFixed(4),"aria-current":r?`true`:void 0,className:y(Ut,`flex items-center gap-1.5 px-2 text-left transition-colors`,r?`bg-track-scene/25 border-track-scene`:`bg-track-scene/10 border-track-scene/45 hover:bg-track-scene/20`),style:{left:Q(e.start,c),width:`calc(${Q(e.end-e.start,c)} - 1px)`},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{o(e.start)},children:[(0,F.jsx)(`span`,{className:y(`font-mono text-micro tabular-nums`,r?`text-foreground/70`:`text-muted-foreground`),children:String(n+1)}),d?null:(0,F.jsx)(`span`,{className:y(`min-w-0 truncate font-serif text-xs`,r?`font-semibold`:`text-foreground/80`),children:s})]})},e.key)})}),r.includes(`voice`)?(0,F.jsxs)(`div`,{className:`relative border-t`,style:{height:Z.voice+1},"data-row":`voice`,children:[d.length>0?d.map(e=>(0,F.jsx)(Wt,{line:e,duration:c,onSeek:o},`${e.part}@${String(e.start)}`)):u(s.noVoice),(0,F.jsx)(qt,{parts:l,duration:c})]}):null,r.includes(`music`)?(0,F.jsx)(`div`,{className:`relative border-t`,style:{height:Z.music+1},"data-row":`music`,children:f.length?f.map(e=>(0,F.jsx)(Yt,{music:e,duration:c,ducked:s.ducked},`${e.file}@${String(e.start)}`)):u(s.noMusic)}):null,r.includes(`sound`)?(0,F.jsxs)(`div`,{className:`relative border-t`,style:{height:Z.sound+1},"data-row":`sound`,children:[(0,F.jsx)(`span`,{className:`bg-rule-strong absolute inset-x-0 top-1/2 h-px`}),p.length?p.map((e,t)=>(0,F.jsx)(zt,{mono:!0,title:e.sound,time:`${Y(e.t)} · ${m(e.part)}`,line:e.what,children:(0,F.jsx)(`span`,{"data-cue":e.sound,className:`absolute top-1/2 block size-[7px] -translate-y-1/2`,style:{left:Q(e.t,c)},children:(0,F.jsx)(`span`,{className:y(`bg-track-sound block size-full rotate-45`,e.t*a<5?`translate-x-[2px]`:`-translate-x-1/2`)})})},`${e.sound}@${String(e.t)}#${String(t)}`)):u(s.noCues)]}):null]})});function Zt({timeline:e,texts:t,tracks:n,rows:r,state:i,onSeek:a}){let o=X(),{duration:s,fps:c,parts:l}=e,u=Math.max(0,s-1/c),d=(0,P.useRef)(null),f=(0,P.useRef)(null),[p,m]=(0,P.useState)(0),[h,g]=(0,P.useState)(!1),[_,v]=(0,P.useState)();(0,P.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=()=>{m(e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let b=p>0&&p/s<It,x=b?Math.ceil(s*It):p,S=x/Math.max(s,1e-6),{t:C,playing:w}=i;(0,P.useEffect)(()=>{let e=f.current;if(!e)return;let t=t=>{let n=Math.min(Math.max(t,0),s)*S;e.style.transform=`translateX(${String(n)}px)`;let r=d.current;b&&w&&r&&(n<r.scrollLeft+24||n>r.scrollLeft+r.clientWidth-24)&&(r.scrollLeft=Math.max(0,n-r.clientWidth*.2))};if(t(C),!w)return;let n=performance.now(),r=requestAnimationFrame(function e(i){t(Math.min(C+(i-n)/1e3,u)),r=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(r)}},[C,w,S,s,u,b]);let T=e=>{let t=e.currentTarget.getBoundingClientRect(),n=Math.min(t.width,Math.max(0,e.clientX-t.left))/Math.max(t.width,1)*s;return Math.min(Math.max(Ge(n,c),0),u)},E=e=>{a(Math.min(Math.max(Ge(e,c),0),u))},D=l.find(e=>i.t>=e.start&&i.t<e.end)??l.at(-1),{minor:O,major:k}=Rt(s),ee=[];for(let e=0;e<=s+1e-6;e+=O)ee.push(e);let A=(e,t)=>(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 overflow-hidden border-t pr-2 pl-3 max-[559px]:justify-center max-[559px]:px-0`,style:{height:Z[e]+1},"data-track":e,children:[(0,F.jsx)(`span`,{role:`img`,"aria-label":o.rows[e],className:y(`shrink-0 [&_svg]:size-3.5`,Pt[e]),children:t}),(0,F.jsx)(Ve,{"aria-hidden":!0,className:`text-micro whitespace-nowrap max-[559px]:hidden`,children:o.rows[e]})]});return(0,F.jsx)(_t,{delayDuration:250,children:(0,F.jsxs)(`div`,{className:`flex border-t`,style:{height:Ft(r)+1},"data-testid":`timeline`,children:[(0,F.jsxs)(`div`,{className:`w-max min-w-20 shrink-0 border-r max-[559px]:w-10 max-[559px]:min-w-10`,children:[(0,F.jsx)(`div`,{style:{height:Z.ruler}}),A(`scenes`,(0,F.jsx)(he,{})),r.includes(`voice`)?A(`voice`,(0,F.jsx)(_e,{})):null,r.includes(`music`)?A(`music`,(0,F.jsx)(M,{})):null,r.includes(`sound`)?A(`sound`,(0,F.jsx)(ge,{})):null]}),(0,F.jsx)(`div`,{ref:d,className:y(`relative min-w-0 flex-1 overflow-y-hidden border-l border-transparent`,b?`overflow-x-auto`:`overflow-x-hidden`),"data-testid":`tracks`,children:(0,F.jsxs)(`div`,{className:`relative h-full cursor-pointer touch-none`,style:{width:x||`100%`},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),g(!0),a(T(e))},onPointerMove:e=>{let t=T(e);v(t),h&&a(t)},onPointerUp:()=>{g(!1)},onPointerCancel:()=>{g(!1)},onPointerLeave:()=>{v(void 0)},children:[(0,F.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":o.seek,"aria-valuemin":0,"aria-valuemax":Math.round(s*100)/100,"aria-valuenow":Math.round(i.t*100)/100,"aria-valuetext":o.timeOf(J(i.t),J(s),D?.title??``),"data-testid":`scrubber`,className:`focus-visible:outline-ring relative outline-none focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`,style:{height:Z.ruler},onKeyDown:e=>{if(e.key===`ArrowLeft`)E(i.t-1);else if(e.key===`ArrowRight`)E(i.t+1);else if(e.key===`Home`)E(0);else if(e.key===`End`)E(u);else return;e.preventDefault()},children:ee.map(e=>{let t=Math.abs(e/k-Math.round(e/k))<1e-6;return(0,F.jsxs)(`span`,{className:`absolute bottom-0`,style:{left:Q(e,s)},children:[(0,F.jsx)(`span`,{className:y(`absolute bottom-0 left-0 w-px`,t?`bg-lead-soft h-2`:`bg-rule-strong h-1`)}),t&&(s-e)*S>34?(0,F.jsx)(`span`,{className:`text-muted-foreground absolute bottom-[7px] left-1 font-mono text-micro leading-none tabular-nums`,children:J(e)}):null]},e)})}),(0,F.jsx)(Xt,{timeline:e,texts:t,tracks:n,rows:r,current:i.part??D?.key,second:S,onSeek:a}),_===void 0?null:(0,F.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-0 z-10`,style:{transform:`translateX(${String(_*S)}px)`},"data-testid":`hover-guide`,children:[(0,F.jsx)(`span`,{className:`bg-foreground/25 absolute inset-y-0 left-0 w-px`}),(0,F.jsx)(`span`,{className:`bg-popover text-popover-foreground absolute top-0.5 left-1 rounded-xs border px-1 font-mono text-micro leading-[14px] tabular-nums`,children:J(_)})]}),(0,F.jsxs)(`div`,{ref:f,"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-0 z-20 will-change-transform`,"data-testid":`playhead`,children:[(0,F.jsx)(`span`,{className:`bg-foreground absolute inset-y-0 left-0 w-px`}),(0,F.jsx)(`svg`,{viewBox:`0 0 9 9`,className:`text-foreground absolute top-0 -left-1 size-[9px]`,children:(0,F.jsx)(`path`,{d:`M0 0h9v4L4.5 9 0 4z`,fill:`currentColor`})})]})]})})]})})}var Qt=48,$t=[`voice`,`music`,`sound`],en=[`voice`],tn=[],nn=160,rn=560,an=1e3,on=20,sn=1500,cn=15e3,ln=e=>({timeline:e.timeline,texts:e.text,tracks:kt(e.timeline,e.text,e.mix),uncut:Nt(e.timeline)});function un({item:e,version:t,revision:n,width:r,height:i,start:a,overlay:o,onLoaded:s,onError:c,onState:l,ref:u}){let d=X(),f=T(),p=(0,P.useRef)(null),m=(0,P.useRef)(new Map),[h,g]=(0,P.useState)(),[_,v]=(0,P.useState)(),[x,C]=(0,P.useState)(),[w,E]=(0,P.useState)(),[D,k]=(0,P.useState)(!1),[A,te]=(0,P.useState)(),ne=ee(A),[j,re]=(0,P.useState)({t:a?.t??0,part:void 0,playing:!1}),[ae,se]=(0,P.useState)(0),[ce,le]=(0,P.useState)(),[ue=!0,de]=ut(`video-editor.timeline`,!0),fe=(0,P.useRef)(null),[pe,me]=(0,P.useState)(0),he=(0,P.useRef)(1),ge=(0,P.useRef)(void 0),_e=(0,P.useRef)(!1),M=(0,P.useCallback)(e=>{let t=Math.max(0,e);ge.current!==t&&(ge.current=t,f[`editor/place`]({place:{t}}).catch(()=>void 0))},[f]),N=(0,P.useRef)({shown:h,pending:_,play:j,view:x,onLoaded:s,onError:c,onState:l});(0,P.useEffect)(()=>{N.current={shown:h,pending:_,play:j,view:x,onLoaded:s,onError:c,onState:l}});let I=e=>e===void 0?void 0:p.current?.querySelector(`iframe[data-frame="${String(e.id)}"]`)?.contentWindow,L=e=>{gt(I(N.current.shown),e)};(0,P.useImperativeHandle)(u,()=>({seek:e=>{L({type:`seek`,t:e}),M(e)},play:()=>{L({type:`play`})},pause:()=>{L({type:`pause`})}}));let R=n=>S(f,`video/stage`,{item:e,version:t,start:n,chrome:!1}).then(e=>(te(e.probe),e.url)),ye=`${e}\n${t}`,z=(0,P.useRef)(e);(0,P.useEffect)(()=>{let{shown:t,play:n}=N.current,r=z.current===e;z.current=e;let i={t:0},o=t?r?{t:n.t}:i:a??i,s=!0;return R(o).then(e=>{s&&(g({id:he.current++,src:e}),v(void 0),E(void 0))},e=>{if(!s)return;let t=e instanceof Error?e.message:String(e);E(t),N.current.onError?.(t)}),()=>{s=!1}},[ye]);let be=(0,P.useRef)(n);(0,P.useEffect)(()=>{if(n===be.current)return;be.current=n;let{shown:e,play:t,view:r}=N.current;if(!e)return;let i=r?.timeline.parts.find(e=>t.t>=e.start&&t.t<e.end),a=i?{t:t.t,part:i.key,offset:t.t-i.start,dur:i.end-i.start}:{t:t.t},o=!0;return R(a).then(e=>{o&&v({id:he.current++,src:e,from:t.t})},e=>{o&&N.current.onError?.(e instanceof Error?e.message:String(e))}),()=>{o=!1}},[n]),(0,P.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>{v(void 0),N.current.onError?.(d.loadFailed)},cn);return()=>{clearTimeout(e)}},[_,d.loadFailed]),(0,P.useEffect)(()=>{let e=e=>{let t=ht(e.data);if(!t)return;let{shown:n,pending:r}=N.current,i=[n,r].find(t=>t!==void 0&&I(t)===e.source);if(!i)return;let a=i.id===r?.id;if(t.type===`located`)m.current.get(t.id)?.(t.layers),m.current.delete(t.id);else if(t.type===`sound`)i.denoising=t.denoising,a||k(t.denoising);else if(t.type===`loaded`){let e={kind:t.kind,timeline:t.timeline,text:t.text,reads:t.reads,problems:t.problems,mix:t.mix};if(a){i.loaded=e;return}C(ln(e)),E(void 0),N.current.onLoaded?.(e)}else if(t.type===`error`)a?v(void 0):E(t.message),N.current.onError?.(t.message);else if(t.type===`time`){if(a){if(!i.loaded)return;g(i),v(void 0),se(e=>e+1),k(i.denoising===!0),C(ln(i.loaded)),E(void 0),N.current.onLoaded?.(i.loaded);let t=N.current.play.t;if(i.from!==void 0&&Math.abs(t-i.from)>1e-6){gt(e.source,{type:`seek`,t});return}}let n={t:t.t,part:t.part,playing:t.playing};n.playing&&_e.current||M(n.t),_e.current=n.playing,le(i.id),re(n),N.current.onState?.(n)}};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[M]);let B=x?.timeline,[V,xe]=B?[B.width,B.height]:[r,i],H=x?.uncut.find(e=>e.part===j.part);(0,P.useLayoutEffect)(()=>{let e=fe.current;if(!e)return;let t=()=>{me(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let Se=B!==void 0,U=j.playing;(0,P.useEffect)(()=>{if(!Se)return;let e=e=>{if(e.key!==` `||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;t instanceof HTMLElement&&(t.isContentEditable||t.closest(`input,textarea,select,button,a,[role=slider],[role=menuitem],[role=dialog]`))||(e.preventDefault(),gt(I(N.current.shown),{type:U?`pause`:`play`}))};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[Se,U]);let Ce=e=>{L({type:`seek`,t:e}),M(e)},W=(e,t)=>(0,F.jsx)(`iframe`,{"data-frame":e.id,src:e.src,title:d.previewTitle,...ne?{sandbox:`allow-scripts`}:{},allow:`autoplay`,"data-testid":t?`stage-pending`:`stage`,className:y(`absolute -inset-0.5 size-[calc(100%+4px)] border-0`,t&&`pointer-events-none opacity-0`)},e.id),we=B?`bg-background`:`bg-black`,Te=(0,F.jsxs)(F.Fragment,{children:[h&&ne!==void 0?W(h,!1):null,_&&ne!==void 0?W(_,!0):null,B||w!==void 0?null:(0,F.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,F.jsx)(He,{label:d.loading,className:`[&>span]:bg-on-media/80`})}),D?(0,F.jsx)(`span`,{className:`bg-background/90 text-muted-foreground absolute top-2 right-2 rounded-sm px-2 py-0.5 font-mono text-micro`,"data-testid":`denoising`,children:d.denoising}):null,B?(0,F.jsx)(`span`,{"aria-hidden":!0,"data-testid":`play-affordance`,"data-shown":!j.playing&&j.t<.05?``:void 0,className:`bg-foreground/92 text-background pointer-events-none absolute top-1/2 left-1/2 flex size-14 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md opacity-0 transition-opacity data-[shown]:opacity-100`,children:(0,F.jsx)(ve,{className:`size-6 translate-x-px fill-current`})}):null,H?(0,F.jsx)(`span`,{className:`bg-background/90 text-muted-foreground absolute top-2 left-2 max-w-[calc(100%-1rem)] rounded-sm px-2 py-0.5 font-mono text-micro`,"data-testid":`uncut`,children:d.uncut(H.file)}):null,o]}),Ee=ce!==void 0&&ce===h?.id,De=async()=>{L({type:`pause`});let e=Date.now()+an;for(;N.current.play.playing&&Date.now()<e;)await new Promise(e=>{setTimeout(e,on)})},Oe=e=>{let t=p.current?.getBoundingClientRect();if(!t||t.width===0||t.height===0)return Promise.resolve([]);let n=crypto.randomUUID();return new Promise(r=>{let i=setTimeout(()=>{m.current.delete(n),r([])},sn);m.current.set(n,e=>{clearTimeout(i),r(e)}),L({type:`locate`,id:n,mark:oe(e,({x:e,y:n})=>({x:(e-t.x)/t.width,y:(n-t.y)/t.height}))})})},G=O()?.item.entry;b({freeze:async()=>{await De();let{t:n,part:r}=N.current.play;return{key:`${e}@${t}@${n.toFixed(3)}@${String(N.current.shown?.id??0)}`,what:`The video ${e}, version ${t}, at ${n.toFixed(2)} s${r===void 0?``:`, in the part ${r}`}`,...G===void 0?{}:{source:{path:G}}}},pictures:async()=>{let n=p.current?.getBoundingClientRect();if(!n)return[];let r=await S(f,`video/still`,{item:e,version:t,t:N.current.play.t}).catch(()=>void 0);return r?[{rect:{x:n.x,y:n.y,width:n.width,height:n.height},mime:r.image.mime,data:r.image.data}]:[]},locate:async e=>{let t=p.current?.getBoundingClientRect();return t&&ie(e,t)?(await Oe(e)).map(e=>({name:`${e.name===void 0?`the ${e.layer} layer`:`layer ${JSON.stringify(e.name)}`} of part ${e.part}`,...G===void 0?{}:{source:{path:G}},...e.text===void 0?{}:{text:e.text}})):[...document.querySelectorAll(`[data-row]`)].filter(t=>ie(e,t.getBoundingClientRect())).map(e=>({name:`the ${e.dataset.row??``} row of the timeline`}))}});let ke=e=>pe-Qt-3-Ft(e)-1,K=[$t,en].find(e=>ke(e)>=nn)??tn,Ae=B&&ue?Ft(K)+1:0,je=51+Ae,q=`min(100cqw - 2px, (100cqh - ${String(je)}px) * ${String(V/xe)})`,Me=Ae?`max(${q}, min(100cqw - 2px, ${String(rn)}px))`:q;return(0,F.jsx)(`div`,{className:`flex h-full min-h-0 flex-col gap-2`,"data-testid":`video-preview`,"data-t":j.t.toFixed(4),"data-ready":Ee?``:void 0,"data-swaps":ae,children:(0,F.jsx)(`div`,{ref:fe,className:`flex min-h-0 flex-1 flex-col items-center justify-start [container-type:size]`,children:(0,F.jsxs)(`div`,{className:`box-content overflow-hidden border`,style:{width:Me},"data-testid":`player`,children:[(0,F.jsx)(`div`,{ref:p,className:y(`relative mx-auto overflow-hidden`,we),style:{width:q,height:`calc(${q} * ${String(xe/V)})`},children:Te}),B?(0,F.jsx)(dn,{timeline:B,state:j,open:ue,onOpen:de,onToggle:()=>{L({type:j.playing?`pause`:`play`})},onSeek:Ce}):(0,F.jsx)(`div`,{className:`h-12 border-t`}),B&&ue?(0,F.jsx)(Zt,{timeline:B,texts:x.texts,tracks:x.tracks,rows:K,state:j,onSeek:Ce}):null]})})})}var $=2;function dn({timeline:e,state:t,open:n,onOpen:r,onToggle:i,onSeek:a}){let o=X(),{parts:s}=e,c=Math.max(0,s.findIndex((e,n)=>n===s.length-1||t.t<e.end)),l=s[c];return(0,F.jsxs)(`div`,{className:`relative flex h-12 items-center gap-3 border-t px-3`,"data-testid":`transport`,children:[(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(A,{size:`icon-sm`,className:`rounded-md`,"aria-label":t.playing?o.pause:o.play,"data-testid":`play`,onClick:i,children:t.playing?(0,F.jsx)(N,{className:`fill-current`}):(0,F.jsx)(ve,{className:`translate-x-px fill-current`})}),(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,"data-testid":`clock`,children:[J(Math.min(t.t,e.duration)),(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[` / `,J(e.duration)]})]})]}),n?(0,F.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:l?(0,F.jsxs)(`span`,{className:`text-muted-foreground max-w-[40%] truncate font-mono text-micro`,"data-testid":`scene-now`,children:[String(c+1),` · `,l.title??l.key]}):null}):(0,F.jsx)(fn,{timeline:e,state:t,onSeek:a}),(0,F.jsx)(A,{size:`icon-sm`,variant:`ghost`,className:`text-muted-foreground -mr-1`,"aria-label":n?o.hideTimeline:o.showTimeline,title:n?o.hideTimeline:o.showTimeline,"aria-expanded":n,"data-testid":`timeline-toggle`,onClick:()=>{r(!n)},children:n?(0,F.jsx)(ae,{}):(0,F.jsx)(de,{})})]})}function fn({timeline:e,state:t,onSeek:n}){let r=X(),{duration:i,fps:a}=e,o=Math.max(0,i-1/a),s=e.parts.length?e.parts.map((e,t)=>({key:e.key,name:e.title??String(t+1),start:e.start,end:e.end})):[{key:``,name:``,start:0,end:i}],c=(s.length-1)*$,[l,u]=(0,P.useState)(),[d,f]=(0,P.useState)(),p=Math.min(l??t.t,i),m=e=>Math.max(0,s.findIndex((t,n)=>n===s.length-1||e<t.end)),h=s[m(p)],g=e=>{let t=e.currentTarget.getBoundingClientRect(),n=Math.min(t.width,Math.max(0,e.clientX-t.left)),r=Math.max(1,t.width-c),l=0,u=i;for(let e of s){let t=r*(e.end-e.start)/Math.max(i,1e-6);if(n<=l+t+$/2){let r=Math.min(1,Math.max(0,(n-l)/Math.max(t,1)));u=e.start+r*(e.end-e.start);break}l+=t+$}return{x:n,t:Math.min(Math.max(Ge(u,a),0),o)}},_=e=>{n(Math.min(Math.max(Ge(e,a),0),o))},v=d?s[m(d.t)]?.name:void 0;return(0,F.jsxs)(`div`,{role:`slider`,tabIndex:0,"aria-label":r.seek,"aria-valuemin":0,"aria-valuemax":Math.round(i*100)/100,"aria-valuenow":Math.round(p*100)/100,"aria-valuetext":r.timeOf(J(p),J(i),h?.name??``),"data-testid":`scrubber`,className:`group/scrub focus-visible:outline-ring relative h-6 min-w-0 flex-1 cursor-pointer touch-none rounded-sm outline-none focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId);let t=g(e);u(t.t),f(t),n(t.t)},onPointerMove:e=>{let t=g(e);f(t),l!==void 0&&t.t!==l&&(u(t.t),n(t.t))},onPointerUp:()=>{u(void 0)},onPointerCancel:()=>{u(void 0)},onPointerLeave:()=>{f(void 0)},onKeyDown:e=>{if(e.key===`ArrowLeft`)_(t.t-1);else if(e.key===`ArrowRight`)_(t.t+1);else if(e.key===`Home`)_(0);else if(e.key===`End`)_(o);else return;e.preventDefault()},children:[(0,F.jsx)(`div`,{className:`absolute inset-x-0 top-1/2 flex h-1 -translate-y-1/2 transition-[height] duration-100 group-hover/scrub:h-1.5`,style:{gap:$},children:s.map(e=>{let t=Math.max(e.end-e.start,1e-6),n=Math.min(1,Math.max(0,(p-e.start)/t));return(0,F.jsx)(`span`,{"data-chapter":e.key,className:`bg-rule-strong relative min-w-0 overflow-hidden`,style:{flexGrow:t,flexBasis:0},children:(0,F.jsx)(`span`,{className:`bg-foreground absolute inset-y-0 left-0`,style:{width:`${String(n*100)}%`}})},e.key)})}),(0,F.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground ring-background pointer-events-none absolute top-1/2 h-3 w-[3px] -translate-x-1/2 -translate-y-1/2 ring-1`,style:{left:`calc((100% - ${String(c)}px) * ${String(p/Math.max(i,1e-6))} + ${String(m(p)*$)}px)`}}),d?(0,F.jsxs)(`span`,{role:`tooltip`,"data-testid":`scrub-tip`,className:`bg-popover text-popover-foreground shadow-overlay pointer-events-none absolute bottom-full z-10 mb-1.5 flex max-w-[16rem] -translate-x-1/2 items-baseline gap-2 rounded-sm px-2 py-1 whitespace-nowrap`,style:{left:d.x},children:[v?(0,F.jsx)(`span`,{className:`truncate font-serif text-dense`,children:v}):null,(0,F.jsx)(`span`,{className:`text-muted-foreground font-mono text-micro tabular-nums`,children:J(d.t)})]}):null]})}var pn={error:0,warn:1};function mn(e){let t=new Set;return[...e].sort((e,t)=>pn[e.level]-pn[t.level]).filter(e=>{let n=`${e.code}\u0000${e.message}\u0000${e.where?.file??``}`;return!t.has(n)&&(t.add(n),!0)})}function hn({error:e,problems:t,compact:n}){let i=X(),[a,o]=(0,P.useState)(!1),s=mn(t);return e===void 0?s.length?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`bg-background/90 text-foreground absolute bottom-2 left-2 z-20 flex items-center gap-1.5 rounded-sm px-2 py-1 font-mono text-micro`,onClick:()=>{o(!a)},"aria-expanded":a,"data-testid":`problems-chip`,children:[(0,F.jsx)(r,{className:y(`size-3.5`,s.some(e=>e.level===`error`)?`text-problem-text`:`text-caution-text`)}),i.problemsHere(s.length)]}),a?(0,F.jsxs)(`div`,{className:`bg-card absolute bottom-10 left-2 z-30 flex max-h-[60%] w-[min(420px,calc(100%-1rem))] flex-col rounded-md border shadow-[var(--allyhub-shadow-overlay)]`,"data-testid":`problems`,children:[(0,F.jsx)(`div`,{className:`flex items-center justify-end border-b px-1 py-1`,children:(0,F.jsx)(A,{size:`icon-xs`,variant:`ghost`,"aria-label":i.close,onClick:()=>{o(!1)},children:(0,F.jsx)(h,{})})}),(0,F.jsx)(`ul`,{className:`divide-y overflow-y-auto`,children:s.map((e,t)=>(0,F.jsxs)(`li`,{"data-code":e.code,className:`px-3 py-2 text-sm leading-relaxed`,children:[(0,F.jsxs)(`span`,{className:`text-muted-foreground mr-2 font-mono text-micro`,children:[e.level===`error`?i.levelError:i.levelWarn,` ·`,` `,e.code]}),e.message]},`${e.code}-${String(t)}`))})]}):null]}):null:(0,F.jsx)(`div`,{className:y(`z-20 overflow-auto text-left`,n?`bg-background/94 absolute inset-x-0 bottom-0 max-h-[45%] border-t px-4 py-3`:`bg-background/96 absolute inset-0 grid content-center justify-items-center p-5 text-center`),"data-testid":`stage-overlay`,"data-compact":n?`true`:void 0,role:`alert`,children:(0,F.jsxs)(`p`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,F.jsx)(r,{className:`text-problem-text size-4`,"aria-hidden":!0}),n?i.previewFailedKept:i.previewFailed]})})}var gn=1200;function _n({item:e,piece:t,version:n,revision:r,start:i,problems:a,stageProblems:o=!0,loaded:s,onLoaded:c}){let[l,u]=(0,P.useState)(),[d,f]=(0,P.useState)();(0,P.useEffect)(()=>{if(l===void 0)return;let e=setTimeout(()=>{f(l)},gn);return()=>{clearTimeout(e)}},[l]);let p=l!==void 0&&d===l?l:void 0,[m,h]=(0,P.useState)(n.key);m!==n.key&&(h(n.key),u(void 0));let g=[...a,...o?s?.problems??[]:[]];return(0,F.jsx)(`div`,{className:`bg-paper size-full p-4 min-[560px]:p-6`,children:(0,F.jsx)(un,{item:e,version:n.key,revision:r,start:i,width:t.width,height:t.height,overlay:(0,F.jsx)(hn,{error:p,problems:g,compact:s!==void 0}),onLoaded:e=>{c(e),u(void 0)},onError:u})})}function vn(e,t,n){let r=t.versions.filter(e=>n?.includes(e.key)!==!1).flatMap(n=>pt(e,t.piece,n)).filter(e=>e.level===`error`).map(e=>`${e.code}: ${e.message}`);return new Set(r).size}function yn(){let e=X(),t=O(),n=t?.item.dir,r=w[D(t?.locale)],i=t?.place,a=ct(),{data:o,error:s}=st(`video/versions`,n===void 0?void 0:{item:n},[a]),[c,l]=ut(`video-editor.version:${n??``}`,``),u=lt(),d=o?ft(o,c):void 0,[f,p]=(0,P.useState)(),m=d&&f?.key===`${n??``}\n${d.key}`?f.loaded:void 0;if(n===void 0||!o&&!s)return(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,F.jsx)(He,{label:e.loading})});if(!o||!d)return(0,F.jsx)(Ue,{title:e.noVideo,className:`h-full justify-center`,children:s?.message});let h=t?.viewer===!0,g=u&&!h?pt(u.problems,o.piece,d):[],_=e=>e.lang===void 0?e.key:mt(e.lang,r),v=o.kind===`video`?m?.timeline:void 0,y=o.kind===`video`&&m!==void 0&&!m.text.some(e=>e.spoken!==void 0);return(0,F.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col`,"data-testid":`video-editor`,children:[(0,F.jsx)(le,{start:o.versions.length>1?(0,F.jsx)(ue,{testid:`video-bar`,children:(0,F.jsx)(pe,{id:`language`,children:(0,F.jsxs)(me,{value:d.key,onValueChange:e=>{l(e)},children:[(0,F.jsx)(j,{"aria-label":e.version,className:`max-w-[16rem]`,"data-testid":`version`,children:(0,F.jsx)(se,{})}),(0,F.jsx)(ce,{position:`popper`,align:`start`,children:o.versions.map(e=>(0,F.jsx)(re,{value:e.key,className:`text-xs`,title:e.key,children:_(e)},e.key))})]})})}):void 0,exports:{versions:o.versions.map(e=>({key:e.key,label:_(e)})),shown:d.key,facts:[`${String(o.width)} × ${String(o.height)}`,...v?[`${String(v.fps)} fps`,J(v.duration)]:[]].join(` · `),unavailable:y?{srt:e.noVoice}:{},check:{waiting:u?.status===`waiting`||u?.status===`running`,problems:e=>u?.status===`done`?vn(u.problems,o,e):0}}}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,F.jsx)(_n,{item:n,piece:o,version:d,revision:a,start:i!==void 0&&`t`in i?{t:i.t}:void 0,problems:g,stageProblems:!h,loaded:m,onLoaded:e=>{p({key:`${n}\n${d.key}`,loaded:e})}})})]})}var bn=e({VideoEditor:()=>yn});export{ft as a,ut as c,He as d,ve as f,mt as i,st as l,vn as n,lt as o,N as p,ht as r,ct as s,bn as t,Ue as u};