@krantho/studio 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AssistantPanel-DpYeurU-.js → AssistantPanel-CeOJfSzu.js} +2 -2
- package/dist/assets/GraphBrowser-BNto7hgk.js +2 -0
- package/dist/assets/GraphCanvas-Wo0XaRUG.js +1 -0
- package/dist/assets/{action-button-DIrhqMRc.js → action-button-DPLZn2gk.js} +1 -1
- package/dist/assets/api-seo-CL5Gq_tK.js +1 -0
- package/dist/assets/{arduino-DKR9_xyJ.js → arduino-LsGX0_fs.js} +1 -1
- package/dist/assets/{arrow-down-B5kfR2lG.js → arrow-down-EM8VW6wf.js} +1 -1
- package/dist/assets/{arrow-left-7opbl8fu.js → arrow-left-DDRnAcp0.js} +1 -1
- package/dist/assets/{auth-CIpilSKF.js → auth-Dw_S0y7Q.js} +1 -1
- package/dist/assets/{c-CEM0h_nK.js → c-8MGCQYww.js} +1 -1
- package/dist/assets/{circle-check-big-DQjpuxcC.js → circle-check-big-BoM2gsTK.js} +1 -1
- package/dist/assets/{circle-dashed-cuYrILNo.js → circle-dashed-BrW3fkOb.js} +1 -1
- package/dist/assets/{circle-x-peGpq98w.js → circle-x-BFRqOpao.js} +1 -1
- package/dist/assets/{clike-BlGBRct5.js → clike-DDEFrJkJ.js} +1 -1
- package/dist/assets/{clock-DoBIVjZO.js → clock-D6yo3SXy.js} +1 -1
- package/dist/assets/{collection-view-Bbr6ff-2.js → collection-view-m8EZ-LL6.js} +1 -1
- package/dist/assets/{copy-V85khWct.js → copy-DLNaHdGn.js} +1 -1
- package/dist/assets/{corner-down-right-BpwOGRFR.js → corner-down-right-DjKESJQq.js} +1 -1
- package/dist/assets/{cpp-C0nea612.js → cpp-CCXrbquo.js} +1 -1
- package/dist/assets/createLucideIcon-Bepm3pPy.js +1 -0
- package/dist/assets/{csharp-C430X67Y.js → csharp-C9B8MEOG.js} +1 -1
- package/dist/assets/{data-table-B1kqxrEw.js → data-table-CkVtHoRX.js} +1 -1
- package/dist/assets/{editor-page-ydSt1TIL.js → editor-page-DygzC7e2.js} +4 -4
- package/dist/assets/{empty-state-CeUZocHx.js → empty-state-CFOGJxEy.js} +1 -1
- package/dist/assets/{export-helpers-C_HVpJN9.js → export-helpers-88w7CxCC.js} +1 -1
- package/dist/assets/{external-link-Dh7p8Ii6.js → external-link-WjUzPJ5r.js} +1 -1
- package/dist/assets/fill-job-B7N4431e.js +1 -0
- package/dist/assets/{fill-run-view-ChrOLoV4.js → fill-run-view-CwWAvqg1.js} +1 -1
- package/dist/assets/{findability-BrhtZ2yD.js → findability-CMuvomGn.js} +1 -1
- package/dist/assets/{format-C3ZX9yGM.js → format-Bm7d76kc.js} +1 -1
- package/dist/assets/{go-2ldyX7zA.js → go-C0xZKYRK.js} +1 -1
- package/dist/assets/graph-config-CkeJgPns.js +1 -0
- package/dist/assets/{image-editor-CAZbOhRZ.js → image-editor-DUnZn-si.js} +1 -1
- package/dist/assets/index-CZQJBss1.js +2 -0
- package/dist/assets/{info-Cxkabti5.js → info-C_gFhCsx.js} +1 -1
- package/dist/assets/{java-BaDy4FT-.js → java-DQEBLEMZ.js} +1 -1
- package/dist/assets/{javascript-DoKZVVG7.js → javascript-fLcGJpXd.js} +1 -1
- package/dist/assets/{kotlin-aNSUnDDr.js → kotlin-BhmBVS_0.js} +1 -1
- package/dist/assets/{layers-0VWe0rKm.js → layers-BzWhM_T4.js} +1 -1
- package/dist/assets/{list-checks-BCEhMMVY.js → list-checks-BycWtY9-.js} +1 -1
- package/dist/assets/live-markdown-editor-ColMfnPc.js +54 -0
- package/dist/assets/{markdown-ChIsYjIt.js → markdown-Cxg2MxWr.js} +1 -1
- package/dist/assets/{markup-C09yLKTH.js → markup-CaYP0gdG.js} +1 -1
- package/dist/assets/{markup-templating-DNhq-UOv.js → markup-templating-DwmVPbHS.js} +1 -1
- package/dist/assets/{media-model-D4F1Farw.js → media-model-s8-mD6gc.js} +1 -1
- package/dist/assets/media-page-BIWNwixX.js +1 -0
- package/dist/assets/{meter-ZOLJ0WhG.js → meter-ZmQjbS6d.js} +1 -1
- package/dist/assets/{objectivec-s2I4Tn1D.js → objectivec-CHvtiGZJ.js} +1 -1
- package/dist/assets/{pen-line-B524Nue8.js → pen-line-tXXn2ou2.js} +1 -1
- package/dist/assets/{pencil-xdGZtrO4.js → pencil-CGbkYPXO.js} +1 -1
- package/dist/assets/{php-B_6N-5RT.js → php-SxIHzpF9.js} +1 -1
- package/dist/assets/{pulse-page-zRYAQJh6.js → pulse-page-rQssy-k-.js} +1 -1
- package/dist/assets/rolldown-runtime-9C0vUP4u.js +1 -0
- package/dist/assets/{rotate-ccw-BgARBEK3.js → rotate-ccw-IHHFmrqQ.js} +1 -1
- package/dist/assets/{ruby-C8GJZDTg.js → ruby--MTbGwza.js} +1 -1
- package/dist/assets/{save-ClSXW9cb.js → save-DWhrs5es.js} +1 -1
- package/dist/assets/{send-kYpW5JED.js → send-Bf0SGwsO.js} +1 -1
- package/dist/assets/setup-page-C2UVL4hj.js +1 -0
- package/dist/assets/site-CI7ReWwB.js +1 -0
- package/dist/assets/site-model-DwdSKSWR.js +1 -0
- package/dist/assets/{site-overview-B0Dnsj2N.js → site-overview-BnmQMy6p.js} +1 -1
- package/dist/assets/{structure-page-DpM1G-M9.js → structure-page-Cjqo5mS4.js} +2 -2
- package/dist/assets/{trash-DzRCm500.js → trash-DFKejXb4.js} +1 -1
- package/dist/assets/{triangle-exclamation-point-ttN5lZI0.js → triangle-exclamation-point-CxTYPLt1.js} +1 -1
- package/dist/assets/{typescript-s_P45ayF.js → typescript-DuydAHsI.js} +1 -1
- package/dist/assets/{upload-CaqQJaUr.js → upload-9M4suN_I.js} +1 -1
- package/dist/assets/{use-drawer-actions-BeAi2hJS.js → use-drawer-actions-CXYpJuv5.js} +1 -1
- package/dist/assets/use-loaded-DJHzW9zx.js +1 -0
- package/dist/assets/{use-locale-versions-CcJ_us1I.js → use-locale-versions-DXUTVGkz.js} +1 -1
- package/dist/assets/{vendor-diff-DGCTJYJ4.js → vendor-diff-B5uXPOYl.js} +40 -40
- package/dist/assets/vendor-markdown-BXQo8zdD.js +79 -0
- package/dist/assets/{vendor-media-DXSmPN_d.js → vendor-media-BVfbikEZ.js} +1 -1
- package/dist/assets/vendor-react-Njf47Pb1.js +15 -0
- package/dist/assets/{vendor-react-DLioOiRN.css → vendor-react-bSyOAvy0.css} +1 -1
- package/dist/assets/vendor-reactflow-D7sfycOJ.js +1 -0
- package/dist/assets/vendor-router-Cwn5_0Pw.js +1 -0
- package/dist/index.html +9 -9
- package/package.json +23 -23
- package/dist/assets/GraphBrowser-Cm5q82MJ.js +0 -2
- package/dist/assets/GraphCanvas-CZJNUa_J.js +0 -1
- package/dist/assets/api-seo-DeG5gsh6.js +0 -1
- package/dist/assets/createLucideIcon-BklFHeMd.js +0 -1
- package/dist/assets/fill-job-CKtHKXwV.js +0 -1
- package/dist/assets/graph-config-CgXhm7XP.js +0 -1
- package/dist/assets/index-d5j-az5g.js +0 -2
- package/dist/assets/live-markdown-editor-DSsCNBWR.js +0 -54
- package/dist/assets/media-page-DuSUjFO1.js +0 -1
- package/dist/assets/rolldown-runtime-COiEfhsA.js +0 -1
- package/dist/assets/setup-page-CshRkFJ-.js +0 -1
- package/dist/assets/site-CGs9-oiw.js +0 -1
- package/dist/assets/site-model-BXHOxNij.js +0 -1
- package/dist/assets/use-loaded-BNCu0C-c.js +0 -1
- package/dist/assets/vendor-markdown-BeOOOWTF.js +0 -74
- package/dist/assets/vendor-react-CXaWJ_ii.js +0 -15
- package/dist/assets/vendor-reactflow-CMKi7AEX.js +0 -1
- package/dist/assets/vendor-router-B4czwg8X.js +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function e(e,t){this.v=e,this.k=t}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(Array.isArray(e)&&(n==null||n===(typeof Symbol<`u`&&[][Symbol.iterator])||n===[][`@@iterator`]))return e;if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){return n(e,t)||a(e,t)||r()}function a(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function o(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}o.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},o.prototype.next=function(e){return this._invoke(`next`,e)},o.prototype.throw=function(e){return this._invoke(`throw`,e)},o.prototype.return=function(e){return this._invoke(`return`,e)};var s=Object.entries,c=Object.keys,l=Object.setPrototypeOf,u=Object.isFrozen,d=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,p=Object.freeze,m=Object.seal,h=Object.create,g=typeof Reflect<`u`&&Reflect,ee=g.apply,te=g.construct;p||=function(e){return e},m||=function(e){return e},ee||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},te||=function(e){return new e(...[...arguments].slice(1))};var _=C(Array.prototype.forEach),ne=C(Array.prototype.lastIndexOf),re=C(Array.prototype.pop),ie=C(Array.prototype.push),ae=C(Array.prototype.slice),oe=C(Array.prototype.splice),se=Array.isArray,ce=w(Set),le=C(Set.prototype.add),ue=C(Set.prototype.has),de=C(Set.prototype.delete),fe=w(Map),pe=C(Map.prototype.get),me=C(Map.prototype.set),v=C(String.prototype.toLowerCase),he=C(String.prototype.toString),ge=C(String.prototype.match),_e=C(String.prototype.replace),ve=C(String.prototype.indexOf),ye=C(String.prototype.trim),be=C(Number.prototype.toString),xe=C(Boolean.prototype.toString),Se=typeof BigInt>`u`?null:C(BigInt.prototype.toString),y=typeof Symbol>`u`?null:C(Symbol.prototype.toString),b=C(Object.prototype.hasOwnProperty),Ce=C(Object.prototype.toString),we=RegExp.prototype.test,x=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),ee(we,e,[t])},S=w(TypeError);function C(e){return function(t){var n=[...arguments].slice(1);return ee(e,t,n)}}function w(e){return function(){return te(e,[...arguments])}}function T(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v;if(l&&l(e,null),!se(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(u(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Te(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function Ee(e){let t=h(null);for(let r of s(e)){var n=i(r,2);let a=n[0],o=n[1];b(e,a)&&(t[a]=se(o)?Te(o):o&&typeof o==`object`&&o.constructor===Object?Ee(o):o)}return t}function De(e){let t=h(null),n=c(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function Oe(e){switch(typeof e){case`string`:return e;case`number`:return be(e);case`boolean`:return xe(e);case`bigint`:return Se?Se(e):`0`;case`symbol`:return y?y(e):`Symbol()`;case`undefined`:return Ce(e);case`function`:case`object`:{if(e===null)return Ce(e);let t=e,n=E(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Ce(e)}return Ce(e)}default:return Ce(e)}}function E(e,t){for(;e!==null;){let n=f(e,t);if(n){if(n.get)return C(n.get);if(typeof n.value==`function`)return C(n.value)}e=d(e)}function n(){return null}return n}function ke(e,t){for(;e!==null;){let n=f(e,t);if(n)return n.get?C(n.get):null;e=d(e)}return null}function Ae(e){if(!e)return!1;try{return x(e,``),!0}catch{return!1}}var je=p(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Me=p(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.filter.font.g.glyph.glyphref.hkern.image.line.lineargradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ne=p([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Pe=p([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Fe=p(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ie=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Le=p([`#text`]),Re=p(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ze=p(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Be=p(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ve=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),He=m(/{{[\w\W]*|^[\w\W]*}}/g),Ue=m(/<%[\w\W]*|^[\w\W]*%>/g),We=m(/\${[\w\W]*/g),Ge=m(/{{|}}|\${|<%|%>/),Ke=m(/[^\t\n\f\r ]/),qe=m(/\u0000/g),Je=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ye=m(/^aria-[\-\w]+$/),Xe=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ze=m(/^(?:\w+script|data):/i),Qe=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$e=m(/^html$/i),et=m(/^[a-z][.\w]*(-[.\w]+)+$/i),tt=m(/<[/\w!]/g),nt=m(/<[/\w]/g),rt=m(/<[/\w]|^-?>|--!?>|<!-$/g),it=m(/<\/no(script|embed|frames)/i),at=m(/\/>/i),ot=m(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),st=m(/^[\r\n\t ]+/),D={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},ct=p(T({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),lt=p(T({},[`textarea`,`title`])),ut=p(T({},[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`embed`,`frame`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`])),dt=function(){return typeof window>`u`?null:window},ft=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},pt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},mt=function(e,t,n,r){return b(e,t)&&se(e[t])?T(r.base?De(r.base):{},e[t],r.transform):n},ht=function(e,t,n){let r=b(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ee(r):n};function gt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dt(),t=e=>gt(e);if(t.version=`3.5.1`,t.removed=[],!e||!e.document||e.document.nodeType!==D.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,c=e.Element,l=e.NodeFilter,u=e.DOMParser,d=e.MutationObserver,f=e.trustedTypes,g=c.prototype,ee=E(g,`remove`),te=E(g,`removeChild`),be=E(g,`removeAttributeNode`),xe=E(g,`nextSibling`),Se=E(g,`childNodes`),y=E(g,`parentNode`),Ce=E(g,`shadowRoot`),we=E(g,`attributes`),C=o&&o.prototype?E(o.prototype,`nodeType`):null,w=o&&o.prototype?E(o.prototype,`nodeName`):null,Te=o&&o.prototype?E(o.prototype,`ownerDocument`):null,O=function(e){return C?C(e):e.nodeType},k=function(e){return w?w(e):e.nodeName},A=ke(g,`namespaceURI`),_t=function(e){return A?A(e):e.namespaceURI},vt=function(e){return O(e)===D.element?we(e):null};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let j,M=``,yt,bt=!1,N=0,xt=function(){if(N>0)throw S(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},St=function(e){xt(),N++;try{return j.createHTML(e)}finally{N--}},Ct=function(e){return j&&tn?St(e):e},wt=function(e){xt(),N++;try{return j.createScriptURL(e)}finally{N--}},Tt=function(){return bt||=(yt=ft(f,i),!0),yt},Et=n,Dt=Et.implementation,Ot=Et.createNodeIterator,kt=Et.createDocumentFragment,At=Et.getElementsByTagName,jt=r.importNode,P=pt();t.isSupported=typeof s==`function`&&typeof y==`function`&&Dt&&Dt.createHTMLDocument!==void 0;let Mt=He,Nt=Ue,Pt=We,Ft=Je,It=Ye,Lt=Ze,Rt=Qe,zt=et,Bt=Xe,F=null,Vt=T({},[...je,...Me,...Ne,...Fe,...Le]),I=null,Ht=T({},[...Re,...ze,...Be,...Ve]),L=null,Ut=null,Wt=null,R=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Gt=!0,z=!0,Kt=!1,qt=!0,B=!1,Jt=!0,V=!1,Yt=!1,Xt=null,Zt=null,Qt=!1,$t=!1,en=!1,tn=!1,nn=!0,rn=!1,an=`user-content-`,on=!0,sn=!1,H=null,cn=null,ln=!1,un=null,dn=T({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),fn=null,pn=T({},[`audio`,`video`,`img`,`source`,`image`,`track`]),mn=null,hn=T({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),gn=`http://www.w3.org/1998/Math/MathML`,_n=`http://www.w3.org/2000/svg`,U=`http://www.w3.org/1999/xhtml`,vn=U,yn=!1,bn=null,xn=T({},[gn,_n,U],he),Sn=p(T({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),Cn=null,wn=p(T({},[`annotation-xml`])),Tn=null,En=p(h(null)),Dn=T({},[`title`,`style`,`font`,`a`,`script`]),On=null,kn=[`application/xhtml+xml`,`text/html`],W=null,An=null,jn=null,Mn=n.createElement(`form`),Nn=function(e){return e instanceof RegExp||e instanceof Function},Pn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=Ee(e),On=kn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=On===`application/xhtml+xml`?he:v,F=mt(e,`ALLOWED_TAGS`,Vt,{transform:W}),I=mt(e,`ALLOWED_ATTR`,Ht,{transform:W}),bn=mt(e,`ALLOWED_NAMESPACES`,xn,{transform:he}),mn=mt(e,`ADD_URI_SAFE_ATTR`,hn,{transform:W,base:hn}),fn=mt(e,`ADD_DATA_URI_TAGS`,pn,{transform:W,base:pn}),un=mt(e,`FORBID_CONTENTS`,dn,{transform:W}),Ut=mt(e,`FORBID_TAGS`,h(null),{transform:W}),Wt=mt(e,`FORBID_ATTR`,h(null),{transform:W}),ln=b(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ee(e.USE_PROFILES):e.USE_PROFILES:!1,Gt=e.ALLOW_ARIA_ATTR!==!1,z=e.ALLOW_DATA_ATTR!==!1,Kt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=e.SAFE_FOR_TEMPLATES||!1,Jt=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,$t=e.RETURN_DOM||!1,en=e.RETURN_DOM_FRAGMENT||!1,tn=e.RETURN_TRUSTED_TYPE||!1,Qt=e.FORCE_BODY||!1,nn=e.SANITIZE_DOM!==!1,rn=e.SANITIZE_NAMED_PROPS||!1,on=e.KEEP_CONTENT!==!1,sn=e.IN_PLACE||!1,Bt=Ae(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Xe,vn=typeof e.NAMESPACE==`string`?e.NAMESPACE:U,Cn=ht(e,`MATHML_TEXT_INTEGRATION_POINTS`,Sn),Tn=ht(e,`HTML_INTEGRATION_POINTS`,wn);let t=ht(e,`CUSTOM_ELEMENT_HANDLING`,En);if(L=h(null),b(t,`tagNameCheck`)&&Nn(t.tagNameCheck)&&(L.tagNameCheck=t.tagNameCheck),b(t,`attributeNameCheck`)&&Nn(t.attributeNameCheck)&&(L.attributeNameCheck=t.attributeNameCheck),b(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(L.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(L),B&&(z=!1),en&&($t=!0),ln&&((b(e,`ALLOWED_TAGS`)||b(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),F=T({},Le),I=h(null),ln.html===!0&&(T(F,je),T(I,Re)),ln.svg===!0&&(T(F,Me),T(I,ze),T(I,Ve)),ln.svgFilters===!0&&(T(F,Ne),T(I,ze),T(I,Ve)),ln.mathMl===!0&&(T(F,Fe),T(I,Be),T(I,Ve))),R.tagCheck=null,R.attributeCheck=null,b(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:se(e.ADD_TAGS)&&(F===Vt&&(F=De(F)),T(F,e.ADD_TAGS,W))),b(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:se(e.ADD_ATTR)&&(I===Ht&&(I=De(I)),T(I,e.ADD_ATTR,W))),b(e,`ADD_FORBID_CONTENTS`)&&se(e.ADD_FORBID_CONTENTS)&&(un===dn&&(un=De(un)),T(un,e.ADD_FORBID_CONTENTS,W)),on&&(F[`#text`]=!0),V&&T(F,[`html`,`head`,`body`]),F.table&&(F.tbody=!0,delete Ut.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=j;j=e.TRUSTED_TYPES_POLICY;try{M=St(``)}catch(e){throw j=t,e}}else e.TRUSTED_TYPES_POLICY===null?(j=void 0,M=``):(j===void 0&&(j=Tt()),j&&typeof M==`string`&&(M=St(``)));An=p(e)},Fn=T({},[...Me,...Ne,...Pe]),G=T({},[...Fe,...Ie]),In=function(e,t,n){return t===U?e===`svg`:t===gn?e===`svg`&&(n===`annotation-xml`||Cn[n]):!!Fn[e]},Ln=function(e,t,n){return t===U?e===`math`:t===_n?e===`math`&&Tn[n]:!!G[e]},Rn=function(e,t,n){return t===_n&&!Tn[n]||t===gn&&!Cn[n]?!1:!G[e]&&(Dn[e]||!Fn[e])},K=function(e){let t=_t(e),n=v(k(e)),r=y(e),i=vn,a=`template`;return r&&O(r)===D.element&&(i=_t(r),a=v(k(r))),bn[t]?t===_n?In(n,i,a):t===gn?Ln(n,i,a):t===U?Rn(n,i,a):On===`application/xhtml+xml`:!1},q=function(e){ie(t.removed,{element:e}),$n(e);try{y(e).removeChild(e)}catch{if(ee(e),!y(e))throw S(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},zn=function(e,t,n){try{be(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Bn=function(e){Un(e);let t=Se(e);t&&_(ae(t),t=>{try{te(e,t)}catch{}}),O(e)===D.element&&Vn(e,!1)},J=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}if(ie(t.removed,{attribute:r||null,from:n}),r)zn(n,r,e);else try{n.removeAttribute(e)}catch{}if(e===`is`){if($t||en)try{q(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Vn=function(e,t){let n=we(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&I[W(a)])&&zn(e,i,a)}},Hn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&O(e)===D.element){let t=Ce(e);sr(t)&&r.push(t)}let i=Se(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Un=function(e){Hn(e,e=>{O(e)===D.element&&Vn(e,!0)})},Wn=function(e){let t=[];return Hn(e,e=>{t.push(e)},!0),t},Gn=function(e){let t=null;return d&&_(e,e=>{O(e)===D.element&&W(k(e))===`selectedcontent`&&(t||=new d(()=>void 0),t.observe(e,{childList:!0}))}),t},Kn=function(e){_(e.takeRecords(),e=>{_(e.addedNodes,Un),_(e.removedNodes,Un)}),e.disconnect()},qn=function(e,t){let n=ce();_(Wn(e),e=>{O(e)===D.element&&le(n,e)}),_(t,e=>{O(e)===D.element&&!ue(n,e)&&Vn(e,!0)})},Jn=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r||=t.element===e,Un(t.element))}),qn(e,n),r},Yn=function(e,t){Bn(e),Jn(e,t)},Xn=function(e,t){let n=H,r=null,i=()=>(r||(r=ce(),_(t,e=>{le(r,e)})),r);for(let t=0;;t++){let r=Wn(e),a=[e],o=!1;if(_(r,e=>{O(e)===D.documentFragment?ie(a,e):!o&&!ue(n,e)&&(o=ue(i(),e))}),!o)return;if(t>=8)throw S(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{Zn(t,n>0,e,i())})}},Zn=function(e,t,n,r){let i=nr(e),a;for(;a=i.nextNode();)ue(r,a)&&!ue(H,a)&&(t&&$(P.uponSanitizeShadowNode,a,null),Cr(a,n))},Qn=function(e){if(!H)return;le(H,e);let t=pe(cn,e);if(t!==void 0){if(t>=8)throw S(`the tree kept changing during in-place sanitization; refusing to return it`);me(cn,e,t+1)}},$n=function(e){H&&(de(H,e),pe(cn,e)===void 0&&me(cn,e,0))},er=function(e,t){return Jt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Y=function(e){Jt&&Hn(e,e=>{let t=O(e);if(t===D.processingInstruction||t===D.comment&&x(nt,e.data)){try{ee(e)}catch{}return!1}if(t===D.element){let t=e,n=W(k(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&er(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},tr=function(e){let t=null,r=null;if(Qt)e=`<remove></remove>`+e;else{let t=ge(e,st);r=t&&t[0]}On===`application/xhtml+xml`&&vn===U&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=j?St(e):e;if(vn===U)try{t=new u().parseFromString(i,On)}catch{}if(!t||!t.documentElement){t=Dt.createDocument(vn,`template`,null);try{t.documentElement.innerHTML=yn?M:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),vn===U?At.call(t,V?`html`:`body`)[0]:V?t.documentElement:a},nr=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=Te?Te(e):e.ownerDocument;return Ot.call(n||e,e,(t?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},rr=function(e){return e=_e(e,Mt,` `),e=_e(e,Nt,` `),e=_e(e,Pt,` `),e},X=function(e){or(e);let t=e.querySelectorAll?.call(e,`template`);t&&_(t,e=>{sr(e.content)&&X(e.content)})},ir=T({},[`caption`,`colgroup`,`col`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`,`style`,`script`,`template`]),ar=function(e){if(On===`application/xhtml+xml`)return;let t=e.querySelectorAll?.call(e,`table,tbody,thead,tfoot,tr,colgroup`);t&&t.length!==0&&_(t,t=>{_(ae(Se(t)),n=>{let r=O(n);if(!(r===D.text?x(Ke,n.data):r===D.element&&!ir[v(k(n))]))return;let i=t;for(;i&&v(k(i))!==`table`;)i=i===e?null:y(i);let a=i&&i!==e?y(i):null;if(a)try{a.insertBefore(n,i)}catch{}})})},or=function(e){ar(e),e.normalize();let t=nr(e,!0),n=null,r=t.nextNode();for(;r;){let e=r.data;if(x(qe,e)&&(e=_e(e,qe,``),r.data=e),x(Ge,e)&&(e=rr(e),r.data=e),e&&O(r)===D.text){if(n){let t=n.data;x(Ge,t[t.length-1]+e[0])&&(n.data=rr(t+e[0]))}n=r}r=t.nextNode()}},Z=function(e){let t=w?w(e):null;return typeof t!=`string`||W(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==we(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==C(e)||e.childNodes!==Se(e)},Q=function(e){if(!C||typeof e!=`object`||!e)return null;try{let t=C(e);return typeof t==`number`?t:null}catch{return null}},sr=function(e){return Q(e)===D.documentFragment},cr=function(e){return Q(e)!==null};function $(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,An)})}let lr=function(e,t){let n=!!ut[t],r=!!ct[t];return!n&&!r&&!lt[t]||_t(e)!==U?!1:n?e.hasChildNodes():cr(e.firstElementChild)?!0:r&&typeof e.textContent==`string`&&x(tt,e.textContent)},ur=function(e,t,n,r){return!!(Jt&&n===D.element&&(t!==`body`||y(e)!==r)&&e.hasChildNodes()&&!cr(e.firstElementChild)&&x(tt,e.textContent)&&x(tt,e.innerHTML)||Jt&&n===D.element&&lr(e,t)||n===D.processingInstruction||Jt&&n===D.comment&&x(rt,e.data))},dr=function(e,t){return e instanceof RegExp?x(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},fr=function(e,t,n){if(!Ut[t]&&vr(t)&&dr(L.tagNameCheck,t))return!1;if(on&&!un[t]&&!un[v(t)]){let t=y(e),r=Se(e);if(r&&t&&e!==n){let n=r.length;for(let i=n-1;i>=0;--i)t.insertBefore(r[i],xe(e))}}return q(e),!0},pr=function(e,t,n,r){return e.length===0?t:t===n||t===r?De(t):t},mr=function(e,t){return e===t||y(e)!==null?!1:(sn&&Un(e),$n(e),!0)},hr=function(e,n){if(Qn(e),$(P.beforeSanitizeElements,e,null),mr(e,n))return!0;if(Z(e))return q(e),!0;let r=W(k(e)),i=O(e);if(F=pr(P.uponSanitizeElement,F,Vt,Xt),$(P.uponSanitizeElement,e,{tagName:r,allowedTags:F}),mr(e,n))return!0;if(ur(e,r,i,n))return q(e),!0;if((Ut[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!F[r])&&fr(e,r,n))return!0;if(i===D.element&&!K(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&x(it,e.innerHTML))return q(e),!0;if(B&&i===D.text){let n=e.textContent,r=rr(n);n!==r&&(ie(t.removed,{element:e.cloneNode()}),e.textContent=r)}return $(P.afterSanitizeElements,e,null),mr(e,n)},gr=function(e,t,r){if(Wt[t]||er(t,e)||nn&&(t===`id`||t===`name`)&&(r in n||r in Mn))return!1;let i=I[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);if(z&&x(Ft,t)||Gt&&x(It,t))return!0;if(!i)return vr(e)&&dr(L.tagNameCheck,e)&&dr(L.attributeNameCheck,t,e)||t===`is`&&L.allowCustomizedBuiltInElements&&dr(L.tagNameCheck,r);if(mn[t])return!0;let a=_e(r,Rt,``);return x(Bt,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ve(r,`data:`)===0&&fn[e]||Kt&&!x(Lt,a)?!0:!r},_r=T({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),vr=function(e){return!_r[v(e)]&&x(zt,e)},yr=function(e,t,n,r){if(j&&typeof f==`object`&&typeof f.getAttributeType==`function`&&!n)switch(f.getAttributeType(e,t)){case`TrustedHTML`:return St(r);case`TrustedScriptURL`:return wt(r)}return r},br=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Z(e)||(q(e),!1)}catch{return J(t,e),!1}},xr=function(e,t){return Jt&&x(ot,t)?!0:v(e)===`attributename`&&ve(t,`href`)!==-1},Sr=function(e,n){if($(P.beforeSanitizeAttributes,e,null),mr(e,n))return;let r=vt(e);if(!r||Z(e))return;I=pr(P.uponSanitizeAttribute,I,Ht,Zt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},a=r.length,o=W(k(e));for(;a--;){let n=r[a];if(!n)continue;let s=n.name,c=n.namespaceURI,l=n.value,u=W(s),d=l,f=s===`value`?d:ye(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(P.uponSanitizeAttribute,e,i),f=i.attrValue,rn&&(u===`id`||u===`name`)&&ve(f,an)!==0&&(J(s,e,n),f=an+f,p=!0),xr(s,f)?J(s,e,n):i.forceKeepAttr||(i.keepAttr?!qt&&x(at,f)?J(s,e,n):(B&&(f=rr(f)),gr(o,u,f)?(f=yr(o,u,c,f),f!==d&&br(e,s,c,f)&&p&&re(t.removed)):J(s,e,n)):J(s,e,n))}$(P.afterSanitizeAttributes,e,null),mr(e,n)},Cr=function(e,t){hr(e,t),Sr(e,t),sr(e.content)&&wr(e.content)},wr=function(e){let t=null,n=nr(e);for($(P.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(P.uponSanitizeShadowNode,t,null),Cr(t,e),O(t)===D.element){let e=Ce(t);sr(e)&&(Tr(e),wr(e))}B&&or(e),$(P.afterSanitizeShadowDOM,e,null)},Tr=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wr(e.shadow);continue}let n=e.node,r=O(n)===D.element,i=Se(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=w?w(n):null;if(typeof e==`string`&&W(e)===`template`){let e=n.content;sr(e)&&t.push({node:e,shadow:null})}}if(r){let e=Ce(n);sr(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}},Er=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(yn=!e,yn&&(e=`<!-->`),typeof e!=`string`&&!cr(e)&&(e=Oe(e),typeof e!=`string`))throw S(`dirty is not a string, aborting`);if(!t.isSupported)return e;Yt?(F=Xt,I=Zt):Pn(n),jn=An,t.removed=[];let c=sn&&typeof e!=`string`&&cr(e),l=[],u=H,d=cn;if(c){Y(e),l=Wn(e);let t=k(e);if(typeof t==`string`){let n=W(t);if(!F[n]||Ut[n])throw Yn(e,l),S(`root node is forbidden and cannot be sanitized in-place`)}if(Z(e))throw Yn(e,l),S(`root node is clobbered and cannot be sanitized in-place`);H=ce(),cn=fe()}else if(cr(e)){i=tr(`<!---->`);let t=i.ownerDocument;a=t.importNode(e,!0);let n=a.nodeType===D.element&&_t(a)===U;n&&t.body&&a.nodeName===`BODY`?(t.documentElement.replaceChild(a,t.body),i=a):n&&a.nodeName===`HTML`?(t.replaceChild(a,t.documentElement),i=a):i.appendChild(a),Tr(i)}else{if(!$t&&!B&&!V&&e.indexOf(`<`)===-1)return Ct(e);if(i=tr(e),!i)return $t?null:tn?M:``}i&&Qt&&q(i.firstChild);let f=c?e:i,p=null;try{c&&(p=Gn(l),Tr(e));let t=nr(f);for(;o=t.nextNode();)Cr(o,f);c&&Xn(e,l)}catch(t){throw c&&Yn(e,l),t}finally{p&&Kn(p),H=u,cn=d}if(c){if(Jn(e,l))throw S(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return B&&X(e),e}if($t){if(B&&X(i),en)for(s=kt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(I.shadowroot||I.shadowrootmode)&&(s=jt.call(r,s,!0)),s}B&&or(i);let m=V?i.outerHTML:i.innerHTML;return V&&F[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&x($e,i.ownerDocument.doctype.name)&&(m=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3
|
+
`+m),Ct(m)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=jn,i=F,a=I,o=t.removed;jn=null;try{return Er(e,n)}finally{jn=r,r&&(Yt||Pn(r),F=i,I=a,t.removed=o)}},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pn(e),Yt=!0,Xt=F,Zt=I},t.clearConfig=function(){An=null,Yt=!1,Xt=null,Zt=null,j=yt,M=``},t.isValidAttribute=function(e,t,n){An||Pn({});let r=W(e),i=W(t);return typeof n==`string`&&(xr(t,n)||!qt&&x(at,n))?!1:gr(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&b(P,e)&&ie(P[e],t)},t.removeHook=function(e,t){if(b(P,e)){if(t!==void 0){let n=ne(P[e],t);return n===-1?void 0:oe(P[e],n,1)[0]}return re(P[e])}},t.removeHooks=function(e){b(P,e)&&(P[e]=[])},t.removeAllHooks=function(){P=pt()},t}var O=gt();function k(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=k();function _t(e){A=e}var vt={exec:()=>null};function j(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function M(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(N.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var yt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),bt=`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)`,N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|0{0,8}1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^( {1,3})(?:`{3}|~{3})/,beginningSpace:/^[ \t]{1,3}/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,multipleSpaceTabGlobal:/[ \t\r\n]+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,textIndentedContinuation:/^(?:\n(?: {4}| {0,3}\t)[ \t]*[^ \t\n][^\n]*)+/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:RegExp(bt+`(?:\\n|$)`),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:j(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:j(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:j(e=>RegExp(`^ {0,${e}}(?:\`{3,}(?=[^\`\\n]*(?:\\n|$))|~~~)`)),headingBeginRegex:j(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:j(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:j(e=>RegExp(`^ {0,${e}}(?:</?(?:${Dt})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:j(e=>RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},xt=/^(?:[ \t]*(?:\n|$))+/,St=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ct=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,wt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Et=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Dt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Ot=M(` {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Dt).getRegex(),kt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?![ \t]*\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,At=M(kt).replace(/bull/g,Et).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}(?=[^`\n]*(?:\n|$))|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,``).replace(/html/g,Ot).getRegex(),jt=M(kt).replace(/bull/g,Et).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}(?=[^`\n]*(?:\n|$))|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,Ot).getRegex(),P=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Mt=/^[^\n]+/,Nt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Pt=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Nt).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Ft=M(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Et).getRegex(),It=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Lt=M(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,It).replace(`tag`,Dt).replace(`attribute`,/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),Rt=e=>M(P).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,Ot).getRegex(),zt=Rt(N.listInterruptsParagraph),Bt=Rt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),F=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,Vt={blockquote:M(/^(first)(?:next)*/).replace(`first`,M(F).replace(`blank`,/[ \t]*(?:\n|$)| {4}/).getRegex()).replace(`next`,M(F).replace(`blank`,/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,Bt).getRegex(),code:St,def:Pt,fences:Ct,heading:Tt,hr:wt,html:Lt,lheading:At,list:Ft,newline:xt,paragraph:zt,table:vt,text:Mt},I=M(bt+`(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|0{0,8}1[.)])[ \\t]`).replace(`html`,Ot).getRegex(),Ht={...Vt,lheading:jt,table:I,paragraph:M(P).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,N.tableHeader).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,N.listInterruptsParagraph).replace(`html`,Ot).getRegex()},L={...Vt,html:M(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,It).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(P).replace(`hr`,wt).replace(`heading`,` *#{1,6} *[^
|
|
4
|
+
]`).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).replace(`lheading`,At).getRegex()},Ut=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,R=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Gt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,z=/[\p{P}\p{S}]/u,Kt=/[\s\p{P}\p{S}]/u,qt=/[^\s\p{P}\p{S}]/u,B=M(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Kt).getRegex(),Jt=/[\p{Pi}\p{Ps}"']/u,V=/(?!~)[\p{P}\p{S}]/u,Yt=/(?!~)[\s\p{P}\p{S}]/u,Xt=/(?:[^\s\p{P}\p{S}]|~)/u,Zt=M(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,yt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Qt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,$t=M(Qt,`u`).replace(/punct/g,z).getRegex(),en=M(Qt,`u`).replace(/punct/g,V).getRegex(),tn=M(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Jt).replace(/punct/g,z).getRegex(),nn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,rn=M(nn,`gu`).replace(/notPunctSpace/g,qt).replace(/punctSpace/g,Kt).replace(/punct/g,z).getRegex(),an=M(nn,`gu`).replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Yt).replace(/punct/g,V).getRegex(),on=M(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,qt).replace(/punctSpace/g,Kt).replace(/punct/g,z).getRegex(),sn=M(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,qt).replace(/punctSpace/g,Kt).replace(/punct/g,z).getRegex(),H=M(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,qt).replace(/punctSpace/g,Kt).replace(/punct/g,z).getRegex(),cn=M(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,z).getRegex(),ln=M(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,qt).replace(/punctSpace/g,Kt).replace(/punct/g,z).getRegex(),un=M(/\\(punct)/,`gu`).replace(/punct/g,z).getRegex(),dn=M(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,z).getRegex(),fn=M(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pn=M(It).replace(`(?:-->|$)`,`-->`).getRegex(),mn=M(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,pn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,gn=M(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,hn).getRegex(),_n=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,U=M(/\((?:char)*\)/).replace(`char`,_n).getRegex(),vn=M(/\((?:char|p1)*\)/).replace(`char`,_n).replace(`p1`,U).getRegex(),yn=M(/\((?:char|p2)*\)/).replace(`char`,_n).replace(`p2`,vn).getRegex(),bn=M(/(?!<)(?:char|p3)+/).replace(`char`,_n).replace(`p3`,yn).getRegex(),xn=M(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,gn).replace(`href`,M(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace(`bareHref`,bn).getRegex()).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Sn=M(/^!?\[(label)\]\[(ref)\]/).replace(`label`,gn).replace(`ref`,Nt).getRegex(),Cn=M(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Nt).getRegex(),wn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Tn=M(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,hn).getRegex(),En=M(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,M(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Tn).replace(`ref`,wn).getRegex()).replace(`nolink`,M(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,wn).getRegex()).getRegex(),Dn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,On=M(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),kn={_backpedal:vt,anyPunctuation:un,anyPunctuationOutsideCode:dn,autolink:fn,blockSkip:Zt,br:R,code:Wt,del:vt,delLDelim:vt,delRDelim:vt,emStrongLDelim:$t,emStrongRDelimAst:rn,emStrongRDelimUnd:sn,escape:Ut,link:xn,nolink:Cn,punctuation:B,reflink:Sn,reflinkSearch:En,tag:mn,text:Gt,url:vt},W={...kn,emStrongLDelim:tn,emStrongRDelimAst:on,emStrongRDelimUnd:H,link:M(/^!?\[(label)\]\((.*?)\)/).replace(`label`,gn).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,gn).getRegex()},An={...kn,emStrongRDelimAst:an,emStrongLDelim:en,delLDelim:cn,delRDelim:ln,url:M(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,On).replace(`protocol`,Dn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:M(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Dn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,yt?`(?<![^\\s*_~(])www\\.`:`www\\.`).getRegex()},jn={...An,br:M(R).replace(`{2,}`,`*`).getRegex(),text:M(An.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Mn={normal:Vt,gfm:Ht,pedantic:L},Nn={normal:kn,gfm:An,breaks:jn,pedantic:W},Pn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Fn=e=>Pn[e];function G(e,t){if(t){if(N.escapeTest.test(e))return e.replace(N.escapeReplace,Fn)}else if(N.escapeTestNoEncode.test(e))return e.replace(N.escapeReplaceNoEncode,Fn);return e}function In(e){return N.numericCharacterReference.test(e)?e.replace(N.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function Ln(e){try{e=encodeURI(e).replace(N.percentDecode,`%`)}catch{return null}return e}function Rn(e,t){let n=e.replace(N.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(N.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(N.slashPipe,`|`);return n}function K(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function q(e){let t=e.split(`
|
|
5
|
+
`),n=t.length-1;for(;n>=0&&N.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
6
|
+
`)}function zn(e,t=!1){let n=t?N.multipleSpaceGlobal:N.multipleSpaceTabGlobal;return e.trim().replace(n,` `).toLowerCase().toUpperCase().toLowerCase()}function Bn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var J=new WeakMap;function Vn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`
|
|
7
|
+
`:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`
|
|
8
|
+
`&&o!==`\r`&&o!==`\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function Hn(e,t){let n=Vn(t),r=J.get(e);r?r.push(n):J.set(e,[n])}function Un(e){let t=J.get(e);t&&(t.pop(),t.length===0&&J.delete(e))}function Wn(e,t,n){let r=J.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:Vn(t).lastPossibleEmStrongCloserIndex[n]}function Gn(e,t){let n=J.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:Vn(t).lastPossibleDelCloserIndex}function Kn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function qn(e){let t,n=!1;return e.map(e=>{if(n)return e;let{depth:r,expanded:i,keptIndent:a,content:o}=Jn(e,t?.depth??1/0);if(t?.depth!==r&&(t=void 0),t){let e=N.blockquoteFenceClose.exec(o)?.[1];return!e||e[0]!==t.marker[0]||e.length<t.marker.length?a:(t=void 0,i)}if(n=N.blockquoteListItemStart.test(o),n)return e;let s=N.blockquoteFenceOpen.exec(o)?.[1];return s&&(t={marker:s,depth:r}),i}).join(`
|
|
9
|
+
`)}function Jn(e,t){let n=0,r=0,i=0,a=0,o=``;for(;i<t;){let t=n,s=r;for(;e[t]===` `||e[t]===` `;)s+=Yn(e[t],s),t++;if(e[t]!==`>`||s-a>3)break;o+=` `.repeat(s-r)+`>`,i++,n=t+1,r=s+1,a=e[n]===` `||e[n]===` `?r+1:r}if(i===0)return{depth:i,expanded:e,keptIndent:e,content:e};let s=``,c=``;for(;(e[n]===` `||e[n]===` `)&&r<a+4;){let t=Yn(e[n],r);s+=` `.repeat(t),c+=r<a&&t>1?` `.repeat(t):e[n],r+=t,n++}let l=e.slice(n);return{depth:i,expanded:o+s+l,keptIndent:o+c+l,content:` `.repeat(Math.max(0,r-a))+l}}function Yn(e,t){return e===` `?4-t%4:1}function Xn(e,t){let n=``;for(let r=0;r<e.length;r++){if(e[r]==="`"){let i=t.inline.code.exec(e.slice(r));if(i){n+=i[0],r+=i[0].length-1;continue}}e[r]===`\\`&&(e[r+1]===`[`||e[r+1]===`]`)?(n+=e[r+1],r++):n+=e[r]}return n}function Zn(e,t,n,r,i){let a=t.href,o=t.title||null,s=Xn(e[1],i),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Qn(e,t,n,r){let i=e.match(n.other.indentCodeCompensation);if(i===null)return t;let a=i[1].length;return t.split(`
|
|
10
|
+
`).map(t=>{let i=t.match(n.other.beginningSpace);if(i===null)return t;let[o]=i,s=o.indexOf(` `);if(s!==-1&&s<a){if(r)return` `.repeat(4-a)+t.slice(s+1);if(e[a]===`~`)return t}return t.slice(Math.min(o.length,a))}).join(`
|
|
11
|
+
`)}function $n(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var er=class{options;rules;lexer;constructor(e){this.options=e||A}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:q(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Qn(e,t[3]||``,this.rules,this.lexer.state.top&&!this.lexer.state.inBlockquote);t[3]!==void 0&&(n===``||n.endsWith(`
|
|
12
|
+
`))&&(n+=`
|
|
13
|
+
`);let r=t[2];if(r){let e=0,t=r.length;for(;e<t&&(r[e]===` `||r[e]===` `);)e++;for(;t>e&&(r[t-1]===` `||r[t-1]===` `);)t--;r=r.slice(e,t).replace(this.rules.inline.anyPunctuation,`$1`)}return{type:`code`,raw:e,lang:r,text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=K(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:K(t[0],`
|
|
14
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:K(t[0],`
|
|
15
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],`
|
|
16
|
+
`).split(`
|
|
17
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
18
|
+
`),c=(this.lexer.state.top&&!this.lexer.state.inBlockquote&&s.includes(` `)?qn(a):s).replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>n.startsWith(` `)?t+` `+n.slice(1):t+Kn(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
19
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
20
|
+
${s}`:s,r=r?`${r}
|
|
21
|
+
${c}`:c;let l=this.lexer.state.top,u=this.lexer.state.inBlockquote,d=this.lexer.state.lastToken;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,this.lexer.state.inBlockquote=u,e.length===0)break;let f=i.at(-1);if(f?.type===`code`||f?.type===`heading`||f?.type===`hr`||f?.type===`html`||f?.type===`table`)break;if(f?.type===`blockquote`){let t=f,a=e.join(`
|
|
22
|
+
`),o=t.raw+`
|
|
23
|
+
`+a.replace(this.rules.other.blockquoteSetextReplace2,``);this.lexer.state.inBlockquote=!0,this.lexer.state.lastToken=i.at(-2);let s=this.blockquote(o);this.lexer.state.inBlockquote=u,this.lexer.state.lastToken=d,i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
|
24
|
+
`).length:0,p=l?e.slice(0,-l):e;if(p.length>0&&(n=`${n}
|
|
25
|
+
${p.join(`
|
|
26
|
+
`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(p.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(f?.type===`list`){let t=f,a=t.raw+`
|
|
27
|
+
`+e.join(`
|
|
28
|
+
`);this.lexer.state.inBlockquote=!0,this.lexer.state.lastToken=i.at(-2);let o=this.list(a);this.lexer.state.top=l,this.lexer.state.inBlockquote=u,this.lexer.state.lastToken=d,i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`
|
|
29
|
+
`).length:0;if(s>0){let t=e.slice(0,s).join(`
|
|
30
|
+
`);n=`${n}
|
|
31
|
+
${t}`,r=`${r}
|
|
32
|
+
${t}`}if(e=e.slice(s),e.length>0&&!this.rules.other.blockquoteStart.test(e[0]))break}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===`text`&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
|
|
33
|
+
`,1)[0],d=t[1].length,f=this.options.pedantic?Kn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Kn(e,d)),p=e.split(`
|
|
34
|
+
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),f=a,h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h),c=!1;for(;e;){let l=e.split(`
|
|
35
|
+
`,1)[0],u;if(p=l,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),u=p):u=p.replace(this.rules.other.leadingSpaceTab,e=>Kn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(u.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
|
|
36
|
+
`+u.slice(h),c=!1;else{if(m)break;let e=f;if(!this.options.pedantic&&!a.includes(`
|
|
37
|
+
`)&&!f.includes(` `)){let t;for(;!n.test(e)&&(t=this.rules.other.nestedBlockMarker.exec(e));)e=e.slice(t[0].length);if(!e.trim())break}if(e.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(e)||i.test(e)||o.test(e)||n.test(e))break;if(!this.options.pedantic&&!c){let e=f.replace(this.rules.other.nestedContainerMarkers,``);if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}let t=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}
|
|
38
|
+
${p}`)?` ${u.replace(/^ {0,3}/,``)}`:p,s=!this.options.pedantic&&!c&&u.startsWith(` `)?this.rules.block.list.exec(f):null;if(s?.[2]){let e=s[1].length,n=s[2].replace(this.rules.other.leadingSpaceTab,t=>Kn(t,e)),r=n.search(this.rules.other.nonSpaceChar);r>0&&r<=4&&!this.rules.other.nestedBlockMarker.test(n.slice(r))&&u.search(this.rules.other.nonSpaceChar)>=e+r&&this.rules.other.listInterruptsParagraph.test(u.slice(e+r))&&(t=` ${u}`)}a+=`
|
|
39
|
+
`+t,c=!0}m=!p.trim(),e=e.substring(l.length+1),f=u.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();let u=[],d=this.lexer.state.top;for(let e of o.items)if(this.lexer.state.top=!1,u.push(this.lexer.inlineQueue.length),e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}this.lexer.state.top=d;for(let e=0;e<o.items.length;e++){let t=o.items[e],n=t.tokens[0];if(t.task&&(n?.type===`text`||n?.type===`paragraph`)){t.text=t.text.replace(this.rules.other.listReplaceTask,``),n.raw=n.raw.replace(this.rules.other.listReplaceTask,``),n.text=n.text.replace(this.rules.other.listReplaceTask,``);let r=this.lexer.inlineQueue;for(let t=u[e];t<r.length;t++)if(r[t].tokens===n.tokens){r[t].src=r[t].src.replace(this.rules.other.listReplaceTask,``);break}let i=this.rules.other.listTaskCheckbox.exec(t.raw);if(i){let e={type:`checkbox`,raw:i[0]+` `,checked:i[0]!==`[ ]`};t.checked=e.checked,o.loose?t.tokens[0]&&[`paragraph`,`text`].includes(t.tokens[0].type)&&`tokens`in t.tokens[0]&&t.tokens[0].tokens?(t.tokens[0].raw=e.raw+t.tokens[0].raw,t.tokens[0].text=e.raw+t.tokens[0].text,t.tokens[0].tokens.unshift(e)):t.tokens.unshift({type:`paragraph`,raw:e.raw,text:e.raw,tokens:[e]}):t.tokens.unshift(e)}}else t.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){if(this.lexer.state.lastToken?.type===`paragraph`&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=q(t[0]);return{type:`html`,block:!0,raw:n,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Bn(t[2],`()`)!==-1)return;let e=zn(t[1],this.options.pedantic),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:K(t[0],`
|
|
40
|
+
`),href:n,title:r}}}table(e){let t,n;if(this.options.gfm&&!this.options.pedantic){let r=this.rules.other.tableHeader.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2])||(t=Rn(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,``).split(`|`),t.length!==n.length))return}let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;t??=Rn(r[1]),n??=r[2].replace(this.rules.other.tableAlignChars,``).split(`|`);let i=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
41
|
+
`):[],a={type:`table`,raw:K(r[0],`
|
|
42
|
+
`),header:[],align:[],rows:[]};if(t.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<t.length;e++)a.header.push({text:t[e],tokens:this.lexer.inline(t[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Rn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:K(t[0],`
|
|
43
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
44
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],i=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return i&&(n+=i[0],r+=i[0].replace(this.rules.other.codeRemoveIndent,``)),{type:`text`,raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(e.charCodeAt(0)!==92)return;let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=e.charCodeAt(0);if(t!==91&&t!==33)return;let n=this.rules.inline.link.exec(e);if(n){let t=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&$n(e,n[1],t,this.rules))return;let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=K(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Bn(n[2],`()`);if(e===-2)return;if(e>-1){let t=(n[0].indexOf(`!`)===0?5:4)+n[1].length+e;n[2]=n[2].substring(0,e),n[0]=n[0].substring(0,t).trim(),n[3]=``}}let i=K(n[0].slice(0,-1),`\\`);if((n[0].length-i.length)%2==0)return;let a=n[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=n[3]?n[3].slice(1,-1):``;return this.options.pedantic&&(a=a.trim()),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),Zn(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},n[0],this.lexer,this.rules)}}reflink(e,t){let n=e.charCodeAt(0);if(n!==91&&n!==33)return;let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=r[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&$n(e,r[1],n,this.rules))return;let i=t[zn(r[2]||r[1],this.options.pedantic)];if(!i){let e=r[0].charAt(0);return{type:`text`,raw:e,text:e}}return Zn(r,i,r[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:n===`*`||n===`_`||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,g=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let ee=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,te=Wn(this,t,i),_=t.length-e.length+n;if(te<_)return;t=t.slice(-1*e.length+n);let ne=te-_;for(ee.lastIndex=0;(r=ee.exec(t))!==null&&!(r.index>ne);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;f=[...u].length;let t=f>p-n;if(r[3]||r[4]){p+=f;continue}if((r[5]||r[6]||g&&t)&&h%3&&!((h+f)%3)){if(a&&(r[5]||r[6]))break;m+=f;continue}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let i=[...r[0]][0].length,o=e.slice(0,n+r.index+i+f);if(Math.min(n,f)%2){let e=o.slice(1,-1);return{type:`em`,raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let s=o.slice(2,-2);return{type:`strong`,raw:o,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){if(e.charCodeAt(0)!==96)return;let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=e.charCodeAt(0);if(t!==32&&t!==92&&t!==10)return;let n=this.rules.inline.br.exec(e);if(n)return{type:`br`,raw:n[0]}}del(e,t,n=``){if(e.charCodeAt(0)!==126)return;let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=Gn(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:In(t[0]),escaped:e}}}},Y=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new er,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:N,block:Mn.normal,inline:Nn.normal};this.options.pedantic?(t.block=Mn.pedantic,t.inline=Nn.pedantic):this.options.gfm&&(t.block=Mn.gfm,t.inline=this.options.breaks?Nn.breaks:Nn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Mn,inline:Nn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){let r=new e(n);return t.includes(`\r`)&&(t=t.replace(N.carriageReturn,`
|
|
45
|
+
`)),r.inlineTokens(t)}lex(e){e=e.replace(N.carriageReturn,`
|
|
46
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(N.tabCharGlobal,` `).replace(N.spaceLine,``));let i=1/0,a,o=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===er.prototype.paragraph;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
47
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
48
|
+
`)?``:`
|
|
49
|
+
`)+r.raw,n.text+=`
|
|
50
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
51
|
+
`)?``:`
|
|
52
|
+
`)+r.raw,n.text+=`
|
|
53
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let i=t.at(-1);(n||i===a&&o)&&i?.type===`paragraph`?(i.raw+=(i.raw.endsWith(`
|
|
54
|
+
`)?``:`
|
|
55
|
+
`)+r.raw,i.text+=`
|
|
56
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text,a=i):(t.push(r),a=r),n=s.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
57
|
+
`)?``:`
|
|
58
|
+
`)+r.raw,n.text+=`
|
|
59
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,zn(e.slice(n+1,-1),this.options.pedantic))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==er.prototype.emStrong||this.tokenizer.del!==er.prototype.del?this.#r(e):e;if(!n)return this.#t(e,r,t);Hn(this.tokenizer,r);try{return this.#t(e,r,t)}finally{Un(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}let s=e[0];if(s===`*`||s===`_`){let a=t.length-e.length;if(Wn(this.tokenizer,t,s)<=a){let t=1;for(;t<e.length&&e.charCodeAt(t)===s.charCodeAt(0);)t++;let a=e.substring(0,t),o=n.at(-1);o?.type===`text`&&!o.escaped?(o.raw+=a,o.text+=a):n.push({type:`text`,raw:a,text:a,escaped:!1}),e=e.substring(t),i=s,r=!0;continue}}else if(s===`~`){let a=t.length-e.length;if(Gn(this.tokenizer,t)<=a){let t=1;for(;t<e.length&&e.charCodeAt(t)===126;)t++;let a=e.substring(0,t),o=n.at(-1);o?.type===`text`&&!o.escaped?(o.raw+=a,o.text+=a):n.push({type:`text`,raw:a,text:a,escaped:!1}),e=e.substring(t),i=s,r=!0;continue}}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(c=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,i=``,a=0,o;for(t.lastIndex=0;o=t.exec(e);){let s=o.index+(o[2]?o[2].length:0),c=o.index+o[0].length;if(e.charAt(s)===`<`){let i=e.slice(s),a=n.exec(i)||r.exec(i);if(!a){t.lastIndex=s+1;continue}c=s+a[0].length,t.lastIndex=c}i+=e.slice(a,s)+`[`+`a`.repeat(c-s-2)+`]`,a=c}return i+e.slice(a)}#r(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,zn(t.slice(r+1,-1),this.options.pedantic)))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}};function tr(e,t=!1){let n;for(let r=0;r<e.length;r++){let i=e[r],a=i;if(i.type===`codespan`||i.type===`escape`||t&&i.type===`text`){let e=G(i.text,!0);e!==i.text&&(a={...i,text:e})}else if(i.type===`link`&&i.autolink){let e=G(i.text,!0),t=i.tokens,n=t&&(t.length===1&&t[0].type===`text`&&t[0].text===i.text?e===i.text?t:[{...t[0],text:e}]:tr(t,!0));(e!==i.text||n!==t)&&(a=n===t?{...i,text:e}:{...i,text:e,tokens:n})}else if(`tokens`in i&&i.tokens){let e=tr(i.tokens,t);e!==i.tokens&&(a={...i,tokens:e})}a===i?n&&n.push(i):(n||=e.slice(0,r),n.push(a))}return n||e}var nr=class{options;parser;constructor(e){this.options=e||A}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).trim().match(N.notSpaceStart)?.[0],i=e?e.replace(N.endingNewline,``)+`
|
|
60
|
+
`:``;return r?`<pre><code class="language-`+G(r)+`">`+(n?i:G(i,!0))+`</code></pre>
|
|
61
|
+
`:`<pre><code>`+(n?i:G(i,!0))+`</code></pre>
|
|
62
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
63
|
+
${this.parser.parse(e)}</blockquote>
|
|
64
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
65
|
+
`}hr(e){return`<hr>
|
|
66
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
67
|
+
`+r+`</`+i+`>
|
|
68
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
69
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
70
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
71
|
+
<thead>
|
|
72
|
+
`+t+`</thead>
|
|
73
|
+
`+r+`</table>
|
|
74
|
+
`}tablerow({text:e}){return`<tr>
|
|
75
|
+
${e}</tr>
|
|
76
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
77
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${G(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?G(n,!0):this.parser.parseInline(r),o=Ln(e);if(o===null)return a;e=G(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+G(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(tr(r),this.parser.textRenderer));let i=Ln(e);if(i===null)return G(n);e=i;let a=`<img src="${G(e)}" alt="${G(n)}"`;return t&&(a+=` title="${G(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:G(e.text)}},rr=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
|
|
78
|
+
`}checkbox({raw:e}){return e}},X=class e{options;renderer;textRenderer;constructor(e){this.options=e||A,this.options.renderer=this.options.renderer||new nr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rr,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n],i=this.options.extensions?.renderers;if(i&&Object.hasOwn(i,r.type)&&i[r.type]){let e=r,n=i[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n===!1?``:n??``;continue}}let a=r;switch(a.type){case`space`:t+=this.renderer.space(a);break;case`hr`:t+=this.renderer.hr(a);break;case`heading`:t+=this.renderer.heading(a);break;case`code`:t+=this.renderer.code(a);break;case`table`:t+=this.renderer.table(a);break;case`blockquote`:t+=this.renderer.blockquote(a);break;case`list`:t+=this.renderer.list(a);break;case`checkbox`:t+=this.renderer.checkbox(a);break;case`html`:t+=this.renderer.html(a);break;case`def`:t+=this.renderer.def(a);break;case`paragraph`:t+=this.renderer.paragraph(a);break;case`text`:t+=this.renderer.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=this.options.extensions?.renderers;if(a&&Object.hasOwn(a,i.type)&&a[i.type]){let e=a[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e===!1?``:e??``;continue}}let o=i;switch(o.type){case`escape`:n+=t.text(o);break;case`html`:n+=t.html(o);break;case`link`:n+=t.link(o);break;case`image`:n+=t.image(o);break;case`checkbox`:n+=t.checkbox(o);break;case`strong`:n+=t.strong(o);break;case`em`:n+=t.em(o);break;case`codespan`:n+=t.codespan(o);break;case`br`:n+=t.br(o);break;case`del`:n+=t.del(o);break;case`text`:n+=t.text(o);break;default:{let e=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ir=class{options;block;constructor(e){this.options=e||A}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Y.lex:Y.lexInline}provideParser(e=this.block){return e?X.parse:X.parseInline}};function ar(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var or=class{defaults=k();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X;Renderer=nr;TextRenderer=rr;Lexer=Y;Tokenizer=er;Hooks=ir;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(ar(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)ar(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)ar(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;ar(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{if(e[r]){let i=e[r].flat(1/0);ar(n,this.walkTokens(i,t))}}):e.tokens&&ar(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e&&e.renderer){let n=e.renderer,r=t.renderers[e.name];r?t.renderers[e.name]=function(...e){let t=n.apply(this,e);return t===!1&&(t=r.apply(this,e)),t}:t.renderers[e.name]=n}if(`tokenizer`in e&&e.tokenizer){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new nr(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r];if(i===void 0)continue;let a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new er(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r];if(i===void 0)continue;let a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ir;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r];if(i===void 0)continue;let a=t[r];t[r]=ir.passThroughHooks.has(n)?e=>{if(t.options.async&&ir.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return ar(n,r.call(this,e)),t&&ar(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Y.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Y.lex:Y.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?X.parse:X.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Y.lex:Y.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?X.parse:X.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{let r=n instanceof Error?n:Error(String(n));if(r.message+=`
|
|
79
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(r.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}},Z=new or;function Q(e,t){return Z.parse(e,t)}Q.options=Q.setOptions=function(e){return Z.setOptions(e),Q.defaults=Z.defaults,_t(Q.defaults),Q},Q.getDefaults=k,Q.defaults=A,Q.use=function(...e){return Z.use(...e),Q.defaults=Z.defaults,_t(Q.defaults),Q},Q.walkTokens=function(e,t){return Z.walkTokens(e,t)},Q.parseInline=function(e,t){return Z.parseInline(e,t)},Q.Parser=X,Q.parser=X.parse,Q.Renderer=nr,Q.TextRenderer=rr,Q.Lexer=Y,Q.lexer=Y.lex,Q.Tokenizer=er,Q.Hooks=ir,Q.parse=Q,Q.options,Q.setOptions,Q.walkTokens,Q.parseInline,X.parse,Y.lex;export{or as n,O as r,Q as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{s as t}from"./vendor-diff-DGCTJYJ4.js";var n=e(t(),1),r={x:0,y:0,width:0,height:0,unit:`px`},i=(e,t,n)=>Math.min(Math.max(e,t),n),a=(...e)=>e.filter(e=>e&&typeof e==`string`).join(` `),o=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,n){return e.unit===`%`?{...r,...e,unit:`%`}:{unit:`%`,x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function c(e,t,n){return!e.unit||e.unit===`px`?{...r,...e,unit:`px`}:{unit:`px`,x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}}function l(e,t,n,r,i,a=0,o=0,s=r,c=i){let l={...e},u=Math.min(a,r),d=Math.min(o,i),f=Math.min(s,r),p=Math.min(c,i);t&&(t>1?(u=o?o*t:u,d=u/t,f=s*t):(d=a?a/t:d,u=d*t,p=c/t)),l.y<0&&(l.height=Math.max(l.height+l.y,d),l.y=0),l.x<0&&(l.width=Math.max(l.width+l.x,u),l.x=0);let m=r-(l.x+l.width);m<0&&(l.x=Math.min(l.x,r-u),l.width+=m);let h=i-(l.y+l.height);if(h<0&&(l.y=Math.min(l.y,i-d),l.height+=h),l.width<u&&((n===`sw`||n==`nw`)&&(l.x-=u-l.width),l.width=u),l.height<d&&((n===`nw`||n==`ne`)&&(l.y-=d-l.height),l.height=d),l.width>f&&((n===`sw`||n==`nw`)&&(l.x-=f-l.width),l.width=f),l.height>p&&((n===`nw`||n==`ne`)&&(l.y-=p-l.height),l.height=p),t){let e=l.width/l.height;if(e<t){let e=Math.max(l.width/t,d);(n===`nw`||n==`ne`)&&(l.y-=e-l.height),l.height=e}else if(e>t){let e=Math.max(l.height*t,u);(n===`sw`||n==`nw`)&&(l.x-=e-l.width),l.width=e}}return l}function u(e,t,n,r){let i={...e};return t===`ArrowLeft`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`w`?(i.x-=n,i.width+=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`e`?i.width-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowRight`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`w`?(i.x+=n,i.width-=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`e`?i.width+=n:r===`se`&&(i.width+=n,i.height+=n)),t===`ArrowUp`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`n`?(i.y-=n,i.height+=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`s`?i.height-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowDown`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`n`?(i.y+=n,i.height-=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`s`?i.height+=n:r===`se`&&(i.width+=n,i.height+=n)),i}var d={capture:!0,passive:!1},f=0,p=class e extends n.PureComponent{static xOrds=[`e`,`w`];static yOrds=[`n`,`s`];static xyOrds=[`nw`,`ne`,`se`,`sw`];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:`Use the arrow keys to move the crop selection area`,nwDragHandle:`Use the arrow keys to move the north west drag handle to change the crop selection area`,nDragHandle:`Use the up and down arrow keys to move the north drag handle to change the crop selection area`,neDragHandle:`Use the arrow keys to move the north east drag handle to change the crop selection area`,eDragHandle:`Use the up and down arrow keys to move the east drag handle to change the crop selection area`,seDragHandle:`Use the arrow keys to move the south east drag handle to change the crop selection area`,sDragHandle:`Use the up and down arrow keys to move the south drag handle to change the crop selection area`,swDragHandle:`Use the arrow keys to move the south west drag handle to change the crop selection area`,wDragHandle:`Use the up and down arrow keys to move the west drag handle to change the crop selection area`}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,n.createRef)();mediaRef=(0,n.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${f++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:r}=this.getBox();e&&r&&n(c(t,e,r),s(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener(`pointermove`,this.onDocPointerMove,d),this.document.addEventListener(`pointerup`,this.onDocPointerDone,d),this.document.addEventListener(`pointercancel`,this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener(`pointermove`,this.onDocPointerMove,d),this.document.removeEventListener(`pointerup`,this.onDocPointerDone,d),this.document.removeEventListener(`pointercancel`,this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;let i=c(t,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=!!a,s=e.clientX,l=e.clientY,u=i.x,d=i.y;if(a){let t=e.clientX-r.x,n=e.clientY-r.y,o=0,c=0;a===`ne`||a==`e`?(o=t-(i.x+i.width),c=n-i.y,u=i.x,d=i.y+i.height):a===`se`||a===`s`?(o=t-(i.x+i.width),c=n-(i.y+i.height),u=i.x,d=i.y):a===`sw`||a==`w`?(o=t-i.x,c=n-(i.y+i.height),u=i.x+i.width,d=i.y):(a===`nw`||a==`n`)&&(o=t-i.x,c=n-i.y,u=i.x+i.width,d=i.y+i.height),s=u+r.x+o,l=d+r.y+c}this.evData={startClientX:s,startClientY:l,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:o,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:r,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(n||r||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,u=e.clientY-o.y,d={unit:`px`,x:l,y:u,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:u,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let{crop:t,disabled:n,onChange:r,onDragStart:i}=this.props,a=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(e));let{evData:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let u;u=l.isResize?this.resizeCrop():this.dragCrop(),o(t,u)||r(c(u,a.width,a.height),s(u,a.width,a.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:a,onComplete:o}=this.props;if(r)return;let l=t.key,u=!1;if(!n)return;let d=this.getBox(),f=this.makePixelCrop(d),p=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if(l===`ArrowLeft`?(f.x-=p,u=!0):l===`ArrowRight`?(f.x+=p,u=!0):l===`ArrowUp`?(f.y-=p,u=!0):l===`ArrowDown`&&(f.y+=p,u=!0),u){t.cancelable&&t.preventDefault(),f.x=i(f.x,0,d.width-f.width),f.y=i(f.y,0,d.height-f.height);let e=c(f,d.width,d.height),n=s(f,d.width,d.height);a(e,n),o&&o(e,n)}};onHandlerKeyDown=(t,n)=>{let{aspect:r=0,crop:i,disabled:a,minWidth:d=0,minHeight:f=0,maxWidth:p,maxHeight:m,onChange:h,onComplete:g}=this.props,_=this.getBox();if(a||!i)return;if(t.key===`ArrowUp`||t.key===`ArrowDown`||t.key===`ArrowLeft`||t.key===`ArrowRight`)t.stopPropagation(),t.preventDefault();else return;let v=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,y=l(u(c(i,_.width,_.height),t.key,v,n),r,n,_.width,_.height,d,f,p,m);if(!o(i,y)){let e=s(y,_.width,_.height);h(y,e),g&&g(y,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:r,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),r&&r(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return n.x=i(e.startCropX+r,0,t.width-n.width),n.y=i(e.startCropY+a,0,t.height-n.height),n}getPointRegion(e,t,n,r){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;s=r&&t?t===`nw`||t===`n`||t===`ne`:o<i.startCropY;let c;return c=n&&t?t===`nw`||t===`w`||t===`sw`:a<i.startCropX,c?s?`nw`:`sw`:s?`ne`:`se`}resolveMinDimensions(e,t,n=0,r=0){let i=Math.min(n,e.width),a=Math.min(r,e.height);return!t||!i&&!a?[i,a]:t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:a}=this.props,o=this.getBox(),[s,c]=this.resolveMinDimensions(o,n,this.props.minWidth,this.props.minHeight),u=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,s,c),f=t.ord||d,p=t.clientX-t.startClientX,m=t.clientY-t.startClientY;(s&&f===`nw`||f===`w`||f===`sw`)&&(p=Math.min(p,-s)),(c&&f===`nw`||f===`n`||f===`ne`)&&(m=Math.min(m,-c));let h={unit:`px`,x:0,y:0,width:0,height:0};d===`ne`?(h.x=t.startCropX,h.width=p,n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY-h.height)):d===`se`?(h.x=t.startCropX,h.y=t.startCropY,h.width=p,h.height=n?h.width/n:m):d===`sw`?(h.x=t.startCropX+p,h.y=t.startCropY,h.width=Math.abs(p),h.height=n?h.width/n:m):d===`nw`&&(h.x=t.startCropX+p,h.width=Math.abs(p),n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY+m));let g=l(h,n,d,o.width,o.height,s,c,r,a);return n||e.xyOrds.indexOf(f)>-1?u=g:e.xOrds.indexOf(f)>-1?(u.x=g.x,u.width=g.width):e.yOrds.indexOf(f)>-1&&(u.y=g.y,u.height=g.height),u.x=i(u.x,0,o.width-u.width),u.y=i(u.y,0,o.height-u.height),u}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,c=this.getCropStyle();if(s)return n.createElement(`div`,{style:c,className:`ReactCrop__crop-selection`,onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:`group`},!r&&!i&&n.createElement(`div`,{className:`ReactCrop__drag-elements`,onFocus:this.onDragFocus},n.createElement(`div`,{className:`ReactCrop__drag-bar ord-n`,"data-ord":`n`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-e`,"data-ord":`e`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-s`,"data-ord":`s`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-w`,"data-ord":`w`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-nw`,"data-ord":`nw`,tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`nw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-n`,"data-ord":`n`,tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`n`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-ne`,"data-ord":`ne`,tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`ne`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-e`,"data-ord":`e`,tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`e`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-se`,"data-ord":`se`,tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`se`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-s`,"data-ord":`s`,tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`s`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-sw`,"data-ord":`sw`,tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`sw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-w`,"data-ord":`w`,tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`w`),role:`button`})),a&&n.createElement(`div`,{className:`ReactCrop__selection-addon`,onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&n.createElement(n.Fragment,null,n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-hz`}),n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-vt`})))}makePixelCrop(e){return c({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:i,crop:o,disabled:s,locked:c,style:l,ruleOfThirds:u}=this.props,{cropIsActive:d,newCropIsBeingDrawn:f}=this.state,p=o?this.renderCropSelection():null,m=a(`ReactCrop`,i,d&&`ReactCrop--active`,s&&`ReactCrop--disabled`,c&&`ReactCrop--locked`,f&&`ReactCrop--new-crop`,o&&e&&`ReactCrop--fixed-aspect`,o&&r&&`ReactCrop--circular-crop`,o&&u&&`ReactCrop--rule-of-thirds`,!this.dragStarted&&o&&!o.width&&!o.height&&`ReactCrop--invisible-crop`,r&&`ReactCrop--no-animate`);return n.createElement(`div`,{ref:this.componentRef,className:m,style:l},n.createElement(`div`,{ref:this.mediaRef,className:`ReactCrop__child-wrapper`,onPointerDown:this.onComponentPointerDown},t),o?n.createElement(`svg`,{className:`ReactCrop__crop-mask`,width:`100%`,height:`100%`},n.createElement(`defs`,null,n.createElement(`mask`,{id:`hole-${this.instanceId}`},n.createElement(`rect`,{width:`100%`,height:`100%`,fill:`white`}),r?n.createElement(`ellipse`,{cx:`${o.x+o.width/2}${o.unit}`,cy:`${o.y+o.height/2}${o.unit}`,rx:`${o.width/2}${o.unit}`,ry:`${o.height/2}${o.unit}`,fill:`black`}):n.createElement(`rect`,{x:`${o.x}${o.unit}`,y:`${o.y}${o.unit}`,width:`${o.width}${o.unit}`,height:`${o.height}${o.unit}`,fill:`black`}))),n.createElement(`rect`,{fill:`black`,fillOpacity:.5,width:`100%`,height:`100%`,mask:`url(#hole-${this.instanceId})`})):void 0,p)}};export{p as t};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-9C0vUP4u.js";import{s as t}from"./vendor-diff-B5uXPOYl.js";var n=e(t(),1),r={x:0,y:0,width:0,height:0,unit:`px`},i=(e,t,n)=>Math.min(Math.max(e,t),n),a=(...e)=>e.filter(e=>e&&typeof e==`string`).join(` `),o=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,n){return e.unit===`%`?{...r,...e,unit:`%`}:{unit:`%`,x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function c(e,t,n){return!e.unit||e.unit===`px`?{...r,...e,unit:`px`}:{unit:`px`,x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}}function l(e,t,n,r,i,a=0,o=0,s=r,c=i){let l={...e},u=Math.min(a,r),d=Math.min(o,i),f=Math.min(s,r),p=Math.min(c,i);t&&(t>1?(u=o?o*t:u,d=u/t,f=s*t):(d=a?a/t:d,u=d*t,p=c/t)),l.y<0&&(l.height=Math.max(l.height+l.y,d),l.y=0),l.x<0&&(l.width=Math.max(l.width+l.x,u),l.x=0);let m=r-(l.x+l.width);m<0&&(l.x=Math.min(l.x,r-u),l.width+=m);let h=i-(l.y+l.height);if(h<0&&(l.y=Math.min(l.y,i-d),l.height+=h),l.width<u&&((n===`sw`||n==`nw`)&&(l.x-=u-l.width),l.width=u),l.height<d&&((n===`nw`||n==`ne`)&&(l.y-=d-l.height),l.height=d),l.width>f&&((n===`sw`||n==`nw`)&&(l.x-=f-l.width),l.width=f),l.height>p&&((n===`nw`||n==`ne`)&&(l.y-=p-l.height),l.height=p),t){let e=l.width/l.height;if(e<t){let e=Math.max(l.width/t,d);(n===`nw`||n==`ne`)&&(l.y-=e-l.height),l.height=e}else if(e>t){let e=Math.max(l.height*t,u);(n===`sw`||n==`nw`)&&(l.x-=e-l.width),l.width=e}}return l}function u(e,t,n,r){let i={...e};return t===`ArrowLeft`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`w`?(i.x-=n,i.width+=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`e`?i.width-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowRight`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`w`?(i.x+=n,i.width-=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`e`?i.width+=n:r===`se`&&(i.width+=n,i.height+=n)),t===`ArrowUp`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`n`?(i.y-=n,i.height+=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`s`?i.height-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowDown`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`n`?(i.y+=n,i.height-=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`s`?i.height+=n:r===`se`&&(i.width+=n,i.height+=n)),i}var d={capture:!0,passive:!1},f=0,p=class e extends n.PureComponent{static xOrds=[`e`,`w`];static yOrds=[`n`,`s`];static xyOrds=[`nw`,`ne`,`se`,`sw`];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:`Use the arrow keys to move the crop selection area`,nwDragHandle:`Use the arrow keys to move the north west drag handle to change the crop selection area`,nDragHandle:`Use the up and down arrow keys to move the north drag handle to change the crop selection area`,neDragHandle:`Use the arrow keys to move the north east drag handle to change the crop selection area`,eDragHandle:`Use the up and down arrow keys to move the east drag handle to change the crop selection area`,seDragHandle:`Use the arrow keys to move the south east drag handle to change the crop selection area`,sDragHandle:`Use the up and down arrow keys to move the south drag handle to change the crop selection area`,swDragHandle:`Use the arrow keys to move the south west drag handle to change the crop selection area`,wDragHandle:`Use the up and down arrow keys to move the west drag handle to change the crop selection area`}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,n.createRef)();mediaRef=(0,n.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${f++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:r}=this.getBox();e&&r&&n(c(t,e,r),s(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener(`pointermove`,this.onDocPointerMove,d),this.document.addEventListener(`pointerup`,this.onDocPointerDone,d),this.document.addEventListener(`pointercancel`,this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener(`pointermove`,this.onDocPointerMove,d),this.document.removeEventListener(`pointerup`,this.onDocPointerDone,d),this.document.removeEventListener(`pointercancel`,this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;let i=c(t,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=!!a,s=e.clientX,l=e.clientY,u=i.x,d=i.y;if(a){let t=e.clientX-r.x,n=e.clientY-r.y,o=0,c=0;a===`ne`||a==`e`?(o=t-(i.x+i.width),c=n-i.y,u=i.x,d=i.y+i.height):a===`se`||a===`s`?(o=t-(i.x+i.width),c=n-(i.y+i.height),u=i.x,d=i.y):a===`sw`||a==`w`?(o=t-i.x,c=n-(i.y+i.height),u=i.x+i.width,d=i.y):(a===`nw`||a==`n`)&&(o=t-i.x,c=n-i.y,u=i.x+i.width,d=i.y+i.height),s=u+r.x+o,l=d+r.y+c}this.evData={startClientX:s,startClientY:l,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:o,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:r,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(n||r||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,u=e.clientY-o.y,d={unit:`px`,x:l,y:u,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:u,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let{crop:t,disabled:n,onChange:r,onDragStart:i}=this.props,a=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(e));let{evData:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let u;u=l.isResize?this.resizeCrop():this.dragCrop(),o(t,u)||r(c(u,a.width,a.height),s(u,a.width,a.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:a,onComplete:o}=this.props;if(r)return;let l=t.key,u=!1;if(!n)return;let d=this.getBox(),f=this.makePixelCrop(d),p=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if(l===`ArrowLeft`?(f.x-=p,u=!0):l===`ArrowRight`?(f.x+=p,u=!0):l===`ArrowUp`?(f.y-=p,u=!0):l===`ArrowDown`&&(f.y+=p,u=!0),u){t.cancelable&&t.preventDefault(),f.x=i(f.x,0,d.width-f.width),f.y=i(f.y,0,d.height-f.height);let e=c(f,d.width,d.height),n=s(f,d.width,d.height);a(e,n),o&&o(e,n)}};onHandlerKeyDown=(t,n)=>{let{aspect:r=0,crop:i,disabled:a,minWidth:d=0,minHeight:f=0,maxWidth:p,maxHeight:m,onChange:h,onComplete:g}=this.props,_=this.getBox();if(a||!i)return;if(t.key===`ArrowUp`||t.key===`ArrowDown`||t.key===`ArrowLeft`||t.key===`ArrowRight`)t.stopPropagation(),t.preventDefault();else return;let v=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,y=l(u(c(i,_.width,_.height),t.key,v,n),r,n,_.width,_.height,d,f,p,m);if(!o(i,y)){let e=s(y,_.width,_.height);h(y,e),g&&g(y,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:r,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),r&&r(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return n.x=i(e.startCropX+r,0,t.width-n.width),n.y=i(e.startCropY+a,0,t.height-n.height),n}getPointRegion(e,t,n,r){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;s=r&&t?t===`nw`||t===`n`||t===`ne`:o<i.startCropY;let c;return c=n&&t?t===`nw`||t===`w`||t===`sw`:a<i.startCropX,c?s?`nw`:`sw`:s?`ne`:`se`}resolveMinDimensions(e,t,n=0,r=0){let i=Math.min(n,e.width),a=Math.min(r,e.height);return!t||!i&&!a?[i,a]:t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:a}=this.props,o=this.getBox(),[s,c]=this.resolveMinDimensions(o,n,this.props.minWidth,this.props.minHeight),u=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,s,c),f=t.ord||d,p=t.clientX-t.startClientX,m=t.clientY-t.startClientY;(s&&f===`nw`||f===`w`||f===`sw`)&&(p=Math.min(p,-s)),(c&&f===`nw`||f===`n`||f===`ne`)&&(m=Math.min(m,-c));let h={unit:`px`,x:0,y:0,width:0,height:0};d===`ne`?(h.x=t.startCropX,h.width=p,n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY-h.height)):d===`se`?(h.x=t.startCropX,h.y=t.startCropY,h.width=p,h.height=n?h.width/n:m):d===`sw`?(h.x=t.startCropX+p,h.y=t.startCropY,h.width=Math.abs(p),h.height=n?h.width/n:m):d===`nw`&&(h.x=t.startCropX+p,h.width=Math.abs(p),n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY+m));let g=l(h,n,d,o.width,o.height,s,c,r,a);return n||e.xyOrds.indexOf(f)>-1?u=g:e.xOrds.indexOf(f)>-1?(u.x=g.x,u.width=g.width):e.yOrds.indexOf(f)>-1&&(u.y=g.y,u.height=g.height),u.x=i(u.x,0,o.width-u.width),u.y=i(u.y,0,o.height-u.height),u}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,c=this.getCropStyle();if(s)return n.createElement(`div`,{style:c,className:`ReactCrop__crop-selection`,onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:`group`},!r&&!i&&n.createElement(`div`,{className:`ReactCrop__drag-elements`,onFocus:this.onDragFocus},n.createElement(`div`,{className:`ReactCrop__drag-bar ord-n`,"data-ord":`n`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-e`,"data-ord":`e`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-s`,"data-ord":`s`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-w`,"data-ord":`w`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-nw`,"data-ord":`nw`,tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`nw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-n`,"data-ord":`n`,tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`n`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-ne`,"data-ord":`ne`,tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`ne`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-e`,"data-ord":`e`,tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`e`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-se`,"data-ord":`se`,tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`se`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-s`,"data-ord":`s`,tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`s`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-sw`,"data-ord":`sw`,tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`sw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-w`,"data-ord":`w`,tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`w`),role:`button`})),a&&n.createElement(`div`,{className:`ReactCrop__selection-addon`,onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&n.createElement(n.Fragment,null,n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-hz`}),n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-vt`})))}makePixelCrop(e){return c({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:i,crop:o,disabled:s,locked:c,style:l,ruleOfThirds:u}=this.props,{cropIsActive:d,newCropIsBeingDrawn:f}=this.state,p=o?this.renderCropSelection():null,m=a(`ReactCrop`,i,d&&`ReactCrop--active`,s&&`ReactCrop--disabled`,c&&`ReactCrop--locked`,f&&`ReactCrop--new-crop`,o&&e&&`ReactCrop--fixed-aspect`,o&&r&&`ReactCrop--circular-crop`,o&&u&&`ReactCrop--rule-of-thirds`,!this.dragStarted&&o&&!o.width&&!o.height&&`ReactCrop--invisible-crop`,r&&`ReactCrop--no-animate`);return n.createElement(`div`,{ref:this.componentRef,className:m,style:l},n.createElement(`div`,{ref:this.mediaRef,className:`ReactCrop__child-wrapper`,onPointerDown:this.onComponentPointerDown},t),o?n.createElement(`svg`,{className:`ReactCrop__crop-mask`,width:`100%`,height:`100%`},n.createElement(`defs`,null,n.createElement(`mask`,{id:`hole-${this.instanceId}`},n.createElement(`rect`,{width:`100%`,height:`100%`,fill:`white`}),r?n.createElement(`ellipse`,{cx:`${o.x+o.width/2}${o.unit}`,cy:`${o.y+o.height/2}${o.unit}`,rx:`${o.width/2}${o.unit}`,ry:`${o.height/2}${o.unit}`,fill:`black`}):n.createElement(`rect`,{x:`${o.x}${o.unit}`,y:`${o.y}${o.unit}`,width:`${o.width}${o.unit}`,height:`${o.height}${o.unit}`,fill:`black`}))),n.createElement(`rect`,{fill:`black`,fillOpacity:.5,width:`100%`,height:`100%`,mask:`url(#hole-${this.instanceId})`})):void 0,p)}};export{p as t};
|