@tryghost/koenig-lexical 0.0.57 → 0.0.58
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.
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
`}function o(c,f,d,m,x){var y=x.rules.footnote_anchor_name(c,f,d,m,x);return c[f].meta.subId>0&&(y+=":"+c[f].meta.subId),'<li id="fn'+y+'" class="footnote-item">'}function s(){return`</li>
|
|
61
61
|
`}function l(c,f,d,m,x){var y=x.rules.footnote_anchor_name(c,f,d,m,x);return c[f].meta.subId>0&&(y+=":"+c[f].meta.subId),' <a href="#fnref'+y+'" class="footnote-backref">\u21A9\uFE0E</a>'}return AS=function(f){var d=f.helpers.parseLinkLabel,m=f.utils.isSpace;f.renderer.rules.footnote_ref=t,f.renderer.rules.footnote_block_open=n,f.renderer.rules.footnote_block_close=i,f.renderer.rules.footnote_open=o,f.renderer.rules.footnote_close=s,f.renderer.rules.footnote_anchor=l,f.renderer.rules.footnote_caption=e,f.renderer.rules.footnote_anchor_name=r;function x(k,A,$,R){var D,N,M,B,Z,ee,ie,z,W,ne,V,q=k.bMarks[A]+k.tShift[A],H=k.eMarks[A];if(q+4>H||k.src.charCodeAt(q)!==91||k.src.charCodeAt(q+1)!==94)return!1;for(Z=q+2;Z<H;Z++){if(k.src.charCodeAt(Z)===32)return!1;if(k.src.charCodeAt(Z)===93)break}if(Z===q+2||Z+1>=H||k.src.charCodeAt(++Z)!==58)return!1;if(R)return!0;for(Z++,k.env.footnotes||(k.env.footnotes={}),k.env.footnotes.refs||(k.env.footnotes.refs={}),ee=k.src.slice(q+2,Z-2),k.env.footnotes.refs[":"+ee]=-1,ie=new k.Token("footnote_reference_open","",1),ie.meta={label:ee},ie.level=k.level++,k.tokens.push(ie),D=k.bMarks[A],N=k.tShift[A],M=k.sCount[A],B=k.parentType,V=Z,z=W=k.sCount[A]+Z-(k.bMarks[A]+k.tShift[A]);Z<H&&(ne=k.src.charCodeAt(Z),m(ne));){ne===9?W+=4-W%4:W++;Z++}return k.tShift[A]=Z-V,k.sCount[A]=W-z,k.bMarks[A]=V,k.blkIndent+=4,k.parentType="footnote",k.sCount[A]<k.blkIndent&&(k.sCount[A]+=k.blkIndent),k.md.block.tokenize(k,A,$,!0),k.parentType=B,k.blkIndent-=4,k.tShift[A]=N,k.sCount[A]=M,k.bMarks[A]=D,ie=new k.Token("footnote_reference_close","",-1),ie.level=--k.level,k.tokens.push(ie),!0}function y(k,A){var $,R,D,N,M,B=k.posMax,Z=k.pos;return Z+2>=B||k.src.charCodeAt(Z)!==94||k.src.charCodeAt(Z+1)!==91||($=Z+2,R=d(k,Z+1),R<0)?!1:(A||(k.env.footnotes||(k.env.footnotes={}),k.env.footnotes.list||(k.env.footnotes.list=[]),D=k.env.footnotes.list.length,k.md.inline.parse(k.src.slice($,R),k.md,k.env,M=[]),N=k.push("footnote_ref","",0),N.meta={id:D},k.env.footnotes.list[D]={content:k.src.slice($,R),tokens:M}),k.pos=R+1,k.posMax=B,!0)}function S(k,A){var $,R,D,N,M,B=k.posMax,Z=k.pos;if(Z+3>B||!k.env.footnotes||!k.env.footnotes.refs||k.src.charCodeAt(Z)!==91||k.src.charCodeAt(Z+1)!==94)return!1;for(R=Z+2;R<B;R++){if(k.src.charCodeAt(R)===32||k.src.charCodeAt(R)===10)return!1;if(k.src.charCodeAt(R)===93)break}return R===Z+2||R>=B||(R++,$=k.src.slice(Z+2,R-1),typeof k.env.footnotes.refs[":"+$]>"u")?!1:(A||(k.env.footnotes.list||(k.env.footnotes.list=[]),k.env.footnotes.refs[":"+$]<0?(D=k.env.footnotes.list.length,k.env.footnotes.list[D]={label:$,count:0},k.env.footnotes.refs[":"+$]=D):D=k.env.footnotes.refs[":"+$],N=k.env.footnotes.list[D].count,k.env.footnotes.list[D].count++,M=k.push("footnote_ref","",0),M.meta={id:D,subId:N,label:$}),k.pos=R,k.posMax=B,!0)}function _(k){var A,$,R,D,N,M,B,Z,ee,ie,z=!1,W={};if(!!k.env.footnotes&&(k.tokens=k.tokens.filter(function(ne){return ne.type==="footnote_reference_open"?(z=!0,ee=[],ie=ne.meta.label,!1):ne.type==="footnote_reference_close"?(z=!1,W[":"+ie]=ee,!1):(z&&ee.push(ne),!z)}),!!k.env.footnotes.list)){for(M=k.env.footnotes.list,B=new k.Token("footnote_block_open","",1),k.tokens.push(B),A=0,$=M.length;A<$;A++){for(B=new k.Token("footnote_open","",1),B.meta={id:A,label:M[A].label},k.tokens.push(B),M[A].tokens?(Z=[],B=new k.Token("paragraph_open","p",1),B.block=!0,Z.push(B),B=new k.Token("inline","",0),B.children=M[A].tokens,B.content=M[A].content,Z.push(B),B=new k.Token("paragraph_close","p",-1),B.block=!0,Z.push(B)):M[A].label&&(Z=W[":"+M[A].label]),Z&&(k.tokens=k.tokens.concat(Z)),k.tokens[k.tokens.length-1].type==="paragraph_close"?N=k.tokens.pop():N=null,D=M[A].count>0?M[A].count:1,R=0;R<D;R++)B=new k.Token("footnote_anchor","",0),B.meta={id:A,subId:R,label:M[A].label},k.tokens.push(B);N&&k.tokens.push(N),B=new k.Token("footnote_close","",-1),k.tokens.push(B)}B=new k.Token("footnote_block_close","",-1),k.tokens.push(B)}}f.block.ruler.before("reference","footnote_def",x,{alt:["paragraph","reference"]}),f.inline.ruler.after("image","footnote_inline",y),f.inline.ruler.after("footnote_inline","footnote_ref",S),f.core.ruler.after("inline","footnote_tail",_)},AS}var PS,A5;function P5(){return A5||(A5=1,PS=function(e){function t(n,i,o,s){var l,c,f,d,m=n.bMarks[i]+n.tShift[i],x=n.eMarks[i];if(l=n.src.charCodeAt(m),l!==35||m>=x)return!1;for(c=1,l=n.src.charCodeAt(++m);l===35&&m<x&&c<=6;)c++,l=n.src.charCodeAt(++m);return c>6?!1:(s||(x=n.skipCharsBack(x,32,m),f=n.skipCharsBack(x,35,m),f>m&&n.src.charCodeAt(f-1)===32&&(x=f),n.line=i+1,d=n.push("heading_open","h"+String(c),1),d.markup="########".slice(0,c),d.map=[i,n.line],d=n.push("inline","",0),d.content=n.src.slice(m,x).trim(),d.map=[i,n.line],d.children=[],d=n.push("heading_close","h"+String(c),-1),d.markup="########".slice(0,c)),!0)}e.block.ruler.at("heading",t,{alt:["paragraph","reference","blockquote"]})}),PS}var NS,N5;function R5(){return N5||(N5=1,NS=function(e){function t(i,o){var s,l,c,f,d,m=i.pos,x=i.src.charCodeAt(m);if(o||x!==61||(l=i.scanDelims(i.pos,!0),f=l.length,d=String.fromCharCode(x),f<2))return!1;for(f%2&&(c=i.push("text","",0),c.content=d,f--),s=0;s<f;s+=2)c=i.push("text","",0),c.content=d+d,!(!l.can_open&&!l.can_close)&&i.delimiters.push({marker:x,length:0,jump:s/2,token:i.tokens.length-1,end:-1,open:l.can_open,close:l.can_close});return i.pos+=l.length,!0}function n(i,o){var s,l,c,f,d,m=[],x=o.length;for(s=0;s<x;s++)c=o[s],c.marker===61&&c.end!==-1&&(f=o[c.end],d=i.tokens[c.token],d.type="mark_open",d.tag="mark",d.nesting=1,d.markup="==",d.content="",d=i.tokens[f.token],d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",i.tokens[f.token-1].type==="text"&&i.tokens[f.token-1].content==="="&&m.push(f.token-1));for(;m.length;){for(s=m.pop(),l=s+1;l<i.tokens.length&&i.tokens[l].type==="mark_close";)l++;l--,s!==l&&(d=i.tokens[l],i.tokens[l]=i.tokens[s],i.tokens[s]=d)}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(i){var o,s=i.tokens_meta,l=(i.tokens_meta||[]).length;for(n(i,i.delimiters),o=0;o<l;o++)s[o]&&s[o].delimiters&&n(i,s[o].delimiters)})}),NS}var B1={exports:{}};const Wp=Cb(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var W1={exports:{}},q1={exports:{}},D5;function qZ(){return D5||(D5=1,typeof Object.create=="function"?q1.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:q1.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),q1.exports}var z1={exports:{}},L5;function zZ(){if(L5)return z1.exports;L5=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(N,M,B){return Function.prototype.apply.call(N,M,B)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:t=function(N){return Object.getOwnPropertyNames(N)};function n(D){console&&console.warn&&console.warn(D)}var i=Number.isNaN||function(N){return N!==N};function o(){o.init.call(this)}z1.exports=o,z1.exports.once=A,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");s=D}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||i(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(D){return D._maxListeners===void 0?o.defaultMaxListeners:D._maxListeners}o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(N){for(var M=[],B=1;B<arguments.length;B++)M.push(arguments[B]);var Z=N==="error",ee=this._events;if(ee!==void 0)Z=Z&&ee.error===void 0;else if(!Z)return!1;if(Z){var ie;if(M.length>0&&(ie=M[0]),ie instanceof Error)throw ie;var z=new Error("Unhandled error."+(ie?" ("+ie.message+")":""));throw z.context=ie,z}var W=ee[N];if(W===void 0)return!1;if(typeof W=="function")e(W,this,M);else for(var ne=W.length,V=S(W,ne),B=0;B<ne;++B)e(V[B],this,M);return!0};function f(D,N,M,B){var Z,ee,ie;if(l(M),ee=D._events,ee===void 0?(ee=D._events=Object.create(null),D._eventsCount=0):(ee.newListener!==void 0&&(D.emit("newListener",N,M.listener?M.listener:M),ee=D._events),ie=ee[N]),ie===void 0)ie=ee[N]=M,++D._eventsCount;else if(typeof ie=="function"?ie=ee[N]=B?[M,ie]:[ie,M]:B?ie.unshift(M):ie.push(M),Z=c(D),Z>0&&ie.length>Z&&!ie.warned){ie.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=D,z.type=N,z.count=ie.length,n(z)}return D}o.prototype.addListener=function(N,M){return f(this,N,M,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(N,M){return f(this,N,M,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(D,N,M){var B={fired:!1,wrapFn:void 0,target:D,type:N,listener:M},Z=d.bind(B);return Z.listener=M,B.wrapFn=Z,Z}o.prototype.once=function(N,M){return l(M),this.on(N,m(this,N,M)),this},o.prototype.prependOnceListener=function(N,M){return l(M),this.prependListener(N,m(this,N,M)),this},o.prototype.removeListener=function(N,M){var B,Z,ee,ie,z;if(l(M),Z=this._events,Z===void 0)return this;if(B=Z[N],B===void 0)return this;if(B===M||B.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete Z[N],Z.removeListener&&this.emit("removeListener",N,B.listener||M));else if(typeof B!="function"){for(ee=-1,ie=B.length-1;ie>=0;ie--)if(B[ie]===M||B[ie].listener===M){z=B[ie].listener,ee=ie;break}if(ee<0)return this;ee===0?B.shift():_(B,ee),B.length===1&&(Z[N]=B[0]),Z.removeListener!==void 0&&this.emit("removeListener",N,z||M)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(N){var M,B,Z;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[N]),this;if(arguments.length===0){var ee=Object.keys(B),ie;for(Z=0;Z<ee.length;++Z)ie=ee[Z],ie!=="removeListener"&&this.removeAllListeners(ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(M=B[N],typeof M=="function")this.removeListener(N,M);else if(M!==void 0)for(Z=M.length-1;Z>=0;Z--)this.removeListener(N,M[Z]);return this};function x(D,N,M){var B=D._events;if(B===void 0)return[];var Z=B[N];return Z===void 0?[]:typeof Z=="function"?M?[Z.listener||Z]:[Z]:M?k(Z):S(Z,Z.length)}o.prototype.listeners=function(N){return x(this,N,!0)},o.prototype.rawListeners=function(N){return x(this,N,!1)},o.listenerCount=function(D,N){return typeof D.listenerCount=="function"?D.listenerCount(N):y.call(D,N)},o.prototype.listenerCount=y;function y(D){var N=this._events;if(N!==void 0){var M=N[D];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function S(D,N){for(var M=new Array(N),B=0;B<N;++B)M[B]=D[B];return M}function _(D,N){for(;N+1<D.length;N++)D[N]=D[N+1];D.pop()}function k(D){for(var N=new Array(D.length),M=0;M<N.length;++M)N[M]=D[M].listener||D[M];return N}function A(D,N){return new Promise(function(M,B){function Z(ie){D.removeListener(N,ee),B(ie)}function ee(){typeof D.removeListener=="function"&&D.removeListener("error",Z),M([].slice.call(arguments))}R(D,N,ee,{once:!0}),N!=="error"&&$(D,Z,{once:!0})})}function $(D,N,M){typeof D.on=="function"&&R(D,"error",N,M)}function R(D,N,M,B){if(typeof D.on=="function")B.once?D.once(N,M):D.on(N,M);else if(typeof D.addEventListener=="function")D.addEventListener(N,function Z(ee){B.once&&D.removeEventListener(N,Z),M(ee)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof D)}return z1.exports}var M5;function UZ(){if(M5)return W1.exports;M5=1;var r=qZ(),e=zZ().EventEmitter;W1.exports=t,W1.exports.default=t;function t(c){if(!(this instanceof t))return new t(c);e.call(this),c=c||{},this.concurrency=c.concurrency||1/0,this.timeout=c.timeout||0,this.autostart=c.autostart||!1,this.results=c.results||null,this.pending=0,this.session=0,this.running=!1,this.jobs=[],this.timers={}}r(t,e);var n=["pop","shift","indexOf","lastIndexOf"];n.forEach(function(c){t.prototype[c]=function(){return Array.prototype[c].apply(this.jobs,arguments)}}),t.prototype.slice=function(c,f){return this.jobs=this.jobs.slice(c,f),this},t.prototype.reverse=function(){return this.jobs.reverse(),this};var i=["push","unshift","splice"];i.forEach(function(c){t.prototype[c]=function(){var f=Array.prototype[c].apply(this.jobs,arguments);return this.autostart&&this.start(),f}}),Object.defineProperty(t.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),t.prototype.start=function(c){if(c&&s.call(this,c),this.running=!0,this.pending>=this.concurrency)return;if(this.jobs.length===0){this.pending===0&&l.call(this);return}var f=this,d=this.jobs.shift(),m=!0,x=this.session,y=null,S=!1,_=null,k=d.hasOwnProperty("timeout")?d.timeout:this.timeout;function A(R,D){m&&f.session===x&&(m=!1,f.pending--,y!==null&&(delete f.timers[y],clearTimeout(y)),R?f.emit("error",R,d):S===!1&&(_!==null&&(f.results[_]=Array.prototype.slice.call(arguments,1)),f.emit("success",D,d)),f.session===x&&(f.pending===0&&f.jobs.length===0?l.call(f):f.running&&f.start()))}k&&(y=setTimeout(function(){S=!0,f.listeners("timeout").length>0?f.emit("timeout",A,d):A()},k),this.timers[y]=y),this.results&&(_=this.results.length,this.results[_]=null),this.pending++,f.emit("start",d);var $=d(A);$&&$.then&&typeof $.then=="function"&&$.then(function(R){return A(null,R)}).catch(function(R){return A(R||!0)}),this.running&&this.jobs.length>0&&this.start()},t.prototype.stop=function(){this.running=!1},t.prototype.end=function(c){o.call(this),this.jobs.length=0,this.pending=0,l.call(this,c)};function o(){for(var c in this.timers){var f=this.timers[c];delete this.timers[c],clearTimeout(f)}}function s(c){var f=this;this.on("error",d),this.on("end",m);function d(x){f.end(x)}function m(x){f.removeListener("error",d),f.removeListener("end",m),c(x,this.results)}}function l(c){this.session++,this.running=!1,this.emit("end",c)}return W1.exports}var qp={},zp={},I5;function XZ(){return I5||(I5=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.BMP=void 0,zp.BMP={validate(r){return r.toString("ascii",0,2)==="BM"},calculate(r){return{height:Math.abs(r.readInt32LE(22)),width:r.readUInt32LE(18)}}}),zp}var Up={},Xp={},Q5;function F5(){if(Q5)return Xp;Q5=1,Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.ICO=void 0;const r=1,e=2+2+2,t=1+1+1+1+2+2+4+4;function n(o,s){const l=o.readUInt8(s);return l===0?256:l}function i(o,s){const l=e+s*t;return{height:n(o,l+1),width:n(o,l)}}return Xp.ICO={validate(o){const s=o.readUInt16LE(0),l=o.readUInt16LE(4);return s!==0||l===0?!1:o.readUInt16LE(2)===r},calculate(o){const s=o.readUInt16LE(4),l=i(o,0);if(s===1)return l;const c=[l];for(let d=1;d<s;d+=1)c.push(i(o,d));return{height:l.height,images:c,width:l.width}}},Xp}var B5;function ZZ(){if(B5)return Up;B5=1,Object.defineProperty(Up,"__esModule",{value:!0}),Up.CUR=void 0;const r=F5(),e=2;return Up.CUR={validate(t){const n=t.readUInt16LE(0),i=t.readUInt16LE(4);return n!==0||i===0?!1:t.readUInt16LE(2)===e},calculate(t){return r.ICO.calculate(t)}},Up}var Zp={},W5;function VZ(){return W5||(W5=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.DDS=void 0,Zp.DDS={validate(r){return r.readUInt32LE(0)===542327876},calculate(r){return{height:r.readUInt32LE(12),width:r.readUInt32LE(16)}}}),Zp}var Vp={},q5;function HZ(){if(q5)return Vp;q5=1,Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.GIF=void 0;const r=/^GIF8[79]a/;return Vp.GIF={validate(e){const t=e.toString("ascii",0,6);return r.test(t)},calculate(e){return{height:e.readUInt16LE(8),width:e.readUInt16LE(6)}}},Vp}var Hp={},z5;function jZ(){if(z5)return Hp;z5=1,Object.defineProperty(Hp,"__esModule",{value:!0}),Hp.ICNS=void 0;const r=4+4,e=4,t=4,n={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function i(s,l){const c=l+t;return[s.toString("ascii",l,c),s.readUInt32BE(c)]}function o(s){const l=n[s];return{width:l,height:l,type:s}}return Hp.ICNS={validate(s){return s.toString("ascii",0,4)==="icns"},calculate(s){const l=s.length,c=s.readUInt32BE(e);let f=r,d=i(s,f),m=o(d[0]);if(f+=d[1],f===c)return m;const x={height:m.height,images:[m],width:m.width};for(;f<c&&f<l;)d=i(s,f),m=o(d[0]),f+=d[1],x.images.push(m);return x}},Hp}var jp={},U5;function YZ(){return U5||(U5=1,Object.defineProperty(jp,"__esModule",{value:!0}),jp.J2C=void 0,jp.J2C={validate(r){return r.toString("hex",0,4)==="ff4fff51"},calculate(r){return{height:r.readUInt32BE(12),width:r.readUInt32BE(8)}}}),jp}var Yp={},X5;function GZ(){if(X5)return Yp;X5=1,Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.JP2=void 0;const r={ftyp:"66747970",ihdr:"69686472",jp2h:"6a703268",jp__:"6a502020",rreq:"72726571",xml_:"786d6c20"},e=n=>{const i=n.readUInt8(0);let o=1+2*i;const l=n.readUInt16BE(o)*(2+i);o=o+2+l;const f=n.readUInt16BE(o)*(16+i);return o+2+f},t=n=>({height:n.readUInt32BE(4),width:n.readUInt32BE(8)});return Yp.JP2={validate(n){const i=n.toString("hex",4,8),o=n.readUInt32BE(0);if(i!==r.jp__||o<1)return!1;const s=o+4,l=n.readUInt32BE(o);return n.slice(s,s+l).toString("hex",0,4)===r.ftyp},calculate(n){const i=n.readUInt32BE(0),o=n.readUInt16BE(i+2);let s=i+4+o;switch(n.toString("hex",s,s+4)){case r.rreq:return s=s+4+4+e(n.slice(s+4)),t(n.slice(s+8,s+24));case r.jp2h:return t(n.slice(s+8,s+24));default:throw new TypeError("Unsupported header found: "+n.toString("ascii",s,s+4))}}},Yp}var Gp={},Kp={},Z5;function V5(){if(Z5)return Kp;Z5=1,Object.defineProperty(Kp,"__esModule",{value:!0}),Kp.readUInt=void 0;function r(e,t,n,i){n=n||0;const o=i?"BE":"LE",s="readUInt"+t+o;return e[s].call(e,n)}return Kp.readUInt=r,Kp}var H5;function KZ(){if(H5)return Gp;H5=1,Object.defineProperty(Gp,"__esModule",{value:!0}),Gp.JPG=void 0;const r=V5(),e="45786966",t=2,n=6,i=2,o="4d4d",s="4949",l=12,c=2;function f(S){return S.toString("hex",2,6)===e}function d(S,_){return{height:S.readUInt16BE(_),width:S.readUInt16BE(_+2)}}function m(S,_){const A=n+8,$=(0,r.readUInt)(S,16,A,_);for(let R=0;R<$;R++){const D=A+c+R*l,N=D+l;if(D>S.length)return;const M=S.slice(D,N);if((0,r.readUInt)(M,16,0,_)===274)return(0,r.readUInt)(M,16,2,_)!==3||(0,r.readUInt)(M,32,4,_)!==1?void 0:(0,r.readUInt)(M,16,8,_)}}function x(S,_){const k=S.slice(t,_),A=k.toString("hex",n,n+i),$=A===o;if($||A===s)return m(k,$)}function y(S,_){if(_>S.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(S[_]!==255)throw new TypeError("Invalid JPG, marker table corrupted")}return Gp.JPG={validate(S){return S.toString("hex",0,2)==="ffd8"},calculate(S){S=S.slice(4);let _,k;for(;S.length;){const A=S.readUInt16BE(0);if(f(S)&&(_=x(S,A)),y(S,A),k=S[A+1],k===192||k===193||k===194){const $=d(S,A+5);return _?{height:$.height,orientation:_,width:$.width}:$}S=S.slice(A+2)}throw new TypeError("Invalid JPG, no size found")}},Gp}var Jp={},j5;function JZ(){if(j5)return Jp;j5=1,Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.KTX=void 0;const r="KTX 11";return Jp.KTX={validate(e){return r===e.toString("ascii",1,7)},calculate(e){return{height:e.readUInt32LE(40),width:e.readUInt32LE(36)}}},Jp}var eg={},Y5;function eV(){if(Y5)return eg;Y5=1,Object.defineProperty(eg,"__esModule",{value:!0}),eg.PNG=void 0;const r=`PNG\r
|
|
62
62
|
|
|
63
|
-
`,e="IHDR",t="CgBI";return eg.PNG={validate(n){if(r===n.toString("ascii",1,8)){let i=n.toString("ascii",12,16);if(i===t&&(i=n.toString("ascii",28,32)),i!==e)throw new TypeError("Invalid PNG");return!0}return!1},calculate(n){return n.toString("ascii",12,16)===t?{height:n.readUInt32BE(36),width:n.readUInt32BE(32)}:{height:n.readUInt32BE(20),width:n.readUInt32BE(16)}}},eg}var tg={},G5;function tV(){if(G5)return tg;G5=1,Object.defineProperty(tg,"__esModule",{value:!0}),tg.PNM=void 0;const r={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},e=Object.keys(r),t={default:n=>{let i=[];for(;n.length>0;){const o=n.shift();if(o[0]!=="#"){i=o.split(" ");break}}if(i.length===2)return{height:parseInt(i[1],10),width:parseInt(i[0],10)};throw new TypeError("Invalid PNM")},pam:n=>{const i={};for(;n.length>0;){const o=n.shift();if(o.length>16||o.charCodeAt(0)>128)continue;const[s,l]=o.split(" ");if(s&&l&&(i[s.toLowerCase()]=parseInt(l,10)),i.height&&i.width)break}if(i.height&&i.width)return{height:i.height,width:i.width};throw new TypeError("Invalid PAM")}};return tg.PNM={validate(n){const i=n.toString("ascii",0,2);return e.includes(i)},calculate(n){const i=n.toString("ascii",0,2),o=r[i],s=n.toString("ascii",3).split(/[\r\n]+/);return(t[o]||t.default)(s)}},tg}var rg={},K5;function rV(){return K5||(K5=1,Object.defineProperty(rg,"__esModule",{value:!0}),rg.PSD=void 0,rg.PSD={validate(r){return r.toString("ascii",0,4)==="8BPS"},calculate(r){return{height:r.readUInt32BE(14),width:r.readUInt32BE(18)}}}),rg}var ng={},J5;function nV(){if(J5)return ng;J5=1,Object.defineProperty(ng,"__esModule",{value:!0}),ng.SVG=void 0;const r=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/,e={height:/\sheight=(['"])([^%]+?)\1/,root:r,viewbox:/\sviewBox=(['"])(.+?)\1/i,width:/\swidth=(['"])([^%]+?)\1/},t=2.54,n={in:96,cm:96/t,em:16,ex:8,m:96/t*100,mm:96/t/10,pc:96/72/12,pt:96/72,px:1},i=new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(n).join("|")})?$`);function o(d){const m=i.exec(d);if(!!m)return Math.round(Number(m[1])*(n[m[2]]||1))}function s(d){const m=d.split(" ");return{height:o(m[3]),width:o(m[2])}}function l(d){const m=d.match(e.width),x=d.match(e.height),y=d.match(e.viewbox);return{height:x&&o(x[2]),viewbox:y&&s(y[2]),width:m&&o(m[2])}}function c(d){return{height:d.height,width:d.width}}function f(d,m){const x=m.width/m.height;return d.width?{height:Math.floor(d.width/x),width:d.width}:d.height?{height:d.height,width:Math.floor(d.height*x)}:{height:m.height,width:m.width}}return ng.SVG={validate(d){const m=String(d);return r.test(m)},calculate(d){const m=d.toString("utf8").match(e.root);if(m){const x=l(m[0]);if(x.width&&x.height)return c(x);if(x.viewbox)return f(x,x.viewbox)}throw new TypeError("Invalid SVG")}},ng}var ig={},eP;function iV(){return eP||(eP=1,Object.defineProperty(ig,"__esModule",{value:!0}),ig.TGA=void 0,ig.TGA={validate(r){return r.readUInt16LE(0)===0&&r.readUInt16LE(4)===0},calculate(r){return{height:r.readUInt16LE(14),width:r.readUInt16LE(12)}}}),ig}var og={},tP;function oV(){if(tP)return og;tP=1,Object.defineProperty(og,"__esModule",{value:!0}),og.TIFF=void 0;const r=Wp,e=V5();function t(c,f,d){const m=(0,e.readUInt)(c,32,4,d);let x=1024;const y=r.statSync(f).size;m+x>y&&(x=y-m-10);const S=Buffer.alloc(x),_=r.openSync(f,"r");return r.readSync(_,S,0,x,m),r.closeSync(_),S.slice(2)}function n(c,f){const d=(0,e.readUInt)(c,16,8,f);return((0,e.readUInt)(c,16,10,f)<<16)+d}function i(c){if(c.length>24)return c.slice(12)}function o(c,f){const d={};let m=c;for(;m&&m.length;){const x=(0,e.readUInt)(m,16,0,f),y=(0,e.readUInt)(m,16,2,f),S=(0,e.readUInt)(m,32,4,f);if(x===0)break;S===1&&(y===3||y===4)&&(d[x]=n(m,f)),m=i(m)}return d}function s(c){const f=c.toString("ascii",0,2);if(f==="II")return"LE";if(f==="MM")return"BE"}const l=["49492a00","4d4d002a"];return og.TIFF={validate(c){return l.includes(c.toString("hex",0,4))},calculate(c,f){if(!f)throw new TypeError("Tiff doesn't support buffer");const d=s(c)==="BE",m=t(c,f,d),x=o(m,d),y=x[256],S=x[257];if(!y||!S)throw new TypeError("Invalid Tiff. Missing tags");return{height:S,width:y}}},og}var sg={},rP;function sV(){if(rP)return sg;rP=1,Object.defineProperty(sg,"__esModule",{value:!0}),sg.WEBP=void 0;function r(n){return{height:1+n.readUIntLE(7,3),width:1+n.readUIntLE(4,3)}}function e(n){return{height:1+((n[4]&15)<<10|n[3]<<2|(n[2]&192)>>6),width:1+((n[2]&63)<<8|n[1])}}function t(n){return{height:n.readInt16LE(8)&16383,width:n.readInt16LE(6)&16383}}return sg.WEBP={validate(n){const i=n.toString("ascii",0,4)==="RIFF",o=n.toString("ascii",8,12)==="WEBP",s=n.toString("ascii",12,15)==="VP8";return i&&o&&s},calculate(n){const i=n.toString("ascii",12,16);if(n=n.slice(20,30),i==="VP8X"){const s=n[0],l=(s&192)===0,c=(s&1)===0;if(l&&c)return r(n);throw new TypeError("Invalid WebP")}if(i==="VP8 "&&n[0]!==47)return t(n);const o=n.toString("hex",3,6);if(i==="VP8L"&&o!=="9d012a")return e(n);throw new TypeError("Invalid WebP")}},sg}var nP;function iP(){if(nP)return qp;nP=1,Object.defineProperty(qp,"__esModule",{value:!0}),qp.typeHandlers=void 0;const r=XZ(),e=ZZ(),t=VZ(),n=HZ(),i=jZ(),o=F5(),s=YZ(),l=GZ(),c=KZ(),f=JZ(),d=eV(),m=tV(),x=rV(),y=nV(),S=iV(),_=oV(),k=sV();return qp.typeHandlers={bmp:r.BMP,cur:e.CUR,dds:t.DDS,gif:n.GIF,icns:i.ICNS,ico:o.ICO,j2c:s.J2C,jp2:l.JP2,jpg:c.JPG,ktx:f.KTX,png:d.PNG,pnm:m.PNM,psd:x.PSD,svg:y.SVG,tga:S.TGA,tiff:_.TIFF,webp:k.WEBP},qp}var lg={},oP;function lV(){if(oP)return lg;oP=1,Object.defineProperty(lg,"__esModule",{value:!0}),lg.detector=void 0;const r=iP(),e=Object.keys(r.typeHandlers),t={56:"psd",66:"bmp",68:"dds",71:"gif",73:"tiff",77:"tiff",82:"webp",105:"icns",137:"png",255:"jpg"};function n(i){const o=i[0];if(o in t){const l=t[o];if(l&&r.typeHandlers[l].validate(i))return l}const s=l=>r.typeHandlers[l].validate(i);return e.find(s)}return lg.detector=n,lg}var sP;function aV(){return sP||(sP=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0}),e.types=e.setConcurrency=e.disableTypes=e.disableFS=e.imageSize=void 0;const t=Wp,n=Wp,i=UZ(),o=iP(),s=lV(),l=512*1024,c=new i.default({concurrency:100,autostart:!0}),f={disabledFS:!1,disabledTypes:[]};function d(A,$){const R=(0,s.detector)(A);if(typeof R<"u"){if(f.disabledTypes.indexOf(R)>-1)throw new TypeError("disabled file type: "+R);if(R in o.typeHandlers){const D=o.typeHandlers[R].calculate(A,$);if(D!==void 0)return D.type=R,D}}throw new TypeError("unsupported file type: "+R+" (file: "+$+")")}async function m(A){const $=await t.promises.open(A,"r");try{const{size:R}=await $.stat();if(R<=0)throw new Error("Empty file");const D=Math.min(R,l),N=Buffer.alloc(D);return await $.read(N,0,D,0),N}finally{await $.close()}}function x(A){const $=t.openSync(A,"r");try{const{size:R}=t.fstatSync($);if(R<=0)throw new Error("Empty file");const D=Math.min(R,l),N=Buffer.alloc(D);return t.readSync($,N,0,D,0),N}finally{t.closeSync($)}}r.exports=e=y,e.default=y;function y(A,$){if(Buffer.isBuffer(A))return d(A);if(typeof A!="string"||f.disabledFS)throw new TypeError("invalid invocation. input should be a Buffer");const R=n.resolve(A);if(typeof $=="function")c.push(()=>m(R).then(D=>process.nextTick($,null,d(D,R))).catch($));else{const D=x(R);return d(D,R)}}e.imageSize=y;const S=A=>{f.disabledFS=A};e.disableFS=S;const _=A=>{f.disabledTypes=A};e.disableTypes=_;const k=A=>{c.concurrency=A};e.setConcurrency=k,e.types=Object.keys(o.typeHandlers)}(B1,B1.exports)),B1.exports}var RS,lP;function aP(){return lP||(lP=1,RS=function(e,t){var n=e.renderer.rules.image;e.renderer.rules.image=function(i,o,s,l,c){var f=i[o];if(f.attrSet("loading","lazy"),t&&t.decoding===!0&&f.attrSet("decoding","async"),t&&t.base_path&&t.image_size===!0){const d=aV(),m=Wp,x=f.attrGet("src"),y=m.join(t.base_path,x),S=d(y);f.attrSet("width",S.width),f.attrSet("height",S.height)}return n(i,o,s,l,c)}}),RS}var DS,cP;function uP(){if(cP)return DS;cP=1;var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function e(t,n){var i,o,s,l=t.posMax,c=t.pos;if(t.src.charCodeAt(c)!==126||n||c+2>=l)return!1;for(t.pos=c+1;t.pos<l;){if(t.src.charCodeAt(t.pos)===126){i=!0;break}t.md.inline.skipToken(t)}return!i||c+1===t.pos||(o=t.src.slice(c+1,t.pos),o.match(/(^|[^\\])(\\\\)*\s/))?(t.pos=c,!1):(t.posMax=t.pos,t.pos=c+1,s=t.push("sub_open","sub",1),s.markup="~",s=t.push("text","",0),s.content=o.replace(r,"$1"),s=t.push("sub_close","sub",-1),s.markup="~",t.pos=t.posMax+1,t.posMax=l,!0)}return DS=function(n){n.inline.ruler.after("emphasis","sub",e)},DS}var LS,fP;function hP(){if(fP)return LS;fP=1;var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function e(t,n){var i,o,s,l=t.posMax,c=t.pos;if(t.src.charCodeAt(c)!==94||n||c+2>=l)return!1;for(t.pos=c+1;t.pos<l;){if(t.src.charCodeAt(t.pos)===94){i=!0;break}t.md.inline.skipToken(t)}return!i||c+1===t.pos||(o=t.src.slice(c+1,t.pos),o.match(/(^|[^\\])(\\\\)*\s/))?(t.pos=c,!1):(t.posMax=t.pos,t.pos=c+1,s=t.push("sup_open","sup",1),s.markup="^",s=t.push("text","",0),s.content=o.replace(r,"$1"),s=t.push("sup_close","sup",-1),s.markup="^",t.pos=t.posMax+1,t.posMax=l,!0)}return LS=function(n){n.inline.ruler.after("emphasis","sup",e)},LS}const dP=g3.exports,pP=BU,{slugify:cV}=GA.exports,bh={},gP=function({ghostVersion:r}={}){const e=function(t,n={}){let i=cV(t,{ghostVersion:r,type:"markdown"});return n[i]&&(n[i]+=1,i+=n[i]),i};return function(t){const n=t.renderer.rules.heading_open;t.renderer.rules.heading_open=function(i,o,s,l,c){const f={};i[o].attrs=i[o].attrs||[];const d=i[o+1].children.reduce(function(x,y){return x+y.content},""),m=e(d,f);return i[o].attrs.push(["id",m]),n?n.apply(this,arguments):c.renderToken.apply(c,arguments)}}},uV=function(r){const e=pP.coerce(r.ghostVersion||"4.0");if(pP.satisfies(e,"<4.x")){if(bh["<4.x"])return bh["<4.x"];const t=new dP({html:!0,breaks:!0,linkify:!0}).use($5()).use(P5()).use(R5()).use(aP()).use(gP(r)).use(uP()).use(hP());return t.linkify.set({fuzzyLink:!1}),bh["<4.x"]=t,t}else{if(bh.latest)return bh.latest;const t=new dP({html:!0,breaks:!0,linkify:!0}).use($5()).use(P5()).use(R5()).use(aP()).use(gP(r)).use(uP()).use(hP());return t.linkify.set({fuzzyLink:!1}),bh.latest=t,t}};var fV={render:function(r,e={}){return uV(e).render(r)}};(function(r){r.exports=fV})(p3);const mP=bQ(p3.exports);class ag extends G.DecoratorNode{}function vP(r){const e={};if(r.src&&(e.src=r.src),r.width?e.width=r.width:r.dataset&&r.dataset.width&&(e.width=parseInt(r.dataset.width,10)),r.height?e.height=r.height:r.dataset&&r.dataset.height&&(e.height=parseInt(r.dataset.height,10)),!r.width&&!r.height&&r.getAttribute("data-image-dimensions")){const[,t,n]=/^(\d*)x(\d*)$/gi.exec(r.getAttribute("data-image-dimensions"));e.width=parseInt(t,10),e.height=parseInt(n,10)}if(r.alt&&(e.alt=r.alt),r.title&&(e.title=r.title),r.parentNode.tagName==="A"){const t=r.parentNode.href;t!==e.src&&(e.href=t)}return e}function hV(r,e,t){let{selector:n="figcaption",options:i}=t,o=Array.from(r.querySelectorAll(n));o.length&&o.forEach(s=>{let l=i!=null&&i.cleanBasicHtml?i.cleanBasicHtml(s.innerHTML):s.innerHTML;e.caption=e.caption?`${e.caption} / ${l}`:l,s.remove()})}class dV{constructor(e){this.NodeClass=e}get DOMConversionMap(){const e=this;return{img:()=>({conversion(t){if(t.tagName==="IMG"){const{src:n,width:i,height:o,alt:s,title:l}=vP(t);return{node:new e.NodeClass({altText:s,src:n,title:l,width:i,height:o})}}return null},priority:1}),figure:t=>t.querySelector("img")?{conversion(n){const i=n.querySelector("img"),o=n.className.match(/kg-width-(wide|full)/),s=n.className.match(/graf--layout(FillWidth|OutsetCenter)/);if(!i)return null;const l=vP(i);o?l.cardWidth=o[1]:s&&(l.cardWidth=s[1]==="FillWidth"?"full":"wide"),hV(n,l,{options:{cleanBasicHtml:$=>tB($,{createDocument:D=>{const N=n.ownerDocument.implementation.createHTMLDocument();return N.body.innerHTML=D,N}})}});const{src:f,width:d,height:m,alt:x,title:y,caption:S,cardWidth:_,href:k}=l;return{node:new e.NodeClass({altText:x,src:f,title:y,width:d,height:m,caption:S,cardWidth:_,href:k})}},priority:1}:null}}}const OP=function(r,e){const t=Object.values(e).map(i=>{let{width:o}=i;return o}).sort((i,o)=>i-o),n=t.filter(i=>i<=r.width);return r.width>n[n.length-1]&&r.width<t[t.length-1]&&n.push(r.width),n},U1=function(r){const t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"").replace(/\/$/,""),n=r.replace(t,"");return/^(\/.*|__GHOST_URL__)\/?content\/images\//.test(n)},pV=function(r){return/images\.unsplash\.com/.test(r)},gV=function(r){let{src:e,width:t,options:n}=r;if(!n.imageOptimization||n.imageOptimization.srcsets===!1||!t||!n.imageOptimization.contentImageSizes||U1(e,n.siteUrl)&&n.canTransformImage&&!n.canTransformImage(e))return;const i=OP({width:t},n.imageOptimization.contentImageSizes);if(U1(e,n.siteUrl)){const[,o,s]=e.match(/(.*\/content\/images)\/(.*)/),l=[];if(i.forEach(c=>{c===t?l.push(`${e} ${c}w`):c<=t&&l.push(`${o}/size/w${c}/${s} ${c}w`)}),l.length)return l.join(", ")}if(pV(e)){const o=new URL(e),s=[];return i.forEach(l=>{o.searchParams.set("w",l),s.push(`${o.href} ${l}w`)}),s.join(", ")}},mV=function(r,e,t){if(!r||!["IMG","SOURCE"].includes(r.tagName)||!r.getAttribute("src")||!e)return;const{src:n,width:i}=e,o=gV({src:n,width:i,options:t});o&&r.setAttribute("srcset",o)},xP=function(r){let{width:e,height:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{width:n,height:i}=r,o=n/i;if(e){const s=Math.round(e/o);return{width:e,height:s}}if(t)return{width:Math.round(t*o),height:t}};function vV(r){var c;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let f=typeof window<"u"&&window.document;if(!f)throw new Error("renderImageNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return f}}const t=e.createDocument();if(!r.getSrc()||r.getSrc().trim()==="")return t.createTextNode("");const n=t.createElement("figure");let i="kg-card kg-image-card";r.getCardWidth()!=="regular"&&(i+=` kg-width-${r.getCardWidth()}`),n.setAttribute("class",i);const o=t.createElement("img");o.setAttribute("src",r.getSrc()),o.setAttribute("alt",r.getAltText()),o.setAttribute("loading","lazy"),r.getTitle()&&o.setAttribute("title",r.getTitle()),r.getImgWidth()&&r.getImgHeight()&&(o.setAttribute("width",r.getImgWidth()),o.setAttribute("height",r.getImgHeight()));const{canTransformImage:s}=e,{defaultMaxWidth:l}=e.imageOptimization||{};if(l&&r.getImgWidth()>l&&U1(r.getSrc(),e.siteUrl)&&s&&s(r.getSrc())){const f={width:r.getImgWidth(),height:r.getImgHeight()},{width:d,height:m}=xP(f,{width:l});o.setAttribute("width",d),o.setAttribute("height",m)}if(e.target!=="email"){const f={src:r.getSrc(),width:r.getImgWidth(),height:r.getImgHeight()};mV(o,f,e),o.getAttribute("srcset")&&r.getImgWidth()&&r.getImgWidth()>=720&&((!r.getCardWidth()||r.getCardWidth()==="regular")&&o.setAttribute("sizes","(min-width: 720px) 720px"),r.getCardWidth()==="wide"&&r.getImgWidth()>=1200&&o.setAttribute("sizes","(min-width: 1200px) 1200px"))}if(e.target==="email"&&r.getImgWidth()&&r.getImgHeight()){let f={width:r.getImgWidth(),height:r.getImgHeight()};if(r.getImgWidth()>=600&&(f=xP(f,{width:600})),o.setAttribute("width",f.width),o.setAttribute("height",f.height),U1(r.getSrc(),e.siteUrl)&&((c=e.canTransformImage)==null?void 0:c.call(e,r.getSrc()))){const m=OP(r,e.imageOptimization.contentImageSizes).find(x=>x>=1200);if(!(!m||m===r.getImgWidth())){const[,x,y]=r.getSrc().match(/(.*\/content\/images)\/(.*)/);o.setAttribute("src",`${x}/size/w${m}/${y}`)}}}if(r.getHref()){const f=t.createElement("a");f.setAttribute("href",r.getHref()),f.appendChild(o),n.appendChild(f)}else n.appendChild(o);if(r.getCaption()){const f=t.createElement("figcaption");f.innerHTML=r.getCaption(),n.appendChild(f)}return n}const X1=G.createCommand();G.createCommand();class OV extends ag{constructor(){let{src:t,caption:n,title:i,altText:o,cardWidth:s,width:l,height:c,href:f}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=arguments.length>1?arguments[1]:void 0;super(d);Ve(this,"__src");Ve(this,"__caption");Ve(this,"__title");Ve(this,"__altText");Ve(this,"__cardWidth");Ve(this,"__width");Ve(this,"__height");Ve(this,"__href");this.__src=t||"",this.__title=i||"",this.__caption=n||"",this.__altText=o||"",this.__width=l||null,this.__height=c||null,this.__cardWidth=s||"regular",this.__href=f||""}static getType(){return"image"}static clone(t){return new this(t.getDataset(),t.__key)}static get urlTransformMap(){return{src:"url",href:"url",caption:"html"}}getDataset(){const t=this.getLatest();return{src:t.__src,caption:t.__caption,title:t.__title,altText:t.__altText,width:t.__width,height:t.__height,cardWidth:t.__cardWidth,href:t.__href}}static importJSON(t){const{src:n,caption:i,title:o,altText:s,width:l,height:c,cardWidth:f,href:d}=t;return new this({src:n,caption:i,title:o,altText:s,width:l,height:c,href:d,cardWidth:f})}exportJSON(){const n=this.getSrc().startsWith("data:");return{type:"image",version:1,src:n?"<base64String>":this.getSrc(),width:this.getImgWidth(),height:this.getImgHeight(),title:this.getTitle(),altText:this.getAltText(),caption:this.getCaption(),cardWidth:this.getCardWidth(),href:this.getHref()}}static importDOM(){return new dV(this).DOMConversionMap}exportDOM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{element:vV(this,t)}}createDOM(){return document.createElement("div")}updateDOM(){return!1}isInline(){return!1}getSrc(){return this.getLatest().__src}setSrc(t){const n=this.getWritable();return n.__src=t}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t}getHref(){return this.getLatest().__href}setHref(t){const n=this.getWritable();return n.__href=t}setCardWidth(t){const n=this.getWritable();return n.__cardWidth=t}getCardWidth(){return this.getLatest().__cardWidth}getImgWidth(){return this.getLatest().__width}setImgWidth(t){const n=this.getWritable();return n.__width=t}getImgHeight(){return this.getLatest().__height}setImgHeight(t){const n=this.getWritable();return n.__height=t}getCaption(){return this.getLatest().__caption}setCaption(t){const n=this.getWritable();return n.__caption=t}getAltText(){return this.getLatest().__altText}setAltText(t){const n=this.getWritable();return n.__altText=t}decorate(){return""}}class xV{constructor(e){this.NodeClass=e}get DOMConversionMap(){const e=this;return{figure:()=>({conversion(t){if(t.tagName==="FIGURE"){const n=t.querySelector("pre");if(!n)return null;let i=n.querySelector("code"),o=t.querySelector("figcaption");if(!i||!o)return null;let s={code:i.textContent},l=Array.from(t.querySelectorAll("figcaption"));l.length&&l.forEach(y=>{let S=y.innerHTML;s.caption=s.caption?`${s.caption} / ${S}`:S,y.remove()});let c=n.getAttribute("class")||"",f=i.getAttribute("class")||"",d=/lang(?:uage)?-(.*?)(?:\s|$)/i,m=c.match(d)||f.match(d);return m&&(s.language=m[1].toLowerCase()),{node:new e.NodeClass(s)}}return null},priority:1}),pre:()=>({conversion(t){if(t.tagName==="PRE"){let[n]=t.children;if(n&&n.tagName==="CODE"){let i={code:n.textContent},o=t.getAttribute("class")||"",s=n.getAttribute("class")||"",l=/lang(?:uage)?-(.*?)(?:\s|$)/i,c=o.match(l)||s.match(l);return c&&(i.language=c[1].toLowerCase()),{node:new e.NodeClass(i)}}}return null},priority:1})}}}function yV(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let o=typeof window<"u"&&window.document;if(!o)throw new Error("renderImageNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return o}}const t=e.createDocument();if(!r.getCode()||r.getCode().trim()==="")return t.createTextNode("");const n=t.createElement("pre"),i=t.createElement("code");if(r.getLanguage()&&i.setAttribute("class",`language-${r.getLanguage()}`),i.appendChild(t.createTextNode(r.getCode())),n.appendChild(i),r.getCaption()){let o=t.createElement("figure");o.setAttribute("class","kg-card kg-code-card"),o.appendChild(n);let s=t.createElement("figcaption");return s.appendChild(t.createTextNode(r.getCaption())),o.appendChild(s),o}else return n}G.createCommand();class bV extends ag{constructor(){let{code:t,language:n,caption:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;super(o);Ve(this,"__code");Ve(this,"__language");Ve(this,"__caption");this.__code=t,this.__language=n,this.__caption=i}static getType(){return"codeblock"}static clone(t){return new this(t.getDataset(),t.__key)}static get urlTransformMap(){return{caption:"html"}}getDataset(){const t=this.getLatest();return{code:t.__code,language:t.__language,caption:t.__caption}}static importJSON(t){const{code:n,language:i,caption:o}=t;return new this({code:n,language:i,caption:o})}exportJSON(){return{type:"codeblock",version:1,code:this.__code,language:this.__language,caption:this.__caption}}static importDOM(){return new xV(this).DOMConversionMap}exportDOM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{element:yV(this,t)}}createDOM(){return document.createElement("div")}updateDOM(){return!1}isInline(){return!1}getCaption(){return this.getLatest().__caption}setCaption(t){const n=this.getWritable();n.__caption=t}getCode(){return this.getLatest().__code}setCode(t){const n=this.getWritable();n.__code=t}getLanguage(){return this.getLatest().__language}setLanguage(t){const n=this.getWritable();n.__language=t}getTextContent(){return this.getLatest().__code}decorate(){return""}hasEditMode(){return!0}isEmpty(){return!this.__code}}function wV(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let o=typeof window<"u"&&window.document;if(!o)throw new Error("renderMarkdownNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return o}}const t=e.createDocument(),n=mP.render(r.getMarkdown()||"",e),i=t.createElement("div");return i.innerHTML=n,i}const yP=G.createCommand();class SV extends ag{constructor(){let{markdown:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;super(n);Ve(this,"__markdown");this.__markdown=t}static getType(){return"markdown"}static clone(t){return new this(t.getDataset(),t.__key)}static get urlTransformMap(){return{markdown:"markdown"}}getDataset(){return{markdown:this.getLatest().__markdown}}static importJSON(t){const{markdown:n}=t;return new this({markdown:n})}exportJSON(){return{type:"markdown",version:1,markdown:this.getMarkdown()}}exportDOM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{element:wV(this,t),type:"inner"}}createDOM(){return document.createElement("div")}updateDOM(){return!1}isInline(){return!1}getMarkdown(){return this.__markdown}setMarkdown(t){const n=this.getWritable();return n.__markdown=t}decorate(){return""}hasEditMode(){return!0}isEmpty(){return!this.__markdown}}class kV{constructor(e){this.NodeClass=e}get DOMConversionMap(){const e=this;return{figure:()=>({conversion(t){var i;const n=(i=t.classList)==null?void 0:i.contains("kg-video-card");if(t.tagName==="FIGURE"&&n){const o=t.querySelector(".kg-video-container video"),s=t.querySelector(".kg-video-duration"),l=o&&o.src,c=o&&o.width,f=o&&o.height,d=s&&s.innerHTML.trim(),m=t.querySelector("figcaption"),x=m&&m.innerHTML.trim();if(!l)return null;const y={src:l,loop:!!o.loop,cardWidth:CV(o)};if(d){const[_,k]=d.split(":");try{y.duration=parseInt(_)*60+parseInt(k)}catch{}}return t.dataset.kgThumbnail&&(y.thumbnailSrc=t.dataset.kgThumbnail),t.dataset.kgCustomThumbnail&&(y.customThumbnailSrc=t.dataset.kgCustomThumbnail),x&&(y.caption=x),c&&(y.width=c),f&&(y.height=f),{node:new e.NodeClass(y)}}return null},priority:1})}}}function CV(r){return r.classList.contains("kg-width-full")?"full":r.classList.contains("kg-width-wide")?"wide":"regular"}function _V(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let l=typeof window<"u"&&window.document;if(!l)throw new Error("renderVideoNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return l}}const t=e.createDocument();if(!r.getSrc()||r.getSrc().trim()==="")return t.createTextNode("");const n=$V(r).join(" "),i=e.target==="email"?TV({node:r,options:e,cardClasses:n}):EV({node:r,cardClasses:n}),o=t.createElement("div");o.innerHTML=i.trim();const s=o.firstElementChild;return t.body.replaceChildren(s),s}function EV(r){let{node:e,cardClasses:t}=r;const n=e.getVideoWidth(),i=e.getVideoHeight(),o=`https://img.spacergif.org/v1/${n}x${i}/0a/spacer.png`,s=e.getLoop()?"loop autoplay muted":"",l=e.getCustomThumbnailSrc()||e.getThumbnailSrc(),c=e.getLoop()?" kg-video-hide":"";return`
|
|
63
|
+
`,e="IHDR",t="CgBI";return eg.PNG={validate(n){if(r===n.toString("ascii",1,8)){let i=n.toString("ascii",12,16);if(i===t&&(i=n.toString("ascii",28,32)),i!==e)throw new TypeError("Invalid PNG");return!0}return!1},calculate(n){return n.toString("ascii",12,16)===t?{height:n.readUInt32BE(36),width:n.readUInt32BE(32)}:{height:n.readUInt32BE(20),width:n.readUInt32BE(16)}}},eg}var tg={},G5;function tV(){if(G5)return tg;G5=1,Object.defineProperty(tg,"__esModule",{value:!0}),tg.PNM=void 0;const r={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},e=Object.keys(r),t={default:n=>{let i=[];for(;n.length>0;){const o=n.shift();if(o[0]!=="#"){i=o.split(" ");break}}if(i.length===2)return{height:parseInt(i[1],10),width:parseInt(i[0],10)};throw new TypeError("Invalid PNM")},pam:n=>{const i={};for(;n.length>0;){const o=n.shift();if(o.length>16||o.charCodeAt(0)>128)continue;const[s,l]=o.split(" ");if(s&&l&&(i[s.toLowerCase()]=parseInt(l,10)),i.height&&i.width)break}if(i.height&&i.width)return{height:i.height,width:i.width};throw new TypeError("Invalid PAM")}};return tg.PNM={validate(n){const i=n.toString("ascii",0,2);return e.includes(i)},calculate(n){const i=n.toString("ascii",0,2),o=r[i],s=n.toString("ascii",3).split(/[\r\n]+/);return(t[o]||t.default)(s)}},tg}var rg={},K5;function rV(){return K5||(K5=1,Object.defineProperty(rg,"__esModule",{value:!0}),rg.PSD=void 0,rg.PSD={validate(r){return r.toString("ascii",0,4)==="8BPS"},calculate(r){return{height:r.readUInt32BE(14),width:r.readUInt32BE(18)}}}),rg}var ng={},J5;function nV(){if(J5)return ng;J5=1,Object.defineProperty(ng,"__esModule",{value:!0}),ng.SVG=void 0;const r=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/,e={height:/\sheight=(['"])([^%]+?)\1/,root:r,viewbox:/\sviewBox=(['"])(.+?)\1/i,width:/\swidth=(['"])([^%]+?)\1/},t=2.54,n={in:96,cm:96/t,em:16,ex:8,m:96/t*100,mm:96/t/10,pc:96/72/12,pt:96/72,px:1},i=new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(n).join("|")})?$`);function o(d){const m=i.exec(d);if(!!m)return Math.round(Number(m[1])*(n[m[2]]||1))}function s(d){const m=d.split(" ");return{height:o(m[3]),width:o(m[2])}}function l(d){const m=d.match(e.width),x=d.match(e.height),y=d.match(e.viewbox);return{height:x&&o(x[2]),viewbox:y&&s(y[2]),width:m&&o(m[2])}}function c(d){return{height:d.height,width:d.width}}function f(d,m){const x=m.width/m.height;return d.width?{height:Math.floor(d.width/x),width:d.width}:d.height?{height:d.height,width:Math.floor(d.height*x)}:{height:m.height,width:m.width}}return ng.SVG={validate(d){const m=String(d);return r.test(m)},calculate(d){const m=d.toString("utf8").match(e.root);if(m){const x=l(m[0]);if(x.width&&x.height)return c(x);if(x.viewbox)return f(x,x.viewbox)}throw new TypeError("Invalid SVG")}},ng}var ig={},eP;function iV(){return eP||(eP=1,Object.defineProperty(ig,"__esModule",{value:!0}),ig.TGA=void 0,ig.TGA={validate(r){return r.readUInt16LE(0)===0&&r.readUInt16LE(4)===0},calculate(r){return{height:r.readUInt16LE(14),width:r.readUInt16LE(12)}}}),ig}var og={},tP;function oV(){if(tP)return og;tP=1,Object.defineProperty(og,"__esModule",{value:!0}),og.TIFF=void 0;const r=Wp,e=V5();function t(c,f,d){const m=(0,e.readUInt)(c,32,4,d);let x=1024;const y=r.statSync(f).size;m+x>y&&(x=y-m-10);const S=Buffer.alloc(x),_=r.openSync(f,"r");return r.readSync(_,S,0,x,m),r.closeSync(_),S.slice(2)}function n(c,f){const d=(0,e.readUInt)(c,16,8,f);return((0,e.readUInt)(c,16,10,f)<<16)+d}function i(c){if(c.length>24)return c.slice(12)}function o(c,f){const d={};let m=c;for(;m&&m.length;){const x=(0,e.readUInt)(m,16,0,f),y=(0,e.readUInt)(m,16,2,f),S=(0,e.readUInt)(m,32,4,f);if(x===0)break;S===1&&(y===3||y===4)&&(d[x]=n(m,f)),m=i(m)}return d}function s(c){const f=c.toString("ascii",0,2);if(f==="II")return"LE";if(f==="MM")return"BE"}const l=["49492a00","4d4d002a"];return og.TIFF={validate(c){return l.includes(c.toString("hex",0,4))},calculate(c,f){if(!f)throw new TypeError("Tiff doesn't support buffer");const d=s(c)==="BE",m=t(c,f,d),x=o(m,d),y=x[256],S=x[257];if(!y||!S)throw new TypeError("Invalid Tiff. Missing tags");return{height:S,width:y}}},og}var sg={},rP;function sV(){if(rP)return sg;rP=1,Object.defineProperty(sg,"__esModule",{value:!0}),sg.WEBP=void 0;function r(n){return{height:1+n.readUIntLE(7,3),width:1+n.readUIntLE(4,3)}}function e(n){return{height:1+((n[4]&15)<<10|n[3]<<2|(n[2]&192)>>6),width:1+((n[2]&63)<<8|n[1])}}function t(n){return{height:n.readInt16LE(8)&16383,width:n.readInt16LE(6)&16383}}return sg.WEBP={validate(n){const i=n.toString("ascii",0,4)==="RIFF",o=n.toString("ascii",8,12)==="WEBP",s=n.toString("ascii",12,15)==="VP8";return i&&o&&s},calculate(n){const i=n.toString("ascii",12,16);if(n=n.slice(20,30),i==="VP8X"){const s=n[0],l=(s&192)===0,c=(s&1)===0;if(l&&c)return r(n);throw new TypeError("Invalid WebP")}if(i==="VP8 "&&n[0]!==47)return t(n);const o=n.toString("hex",3,6);if(i==="VP8L"&&o!=="9d012a")return e(n);throw new TypeError("Invalid WebP")}},sg}var nP;function iP(){if(nP)return qp;nP=1,Object.defineProperty(qp,"__esModule",{value:!0}),qp.typeHandlers=void 0;const r=XZ(),e=ZZ(),t=VZ(),n=HZ(),i=jZ(),o=F5(),s=YZ(),l=GZ(),c=KZ(),f=JZ(),d=eV(),m=tV(),x=rV(),y=nV(),S=iV(),_=oV(),k=sV();return qp.typeHandlers={bmp:r.BMP,cur:e.CUR,dds:t.DDS,gif:n.GIF,icns:i.ICNS,ico:o.ICO,j2c:s.J2C,jp2:l.JP2,jpg:c.JPG,ktx:f.KTX,png:d.PNG,pnm:m.PNM,psd:x.PSD,svg:y.SVG,tga:S.TGA,tiff:_.TIFF,webp:k.WEBP},qp}var lg={},oP;function lV(){if(oP)return lg;oP=1,Object.defineProperty(lg,"__esModule",{value:!0}),lg.detector=void 0;const r=iP(),e=Object.keys(r.typeHandlers),t={56:"psd",66:"bmp",68:"dds",71:"gif",73:"tiff",77:"tiff",82:"webp",105:"icns",137:"png",255:"jpg"};function n(i){const o=i[0];if(o in t){const l=t[o];if(l&&r.typeHandlers[l].validate(i))return l}const s=l=>r.typeHandlers[l].validate(i);return e.find(s)}return lg.detector=n,lg}var sP;function aV(){return sP||(sP=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0}),e.types=e.setConcurrency=e.disableTypes=e.disableFS=e.imageSize=void 0;const t=Wp,n=Wp,i=UZ(),o=iP(),s=lV(),l=512*1024,c=new i.default({concurrency:100,autostart:!0}),f={disabledFS:!1,disabledTypes:[]};function d(A,$){const R=(0,s.detector)(A);if(typeof R<"u"){if(f.disabledTypes.indexOf(R)>-1)throw new TypeError("disabled file type: "+R);if(R in o.typeHandlers){const D=o.typeHandlers[R].calculate(A,$);if(D!==void 0)return D.type=R,D}}throw new TypeError("unsupported file type: "+R+" (file: "+$+")")}async function m(A){const $=await t.promises.open(A,"r");try{const{size:R}=await $.stat();if(R<=0)throw new Error("Empty file");const D=Math.min(R,l),N=Buffer.alloc(D);return await $.read(N,0,D,0),N}finally{await $.close()}}function x(A){const $=t.openSync(A,"r");try{const{size:R}=t.fstatSync($);if(R<=0)throw new Error("Empty file");const D=Math.min(R,l),N=Buffer.alloc(D);return t.readSync($,N,0,D,0),N}finally{t.closeSync($)}}r.exports=e=y,e.default=y;function y(A,$){if(Buffer.isBuffer(A))return d(A);if(typeof A!="string"||f.disabledFS)throw new TypeError("invalid invocation. input should be a Buffer");const R=n.resolve(A);if(typeof $=="function")c.push(()=>m(R).then(D=>process.nextTick($,null,d(D,R))).catch($));else{const D=x(R);return d(D,R)}}e.imageSize=y;const S=A=>{f.disabledFS=A};e.disableFS=S;const _=A=>{f.disabledTypes=A};e.disableTypes=_;const k=A=>{c.concurrency=A};e.setConcurrency=k,e.types=Object.keys(o.typeHandlers)}(B1,B1.exports)),B1.exports}var RS,lP;function aP(){return lP||(lP=1,RS=function(e,t){var n=e.renderer.rules.image;e.renderer.rules.image=function(i,o,s,l,c){var f=i[o];if(f.attrSet("loading","lazy"),t&&t.decoding===!0&&f.attrSet("decoding","async"),t&&t.base_path&&t.image_size===!0){const d=aV(),m=Wp,x=f.attrGet("src"),y=m.join(t.base_path,x),S=d(y);f.attrSet("width",S.width),f.attrSet("height",S.height)}return n(i,o,s,l,c)}}),RS}var DS,cP;function uP(){if(cP)return DS;cP=1;var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function e(t,n){var i,o,s,l=t.posMax,c=t.pos;if(t.src.charCodeAt(c)!==126||n||c+2>=l)return!1;for(t.pos=c+1;t.pos<l;){if(t.src.charCodeAt(t.pos)===126){i=!0;break}t.md.inline.skipToken(t)}return!i||c+1===t.pos||(o=t.src.slice(c+1,t.pos),o.match(/(^|[^\\])(\\\\)*\s/))?(t.pos=c,!1):(t.posMax=t.pos,t.pos=c+1,s=t.push("sub_open","sub",1),s.markup="~",s=t.push("text","",0),s.content=o.replace(r,"$1"),s=t.push("sub_close","sub",-1),s.markup="~",t.pos=t.posMax+1,t.posMax=l,!0)}return DS=function(n){n.inline.ruler.after("emphasis","sub",e)},DS}var LS,fP;function hP(){if(fP)return LS;fP=1;var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function e(t,n){var i,o,s,l=t.posMax,c=t.pos;if(t.src.charCodeAt(c)!==94||n||c+2>=l)return!1;for(t.pos=c+1;t.pos<l;){if(t.src.charCodeAt(t.pos)===94){i=!0;break}t.md.inline.skipToken(t)}return!i||c+1===t.pos||(o=t.src.slice(c+1,t.pos),o.match(/(^|[^\\])(\\\\)*\s/))?(t.pos=c,!1):(t.posMax=t.pos,t.pos=c+1,s=t.push("sup_open","sup",1),s.markup="^",s=t.push("text","",0),s.content=o.replace(r,"$1"),s=t.push("sup_close","sup",-1),s.markup="^",t.pos=t.posMax+1,t.posMax=l,!0)}return LS=function(n){n.inline.ruler.after("emphasis","sup",e)},LS}const dP=g3.exports,pP=BU,{slugify:cV}=GA.exports,bh={},gP=function({ghostVersion:r}={}){const e=function(t,n={}){let i=cV(t,{ghostVersion:r,type:"markdown"});return n[i]&&(n[i]+=1,i+=n[i]),i};return function(t){const n=t.renderer.rules.heading_open;t.renderer.rules.heading_open=function(i,o,s,l,c){const f={};i[o].attrs=i[o].attrs||[];const d=i[o+1].children.reduce(function(x,y){return x+y.content},""),m=e(d,f);return i[o].attrs.push(["id",m]),n?n.apply(this,arguments):c.renderToken.apply(c,arguments)}}},uV=function(r){const e=pP.coerce(r.ghostVersion||"4.0");if(pP.satisfies(e,"<4.x")){if(bh["<4.x"])return bh["<4.x"];const t=new dP({html:!0,breaks:!0,linkify:!0}).use($5()).use(P5()).use(R5()).use(aP()).use(gP(r)).use(uP()).use(hP());return t.linkify.set({fuzzyLink:!1}),bh["<4.x"]=t,t}else{if(bh.latest)return bh.latest;const t=new dP({html:!0,breaks:!0,linkify:!0}).use($5()).use(P5()).use(R5()).use(aP()).use(gP(r)).use(uP()).use(hP());return t.linkify.set({fuzzyLink:!1}),bh.latest=t,t}};var fV={render:function(r,e={}){return uV(e).render(r)}};(function(r){r.exports=fV})(p3);const mP=bQ(p3.exports);class ag extends G.DecoratorNode{}function vP(r){const e={};if(r.src&&(e.src=r.src),r.width?e.width=r.width:r.dataset&&r.dataset.width&&(e.width=parseInt(r.dataset.width,10)),r.height?e.height=r.height:r.dataset&&r.dataset.height&&(e.height=parseInt(r.dataset.height,10)),!r.width&&!r.height&&r.getAttribute("data-image-dimensions")){const[,t,n]=/^(\d*)x(\d*)$/gi.exec(r.getAttribute("data-image-dimensions"));e.width=parseInt(t,10),e.height=parseInt(n,10)}if(r.alt&&(e.alt=r.alt),r.title&&(e.title=r.title),r.parentNode.tagName==="A"){const t=r.parentNode.href;t!==e.src&&(e.href=t)}return e}function hV(r,e,t){let{selector:n="figcaption",options:i}=t,o=Array.from(r.querySelectorAll(n));o.length&&o.forEach(s=>{let l=i!=null&&i.cleanBasicHtml?i.cleanBasicHtml(s.innerHTML):s.innerHTML;e.caption=e.caption?`${e.caption} / ${l}`:l,s.remove()})}class dV{constructor(e){this.NodeClass=e}get DOMConversionMap(){const e=this;return{img:()=>({conversion(t){if(t.tagName==="IMG"){const{src:n,width:i,height:o,alt:s,title:l}=vP(t);return{node:new e.NodeClass({altText:s,src:n,title:l,width:i,height:o})}}return null},priority:1}),figure:t=>t.querySelector("img")?{conversion(n){const i=n.querySelector("img"),o=n.className.match(/kg-width-(wide|full)/),s=n.className.match(/graf--layout(FillWidth|OutsetCenter)/);if(!i)return null;const l=vP(i);o?l.cardWidth=o[1]:s&&(l.cardWidth=s[1]==="FillWidth"?"full":"wide"),hV(n,l,{options:{cleanBasicHtml:$=>tB($,{createDocument:D=>{const N=n.ownerDocument.implementation.createHTMLDocument();return N.body.innerHTML=D,N}})}});const{src:f,width:d,height:m,alt:x,title:y,caption:S,cardWidth:_,href:k}=l;return{node:new e.NodeClass({altText:x,src:f,title:y,width:d,height:m,caption:S,cardWidth:_,href:k})}},priority:1}:null}}}const OP=function(r,e){const t=Object.values(e).map(i=>{let{width:o}=i;return o}).sort((i,o)=>i-o),n=t.filter(i=>i<=r.width);return r.width>n[n.length-1]&&r.width<t[t.length-1]&&n.push(r.width),n},U1=function(r){const t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"").replace(/\/$/,""),n=r.replace(t,"");return/^(\/.*|__GHOST_URL__)\/?content\/images\//.test(n)},pV=function(r){return/images\.unsplash\.com/.test(r)},gV=function(r){let{src:e,width:t,options:n}=r;if(!n.imageOptimization||n.imageOptimization.srcsets===!1||!t||!n.imageOptimization.contentImageSizes||U1(e,n.siteUrl)&&n.canTransformImage&&!n.canTransformImage(e))return;const i=OP({width:t},n.imageOptimization.contentImageSizes);if(U1(e,n.siteUrl)){const[,o,s]=e.match(/(.*\/content\/images)\/(.*)/),l=[];if(i.forEach(c=>{c===t?l.push(`${e} ${c}w`):c<=t&&l.push(`${o}/size/w${c}/${s} ${c}w`)}),l.length)return l.join(", ")}if(pV(e)){const o=new URL(e),s=[];return i.forEach(l=>{o.searchParams.set("w",l),s.push(`${o.href} ${l}w`)}),s.join(", ")}},mV=function(r,e,t){if(!r||!["IMG","SOURCE"].includes(r.tagName)||!r.getAttribute("src")||!e)return;const{src:n,width:i}=e,o=gV({src:n,width:i,options:t});o&&r.setAttribute("srcset",o)},xP=function(r){let{width:e,height:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{width:n,height:i}=r,o=n/i;if(e){const s=Math.round(e/o);return{width:e,height:s}}if(t)return{width:Math.round(t*o),height:t}};function vV(r){var c;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let f=typeof window<"u"&&window.document;if(!f)throw new Error("renderImageNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return f}}const t=e.createDocument();if(!r.getSrc()||r.getSrc().trim()==="")return t.createTextNode("");const n=t.createElement("figure");let i="kg-card kg-image-card";r.getCardWidth()!=="regular"&&(i+=` kg-width-${r.getCardWidth()}`),n.setAttribute("class",i);const o=t.createElement("img");o.setAttribute("src",r.getSrc()),o.setAttribute("alt",r.getAltText()),o.setAttribute("loading","lazy"),r.getTitle()&&o.setAttribute("title",r.getTitle()),r.getImgWidth()&&r.getImgHeight()&&(o.setAttribute("width",r.getImgWidth()),o.setAttribute("height",r.getImgHeight()));const{canTransformImage:s}=e,{defaultMaxWidth:l}=e.imageOptimization||{};if(l&&r.getImgWidth()>l&&U1(r.getSrc(),e.siteUrl)&&s&&s(r.getSrc())){const f={width:r.getImgWidth(),height:r.getImgHeight()},{width:d,height:m}=xP(f,{width:l});o.setAttribute("width",d),o.setAttribute("height",m)}if(e.target!=="email"){const f={src:r.getSrc(),width:r.getImgWidth(),height:r.getImgHeight()};mV(o,f,e),o.getAttribute("srcset")&&r.getImgWidth()&&r.getImgWidth()>=720&&((!r.getCardWidth()||r.getCardWidth()==="regular")&&o.setAttribute("sizes","(min-width: 720px) 720px"),r.getCardWidth()==="wide"&&r.getImgWidth()>=1200&&o.setAttribute("sizes","(min-width: 1200px) 1200px"))}if(e.target==="email"&&r.getImgWidth()&&r.getImgHeight()){let f={width:r.getImgWidth(),height:r.getImgHeight()};if(r.getImgWidth()>=600&&(f=xP(f,{width:600})),o.setAttribute("width",f.width),o.setAttribute("height",f.height),U1(r.getSrc(),e.siteUrl)&&((c=e.canTransformImage)==null?void 0:c.call(e,r.getSrc()))){const m=OP(r,e.imageOptimization.contentImageSizes).find(x=>x>=1200);if(!(!m||m===r.getImgWidth())){const[,x,y]=r.getSrc().match(/(.*\/content\/images)\/(.*)/);o.setAttribute("src",`${x}/size/w${m}/${y}`)}}}if(r.getHref()){const f=t.createElement("a");f.setAttribute("href",r.getHref()),f.appendChild(o),n.appendChild(f)}else n.appendChild(o);if(r.getCaption()){const f=t.createElement("figcaption");f.innerHTML=r.getCaption(),n.appendChild(f)}return n}const X1=G.createCommand();G.createCommand();class OV extends ag{constructor(){let{src:t,caption:n,title:i,altText:o,cardWidth:s,width:l,height:c,href:f}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=arguments.length>1?arguments[1]:void 0;super(d);Ve(this,"__src");Ve(this,"__caption");Ve(this,"__title");Ve(this,"__altText");Ve(this,"__cardWidth");Ve(this,"__width");Ve(this,"__height");Ve(this,"__href");this.__src=t||"",this.__title=i||"",this.__caption=n||"",this.__altText=o||"",this.__width=l||null,this.__height=c||null,this.__cardWidth=s||"regular",this.__href=f||""}static getType(){return"image"}static clone(t){return new this(t.getDataset(),t.__key)}static get urlTransformMap(){return{src:"url",href:"url",caption:"html"}}getDataset(){const t=this.getLatest();return{src:t.__src,caption:t.__caption,title:t.__title,altText:t.__altText,width:t.__width,height:t.__height,cardWidth:t.__cardWidth,href:t.__href}}static importJSON(t){const{src:n,caption:i,title:o,altText:s,width:l,height:c,cardWidth:f,href:d}=t;return new this({src:n,caption:i,title:o,altText:s,width:l,height:c,href:d,cardWidth:f})}exportJSON(){const n=this.getSrc().startsWith("data:");return{type:"image",version:1,src:n?"<base64String>":this.getSrc(),width:this.getImgWidth(),height:this.getImgHeight(),title:this.getTitle(),altText:this.getAltText(),caption:this.getCaption(),cardWidth:this.getCardWidth(),href:this.getHref()}}static importDOM(){return new dV(this).DOMConversionMap}exportDOM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{element:vV(this,t)}}createDOM(){return document.createElement("div")}updateDOM(){return!1}isInline(){return!1}getSrc(){return this.getLatest().__src}setSrc(t){const n=this.getWritable();return n.__src=t}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t}getHref(){return this.getLatest().__href}setHref(t){const n=this.getWritable();return n.__href=t}setCardWidth(t){const n=this.getWritable();return n.__cardWidth=t}getCardWidth(){return this.getLatest().__cardWidth}getImgWidth(){return this.getLatest().__width}setImgWidth(t){const n=this.getWritable();return n.__width=t}getImgHeight(){return this.getLatest().__height}setImgHeight(t){const n=this.getWritable();return n.__height=t}getCaption(){return this.getLatest().__caption}setCaption(t){const n=this.getWritable();return n.__caption=t}getAltText(){return this.getLatest().__altText}setAltText(t){const n=this.getWritable();return n.__altText=t}decorate(){return""}}class xV{constructor(e){this.NodeClass=e}get DOMConversionMap(){const e=this;return{figure:()=>({conversion(t){if(t.tagName==="FIGURE"){const n=t.querySelector("pre");if(!n)return null;let i=n.querySelector("code"),o=t.querySelector("figcaption");if(!i||!o)return null;let s={code:i.textContent},l=Array.from(t.querySelectorAll("figcaption"));l.length&&l.forEach(y=>{let S=y.innerHTML;s.caption=s.caption?`${s.caption} / ${S}`:S,y.remove()});let c=n.getAttribute("class")||"",f=i.getAttribute("class")||"",d=/lang(?:uage)?-(.*?)(?:\s|$)/i,m=c.match(d)||f.match(d);return m&&(s.language=m[1].toLowerCase()),{node:new e.NodeClass(s)}}return null},priority:1}),pre:()=>({conversion(t){if(t.tagName==="PRE"){let[n]=t.children;if(n&&n.tagName==="CODE"){let i={code:n.textContent},o=t.getAttribute("class")||"",s=n.getAttribute("class")||"",l=/lang(?:uage)?-(.*?)(?:\s|$)/i,c=o.match(l)||s.match(l);return c&&(i.language=c[1].toLowerCase()),{node:new e.NodeClass(i)}}}return null},priority:1})}}}function yV(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let o=typeof window<"u"&&window.document;if(!o)throw new Error("renderImageNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return o}}const t=e.createDocument();if(!r.getCode()||r.getCode().trim()==="")return t.createTextNode("");const n=t.createElement("pre"),i=t.createElement("code");if(r.getLanguage()&&i.setAttribute("class",`language-${r.getLanguage()}`),i.appendChild(t.createTextNode(r.getCode())),n.appendChild(i),r.getCaption()){let o=t.createElement("figure");o.setAttribute("class","kg-card kg-code-card"),o.appendChild(n);let s=t.createElement("figcaption");return s.appendChild(t.createTextNode(r.getCaption())),o.appendChild(s),o}else return n}G.createCommand();class bV extends ag{constructor(){let{code:t,language:n,caption:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;super(o);Ve(this,"__code");Ve(this,"__language");Ve(this,"__caption");this.__code=t,this.__language=n,this.__caption=i}static getType(){return"codeblock"}static clone(t){return new this(t.getDataset(),t.__key)}static get urlTransformMap(){return{caption:"html"}}getDataset(){const t=this.getLatest();return{code:t.__code,language:t.__language,caption:t.__caption}}static importJSON(t){const{code:n,language:i,caption:o}=t;return new this({code:n,language:i,caption:o})}exportJSON(){return{type:"codeblock",version:1,code:this.__code,language:this.__language,caption:this.__caption}}static importDOM(){return new xV(this).DOMConversionMap}exportDOM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{element:yV(this,t)}}createDOM(){return document.createElement("div")}updateDOM(){return!1}isInline(){return!1}getCaption(){return this.getLatest().__caption}setCaption(t){const n=this.getWritable();n.__caption=t}getCode(){return this.getLatest().__code}setCode(t){const n=this.getWritable();n.__code=t}getLanguage(){return this.getLatest().__language}setLanguage(t){const n=this.getWritable();n.__language=t}getTextContent(){return this.getLatest().__code}decorate(){return""}hasEditMode(){return!0}isEmpty(){return!this.__code}}function wV(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let o=typeof window<"u"&&window.document;if(!o)throw new Error("renderMarkdownNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return o}}const t=e.createDocument(),n=mP.render(r.getMarkdown()||"",e),i=t.createElement("div");return i.innerHTML=n,i}const yP=G.createCommand();class SV extends ag{constructor(){let{markdown:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;super(n);Ve(this,"__markdown");this.__markdown=t}static getType(){return"markdown"}static clone(t){return new this(t.getDataset(),t.__key)}static get urlTransformMap(){return{markdown:"markdown"}}getDataset(){return{markdown:this.getLatest().__markdown}}static importJSON(t){const{markdown:n}=t;return new this({markdown:n})}exportJSON(){return{type:"markdown",version:1,markdown:this.getMarkdown()}}exportDOM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{element:wV(this,t),type:"inner"}}createDOM(){return document.createElement("div")}updateDOM(){return!1}isInline(){return!1}getMarkdown(){return this.__markdown}setMarkdown(t){const n=this.getWritable();return n.__markdown=t}decorate(){return""}hasEditMode(){return!0}isEmpty(){return!this.__markdown}}class kV{constructor(e){this.NodeClass=e}get DOMConversionMap(){const e=this;return{figure:()=>({conversion(t){var i;const n=(i=t.classList)==null?void 0:i.contains("kg-video-card");if(t.tagName==="FIGURE"&&n){const o=t.querySelector(".kg-video-container video"),s=t.querySelector(".kg-video-duration"),l=o&&o.src,c=o&&o.width,f=o&&o.height,d=s&&s.innerHTML.trim(),m=t.querySelector("figcaption"),x=m&&m.innerHTML.trim();if(!l)return null;const y={src:l,loop:!!o.loop,cardWidth:CV(o)};if(d){const[_,k]=d.split(":");try{y.duration=parseInt(_)*60+parseInt(k)}catch{}}return t.dataset.kgThumbnail&&(y.thumbnailSrc=t.dataset.kgThumbnail),t.dataset.kgCustomThumbnail&&(y.customThumbnailSrc=t.dataset.kgCustomThumbnail),x&&(y.caption=x),c&&(y.width=c),f&&(y.height=f),{node:new e.NodeClass(y)}}return null},priority:1})}}}function CV(r){return r.classList.contains("kg-width-full")?"full":r.classList.contains("kg-width-wide")?"wide":"regular"}function _V(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e.createDocument){let s=typeof window<"u"&&window.document;if(!s)throw new Error("renderVideoNodeToDOM() must be passed a `createDocument` function as an option when used in a non-browser environment");e.createDocument=function(){return s}}const t=e.createDocument();if(!r.getSrc()||r.getSrc().trim()==="")return t.createTextNode("");const n=$V(r).join(" "),i=e.target==="email"?TV({node:r,options:e,cardClasses:n}):EV({node:r,cardClasses:n}),o=t.createElement("div");return o.innerHTML=i.trim(),o.firstElementChild}function EV(r){let{node:e,cardClasses:t}=r;const n=e.getVideoWidth(),i=e.getVideoHeight(),o=`https://img.spacergif.org/v1/${n}x${i}/0a/spacer.png`,s=e.getLoop()?"loop autoplay muted":"",l=e.getCustomThumbnailSrc()||e.getThumbnailSrc(),c=e.getLoop()?" kg-video-hide":"";return`
|
|
64
64
|
<figure class="${t}" data-kg-thumbnail=${e.getThumbnailSrc()} data-kg-custom-thumbnail=${e.getCustomThumbnailSrc()}>
|
|
65
65
|
<div class="kg-video-container">
|
|
66
66
|
<video
|