conversion-ui-library 1.0.9 → 1.1.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"EditorTextField.d.ts","sourceRoot":"","sources":["../../../src/components/EditorTextField/EditorTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,yBAAyB,CAAC;AAyBjC,QAAA,MAAM,mBAAmB;;;;;mFA0BxB,CAAC;AAkBF,MAAM,WAAW,oBACf,SAAQ,YAAY,CAAC,OAAO,mBAAmB,CAAC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EACL,YAAY,GACZ,YAAY,GACZ,KAAK,GACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK,GACL,UAAU,GACV,KAAK,GACL,MAAM,GACN,WAAW,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,6FAiK3B,CAAC"}
1
+ {"version":3,"file":"EditorTextField.d.ts","sourceRoot":"","sources":["../../../src/components/EditorTextField/EditorTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,yBAAyB,CAAC;AAyBjC,QAAA,MAAM,mBAAmB;;;;;mFA0BxB,CAAC;AAkBF,MAAM,WAAW,oBACf,SAAQ,YAAY,CAAC,OAAO,mBAAmB,CAAC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EACL,YAAY,GACZ,YAAY,GACZ,KAAK,GACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK,GACL,UAAU,GACV,KAAK,GACL,MAAM,GACN,WAAW,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,6FAuK3B,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -132,4 +132,4 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
132
132
  `+e.scrub();for(let n of e.markers)r.marks.push(n)}return this.finishLeaf(r),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let r=this.fragments.takeNodes(this);return r?(this.absoluteLineStart+=r,this.lineStart=X_(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let r=Pve;if(r.end=e,e>=this.to)r.text="";else if(r.text=this.lineChunkAt(e),r.end+=r.text.length,this.ranges.length>1){let n=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<r.end;){i++;let o=this.ranges[i].from,a=this.lineChunkAt(o);r.end=o+a.length,r.text=r.text.slice(0,this.ranges[i-1].to-n)+a,n=r.end-r.text.length}}return r}readLine(){let{line:e}=this,{text:r,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(r);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],o=this.parser.skipContextMarkup[i.type];if(!o)throw new Error("Unhandled block context "+F[i.type]);let a=this.line.markers.length;if(!o(i,this,e)){this.line.markers.length>a&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let r=this.input.chunk(e),n;if(this.input.lineChunks)n=r==`
133
133
  `?"":r;else{let i=r.indexOf(`
134
134
  `);n=i<0?r:r.slice(0,i)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,r,n=0){this.block=Sd.create(e,n,this.lineStart+r,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,r,n=0){this.startContext(this.parser.getNodeType(e),r,n)}addNode(e,r,n){typeof e=="number"&&(e=new Te(this.parser.nodeSet.types[e],Va,Va,(n??this.prevLineEnd())-r)),this.block.addChild(e,r-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,r){this.addNode(this.buffer.writeElements(w1(r.children,e.marks),-r.from).finish(r.type,r.to-r.from),r.from)}finishContext(){let e=this.stack.pop(),r=this.stack[this.stack.length-1];r.addChild(e.toTree(this.parser.nodeSet),e.from-r.from),this.block=r}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?R_(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let r=w1(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(r,-e.start).finish(F.Paragraph,e.content.length),e.start)}elt(e,r,n,i){return typeof e=="string"?ve(this.parser.getNodeType(e),r,n,i):new j_(e,r)}get buffer(){return new __(this.parser.nodeSet)}}function R_(t,e,r,n,i){let o=t[e].to,a=[],s=[],l=r.from+n;function c(u,f){for(;f?u>=o:u>o;){let d=t[e+1].from-o;n+=d,u+=d,e++,o=t[e].to}}for(let u=r.firstChild;u;u=u.nextSibling){c(u.from+n,!0);let f=u.from+n,d,h=i.get(u.tree);h?d=h:u.to+n>o?(d=R_(t,e,u,n,i),c(u.to+n,!1)):d=u.toTree(),a.push(d),s.push(f-l)}return c(r.to+n,!1),new Te(r.type,a,s,r.to+n-l,r.tree?r.tree.propValues:void 0)}class rp extends pb{constructor(e,r,n,i,o,a,s,l,c){super(),this.nodeSet=e,this.blockParsers=r,this.leafBlockParsers=n,this.blockNames=i,this.endLeafBlock=o,this.skipContextMarkup=a,this.inlineParsers=s,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,r,n){let i=new kve(this,e,r,n);for(let o of this.wrappers)i=o(i,e,r,n);return i}configure(e){let r=x1(e);if(!r)return this;let{nodeSet:n,skipContextMarkup:i}=this,o=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),s=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),f=this.wrappers;if(Ts(r.defineNodes)){i=Object.assign({},i);let d=n.types.slice(),h;for(let O of r.defineNodes){let{name:p,block:g,composite:y,style:b}=typeof O=="string"?{name:O}:O;if(d.some(S=>S.name==p))continue;y&&(i[d.length]=(S,k,Q)=>y(k,Q,S.value));let x=d.length,w=y?["Block","BlockContext"]:g?x>=F.ATXHeading1&&x<=F.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;d.push(lt.define({id:x,name:p,props:w&&[[fe.group,w]]})),b&&(h||(h={}),Array.isArray(b)||b instanceof ar?h[p]=b:Object.assign(h,b))}n=new Pc(d),h&&(n=n.extend(wn(h)))}if(Ts(r.props)&&(n=n.extend(...r.props)),Ts(r.remove))for(let d of r.remove){let h=this.blockNames.indexOf(d),O=this.inlineNames.indexOf(d);h>-1&&(o[h]=a[h]=void 0),O>-1&&(l[O]=void 0)}if(Ts(r.parseBlock))for(let d of r.parseBlock){let h=s.indexOf(d.name);if(h>-1)o[h]=d.parse,a[h]=d.leaf;else{let O=d.before?Cu(s,d.before):d.after?Cu(s,d.after)+1:s.length-1;o.splice(O,0,d.parse),a.splice(O,0,d.leaf),s.splice(O,0,d.name)}d.endLeaf&&u.push(d.endLeaf)}if(Ts(r.parseInline))for(let d of r.parseInline){let h=c.indexOf(d.name);if(h>-1)l[h]=d.parse;else{let O=d.before?Cu(c,d.before):d.after?Cu(c,d.after)+1:c.length-1;l.splice(O,0,d.parse),c.splice(O,0,d.name)}}return r.wrap&&(f=f.concat(r.wrap)),new rp(n,o,a,s,u,i,l,c,f)}getNodeType(e){let r=this.nodeTypes[e];if(r==null)throw new RangeError(`Unknown node type '${e}'`);return r}parseInline(e,r){let n=new Lb(this,e,r);e:for(let i=r;i<n.end;){let o=n.char(i);for(let a of this.inlineParsers)if(a){let s=a(n,o,i);if(s>=0){i=s;continue e}}i++}return n.resolveMarkers(0)}}function Ts(t){return t!=null&&t.length>0}function x1(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=x1(t[0]);if(t.length==1)return e;let r=x1(t.slice(1));if(!r||!e)return e||r;let n=(a,s)=>(a||Va).concat(s||Va),i=e.wrap,o=r.wrap;return{props:n(e.props,r.props),defineNodes:n(e.defineNodes,r.defineNodes),parseBlock:n(e.parseBlock,r.parseBlock),parseInline:n(e.parseInline,r.parseInline),remove:n(e.remove,r.remove),wrap:i?o?(a,s,l,c)=>i(o(a,s,l,c),s,l,c):i:o}}function Cu(t,e){let r=t.indexOf(e);if(r<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return r}let M_=[lt.none];for(let t=1,e;e=F[t];t++)M_[t]=lt.define({id:t,name:e,props:t>=F.Escape?[]:[[fe.group,t in w_?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Va=[];let __=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,r,n,i=0){return this.content.push(e,r,n,4+i*4),this}writeElements(e,r=0){for(let n of e)n.writeTo(this,r);return this}finish(e,r){return Te.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:r})}},_l=class{constructor(e,r,n,i=Va){this.type=e,this.from=r,this.to=n,this.children=i}writeTo(e,r){let n=e.content.length;e.writeElements(this.children,r),e.content.push(this.type,this.from+r,this.to+r,e.content.length+4-n)}toTree(e){return new __(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class j_{constructor(e,r){this.tree=e,this.from=r}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Va}writeTo(e,r){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+r,this.to+r,-1)}toTree(){return this.tree}}function ve(t,e,r,n){return new _l(t,e,r,n)}const N_={resolve:"Emphasis",mark:"EmphasisMark"},I_={resolve:"Emphasis",mark:"EmphasisMark"},ao={},Pd={};class nr{constructor(e,r,n,i){this.type=e,this.from=r,this.to=n,this.side=i}}const Z4="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let jl=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{jl=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const zm={Escape(t,e,r){if(e!=92||r==t.end-1)return-1;let n=t.char(r+1);for(let i=0;i<Z4.length;i++)if(Z4.charCodeAt(i)==n)return t.append(ve(F.Escape,r,r+2));return-1},Entity(t,e,r){if(e!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(r+1,r+31));return n?t.append(ve(F.Entity,r,r+1+n[0].length)):-1},InlineCode(t,e,r){if(e!=96||r&&t.char(r-1)==96)return-1;let n=r+1;for(;n<t.end&&t.char(n)==96;)n++;let i=n-r,o=0;for(;n<t.end;n++)if(t.char(n)==96){if(o++,o==i&&t.char(n+1)!=96)return t.append(ve(F.InlineCode,r,n+1,[ve(F.CodeMark,r,r+i),ve(F.CodeMark,n+1-i,n+1)]))}else o=0;return-1},HTMLTag(t,e,r){if(e!=60||r==t.end-1)return-1;let n=t.slice(r+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(i)return t.append(ve(F.Autolink,r,r+1+i[0].length,[ve(F.LinkMark,r,r+1),ve(F.URL,r+1,r+i[0].length),ve(F.LinkMark,r+i[0].length,r+1+i[0].length)]));let o=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(o)return t.append(ve(F.Comment,r,r+1+o[0].length));let a=/^\?[^]*?\?>/.exec(n);if(a)return t.append(ve(F.ProcessingInstruction,r,r+1+a[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return s?t.append(ve(F.HTMLTag,r,r+1+s[0].length)):-1},Emphasis(t,e,r){if(e!=95&&e!=42)return-1;let n=r+1;for(;t.char(n)==e;)n++;let i=t.slice(r-1,r),o=t.slice(n,n+1),a=jl.test(i),s=jl.test(o),l=/\s|^$/.test(i),c=/\s|^$/.test(o),u=!c&&(!s||l||a),f=!l&&(!a||c||s),d=u&&(e==42||!f||a),h=f&&(e==42||!u||s);return t.append(new nr(e==95?N_:I_,r,n,(d?1:0)|(h?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(ve(F.HardBreak,r,r+2));if(e==32){let n=r+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=r+2)return t.append(ve(F.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new nr(ao,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new nr(Pd,r,r+2,1)):-1},LinkEnd(t,e,r){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let i=t.parts[n];if(i instanceof nr&&(i.type==ao||i.type==Pd)){if(!i.side||t.skipSpace(i.to)==r&&!/[(\[]/.test(t.slice(r+1,r+2)))return t.parts[n]=null,-1;let o=t.takeContent(n),a=t.parts[n]=Qve(t,o,i.type==ao?F.Link:F.Image,i.from,r+1);if(i.type==ao)for(let s=0;s<n;s++){let l=t.parts[s];l instanceof nr&&l.type==ao&&(l.side=0)}return a.to}}return-1}};function Qve(t,e,r,n,i){let{text:o}=t,a=t.char(i),s=i;if(e.unshift(ve(F.LinkMark,n,n+(r==F.Image?2:1))),e.push(ve(F.LinkMark,i-1,i)),a==40){let l=t.skipSpace(i+1),c=D_(o,l-t.offset,t.offset),u;c&&(l=t.skipSpace(c.to),l!=c.to&&(u=L_(o,l-t.offset,t.offset),u&&(l=t.skipSpace(u.to)))),t.char(l)==41&&(e.push(ve(F.LinkMark,i,i+1)),s=l+1,c&&e.push(c),u&&e.push(u),e.push(ve(F.LinkMark,l,s)))}else if(a==91){let l=z_(o,i-t.offset,t.offset,!1);l&&(e.push(l),s=l.to)}return ve(r,n,s,e)}function D_(t,e,r){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let o=t.charCodeAt(i);if(o==62)return ve(F.URL,e+r,i+1+r);if(o==60||o==10)return!1}return null}else{let i=0,o=e;for(let a=!1;o<t.length;o++){let s=t.charCodeAt(o);if(Rr(s))break;if(a)a=!1;else if(s==40)i++;else if(s==41){if(!i)break;i--}else s==92&&(a=!0)}return o>e?ve(F.URL,e+r,o+r):o==t.length?null:!1}}function L_(t,e,r){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let i=n==40?41:n;for(let o=e+1,a=!1;o<t.length;o++){let s=t.charCodeAt(o);if(a)a=!1;else{if(s==i)return ve(F.LinkTitle,e+r,o+1+r);s==92&&(a=!0)}}return null}function z_(t,e,r,n){for(let i=!1,o=e+1,a=Math.min(t.length,o+999);o<a;o++){let s=t.charCodeAt(o);if(i)i=!1;else{if(s==93)return n?!1:ve(F.LinkLabel,e+r,o+1+r);if(n&&!Rr(s)&&(n=!1),s==91)return!1;s==92&&(i=!0)}}return null}class Lb{constructor(e,r,n){this.parser=e,this.text=r,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,r){return this.text.slice(e-this.offset,r-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,r,n,i,o){return this.append(new nr(e,r,n,(i?1:0)|(o?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let r=this.parts[e];if(r instanceof nr&&(r.type==ao||r.type==Pd))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n<this.parts.length;n++){let i=this.parts[n];if(!(i instanceof nr&&i.type.resolve&&i.side&2))continue;let o=i.type==N_||i.type==I_,a=i.to-i.from,s,l=n-1;for(;l>=e;l--){let p=this.parts[l];if(p instanceof nr&&p.side&1&&p.type==i.type&&!(o&&(i.side&1||p.side&2)&&(p.to-p.from+a)%3==0&&((p.to-p.from)%3||a%3))){s=p;break}}if(!s)continue;let c=i.type.resolve,u=[],f=s.from,d=i.to;if(o){let p=Math.min(2,s.to-s.from,a);f=s.to-p,d=i.from+p,c=p==1?"Emphasis":"StrongEmphasis"}s.type.mark&&u.push(this.elt(s.type.mark,f,s.to));for(let p=l+1;p<n;p++)this.parts[p]instanceof _l&&u.push(this.parts[p]),this.parts[p]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,d));let h=this.elt(c,f,d,u);this.parts[l]=o&&s.from!=f?new nr(s.type,s.from,f,s.side):null,(this.parts[n]=o&&i.to!=d?new nr(i.type,d,i.to,i.side):null)?this.parts.splice(n,0,h):this.parts[n]=h}let r=[];for(let n=e;n<this.parts.length;n++){let i=this.parts[n];i instanceof _l&&r.push(i)}return r}findOpeningDelimiter(e){for(let r=this.parts.length-1;r>=0;r--){let n=this.parts[r];if(n instanceof nr&&n.type==e&&n.side&1)return r}return null}takeContent(e){let r=this.resolveMarkers(e);return this.parts.length=e,r}getDelimiterAt(e){let r=this.parts[e];return r instanceof nr?r:null}skipSpace(e){return Us(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?ve(this.parser.getNodeType(e),r,n,i):new j_(e,r)}}Lb.linkStart=ao;Lb.imageStart=Pd;function w1(t,e){if(!e.length)return t;if(!t.length)return e;let r=t.slice(),n=0;for(let i of e){for(;n<r.length&&r[n].to<i.to;)n++;if(n<r.length&&r[n].from<i.from){let o=r[n];o instanceof _l&&(r[n]=new _l(o.type,o.from,o.to,w1(o.children,[i])))}else r.splice(n++,0,i)}return r}const Cve=[F.CodeBlock,F.ListItem,F.OrderedList,F.BulletList];class Tve{constructor(e,r){this.fragments=e,this.input=r,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,r){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let o=this.fragment.to;for(;o>0&&this.input.read(o-1,o)!=`
135
- `;)o--;this.fragmentEnd=o?o-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=r;if(!n.childAfter(i))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(fe.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),o=e.absoluteLineStart,a=o,s=e.block.children.length,l=a,c=s;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let u=X_(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,u);else{let f=new Te(e.parser.nodeSet.types[F.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,r.tree),e.addNode(f,u)}if(r.type.is("Block")&&(Cve.indexOf(r.type.id)<0?(a=r.to-n,s=e.block.children.length):(a=l,s=c),l=r.to-n,c=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return a-o}}function X_(t,e){let r=t;for(let n=1;n<e.length;n++){let i=e[n-1].to,o=e[n].from;i<t&&(r-=o-i)}return r}const $ve=wn({"Blockquote/...":P.quote,HorizontalRule:P.contentSeparator,"ATXHeading1/... SetextHeading1/...":P.heading1,"ATXHeading2/... SetextHeading2/...":P.heading2,"ATXHeading3/...":P.heading3,"ATXHeading4/...":P.heading4,"ATXHeading5/...":P.heading5,"ATXHeading6/...":P.heading6,"Comment CommentBlock":P.comment,Escape:P.escape,Entity:P.character,"Emphasis/...":P.emphasis,"StrongEmphasis/...":P.strong,"Link/... Image/...":P.link,"OrderedList/... BulletList/...":P.list,"BlockQuote/...":P.quote,"InlineCode CodeText":P.monospace,"URL Autolink":P.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":P.processingInstruction,"CodeInfo LinkLabel":P.labelName,LinkTitle:P.string,Paragraph:P.content}),Ave=new rp(new Pc(M_).extend($ve),Object.keys(Qu).map(t=>Qu[t]),Object.keys(Qu).map(t=>E_[t]),Object.keys(Qu),Sve,w_,Object.keys(zm).map(t=>zm[t]),Object.keys(zm),[]);function Eve(t,e,r){let n=[];for(let i=t.firstChild,o=e;;i=i.nextSibling){let a=i?i.from:r;if(a>o&&n.push({from:o,to:a}),!i)break;o=i.to}return n}function Rve(t){let{codeParser:e,htmlParser:r}=t;return{wrap:NR((i,o)=>{let a=i.type.id;if(e&&(a==F.CodeBlock||a==F.FencedCode)){let s="";if(a==F.FencedCode){let c=i.node.getChild(F.CodeInfo);c&&(s=o.read(c.from,c.to))}let l=e(s);if(l)return{parser:l,overlay:c=>c.type.id==F.CodeText,bracketed:a==F.FencedCode}}else if(r&&(a==F.HTMLBlock||a==F.HTMLTag||a==F.CommentBlock))return{parser:r,overlay:Eve(i.node,i.from,i.to)};return null})}}const Mve={resolve:"Strikethrough",mark:"StrikethroughMark"},_ve={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":P.strikethrough}},{name:"StrikethroughMark",style:P.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),i=t.slice(r+2,r+3),o=/\s|^$/.test(n),a=/\s|^$/.test(i),s=jl.test(n),l=jl.test(i);return t.addDelimiter(Mve,r,r+2,!a&&(!l||o||s),!o&&(!s||a||l))},after:"Emphasis"}]};function Gs(t,e,r=0,n,i=0){let o=0,a=!0,s=-1,l=-1,c=!1,u=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let f=r;f<e.length;f++){let d=e.charCodeAt(f);d==124&&!c?((!a||s>-1)&&o++,a=!1,n&&(s>-1&&u(),n.push(t.elt("TableDelimiter",f+i,f+i+1))),s=l=-1):(c||d!=32&&d!=9)&&(s<0&&(s=f),l=f+1),c=!c&&d==92}return s>-1&&(o++,n&&u()),o}function V4(t,e){for(let r=e;r<t.length;r++){let n=t.charCodeAt(r);if(n==124)return!0;n==92&&r++}return!1}const Z_=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class q4{constructor(){this.rows=null}nextLine(e,r,n){if(this.rows==null){this.rows=!1;let i;if((r.next==45||r.next==58||r.next==124)&&Z_.test(i=r.text.slice(r.pos))){let o=[];Gs(e,n.content,0,o,n.start)==Gs(e,i,r.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,o),e.elt("TableDelimiter",e.lineStart+r.pos,e.lineStart+r.text.length)])}}else if(this.rows){let i=[];Gs(e,r.text,r.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+r.pos,e.lineStart+r.text.length,i))}return!1}finish(e,r){return this.rows?(e.addLeafElement(r,e.elt("Table",r.start,r.start+r.content.length,this.rows)),!0):!1}}const jve={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":P.heading}},"TableRow",{name:"TableCell",style:P.content},{name:"TableDelimiter",style:P.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return V4(e.content,0)?new q4:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof q4)||!V4(e.text,e.basePos))return!1;let n=t.peekLine();return Z_.test(n)&&Gs(t,e.text,e.basePos)==Gs(t,n,e.basePos)},before:"SetextHeading"}]};class Nve{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Ive={defineNodes:[{name:"Task",block:!0,style:P.list},{name:"TaskMarker",style:P.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Nve:null},after:"SetextHeading"}]},W4=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,B4=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Dve=/[\w-]+\.[\w-]+($|\/)/,Y4=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,F4=/\/[a-zA-Z\d@.]+/gy;function U4(t,e,r,n){let i=0;for(let o=e;o<r;o++)t[o]==n&&i++;return i}function Lve(t,e){B4.lastIndex=e;let r=B4.exec(t);if(!r||Dve.exec(r[0])[0].indexOf("_")>-1)return-1;let n=e+r[0].length;for(;;){let i=t[n-1],o;if(/[?!.,:*_~]/.test(i)||i==")"&&U4(t,e,n,")")>U4(t,e,n,"("))n--;else if(i==";"&&(o=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+o.index;else break}return n}function G4(t,e){Y4.lastIndex=e;let r=Y4.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const zve={parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;W4.lastIndex=n;let i=W4.exec(t.text),o=-1;if(!i)return-1;if(i[1]||i[2]){if(o=Lve(t.text,n+i[0].length),o>-1&&t.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,o));o=n+a[0].length}}else i[3]?o=G4(t.text,n):(o=G4(t.text,n+i[0].length),o>-1&&i[0]=="xmpp:"&&(F4.lastIndex=o,i=F4.exec(t.text),i&&(o=i.index+i[0].length)));return o<0?-1:(t.addElement(t.elt("URL",r,o+t.offset)),o+t.offset)}}]},Xve=[jve,Ive,_ve,zve];function V_(t,e,r){return(n,i,o)=>{if(i!=t||n.char(o+1)==t)return-1;let a=[n.elt(r,o,o+1)];for(let s=o+1;s<n.end;s++){let l=n.char(s);if(l==t)return n.addElement(n.elt(e,o,s+1,a.concat(n.elt(r,s,s+1))));if(l==92&&a.push(n.elt("Escape",s,s+++2)),Rr(l))break}return-1}}const Zve={defineNodes:[{name:"Superscript",style:P.special(P.content)},{name:"SuperscriptMark",style:P.processingInstruction}],parseInline:[{name:"Superscript",parse:V_(94,"Superscript","SuperscriptMark")}]},Vve={defineNodes:[{name:"Subscript",style:P.special(P.content)},{name:"SubscriptMark",style:P.processingInstruction}],parseInline:[{name:"Subscript",parse:V_(126,"Subscript","SubscriptMark")}]},qve={defineNodes:[{name:"Emoji",style:P.character}],parseInline:[{name:"Emoji",parse(t,e,r){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(r+1,t.end)))?-1:t.addElement(t.elt("Emoji",r,r+1+n[0].length))}}]},q_=Ob({commentTokens:{block:{open:"<!--",close:"-->"}}}),W_=new fe,B_=Ave.configure({props:[fi.add(t=>!t.is("Block")||t.is("Document")||S1(t)!=null||Wve(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),W_.add(S1),ui.add({Document:()=>null}),ho.add({Document:q_})]});function S1(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Wve(t){return t.name=="OrderedList"||t.name=="BulletList"}function Bve(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=S1(n.type))!=null&&i<=e)break;r=n}return r.to}const Yve=ipe.of((t,e,r)=>{for(let n=Xe(t).resolveInner(r,-1);n&&!(n.from<e);n=n.parent){let i=n.type.prop(W_);if(i==null)continue;let o=Bve(n,i);if(o>r)return{from:r,to:o}}return null});function zb(t){return new xr(q_,t,[],"markdown")}const Fve=zb(B_),Uve=B_.configure([Xve,Vve,Zve,qve,{props:[fi.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),kd=zb(Uve);function Gve(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=dd.matchLanguageName(t,r,!0),n instanceof dd)return n.support?n.support.language.parser:Tl.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class Xm{constructor(e,r,n,i,o,a,s){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=o,this.type=a,this.item=s}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let i=this.to-this.from-n.length-this.spaceAfter.length;i>0;i--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+F_(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Y_(t,e){let r=[],n=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return n;(i.name=="ListItem"||i.name=="Blockquote")&&r.push(i)}for(let i=r.length-1;i>=0;i--){let o=r[i],a,s=e.lineAt(o.from),l=o.from-s.from;if(o.name=="Blockquote"&&(a=/^ *>( ?)/.exec(s.text.slice(l))))n.push(new Xm(o,l,l+a[0].length,"",a[1],">",null));else if(o.name=="ListItem"&&o.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let c=a[3],u=a[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new Xm(o.parent,l,l+u,a[1],c,a[2],o))}else if(o.name=="ListItem"&&o.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let c=a[4],u=a[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let f=a[2];a[3]&&(f+=a[3].replace(/[xX]/," ")),n.push(new Xm(o.parent,l,l+u,a[1],c,f,o))}}return n}function F_(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function Zm(t,e,r,n=0){for(let i=-1,o=t;;){if(o.name=="ListItem"){let s=F_(o,e),l=+s[2];if(i>=0){if(l!=i+1)return;r.push({from:o.from+s[1].length,to:o.from+s[0].length,insert:String(i+2+n)})}i=l}let a=o.nextSibling;if(!a)break;o=a}}function Xb(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(kc)!=" ")return t;let n=Gn(t,4,r),i="";for(let o=n;o>0;)o>=4?(i+=" ",o-=4):(i+=" ",o--);return i+t.slice(r)}const Hve=(t={})=>({state:e,dispatch:r})=>{let n=Xe(e),{doc:i}=e,o=null,a=e.changeByRange(s=>{if(!s.empty||!kd.isActiveAt(e,s.from,-1)&&!kd.isActiveAt(e,s.from,1))return o={range:s};let l=s.from,c=i.lineAt(l),u=Y_(n.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return o={range:s};let f=u[u.length-1];if(f.to-f.spaceAfter.length>l-c.from)return o={range:s};let d=l>=f.to-f.spaceAfter.length&&!/\S/.test(c.text.slice(f.to));if(f.item&&d){let y=f.node.firstChild,b=f.node.getChild("ListItem","ListItem");if(y.to>=l||b&&b.to<l||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let x=u.length>1?u[u.length-2]:null,w,S="";x&&x.item?(w=c.from+x.from,S=x.marker(i,1)):w=c.from+(x?x.to:0);let k=[{from:w,to:l,insert:S}];return f.node.name=="OrderedList"&&Zm(f.item,i,k,-2),x&&x.node.name=="OrderedList"&&Zm(x.item,i,k),{range:V.cursor(w+S.length),changes:k}}else{let x=K4(u,e,c);return{range:V.cursor(l+x.length+1),changes:{from:c.from,insert:x+e.lineBreak}}}}if(f.node.name=="Blockquote"&&d&&c.from){let y=i.lineAt(c.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==f.from){let x=e.changes([{from:y.from+b.index,to:y.to},{from:c.from+f.from,to:c.to}]);return{range:s.map(x),changes:x}}}let h=[];f.node.name=="OrderedList"&&Zm(f.item,i,h);let O=f.item&&f.item.from<c.from,p="";if(!O||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=f.to)for(let y=0,b=u.length-1;y<=b;y++)p+=y==b&&!O?u[y].marker(i,1):u[y].blank(y<b?Gn(c.text,4,u[y+1].from)-p.length:null);let g=l;for(;g>c.from&&/\s/.test(c.text.charAt(g-c.from-1));)g--;return p=Xb(p,e),Jve(f.node,e.doc)&&(p=K4(u,e,c)+e.lineBreak+p),h.push({from:g,to:l,insert:e.lineBreak+p}),{range:V.cursor(g+p.length+1),changes:h}});return o?!1:(r(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},Kve=Hve();function H4(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Jve(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let i=e.lineAt(r.to),o=e.lineAt(n.from),a=/^[\s>]*$/.test(i.text);return i.number+(a?0:1)<o.number}function K4(t,e,r){let n="";for(let i=0,o=t.length-2;i<=o;i++)n+=t[i].blank(i<o?Gn(r.text,4,t[i+1].from)-n.length:null,i<o);return Xb(n,e)}function eye(t,e){let r=t.resolveInner(e,-1),n=e;H4(r)&&(n=r.from,r=r.parent);for(let i;i=r.childBefore(n);)if(H4(i))n=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")r=i.lastChild,n=r.to;else break;return r}const tye=({state:t,dispatch:e})=>{let r=Xe(t),n=null,i=t.changeByRange(o=>{let a=o.from,{doc:s}=t;if(o.empty&&kd.isActiveAt(t,o.from)){let l=s.lineAt(a),c=Y_(eye(r,a),s);if(c.length){let u=c[c.length-1],f=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(a-l.from>f&&!/\S/.test(l.text.slice(f,a-l.from)))return{range:V.cursor(l.from+f),changes:{from:l.from+f,to:a}};if(a-l.from==f&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let d=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(Gn(l.text,4,u.to)-Gn(l.text,4,u.from));return d==l.from&&(h=Xb(h,t)),{range:V.cursor(d+h.length),changes:{from:d,to:l.from+u.to,insert:h}}}if(d<a)return{range:V.cursor(d),changes:{from:d,to:a}}}}}return n={range:o}});return n?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},rye=[{key:"Enter",run:Kve},{key:"Backspace",run:tye}],U_=O_({matchClosingTags:!1});function nye(t={}){let{codeLanguages:e,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:i}=Fve,completeHTMLTags:o=!0,pasteURLAsLink:a=!0,htmlTagLanguage:s=U_}=t;if(!(i instanceof rp))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],c=[s.support,Yve],u;a&&c.push(sye),r instanceof Jn?(c.push(r.support),u=r.language):r&&(u=r);let f=e||u?Gve(e,u):void 0;l.push(Rve({codeParser:f,htmlParser:s.language.parser})),n&&c.push(bc.high(Yh.of(rye)));let d=zb(i.configure(l));return o&&c.push(d.data.of({autocomplete:iye})),new Jn(d,c)}function iye(t){let{state:e,pos:r}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(r-25,r));if(!n)return null;let i=Xe(e).resolveInner(r,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:r-n[0].length,to:r,options:oye(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Vm=null;function oye(){if(Vm)return Vm;let t=C1e(new pme(Se.create({extensions:U_}),0,!0));return Vm=t?t.options:[]}const aye=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,sye=le.domEventHandlers({paste:(t,e)=>{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!kd.isActiveAt(e.state,n.from,1)))return!1;let o=Xe(e.state),a=!1;return o.iterate({from:n.from,to:n.to,enter:s=>{(s.from>n.from||aye.test(s.name))&&(a=!0)},leave:s=>{s.to<n.to&&(a=!0)}}),a?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),P1=1,lye=2,cye=3,uye=4,fye=5,dye=36,hye=37,pye=38,Oye=11,mye=13;function gye(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function vye(t){return t==9||t==10||t==13||t==32}let J4=null,e3=null,t3=0;function k1(t,e){let r=t.pos+e;if(e3==t&&t3==r)return J4;for(;vye(t.peek(e));)e++;let n="";for(;;){let i=t.peek(e);if(!gye(i))break;n+=String.fromCharCode(i),e++}return e3=t,t3=r,J4=n||null}function r3(t,e){this.name=t,this.parent=e}const yye=new ep({start:null,shift(t,e,r,n){return e==P1?new r3(k1(n,1)||"",t):t},reduce(t,e){return e==Oye&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==P1||i==mye?new r3(k1(n,1)||"",t):t},strict:!1}),bye=new it((t,e)=>{if(t.next==60){if(t.advance(),t.next==47){t.advance();let r=k1(t,0);if(!r)return t.acceptToken(fye);if(e.context&&r==e.context.name)return t.acceptToken(lye);for(let n=e.context;n;n=n.parent)if(n.name==r)return t.acceptToken(cye,-2);t.acceptToken(uye)}else if(t.next!=33&&t.next!=63)return t.acceptToken(P1)}},{contextual:!0});function Zb(t,e){return new it(r=>{let n=0,i=e.charCodeAt(0);e:for(;!(r.next<0);r.advance(),n++)if(r.next==i){for(let o=1;o<e.length;o++)if(r.peek(o)!=e.charCodeAt(o))continue e;break}n&&r.acceptToken(t)})}const xye=Zb(dye,"-->"),wye=Zb(hye,"?>"),Sye=Zb(pye,"]]>"),Pye=wn({Text:P.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":P.angleBracket,TagName:P.tagName,"MismatchedCloseTag/TagName":[P.tagName,P.invalid],AttributeName:P.attributeName,AttributeValue:P.attributeValue,Is:P.definitionOperator,"EntityReference CharacterReference":P.character,Comment:P.blockComment,ProcessingInst:P.processingInstruction,DoctypeDecl:P.documentMeta,Cdata:P.special(P.string)}),kye=yn.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO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[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:yye,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[Pye],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#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P|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[bye,xye,wye,Sye,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function Wu(t,e){let r=e&&e.getChild("TagName");return r?t.sliceString(r.from,r.to):""}function qm(t,e){let r=e&&e.firstChild;return!r||r.name!="OpenTag"?"":Wu(t,r)}function Qye(t,e,r){let n=e&&e.getChildren("Attribute").find(o=>o.from<=r&&o.to>=r),i=n&&n.getChild("AttributeName");return i?t.sliceString(i.from,i.to):""}function Wm(t){for(let e=t&&t.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function Cye(t,e){var r;let n=Xe(t).resolveInner(e,-1),i=null;for(let o=n;!i&&o.parent;o=o.parent)(o.name=="OpenTag"||o.name=="CloseTag"||o.name=="SelfClosingTag"||o.name=="MismatchedCloseTag")&&(i=o);if(i&&(i.to>e||i.lastChild.type.isError)){let o=i.parent;if(n.name=="TagName")return i.name=="CloseTag"||i.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:o}:{type:"openTag",from:n.from,context:Wm(o)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:i};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:i};let a=n==i||n.name=="Attribute"?n.childBefore(e):n;return a?.name=="StartTag"?{type:"openTag",from:e,context:Wm(o)}:a?.name=="StartCloseTag"&&a.to<=e?{type:"closeTag",from:e,context:o}:a?.name=="Is"?{type:"attrValue",from:e,context:i}:a?{type:"attrName",from:e,context:i}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((r=n.lastChild)===null||r===void 0)&&r.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:Wm(n)}:null}let Tye=class{constructor(e,r,n){this.attrs=r,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(i=>({label:i,type:"text"})):[]}};const Bm=/^[:\-\.\w\u00b7-\uffff]*$/;function n3(t){return Object.assign(Object.assign({type:"property"},t.completion||{}),{label:t.name})}function i3(t){return typeof t=="string"?{label:`"${t}"`,type:"constant"}:/^"/.test(t.label)?t:Object.assign(Object.assign({},t),{label:`"${t.label}"`})}function $ye(t,e){let r=[],n=[],i=Object.create(null);for(let l of e){let c=n3(l);r.push(c),l.global&&n.push(c),l.values&&(i[l.name]=l.values.map(i3))}let o=[],a=[],s=Object.create(null);for(let l of t){let c=n,u=i;l.attributes&&(c=c.concat(l.attributes.map(d=>typeof d=="string"?r.find(h=>h.label==d)||{label:d,type:"property"}:(d.values&&(u==i&&(u=Object.create(u)),u[d.name]=d.values.map(i3)),n3(d)))));let f=new Tye(l,c,u);s[f.name]=f,o.push(f),l.top&&a.push(f)}a.length||(a=o);for(let l=0;l<o.length;l++){let c=t[l],u=o[l];if(c.children)for(let f of c.children)s[f]&&u.children.push(s[f]);else u.children=o}return l=>{var c;let{doc:u}=l.state,f=Cye(l.state,l.pos);if(!f||f.type=="tag"&&!l.explicit)return null;let{type:d,from:h,context:O}=f;if(d=="openTag"){let p=a,g=qm(u,O);if(g){let y=s[g];p=y?.children||o}return{from:h,options:p.map(y=>y.completion),validFor:Bm}}else if(d=="closeTag"){let p=qm(u,O);return p?{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)==">"?1:0),options:[((c=s[p])===null||c===void 0?void 0:c.closeNameCompletion)||{label:p+">",type:"type"}],validFor:Bm}:null}else if(d=="attrName"){let p=s[Wu(u,O)];return{from:h,options:p?.attrs||n,validFor:Bm}}else if(d=="attrValue"){let p=Qye(u,O,h);if(!p)return null;let g=s[Wu(u,O)],y=(g?.attrValues||i)[p];return!y||!y.length?null:{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)=='"'?1:0),options:y,validFor:/^"[^"]*"?$/}}else if(d=="tag"){let p=qm(u,O),g=s[p],y=[],b=O&&O.lastChild;p&&(!b||b.name!="CloseTag"||Wu(u,b)!=p)&&y.push(g?g.closeCompletion:{label:"</"+p+">",type:"type",boost:2});let x=y.concat((g?.children||(O?o:a)).map(w=>w.openCompletion));if(O&&g?.text.length){let w=O.firstChild;w.to>l.pos-20&&!/\S/.test(l.state.sliceDoc(w.to,l.pos))&&(x=x.concat(g.text))}return{from:h,options:x,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const Q1=vn.define({name:"xml",parser:kye.configure({props:[ui.add({Element(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),fi.add({Element(t){let e=t.firstChild,r=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:r.name=="CloseTag"?r.from:t.to}}}),vb.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function Aye(t={}){let e=[Q1.data.of({autocomplete:$ye(t.elements||[],t.attributes||[])})];return t.autoCloseTags!==!1&&e.push(Eye),new Jn(Q1,e)}function o3(t,e,r=t.length){if(!e)return"";let n=e.firstChild,i=n&&n.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,r)):""}const Eye=le.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!Q1.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:a}=o,s=a.changeByRange(l=>{var c,u,f;let{head:d}=l,h=a.doc.sliceString(d-1,d)==n,O=Xe(a).resolveInner(d,-1),p;if(h&&n==">"&&O.name=="EndTag"){let g=O.parent;if(((u=(c=g.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=o3(a.doc,g.parent,d))){let y=d+(a.doc.sliceString(d,d+1)===">"?1:0),b=`</${p}>`;return{range:l,changes:{from:d,to:y,insert:b}}}}else if(h&&n=="/"&&O.name=="StartCloseTag"){let g=O.parent;if(O.from==d-2&&((f=g.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(p=o3(a.doc,g,d))){let y=d+(a.doc.sliceString(d,d+1)===">"?1:0),b=`${p}>`;return{range:V.cursor(d+b.length,-1),changes:{from:d,to:y,insert:b}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([o,a.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Rye="#e5c07b",a3="#e06c75",Mye="#56b6c2",_ye="#ffffff",Bu="#abb2bf",C1="#7d8799",jye="#61afef",Nye="#98c379",s3="#d19a66",Iye="#c678dd",Dye="#21252b",l3="#2c313a",c3="#282c34",Ym="#353a42",Lye="#3E4451",u3="#528bff",zye=le.theme({"&":{color:Bu,backgroundColor:c3},".cm-content":{caretColor:u3},".cm-cursor, .cm-dropCursor":{borderLeftColor:u3},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Lye},".cm-panels":{backgroundColor:Dye,color:Bu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:c3,color:C1,border:"none"},".cm-activeLineGutter":{backgroundColor:l3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ym},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ym,borderBottomColor:Ym},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:l3,color:Bu}}},{dark:!0}),Xye=Qc.define([{tag:P.keyword,color:Iye},{tag:[P.name,P.deleted,P.character,P.propertyName,P.macroName],color:a3},{tag:[P.function(P.variableName),P.labelName],color:jye},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:s3},{tag:[P.definition(P.name),P.separator],color:Bu},{tag:[P.typeName,P.className,P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:Rye},{tag:[P.operator,P.operatorKeyword,P.url,P.escape,P.regexp,P.link,P.special(P.string)],color:Mye},{tag:[P.meta,P.comment],color:C1},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.link,color:C1,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:a3},{tag:[P.atom,P.bool,P.special(P.variableName)],color:s3},{tag:[P.processingInstruction,P.string,P.inserted],color:Nye},{tag:P.invalid,color:_ye}]),Zye=[zye,VR(Xye)],Vye=Qc.define([{tag:P.keyword,color:"#d73a49",fontWeight:"bold"},{tag:[P.name,P.deleted,P.character,P.macroName],color:"#22863a"},{tag:[P.propertyName],color:"#6f42c1"},{tag:[P.processingInstruction,P.string,P.inserted],color:"#032f62"},{tag:[P.function(P.variableName),P.labelName],color:"#6f42c1"},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:"#005cc5"},{tag:[P.definition(P.name),P.separator],color:"#24292e"},{tag:[P.className],color:"#6f42c1",fontWeight:"bold"},{tag:[P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:"#005cc5"},{tag:[P.typeName],color:"#d73a49",fontWeight:"bold"},{tag:[P.operator,P.operatorKeyword],color:"#d73a49"},{tag:[P.url,P.escape,P.regexp,P.link],color:"#032f62"},{tag:[P.meta,P.comment],color:"#6a737d",fontStyle:"italic"},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.link,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:"#005cc5"},{tag:[P.atom,P.bool,P.special(P.variableName)],color:"#e36209"},{tag:P.invalid,color:"#cb2431"}]),qye=Tr("w-full border transition-all duration-200 shadow-sm overflow-hidden",{variants:{variant:{outlined:"bg-white border-gray-200 hover:border-primary focus-within:border-primary",filled:"bg-soft border-transparent hover:bg-soft-1 focus-within:border-primary focus-within:bg-white",ghost:"bg-transparent border-transparent hover:border-primary focus-within:border-primary"},error:{true:"!border-red-500 !bg-white"},success:{true:"!border-green-500 !bg-white"},disabled:{true:"bg-soft-1 border-soft-1 cursor-not-allowed opacity-60 pointer-events-none"}},defaultVariants:{variant:"outlined"}}),Wye={javascript:Ls,typescript:()=>Ls({typescript:!0}),jsx:()=>Ls({jsx:!0}),tsx:()=>Ls({typescript:!0,jsx:!0}),python:Jge,json:n0e,html:O_,css:a_,sql:vve,markdown:nye,xml:Aye,yaml:()=>[],plaintext:()=>[]},G_=m.forwardRef(({className:t,variant:e,error:r,success:n,disabled:i,label:o,helperText:a,required:s,value:l,defaultValue:c,onChange:u,language:f="javascript",theme:d="light",height:h="200px",placeholder:O,lineNumbers:p=!0,readOnly:g=!1},y)=>{const b=m.useRef(null),x=m.useRef(null),[w]=m.useState(l!==void 0);m.useEffect(()=>{if(!b.current)return;const k=[Ppe(),Yh.of([...TOe,...Mpe]),le.lineWrapping,Se.readOnly.of(i||g||!1),le.editable.of(!i&&!g)],Q=Wye[f];Q&&k.push(Q()),d==="dark"?k.push(Zye):k.push(VR(Vye)),O&&k.push(ghe(O)),p&&k.push(Qhe()),u&&k.push(le.updateListener.of(_=>{if(_.docChanged){const M=_.state.doc.toString();u(M)}}));const T=Se.create({doc:w?l:c||"",extensions:k}),E=new le({state:T,parent:b.current});return x.current=E,()=>{E.destroy(),x.current=null}},[]),m.useEffect(()=>{if(w&&x.current&&l!==void 0){const k=x.current.state.doc.toString();k!==l&&x.current.dispatch({changes:{from:0,to:k.length,insert:l}})}},[l,w]);const S=typeof h=="number"?`${h}px`:h;return v.jsxs("div",{className:"w-full",ref:y,children:[o&&v.jsxs(je,{size:"small",fontWeight:"medium",className:"mb-2 block text-sub",children:[o,s&&v.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),v.jsx("div",{className:z(qye({variant:e,error:r,success:n,disabled:i}),"rounded-md",t),style:{height:S},children:v.jsx("div",{ref:b,className:z("h-full overflow-auto",d==="dark"?"cm-theme-dark":""),style:{fontSize:"14px"}})}),a&&v.jsx("p",{className:z("mt-1 text-xs",r?"text-red-500":n?"text-green-500":"text-sub"),children:a})]})});G_.displayName="EditorTextField";exports.AppTooltip=y9;exports.Autocomplete=H6;exports.Button=ya;exports.Chart=hue;exports.Chip=jC;exports.ConversionSidebar=Vue;exports.DropdownMenu=hv;exports.DropdownMenuCheckboxItem=e7;exports.DropdownMenuContent=eh;exports.DropdownMenuGroup=HT;exports.DropdownMenuItem=nl;exports.DropdownMenuLabel=Ov;exports.DropdownMenuPortal=pB;exports.DropdownMenuRadioGroup=mB;exports.DropdownMenuRadioItem=t7;exports.DropdownMenuSeparator=r7;exports.DropdownMenuShortcut=n7;exports.DropdownMenuSub=OB;exports.DropdownMenuSubContent=JT;exports.DropdownMenuSubTrigger=KT;exports.DropdownMenuTrigger=pv;exports.EditorTextField=G_;exports.FilterSelect=dZ;exports.Heading=R3;exports.Icon=et;exports.Label=je;exports.Menu=gB;exports.Paragraph=E1;exports.Popup=Hq;exports.Progress=L3;exports.SearchInput=uQ;exports.StatusBadge=gZ;exports.Switch=v9;exports.Table=Wy;exports.TableBody=Yy;exports.TableCaption=d9;exports.TableCell=Uy;exports.TableComponent=Yue;exports.TableFooter=f9;exports.TableHead=Fy;exports.TableHeader=By;exports.TableRow=Jf;exports.Tabs=sL;exports.TabsContent=cQ;exports.TabsList=lQ;exports.TabsTrigger=sQ;exports.Text=Tt;exports.TextArea=NC;exports.TextField=i7;exports.Trend=Y1;
135
+ `;)o--;this.fragmentEnd=o?o-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=r;if(!n.childAfter(i))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(fe.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),o=e.absoluteLineStart,a=o,s=e.block.children.length,l=a,c=s;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let u=X_(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,u);else{let f=new Te(e.parser.nodeSet.types[F.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,r.tree),e.addNode(f,u)}if(r.type.is("Block")&&(Cve.indexOf(r.type.id)<0?(a=r.to-n,s=e.block.children.length):(a=l,s=c),l=r.to-n,c=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return a-o}}function X_(t,e){let r=t;for(let n=1;n<e.length;n++){let i=e[n-1].to,o=e[n].from;i<t&&(r-=o-i)}return r}const $ve=wn({"Blockquote/...":P.quote,HorizontalRule:P.contentSeparator,"ATXHeading1/... SetextHeading1/...":P.heading1,"ATXHeading2/... SetextHeading2/...":P.heading2,"ATXHeading3/...":P.heading3,"ATXHeading4/...":P.heading4,"ATXHeading5/...":P.heading5,"ATXHeading6/...":P.heading6,"Comment CommentBlock":P.comment,Escape:P.escape,Entity:P.character,"Emphasis/...":P.emphasis,"StrongEmphasis/...":P.strong,"Link/... Image/...":P.link,"OrderedList/... BulletList/...":P.list,"BlockQuote/...":P.quote,"InlineCode CodeText":P.monospace,"URL Autolink":P.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":P.processingInstruction,"CodeInfo LinkLabel":P.labelName,LinkTitle:P.string,Paragraph:P.content}),Ave=new rp(new Pc(M_).extend($ve),Object.keys(Qu).map(t=>Qu[t]),Object.keys(Qu).map(t=>E_[t]),Object.keys(Qu),Sve,w_,Object.keys(zm).map(t=>zm[t]),Object.keys(zm),[]);function Eve(t,e,r){let n=[];for(let i=t.firstChild,o=e;;i=i.nextSibling){let a=i?i.from:r;if(a>o&&n.push({from:o,to:a}),!i)break;o=i.to}return n}function Rve(t){let{codeParser:e,htmlParser:r}=t;return{wrap:NR((i,o)=>{let a=i.type.id;if(e&&(a==F.CodeBlock||a==F.FencedCode)){let s="";if(a==F.FencedCode){let c=i.node.getChild(F.CodeInfo);c&&(s=o.read(c.from,c.to))}let l=e(s);if(l)return{parser:l,overlay:c=>c.type.id==F.CodeText,bracketed:a==F.FencedCode}}else if(r&&(a==F.HTMLBlock||a==F.HTMLTag||a==F.CommentBlock))return{parser:r,overlay:Eve(i.node,i.from,i.to)};return null})}}const Mve={resolve:"Strikethrough",mark:"StrikethroughMark"},_ve={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":P.strikethrough}},{name:"StrikethroughMark",style:P.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),i=t.slice(r+2,r+3),o=/\s|^$/.test(n),a=/\s|^$/.test(i),s=jl.test(n),l=jl.test(i);return t.addDelimiter(Mve,r,r+2,!a&&(!l||o||s),!o&&(!s||a||l))},after:"Emphasis"}]};function Gs(t,e,r=0,n,i=0){let o=0,a=!0,s=-1,l=-1,c=!1,u=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let f=r;f<e.length;f++){let d=e.charCodeAt(f);d==124&&!c?((!a||s>-1)&&o++,a=!1,n&&(s>-1&&u(),n.push(t.elt("TableDelimiter",f+i,f+i+1))),s=l=-1):(c||d!=32&&d!=9)&&(s<0&&(s=f),l=f+1),c=!c&&d==92}return s>-1&&(o++,n&&u()),o}function V4(t,e){for(let r=e;r<t.length;r++){let n=t.charCodeAt(r);if(n==124)return!0;n==92&&r++}return!1}const Z_=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class q4{constructor(){this.rows=null}nextLine(e,r,n){if(this.rows==null){this.rows=!1;let i;if((r.next==45||r.next==58||r.next==124)&&Z_.test(i=r.text.slice(r.pos))){let o=[];Gs(e,n.content,0,o,n.start)==Gs(e,i,r.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,o),e.elt("TableDelimiter",e.lineStart+r.pos,e.lineStart+r.text.length)])}}else if(this.rows){let i=[];Gs(e,r.text,r.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+r.pos,e.lineStart+r.text.length,i))}return!1}finish(e,r){return this.rows?(e.addLeafElement(r,e.elt("Table",r.start,r.start+r.content.length,this.rows)),!0):!1}}const jve={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":P.heading}},"TableRow",{name:"TableCell",style:P.content},{name:"TableDelimiter",style:P.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return V4(e.content,0)?new q4:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof q4)||!V4(e.text,e.basePos))return!1;let n=t.peekLine();return Z_.test(n)&&Gs(t,e.text,e.basePos)==Gs(t,n,e.basePos)},before:"SetextHeading"}]};class Nve{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Ive={defineNodes:[{name:"Task",block:!0,style:P.list},{name:"TaskMarker",style:P.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Nve:null},after:"SetextHeading"}]},W4=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,B4=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Dve=/[\w-]+\.[\w-]+($|\/)/,Y4=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,F4=/\/[a-zA-Z\d@.]+/gy;function U4(t,e,r,n){let i=0;for(let o=e;o<r;o++)t[o]==n&&i++;return i}function Lve(t,e){B4.lastIndex=e;let r=B4.exec(t);if(!r||Dve.exec(r[0])[0].indexOf("_")>-1)return-1;let n=e+r[0].length;for(;;){let i=t[n-1],o;if(/[?!.,:*_~]/.test(i)||i==")"&&U4(t,e,n,")")>U4(t,e,n,"("))n--;else if(i==";"&&(o=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+o.index;else break}return n}function G4(t,e){Y4.lastIndex=e;let r=Y4.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const zve={parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;W4.lastIndex=n;let i=W4.exec(t.text),o=-1;if(!i)return-1;if(i[1]||i[2]){if(o=Lve(t.text,n+i[0].length),o>-1&&t.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,o));o=n+a[0].length}}else i[3]?o=G4(t.text,n):(o=G4(t.text,n+i[0].length),o>-1&&i[0]=="xmpp:"&&(F4.lastIndex=o,i=F4.exec(t.text),i&&(o=i.index+i[0].length)));return o<0?-1:(t.addElement(t.elt("URL",r,o+t.offset)),o+t.offset)}}]},Xve=[jve,Ive,_ve,zve];function V_(t,e,r){return(n,i,o)=>{if(i!=t||n.char(o+1)==t)return-1;let a=[n.elt(r,o,o+1)];for(let s=o+1;s<n.end;s++){let l=n.char(s);if(l==t)return n.addElement(n.elt(e,o,s+1,a.concat(n.elt(r,s,s+1))));if(l==92&&a.push(n.elt("Escape",s,s+++2)),Rr(l))break}return-1}}const Zve={defineNodes:[{name:"Superscript",style:P.special(P.content)},{name:"SuperscriptMark",style:P.processingInstruction}],parseInline:[{name:"Superscript",parse:V_(94,"Superscript","SuperscriptMark")}]},Vve={defineNodes:[{name:"Subscript",style:P.special(P.content)},{name:"SubscriptMark",style:P.processingInstruction}],parseInline:[{name:"Subscript",parse:V_(126,"Subscript","SubscriptMark")}]},qve={defineNodes:[{name:"Emoji",style:P.character}],parseInline:[{name:"Emoji",parse(t,e,r){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(r+1,t.end)))?-1:t.addElement(t.elt("Emoji",r,r+1+n[0].length))}}]},q_=Ob({commentTokens:{block:{open:"<!--",close:"-->"}}}),W_=new fe,B_=Ave.configure({props:[fi.add(t=>!t.is("Block")||t.is("Document")||S1(t)!=null||Wve(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),W_.add(S1),ui.add({Document:()=>null}),ho.add({Document:q_})]});function S1(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Wve(t){return t.name=="OrderedList"||t.name=="BulletList"}function Bve(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=S1(n.type))!=null&&i<=e)break;r=n}return r.to}const Yve=ipe.of((t,e,r)=>{for(let n=Xe(t).resolveInner(r,-1);n&&!(n.from<e);n=n.parent){let i=n.type.prop(W_);if(i==null)continue;let o=Bve(n,i);if(o>r)return{from:r,to:o}}return null});function zb(t){return new xr(q_,t,[],"markdown")}const Fve=zb(B_),Uve=B_.configure([Xve,Vve,Zve,qve,{props:[fi.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),kd=zb(Uve);function Gve(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=dd.matchLanguageName(t,r,!0),n instanceof dd)return n.support?n.support.language.parser:Tl.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class Xm{constructor(e,r,n,i,o,a,s){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=o,this.type=a,this.item=s}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let i=this.to-this.from-n.length-this.spaceAfter.length;i>0;i--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+F_(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Y_(t,e){let r=[],n=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return n;(i.name=="ListItem"||i.name=="Blockquote")&&r.push(i)}for(let i=r.length-1;i>=0;i--){let o=r[i],a,s=e.lineAt(o.from),l=o.from-s.from;if(o.name=="Blockquote"&&(a=/^ *>( ?)/.exec(s.text.slice(l))))n.push(new Xm(o,l,l+a[0].length,"",a[1],">",null));else if(o.name=="ListItem"&&o.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let c=a[3],u=a[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new Xm(o.parent,l,l+u,a[1],c,a[2],o))}else if(o.name=="ListItem"&&o.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let c=a[4],u=a[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let f=a[2];a[3]&&(f+=a[3].replace(/[xX]/," ")),n.push(new Xm(o.parent,l,l+u,a[1],c,f,o))}}return n}function F_(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function Zm(t,e,r,n=0){for(let i=-1,o=t;;){if(o.name=="ListItem"){let s=F_(o,e),l=+s[2];if(i>=0){if(l!=i+1)return;r.push({from:o.from+s[1].length,to:o.from+s[0].length,insert:String(i+2+n)})}i=l}let a=o.nextSibling;if(!a)break;o=a}}function Xb(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(kc)!=" ")return t;let n=Gn(t,4,r),i="";for(let o=n;o>0;)o>=4?(i+=" ",o-=4):(i+=" ",o--);return i+t.slice(r)}const Hve=(t={})=>({state:e,dispatch:r})=>{let n=Xe(e),{doc:i}=e,o=null,a=e.changeByRange(s=>{if(!s.empty||!kd.isActiveAt(e,s.from,-1)&&!kd.isActiveAt(e,s.from,1))return o={range:s};let l=s.from,c=i.lineAt(l),u=Y_(n.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return o={range:s};let f=u[u.length-1];if(f.to-f.spaceAfter.length>l-c.from)return o={range:s};let d=l>=f.to-f.spaceAfter.length&&!/\S/.test(c.text.slice(f.to));if(f.item&&d){let y=f.node.firstChild,b=f.node.getChild("ListItem","ListItem");if(y.to>=l||b&&b.to<l||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let x=u.length>1?u[u.length-2]:null,w,S="";x&&x.item?(w=c.from+x.from,S=x.marker(i,1)):w=c.from+(x?x.to:0);let k=[{from:w,to:l,insert:S}];return f.node.name=="OrderedList"&&Zm(f.item,i,k,-2),x&&x.node.name=="OrderedList"&&Zm(x.item,i,k),{range:V.cursor(w+S.length),changes:k}}else{let x=K4(u,e,c);return{range:V.cursor(l+x.length+1),changes:{from:c.from,insert:x+e.lineBreak}}}}if(f.node.name=="Blockquote"&&d&&c.from){let y=i.lineAt(c.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==f.from){let x=e.changes([{from:y.from+b.index,to:y.to},{from:c.from+f.from,to:c.to}]);return{range:s.map(x),changes:x}}}let h=[];f.node.name=="OrderedList"&&Zm(f.item,i,h);let O=f.item&&f.item.from<c.from,p="";if(!O||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=f.to)for(let y=0,b=u.length-1;y<=b;y++)p+=y==b&&!O?u[y].marker(i,1):u[y].blank(y<b?Gn(c.text,4,u[y+1].from)-p.length:null);let g=l;for(;g>c.from&&/\s/.test(c.text.charAt(g-c.from-1));)g--;return p=Xb(p,e),Jve(f.node,e.doc)&&(p=K4(u,e,c)+e.lineBreak+p),h.push({from:g,to:l,insert:e.lineBreak+p}),{range:V.cursor(g+p.length+1),changes:h}});return o?!1:(r(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},Kve=Hve();function H4(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Jve(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let i=e.lineAt(r.to),o=e.lineAt(n.from),a=/^[\s>]*$/.test(i.text);return i.number+(a?0:1)<o.number}function K4(t,e,r){let n="";for(let i=0,o=t.length-2;i<=o;i++)n+=t[i].blank(i<o?Gn(r.text,4,t[i+1].from)-n.length:null,i<o);return Xb(n,e)}function eye(t,e){let r=t.resolveInner(e,-1),n=e;H4(r)&&(n=r.from,r=r.parent);for(let i;i=r.childBefore(n);)if(H4(i))n=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")r=i.lastChild,n=r.to;else break;return r}const tye=({state:t,dispatch:e})=>{let r=Xe(t),n=null,i=t.changeByRange(o=>{let a=o.from,{doc:s}=t;if(o.empty&&kd.isActiveAt(t,o.from)){let l=s.lineAt(a),c=Y_(eye(r,a),s);if(c.length){let u=c[c.length-1],f=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(a-l.from>f&&!/\S/.test(l.text.slice(f,a-l.from)))return{range:V.cursor(l.from+f),changes:{from:l.from+f,to:a}};if(a-l.from==f&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let d=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(Gn(l.text,4,u.to)-Gn(l.text,4,u.from));return d==l.from&&(h=Xb(h,t)),{range:V.cursor(d+h.length),changes:{from:d,to:l.from+u.to,insert:h}}}if(d<a)return{range:V.cursor(d),changes:{from:d,to:a}}}}}return n={range:o}});return n?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},rye=[{key:"Enter",run:Kve},{key:"Backspace",run:tye}],U_=O_({matchClosingTags:!1});function nye(t={}){let{codeLanguages:e,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:i}=Fve,completeHTMLTags:o=!0,pasteURLAsLink:a=!0,htmlTagLanguage:s=U_}=t;if(!(i instanceof rp))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],c=[s.support,Yve],u;a&&c.push(sye),r instanceof Jn?(c.push(r.support),u=r.language):r&&(u=r);let f=e||u?Gve(e,u):void 0;l.push(Rve({codeParser:f,htmlParser:s.language.parser})),n&&c.push(bc.high(Yh.of(rye)));let d=zb(i.configure(l));return o&&c.push(d.data.of({autocomplete:iye})),new Jn(d,c)}function iye(t){let{state:e,pos:r}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(r-25,r));if(!n)return null;let i=Xe(e).resolveInner(r,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:r-n[0].length,to:r,options:oye(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Vm=null;function oye(){if(Vm)return Vm;let t=C1e(new pme(Se.create({extensions:U_}),0,!0));return Vm=t?t.options:[]}const aye=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,sye=le.domEventHandlers({paste:(t,e)=>{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!kd.isActiveAt(e.state,n.from,1)))return!1;let o=Xe(e.state),a=!1;return o.iterate({from:n.from,to:n.to,enter:s=>{(s.from>n.from||aye.test(s.name))&&(a=!0)},leave:s=>{s.to<n.to&&(a=!0)}}),a?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),P1=1,lye=2,cye=3,uye=4,fye=5,dye=36,hye=37,pye=38,Oye=11,mye=13;function gye(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function vye(t){return t==9||t==10||t==13||t==32}let J4=null,e3=null,t3=0;function k1(t,e){let r=t.pos+e;if(e3==t&&t3==r)return J4;for(;vye(t.peek(e));)e++;let n="";for(;;){let i=t.peek(e);if(!gye(i))break;n+=String.fromCharCode(i),e++}return e3=t,t3=r,J4=n||null}function r3(t,e){this.name=t,this.parent=e}const yye=new ep({start:null,shift(t,e,r,n){return e==P1?new r3(k1(n,1)||"",t):t},reduce(t,e){return e==Oye&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==P1||i==mye?new r3(k1(n,1)||"",t):t},strict:!1}),bye=new it((t,e)=>{if(t.next==60){if(t.advance(),t.next==47){t.advance();let r=k1(t,0);if(!r)return t.acceptToken(fye);if(e.context&&r==e.context.name)return t.acceptToken(lye);for(let n=e.context;n;n=n.parent)if(n.name==r)return t.acceptToken(cye,-2);t.acceptToken(uye)}else if(t.next!=33&&t.next!=63)return t.acceptToken(P1)}},{contextual:!0});function Zb(t,e){return new it(r=>{let n=0,i=e.charCodeAt(0);e:for(;!(r.next<0);r.advance(),n++)if(r.next==i){for(let o=1;o<e.length;o++)if(r.peek(o)!=e.charCodeAt(o))continue e;break}n&&r.acceptToken(t)})}const xye=Zb(dye,"-->"),wye=Zb(hye,"?>"),Sye=Zb(pye,"]]>"),Pye=wn({Text:P.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":P.angleBracket,TagName:P.tagName,"MismatchedCloseTag/TagName":[P.tagName,P.invalid],AttributeName:P.attributeName,AttributeValue:P.attributeValue,Is:P.definitionOperator,"EntityReference CharacterReference":P.character,Comment:P.blockComment,ProcessingInst:P.processingInstruction,DoctypeDecl:P.documentMeta,Cdata:P.special(P.string)}),kye=yn.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.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Tag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:yye,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[Pye],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p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Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[bye,xye,wye,Sye,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function Wu(t,e){let r=e&&e.getChild("TagName");return r?t.sliceString(r.from,r.to):""}function qm(t,e){let r=e&&e.firstChild;return!r||r.name!="OpenTag"?"":Wu(t,r)}function Qye(t,e,r){let n=e&&e.getChildren("Attribute").find(o=>o.from<=r&&o.to>=r),i=n&&n.getChild("AttributeName");return i?t.sliceString(i.from,i.to):""}function Wm(t){for(let e=t&&t.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function Cye(t,e){var r;let n=Xe(t).resolveInner(e,-1),i=null;for(let o=n;!i&&o.parent;o=o.parent)(o.name=="OpenTag"||o.name=="CloseTag"||o.name=="SelfClosingTag"||o.name=="MismatchedCloseTag")&&(i=o);if(i&&(i.to>e||i.lastChild.type.isError)){let o=i.parent;if(n.name=="TagName")return i.name=="CloseTag"||i.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:o}:{type:"openTag",from:n.from,context:Wm(o)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:i};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:i};let a=n==i||n.name=="Attribute"?n.childBefore(e):n;return a?.name=="StartTag"?{type:"openTag",from:e,context:Wm(o)}:a?.name=="StartCloseTag"&&a.to<=e?{type:"closeTag",from:e,context:o}:a?.name=="Is"?{type:"attrValue",from:e,context:i}:a?{type:"attrName",from:e,context:i}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((r=n.lastChild)===null||r===void 0)&&r.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:Wm(n)}:null}let Tye=class{constructor(e,r,n){this.attrs=r,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(i=>({label:i,type:"text"})):[]}};const Bm=/^[:\-\.\w\u00b7-\uffff]*$/;function n3(t){return Object.assign(Object.assign({type:"property"},t.completion||{}),{label:t.name})}function i3(t){return typeof t=="string"?{label:`"${t}"`,type:"constant"}:/^"/.test(t.label)?t:Object.assign(Object.assign({},t),{label:`"${t.label}"`})}function $ye(t,e){let r=[],n=[],i=Object.create(null);for(let l of e){let c=n3(l);r.push(c),l.global&&n.push(c),l.values&&(i[l.name]=l.values.map(i3))}let o=[],a=[],s=Object.create(null);for(let l of t){let c=n,u=i;l.attributes&&(c=c.concat(l.attributes.map(d=>typeof d=="string"?r.find(h=>h.label==d)||{label:d,type:"property"}:(d.values&&(u==i&&(u=Object.create(u)),u[d.name]=d.values.map(i3)),n3(d)))));let f=new Tye(l,c,u);s[f.name]=f,o.push(f),l.top&&a.push(f)}a.length||(a=o);for(let l=0;l<o.length;l++){let c=t[l],u=o[l];if(c.children)for(let f of c.children)s[f]&&u.children.push(s[f]);else u.children=o}return l=>{var c;let{doc:u}=l.state,f=Cye(l.state,l.pos);if(!f||f.type=="tag"&&!l.explicit)return null;let{type:d,from:h,context:O}=f;if(d=="openTag"){let p=a,g=qm(u,O);if(g){let y=s[g];p=y?.children||o}return{from:h,options:p.map(y=>y.completion),validFor:Bm}}else if(d=="closeTag"){let p=qm(u,O);return p?{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)==">"?1:0),options:[((c=s[p])===null||c===void 0?void 0:c.closeNameCompletion)||{label:p+">",type:"type"}],validFor:Bm}:null}else if(d=="attrName"){let p=s[Wu(u,O)];return{from:h,options:p?.attrs||n,validFor:Bm}}else if(d=="attrValue"){let p=Qye(u,O,h);if(!p)return null;let g=s[Wu(u,O)],y=(g?.attrValues||i)[p];return!y||!y.length?null:{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)=='"'?1:0),options:y,validFor:/^"[^"]*"?$/}}else if(d=="tag"){let p=qm(u,O),g=s[p],y=[],b=O&&O.lastChild;p&&(!b||b.name!="CloseTag"||Wu(u,b)!=p)&&y.push(g?g.closeCompletion:{label:"</"+p+">",type:"type",boost:2});let x=y.concat((g?.children||(O?o:a)).map(w=>w.openCompletion));if(O&&g?.text.length){let w=O.firstChild;w.to>l.pos-20&&!/\S/.test(l.state.sliceDoc(w.to,l.pos))&&(x=x.concat(g.text))}return{from:h,options:x,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const Q1=vn.define({name:"xml",parser:kye.configure({props:[ui.add({Element(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),fi.add({Element(t){let e=t.firstChild,r=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:r.name=="CloseTag"?r.from:t.to}}}),vb.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function Aye(t={}){let e=[Q1.data.of({autocomplete:$ye(t.elements||[],t.attributes||[])})];return t.autoCloseTags!==!1&&e.push(Eye),new Jn(Q1,e)}function o3(t,e,r=t.length){if(!e)return"";let n=e.firstChild,i=n&&n.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,r)):""}const Eye=le.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!Q1.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:a}=o,s=a.changeByRange(l=>{var c,u,f;let{head:d}=l,h=a.doc.sliceString(d-1,d)==n,O=Xe(a).resolveInner(d,-1),p;if(h&&n==">"&&O.name=="EndTag"){let g=O.parent;if(((u=(c=g.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=o3(a.doc,g.parent,d))){let y=d+(a.doc.sliceString(d,d+1)===">"?1:0),b=`</${p}>`;return{range:l,changes:{from:d,to:y,insert:b}}}}else if(h&&n=="/"&&O.name=="StartCloseTag"){let g=O.parent;if(O.from==d-2&&((f=g.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(p=o3(a.doc,g,d))){let y=d+(a.doc.sliceString(d,d+1)===">"?1:0),b=`${p}>`;return{range:V.cursor(d+b.length,-1),changes:{from:d,to:y,insert:b}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([o,a.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Rye="#e5c07b",a3="#e06c75",Mye="#56b6c2",_ye="#ffffff",Bu="#abb2bf",C1="#7d8799",jye="#61afef",Nye="#98c379",s3="#d19a66",Iye="#c678dd",Dye="#21252b",l3="#2c313a",c3="#282c34",Ym="#353a42",Lye="#3E4451",u3="#528bff",zye=le.theme({"&":{color:Bu,backgroundColor:c3},".cm-content":{caretColor:u3},".cm-cursor, .cm-dropCursor":{borderLeftColor:u3},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Lye},".cm-panels":{backgroundColor:Dye,color:Bu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:c3,color:C1,border:"none"},".cm-activeLineGutter":{backgroundColor:l3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ym},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ym,borderBottomColor:Ym},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:l3,color:Bu}}},{dark:!0}),Xye=Qc.define([{tag:P.keyword,color:Iye},{tag:[P.name,P.deleted,P.character,P.propertyName,P.macroName],color:a3},{tag:[P.function(P.variableName),P.labelName],color:jye},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:s3},{tag:[P.definition(P.name),P.separator],color:Bu},{tag:[P.typeName,P.className,P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:Rye},{tag:[P.operator,P.operatorKeyword,P.url,P.escape,P.regexp,P.link,P.special(P.string)],color:Mye},{tag:[P.meta,P.comment],color:C1},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.link,color:C1,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:a3},{tag:[P.atom,P.bool,P.special(P.variableName)],color:s3},{tag:[P.processingInstruction,P.string,P.inserted],color:Nye},{tag:P.invalid,color:_ye}]),Zye=[zye,VR(Xye)],Vye=Qc.define([{tag:P.keyword,color:"#d73a49",fontWeight:"bold"},{tag:[P.name,P.deleted,P.character,P.macroName],color:"#22863a"},{tag:[P.propertyName],color:"#6f42c1"},{tag:[P.processingInstruction,P.string,P.inserted],color:"#032f62"},{tag:[P.function(P.variableName),P.labelName],color:"#6f42c1"},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:"#005cc5"},{tag:[P.definition(P.name),P.separator],color:"#24292e"},{tag:[P.className],color:"#6f42c1",fontWeight:"bold"},{tag:[P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:"#005cc5"},{tag:[P.typeName],color:"#d73a49",fontWeight:"bold"},{tag:[P.operator,P.operatorKeyword],color:"#d73a49"},{tag:[P.url,P.escape,P.regexp,P.link],color:"#032f62"},{tag:[P.meta,P.comment],color:"#6a737d",fontStyle:"italic"},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.link,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:"#005cc5"},{tag:[P.atom,P.bool,P.special(P.variableName)],color:"#e36209"},{tag:P.invalid,color:"#cb2431"}]),qye=Tr("w-full border transition-all duration-200 shadow-sm overflow-hidden",{variants:{variant:{outlined:"bg-white border-gray-200 hover:border-primary focus-within:border-primary",filled:"bg-soft border-transparent hover:bg-soft-1 focus-within:border-primary focus-within:bg-white",ghost:"bg-transparent border-transparent hover:border-primary focus-within:border-primary"},error:{true:"!border-red-500 !bg-white"},success:{true:"!border-green-500 !bg-white"},disabled:{true:"bg-soft-1 border-soft-1 cursor-not-allowed opacity-60 pointer-events-none"}},defaultVariants:{variant:"outlined"}}),Wye={javascript:Ls,typescript:()=>Ls({typescript:!0}),jsx:()=>Ls({jsx:!0}),tsx:()=>Ls({typescript:!0,jsx:!0}),python:Jge,json:n0e,html:O_,css:a_,sql:vve,markdown:nye,xml:Aye,yaml:()=>[],plaintext:()=>[]},G_=m.forwardRef(({className:t,variant:e,error:r,success:n,disabled:i,label:o,helperText:a,required:s,value:l,defaultValue:c,onChange:u,language:f="javascript",theme:d="light",height:h="200px",placeholder:O,lineNumbers:p=!0,readOnly:g=!1},y)=>{const b=m.useRef(null),x=m.useRef(null),[w]=m.useState(l!==void 0),S=m.useRef(u);m.useEffect(()=>{S.current=u},[u]),m.useEffect(()=>{if(!b.current)return;const Q=[Ppe(),Yh.of([...TOe,...Mpe]),le.lineWrapping,Se.readOnly.of(i||g||!1),le.editable.of(!i&&!g)],T=Wye[f];T&&Q.push(T()),d==="dark"?Q.push(Zye):Q.push(VR(Vye)),O&&Q.push(ghe(O)),p&&Q.push(Qhe()),Q.push(le.updateListener.of(M=>{if(M.docChanged){const $=M.state.doc.toString();S.current&&S.current($)}}));const E=Se.create({doc:w?l:c||"",extensions:Q}),_=new le({state:E,parent:b.current});return x.current=_,()=>{_.destroy(),x.current=null}},[]),m.useEffect(()=>{if(w&&x.current&&l!==void 0){const Q=x.current.state.doc.toString();Q!==l&&x.current.dispatch({changes:{from:0,to:Q.length,insert:l}})}},[l,w]);const k=typeof h=="number"?`${h}px`:h;return v.jsxs("div",{className:"w-full",ref:y,children:[o&&v.jsxs(je,{size:"small",fontWeight:"medium",className:"mb-2 block text-sub",children:[o,s&&v.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),v.jsx("div",{className:z(qye({variant:e,error:r,success:n,disabled:i}),"rounded-md",t),style:{height:k},children:v.jsx("div",{ref:b,className:z("h-full overflow-auto",d==="dark"?"cm-theme-dark":""),style:{fontSize:"14px"}})}),a&&v.jsx("p",{className:z("mt-1 text-xs",r?"text-red-500":n?"text-green-500":"text-sub"),children:a})]})});G_.displayName="EditorTextField";exports.AppTooltip=y9;exports.Autocomplete=H6;exports.Button=ya;exports.Chart=hue;exports.Chip=jC;exports.ConversionSidebar=Vue;exports.DropdownMenu=hv;exports.DropdownMenuCheckboxItem=e7;exports.DropdownMenuContent=eh;exports.DropdownMenuGroup=HT;exports.DropdownMenuItem=nl;exports.DropdownMenuLabel=Ov;exports.DropdownMenuPortal=pB;exports.DropdownMenuRadioGroup=mB;exports.DropdownMenuRadioItem=t7;exports.DropdownMenuSeparator=r7;exports.DropdownMenuShortcut=n7;exports.DropdownMenuSub=OB;exports.DropdownMenuSubContent=JT;exports.DropdownMenuSubTrigger=KT;exports.DropdownMenuTrigger=pv;exports.EditorTextField=G_;exports.FilterSelect=dZ;exports.Heading=R3;exports.Icon=et;exports.Label=je;exports.Menu=gB;exports.Paragraph=E1;exports.Popup=Hq;exports.Progress=L3;exports.SearchInput=uQ;exports.StatusBadge=gZ;exports.Switch=v9;exports.Table=Wy;exports.TableBody=Yy;exports.TableCaption=d9;exports.TableCell=Uy;exports.TableComponent=Yue;exports.TableFooter=f9;exports.TableHead=Fy;exports.TableHeader=By;exports.TableRow=Jf;exports.Tabs=sL;exports.TabsContent=cQ;exports.TabsList=lQ;exports.TabsTrigger=sQ;exports.Text=Tt;exports.TextArea=NC;exports.TextField=i7;exports.Trend=Y1;
package/dist/index.es.js CHANGED
@@ -52343,47 +52343,49 @@ const zye = /* @__PURE__ */ le.inputHandler.of((t, e, r, n, i) => {
52343
52343
  lineNumbers: p = !0,
52344
52344
  readOnly: g = !1
52345
52345
  }, v) => {
52346
- const b = m.useRef(null), x = m.useRef(null), [w] = m.useState(l !== void 0);
52346
+ const b = m.useRef(null), x = m.useRef(null), [w] = m.useState(l !== void 0), S = m.useRef(u);
52347
52347
  m.useEffect(() => {
52348
+ S.current = u;
52349
+ }, [u]), m.useEffect(() => {
52348
52350
  if (!b.current) return;
52349
- const k = [
52351
+ const Q = [
52350
52352
  Mpe(),
52351
52353
  op.of([...DOe, ...Zpe]),
52352
52354
  le.lineWrapping,
52353
52355
  Pe.readOnly.of(i || g || !1),
52354
52356
  le.editable.of(!i && !g)
52355
- ], Q = ebe[f];
52356
- Q && k.push(Q()), d === "dark" ? k.push(Hye) : k.push(ZR(Kye)), O && k.push(Qhe(O)), p && k.push(Nhe()), u && k.push(
52357
- le.updateListener.of((M) => {
52358
- if (M.docChanged) {
52359
- const R = M.state.doc.toString();
52360
- u(R);
52357
+ ], C = ebe[f];
52358
+ C && Q.push(C()), d === "dark" ? Q.push(Hye) : Q.push(ZR(Kye)), O && Q.push(Qhe(O)), p && Q.push(Nhe()), Q.push(
52359
+ le.updateListener.of((R) => {
52360
+ if (R.docChanged) {
52361
+ const T = R.state.doc.toString();
52362
+ S.current && S.current(T);
52361
52363
  }
52362
52364
  })
52363
52365
  );
52364
- const C = Pe.create({
52366
+ const A = Pe.create({
52365
52367
  doc: w ? l : c || "",
52366
- extensions: k
52367
- }), A = new le({
52368
- state: C,
52368
+ extensions: Q
52369
+ }), M = new le({
52370
+ state: A,
52369
52371
  parent: b.current
52370
52372
  });
52371
- return x.current = A, () => {
52372
- A.destroy(), x.current = null;
52373
+ return x.current = M, () => {
52374
+ M.destroy(), x.current = null;
52373
52375
  };
52374
52376
  }, []), m.useEffect(() => {
52375
52377
  if (w && x.current && l !== void 0) {
52376
- const k = x.current.state.doc.toString();
52377
- k !== l && x.current.dispatch({
52378
+ const Q = x.current.state.doc.toString();
52379
+ Q !== l && x.current.dispatch({
52378
52380
  changes: {
52379
52381
  from: 0,
52380
- to: k.length,
52382
+ to: Q.length,
52381
52383
  insert: l
52382
52384
  }
52383
52385
  });
52384
52386
  }
52385
52387
  }, [l, w]);
52386
- const S = typeof h == "number" ? `${h}px` : h;
52388
+ const k = typeof h == "number" ? `${h}px` : h;
52387
52389
  return /* @__PURE__ */ I("div", { className: "w-full", ref: v, children: [
52388
52390
  o && /* @__PURE__ */ I(
52389
52391
  qe,
@@ -52405,7 +52407,7 @@ const zye = /* @__PURE__ */ le.inputHandler.of((t, e, r, n, i) => {
52405
52407
  "rounded-md",
52406
52408
  t
52407
52409
  ),
52408
- style: { height: S },
52410
+ style: { height: k },
52409
52411
  children: /* @__PURE__ */ y(
52410
52412
  "div",
52411
52413
  {
package/dist/index.umd.js CHANGED
@@ -133,4 +133,4 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
133
133
  `+e.scrub();for(let n of e.markers)r.marks.push(n)}return this.finishLeaf(r),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let r=this.fragments.takeNodes(this);return r?(this.absoluteLineStart+=r,this.lineStart=SN(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let r=Cve;if(r.end=e,e>=this.to)r.text="";else if(r.text=this.lineChunkAt(e),r.end+=r.text.length,this.ranges.length>1){let n=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<r.end;){i++;let a=this.ranges[i].from,o=this.lineChunkAt(a);r.end=a+o.length,r.text=r.text.slice(0,this.ranges[i-1].to-n)+o,n=r.end-r.text.length}}return r}readLine(){let{line:e}=this,{text:r,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(r);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],a=this.parser.skipContextMarkup[i.type];if(!a)throw new Error("Unhandled block context "+F[i.type]);let o=this.line.markers.length;if(!a(i,this,e)){this.line.markers.length>o&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let r=this.input.chunk(e),n;if(this.input.lineChunks)n=r==`
134
134
  `?"":r;else{let i=r.indexOf(`
135
135
  `);n=i<0?r:r.slice(0,i)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,r,n=0){this.block=Gh.create(e,n,this.lineStart+r,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,r,n=0){this.startContext(this.parser.getNodeType(e),r,n)}addNode(e,r,n){typeof e=="number"&&(e=new Te(this.parser.nodeSet.types[e],fs,fs,(n??this.prevLineEnd())-r)),this.block.addChild(e,r-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,r){this.addNode(this.buffer.writeElements($y(r.children,e.marks),-r.from).finish(r.type,r.to-r.from),r.from)}finishContext(){let e=this.stack.pop(),r=this.stack[this.stack.length-1];r.addChild(e.toTree(this.parser.nodeSet),e.from-r.from),this.block=r}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?hN(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let r=$y(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(r,-e.start).finish(F.Paragraph,e.content.length),e.start)}elt(e,r,n,i){return typeof e=="string"?ve(this.parser.getNodeType(e),r,n,i):new mN(e,r)}get buffer(){return new gN(this.parser.nodeSet)}}function hN(t,e,r,n,i){let a=t[e].to,o=[],s=[],l=r.from+n;function c(u,d){for(;d?u>=a:u>a;){let f=t[e+1].from-a;n+=f,u+=f,e++,a=t[e].to}}for(let u=r.firstChild;u;u=u.nextSibling){c(u.from+n,!0);let d=u.from+n,f,h=i.get(u.tree);h?f=h:u.to+n>a?(f=hN(t,e,u,n,i),c(u.to+n,!1)):f=u.toTree(),o.push(f),s.push(d-l)}return c(r.to+n,!1),new Te(r.type,o,s,r.to+n-l,r.tree?r.tree.propValues:void 0)}class Kh extends db{constructor(e,r,n,i,a,o,s,l,c){super(),this.nodeSet=e,this.blockParsers=r,this.leafBlockParsers=n,this.blockNames=i,this.endLeafBlock=a,this.skipContextMarkup=o,this.inlineParsers=s,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,r,n){let i=new Tve(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}configure(e){let r=Qy(e);if(!r)return this;let{nodeSet:n,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(Qc(r.defineNodes)){i=Object.assign({},i);let f=n.types.slice(),h;for(let g of r.defineNodes){let{name:p,block:O,composite:b,style:y}=typeof g=="string"?{name:g}:g;if(f.some(S=>S.name==p))continue;b&&(i[f.length]=(S,P,Q)=>b(P,Q,S.value));let w=f.length,x=b?["Block","BlockContext"]:O?w>=F.ATXHeading1&&w<=F.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(ht.define({id:w,name:p,props:x&&[[fe.group,x]]})),y&&(h||(h={}),Array.isArray(y)||y instanceof fr?h[p]=y:Object.assign(h,y))}n=new ac(f),h&&(n=n.extend(On(h)))}if(Qc(r.props)&&(n=n.extend(...r.props)),Qc(r.remove))for(let f of r.remove){let h=this.blockNames.indexOf(f),g=this.inlineNames.indexOf(f);h>-1&&(a[h]=o[h]=void 0),g>-1&&(l[g]=void 0)}if(Qc(r.parseBlock))for(let f of r.parseBlock){let h=s.indexOf(f.name);if(h>-1)a[h]=f.parse,o[h]=f.leaf;else{let g=f.before?Jh(s,f.before):f.after?Jh(s,f.after)+1:s.length-1;a.splice(g,0,f.parse),o.splice(g,0,f.leaf),s.splice(g,0,f.name)}f.endLeaf&&u.push(f.endLeaf)}if(Qc(r.parseInline))for(let f of r.parseInline){let h=c.indexOf(f.name);if(h>-1)l[h]=f.parse;else{let g=f.before?Jh(c,f.before):f.after?Jh(c,f.after)+1:c.length-1;l.splice(g,0,f.parse),c.splice(g,0,f.name)}}return r.wrap&&(d=d.concat(r.wrap)),new Kh(n,a,o,s,u,i,l,c,d)}getNodeType(e){let r=this.nodeTypes[e];if(r==null)throw new RangeError(`Unknown node type '${e}'`);return r}parseInline(e,r){let n=new Ty(this,e,r);e:for(let i=r;i<n.end;){let a=n.char(i);for(let o of this.inlineParsers)if(o){let s=o(n,a,i);if(s>=0){i=s;continue e}}i++}return n.resolveMarkers(0)}}function Qc(t){return t!=null&&t.length>0}function Qy(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Qy(t[0]);if(t.length==1)return e;let r=Qy(t.slice(1));if(!r||!e)return e||r;let n=(o,s)=>(o||fs).concat(s||fs),i=e.wrap,a=r.wrap;return{props:n(e.props,r.props),defineNodes:n(e.defineNodes,r.defineNodes),parseBlock:n(e.parseBlock,r.parseBlock),parseInline:n(e.parseInline,r.parseInline),remove:n(e.remove,r.remove),wrap:i?a?(o,s,l,c)=>i(a(o,s,l,c),s,l,c):i:a}}function Jh(t,e){let r=t.indexOf(e);if(r<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return r}let pN=[ht.none];for(let t=1,e;e=F[t];t++)pN[t]=ht.define({id:t,name:e,props:t>=F.Escape?[]:[[fe.group,t in tN?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const fs=[];let gN=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,r,n,i=0){return this.content.push(e,r,n,4+i*4),this}writeElements(e,r=0){for(let n of e)n.writeTo(this,r);return this}finish(e,r){return Te.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:r})}},Cc=class{constructor(e,r,n,i=fs){this.type=e,this.from=r,this.to=n,this.children=i}writeTo(e,r){let n=e.content.length;e.writeElements(this.children,r),e.content.push(this.type,this.from+r,this.to+r,e.content.length+4-n)}toTree(e){return new gN(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class mN{constructor(e,r){this.tree=e,this.from=r}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return fs}writeTo(e,r){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+r,this.to+r,-1)}toTree(){return this.tree}}function ve(t,e,r,n){return new Cc(t,e,r,n)}const ON={resolve:"Emphasis",mark:"EmphasisMark"},vN={resolve:"Emphasis",mark:"EmphasisMark"},Ya={},ep={};class gr{constructor(e,r,n,i){this.type=e,this.from=r,this.to=n,this.side=i}}const bN="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Tc=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Tc=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const Cy={Escape(t,e,r){if(e!=92||r==t.end-1)return-1;let n=t.char(r+1);for(let i=0;i<bN.length;i++)if(bN.charCodeAt(i)==n)return t.append(ve(F.Escape,r,r+2));return-1},Entity(t,e,r){if(e!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(r+1,r+31));return n?t.append(ve(F.Entity,r,r+1+n[0].length)):-1},InlineCode(t,e,r){if(e!=96||r&&t.char(r-1)==96)return-1;let n=r+1;for(;n<t.end&&t.char(n)==96;)n++;let i=n-r,a=0;for(;n<t.end;n++)if(t.char(n)==96){if(a++,a==i&&t.char(n+1)!=96)return t.append(ve(F.InlineCode,r,n+1,[ve(F.CodeMark,r,r+i),ve(F.CodeMark,n+1-i,n+1)]))}else a=0;return-1},HTMLTag(t,e,r){if(e!=60||r==t.end-1)return-1;let n=t.slice(r+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(i)return t.append(ve(F.Autolink,r,r+1+i[0].length,[ve(F.LinkMark,r,r+1),ve(F.URL,r+1,r+i[0].length),ve(F.LinkMark,r+i[0].length,r+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(a)return t.append(ve(F.Comment,r,r+1+a[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(ve(F.ProcessingInstruction,r,r+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return s?t.append(ve(F.HTMLTag,r,r+1+s[0].length)):-1},Emphasis(t,e,r){if(e!=95&&e!=42)return-1;let n=r+1;for(;t.char(n)==e;)n++;let i=t.slice(r-1,r),a=t.slice(n,n+1),o=Tc.test(i),s=Tc.test(a),l=/\s|^$/.test(i),c=/\s|^$/.test(a),u=!c&&(!s||l||o),d=!l&&(!o||c||s),f=u&&(e==42||!d||o),h=d&&(e==42||!u||s);return t.append(new gr(e==95?ON:vN,r,n,(f?1:0)|(h?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(ve(F.HardBreak,r,r+2));if(e==32){let n=r+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=r+2)return t.append(ve(F.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new gr(Ya,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new gr(ep,r,r+2,1)):-1},LinkEnd(t,e,r){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let i=t.parts[n];if(i instanceof gr&&(i.type==Ya||i.type==ep)){if(!i.side||t.skipSpace(i.to)==r&&!/[(\[]/.test(t.slice(r+1,r+2)))return t.parts[n]=null,-1;let a=t.takeContent(n),o=t.parts[n]=$ve(t,a,i.type==Ya?F.Link:F.Image,i.from,r+1);if(i.type==Ya)for(let s=0;s<n;s++){let l=t.parts[s];l instanceof gr&&l.type==Ya&&(l.side=0)}return o.to}}return-1}};function $ve(t,e,r,n,i){let{text:a}=t,o=t.char(i),s=i;if(e.unshift(ve(F.LinkMark,n,n+(r==F.Image?2:1))),e.push(ve(F.LinkMark,i-1,i)),o==40){let l=t.skipSpace(i+1),c=yN(a,l-t.offset,t.offset),u;c&&(l=t.skipSpace(c.to),l!=c.to&&(u=wN(a,l-t.offset,t.offset),u&&(l=t.skipSpace(u.to)))),t.char(l)==41&&(e.push(ve(F.LinkMark,i,i+1)),s=l+1,c&&e.push(c),u&&e.push(u),e.push(ve(F.LinkMark,l,s)))}else if(o==91){let l=xN(a,i-t.offset,t.offset,!1);l&&(e.push(l),s=l.to)}return ve(r,n,s,e)}function yN(t,e,r){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let a=t.charCodeAt(i);if(a==62)return ve(F.URL,e+r,i+1+r);if(a==60||a==10)return!1}return null}else{let i=0,a=e;for(let o=!1;a<t.length;a++){let s=t.charCodeAt(a);if(Mr(s))break;if(o)o=!1;else if(s==40)i++;else if(s==41){if(!i)break;i--}else s==92&&(o=!0)}return a>e?ve(F.URL,e+r,a+r):a==t.length?null:!1}}function wN(t,e,r){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let i=n==40?41:n;for(let a=e+1,o=!1;a<t.length;a++){let s=t.charCodeAt(a);if(o)o=!1;else{if(s==i)return ve(F.LinkTitle,e+r,a+1+r);s==92&&(o=!0)}}return null}function xN(t,e,r,n){for(let i=!1,a=e+1,o=Math.min(t.length,a+999);a<o;a++){let s=t.charCodeAt(a);if(i)i=!1;else{if(s==93)return n?!1:ve(F.LinkLabel,e+r,a+1+r);if(n&&!Mr(s)&&(n=!1),s==91)return!1;s==92&&(i=!0)}}return null}class Ty{constructor(e,r,n){this.parser=e,this.text=r,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,r){return this.text.slice(e-this.offset,r-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,r,n,i,a){return this.append(new gr(e,r,n,(i?1:0)|(a?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let r=this.parts[e];if(r instanceof gr&&(r.type==Ya||r.type==ep))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n<this.parts.length;n++){let i=this.parts[n];if(!(i instanceof gr&&i.type.resolve&&i.side&2))continue;let a=i.type==ON||i.type==vN,o=i.to-i.from,s,l=n-1;for(;l>=e;l--){let p=this.parts[l];if(p instanceof gr&&p.side&1&&p.type==i.type&&!(a&&(i.side&1||p.side&2)&&(p.to-p.from+o)%3==0&&((p.to-p.from)%3||o%3))){s=p;break}}if(!s)continue;let c=i.type.resolve,u=[],d=s.from,f=i.to;if(a){let p=Math.min(2,s.to-s.from,o);d=s.to-p,f=i.from+p,c=p==1?"Emphasis":"StrongEmphasis"}s.type.mark&&u.push(this.elt(s.type.mark,d,s.to));for(let p=l+1;p<n;p++)this.parts[p]instanceof Cc&&u.push(this.parts[p]),this.parts[p]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,f));let h=this.elt(c,d,f,u);this.parts[l]=a&&s.from!=d?new gr(s.type,s.from,d,s.side):null,(this.parts[n]=a&&i.to!=f?new gr(i.type,f,i.to,i.side):null)?this.parts.splice(n,0,h):this.parts[n]=h}let r=[];for(let n=e;n<this.parts.length;n++){let i=this.parts[n];i instanceof Cc&&r.push(i)}return r}findOpeningDelimiter(e){for(let r=this.parts.length-1;r>=0;r--){let n=this.parts[r];if(n instanceof gr&&n.type==e&&n.side&1)return r}return null}takeContent(e){let r=this.resolveMarkers(e);return this.parts.length=e,r}getDelimiterAt(e){let r=this.parts[e];return r instanceof gr?r:null}skipSpace(e){return Pc(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?ve(this.parser.getNodeType(e),r,n,i):new mN(e,r)}}Ty.linkStart=Ya,Ty.imageStart=ep;function $y(t,e){if(!e.length)return t;if(!t.length)return e;let r=t.slice(),n=0;for(let i of e){for(;n<r.length&&r[n].to<i.to;)n++;if(n<r.length&&r[n].from<i.from){let a=r[n];a instanceof Cc&&(r[n]=new Cc(a.type,a.from,a.to,$y(a.children,[i])))}else r.splice(n++,0,i)}return r}const Ave=[F.CodeBlock,F.ListItem,F.OrderedList,F.BulletList];class Eve{constructor(e,r){this.fragments=e,this.input=r,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,r){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let a=this.fragment.to;for(;a>0&&this.input.read(a-1,a)!=`
136
- `;)a--;this.fragmentEnd=a?a-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=r;if(!n.childAfter(i))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(fe.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),a=e.absoluteLineStart,o=a,s=e.block.children.length,l=o,c=s;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let u=SN(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,u);else{let d=new Te(e.parser.nodeSet.types[F.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(d,r.tree),e.addNode(d,u)}if(r.type.is("Block")&&(Ave.indexOf(r.type.id)<0?(o=r.to-n,s=e.block.children.length):(o=l,s=c),l=r.to-n,c=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return o-a}}function SN(t,e){let r=t;for(let n=1;n<e.length;n++){let i=e[n-1].to,a=e[n].from;i<t&&(r-=a-i)}return r}const _ve=On({"Blockquote/...":k.quote,HorizontalRule:k.contentSeparator,"ATXHeading1/... SetextHeading1/...":k.heading1,"ATXHeading2/... SetextHeading2/...":k.heading2,"ATXHeading3/...":k.heading3,"ATXHeading4/...":k.heading4,"ATXHeading5/...":k.heading5,"ATXHeading6/...":k.heading6,"Comment CommentBlock":k.comment,Escape:k.escape,Entity:k.character,"Emphasis/...":k.emphasis,"StrongEmphasis/...":k.strong,"Link/... Image/...":k.link,"OrderedList/... BulletList/...":k.list,"BlockQuote/...":k.quote,"InlineCode CodeText":k.monospace,"URL Autolink":k.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":k.processingInstruction,"CodeInfo LinkLabel":k.labelName,LinkTitle:k.string,Paragraph:k.content}),Mve=new Kh(new ac(pN).extend(_ve),Object.keys(Hh).map(t=>Hh[t]),Object.keys(Hh).map(t=>fN[t]),Object.keys(Hh),Qve,tN,Object.keys(Cy).map(t=>Cy[t]),Object.keys(Cy),[]);function Nve(t,e,r){let n=[];for(let i=t.firstChild,a=e;;i=i.nextSibling){let o=i?i.from:r;if(o>a&&n.push({from:a,to:o}),!i)break;a=i.to}return n}function Ive(t){let{codeParser:e,htmlParser:r}=t;return{wrap:n9((i,a)=>{let o=i.type.id;if(e&&(o==F.CodeBlock||o==F.FencedCode)){let s="";if(o==F.FencedCode){let c=i.node.getChild(F.CodeInfo);c&&(s=a.read(c.from,c.to))}let l=e(s);if(l)return{parser:l,overlay:c=>c.type.id==F.CodeText,bracketed:o==F.FencedCode}}else if(r&&(o==F.HTMLBlock||o==F.HTMLTag||o==F.CommentBlock))return{parser:r,overlay:Nve(i.node,i.from,i.to)};return null})}}const Dve={resolve:"Strikethrough",mark:"StrikethroughMark"},Lve={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":k.strikethrough}},{name:"StrikethroughMark",style:k.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),i=t.slice(r+2,r+3),a=/\s|^$/.test(n),o=/\s|^$/.test(i),s=Tc.test(n),l=Tc.test(i);return t.addDelimiter(Dve,r,r+2,!o&&(!l||a||s),!a&&(!s||o||l))},after:"Emphasis"}]};function $c(t,e,r=0,n,i=0){let a=0,o=!0,s=-1,l=-1,c=!1,u=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let d=r;d<e.length;d++){let f=e.charCodeAt(d);f==124&&!c?((!o||s>-1)&&a++,o=!1,n&&(s>-1&&u(),n.push(t.elt("TableDelimiter",d+i,d+i+1))),s=l=-1):(c||f!=32&&f!=9)&&(s<0&&(s=d),l=d+1),c=!c&&f==92}return s>-1&&(a++,n&&u()),a}function kN(t,e){for(let r=e;r<t.length;r++){let n=t.charCodeAt(r);if(n==124)return!0;n==92&&r++}return!1}const PN=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class QN{constructor(){this.rows=null}nextLine(e,r,n){if(this.rows==null){this.rows=!1;let i;if((r.next==45||r.next==58||r.next==124)&&PN.test(i=r.text.slice(r.pos))){let a=[];$c(e,n.content,0,a,n.start)==$c(e,i,r.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,a),e.elt("TableDelimiter",e.lineStart+r.pos,e.lineStart+r.text.length)])}}else if(this.rows){let i=[];$c(e,r.text,r.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+r.pos,e.lineStart+r.text.length,i))}return!1}finish(e,r){return this.rows?(e.addLeafElement(r,e.elt("Table",r.start,r.start+r.content.length,this.rows)),!0):!1}}const zve={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":k.heading}},"TableRow",{name:"TableCell",style:k.content},{name:"TableDelimiter",style:k.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return kN(e.content,0)?new QN:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof QN)||!kN(e.text,e.basePos))return!1;let n=t.peekLine();return PN.test(n)&&$c(t,e.text,e.basePos)==$c(t,n,e.basePos)},before:"SetextHeading"}]};class jve{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Rve={defineNodes:[{name:"Task",block:!0,style:k.list},{name:"TaskMarker",style:k.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new jve:null},after:"SetextHeading"}]},CN=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,TN=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Xve=/[\w-]+\.[\w-]+($|\/)/,$N=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,AN=/\/[a-zA-Z\d@.]+/gy;function EN(t,e,r,n){let i=0;for(let a=e;a<r;a++)t[a]==n&&i++;return i}function Zve(t,e){TN.lastIndex=e;let r=TN.exec(t);if(!r||Xve.exec(r[0])[0].indexOf("_")>-1)return-1;let n=e+r[0].length;for(;;){let i=t[n-1],a;if(/[?!.,:*_~]/.test(i)||i==")"&&EN(t,e,n,")")>EN(t,e,n,"("))n--;else if(i==";"&&(a=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+a.index;else break}return n}function _N(t,e){$N.lastIndex=e;let r=$N.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const Vve=[zve,Rve,Lve,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;CN.lastIndex=n;let i=CN.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=Zve(t.text,n+i[0].length),a>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,a));a=n+o[0].length}}else i[3]?a=_N(t.text,n):(a=_N(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(AN.lastIndex=a,i=AN.exec(t.text),i&&(a=i.index+i[0].length)));return a<0?-1:(t.addElement(t.elt("URL",r,a+t.offset)),a+t.offset)}}]}];function MN(t,e,r){return(n,i,a)=>{if(i!=t||n.char(a+1)==t)return-1;let o=[n.elt(r,a,a+1)];for(let s=a+1;s<n.end;s++){let l=n.char(s);if(l==t)return n.addElement(n.elt(e,a,s+1,o.concat(n.elt(r,s,s+1))));if(l==92&&o.push(n.elt("Escape",s,s+++2)),Mr(l))break}return-1}}const qve={defineNodes:[{name:"Superscript",style:k.special(k.content)},{name:"SuperscriptMark",style:k.processingInstruction}],parseInline:[{name:"Superscript",parse:MN(94,"Superscript","SuperscriptMark")}]},Wve={defineNodes:[{name:"Subscript",style:k.special(k.content)},{name:"SubscriptMark",style:k.processingInstruction}],parseInline:[{name:"Subscript",parse:MN(126,"Subscript","SubscriptMark")}]},Bve={defineNodes:[{name:"Emoji",style:k.character}],parseInline:[{name:"Emoji",parse(t,e,r){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(r+1,t.end)))?-1:t.addElement(t.elt("Emoji",r,r+1+n[0].length))}}]},NN=mb({commentTokens:{block:{open:"<!--",close:"-->"}}}),IN=new fe,DN=Mve.configure({props:[si.add(t=>!t.is("Block")||t.is("Document")||Ay(t)!=null||Yve(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),IN.add(Ay),oi.add({Document:()=>null}),Za.add({Document:NN})]});function Ay(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Yve(t){return t.name=="OrderedList"||t.name=="BulletList"}function Fve(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=Ay(n.type))!=null&&i<=e)break;r=n}return r.to}const Uve=hhe.of((t,e,r)=>{for(let n=Ze(t).resolveInner(r,-1);n&&!(n.from<e);n=n.parent){let i=n.type.prop(IN);if(i==null)continue;let a=Fve(n,i);if(a>r)return{from:r,to:a}}return null});function Ey(t){return new Ar(NN,t,[],"markdown")}const Gve=Ey(DN),tp=Ey(DN.configure([Vve,Wve,qve,Bve,{props:[si.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function Hve(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=Sh.matchLanguageName(t,r,!0),n instanceof Sh)return n.support?n.support.language.parser:uc.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class _y{constructor(e,r,n,i,a,o,s){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=a,this.type=o,this.item=s}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let i=this.to-this.from-n.length-this.spaceAfter.length;i>0;i--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+zN(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function LN(t,e){let r=[],n=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return n;(i.name=="ListItem"||i.name=="Blockquote")&&r.push(i)}for(let i=r.length-1;i>=0;i--){let a=r[i],o,s=e.lineAt(a.from),l=a.from-s.from;if(a.name=="Blockquote"&&(o=/^ *>( ?)/.exec(s.text.slice(l))))n.push(new _y(a,l,l+o[0].length,"",o[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new _y(a.parent,l,l+u,o[1],c,o[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let d=o[2];o[3]&&(d+=o[3].replace(/[xX]/," ")),n.push(new _y(a.parent,l,l+u,o[1],c,d,a))}}return n}function zN(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function My(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let s=zN(a,e),l=+s[2];if(i>=0){if(l!=i+1)return;r.push({from:a.from+s[1].length,to:a.from+s[0].length,insert:String(i+2+n)})}i=l}let o=a.nextSibling;if(!o)break;a=o}}function Ny(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(dc)!=" ")return t;let n=Jn(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const Kve=((t={})=>({state:e,dispatch:r})=>{let n=Ze(e),{doc:i}=e,a=null,o=e.changeByRange(s=>{if(!s.empty||!tp.isActiveAt(e,s.from,-1)&&!tp.isActiveAt(e,s.from,1))return a={range:s};let l=s.from,c=i.lineAt(l),u=LN(n.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return a={range:s};let d=u[u.length-1];if(d.to-d.spaceAfter.length>l-c.from)return a={range:s};let f=l>=d.to-d.spaceAfter.length&&!/\S/.test(c.text.slice(d.to));if(d.item&&f){let b=d.node.firstChild,y=d.node.getChild("ListItem","ListItem");if(b.to>=l||y&&y.to<l||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let w=u.length>1?u[u.length-2]:null,x,S="";w&&w.item?(x=c.from+w.from,S=w.marker(i,1)):x=c.from+(w?w.to:0);let P=[{from:x,to:l,insert:S}];return d.node.name=="OrderedList"&&My(d.item,i,P,-2),w&&w.node.name=="OrderedList"&&My(w.item,i,P),{range:V.cursor(x+S.length),changes:P}}else{let w=RN(u,e,c);return{range:V.cursor(l+w.length+1),changes:{from:c.from,insert:w+e.lineBreak}}}}if(d.node.name=="Blockquote"&&f&&c.from){let b=i.lineAt(c.from-1),y=/>\s*$/.exec(b.text);if(y&&y.index==d.from){let w=e.changes([{from:b.from+y.index,to:b.to},{from:c.from+d.from,to:c.to}]);return{range:s.map(w),changes:w}}}let h=[];d.node.name=="OrderedList"&&My(d.item,i,h);let g=d.item&&d.item.from<c.from,p="";if(!g||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=d.to)for(let b=0,y=u.length-1;b<=y;b++)p+=b==y&&!g?u[b].marker(i,1):u[b].blank(b<y?Jn(c.text,4,u[b+1].from)-p.length:null);let O=l;for(;O>c.from&&/\s/.test(c.text.charAt(O-c.from-1));)O--;return p=Ny(p,e),Jve(d.node,e.doc)&&(p=RN(u,e,c)+e.lineBreak+p),h.push({from:O,to:l,insert:e.lineBreak+p}),{range:V.cursor(O+p.length+1),changes:h}});return a?!1:(r(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)})();function jN(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Jve(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let i=e.lineAt(r.to),a=e.lineAt(n.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function RN(t,e,r){let n="";for(let i=0,a=t.length-2;i<=a;i++)n+=t[i].blank(i<a?Jn(r.text,4,t[i+1].from)-n.length:null,i<a);return Ny(n,e)}function e1e(t,e){let r=t.resolveInner(e,-1),n=e;jN(r)&&(n=r.from,r=r.parent);for(let i;i=r.childBefore(n);)if(jN(i))n=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")r=i.lastChild,n=r.to;else break;return r}const t1e=[{key:"Enter",run:Kve},{key:"Backspace",run:({state:t,dispatch:e})=>{let r=Ze(t),n=null,i=t.changeByRange(a=>{let o=a.from,{doc:s}=t;if(a.empty&&tp.isActiveAt(t,a.from)){let l=s.lineAt(o),c=LN(e1e(r,o),s);if(c.length){let u=c[c.length-1],d=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>d&&!/\S/.test(l.text.slice(d,o-l.from)))return{range:V.cursor(l.from+d),changes:{from:l.from+d,to:o}};if(o-l.from==d&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(Jn(l.text,4,u.to)-Jn(l.text,4,u.from));return f==l.from&&(h=Ny(h,t)),{range:V.cursor(f+h.length),changes:{from:f,to:l.from+u.to,insert:h}}}if(f<o)return{range:V.cursor(f),changes:{from:f,to:o}}}}}return n={range:a}});return n?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)}}],XN=LM({matchClosingTags:!1});function r1e(t={}){let{codeLanguages:e,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:i}=Gve,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=XN}=t;if(!(i instanceof Kh))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],c=[s.support,Uve],u;o&&c.push(o1e),r instanceof ai?(c.push(r.support),u=r.language):r&&(u=r);let d=e||u?Hve(e,u):void 0;l.push(Ive({codeParser:d,htmlParser:s.language.parser})),n&&c.push(Rl.high(ph.of(t1e)));let f=Ey(i.configure(l));return a&&c.push(f.data.of({autocomplete:n1e})),new ai(f,c)}function n1e(t){let{state:e,pos:r}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(r-25,r));if(!n)return null;let i=Ze(e).resolveInner(r,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:r-n[0].length,to:r,options:i1e(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Iy=null;function i1e(){if(Iy)return Iy;let t=_0e(new Sge(ke.create({extensions:XN}),0,!0));return Iy=t?t.options:[]}const a1e=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,o1e=ce.domEventHandlers({paste:(t,e)=>{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!tp.isActiveAt(e.state,n.from,1)))return!1;let a=Ze(e.state),o=!1;return a.iterate({from:n.from,to:n.to,enter:s=>{(s.from>n.from||a1e.test(s.name))&&(o=!0)},leave:s=>{s.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Dy=1,s1e=2,l1e=3,c1e=4,u1e=5,d1e=36,f1e=37,h1e=38,p1e=11,g1e=13;function m1e(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function O1e(t){return t==9||t==10||t==13||t==32}let ZN=null,VN=null,qN=0;function Ly(t,e){let r=t.pos+e;if(VN==t&&qN==r)return ZN;for(;O1e(t.peek(e));)e++;let n="";for(;;){let i=t.peek(e);if(!m1e(i))break;n+=String.fromCharCode(i),e++}return VN=t,qN=r,ZN=n||null}function WN(t,e){this.name=t,this.parent=e}const v1e=new jh({start:null,shift(t,e,r,n){return e==Dy?new WN(Ly(n,1)||"",t):t},reduce(t,e){return e==p1e&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==Dy||i==g1e?new WN(Ly(n,1)||"",t):t},strict:!1}),b1e=new at((t,e)=>{if(t.next==60){if(t.advance(),t.next==47){t.advance();let r=Ly(t,0);if(!r)return t.acceptToken(u1e);if(e.context&&r==e.context.name)return t.acceptToken(s1e);for(let n=e.context;n;n=n.parent)if(n.name==r)return t.acceptToken(l1e,-2);t.acceptToken(c1e)}else if(t.next!=33&&t.next!=63)return t.acceptToken(Dy)}},{contextual:!0});function zy(t,e){return new at(r=>{let n=0,i=e.charCodeAt(0);e:for(;!(r.next<0);r.advance(),n++)if(r.next==i){for(let a=1;a<e.length;a++)if(r.peek(a)!=e.charCodeAt(a))continue e;break}n&&r.acceptToken(t)})}const y1e=zy(d1e,"-->"),w1e=zy(f1e,"?>"),x1e=zy(h1e,"]]>"),S1e=On({Text:k.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":k.angleBracket,TagName:k.tagName,"MismatchedCloseTag/TagName":[k.tagName,k.invalid],AttributeName:k.attributeName,AttributeValue:k.attributeValue,Is:k.definitionOperator,"EntityReference CharacterReference":k.character,Comment:k.blockComment,ProcessingInst:k.processingInstruction,DoctypeDecl:k.documentMeta,Cdata:k.special(k.string)}),k1e=Sn.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TO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Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:v1e,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[S1e],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&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^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[b1e,y1e,w1e,x1e,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function rp(t,e){let r=e&&e.getChild("TagName");return r?t.sliceString(r.from,r.to):""}function jy(t,e){let r=e&&e.firstChild;return!r||r.name!="OpenTag"?"":rp(t,r)}function P1e(t,e,r){let n=e&&e.getChildren("Attribute").find(a=>a.from<=r&&a.to>=r),i=n&&n.getChild("AttributeName");return i?t.sliceString(i.from,i.to):""}function Ry(t){for(let e=t&&t.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function Q1e(t,e){var r;let n=Ze(t).resolveInner(e,-1),i=null;for(let a=n;!i&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(i=a);if(i&&(i.to>e||i.lastChild.type.isError)){let a=i.parent;if(n.name=="TagName")return i.name=="CloseTag"||i.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:a}:{type:"openTag",from:n.from,context:Ry(a)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:i};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:i};let o=n==i||n.name=="Attribute"?n.childBefore(e):n;return o?.name=="StartTag"?{type:"openTag",from:e,context:Ry(a)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:a}:o?.name=="Is"?{type:"attrValue",from:e,context:i}:o?{type:"attrName",from:e,context:i}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((r=n.lastChild)===null||r===void 0)&&r.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:Ry(n)}:null}let C1e=class{constructor(e,r,n){this.attrs=r,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(i=>({label:i,type:"text"})):[]}};const Xy=/^[:\-\.\w\u00b7-\uffff]*$/;function BN(t){return Object.assign(Object.assign({type:"property"},t.completion||{}),{label:t.name})}function YN(t){return typeof t=="string"?{label:`"${t}"`,type:"constant"}:/^"/.test(t.label)?t:Object.assign(Object.assign({},t),{label:`"${t.label}"`})}function T1e(t,e){let r=[],n=[],i=Object.create(null);for(let l of e){let c=BN(l);r.push(c),l.global&&n.push(c),l.values&&(i[l.name]=l.values.map(YN))}let a=[],o=[],s=Object.create(null);for(let l of t){let c=n,u=i;l.attributes&&(c=c.concat(l.attributes.map(f=>typeof f=="string"?r.find(h=>h.label==f)||{label:f,type:"property"}:(f.values&&(u==i&&(u=Object.create(u)),u[f.name]=f.values.map(YN)),BN(f)))));let d=new C1e(l,c,u);s[d.name]=d,a.push(d),l.top&&o.push(d)}o.length||(o=a);for(let l=0;l<a.length;l++){let c=t[l],u=a[l];if(c.children)for(let d of c.children)s[d]&&u.children.push(s[d]);else u.children=a}return l=>{var c;let{doc:u}=l.state,d=Q1e(l.state,l.pos);if(!d||d.type=="tag"&&!l.explicit)return null;let{type:f,from:h,context:g}=d;if(f=="openTag"){let p=o,O=jy(u,g);if(O){let b=s[O];p=b?.children||a}return{from:h,options:p.map(b=>b.completion),validFor:Xy}}else if(f=="closeTag"){let p=jy(u,g);return p?{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)==">"?1:0),options:[((c=s[p])===null||c===void 0?void 0:c.closeNameCompletion)||{label:p+">",type:"type"}],validFor:Xy}:null}else if(f=="attrName"){let p=s[rp(u,g)];return{from:h,options:p?.attrs||n,validFor:Xy}}else if(f=="attrValue"){let p=P1e(u,g,h);if(!p)return null;let O=s[rp(u,g)],b=(O?.attrValues||i)[p];return!b||!b.length?null:{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)=='"'?1:0),options:b,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let p=jy(u,g),O=s[p],b=[],y=g&&g.lastChild;p&&(!y||y.name!="CloseTag"||rp(u,y)!=p)&&b.push(O?O.closeCompletion:{label:"</"+p+">",type:"type",boost:2});let w=b.concat((O?.children||(g?a:o)).map(x=>x.openCompletion));if(g&&O?.text.length){let x=g.firstChild;x.to>l.pos-20&&!/\S/.test(l.state.sliceDoc(x.to,l.pos))&&(w=w.concat(O.text))}return{from:h,options:w,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const Zy=wn.define({name:"xml",parser:k1e.configure({props:[oi.add({Element(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),si.add({Element(t){let e=t.firstChild,r=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:r.name=="CloseTag"?r.from:t.to}}}),xb.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function $1e(t={}){let e=[Zy.data.of({autocomplete:T1e(t.elements||[],t.attributes||[])})];return t.autoCloseTags!==!1&&e.push(A1e),new ai(Zy,e)}function FN(t,e,r=t.length){if(!e)return"";let n=e.firstChild,i=n&&n.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,r)):""}const A1e=ce.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!Zy.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var c,u,d;let{head:f}=l,h=o.doc.sliceString(f-1,f)==n,g=Ze(o).resolveInner(f,-1),p;if(h&&n==">"&&g.name=="EndTag"){let O=g.parent;if(((u=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=FN(o.doc,O.parent,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`</${p}>`;return{range:l,changes:{from:f,to:b,insert:y}}}}else if(h&&n=="/"&&g.name=="StartCloseTag"){let O=g.parent;if(g.from==f-2&&((d=O.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(p=FN(o.doc,O,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${p}>`;return{range:V.cursor(f+y.length,-1),changes:{from:f,to:b,insert:y}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([a,o.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E1e="#e5c07b",UN="#e06c75",_1e="#56b6c2",M1e="#ffffff",np="#abb2bf",Vy="#7d8799",N1e="#61afef",I1e="#98c379",GN="#d19a66",D1e="#c678dd",L1e="#21252b",HN="#2c313a",KN="#282c34",qy="#353a42",z1e="#3E4451",JN="#528bff",j1e=ce.theme({"&":{color:np,backgroundColor:KN},".cm-content":{caretColor:JN},".cm-cursor, .cm-dropCursor":{borderLeftColor:JN},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:z1e},".cm-panels":{backgroundColor:L1e,color:np},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:KN,color:Vy,border:"none"},".cm-activeLineGutter":{backgroundColor:HN},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:qy},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qy,borderBottomColor:qy},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:HN,color:np}}},{dark:!0}),R1e=fc.define([{tag:k.keyword,color:D1e},{tag:[k.name,k.deleted,k.character,k.propertyName,k.macroName],color:UN},{tag:[k.function(k.variableName),k.labelName],color:N1e},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:GN},{tag:[k.definition(k.name),k.separator],color:np},{tag:[k.typeName,k.className,k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:E1e},{tag:[k.operator,k.operatorKeyword,k.url,k.escape,k.regexp,k.link,k.special(k.string)],color:_1e},{tag:[k.meta,k.comment],color:Vy},{tag:k.strong,fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.strikethrough,textDecoration:"line-through"},{tag:k.link,color:Vy,textDecoration:"underline"},{tag:k.heading,fontWeight:"bold",color:UN},{tag:[k.atom,k.bool,k.special(k.variableName)],color:GN},{tag:[k.processingInstruction,k.string,k.inserted],color:I1e},{tag:k.invalid,color:M1e}]),X1e=[j1e,y9(R1e)],Z1e=fc.define([{tag:k.keyword,color:"#d73a49",fontWeight:"bold"},{tag:[k.name,k.deleted,k.character,k.macroName],color:"#22863a"},{tag:[k.propertyName],color:"#6f42c1"},{tag:[k.processingInstruction,k.string,k.inserted],color:"#032f62"},{tag:[k.function(k.variableName),k.labelName],color:"#6f42c1"},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:"#005cc5"},{tag:[k.definition(k.name),k.separator],color:"#24292e"},{tag:[k.className],color:"#6f42c1",fontWeight:"bold"},{tag:[k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:"#005cc5"},{tag:[k.typeName],color:"#d73a49",fontWeight:"bold"},{tag:[k.operator,k.operatorKeyword],color:"#d73a49"},{tag:[k.url,k.escape,k.regexp,k.link],color:"#032f62"},{tag:[k.meta,k.comment],color:"#6a737d",fontStyle:"italic"},{tag:k.strong,fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.link,textDecoration:"underline"},{tag:k.heading,fontWeight:"bold",color:"#005cc5"},{tag:[k.atom,k.bool,k.special(k.variableName)],color:"#e36209"},{tag:k.invalid,color:"#cb2431"}]),V1e=mr("w-full border transition-all duration-200 shadow-sm overflow-hidden",{variants:{variant:{outlined:"bg-white border-gray-200 hover:border-primary focus-within:border-primary",filled:"bg-soft border-transparent hover:bg-soft-1 focus-within:border-primary focus-within:bg-white",ghost:"bg-transparent border-transparent hover:border-primary focus-within:border-primary"},error:{true:"!border-red-500 !bg-white"},success:{true:"!border-green-500 !bg-white"},disabled:{true:"bg-soft-1 border-soft-1 cursor-not-allowed opacity-60 pointer-events-none"}},defaultVariants:{variant:"outlined"}}),q1e={javascript:bc,typescript:()=>bc({typescript:!0}),jsx:()=>bc({jsx:!0}),tsx:()=>bc({typescript:!0,jsx:!0}),python:aOe,json:cOe,html:LM,css:QM,sql:wve,markdown:r1e,xml:$1e,yaml:()=>[],plaintext:()=>[]},eI=m.forwardRef(({className:t,variant:e,error:r,success:n,disabled:i,label:a,helperText:o,required:s,value:l,defaultValue:c,onChange:u,language:d="javascript",theme:f="light",height:h="200px",placeholder:g,lineNumbers:p=!0,readOnly:O=!1},b)=>{const y=m.useRef(null),w=m.useRef(null),[x]=m.useState(l!==void 0);m.useEffect(()=>{if(!y.current)return;const P=[Mhe(),ph.of([...Lpe,...Zhe]),ce.lineWrapping,ke.readOnly.of(i||O||!1),ce.editable.of(!i&&!O)],Q=q1e[d];Q&&P.push(Q()),f==="dark"?P.push(X1e):P.push(y9(Z1e)),g&&P.push(Qfe(g)),p&&P.push(Ife()),u&&P.push(ce.updateListener.of(N=>{if(N.docChanged){const M=N.state.doc.toString();u(M)}}));const T=ke.create({doc:x?l:c||"",extensions:P}),E=new ce({state:T,parent:y.current});return w.current=E,()=>{E.destroy(),w.current=null}},[]),m.useEffect(()=>{if(x&&w.current&&l!==void 0){const P=w.current.state.doc.toString();P!==l&&w.current.dispatch({changes:{from:0,to:P.length,insert:l}})}},[l,x]);const S=typeof h=="number"?`${h}px`:h;return v.jsxs("div",{className:"w-full",ref:b,children:[a&&v.jsxs(De,{size:"small",fontWeight:"medium",className:"mb-2 block text-sub",children:[a,s&&v.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),v.jsx("div",{className:R(V1e({variant:e,error:r,success:n,disabled:i}),"rounded-md",t),style:{height:S},children:v.jsx("div",{ref:y,className:R("h-full overflow-auto",f==="dark"?"cm-theme-dark":""),style:{fontSize:"14px"}})}),o&&v.jsx("p",{className:R("mt-1 text-xs",r?"text-red-500":n?"text-green-500":"text-sub"),children:o})]})});eI.displayName="EditorTextField",se.AppTooltip=Y$,se.Autocomplete=_5,se.Button=Ja,se.Chart=xce,se.Chip=tS,se.ConversionSidebar=Kce,se.DropdownMenu=Eg,se.DropdownMenuCheckboxItem=Dk,se.DropdownMenuContent=Eu,se.DropdownMenuGroup=Mk,se.DropdownMenuItem=Zs,se.DropdownMenuLabel=Mg,se.DropdownMenuPortal=kW,se.DropdownMenuRadioGroup=QW,se.DropdownMenuRadioItem=Lk,se.DropdownMenuSeparator=zk,se.DropdownMenuShortcut=jk,se.DropdownMenuSub=PW,se.DropdownMenuSubContent=Ik,se.DropdownMenuSubTrigger=Nk,se.DropdownMenuTrigger=_g,se.EditorTextField=eI,se.FilterSelect=QX,se.Heading=kw,se.Icon=et,se.Label=De,se.Menu=CW,se.Paragraph=dp,se.Popup=sq,se.Progress=Mw,se.SearchInput=a2,se.StatusBadge=EX,se.Switch=B$,se.Table=Gv,se.TableBody=Kv,se.TableCaption=R$,se.TableCell=e1,se.TableComponent=rue,se.TableFooter=j$,se.TableHead=Jv,se.TableHeader=Hv,se.TableRow=Df,se.Tabs=wz,se.TabsContent=i2,se.TabsList=n2,se.TabsTrigger=r2,se.Text=wt,se.TextArea=rS,se.TextField=Rk,se.Trend=Fp,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
136
+ `;)a--;this.fragmentEnd=a?a-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=r;if(!n.childAfter(i))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(fe.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),a=e.absoluteLineStart,o=a,s=e.block.children.length,l=o,c=s;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let u=SN(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,u);else{let d=new Te(e.parser.nodeSet.types[F.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(d,r.tree),e.addNode(d,u)}if(r.type.is("Block")&&(Ave.indexOf(r.type.id)<0?(o=r.to-n,s=e.block.children.length):(o=l,s=c),l=r.to-n,c=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return o-a}}function SN(t,e){let r=t;for(let n=1;n<e.length;n++){let i=e[n-1].to,a=e[n].from;i<t&&(r-=a-i)}return r}const _ve=On({"Blockquote/...":k.quote,HorizontalRule:k.contentSeparator,"ATXHeading1/... SetextHeading1/...":k.heading1,"ATXHeading2/... SetextHeading2/...":k.heading2,"ATXHeading3/...":k.heading3,"ATXHeading4/...":k.heading4,"ATXHeading5/...":k.heading5,"ATXHeading6/...":k.heading6,"Comment CommentBlock":k.comment,Escape:k.escape,Entity:k.character,"Emphasis/...":k.emphasis,"StrongEmphasis/...":k.strong,"Link/... Image/...":k.link,"OrderedList/... BulletList/...":k.list,"BlockQuote/...":k.quote,"InlineCode CodeText":k.monospace,"URL Autolink":k.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":k.processingInstruction,"CodeInfo LinkLabel":k.labelName,LinkTitle:k.string,Paragraph:k.content}),Mve=new Kh(new ac(pN).extend(_ve),Object.keys(Hh).map(t=>Hh[t]),Object.keys(Hh).map(t=>fN[t]),Object.keys(Hh),Qve,tN,Object.keys(Cy).map(t=>Cy[t]),Object.keys(Cy),[]);function Nve(t,e,r){let n=[];for(let i=t.firstChild,a=e;;i=i.nextSibling){let o=i?i.from:r;if(o>a&&n.push({from:a,to:o}),!i)break;a=i.to}return n}function Ive(t){let{codeParser:e,htmlParser:r}=t;return{wrap:n9((i,a)=>{let o=i.type.id;if(e&&(o==F.CodeBlock||o==F.FencedCode)){let s="";if(o==F.FencedCode){let c=i.node.getChild(F.CodeInfo);c&&(s=a.read(c.from,c.to))}let l=e(s);if(l)return{parser:l,overlay:c=>c.type.id==F.CodeText,bracketed:o==F.FencedCode}}else if(r&&(o==F.HTMLBlock||o==F.HTMLTag||o==F.CommentBlock))return{parser:r,overlay:Nve(i.node,i.from,i.to)};return null})}}const Dve={resolve:"Strikethrough",mark:"StrikethroughMark"},Lve={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":k.strikethrough}},{name:"StrikethroughMark",style:k.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),i=t.slice(r+2,r+3),a=/\s|^$/.test(n),o=/\s|^$/.test(i),s=Tc.test(n),l=Tc.test(i);return t.addDelimiter(Dve,r,r+2,!o&&(!l||a||s),!a&&(!s||o||l))},after:"Emphasis"}]};function $c(t,e,r=0,n,i=0){let a=0,o=!0,s=-1,l=-1,c=!1,u=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let d=r;d<e.length;d++){let f=e.charCodeAt(d);f==124&&!c?((!o||s>-1)&&a++,o=!1,n&&(s>-1&&u(),n.push(t.elt("TableDelimiter",d+i,d+i+1))),s=l=-1):(c||f!=32&&f!=9)&&(s<0&&(s=d),l=d+1),c=!c&&f==92}return s>-1&&(a++,n&&u()),a}function kN(t,e){for(let r=e;r<t.length;r++){let n=t.charCodeAt(r);if(n==124)return!0;n==92&&r++}return!1}const PN=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class QN{constructor(){this.rows=null}nextLine(e,r,n){if(this.rows==null){this.rows=!1;let i;if((r.next==45||r.next==58||r.next==124)&&PN.test(i=r.text.slice(r.pos))){let a=[];$c(e,n.content,0,a,n.start)==$c(e,i,r.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,a),e.elt("TableDelimiter",e.lineStart+r.pos,e.lineStart+r.text.length)])}}else if(this.rows){let i=[];$c(e,r.text,r.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+r.pos,e.lineStart+r.text.length,i))}return!1}finish(e,r){return this.rows?(e.addLeafElement(r,e.elt("Table",r.start,r.start+r.content.length,this.rows)),!0):!1}}const zve={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":k.heading}},"TableRow",{name:"TableCell",style:k.content},{name:"TableDelimiter",style:k.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return kN(e.content,0)?new QN:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof QN)||!kN(e.text,e.basePos))return!1;let n=t.peekLine();return PN.test(n)&&$c(t,e.text,e.basePos)==$c(t,n,e.basePos)},before:"SetextHeading"}]};class jve{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Rve={defineNodes:[{name:"Task",block:!0,style:k.list},{name:"TaskMarker",style:k.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new jve:null},after:"SetextHeading"}]},CN=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,TN=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Xve=/[\w-]+\.[\w-]+($|\/)/,$N=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,AN=/\/[a-zA-Z\d@.]+/gy;function EN(t,e,r,n){let i=0;for(let a=e;a<r;a++)t[a]==n&&i++;return i}function Zve(t,e){TN.lastIndex=e;let r=TN.exec(t);if(!r||Xve.exec(r[0])[0].indexOf("_")>-1)return-1;let n=e+r[0].length;for(;;){let i=t[n-1],a;if(/[?!.,:*_~]/.test(i)||i==")"&&EN(t,e,n,")")>EN(t,e,n,"("))n--;else if(i==";"&&(a=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+a.index;else break}return n}function _N(t,e){$N.lastIndex=e;let r=$N.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const Vve=[zve,Rve,Lve,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;CN.lastIndex=n;let i=CN.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=Zve(t.text,n+i[0].length),a>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,a));a=n+o[0].length}}else i[3]?a=_N(t.text,n):(a=_N(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(AN.lastIndex=a,i=AN.exec(t.text),i&&(a=i.index+i[0].length)));return a<0?-1:(t.addElement(t.elt("URL",r,a+t.offset)),a+t.offset)}}]}];function MN(t,e,r){return(n,i,a)=>{if(i!=t||n.char(a+1)==t)return-1;let o=[n.elt(r,a,a+1)];for(let s=a+1;s<n.end;s++){let l=n.char(s);if(l==t)return n.addElement(n.elt(e,a,s+1,o.concat(n.elt(r,s,s+1))));if(l==92&&o.push(n.elt("Escape",s,s+++2)),Mr(l))break}return-1}}const qve={defineNodes:[{name:"Superscript",style:k.special(k.content)},{name:"SuperscriptMark",style:k.processingInstruction}],parseInline:[{name:"Superscript",parse:MN(94,"Superscript","SuperscriptMark")}]},Wve={defineNodes:[{name:"Subscript",style:k.special(k.content)},{name:"SubscriptMark",style:k.processingInstruction}],parseInline:[{name:"Subscript",parse:MN(126,"Subscript","SubscriptMark")}]},Bve={defineNodes:[{name:"Emoji",style:k.character}],parseInline:[{name:"Emoji",parse(t,e,r){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(r+1,t.end)))?-1:t.addElement(t.elt("Emoji",r,r+1+n[0].length))}}]},NN=mb({commentTokens:{block:{open:"<!--",close:"-->"}}}),IN=new fe,DN=Mve.configure({props:[si.add(t=>!t.is("Block")||t.is("Document")||Ay(t)!=null||Yve(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),IN.add(Ay),oi.add({Document:()=>null}),Za.add({Document:NN})]});function Ay(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Yve(t){return t.name=="OrderedList"||t.name=="BulletList"}function Fve(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=Ay(n.type))!=null&&i<=e)break;r=n}return r.to}const Uve=hhe.of((t,e,r)=>{for(let n=Ze(t).resolveInner(r,-1);n&&!(n.from<e);n=n.parent){let i=n.type.prop(IN);if(i==null)continue;let a=Fve(n,i);if(a>r)return{from:r,to:a}}return null});function Ey(t){return new Ar(NN,t,[],"markdown")}const Gve=Ey(DN),tp=Ey(DN.configure([Vve,Wve,qve,Bve,{props:[si.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function Hve(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=Sh.matchLanguageName(t,r,!0),n instanceof Sh)return n.support?n.support.language.parser:uc.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class _y{constructor(e,r,n,i,a,o,s){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=a,this.type=o,this.item=s}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let i=this.to-this.from-n.length-this.spaceAfter.length;i>0;i--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+zN(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function LN(t,e){let r=[],n=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return n;(i.name=="ListItem"||i.name=="Blockquote")&&r.push(i)}for(let i=r.length-1;i>=0;i--){let a=r[i],o,s=e.lineAt(a.from),l=a.from-s.from;if(a.name=="Blockquote"&&(o=/^ *>( ?)/.exec(s.text.slice(l))))n.push(new _y(a,l,l+o[0].length,"",o[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new _y(a.parent,l,l+u,o[1],c,o[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let d=o[2];o[3]&&(d+=o[3].replace(/[xX]/," ")),n.push(new _y(a.parent,l,l+u,o[1],c,d,a))}}return n}function zN(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function My(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let s=zN(a,e),l=+s[2];if(i>=0){if(l!=i+1)return;r.push({from:a.from+s[1].length,to:a.from+s[0].length,insert:String(i+2+n)})}i=l}let o=a.nextSibling;if(!o)break;a=o}}function Ny(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(dc)!=" ")return t;let n=Jn(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const Kve=((t={})=>({state:e,dispatch:r})=>{let n=Ze(e),{doc:i}=e,a=null,o=e.changeByRange(s=>{if(!s.empty||!tp.isActiveAt(e,s.from,-1)&&!tp.isActiveAt(e,s.from,1))return a={range:s};let l=s.from,c=i.lineAt(l),u=LN(n.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return a={range:s};let d=u[u.length-1];if(d.to-d.spaceAfter.length>l-c.from)return a={range:s};let f=l>=d.to-d.spaceAfter.length&&!/\S/.test(c.text.slice(d.to));if(d.item&&f){let b=d.node.firstChild,y=d.node.getChild("ListItem","ListItem");if(b.to>=l||y&&y.to<l||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let w=u.length>1?u[u.length-2]:null,x,S="";w&&w.item?(x=c.from+w.from,S=w.marker(i,1)):x=c.from+(w?w.to:0);let P=[{from:x,to:l,insert:S}];return d.node.name=="OrderedList"&&My(d.item,i,P,-2),w&&w.node.name=="OrderedList"&&My(w.item,i,P),{range:V.cursor(x+S.length),changes:P}}else{let w=RN(u,e,c);return{range:V.cursor(l+w.length+1),changes:{from:c.from,insert:w+e.lineBreak}}}}if(d.node.name=="Blockquote"&&f&&c.from){let b=i.lineAt(c.from-1),y=/>\s*$/.exec(b.text);if(y&&y.index==d.from){let w=e.changes([{from:b.from+y.index,to:b.to},{from:c.from+d.from,to:c.to}]);return{range:s.map(w),changes:w}}}let h=[];d.node.name=="OrderedList"&&My(d.item,i,h);let g=d.item&&d.item.from<c.from,p="";if(!g||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=d.to)for(let b=0,y=u.length-1;b<=y;b++)p+=b==y&&!g?u[b].marker(i,1):u[b].blank(b<y?Jn(c.text,4,u[b+1].from)-p.length:null);let O=l;for(;O>c.from&&/\s/.test(c.text.charAt(O-c.from-1));)O--;return p=Ny(p,e),Jve(d.node,e.doc)&&(p=RN(u,e,c)+e.lineBreak+p),h.push({from:O,to:l,insert:e.lineBreak+p}),{range:V.cursor(O+p.length+1),changes:h}});return a?!1:(r(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)})();function jN(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Jve(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let i=e.lineAt(r.to),a=e.lineAt(n.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function RN(t,e,r){let n="";for(let i=0,a=t.length-2;i<=a;i++)n+=t[i].blank(i<a?Jn(r.text,4,t[i+1].from)-n.length:null,i<a);return Ny(n,e)}function e1e(t,e){let r=t.resolveInner(e,-1),n=e;jN(r)&&(n=r.from,r=r.parent);for(let i;i=r.childBefore(n);)if(jN(i))n=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")r=i.lastChild,n=r.to;else break;return r}const t1e=[{key:"Enter",run:Kve},{key:"Backspace",run:({state:t,dispatch:e})=>{let r=Ze(t),n=null,i=t.changeByRange(a=>{let o=a.from,{doc:s}=t;if(a.empty&&tp.isActiveAt(t,a.from)){let l=s.lineAt(o),c=LN(e1e(r,o),s);if(c.length){let u=c[c.length-1],d=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>d&&!/\S/.test(l.text.slice(d,o-l.from)))return{range:V.cursor(l.from+d),changes:{from:l.from+d,to:o}};if(o-l.from==d&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(Jn(l.text,4,u.to)-Jn(l.text,4,u.from));return f==l.from&&(h=Ny(h,t)),{range:V.cursor(f+h.length),changes:{from:f,to:l.from+u.to,insert:h}}}if(f<o)return{range:V.cursor(f),changes:{from:f,to:o}}}}}return n={range:a}});return n?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)}}],XN=LM({matchClosingTags:!1});function r1e(t={}){let{codeLanguages:e,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:i}=Gve,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=XN}=t;if(!(i instanceof Kh))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],c=[s.support,Uve],u;o&&c.push(o1e),r instanceof ai?(c.push(r.support),u=r.language):r&&(u=r);let d=e||u?Hve(e,u):void 0;l.push(Ive({codeParser:d,htmlParser:s.language.parser})),n&&c.push(Rl.high(ph.of(t1e)));let f=Ey(i.configure(l));return a&&c.push(f.data.of({autocomplete:n1e})),new ai(f,c)}function n1e(t){let{state:e,pos:r}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(r-25,r));if(!n)return null;let i=Ze(e).resolveInner(r,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:r-n[0].length,to:r,options:i1e(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Iy=null;function i1e(){if(Iy)return Iy;let t=_0e(new Sge(ke.create({extensions:XN}),0,!0));return Iy=t?t.options:[]}const a1e=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,o1e=ce.domEventHandlers({paste:(t,e)=>{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!tp.isActiveAt(e.state,n.from,1)))return!1;let a=Ze(e.state),o=!1;return a.iterate({from:n.from,to:n.to,enter:s=>{(s.from>n.from||a1e.test(s.name))&&(o=!0)},leave:s=>{s.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Dy=1,s1e=2,l1e=3,c1e=4,u1e=5,d1e=36,f1e=37,h1e=38,p1e=11,g1e=13;function m1e(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function O1e(t){return t==9||t==10||t==13||t==32}let ZN=null,VN=null,qN=0;function Ly(t,e){let r=t.pos+e;if(VN==t&&qN==r)return ZN;for(;O1e(t.peek(e));)e++;let n="";for(;;){let i=t.peek(e);if(!m1e(i))break;n+=String.fromCharCode(i),e++}return VN=t,qN=r,ZN=n||null}function WN(t,e){this.name=t,this.parent=e}const v1e=new jh({start:null,shift(t,e,r,n){return e==Dy?new WN(Ly(n,1)||"",t):t},reduce(t,e){return e==p1e&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==Dy||i==g1e?new WN(Ly(n,1)||"",t):t},strict:!1}),b1e=new at((t,e)=>{if(t.next==60){if(t.advance(),t.next==47){t.advance();let r=Ly(t,0);if(!r)return t.acceptToken(u1e);if(e.context&&r==e.context.name)return t.acceptToken(s1e);for(let n=e.context;n;n=n.parent)if(n.name==r)return t.acceptToken(l1e,-2);t.acceptToken(c1e)}else if(t.next!=33&&t.next!=63)return t.acceptToken(Dy)}},{contextual:!0});function zy(t,e){return new at(r=>{let n=0,i=e.charCodeAt(0);e:for(;!(r.next<0);r.advance(),n++)if(r.next==i){for(let a=1;a<e.length;a++)if(r.peek(a)!=e.charCodeAt(a))continue e;break}n&&r.acceptToken(t)})}const y1e=zy(d1e,"-->"),w1e=zy(f1e,"?>"),x1e=zy(h1e,"]]>"),S1e=On({Text:k.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":k.angleBracket,TagName:k.tagName,"MismatchedCloseTag/TagName":[k.tagName,k.invalid],AttributeName:k.attributeName,AttributeValue:k.attributeValue,Is:k.definitionOperator,"EntityReference CharacterReference":k.character,Comment:k.blockComment,ProcessingInst:k.processingInstruction,DoctypeDecl:k.documentMeta,Cdata:k.special(k.string)}),k1e=Sn.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:v1e,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[S1e],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs%gsv$qwx'^x!^$q!^!_(o!_;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(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[b1e,y1e,w1e,x1e,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function rp(t,e){let r=e&&e.getChild("TagName");return r?t.sliceString(r.from,r.to):""}function jy(t,e){let r=e&&e.firstChild;return!r||r.name!="OpenTag"?"":rp(t,r)}function P1e(t,e,r){let n=e&&e.getChildren("Attribute").find(a=>a.from<=r&&a.to>=r),i=n&&n.getChild("AttributeName");return i?t.sliceString(i.from,i.to):""}function Ry(t){for(let e=t&&t.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function Q1e(t,e){var r;let n=Ze(t).resolveInner(e,-1),i=null;for(let a=n;!i&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(i=a);if(i&&(i.to>e||i.lastChild.type.isError)){let a=i.parent;if(n.name=="TagName")return i.name=="CloseTag"||i.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:a}:{type:"openTag",from:n.from,context:Ry(a)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:i};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:i};let o=n==i||n.name=="Attribute"?n.childBefore(e):n;return o?.name=="StartTag"?{type:"openTag",from:e,context:Ry(a)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:a}:o?.name=="Is"?{type:"attrValue",from:e,context:i}:o?{type:"attrName",from:e,context:i}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((r=n.lastChild)===null||r===void 0)&&r.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:Ry(n)}:null}let C1e=class{constructor(e,r,n){this.attrs=r,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(i=>({label:i,type:"text"})):[]}};const Xy=/^[:\-\.\w\u00b7-\uffff]*$/;function BN(t){return Object.assign(Object.assign({type:"property"},t.completion||{}),{label:t.name})}function YN(t){return typeof t=="string"?{label:`"${t}"`,type:"constant"}:/^"/.test(t.label)?t:Object.assign(Object.assign({},t),{label:`"${t.label}"`})}function T1e(t,e){let r=[],n=[],i=Object.create(null);for(let l of e){let c=BN(l);r.push(c),l.global&&n.push(c),l.values&&(i[l.name]=l.values.map(YN))}let a=[],o=[],s=Object.create(null);for(let l of t){let c=n,u=i;l.attributes&&(c=c.concat(l.attributes.map(f=>typeof f=="string"?r.find(h=>h.label==f)||{label:f,type:"property"}:(f.values&&(u==i&&(u=Object.create(u)),u[f.name]=f.values.map(YN)),BN(f)))));let d=new C1e(l,c,u);s[d.name]=d,a.push(d),l.top&&o.push(d)}o.length||(o=a);for(let l=0;l<a.length;l++){let c=t[l],u=a[l];if(c.children)for(let d of c.children)s[d]&&u.children.push(s[d]);else u.children=a}return l=>{var c;let{doc:u}=l.state,d=Q1e(l.state,l.pos);if(!d||d.type=="tag"&&!l.explicit)return null;let{type:f,from:h,context:g}=d;if(f=="openTag"){let p=o,O=jy(u,g);if(O){let b=s[O];p=b?.children||a}return{from:h,options:p.map(b=>b.completion),validFor:Xy}}else if(f=="closeTag"){let p=jy(u,g);return p?{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)==">"?1:0),options:[((c=s[p])===null||c===void 0?void 0:c.closeNameCompletion)||{label:p+">",type:"type"}],validFor:Xy}:null}else if(f=="attrName"){let p=s[rp(u,g)];return{from:h,options:p?.attrs||n,validFor:Xy}}else if(f=="attrValue"){let p=P1e(u,g,h);if(!p)return null;let O=s[rp(u,g)],b=(O?.attrValues||i)[p];return!b||!b.length?null:{from:h,to:l.pos+(u.sliceString(l.pos,l.pos+1)=='"'?1:0),options:b,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let p=jy(u,g),O=s[p],b=[],y=g&&g.lastChild;p&&(!y||y.name!="CloseTag"||rp(u,y)!=p)&&b.push(O?O.closeCompletion:{label:"</"+p+">",type:"type",boost:2});let w=b.concat((O?.children||(g?a:o)).map(x=>x.openCompletion));if(g&&O?.text.length){let x=g.firstChild;x.to>l.pos-20&&!/\S/.test(l.state.sliceDoc(x.to,l.pos))&&(w=w.concat(O.text))}return{from:h,options:w,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const Zy=wn.define({name:"xml",parser:k1e.configure({props:[oi.add({Element(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),si.add({Element(t){let e=t.firstChild,r=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:r.name=="CloseTag"?r.from:t.to}}}),xb.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function $1e(t={}){let e=[Zy.data.of({autocomplete:T1e(t.elements||[],t.attributes||[])})];return t.autoCloseTags!==!1&&e.push(A1e),new ai(Zy,e)}function FN(t,e,r=t.length){if(!e)return"";let n=e.firstChild,i=n&&n.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,r)):""}const A1e=ce.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!Zy.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var c,u,d;let{head:f}=l,h=o.doc.sliceString(f-1,f)==n,g=Ze(o).resolveInner(f,-1),p;if(h&&n==">"&&g.name=="EndTag"){let O=g.parent;if(((u=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=FN(o.doc,O.parent,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`</${p}>`;return{range:l,changes:{from:f,to:b,insert:y}}}}else if(h&&n=="/"&&g.name=="StartCloseTag"){let O=g.parent;if(g.from==f-2&&((d=O.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(p=FN(o.doc,O,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${p}>`;return{range:V.cursor(f+y.length,-1),changes:{from:f,to:b,insert:y}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([a,o.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E1e="#e5c07b",UN="#e06c75",_1e="#56b6c2",M1e="#ffffff",np="#abb2bf",Vy="#7d8799",N1e="#61afef",I1e="#98c379",GN="#d19a66",D1e="#c678dd",L1e="#21252b",HN="#2c313a",KN="#282c34",qy="#353a42",z1e="#3E4451",JN="#528bff",j1e=ce.theme({"&":{color:np,backgroundColor:KN},".cm-content":{caretColor:JN},".cm-cursor, .cm-dropCursor":{borderLeftColor:JN},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:z1e},".cm-panels":{backgroundColor:L1e,color:np},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:KN,color:Vy,border:"none"},".cm-activeLineGutter":{backgroundColor:HN},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:qy},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qy,borderBottomColor:qy},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:HN,color:np}}},{dark:!0}),R1e=fc.define([{tag:k.keyword,color:D1e},{tag:[k.name,k.deleted,k.character,k.propertyName,k.macroName],color:UN},{tag:[k.function(k.variableName),k.labelName],color:N1e},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:GN},{tag:[k.definition(k.name),k.separator],color:np},{tag:[k.typeName,k.className,k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:E1e},{tag:[k.operator,k.operatorKeyword,k.url,k.escape,k.regexp,k.link,k.special(k.string)],color:_1e},{tag:[k.meta,k.comment],color:Vy},{tag:k.strong,fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.strikethrough,textDecoration:"line-through"},{tag:k.link,color:Vy,textDecoration:"underline"},{tag:k.heading,fontWeight:"bold",color:UN},{tag:[k.atom,k.bool,k.special(k.variableName)],color:GN},{tag:[k.processingInstruction,k.string,k.inserted],color:I1e},{tag:k.invalid,color:M1e}]),X1e=[j1e,y9(R1e)],Z1e=fc.define([{tag:k.keyword,color:"#d73a49",fontWeight:"bold"},{tag:[k.name,k.deleted,k.character,k.macroName],color:"#22863a"},{tag:[k.propertyName],color:"#6f42c1"},{tag:[k.processingInstruction,k.string,k.inserted],color:"#032f62"},{tag:[k.function(k.variableName),k.labelName],color:"#6f42c1"},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:"#005cc5"},{tag:[k.definition(k.name),k.separator],color:"#24292e"},{tag:[k.className],color:"#6f42c1",fontWeight:"bold"},{tag:[k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:"#005cc5"},{tag:[k.typeName],color:"#d73a49",fontWeight:"bold"},{tag:[k.operator,k.operatorKeyword],color:"#d73a49"},{tag:[k.url,k.escape,k.regexp,k.link],color:"#032f62"},{tag:[k.meta,k.comment],color:"#6a737d",fontStyle:"italic"},{tag:k.strong,fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.link,textDecoration:"underline"},{tag:k.heading,fontWeight:"bold",color:"#005cc5"},{tag:[k.atom,k.bool,k.special(k.variableName)],color:"#e36209"},{tag:k.invalid,color:"#cb2431"}]),V1e=mr("w-full border transition-all duration-200 shadow-sm overflow-hidden",{variants:{variant:{outlined:"bg-white border-gray-200 hover:border-primary focus-within:border-primary",filled:"bg-soft border-transparent hover:bg-soft-1 focus-within:border-primary focus-within:bg-white",ghost:"bg-transparent border-transparent hover:border-primary focus-within:border-primary"},error:{true:"!border-red-500 !bg-white"},success:{true:"!border-green-500 !bg-white"},disabled:{true:"bg-soft-1 border-soft-1 cursor-not-allowed opacity-60 pointer-events-none"}},defaultVariants:{variant:"outlined"}}),q1e={javascript:bc,typescript:()=>bc({typescript:!0}),jsx:()=>bc({jsx:!0}),tsx:()=>bc({typescript:!0,jsx:!0}),python:aOe,json:cOe,html:LM,css:QM,sql:wve,markdown:r1e,xml:$1e,yaml:()=>[],plaintext:()=>[]},eI=m.forwardRef(({className:t,variant:e,error:r,success:n,disabled:i,label:a,helperText:o,required:s,value:l,defaultValue:c,onChange:u,language:d="javascript",theme:f="light",height:h="200px",placeholder:g,lineNumbers:p=!0,readOnly:O=!1},b)=>{const y=m.useRef(null),w=m.useRef(null),[x]=m.useState(l!==void 0),S=m.useRef(u);m.useEffect(()=>{S.current=u},[u]),m.useEffect(()=>{if(!y.current)return;const Q=[Mhe(),ph.of([...Lpe,...Zhe]),ce.lineWrapping,ke.readOnly.of(i||O||!1),ce.editable.of(!i&&!O)],T=q1e[d];T&&Q.push(T()),f==="dark"?Q.push(X1e):Q.push(y9(Z1e)),g&&Q.push(Qfe(g)),p&&Q.push(Ife()),Q.push(ce.updateListener.of(M=>{if(M.docChanged){const $=M.state.doc.toString();S.current&&S.current($)}}));const E=ke.create({doc:x?l:c||"",extensions:Q}),N=new ce({state:E,parent:y.current});return w.current=N,()=>{N.destroy(),w.current=null}},[]),m.useEffect(()=>{if(x&&w.current&&l!==void 0){const Q=w.current.state.doc.toString();Q!==l&&w.current.dispatch({changes:{from:0,to:Q.length,insert:l}})}},[l,x]);const P=typeof h=="number"?`${h}px`:h;return v.jsxs("div",{className:"w-full",ref:b,children:[a&&v.jsxs(De,{size:"small",fontWeight:"medium",className:"mb-2 block text-sub",children:[a,s&&v.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),v.jsx("div",{className:R(V1e({variant:e,error:r,success:n,disabled:i}),"rounded-md",t),style:{height:P},children:v.jsx("div",{ref:y,className:R("h-full overflow-auto",f==="dark"?"cm-theme-dark":""),style:{fontSize:"14px"}})}),o&&v.jsx("p",{className:R("mt-1 text-xs",r?"text-red-500":n?"text-green-500":"text-sub"),children:o})]})});eI.displayName="EditorTextField",se.AppTooltip=Y$,se.Autocomplete=_5,se.Button=Ja,se.Chart=xce,se.Chip=tS,se.ConversionSidebar=Kce,se.DropdownMenu=Eg,se.DropdownMenuCheckboxItem=Dk,se.DropdownMenuContent=Eu,se.DropdownMenuGroup=Mk,se.DropdownMenuItem=Zs,se.DropdownMenuLabel=Mg,se.DropdownMenuPortal=kW,se.DropdownMenuRadioGroup=QW,se.DropdownMenuRadioItem=Lk,se.DropdownMenuSeparator=zk,se.DropdownMenuShortcut=jk,se.DropdownMenuSub=PW,se.DropdownMenuSubContent=Ik,se.DropdownMenuSubTrigger=Nk,se.DropdownMenuTrigger=_g,se.EditorTextField=eI,se.FilterSelect=QX,se.Heading=kw,se.Icon=et,se.Label=De,se.Menu=CW,se.Paragraph=dp,se.Popup=sq,se.Progress=Mw,se.SearchInput=a2,se.StatusBadge=EX,se.Switch=B$,se.Table=Gv,se.TableBody=Kv,se.TableCaption=R$,se.TableCell=e1,se.TableComponent=rue,se.TableFooter=j$,se.TableHead=Jv,se.TableHeader=Hv,se.TableRow=Df,se.Tabs=wz,se.TabsContent=i2,se.TabsList=n2,se.TabsTrigger=r2,se.Text=wt,se.TextArea=rS,se.TextField=Rk,se.Trend=Fp,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conversion-ui-library",
3
- "version": "1.0.9",
3
+ "version": "1.1.10",
4
4
  "description": "Modern React UI component library with Tailwind CSS and design tokens",
5
5
  "author": "Vaibhav Anchal",
6
6
  "license": "MIT",