@ziteh/yangchun-comment-client 0.1.0 → 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/src/api/apiService.d.ts +22 -0
- package/dist/src/api/globalApiService.d.ts +10 -0
- package/dist/src/components/comment-admin.d.ts +25 -0
- package/dist/src/components/comment-dialog.d.ts +18 -0
- package/dist/src/components/comment-info.d.ts +14 -0
- package/dist/src/components/comment-input.d.ts +31 -0
- package/dist/src/components/list/comment-list-item.d.ts +19 -0
- package/dist/src/components/list/comment-list.d.ts +9 -0
- package/dist/src/components/yangchun-comment.d.ts +58 -0
- package/dist/src/components/yangchun-comment.styles.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/utils/comment.d.ts +6 -0
- package/dist/src/utils/format.d.ts +2 -0
- package/dist/src/utils/i18n.d.ts +46 -0
- package/dist/src/utils/pow.d.ts +9 -0
- package/dist/{utils → src/utils}/pseudonym.d.ts +0 -1
- package/dist/src/utils/sanitize.d.ts +1 -0
- package/dist/test/sanitize.test.d.ts +1 -0
- package/dist/yangchun-comment.js +962 -0
- package/dist/yangchun-comment.js.map +1 -0
- package/dist/yangchun-comment.umd.cjs +962 -0
- package/dist/yangchun-comment.umd.cjs.map +1 -0
- package/package.json +17 -13
- package/dist/element.d.ts +0 -97
- package/dist/element.js +0 -680
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -23
- package/dist/types.d.ts +0 -3
- package/dist/utils/apiService.d.ts +0 -15
- package/dist/utils/apiService.js +0 -118
- package/dist/utils/format.d.ts +0 -1
- package/dist/utils/format.js +0 -14
- package/dist/utils/i18n.d.ts +0 -51
- package/dist/utils/i18n.js +0 -98
- package/dist/utils/pseudonym.js +0 -34
- package/dist/utils/sanitize.d.ts +0 -4
- package/dist/utils/sanitize.js +0 -59
- package/dist/utils/wordBank.js +0 -692
- package/dist/views/comments.d.ts +0 -3
- package/dist/views/comments.js +0 -119
- package/dist/views/preview.d.ts +0 -3
- package/dist/views/preview.js +0 -53
- package/dist/yangchun-comment.css +0 -1
- package/dist/yangchun-comment.es.js +0 -317
- package/dist/yangchun-comment.es.js.map +0 -1
- package/dist/yangchun-comment.umd.js +0 -317
- package/dist/yangchun-comment.umd.js.map +0 -1
- /package/dist/{types.js → src/utils/pow.worker.d.ts} +0 -0
- /package/dist/{utils → src/utils}/wordBank.d.ts +0 -0
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const s=(e,...t)=>{const r=1===e.length?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1],e[0]);return new i(r,e,n)},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new i("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:a,defineProperty:c,getOwnPropertyDescriptor:l,getOwnPropertyNames:u,getOwnPropertySymbols:h,getPrototypeOf:d}=Object,p=globalThis,m=p.trustedTypes,f=m?m.emptyScript:"",g=p.reactiveElementPolyfillSupport,y=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},v=(e,t)=>!a(e,t),k={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:v};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=k){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&c(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:i}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const s=r?.call(this);i?.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??k}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=d(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...u(e),...h(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(o(e))}else void 0!==e&&t.push(o(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const t of r){const r=document.createElement("style"),i=e.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==n.converter?.toAttribute?n.converter:b).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:b;this._$Em=r;const s=i.fromAttribute(t,e.type);this[r]=s??this._$Ej?.get(r)??s,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const r=this.constructor,i=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??v)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},s){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==i||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,n,r)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[y("elementProperties")]=new Map,w[y("finalized")]=new Map,g?.({ReactiveElement:w}),(p.reactiveElementVersions??=[]).push("2.1.1");const _=globalThis,x=_.trustedTypes,$=x?x.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,E="?"+A,C=`<${E}>`,T=document,z=()=>T.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,O=Array.isArray,M="[ \t\n\f\r]",I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,R=/>/g,L=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,j=/"/g,U=/^(?:script|style|textarea|title)$/i,F=(e,...t)=>({_$litType$:1,strings:e,values:t}),Z=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),W=new WeakMap,H=T.createTreeWalker(T,129);function G(e,t){if(!O(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$?$.createHTML(t):t}let q=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let s=0,o=0;const a=t.length-1,c=this.parts,[l,u]=((e,t)=>{const n=e.length-1,r=[];let i,s=2===t?"<svg>":3===t?"<math>":"",o=I;for(let t=0;t<n;t++){const n=e[t];let a,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),null!==c);)u=o.lastIndex,o===I?"!--"===c[1]?o=N:void 0!==c[1]?o=R:void 0!==c[2]?(U.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=L):void 0!==c[3]&&(o=L):o===L?">"===c[0]?(o=i??I,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?L:'"'===c[3]?j:D):o===j||o===D?o=L:o===N||o===R?o=I:(o=L,i=void 0);const h=o===L&&e[t+1].startsWith("/>")?" ":"";s+=o===I?n+C:l>=0?(r.push(a),n.slice(0,l)+S+n.slice(l)+A+h):n+A+(-2===l?t:h)}return[G(e,s+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]})(t,n);if(this.el=e.createElement(l,r),H.currentNode=this.el.content,2===n||3===n){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=H.nextNode())&&c.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(S)){const t=u[o++],n=i.getAttribute(e).split(A),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:s,name:r[2],strings:n,ctor:"."===r[1]?K:"?"===r[1]?Q:"@"===r[1]?ee:Y}),i.removeAttribute(e)}else e.startsWith(A)&&(c.push({type:6,index:s}),i.removeAttribute(e));if(U.test(i.tagName)){const e=i.textContent.split(A),t=e.length-1;if(t>0){i.textContent=x?x.emptyScript:"";for(let n=0;n<t;n++)i.append(e[n],z()),H.nextNode(),c.push({type:2,index:++s});i.append(e[t],z())}}}else if(8===i.nodeType)if(i.data===E)c.push({type:2,index:s});else{let e=-1;for(;-1!==(e=i.data.indexOf(A,e+1));)c.push({type:7,index:s}),e+=A.length-1}s++}}static createElement(e,t){const n=T.createElement("template");return n.innerHTML=e,n}};function J(e,t,n=e,r){if(t===Z)return t;let i=void 0!==r?n._$Co?.[r]:n._$Cl;const s=P(t)?void 0:t._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),void 0===s?i=void 0:(i=new s(e),i._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=i:n._$Cl=i),void 0!==i&&(t=J(e,i._$AS(e,t.values),i,r)),t}let V=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??T).importNode(t,!0);H.currentNode=r;let i=H.nextNode(),s=0,o=0,a=n[0];for(;void 0!==a;){if(s===a.index){let t;2===a.type?t=new X(i,i.nextSibling,this,e):1===a.type?t=new a.ctor(i,a.name,a.strings,this,e):6===a.type&&(t=new te(i,this,e)),this._$AV.push(t),a=n[++o]}s!==a?.index&&(i=H.nextNode(),s++)}return H.currentNode=T,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}};class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=J(this,e,t),P(e)?e===B||null==e||""===e?(this._$AH!==B&&this._$AR(),this._$AH=B):e!==this._$AH&&e!==Z&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>O(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==B&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=q.createElement(G(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new V(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=W.get(e.strings);return void 0===t&&W.set(e.strings,t=new q(e)),t}k(e){O(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const i of e)r===t.length?t.push(n=new X(this.O(z()),this.O(z()),this,this.options)):n=t[r],n._$AI(i),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}let Y=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=B,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=B}_$AI(e,t=this,n,r){const i=this.strings;let s=!1;if(void 0===i)e=J(this,e,t,0),s=!P(e)||e!==this._$AH&&e!==Z,s&&(this._$AH=e);else{const r=e;let o,a;for(e=i[0],o=0;o<i.length-1;o++)a=J(this,r[n+o],t,o),a===Z&&(a=this._$AH[o]),s||=!P(a)||a!==this._$AH[o],a===B?e=B:e!==B&&(e+=(a??"")+i[o+1]),this._$AH[o]=a}s&&!r&&this.j(e)}j(e){e===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class K extends Y{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===B?void 0:e}}let Q=class extends Y{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==B)}},ee=class extends Y{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=J(this,e,t,0)??B)===Z)return;const n=this._$AH,r=e===B&&n!==B||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==B&&(n===B||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},te=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){J(this,e)}};const ne=_.litHtmlPolyfillSupport;ne?.(q,X),(_.litHtmlVersions??=[]).push("3.3.1");const re=globalThis;let ie=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const r=n?.renderBefore??t;let i=r._$litPart$;if(void 0===i){const e=n?.renderBefore??null;r._$litPart$=i=new X(t.insertBefore(z(),e),e,void 0,n??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};ie._$litElement$=!0,ie.finalized=!0,re.litElementHydrateSupport?.({LitElement:ie});const se=re.litElementPolyfillSupport;se?.({LitElement:ie}),(re.litElementVersions??=[]).push("4.2.1");const oe=e=>(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},ae={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:v},ce=(e=ae,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function le(e){return(t,n)=>"object"==typeof n?ce(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function ue(e){return le({...e,state:!0,attribute:!1})}function he(e,t){return(t,n,r)=>((e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,n),n))(t,n,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}const de=s`
|
|
2
|
+
:host {
|
|
3
|
+
--ycc-primary-color: #2563eb;
|
|
4
|
+
--ycc-primary-hover: #1d4ed8;
|
|
5
|
+
--ycc-text-color: #1f2937;
|
|
6
|
+
--ycc-text-secondary: #6b7280;
|
|
7
|
+
--ycc-placeholder-color: #9ca3af;
|
|
8
|
+
--ycc-bg-color: #ffffff;
|
|
9
|
+
--ycc-bg-secondary: #f3f4f6;
|
|
10
|
+
--ycc-border-color: #e5e7eb;
|
|
11
|
+
--ycc-error-color: #ef4444;
|
|
12
|
+
|
|
13
|
+
--ycc-spacing-xs: 4px;
|
|
14
|
+
--ycc-spacing-s: 8px;
|
|
15
|
+
--ycc-spacing-m: 16px;
|
|
16
|
+
--ycc-spacing-l: 24px;
|
|
17
|
+
|
|
18
|
+
--ycc-font-family: sans-serif;
|
|
19
|
+
--ycc-font-monospace: ui-monospace, monospace;
|
|
20
|
+
--ycc-font-size: 14px;
|
|
21
|
+
--ycc-line-height: 1.5;
|
|
22
|
+
--ycc-radius: 6px;
|
|
23
|
+
}
|
|
24
|
+
`,pe=s`
|
|
25
|
+
:host {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.root {
|
|
30
|
+
font-family: var(--ycc-font-family);
|
|
31
|
+
color: var(--ycc-text-color);
|
|
32
|
+
line-height: var(--ycc-line-height);
|
|
33
|
+
font-size: var(--ycc-font-size);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
button {
|
|
37
|
+
background-color: var(--ycc-primary-color);
|
|
38
|
+
color: white;
|
|
39
|
+
border: none;
|
|
40
|
+
padding: var(--ycc-spacing-s) var(--ycc-spacing-m);
|
|
41
|
+
border-radius: var(--ycc-radius);
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
font-size: var(--ycc-font-size);
|
|
44
|
+
transition: background-color 0.2s;
|
|
45
|
+
}
|
|
46
|
+
button:hover {
|
|
47
|
+
background-color: var(--ycc-primary-hover);
|
|
48
|
+
}
|
|
49
|
+
button:disabled {
|
|
50
|
+
opacity: 0.5;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
53
|
+
button.secondary {
|
|
54
|
+
background-color: var(--ycc-border-color);
|
|
55
|
+
color: var(--ycc-text-color);
|
|
56
|
+
}
|
|
57
|
+
button.secondary:hover {
|
|
58
|
+
background-color: var(--ycc-bg-secondary);
|
|
59
|
+
color: var(--ycc-text-secondary);
|
|
60
|
+
}
|
|
61
|
+
button.outline {
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
color: var(--ycc-text-secondary);
|
|
64
|
+
border: 1px solid var(--ycc-border-color);
|
|
65
|
+
}
|
|
66
|
+
button.outline:hover {
|
|
67
|
+
background-color: var(--ycc-bg-secondary);
|
|
68
|
+
color: var(--ycc-text-color);
|
|
69
|
+
}
|
|
70
|
+
button.text-btn {
|
|
71
|
+
background: none;
|
|
72
|
+
border: none;
|
|
73
|
+
color: var(--ycc-text-secondary);
|
|
74
|
+
padding: 0;
|
|
75
|
+
font-size: 0.9em;
|
|
76
|
+
}
|
|
77
|
+
button.text-btn:hover {
|
|
78
|
+
color: var(--ycc-primary-color);
|
|
79
|
+
background: none;
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
input[type='text'],
|
|
84
|
+
textarea {
|
|
85
|
+
width: 100%;
|
|
86
|
+
padding: var(--ycc-spacing-s);
|
|
87
|
+
border-radius: var(--ycc-radius);
|
|
88
|
+
font-family: inherit;
|
|
89
|
+
font-size: inherit;
|
|
90
|
+
box-sizing: border-box; /* Important for width: 100% */
|
|
91
|
+
}
|
|
92
|
+
input[type='text']:focus,
|
|
93
|
+
textarea:focus {
|
|
94
|
+
outline: none;
|
|
95
|
+
border-color: var(--ycc-primary-color);
|
|
96
|
+
}
|
|
97
|
+
`,me=new class{constructor(){this.instance=null}setInstance(e){this.instance=e}getInstance(){if(!this.instance)throw new Error("ApiService instance is not set");return this.instance}isInitialized(){return null!==this.instance}clear(){this.instance=null}},fe=e=>(...t)=>({_$litDirective$:e,values:t});let ge=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};class ye extends ge{constructor(e){if(super(e),this.it=B,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===B||null==e)return this._t=void 0,this.it=e;if(e===Z)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ye.directiveName="unsafeHTML",ye.resultType=1;const be=fe(ye),ve=(e,t)=>{const n=e._$AN;if(void 0===n)return!1;for(const e of n)e._$AO?.(t,!1),ve(e,t);return!0},ke=e=>{let t,n;do{if(void 0===(t=e._$AM))break;n=t._$AN,n.delete(e),e=t}while(0===n?.size)},we=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(void 0===n)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),$e(t)}};function _e(e){void 0!==this._$AN?(ke(this),this._$AM=e,we(this)):this._$AM=e}function xe(e,t=!1,n=0){const r=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)ve(r[e],!1),ke(r[e]);else null!=r&&(ve(r,!1),ke(r));else ve(this,e)}const $e=e=>{2==e.type&&(e._$AP??=xe,e._$AQ??=_e)};class Se extends ge{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),we(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(ve(this,e),ke(this))}setValue(e){if(void 0===this._$Ct.strings)this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}class Ae{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class Ee{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}const Ce=e=>{return!(null===(t=e)||"object"!=typeof t&&"function"!=typeof t||"function"!=typeof e.then);var t},Te=1073741823,ze=fe(class extends Se{constructor(){super(...arguments),this._$Cwt=Te,this._$Cbt=[],this._$CK=new Ae(this),this._$CX=new Ee}render(...e){return e.find(e=>!Ce(e))??Z}update(e,t){const n=this._$Cbt;let r=n.length;this._$Cbt=t;const i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this._$Cwt);e++){const o=t[e];if(!Ce(o))return this._$Cwt=e,o;e<r&&o===n[e]||(this._$Cwt=Te,r=0,Promise.resolve(o).then(async e=>{for(;s.get();)await s.get();const t=i.deref();if(void 0!==t){const n=t._$Cbt.indexOf(o);n>-1&&n<t._$Cwt&&(t._$Cwt=n,t.setValue(e))}}))}return Z}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}),{entries:Pe,setPrototypeOf:Oe,isFrozen:Me,getPrototypeOf:Ie,getOwnPropertyDescriptor:Ne}=Object;let{freeze:Re,seal:Le,create:De}=Object,{apply:je,construct:Ue}="undefined"!=typeof Reflect&&Reflect;Re||(Re=function(e){return e}),Le||(Le=function(e){return e}),je||(je=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),Ue||(Ue=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Fe=nt(Array.prototype.forEach),Ze=nt(Array.prototype.lastIndexOf),Be=nt(Array.prototype.pop),We=nt(Array.prototype.push),He=nt(Array.prototype.splice),Ge=nt(String.prototype.toLowerCase),qe=nt(String.prototype.toString),Je=nt(String.prototype.match),Ve=nt(String.prototype.replace),Xe=nt(String.prototype.indexOf),Ye=nt(String.prototype.trim),Ke=nt(Object.prototype.hasOwnProperty),Qe=nt(RegExp.prototype.test),et=(tt=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ue(tt,t)});var tt;function nt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return je(e,t,r)}}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ge;Oe&&Oe(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(Me(t)||(t[r]=e),i=e)}e[i]=!0}return e}function it(e){for(let t=0;t<e.length;t++)Ke(e,t)||(e[t]=null);return e}function st(e){const t=De(null);for(const[n,r]of Pe(e))Ke(e,n)&&(Array.isArray(r)?t[n]=it(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=st(r):t[n]=r);return t}function ot(e,t){for(;null!==e;){const n=Ne(e,t);if(n){if(n.get)return nt(n.get);if("function"==typeof n.value)return nt(n.value)}e=Ie(e)}return function(){return null}}const at=Re(["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"]),ct=Re(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),lt=Re(["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"]),ut=Re(["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"]),ht=Re(["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"]),dt=Re(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pt=Re(["#text"]),mt=Re(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),ft=Re(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),gt=Re(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),yt=Re(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bt=Le(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vt=Le(/<%[\w\W]*|[\w\W]*%>/gm),kt=Le(/\$\{[\w\W]*/gm),wt=Le(/^data-[\-\w.\u00B7-\uFFFF]+$/),_t=Le(/^aria-[\-\w]+$/),xt=Le(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$t=Le(/^(?:\w+script|data):/i),St=Le(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),At=Le(/^html$/i),Et=Le(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ct=Object.freeze({__proto__:null,ARIA_ATTR:_t,ATTR_WHITESPACE:St,CUSTOM_ELEMENT:Et,DATA_ATTR:wt,DOCTYPE_NAME:At,ERB_EXPR:vt,IS_ALLOWED_URI:xt,IS_SCRIPT_OR_DATA:$t,MUSTACHE_EXPR:bt,TMPLIT_EXPR:kt});var Tt=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:c,Element:l,NodeFilter:u,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:m}=t,f=l.prototype,g=ot(f,"cloneNode"),y=ot(f,"remove"),b=ot(f,"nextSibling"),v=ot(f,"childNodes"),k=ot(f,"parentNode");if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,_="";const{implementation:x,createNodeIterator:$,createDocumentFragment:S,getElementsByTagName:A}=r,{importNode:E}=i;let C={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Pe&&"function"==typeof k&&x&&void 0!==x.createHTMLDocument;const{MUSTACHE_EXPR:T,ERB_EXPR:z,TMPLIT_EXPR:P,DATA_ATTR:O,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:R}=Ct;let{IS_ALLOWED_URI:L}=Ct,D=null;const j=rt({},[...at,...ct,...lt,...ht,...pt]);let U=null;const F=rt({},[...mt,...ft,...gt,...yt]);let Z=Object.seal(De(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,W=null;const H=Object.seal(De(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let G=!0,q=!0,J=!1,V=!0,X=!1,Y=!0,K=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!1,ie=!0,se=!1,oe=!0,ae=!1,ce={},le=null;const ue=rt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let he=null;const de=rt({},["audio","video","img","source","image","track"]);let pe=null;const me=rt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let be=ye,ve=!1,ke=null;const we=rt({},[fe,ge,ye],qe);let _e=rt({},["mi","mo","mn","ms","mtext"]),xe=rt({},["annotation-xml"]);const $e=rt({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let Ee=null,Ce=null;const Te=r.createElement("form"),ze=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ce||Ce!==e){if(e&&"object"==typeof e||(e={}),e=st(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===Se?qe:Ge,D=Ke(e,"ALLOWED_TAGS")?rt({},e.ALLOWED_TAGS,Ee):j,U=Ke(e,"ALLOWED_ATTR")?rt({},e.ALLOWED_ATTR,Ee):F,ke=Ke(e,"ALLOWED_NAMESPACES")?rt({},e.ALLOWED_NAMESPACES,qe):we,pe=Ke(e,"ADD_URI_SAFE_ATTR")?rt(st(me),e.ADD_URI_SAFE_ATTR,Ee):me,he=Ke(e,"ADD_DATA_URI_TAGS")?rt(st(de),e.ADD_DATA_URI_TAGS,Ee):de,le=Ke(e,"FORBID_CONTENTS")?rt({},e.FORBID_CONTENTS,Ee):ue,B=Ke(e,"FORBID_TAGS")?rt({},e.FORBID_TAGS,Ee):st({}),W=Ke(e,"FORBID_ATTR")?rt({},e.FORBID_ATTR,Ee):st({}),ce=!!Ke(e,"USE_PROFILES")&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,J=e.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,K=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,se=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||xt,be=e.NAMESPACE||ye,_e=e.MATHML_TEXT_INTEGRATION_POINTS||_e,xe=e.HTML_INTEGRATION_POINTS||xe,Z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(q=!1),ne&&(te=!0),ce&&(D=rt({},pt),U=[],!0===ce.html&&(rt(D,at),rt(U,mt)),!0===ce.svg&&(rt(D,ct),rt(U,ft),rt(U,yt)),!0===ce.svgFilters&&(rt(D,lt),rt(U,ft),rt(U,yt)),!0===ce.mathMl&&(rt(D,ht),rt(U,gt),rt(U,yt))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?H.tagCheck=e.ADD_TAGS:(D===j&&(D=st(D)),rt(D,e.ADD_TAGS,Ee))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?H.attributeCheck=e.ADD_ATTR:(U===F&&(U=st(U)),rt(U,e.ADD_ATTR,Ee))),e.ADD_URI_SAFE_ATTR&&rt(pe,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ue&&(le=st(le)),rt(le,e.FORBID_CONTENTS,Ee)),e.ADD_FORBID_CONTENTS&&(le===ue&&(le=st(le)),rt(le,e.ADD_FORBID_CONTENTS,Ee)),oe&&(D["#text"]=!0),K&&rt(D,["html","head","body"]),D.table&&(rt(D,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,_=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(m,s)),null!==w&&"string"==typeof _&&(_=w.createHTML(""));Re&&Re(e),Ce=e}},Me=rt({},[...ct,...lt,...ut]),Ie=rt({},[...ht,...dt]),Ne=function(e){We(n.removed,{element:e});try{k(e).removeChild(e)}catch(t){y(e)}},Le=function(e,t){try{We(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){We(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},je=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=Je(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&be===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=w?w.createHTML(e):e;if(be===ye)try{t=(new p).parseFromString(i,Se)}catch(e){}if(!t||!t.documentElement){t=x.createDocument(be,"template",null);try{t.documentElement.innerHTML=ve?_:i}catch(e){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(r.createTextNode(n),s.childNodes[0]||null),be===ye?A.call(t,K?"html":"body")[0]:K?t.documentElement:s},Ue=function(e){return $.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},tt=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},nt=function(e){return"function"==typeof c&&e instanceof c};function it(e,t,r){Fe(e,e=>{e.call(n,t,r,Ce)})}const bt=function(e){let t=null;if(it(C.beforeSanitizeElements,e,null),tt(e))return Ne(e),!0;const r=Ee(e.nodeName);if(it(C.uponSanitizeElement,e,{tagName:r,allowedTags:D}),Y&&e.hasChildNodes()&&!nt(e.firstElementChild)&&Qe(/<[/\w!]/g,e.innerHTML)&&Qe(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(7===e.nodeType)return Ne(e),!0;if(Y&&8===e.nodeType&&Qe(/<[/\w]/g,e.data))return Ne(e),!0;if(!(H.tagCheck instanceof Function&&H.tagCheck(r))&&(!D[r]||B[r])){if(!B[r]&&kt(r)){if(Z.tagNameCheck instanceof RegExp&&Qe(Z.tagNameCheck,r))return!1;if(Z.tagNameCheck instanceof Function&&Z.tagNameCheck(r))return!1}if(oe&&!le[r]){const t=k(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const i=g(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,b(e))}}return Ne(e),!0}return e instanceof l&&!function(e){let t=k(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Ge(e.tagName),r=Ge(t.tagName);return!!ke[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===r||_e[r]):Boolean(Me[n]):e.namespaceURI===fe?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&xe[r]:Boolean(Ie[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!xe[r])&&!(t.namespaceURI===fe&&!_e[r])&&!Ie[n]&&($e[n]||!Me[n]):!("application/xhtml+xml"!==Se||!ke[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Qe(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,Fe([T,z,P],e=>{t=Ve(t,e," ")}),e.textContent!==t&&(We(n.removed,{element:e.cloneNode()}),e.textContent=t)),it(C.afterSanitizeElements,e,null),!1):(Ne(e),!0)},vt=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in r||n in Te))return!1;if(q&&!W[t]&&Qe(O,t));else if(G&&Qe(M,t));else if(H.attributeCheck instanceof Function&&H.attributeCheck(t,e));else if(!U[t]||W[t]){if(!(kt(e)&&(Z.tagNameCheck instanceof RegExp&&Qe(Z.tagNameCheck,e)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(e))&&(Z.attributeNameCheck instanceof RegExp&&Qe(Z.attributeNameCheck,t)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(t,e))||"is"===t&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Qe(Z.tagNameCheck,n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(n))))return!1}else if(pe[t]);else if(Qe(L,Ve(n,N,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Xe(n,"data:")||!he[e])if(J&&!Qe(I,Ve(n,N,"")));else if(n)return!1;return!0},kt=function(e){return"annotation-xml"!==e&&Je(e,R)},wt=function(e){it(C.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||tt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0};let i=t.length;for(;i--;){const s=t[i],{name:o,namespaceURI:a,value:c}=s,l=Ee(o),u=c;let h="value"===o?u:Ye(u);if(r.attrName=l,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,it(C.uponSanitizeAttribute,e,r),h=r.attrValue,!se||"id"!==l&&"name"!==l||(Le(o,e),h="user-content-"+h),Y&&Qe(/((--!?|])>)|<\/(style|title|textarea)/i,h)){Le(o,e);continue}if("attributename"===l&&Je(h,"href")){Le(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Le(o,e);continue}if(!V&&Qe(/\/>/i,h)){Le(o,e);continue}X&&Fe([T,z,P],e=>{h=Ve(h,e," ")});const d=Ee(e.nodeName);if(vt(d,l,h)){if(w&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(a);else switch(m.getAttributeType(d,l)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}if(h!==u)try{a?e.setAttributeNS(a,o,h):e.setAttribute(o,h),tt(e)?Ne(e):Be(n.removed)}catch(t){Le(o,e)}}else Le(o,e)}it(C.afterSanitizeAttributes,e,null)},_t=function e(t){let n=null;const r=Ue(t);for(it(C.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)it(C.uponSanitizeShadowNode,n,null),bt(n),wt(n),n.content instanceof o&&e(n.content);it(C.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,s=null,a=null,l=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!nt(e)){if("function"!=typeof e.toString)throw et("toString is not a function");if("string"!=typeof(e=e.toString()))throw et("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Q||Oe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ee(e.nodeName);if(!D[t]||B[t])throw et("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=je("\x3c!----\x3e"),s=r.ownerDocument.importNode(e,!0),1===s.nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!te&&!X&&!K&&-1===e.indexOf("<"))return w&&re?w.createHTML(e):e;if(r=je(e),!r)return te?null:re?_:""}r&&ee&&Ne(r.firstChild);const u=Ue(ae?e:r);for(;a=u.nextNode();)bt(a),wt(a),a.content instanceof o&&_t(a.content);if(ae)return e;if(te){if(ne)for(l=S.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(U.shadowroot||U.shadowrootmode)&&(l=E.call(i,l,!0)),l}let h=K?r.outerHTML:r.innerHTML;return K&&D["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Qe(At,r.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+h),X&&Fe([T,z,P],e=>{h=Ve(h,e," ")}),w&&re?w.createHTML(h):h},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){Ce=null,Q=!1},n.isValidAttribute=function(e,t,n){Ce||Oe({});const r=Ee(e),i=Ee(t);return vt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&We(C[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Ze(C[e],t);return-1===n?void 0:He(C[e],n,1)[0]}return Be(C[e])},n.removeHooks=function(e){C[e]=[]},n.removeAllHooks=function(){C={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const zt={ALLOWED_TAGS:["a","b","i","em","strong","s","p","ul","ol","li","code","pre","blockquote","h6","hr","br","img"],ALLOWED_ATTR:["href","src","alt"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1};let Pt=!1;Pt||(Tt.addHook("afterSanitizeAttributes",e=>{if(e instanceof HTMLAnchorElement){e.setAttribute("rel","noopener noreferrer"),e.setAttribute("data-external-link","true");const t=e.getAttribute("href");t&&(e.setAttribute("data-href",t),e.removeAttribute("href")),e.style.cursor="pointer"}e instanceof HTMLImageElement&&e.setAttribute("loading","lazy")}),Tt.addHook("uponSanitizeAttribute",(e,t)=>{if("href"===t.attrName||"src"===t.attrName)try{const e=new URL(t.attrValue||"");"http:"!==e.protocol&&"https:"!==e.protocol&&(t.keepAttr=!1)}catch{t.keepAttr=!1}}),Pt=!0);var Ot={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Mt(e){Ot=e}var It={exec:()=>null};function Nt(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Lt.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Rt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Lt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Dt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jt=/(?:[*+-]|\d{1,9}[.)])/,Ut=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ft=Nt(Ut).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zt=Nt(Ut).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ht=Nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gt=Nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),qt="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",Jt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vt=Nt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Jt).replace("tag",qt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xt=Nt(Bt).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qt).getRegex(),Yt={blockquote:Nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xt).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Ht,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Dt,html:Vt,lheading:Ft,list:Gt,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Xt,table:It,text:/^[^\n]+/},Kt=Nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qt).getRegex(),Qt={...Yt,lheading:Zt,table:Kt,paragraph:Nt(Bt).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qt).getRegex()},en={...Yt,html:Nt("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Jt).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:It,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nt(Bt).replace("hr",Dt).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ft).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tn=/^( {2,}|\\)\n(?!\s*$)/,nn=/[\p{P}\p{S}]/u,rn=/[\s\p{P}\p{S}]/u,sn=/[^\s\p{P}\p{S}]/u,on=Nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rn).getRegex(),an=/(?!~)[\p{P}\p{S}]/u,cn=Nt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Rt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ln=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,un=Nt(ln,"u").replace(/punct/g,nn).getRegex(),hn=Nt(ln,"u").replace(/punct/g,an).getRegex(),dn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pn=Nt(dn,"gu").replace(/notPunctSpace/g,sn).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),mn=Nt(dn,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,an).getRegex(),fn=Nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,sn).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),gn=Nt(/\\(punct)/,"gu").replace(/punct/g,nn).getRegex(),yn=Nt(/^<(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(),bn=Nt(Jt).replace("(?:--\x3e|$)","--\x3e").getRegex(),vn=Nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,wn=Nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_n=Nt(/^!?\[(label)\]\[(ref)\]/).replace("label",kn).replace("ref",Wt).getRegex(),xn=Nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wt).getRegex(),$n=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Sn={_backpedal:It,anyPunctuation:gn,autolink:yn,blockSkip:cn,br:tn,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:It,emStrongLDelim:un,emStrongRDelimAst:pn,emStrongRDelimUnd:fn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:wn,nolink:xn,punctuation:on,reflink:_n,reflinkSearch:Nt("reflink|nolink(?!\\()","g").replace("reflink",_n).replace("nolink",xn).getRegex(),tag:vn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:It},An={...Sn,link:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",kn).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kn).getRegex()},En={...Sn,emStrongRDelimAst:mn,emStrongLDelim:hn,url:Nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$n).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Nt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",$n).getRegex()},Cn={...En,br:Nt(tn).replace("{2,}","*").getRegex(),text:Nt(En.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tn={normal:Yt,gfm:Qt,pedantic:en},zn={normal:Sn,gfm:En,breaks:Cn,pedantic:An},Pn={"&":"&","<":"<",">":">",'"':""","'":"'"},On=e=>Pn[e];function Mn(e,t){if(t){if(Lt.escapeTest.test(e))return e.replace(Lt.escapeReplace,On)}else if(Lt.escapeTestNoEncode.test(e))return e.replace(Lt.escapeReplaceNoEncode,On);return e}function In(e){try{e=encodeURI(e).replace(Lt.percentDecode,"%")}catch{return null}return e}function Nn(e,t){let n=e.replace(Lt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(Lt.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(Lt.slashPipe,"|");return n}function Rn(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Ln(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,c}var Dn=class{options;rules;lexer;constructor(e){this.options=e||Ot}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=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Rn(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],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=Rn(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],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:Rn(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Rn(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),c=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),l=e.split("\n",1)[0],u=!c.trim(),h=0;if(this.options.pedantic?(h=2,a=c.trimStart()):u?h=t[1].length+1:(h=t[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=c.slice(h),h+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+"\n",e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),i=this.rules.other.fencesBeginRegex(h),s=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h);for(;e;){let d,p=e.split("\n",1)[0];if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting," "),d=l):d=l.replace(this.rules.other.tabCharGlobal," "),i.test(l)||s.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(d.search(this.rules.other.nonSpaceChar)>=h||!l.trim())a+="\n"+d.slice(h);else{if(u||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(c)||s.test(c)||n.test(c))break;a+="\n"+l}!u&&!l.trim()&&(u=!0),r+=p+"\n",e=e.substring(p.length+1),c=d.slice(h)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),"text"===e.tokens[0]?.type||"paragraph"===e.tokens[0]?.type){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,i.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));i.loose=n}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),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:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Nn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Nn(e,s.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?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)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){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){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Rn(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[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}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ln(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Ln(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=c.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,c=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){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=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){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,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="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,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:t[0],escaped:e}}}},jn=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ot,this.options.tokenizer=this.options.tokenizer||new Dn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Lt,block:Tn.normal,inline:zn.normal};this.options.pedantic?(t.block=Tn.pedantic,t.inline=zn.pedantic):this.options.gfm&&(t.block=Tn.gfm,this.options.breaks?t.inline=zn.breaks:t.inline=zn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Tn,inline:zn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Lt.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Lt.tabCharGlobal," ").replace(Lt.spaceLine,""));e;){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)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(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);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+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)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r=e,i=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(r));)n=i[2]?i[2].length:0,r=r.slice(0,i.index+n)+"["+"a".repeat(i[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let s=!1,o="";for(;e;){let n;if(s||(o=""),s=!1,this.options.extensions?.inline?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,o)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),s=!0;let r=t.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Un=class{options;parser;constructor(e){this.options=e||Ot}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Lt.notSpaceStart)?.[0],i=e.replace(Lt.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Mn(r)+'">'+(n?i:Mn(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Mn(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}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";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}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&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}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>${Mn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=In(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Mn(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=In(e);if(null===i)return Mn(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Mn(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Mn(e.text)}},Fn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Zn=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ot,this.options.renderer=this.options.renderer||new Un,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fn}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let i=r;switch(i.type){case"space":t+=this.renderer.space(i);break;case"hr":t+=this.renderer.hr(i);break;case"heading":t+=this.renderer.heading(i);break;case"code":t+=this.renderer.code(i);break;case"table":t+=this.renderer.table(i);break;case"blockquote":t+=this.renderer.blockquote(i);break;case"list":t+=this.renderer.list(i);break;case"checkbox":t+=this.renderer.checkbox(i);break;case"html":t+=this.renderer.html(i);break;case"def":t+=this.renderer.def(i);break;case"paragraph":t+=this.renderer.paragraph(i);break;case"text":t+=this.renderer.text(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"checkbox":n+=t.checkbox(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Bn=class{options;block;constructor(e){this.options=e||Ot}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(){return this.block?jn.lex:jn.lexInline}provideParser(){return this.block?Zn.parse:Zn.parseInline}},Wn=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Zn;Renderer=Un;TextRenderer=Fn;Lexer=jn;Tokenizer=Dn;Hooks=Bn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};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 new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new 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&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(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 Un(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Dn(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Bn;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];Bn.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Bn.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.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 n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return jn.lex(e,t??this.defaults)}parser(e,t){return Zn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new 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"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new 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?jn.lex:jn.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Zn.parse:Zn.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?jn.lex:jn.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?Zn.parse:Zn.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Mn(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Hn(e,t){return Wn.parse(e,t)}function Gn(e){const t=new Date(e),n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");let s=t.getHours();const o=String(t.getMinutes()).padStart(2,"0"),a=s>=12?"PM":"AM";return s%=12,0===s&&(s=12),`${n}/${r}/${i} ${String(s).padStart(2,"0")}:${o} ${a}`}function qn(e,t="en-US"){const n=new Date(e),r=Date.now(),i=n.getTime()-r,s=Math.round(i/1e3),o=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),a=[{amount:60,unit:"second"},{amount:60,unit:"minute"},{amount:24,unit:"hour"},{amount:7,unit:"day"},{amount:4.34524,unit:"week"},{amount:12,unit:"month"},{amount:1/0,unit:"year"}];let c=s;for(const e of a){if(Math.abs(c)<e.amount)return o.format(Math.round(c),e.unit);c/=e.amount}return""}Hn.options=Hn.setOptions=function(e){return Wn.setOptions(e),Hn.defaults=Wn.defaults,Mt(Hn.defaults),Hn},Hn.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},Hn.defaults=Ot,Hn.use=function(...e){return Wn.use(...e),Hn.defaults=Wn.defaults,Mt(Hn.defaults),Hn},Hn.walkTokens=function(e,t){return Wn.walkTokens(e,t)},Hn.parseInline=Wn.parseInline,Hn.Parser=Zn,Hn.parser=Zn.parse,Hn.Renderer=Un,Hn.TextRenderer=Fn,Hn.Lexer=jn,Hn.lexer=jn.lex,Hn.Tokenizer=Dn,Hn.Hooks=Bn,Hn.parse=Hn,Hn.options,Hn.setOptions,Hn.use,Hn.walkTokens,Hn.parseInline,Zn.parse,jn.lex;const Jn={bcp47:"en-US",anonymous:"Anonymous",submit:"Submit",preview:"Preview",edit:"Edit",edited:"Edited",editing:"Editing: ",delete:"Delete",reply:"Reply",replyTo:"Reply to",replyingTo:"Replying to: ",notify:"Notify",help:"Help",cancel:"Cancel",close:"Close",author:"Author",me:"Me",messagePlaceholder:"Write a comment...\nSupports Markdown",nicknamePlaceholder:"Nickname (optional), it will be converted to a pseudonym",confirmDelete:"Confirm delete",confirmDeleteDesc1:"Are you sure you want to delete this comment? Comment ID: ",confirmDeleteDesc2:"This action cannot be undone!",helpDesc:"This is a simple comment system — you can post comments and reply to others. You may preview your content before posting.\n You can fill in a nickname which will be converted to a pseudonym for privacy, or leave it blank to remain anonymous.\n After posting, you can edit or delete your own comment within two minutes without leaving or refreshing the page.\n Comment content supports basic Markdown and does not support HTML.",helpMdLink:"Link",helpMdImage:"Image",helpMdItalic:"Italic",helpMdBold:"Bold",helpMdList:"List item",helpMdOrderedList:"Ordered list item",helpMdInlineCode:"Inline code",helpMdCodeBlock:"Code block",helpMdNoHtml:"No HTML",notifyDesc:"You can subscribe to the comments RSS feed for this post: ",noComments:"No comments yet",showMore:"Show more",showLess:"Show less",externalLinkWarning:"External Link Warning",externalLinkDesc:"You are about to leave this site and visit:",openLink:"Open Link",copyLink:"Copy Link"},Vn={bcp47:"zh-TW",anonymous:"匿名",submit:"發送",preview:"預覽",edit:"編輯",edited:"已編輯",editing:"正在編輯:",delete:"刪除",reply:"回覆",replyTo:"回覆給",replyingTo:"正在回覆:",notify:"通知",cancel:"取消",close:"關閉",help:"幫助",author:"作者",me:"我",messagePlaceholder:"請輸入留言...\n支援 Markdown",nicknamePlaceholder:"暱稱(選填)將會被轉換為假名",confirmDelete:"確認刪除",confirmDeleteDesc1:"確定要刪除此留言嗎?留言 ID: ",confirmDeleteDesc2:"此操作無法復原!",helpDesc:"這是一個簡單的留言板,你可以發表留言、回覆他人的留言,發表前可以先預覽內容。\n留言時可以填寫暱稱,系統會將其轉換為假名以保護你的隱私,或留空保持匿名。\n發表留言後,在不離開或重新整理頁面的情況下,可以編輯或刪除自己兩分鐘內的留言。\n留言內容支援基本 Markdown 語法,不支援 HTML。",helpMdLink:"連結",helpMdImage:"圖片",helpMdItalic:"斜體",helpMdBold:"粗體",helpMdList:"清單項目",helpMdOrderedList:"有序清單項目",helpMdInlineCode:"行內程式碼",helpMdCodeBlock:"程式碼區塊",helpMdNoHtml:"不支援 HTML",notifyDesc:"你可以訂閱此文章的留言 RSS Feed:",noComments:"目前還沒有留言",showMore:"顯示全部",showLess:"折疊",externalLinkWarning:"外部連結警告",externalLinkDesc:"你即將離開本站並訪問:",openLink:"開啟連結",copyLink:"複製連結"};let Xn=Jn;function Yn(e){return Xn[e]||e}function Kn(e){Xn=e}var Qn,er,tr,nr,rr,ir,sr,or,ar,cr=Object.create,lr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,hr=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),dr=e=>{throw TypeError(e)},pr=(e,t)=>lr(e,"name",{value:t,configurable:!0}),mr=["class","method","getter","setter","accessor","field","value","get","set"],fr=e=>void 0!==e&&"function"!=typeof e?dr("Function expected"):e,gr=(e,t,n,r,i)=>({kind:mr[e],name:t,metadata:r,addInitializer:e=>n._?dr("Already initialized"):i.push(fr(e||null))}),yr=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},br=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=mr[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&ur(h<4?i:{get[n](){return wr(this,s)},set[n](e){return xr(this,s,e)}},n));h?p&&h<4&&pr(s,(h>2?"set ":h>1?"get ":"")+n):pr(i,n);for(var v=r.length-1;v>=0;v--)l=gr(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>kr(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?wr:$r)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>xr(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?fr(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?dr("Object expected"):(fr(o=a.get)&&(b.get=o),fr(o=a.set)&&(b.set=o),fr(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=hr("metadata"),i=e[3],r in n?lr(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&lr(i,n,b),p?4^h?s:b:i},vr=(e,t,n)=>t.has(e)||dr("Cannot "+n),kr=(e,t)=>Object(t)!==t?dr('Cannot use the "in" operator on this value'):e.has(t),wr=(e,t,n)=>(vr(e,t,"read from private field"),n?n.call(e):t.get(e)),_r=(e,t,n)=>t.has(e)?dr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xr=(e,t,n,r)=>(vr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),$r=(e,t,n)=>(vr(e,t,"access private method"),n);const Sr="deleted";rr=[oe("comment-list-item")];class Ar extends(nr=ie,tr=[le({type:Object})],er=[le({type:Array})],Qn=[le({type:String})],nr){constructor(){super(...arguments),_r(this,sr,yr(ir,8,this,{id:"",msg:"",pubDate:0})),yr(ir,11,this),_r(this,or,yr(ir,12,this,[])),yr(ir,15,this),_r(this,ar,yr(ir,16,this,"")),yr(ir,19,this),this.isContentExpanded=!1,this.MAX_LINES=10}render(){const e=F`
|
|
98
|
+
<!-- prettier-ignore -->
|
|
99
|
+
<div
|
|
100
|
+
part="content"
|
|
101
|
+
class="content ${!this.isContentExpanded&&this.shouldShowExpandBtn()?"collapsed":""}"
|
|
102
|
+
@click=${this.handleContentClick}
|
|
103
|
+
>${ze(this.renderMarkdown(this.comment.msg),F`<span></span>`)}</div>
|
|
104
|
+
`;return F`
|
|
105
|
+
<div class=${this.comment.replyTo?"reply-comment":"root-comment"}>
|
|
106
|
+
<div
|
|
107
|
+
part="comment-box"
|
|
108
|
+
class="comment-box"
|
|
109
|
+
id=${this.comment.id}
|
|
110
|
+
role="article"
|
|
111
|
+
aria-labelledby="author-${this.comment.id}"
|
|
112
|
+
>
|
|
113
|
+
<div class="header" part="header">
|
|
114
|
+
<span class="author" part="author" id="author-${this.comment.id}"
|
|
115
|
+
>${this.comment.isAdmin&&this.author?this.author:this.comment.pseudonym||Yn("anonymous")}</span
|
|
116
|
+
>
|
|
117
|
+
${(()=>this.comment.isAdmin?F`<span class="badge" part="badge">${Yn("author")}</span>`:me.isInitialized()&&me.getInstance().isMyComment(this.comment.id)?F`<span class="badge" part="badge">${Yn("me")}</span>`:null)()}
|
|
118
|
+
${this.comment.modDate&&this.comment.modDate>this.comment.pubDate?F`
|
|
119
|
+
<time
|
|
120
|
+
part="date"
|
|
121
|
+
class="date-relative"
|
|
122
|
+
datetime=${new Date(this.comment.modDate).toISOString()}
|
|
123
|
+
aria-label="${Yn("edited")} ${qn(this.comment.modDate,Yn("bcp47"))} (${Gn(this.comment.modDate)})"
|
|
124
|
+
>
|
|
125
|
+
${Yn("edited")+" "+qn(this.comment.modDate,Yn("bcp47"))}
|
|
126
|
+
</time>
|
|
127
|
+
<span class="date-absolute" aria-hidden="true"
|
|
128
|
+
>${Gn(this.comment.modDate)}</span
|
|
129
|
+
>
|
|
130
|
+
`:F`
|
|
131
|
+
<time
|
|
132
|
+
part="date"
|
|
133
|
+
class="date-relative"
|
|
134
|
+
datetime=${new Date(this.comment.pubDate).toISOString()}
|
|
135
|
+
aria-label="${qn(this.comment.pubDate,Yn("bcp47"))} (${Gn(this.comment.pubDate)})"
|
|
136
|
+
>
|
|
137
|
+
${qn(this.comment.pubDate,Yn("bcp47"))}
|
|
138
|
+
</time>
|
|
139
|
+
<span class="date-absolute" aria-hidden="true"
|
|
140
|
+
>${Gn(this.comment.pubDate)}</span
|
|
141
|
+
>
|
|
142
|
+
`}
|
|
143
|
+
<span class="comment-id" aria-hidden="true">#${this.comment.id}</span>
|
|
144
|
+
${this.comment.replyTo?F`<span class="comment-reply-to"
|
|
145
|
+
>${Yn("replyTo")+" #"+this.comment.replyTo}</span
|
|
146
|
+
>`:null}
|
|
147
|
+
</div>
|
|
148
|
+
${e}
|
|
149
|
+
${this.shouldShowExpandBtn()?F`<button
|
|
150
|
+
part="show-more-btn"
|
|
151
|
+
class="show-more-btn"
|
|
152
|
+
@click=${this.handleToggleExpand}
|
|
153
|
+
>
|
|
154
|
+
${this.isContentExpanded?Yn("showLess"):Yn("showMore")}
|
|
155
|
+
</button>`:null}
|
|
156
|
+
${this.isPreviewComment()||this.comment.pseudonym===Sr&&this.comment.msg===Sr?null:F`
|
|
157
|
+
<div class="actions" part="actions">
|
|
158
|
+
<button
|
|
159
|
+
class="text-btn"
|
|
160
|
+
@click=${this.handleReply}
|
|
161
|
+
title=${Yn("replyTo")+" #"+this.comment.id}
|
|
162
|
+
aria-label=${Yn("replyTo")+" "+(this.comment.pseudonym||Yn("anonymous"))}
|
|
163
|
+
>
|
|
164
|
+
${Yn("reply")}
|
|
165
|
+
</button>
|
|
166
|
+
${me.isInitialized()&&me.getInstance().canEditComment(this.comment.id)?F`
|
|
167
|
+
<button class="text-btn" @click=${this.handleEdit}>${Yn("edit")}</button>
|
|
168
|
+
<button class="text-btn" @click=${this.handleDelete}>${Yn("delete")}</button>
|
|
169
|
+
`:null}
|
|
170
|
+
</div>
|
|
171
|
+
`}
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div class="reply-comments" part="reply-comments" role="list">
|
|
175
|
+
${this.replyComments.map(e=>F`
|
|
176
|
+
<comment-list-item
|
|
177
|
+
role="listitem"
|
|
178
|
+
.comment=${e}
|
|
179
|
+
.author=${this.author}
|
|
180
|
+
></comment-list-item>
|
|
181
|
+
`)}
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
`}isPreviewComment(){return"preview_"===this.comment.id}handleDelete(){this.comment.id&&this.dispatchEvent(new CustomEvent("comment-delete",{detail:this.comment.id,bubbles:!0,composed:!0}))}handleEdit(){this.comment.id&&this.dispatchEvent(new CustomEvent("comment-edit",{detail:this.comment.id,bubbles:!0,composed:!0}))}handleReply(){this.comment.id&&this.dispatchEvent(new CustomEvent("comment-reply",{detail:this.comment.id,bubbles:!0,composed:!0}))}handleContentClick(e){const t=e.target.closest('[data-external-link="true"]');if(t){e.preventDefault(),e.stopPropagation();const n=t.getAttribute("data-href");n&&this.dispatchEvent(new CustomEvent("external-link-click",{detail:n,bubbles:!0,composed:!0}))}}async renderMarkdown(e){if(!e)return be("");const t=function(e){return Tt.sanitize(e,zt)}(await Hn.parse(e));return be(t)}shouldShowExpandBtn(){return(this.comment.msg||"").split("\n").length>this.MAX_LINES}handleToggleExpand(){this.isContentExpanded=!this.isContentExpanded,this.requestUpdate()}}var Er;Er=nr,ir=[,,,cr(Er?.[hr("metadata")]??null)],sr=new WeakMap,or=new WeakMap,ar=new WeakMap,br(ir,4,"comment",tr,Ar,sr),br(ir,4,"replyComments",er,Ar,or),br(ir,4,"author",Qn,Ar,ar),(Ar=br(ir,0,"CommentListItem",rr,Ar)).styles=[pe,s`
|
|
185
|
+
:host {
|
|
186
|
+
display: block;
|
|
187
|
+
margin-bottom: var(--ycc-spacing-s);
|
|
188
|
+
}
|
|
189
|
+
.comment-box {
|
|
190
|
+
padding: var(--ycc-spacing-s);
|
|
191
|
+
// border: 1px solid var(--ycc-border-color);
|
|
192
|
+
// border-radius: var(--ycc-radius);
|
|
193
|
+
border: none;
|
|
194
|
+
background-color: var(--ycc-bg-color);
|
|
195
|
+
}
|
|
196
|
+
.reply-comment .comment-box {
|
|
197
|
+
// background-color: var(--ycc-bg-secondary);
|
|
198
|
+
}
|
|
199
|
+
.header {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: baseline;
|
|
202
|
+
gap: var(--ycc-spacing-s);
|
|
203
|
+
margin-bottom: var(--ycc-spacing-s);
|
|
204
|
+
font-size: 0.9em;
|
|
205
|
+
color: var(--ycc-text-secondary);
|
|
206
|
+
flex-wrap: wrap;
|
|
207
|
+
}
|
|
208
|
+
.author {
|
|
209
|
+
font-weight: bold;
|
|
210
|
+
color: var(--ycc-text-color);
|
|
211
|
+
font-size: 1.1em;
|
|
212
|
+
}
|
|
213
|
+
.badge {
|
|
214
|
+
background-color: var(--ycc-primary-color);
|
|
215
|
+
color: var(--ycc-bg-color);
|
|
216
|
+
border-radius: var(--ycc-radius);
|
|
217
|
+
padding: 2px var(--ycc-spacing-xs);
|
|
218
|
+
font-size: 0.8em;
|
|
219
|
+
}
|
|
220
|
+
.date-relative {
|
|
221
|
+
font-size: 0.9em;
|
|
222
|
+
}
|
|
223
|
+
.date-absolute {
|
|
224
|
+
display: none;
|
|
225
|
+
font-size: 0.9em;
|
|
226
|
+
}
|
|
227
|
+
.comment-id {
|
|
228
|
+
display: none;
|
|
229
|
+
font-size: 0.9em;
|
|
230
|
+
}
|
|
231
|
+
.header:hover .comment-id {
|
|
232
|
+
display: block;
|
|
233
|
+
opacity: 0.6;
|
|
234
|
+
}
|
|
235
|
+
.header:hover .date-absolute {
|
|
236
|
+
display: block;
|
|
237
|
+
opacity: 0.6;
|
|
238
|
+
}
|
|
239
|
+
.comment-reply-to {
|
|
240
|
+
display: none;
|
|
241
|
+
font-size: 0.9em;
|
|
242
|
+
}
|
|
243
|
+
.header:hover .comment-reply-to {
|
|
244
|
+
display: block;
|
|
245
|
+
opacity: 0.6;
|
|
246
|
+
}
|
|
247
|
+
.content {
|
|
248
|
+
margin: 0;
|
|
249
|
+
line-height: 1.6;
|
|
250
|
+
white-space: pre-wrap;
|
|
251
|
+
word-break: break-word;
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
transition: max-height 0.3s ease-out;
|
|
254
|
+
}
|
|
255
|
+
.content.collapsed {
|
|
256
|
+
max-height: 10em;
|
|
257
|
+
position: relative;
|
|
258
|
+
}
|
|
259
|
+
.content.collapsed::after {
|
|
260
|
+
content: '';
|
|
261
|
+
position: absolute;
|
|
262
|
+
bottom: 0;
|
|
263
|
+
left: 0;
|
|
264
|
+
width: 100%;
|
|
265
|
+
height: 3em;
|
|
266
|
+
background: linear-gradient(transparent, var(--ycc-bg-color));
|
|
267
|
+
pointer-events: none;
|
|
268
|
+
}
|
|
269
|
+
.show-more-btn {
|
|
270
|
+
margin-top: var(--ycc-spacing-xs);
|
|
271
|
+
color: var(--ycc-primary-color);
|
|
272
|
+
font-weight: 500;
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
padding: 2px 0;
|
|
275
|
+
font-size: 0.9em;
|
|
276
|
+
background: none;
|
|
277
|
+
border: none;
|
|
278
|
+
}
|
|
279
|
+
.show-more-btn:hover {
|
|
280
|
+
color: var(--ycc-primary-hover);
|
|
281
|
+
text-decoration: underline;
|
|
282
|
+
background: none;
|
|
283
|
+
}
|
|
284
|
+
.content p {
|
|
285
|
+
margin: 0.5em 0;
|
|
286
|
+
}
|
|
287
|
+
.content a {
|
|
288
|
+
color: var(--ycc-primary-color);
|
|
289
|
+
text-decoration: underline;
|
|
290
|
+
}
|
|
291
|
+
.content a:hover {
|
|
292
|
+
color: var(--ycc-primary-hover);
|
|
293
|
+
}
|
|
294
|
+
.content img {
|
|
295
|
+
max-width: 80%;
|
|
296
|
+
height: auto;
|
|
297
|
+
border-radius: var(--ycc-radius);
|
|
298
|
+
display: block;
|
|
299
|
+
margin: var(--ycc-spacing-s) 0;
|
|
300
|
+
}
|
|
301
|
+
.content code {
|
|
302
|
+
background-color: var(--ycc-bg-secondary);
|
|
303
|
+
padding: 2px 4px;
|
|
304
|
+
border-radius: 4px;
|
|
305
|
+
font-family: var(--ycc-font-monospace);
|
|
306
|
+
font-size: 0.9em;
|
|
307
|
+
}
|
|
308
|
+
.content pre {
|
|
309
|
+
background-color: var(--ycc-bg-secondary);
|
|
310
|
+
padding: var(--ycc-spacing-s);
|
|
311
|
+
border-radius: var(--ycc-radius);
|
|
312
|
+
overflow-x: auto;
|
|
313
|
+
margin: var(--ycc-spacing-s) 0;
|
|
314
|
+
}
|
|
315
|
+
.content pre code {
|
|
316
|
+
padding: 0;
|
|
317
|
+
background-color: transparent;
|
|
318
|
+
display: block;
|
|
319
|
+
}
|
|
320
|
+
.content ul,
|
|
321
|
+
.content ol {
|
|
322
|
+
padding-left: var(--ycc-spacing-l);
|
|
323
|
+
margin: var(--ycc-spacing-s) 0;
|
|
324
|
+
}
|
|
325
|
+
.content li {
|
|
326
|
+
margin: 0.2em 0;
|
|
327
|
+
}
|
|
328
|
+
.content hr {
|
|
329
|
+
border: none;
|
|
330
|
+
border-top: 1px solid var(--ycc-border-color);
|
|
331
|
+
margin: var(--ycc-spacing-m) 0;
|
|
332
|
+
}
|
|
333
|
+
.content blockquote {
|
|
334
|
+
border-left: 4px solid var(--ycc-border-color);
|
|
335
|
+
margin: var(--ycc-spacing-s) 0;
|
|
336
|
+
padding-left: var(--ycc-spacing-m);
|
|
337
|
+
color: var(--ycc-text-secondary);
|
|
338
|
+
}
|
|
339
|
+
.content strong {
|
|
340
|
+
font-weight: bold;
|
|
341
|
+
}
|
|
342
|
+
.content em {
|
|
343
|
+
font-style: italic;
|
|
344
|
+
}
|
|
345
|
+
.content h6 {
|
|
346
|
+
font-size: 1em;
|
|
347
|
+
margin: var(--ycc-spacing-s) 0;
|
|
348
|
+
font-weight: bold;
|
|
349
|
+
}
|
|
350
|
+
.actions {
|
|
351
|
+
gap: var(--ycc-spacing-s);
|
|
352
|
+
display: flex;
|
|
353
|
+
margin-top: var(--ycc-spacing-s);
|
|
354
|
+
// justify-content: flex-end;
|
|
355
|
+
opacity: 0.7;
|
|
356
|
+
}
|
|
357
|
+
.reply-comments {
|
|
358
|
+
margin-left: var(--ycc-spacing-l);
|
|
359
|
+
// margin-top: var(--ycc-spacing-s);
|
|
360
|
+
padding-left: var(--ycc-spacing-s);
|
|
361
|
+
border-left: 4px solid var(--ycc-border-color);
|
|
362
|
+
}
|
|
363
|
+
`],yr(ir,1,Ar);const Cr=["Brilliant","Elegant","Majestic","Serene","Vibrant","Graceful","Radiant","Mystical","Noble","Charming","Delicate","Gentle","Luminous","Peaceful","Quick","Resilient","Sparkling","Tranquil","Vivid","Wise","Brave","Creative","Dynamic","Enigmatic","Fantastic","Golden","Harmonious","Inspiring","Joyful","Keen","Lively","Magnificent","Natural","Optimistic","Precious","Quiet","Remarkable","Stunning","Thoughtful","Uplifting","Wonderful","Adventurous","Balanced","Confident","Determined","Energetic","Fearless","Gracious","Innovative","Jubilant","Kind","Loyal","Marvelous","Amazing","Bright","Cheerful","Curious","Excited","Fresh","Happy","Intelligent","Jovial","Lovely","Merry","Nimble","Pleasant","Resourceful","Spirited","Talented","Versatile","Warm","Youthful","Active","Agile","Alert","Artistic","Athletic","Authentic","Blissful","Buoyant","Calm","Capable","Caring","Clever","Compassionate","Cool","Courageous","Dazzling","Dedicated","Diligent","Earnest","Efficient","Enthusiastic","Exceptional","Expressive","Fabulous","Faithful","Focused","Friendly","Generous","Gifted","Glorious","Helpful","Honest","Hopeful","Humorous","Independent","Inventive","Lighthearted","Lucky","Mindful","Modest","Motivating","Nurturing","Original","Outgoing","Patient","Playful","Polite","Positive","Proud","Pure","Reliable","Responsible","Sincere","Smart","Smooth","Sociable","Spontaneous","Successful","Sweet","Tender","Trusting","Understanding","Unique","Valuable","Virtuous","Wholesome","Witty"],Tr=["Falcon","Phoenix","Dragon","Eagle","Tiger","Lion","Wolf","Bear","Deer","Fox","Hawk","Raven","Swan","Dove","Owl","Butterfly","Rose","Lily","Orchid","Jasmine","Cedar","Oak","Pine","Willow","Maple","Mountain","River","Ocean","Moon","Sun","Cloud","Thunder","Rainbow","Diamond","Ruby","Emerald","Sapphire","Pearl","Crystal","Gold","Silver","Amber","Flame","Breeze","Storm","Mist","Dawn","Dusk","Aurora","Comet","Galaxy","Nebula","Shield","Crown","Gem","Prism","Panda","Koala","Giraffe","Zebra","Leopard","Cheetah","Otter","Dolphin","Whale","Penguin","Rabbit","Squirrel","Hedgehog","Badger","Moose","Camel","Horse","Donkey","Sheep","Goat","Cow","Chicken","Duck","Goose","Turkey","Peacock","Parrot","Canary","Finch","Sparrow","Crane","Stork","Flamingo","Pelican","Shrimp","Crab","Lobster","Octopus","Squid","Walrus","Mole","Ferret","Hamster","Chinchilla","GuineaPig","Lemur","Tapir","Buffalo","Bison","Yak","Ibex","Gazelle","Porcupine","Armadillo","Sloth","Opossum","Platypus","Wombat","Kangaroo","Wallaby","Emu","Cassowary","Orangutan","Gibbon","Chimpanzee","Baboon","Macaque","Lynx","Puma","Jaguar","Cougar","Bobcat","Ocelot","RedPanda","Raccoon","Weasel","Stoat","Ermine","Wolverine","Marten","Jay","Magpie","Rook","Swallow","Swift","Cuckoo","Coot","Grebe","Heron","Egret","Ibis","Gull","Tern","Salmon","Trout","Bass","Cod","Tuna","Ray","Carp","Perch","Catfish","Eel","Pike","Snapper","Bream","Tilapia","Goby","Mullet","Loach","Bamboo","Cactus","Fern","Moss","Palm","Birch","Aspen","Beech","Hazel","Elm","Poplar","Magnolia","Azalea","Gardenia","Hibiscus","Wisteria","Dahlia","Peony","Marigold","Sunflower","Daisy","Violet","Pansy","Begonia","Petunia","Zinnia","Cosmos","Aster","Bluebell","Foxglove","Primrose","Buttercup","Clover","Heather","Lavender","Basil","Rosemary","Thyme","Sage","Parsley","Dill","Fennel","Chive","Oregano","Lotus","Taro","Mushroom","Truffle","Morel","Shiitake","Moth","Dragonfly","Bee","Ant","Termite","Beetle","Ladybug","Firefly","Cicada","Grasshopper","Cricket","Katydid","Locust","Mantis","Earwig","Silverfish","Mayfly","Stonefly","Aphid","Whitefly","Apple","Banana","Orange","Lemon","Lime","Grape","Cherry","Peach","Plum","Pear","Mango","Papaya","Pineapple","Guava","Lychee","Longan","Rambutan","Coconut","Date","Fig","Gooseberry","Blackberry","Blueberry","Raspberry","Strawberry","Cranberry","Currant","Melon","Pumpkin","Squash","Zucchini","Bread","Bagel","Baguette","Croissant","Pretzel","Bun","Roll","Muffin","Cake","Pie","Tart","Cookie","Biscuit","Doughnut","Pancake","Waffle","Crepe","Sandwich","Burger","Pizza","Pasta","Spaghetti","Macaroni","Lasagna","Ravioli","Noodle","Ramen","Udon","Soba","Pho","Dumpling","Wonton","Bao","Sushi","Tempura","Rice","Soup","Stew","Curry","Grill","Roast","Fry","Steam","Boil","Jam","Honey","Butter","Cheese","Cream","Custard","Pudding","IceCream","Sorbet","Milk","Juice","Tea","Coffee","Cocoa","Candy","Mint","Gum","Book","Pen","Pencil","Eraser","Ruler","Scissors","Glue","Paper","Notebook","Bag","Wallet","Key","Lock","Watch","Lamp","Mirror","Brush","Comb","Towel","Soap","Cup","Mug","Bottle","Glass","Plate","Bowl","Spoon","Fork","Tray","Box","Can","Jar","Bin","Pan","Pot","Kettle","Oven","Fan","Phone","Tablet","Laptop","Keyboard","Camera","Radio","TV","Charger","Cable","Plug","Adapter","Battery","Umbrella","Hat","Cap","Scarf","Glove","Sock","Shoe","Boot","Belt","Coat","Jacket","Shirt","Pants","Shorts","Skirt","Dress","Suit","Tie","Mask","Apron","Blanket","Pillow","Chair","Table","Desk","Shelf","Drawer","Cabinet","Door","Window","Wall","Floor","Roof","Stair","Road","Park","Garden","Fence","Gate","Mailbox","Sign","Poster","Flag","Balloon","Kite","Toy","Puzzle","Game","Dice","Card","Coin","Medal","Trophy","Badge","Sticker","Patch","Pin","Ring","Necklace","Bracelet","Earring","Charm","Pendant","Chain","Clip","Hook","Button","Zip","String","Rope","Wire","Band","Tape","Ribbon","Thread","Needle","Thimble","Wrench","Pliers","Level","Map","Globe","Chart","Graph","List","Note","Memo","Label","Tag","Ticket","Pass","Receipt","Bill","Form","Report","File","Folder","Envelope","Stamp","Seal","Circle","Oval","Square","Star","Heart","Arrow","Dot","Line","Wave","Curve","Point","Edge","Corner","Block","Brick","Tile","Panel","Board","Beam","Pole","Rod","Bar","Tube","Pipe","Valve","Tap","Pump","Motor","Gear","Wheel","Axle","Spring","Lever","Handle","Knob","Switch","Dial","Latch","Bolt","Hinge","Frame","Base","Stand","Holder","Mount","Elastic","Rubber","Plastic","Metal","Wood","Stone","Clay","Sand","Soil","Mud","Dust","Salt","Sugar","Oil","Vinegar","Sauce","Paste","Syrup","Fudge","Toffee","Marshmallow","Nougat","Lollipop","Popsicle","Slush","Jellybean"];async function zr(e){const t=(e||"").trim();if(0===t.length)return{pseudonym:"",hash:""};const n=await async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}(t),{adjective:r,noun:i}=function(e){const t=parseInt(e.substring(0,8),16)%Cr.length,n=parseInt(e.substring(8,16),16)%Tr.length;return{adjective:Cr[t],noun:Tr[n]}}(n);return{pseudonym:`${r} ${i}`,hash:n}}var Pr,Or,Mr,Ir,Nr,Rr,Lr,Dr,jr,Ur,Fr,Zr,Br,Wr,Hr,Gr,qr,Jr,Vr,Xr=Object.create,Yr=Object.defineProperty,Kr=Object.getOwnPropertyDescriptor,Qr=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ei=e=>{throw TypeError(e)},ti=(e,t)=>Yr(e,"name",{value:t,configurable:!0}),ni=["class","method","getter","setter","accessor","field","value","get","set"],ri=e=>void 0!==e&&"function"!=typeof e?ei("Function expected"):e,ii=(e,t,n,r,i)=>({kind:ni[e],name:t,metadata:r,addInitializer:e=>n._?ei("Already initialized"):i.push(ri(e||null))}),si=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},oi=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=ni[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&Kr(h<4?i:{get[n](){return li(this,s)},set[n](e){return hi(this,s,e)}},n));h?p&&h<4&&ti(s,(h>2?"set ":h>1?"get ":"")+n):ti(i,n);for(var v=r.length-1;v>=0;v--)l=ii(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>ci(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?li:di)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>hi(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?ri(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?ei("Object expected"):(ri(o=a.get)&&(b.get=o),ri(o=a.set)&&(b.set=o),ri(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=Qr("metadata"),i=e[3],r in n?Yr(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&Yr(i,n,b),p?4^h?s:b:i},ai=(e,t,n)=>t.has(e)||ei("Cannot "+n),ci=(e,t)=>Object(t)!==t?ei('Cannot use the "in" operator on this value'):e.has(t),li=(e,t,n)=>(ai(e,t,"read from private field"),n?n.call(e):t.get(e)),ui=(e,t,n)=>t.has(e)?ei("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),hi=(e,t,n,r)=>(ai(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),di=(e,t,n)=>(ai(e,t,"access private method"),n);Ur=[oe("comment-input")];let pi=class e extends(jr=ie,Dr=[le({type:String})],Lr=[le({type:String})],Rr=[le({type:String})],Nr=[le({type:String})],Ir=[le({type:Boolean})],Mr=[ue()],Or=[ue()],Pr=[ue()],jr){constructor(){super(...arguments),ui(this,Zr,si(Fr,8,this,"")),si(Fr,11,this),ui(this,Br,si(Fr,12,this,"")),si(Fr,15,this),ui(this,Wr,si(Fr,16,this,"")),si(Fr,19,this),ui(this,Hr,si(Fr,20,this,"")),si(Fr,23,this),ui(this,Gr,si(Fr,24,this,!1)),si(Fr,27,this),ui(this,qr,si(Fr,28,this,!1)),si(Fr,31,this),ui(this,Jr,si(Fr,32,this,null)),si(Fr,35,this),ui(this,Vr,si(Fr,36,this,"")),si(Fr,39,this)}render(){return F`
|
|
364
|
+
<div class="comment-input-container">
|
|
365
|
+
<div class="message-row">
|
|
366
|
+
${this.isPreview&&this.previewComment?F`<div class="preview-container">
|
|
367
|
+
<comment-list-item
|
|
368
|
+
.comment=${this.previewComment}
|
|
369
|
+
.author=${this.adminName}
|
|
370
|
+
></comment-list-item>
|
|
371
|
+
</div>`:F`<div class="draft-container">
|
|
372
|
+
<textarea
|
|
373
|
+
part="textarea"
|
|
374
|
+
.value=${this.draft}
|
|
375
|
+
@input=${this.handleDraftInput}
|
|
376
|
+
placeholder=${Yn("messagePlaceholder")}
|
|
377
|
+
aria-label=${Yn("messagePlaceholder")}
|
|
378
|
+
aria-describedby="message-counter"
|
|
379
|
+
maxlength=${e.MAX_MESSAGE_LENGTH}
|
|
380
|
+
></textarea>
|
|
381
|
+
<div class="char-counter message-counter" id="message-counter" aria-live="polite">
|
|
382
|
+
${this.draft.length}/${e.MAX_MESSAGE_LENGTH}
|
|
383
|
+
</div>
|
|
384
|
+
<input
|
|
385
|
+
type="email"
|
|
386
|
+
name="email"
|
|
387
|
+
class="input-email"
|
|
388
|
+
.value=${this.honeypot}
|
|
389
|
+
@input=${this.handleHoneypotInput}
|
|
390
|
+
tabindex="-1"
|
|
391
|
+
aria-hidden="true"
|
|
392
|
+
autocomplete="off"
|
|
393
|
+
/>
|
|
394
|
+
</div>`}
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<div class="controls-row">
|
|
398
|
+
<div class="nickname-wrapper">
|
|
399
|
+
<input
|
|
400
|
+
part="nickname"
|
|
401
|
+
class="nickname-input"
|
|
402
|
+
.value=${this.isAdmin?"Admin":this.nickname}
|
|
403
|
+
@input=${this.handleNicknameInput}
|
|
404
|
+
type="text"
|
|
405
|
+
placeholder=${Yn("nicknamePlaceholder")}
|
|
406
|
+
aria-label=${Yn("nicknamePlaceholder")}
|
|
407
|
+
aria-describedby="nickname-counter"
|
|
408
|
+
?disabled=${this.isPreview||this.isAdmin}
|
|
409
|
+
maxlength=${e.MAX_NICKNAME_LENGTH}
|
|
410
|
+
/>
|
|
411
|
+
<span class="char-counter" id="nickname-counter" aria-live="polite">
|
|
412
|
+
${this.nickname.length}/${e.MAX_NICKNAME_LENGTH}
|
|
413
|
+
</span>
|
|
414
|
+
</div>
|
|
415
|
+
<div class="actions">
|
|
416
|
+
<button
|
|
417
|
+
part="btn-preview"
|
|
418
|
+
class="secondary"
|
|
419
|
+
@click=${this.handleTogglePreview}
|
|
420
|
+
?disabled=${!this.isValidComment()}
|
|
421
|
+
>
|
|
422
|
+
${this.isPreview?Yn("edit"):Yn("preview")}
|
|
423
|
+
</button>
|
|
424
|
+
<button
|
|
425
|
+
part="btn-submit"
|
|
426
|
+
@click=${this.handleSubmit}
|
|
427
|
+
?disabled=${!this.isValidComment()}
|
|
428
|
+
>
|
|
429
|
+
${Yn("submit")}
|
|
430
|
+
</button>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
434
|
+
`}async createPreviewComment(){let e;return e=this.editPseudonym?this.editPseudonym:this.nickname.trim()?(await zr(this.nickname)).pseudonym:Yn("anonymous"),{msg:this.draft,pseudonym:e,pubDate:Date.now(),id:"preview_",isAdmin:this.isAdmin}}isValidComment(){const t=this.draft.trim().length,n=this.nickname.trim().length,r=t>0&&t<=e.MAX_MESSAGE_LENGTH,i=n<=e.MAX_NICKNAME_LENGTH;return r&&i}async handleTogglePreview(){this.isPreview=!this.isPreview,this.isPreview&&(this.previewComment=await this.createPreviewComment())}handleDraftInput(t){const n=t.target;this.draft=n.value.slice(0,e.MAX_MESSAGE_LENGTH),this.dispatchEvent(new CustomEvent("draft-change",{detail:this.draft,bubbles:!0,composed:!0}))}handleNicknameInput(t){const n=t.target;this.nickname=n.value.slice(0,e.MAX_NICKNAME_LENGTH),this.dispatchEvent(new CustomEvent("nickname-change",{detail:this.nickname,bubbles:!0,composed:!0}))}handleHoneypotInput(e){const t=e.target;this.honeypot=t.value}handleSubmit(){""===this.honeypot&&(this.isPreview=!1,this.previewComment=null,this.dispatchEvent(new CustomEvent("comment-submit",{bubbles:!0,composed:!0})))}};Fr=(e=>[,,,Xr(e?.[Qr("metadata")]??null)])(jr),Zr=new WeakMap,Br=new WeakMap,Wr=new WeakMap,Hr=new WeakMap,Gr=new WeakMap,qr=new WeakMap,Jr=new WeakMap,Vr=new WeakMap,oi(Fr,4,"draft",Dr,pi,Zr),oi(Fr,4,"nickname",Lr,pi,Br),oi(Fr,4,"editPseudonym",Rr,pi,Wr),oi(Fr,4,"adminName",Nr,pi,Hr),oi(Fr,4,"isAdmin",Ir,pi,Gr),oi(Fr,4,"isPreview",Mr,pi,qr),oi(Fr,4,"previewComment",Or,pi,Jr),oi(Fr,4,"honeypot",Pr,pi,Vr),pi=oi(Fr,0,"CommentInput",Ur,pi),pi.shadowRootOptions={...ie.shadowRootOptions,delegatesFocus:!0},pi.styles=[pe,s`
|
|
435
|
+
:host {
|
|
436
|
+
display: block;
|
|
437
|
+
// margin-bottom: var(--ycc-spacing-m);
|
|
438
|
+
}
|
|
439
|
+
.comment-input-container {
|
|
440
|
+
// border: 1px solid var(--ycc-border-color);
|
|
441
|
+
// border-radius: var(--ycc-radius);
|
|
442
|
+
// padding: var(--ycc-spacing-s);
|
|
443
|
+
// background-color: var(--ycc-bg-color);
|
|
444
|
+
}
|
|
445
|
+
.draft-container {
|
|
446
|
+
display: flex;
|
|
447
|
+
flex-direction: column;
|
|
448
|
+
gap: var(--ycc-spacing-s);
|
|
449
|
+
padding: var(--ycc-spacing-s);
|
|
450
|
+
}
|
|
451
|
+
textarea {
|
|
452
|
+
// margin: var(--ycc-spacing-s);
|
|
453
|
+
min-height: 100px;
|
|
454
|
+
resize: vertical;
|
|
455
|
+
border: none;
|
|
456
|
+
resize: none;
|
|
457
|
+
background-color: var(--ycc-bg-color);
|
|
458
|
+
scrollbar-width: thin;
|
|
459
|
+
scrollbar-color: var(--ycc-border-color) transparent;
|
|
460
|
+
}
|
|
461
|
+
textarea::-webkit-scrollbar {
|
|
462
|
+
width: 6px;
|
|
463
|
+
}
|
|
464
|
+
textarea::-webkit-scrollbar-track {
|
|
465
|
+
background: transparent;
|
|
466
|
+
}
|
|
467
|
+
textarea::-webkit-scrollbar-thumb {
|
|
468
|
+
background-color: var(--ycc-border-color);
|
|
469
|
+
border-radius: 3px;
|
|
470
|
+
}
|
|
471
|
+
textarea::-webkit-scrollbar-thumb:hover {
|
|
472
|
+
background-color: var(--ycc-text-secondary);
|
|
473
|
+
}
|
|
474
|
+
textarea::placeholder,
|
|
475
|
+
input::placeholder {
|
|
476
|
+
color: var(--ycc-placeholder-color);
|
|
477
|
+
opacity: 1;
|
|
478
|
+
}
|
|
479
|
+
.actions {
|
|
480
|
+
display: flex;
|
|
481
|
+
justify-content: flex-end;
|
|
482
|
+
gap: var(--ycc-spacing-s);
|
|
483
|
+
}
|
|
484
|
+
.message-row {
|
|
485
|
+
border: 1px solid var(--ycc-border-color);
|
|
486
|
+
border-bottom: none;
|
|
487
|
+
border-radius: var(--ycc-radius) var(--ycc-radius) 0 0;
|
|
488
|
+
min-height: calc(100px + 2 * var(--ycc-spacing-s));
|
|
489
|
+
}
|
|
490
|
+
.controls-row {
|
|
491
|
+
border: 1px solid var(--ycc-border-color);
|
|
492
|
+
border-radius: 0 0 var(--ycc-radius) var(--ycc-radius);
|
|
493
|
+
display: flex;
|
|
494
|
+
justify-content: space-between;
|
|
495
|
+
gap: var(--ycc-spacing-s);
|
|
496
|
+
padding: var(--ycc-spacing-s);
|
|
497
|
+
}
|
|
498
|
+
.nickname-input {
|
|
499
|
+
flex: 1;
|
|
500
|
+
border: none;
|
|
501
|
+
outline: none;
|
|
502
|
+
background-color: var(--ycc-bg-color);
|
|
503
|
+
// max-width: 250px;
|
|
504
|
+
}
|
|
505
|
+
.preview-container {
|
|
506
|
+
padding: var(--ycc-spacing-s);
|
|
507
|
+
comment-list-item {
|
|
508
|
+
// margin: 0;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
.nickname-wrapper {
|
|
512
|
+
flex: 1;
|
|
513
|
+
display: flex;
|
|
514
|
+
align-items: center;
|
|
515
|
+
gap: var(--ycc-spacing-s);
|
|
516
|
+
}
|
|
517
|
+
.char-counter {
|
|
518
|
+
font-size: 0.75rem;
|
|
519
|
+
color: var(--ycc-text-secondary);
|
|
520
|
+
white-space: nowrap;
|
|
521
|
+
}
|
|
522
|
+
.message-counter {
|
|
523
|
+
text-align: right;
|
|
524
|
+
}
|
|
525
|
+
.input-email {
|
|
526
|
+
position: absolute;
|
|
527
|
+
left: -9999px;
|
|
528
|
+
width: 1px;
|
|
529
|
+
height: 1px;
|
|
530
|
+
opacity: 0;
|
|
531
|
+
pointer-events: none;
|
|
532
|
+
tab-index: -1;
|
|
533
|
+
}
|
|
534
|
+
`],pi.MAX_NICKNAME_LENGTH=25,pi.MAX_MESSAGE_LENGTH=1e3,si(Fr,1,pi);var mi,fi,gi,yi,bi,vi,ki,wi,_i,xi=Object.create,$i=Object.defineProperty,Si=Object.getOwnPropertyDescriptor,Ai=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ei=e=>{throw TypeError(e)},Ci=(e,t)=>$i(e,"name",{value:t,configurable:!0}),Ti=["class","method","getter","setter","accessor","field","value","get","set"],zi=e=>void 0!==e&&"function"!=typeof e?Ei("Function expected"):e,Pi=(e,t,n,r,i)=>({kind:Ti[e],name:t,metadata:r,addInitializer:e=>n._?Ei("Already initialized"):i.push(zi(e||null))}),Oi=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},Mi=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=Ti[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&Si(h<4?i:{get[n](){return Ri(this,s)},set[n](e){return Di(this,s,e)}},n));h?p&&h<4&&Ci(s,(h>2?"set ":h>1?"get ":"")+n):Ci(i,n);for(var v=r.length-1;v>=0;v--)l=Pi(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>Ni(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?Ri:ji)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>Di(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?zi(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?Ei("Object expected"):(zi(o=a.get)&&(b.get=o),zi(o=a.set)&&(b.set=o),zi(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=Ai("metadata"),i=e[3],r in n?$i(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&$i(i,n,b),p?4^h?s:b:i},Ii=(e,t,n)=>t.has(e)||Ei("Cannot "+n),Ni=(e,t)=>Object(t)!==t?Ei('Cannot use the "in" operator on this value'):e.has(t),Ri=(e,t,n)=>(Ii(e,t,"read from private field"),n?n.call(e):t.get(e)),Li=(e,t,n)=>t.has(e)?Ei("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Di=(e,t,n,r)=>(Ii(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ji=(e,t,n)=>(Ii(e,t,"access private method"),n);bi=[oe("comment-info")];class Ui extends(yi=ie,gi=[le({type:Object})],fi=[le({type:Boolean})],mi=[le({type:String})],yi){constructor(){super(...arguments),Li(this,ki,Oi(vi,8,this,null)),Oi(vi,11,this),Li(this,wi,Oi(vi,12,this,!0)),Oi(vi,15,this),Li(this,_i,Oi(vi,16,this,"")),Oi(vi,19,this)}render(){return this.errorMessage?F`
|
|
535
|
+
<div class="info-bar error" part="info-bar info-bar-error">
|
|
536
|
+
<span class="error-msg">${this.errorMessage}</span>
|
|
537
|
+
<button class="text-btn" @click=${this.handleErrorClear}>${Yn("close")}</button>
|
|
538
|
+
</div>
|
|
539
|
+
`:F`
|
|
540
|
+
<div class="info-bar" part="info-bar">
|
|
541
|
+
${this.comment?F`
|
|
542
|
+
<div class="reference-comment-info">
|
|
543
|
+
${this.isReply?F`<span
|
|
544
|
+
>${Yn("replyingTo")}<strong
|
|
545
|
+
>${this.comment.pseudonym||Yn("anonymous")}${" #"+this.comment.id}</strong
|
|
546
|
+
></span
|
|
547
|
+
>`:F`<span>${Yn("editing")}<strong>${this.comment.id}</strong></span>`}
|
|
548
|
+
<button class="text-btn" @click=${this.handleCancel}>${Yn("cancel")}</button>
|
|
549
|
+
</div>
|
|
550
|
+
`:F`<div></div>`}
|
|
551
|
+
<div class="actions" part="actions">
|
|
552
|
+
<button class="text-btn admin-btn" @click=${this.handleAdmin}>Admin</button>
|
|
553
|
+
<button class="text-btn" @click=${this.handleNotify}>${Yn("notify")}</button>
|
|
554
|
+
<button class="text-btn" @click=${this.handleHelp}>${Yn("help")}</button>
|
|
555
|
+
</div>
|
|
556
|
+
</div>
|
|
557
|
+
`}handleAdmin(){this.dispatchEvent(new CustomEvent("admin-open",{bubbles:!0,composed:!0}))}handleHelp(){this.dispatchEvent(new CustomEvent("help-open",{bubbles:!0,composed:!0}))}handleNotify(){this.dispatchEvent(new CustomEvent("notify-open",{bubbles:!0,composed:!0}))}handleErrorClear(){this.dispatchEvent(new CustomEvent("error-clear",{bubbles:!0,composed:!0}))}handleCancel(){this.comment?.id&&this.dispatchEvent(new CustomEvent("reference-comment-cancel",{detail:this.comment.id,bubbles:!0,composed:!0}))}}vi=(e=>[,,,xi(e?.[Ai("metadata")]??null)])(yi),ki=new WeakMap,wi=new WeakMap,_i=new WeakMap,Mi(vi,4,"comment",gi,Ui,ki),Mi(vi,4,"isReply",fi,Ui,wi),Mi(vi,4,"errorMessage",mi,Ui,_i),(Ui=Mi(vi,0,"CommentInfo",bi,Ui)).styles=[pe,s`
|
|
558
|
+
:host {
|
|
559
|
+
display: block;
|
|
560
|
+
}
|
|
561
|
+
.info-bar {
|
|
562
|
+
display: flex;
|
|
563
|
+
justify-content: space-between;
|
|
564
|
+
align-items: center;
|
|
565
|
+
padding: var(--ycc-spacing-s);
|
|
566
|
+
// background-color: var(--ycc-bg-secondary);
|
|
567
|
+
// border-radius: var(--ycc-radius);
|
|
568
|
+
// margin-bottom: var(--ycc-spacing-s);
|
|
569
|
+
font-size: 0.9em;
|
|
570
|
+
}
|
|
571
|
+
.reference-comment-info {
|
|
572
|
+
display: flex;
|
|
573
|
+
align-items: center;
|
|
574
|
+
gap: var(--ycc-spacing-s);
|
|
575
|
+
}
|
|
576
|
+
.actions {
|
|
577
|
+
display: flex;
|
|
578
|
+
gap: var(--ycc-spacing-s);
|
|
579
|
+
}
|
|
580
|
+
.admin-btn {
|
|
581
|
+
opacity: 0;
|
|
582
|
+
transition: opacity 0.2s;
|
|
583
|
+
}
|
|
584
|
+
.admin-btn:hover {
|
|
585
|
+
opacity: 1;
|
|
586
|
+
}
|
|
587
|
+
.info-bar.error {
|
|
588
|
+
justify-content: flex-start;
|
|
589
|
+
gap: var(--ycc-spacing-s);
|
|
590
|
+
}
|
|
591
|
+
.error-msg {
|
|
592
|
+
color: var(--ycc-error-color);
|
|
593
|
+
}
|
|
594
|
+
`],Oi(vi,1,Ui);var Fi,Zi,Bi,Wi,Hi,Gi,qi,Ji,Vi,Xi,Yi,Ki=Object.create,Qi=Object.defineProperty,es=Object.getOwnPropertyDescriptor,ts=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ns=e=>{throw TypeError(e)},rs=(e,t)=>Qi(e,"name",{value:t,configurable:!0}),is=["class","method","getter","setter","accessor","field","value","get","set"],ss=e=>void 0!==e&&"function"!=typeof e?ns("Function expected"):e,os=(e,t,n,r,i)=>({kind:is[e],name:t,metadata:r,addInitializer:e=>n._?ns("Already initialized"):i.push(ss(e||null))}),as=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},cs=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=is[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&es(h<4?i:{get[n](){return hs(this,s)},set[n](e){return ps(this,s,e)}},n));h?p&&h<4&&rs(s,(h>2?"set ":h>1?"get ":"")+n):rs(i,n);for(var v=r.length-1;v>=0;v--)l=os(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>us(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?hs:ms)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>ps(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?ss(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?ns("Object expected"):(ss(o=a.get)&&(b.get=o),ss(o=a.set)&&(b.set=o),ss(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=ts("metadata"),i=e[3],r in n?Qi(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&Qi(i,n,b),p?4^h?s:b:i},ls=(e,t,n)=>t.has(e)||ns("Cannot "+n),us=(e,t)=>Object(t)!==t?ns('Cannot use the "in" operator on this value'):e.has(t),hs=(e,t,n)=>(ls(e,t,"read from private field"),n?n.call(e):t.get(e)),ds=(e,t,n)=>t.has(e)?ns("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ps=(e,t,n,r)=>(ls(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ms=(e,t,n)=>(ls(e,t,"access private method"),n);Gi=[oe("comment-dialog")];class fs extends(Hi=ie,Wi=[le({type:Boolean})],Bi=[le({type:String})],Zi=[he(".dialog")],Fi=[he(".close-btn")],Hi){constructor(){super(...arguments),ds(this,Ji,as(qi,8,this,!1)),as(qi,11,this),ds(this,Vi,as(qi,12,this,"")),as(qi,15,this),ds(this,Xi,as(qi,16,this)),as(qi,19,this),ds(this,Yi,as(qi,20,this)),as(qi,23,this),this.previousFocus=null,this.handleKeyDown=e=>{this.open&&("Escape"!==e.key?"Tab"===e.key&&this.trapFocus(e):this.handleClose())}}render(){return this.open?F`
|
|
595
|
+
<div class="overlay" part="overlay" @click=${this.handleOverlayClick}>
|
|
596
|
+
<div
|
|
597
|
+
class="dialog"
|
|
598
|
+
part="dialog"
|
|
599
|
+
role="dialog"
|
|
600
|
+
aria-modal="true"
|
|
601
|
+
aria-labelledby="dialog-title"
|
|
602
|
+
>
|
|
603
|
+
<button
|
|
604
|
+
part="close-btn"
|
|
605
|
+
class="close-btn"
|
|
606
|
+
@click=${this.handleClose}
|
|
607
|
+
aria-label=${Yn("close")}
|
|
608
|
+
>
|
|
609
|
+
×
|
|
610
|
+
</button>
|
|
611
|
+
<h2 id="dialog-title" part="header">${this.header}</h2>
|
|
612
|
+
<slot></slot>
|
|
613
|
+
</div>
|
|
614
|
+
</div>
|
|
615
|
+
`:null}updated(e){e.has("open")&&(this.open?(this.previousFocus=document.activeElement||null,this.addEventListeners(),setTimeout(()=>{this.closeButton?.focus()},0)):(this.removeEventListeners(),this.previousFocus&&this.previousFocus.isConnected&&this.previousFocus.focus()))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListeners()}addEventListeners(){window.addEventListener("keydown",this.handleKeyDown)}removeEventListeners(){window.removeEventListener("keydown",this.handleKeyDown)}trapFocus(e){if(!this.dialogElement)return;const t=this.dialogElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=t[0],r=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),n.focus())}handleClose(){this.dispatchEvent(new CustomEvent("close"))}handleOverlayClick(e){e.target===e.currentTarget&&this.handleClose()}}function gs(e,t){return e.slice().sort((e,n)=>t?n.pubDate-e.pubDate:e.pubDate-n.pubDate)}qi=(e=>[,,,Ki(e?.[ts("metadata")]??null)])(Hi),Ji=new WeakMap,Vi=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,cs(qi,4,"open",Wi,fs,Ji),cs(qi,4,"header",Bi,fs,Vi),cs(qi,4,"dialogElement",Zi,fs,Xi),cs(qi,4,"closeButton",Fi,fs,Yi),(fs=cs(qi,0,"CommentDialog",Gi,fs)).styles=[pe,s`
|
|
616
|
+
:host {
|
|
617
|
+
display: contents;
|
|
618
|
+
}
|
|
619
|
+
.overlay {
|
|
620
|
+
position: fixed;
|
|
621
|
+
top: 0;
|
|
622
|
+
left: 0;
|
|
623
|
+
width: 100%;
|
|
624
|
+
height: 100%;
|
|
625
|
+
background: rgba(0, 0, 0, 0.5);
|
|
626
|
+
display: flex;
|
|
627
|
+
justify-content: center;
|
|
628
|
+
align-items: center;
|
|
629
|
+
z-index: 1000;
|
|
630
|
+
}
|
|
631
|
+
.dialog {
|
|
632
|
+
color: var(--ycc-text-color);
|
|
633
|
+
background: var(--ycc-bg-color);
|
|
634
|
+
padding: var(--ycc-spacing-m);
|
|
635
|
+
border-radius: var(--ycc-radius);
|
|
636
|
+
max-width: 500px;
|
|
637
|
+
width: 90%;
|
|
638
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
639
|
+
position: relative;
|
|
640
|
+
overflow-y: auto;
|
|
641
|
+
max-height: 90vh;
|
|
642
|
+
}
|
|
643
|
+
.close-btn {
|
|
644
|
+
position: absolute;
|
|
645
|
+
top: var(--ycc-spacing-s);
|
|
646
|
+
right: var(--ycc-spacing-s);
|
|
647
|
+
background: none;
|
|
648
|
+
color: var(--ycc-text-secondary);
|
|
649
|
+
border: none;
|
|
650
|
+
cursor: pointer;
|
|
651
|
+
font-size: 1.2em;
|
|
652
|
+
}
|
|
653
|
+
.close-btn:hover {
|
|
654
|
+
color: var(--ycc-text-color);
|
|
655
|
+
background: var(--ycc-bg-secondary);
|
|
656
|
+
}
|
|
657
|
+
h2 {
|
|
658
|
+
margin-top: 0;
|
|
659
|
+
margin-bottom: var(--ycc-spacing-m);
|
|
660
|
+
}
|
|
661
|
+
`],as(qi,1,fs);var ys,bs,vs,ks,ws,_s,xs,$s=Object.create,Ss=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Es=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Cs=e=>{throw TypeError(e)},Ts=(e,t)=>Ss(e,"name",{value:t,configurable:!0}),zs=["class","method","getter","setter","accessor","field","value","get","set"],Ps=e=>void 0!==e&&"function"!=typeof e?Cs("Function expected"):e,Os=(e,t,n,r,i)=>({kind:zs[e],name:t,metadata:r,addInitializer:e=>n._?Cs("Already initialized"):i.push(Ps(e||null))}),Ms=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},Is=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=zs[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&As(h<4?i:{get[n](){return Ls(this,s)},set[n](e){return js(this,s,e)}},n));h?p&&h<4&&Ts(s,(h>2?"set ":h>1?"get ":"")+n):Ts(i,n);for(var v=r.length-1;v>=0;v--)l=Os(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>Rs(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?Ls:Us)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>js(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?Ps(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?Cs("Object expected"):(Ps(o=a.get)&&(b.get=o),Ps(o=a.set)&&(b.set=o),Ps(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=Es("metadata"),i=e[3],r in n?Ss(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&Ss(i,n,b),p?4^h?s:b:i},Ns=(e,t,n)=>t.has(e)||Cs("Cannot "+n),Rs=(e,t)=>Object(t)!==t?Cs('Cannot use the "in" operator on this value'):e.has(t),Ls=(e,t,n)=>(Ns(e,t,"read from private field"),n?n.call(e):t.get(e)),Ds=(e,t,n)=>t.has(e)?Cs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),js=(e,t,n,r)=>(Ns(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Us=(e,t,n)=>(Ns(e,t,"access private method"),n);ks=[oe("comment-list")];class Fs extends(vs=ie,bs=[le({type:Array})],ys=[le({type:String})],vs){constructor(){super(...arguments),Ds(this,_s,Ms(ws,8,this,[])),Ms(ws,11,this),Ds(this,xs,Ms(ws,12,this,"")),Ms(ws,15,this)}render(){return 0===this.comments.length?F`<p class="no-comments">${Yn("noComments")}</p>`:F`
|
|
662
|
+
<div class="reply-comments-container" role="list">
|
|
663
|
+
${gs((e=this.comments,e.filter(e=>!e.replyTo)),!0).map(e=>F`
|
|
664
|
+
<comment-list-item
|
|
665
|
+
role="listitem"
|
|
666
|
+
.comment=${e}
|
|
667
|
+
.author=${this.author}
|
|
668
|
+
.replyComments=${gs(function(e,t){if(!e)return[];if(!t)return[];if(!e.find(e=>e.id===t))return[];const n=[];return function t(r){const i=e.filter(e=>e.replyTo===r);for(const e of i)n.push(e),t(e.id)}(t),n}(this.comments,e.id),!1)}
|
|
669
|
+
></comment-list-item>
|
|
670
|
+
`)}
|
|
671
|
+
</div>
|
|
672
|
+
`;var e}}ws=(e=>[,,,$s(e?.[Es("metadata")]??null)])(vs),_s=new WeakMap,xs=new WeakMap,Is(ws,4,"comments",bs,Fs,_s),Is(ws,4,"author",ys,Fs,xs),(Fs=Is(ws,0,"CommentList",ks,Fs)).styles=[pe,s`
|
|
673
|
+
:host {
|
|
674
|
+
display: block;
|
|
675
|
+
}
|
|
676
|
+
.reply-comments-container {
|
|
677
|
+
margin-bottom: var(--ycc-spacing-m);
|
|
678
|
+
}
|
|
679
|
+
.no-comments {
|
|
680
|
+
text-align: center;
|
|
681
|
+
color: var(--ycc-text-secondary);
|
|
682
|
+
font-style: italic;
|
|
683
|
+
font-size: 0.9em;
|
|
684
|
+
}
|
|
685
|
+
`],Ms(ws,1,Fs);var Zs,Bs,Ws,Hs,Gs,qs,Js,Vs,Xs,Ys,Ks,Qs,eo,to,no,ro,io,so,oo,ao=Object.create,co=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,uo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ho=e=>{throw TypeError(e)},po=(e,t)=>co(e,"name",{value:t,configurable:!0}),mo=["class","method","getter","setter","accessor","field","value","get","set"],fo=e=>void 0!==e&&"function"!=typeof e?ho("Function expected"):e,go=(e,t,n,r,i)=>({kind:mo[e],name:t,metadata:r,addInitializer:e=>n._?ho("Already initialized"):i.push(fo(e||null))}),yo=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},bo=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=mo[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&lo(h<4?i:{get[n](){return wo(this,s)},set[n](e){return xo(this,s,e)}},n));h?p&&h<4&&po(s,(h>2?"set ":h>1?"get ":"")+n):po(i,n);for(var v=r.length-1;v>=0;v--)l=go(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>ko(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?wo:$o)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>xo(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?fo(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?ho("Object expected"):(fo(o=a.get)&&(b.get=o),fo(o=a.set)&&(b.set=o),fo(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=uo("metadata"),i=e[3],r in n?co(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&co(i,n,b),p?4^h?s:b:i},vo=(e,t,n)=>t.has(e)||ho("Cannot "+n),ko=(e,t)=>Object(t)!==t?ho('Cannot use the "in" operator on this value'):e.has(t),wo=(e,t,n)=>(vo(e,t,"read from private field"),n?n.call(e):t.get(e)),_o=(e,t,n)=>t.has(e)?ho("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xo=(e,t,n,r)=>(vo(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),$o=(e,t,n)=>(vo(e,t,"access private method"),n);Ys=[oe("comment-admin")];class So extends(Xs=ie,Vs=[ue()],Js=[ue()],qs=[ue()],Gs=[ue()],Hs=[ue()],Ws=[ue()],Bs=[ue()],Zs=[ue()],Xs){constructor(){super(...arguments),_o(this,Qs,yo(Ks,8,this,"")),yo(Ks,11,this),_o(this,eo,yo(Ks,12,this,"")),yo(Ks,15,this),_o(this,to,yo(Ks,16,this,"")),yo(Ks,19,this),_o(this,no,yo(Ks,20,this,"")),yo(Ks,23,this),_o(this,ro,yo(Ks,24,this,!1)),yo(Ks,27,this),_o(this,io,yo(Ks,28,this,!1)),yo(Ks,31,this),_o(this,so,yo(Ks,32,this,!0)),yo(Ks,35,this),_o(this,oo,yo(Ks,36,this,!1)),yo(Ks,39,this),this.handleAdminStatusUpdated=e=>{const t=e;this.hasCheckedAuthFromComments||(this.hasCheckedAuthFromComments=!0,this.isLoggedIn=t.detail,this.isCheckingAuth=!1,this.isLoggedIn&&this.handleAuthStatusChange())},this.handleSubmit=async e=>{if(e.preventDefault(),!this.username||!this.password)return this.errorMessage="Please enter username and password",void(this.successMessage="");if(this.isLoading=!0,this.errorMessage="",this.successMessage="",!me.isInitialized())return this.errorMessage="API service not available",void(this.isLoading=!1);try{const e=await me.getInstance().adminLogin(this.username,this.password);e?(this.successMessage=e.message||"Login successful",this.username="",this.password="",this.isLoggedIn=!0,this.handleAuthStatusChange()):this.errorMessage="Login failed"}catch(e){this.errorMessage=`Error (${e}). Please try again.`}finally{this.isLoading=!1}},this.handleLogout=async()=>{if(me.isInitialized()){this.isLoading=!0,this.errorMessage="",this.successMessage="";try{await me.getInstance().adminLogout()?(this.successMessage="Logged out successfully",this.isLoggedIn=!1,this.handleAuthStatusChange()):this.errorMessage="Logout failed"}catch(e){this.errorMessage=`Error (${e}). Please try again.`}finally{this.isLoading=!1}}else this.errorMessage="API service not available"},this.handleUsernameChange=e=>{const t=e.target;this.username=t.value},this.handlePasswordChange=e=>{const t=e.target;this.password=t.value},this.handleAuthStatusChange=()=>{this.dispatchEvent(new CustomEvent("auth-status-change",{detail:this.isLoggedIn,bubbles:!0,composed:!0}))}}render(){return this.isCheckingAuth?F`<div>Checking authentication status...</div>`:this.isLoggedIn?this.renderAdminPanel():this.renderLoginForm()}async connectedCallback(){super.connectedCallback(),this.addEventListener("admin-status-updated",this.handleAdminStatusUpdated),setTimeout(()=>{this.hasCheckedAuthFromComments||this.checkAuthStatus()},2e3)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("admin-status-updated",this.handleAdminStatusUpdated)}updateAuthStatus(e){this.hasCheckedAuthFromComments||(this.hasCheckedAuthFromComments=!0,this.isLoggedIn=e,this.isCheckingAuth=!1,this.isLoggedIn&&this.handleAuthStatusChange())}renderLoginForm(){return F`
|
|
686
|
+
<form @submit=${this.handleSubmit}>
|
|
687
|
+
<div class="form-group">
|
|
688
|
+
<label for="username">Username</label>
|
|
689
|
+
<input
|
|
690
|
+
type="text"
|
|
691
|
+
id="username"
|
|
692
|
+
.value=${this.username}
|
|
693
|
+
@change=${this.handleUsernameChange}
|
|
694
|
+
?disabled=${this.isLoading}
|
|
695
|
+
required
|
|
696
|
+
/>
|
|
697
|
+
</div>
|
|
698
|
+
<div class="form-group">
|
|
699
|
+
<label for="password">Password</label>
|
|
700
|
+
<input
|
|
701
|
+
type="password"
|
|
702
|
+
id="password"
|
|
703
|
+
.value=${this.password}
|
|
704
|
+
@change=${this.handlePasswordChange}
|
|
705
|
+
?disabled=${this.isLoading}
|
|
706
|
+
required
|
|
707
|
+
/>
|
|
708
|
+
</div>
|
|
709
|
+
<button type="submit" ?disabled=${this.isLoading}>
|
|
710
|
+
${this.isLoading?"Logging in...":"Login"}
|
|
711
|
+
</button>
|
|
712
|
+
</form>
|
|
713
|
+
|
|
714
|
+
<div class="message error ${this.errorMessage?"show":""}">${this.errorMessage}</div>
|
|
715
|
+
|
|
716
|
+
<div class="message success ${this.successMessage?"show":""}">${this.successMessage}</div>
|
|
717
|
+
`}renderAdminPanel(){return F`
|
|
718
|
+
<div>
|
|
719
|
+
<p>You are logged in as admin</p>
|
|
720
|
+
<button @click=${this.handleLogout} ?disabled=${this.isLoading}>
|
|
721
|
+
${this.isLoading?"Logging out...":"Logout"}
|
|
722
|
+
</button>
|
|
723
|
+
|
|
724
|
+
<div class="message error ${this.errorMessage?"show":""}">${this.errorMessage}</div>
|
|
725
|
+
<div class="message success ${this.successMessage?"show":""}">
|
|
726
|
+
${this.successMessage}
|
|
727
|
+
</div>
|
|
728
|
+
</div>
|
|
729
|
+
`}async checkAuthStatus(){if(me.isInitialized())try{this.isLoggedIn=await me.getInstance().checkAdminAuth(),this.isLoggedIn&&this.handleAuthStatusChange()}catch(e){console.error("Failed to check auth status:",e),this.isLoggedIn=!1}finally{this.isCheckingAuth=!1}else this.isCheckingAuth=!1}}function Ao(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const i=o.prototype,s=Object.keys(i);for(let e=0;e<s.length;e++){const t=s[e];t in n||(n[t]=i[t].bind(n))}}const i=n?.Parent??Object;class s extends i{}function o(e){var t;const i=n?.Parent?new s:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(const e of i._zod.deferred)e();return i}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}Ks=(e=>[,,,ao(e?.[uo("metadata")]??null)])(Xs),Qs=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ro=new WeakMap,io=new WeakMap,so=new WeakMap,oo=new WeakMap,bo(Ks,4,"username",Vs,So,Qs),bo(Ks,4,"password",Js,So,eo),bo(Ks,4,"errorMessage",qs,So,to),bo(Ks,4,"successMessage",Gs,So,no),bo(Ks,4,"isLoading",Hs,So,ro),bo(Ks,4,"isLoggedIn",Ws,So,io),bo(Ks,4,"isCheckingAuth",Bs,So,so),bo(Ks,4,"hasCheckedAuthFromComments",Zs,So,oo),(So=bo(Ks,0,"CommentAdmin",Ys,So)).styles=[pe,s`
|
|
730
|
+
:host {
|
|
731
|
+
display: block;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.form-group {
|
|
735
|
+
margin-bottom: var(--ycc-spacing-m);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
label {
|
|
739
|
+
display: block;
|
|
740
|
+
margin-bottom: var(--ycc-spacing-s);
|
|
741
|
+
font-weight: 500;
|
|
742
|
+
color: var(--ycc-text-color);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
input[type='text'],
|
|
746
|
+
input[type='password'] {
|
|
747
|
+
width: 100%;
|
|
748
|
+
padding: var(--ycc-spacing-s);
|
|
749
|
+
border: 1px solid var(--ycc-border-color);
|
|
750
|
+
border-radius: var(--ycc-radius);
|
|
751
|
+
font-family: inherit;
|
|
752
|
+
font-size: var(--ycc-font-size);
|
|
753
|
+
box-sizing: border-box;
|
|
754
|
+
transition: border-color 0.2s;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
input[type='text']:focus,
|
|
758
|
+
input[type='password']:focus {
|
|
759
|
+
outline: none;
|
|
760
|
+
border-color: var(--ycc-primary-color);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
button[type='submit'] {
|
|
764
|
+
width: 100%;
|
|
765
|
+
padding: var(--ycc-spacing-s) var(--ycc-spacing-m);
|
|
766
|
+
margin-top: var(--ycc-spacing-s);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.message {
|
|
770
|
+
margin-top: var(--ycc-spacing-m);
|
|
771
|
+
padding: var(--ycc-spacing-s);
|
|
772
|
+
border-radius: var(--ycc-radius);
|
|
773
|
+
text-align: center;
|
|
774
|
+
display: none;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
.message.show {
|
|
778
|
+
display: block;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.message.error {
|
|
782
|
+
background-color: #fee;
|
|
783
|
+
border: 1px solid #fcc;
|
|
784
|
+
color: var(--ycc-error-color);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.message.success {
|
|
788
|
+
background-color: #efe;
|
|
789
|
+
border: 1px solid #cfc;
|
|
790
|
+
color: #22c55e;
|
|
791
|
+
}
|
|
792
|
+
`],yo(Ks,1,So);class Eo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Co extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const To={};function zo(e){return To}function Po(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Oo(e,t){return"bigint"==typeof t?t.toString():t}function Mo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Io(e){return null==e}function No(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ro=Symbol("evaluating");function Lo(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ro)return void 0===r&&(r=Ro,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Do(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function jo(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Uo(e){return JSON.stringify(e)}const Fo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zo(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Bo=Mo(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Wo(e){if(!1===Zo(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Zo(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ho(e){return Wo(e)?{...e}:Array.isArray(e)?[...e]:e}const Go=new Set(["string","number","symbol"]);function qo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vo(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const Xo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Yo(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Ko(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Qo(e){return"string"==typeof e?e:e?.message}function ea(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Qo(e.inst?._zod.def?.error?.(e))??Qo(t?.error?.(e))??Qo(n.customError?.(e))??Qo(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ta(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function na(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ra=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Oo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ia=Ao("$ZodError",ra),sa=Ao("$ZodError",ra,{Parent:Error}),oa=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Eo;if(o.issues.length){const t=new(i?.Err??e)(o.issues.map(e=>ea(e,s,zo())));throw Fo(t,i?.callee),t}return o.value},aa=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(i?.Err??e)(o.issues.map(e=>ea(e,s,zo())));throw Fo(t,i?.callee),t}return o.value},ca=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Eo;return s.issues.length?{success:!1,error:new(e??ia)(s.issues.map(e=>ea(e,i,zo())))}:{success:!0,data:s.value}},la=ca(sa),ua=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>ea(e,i,zo())))}:{success:!0,data:s.value}},ha=ua(sa),da=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oa(e)(t,n,i)},pa=e=>(t,n,r)=>oa(e)(t,n,r),ma=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return aa(e)(t,n,i)},fa=e=>async(t,n,r)=>aa(e)(t,n,r),ga=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ca(e)(t,n,i)},ya=e=>(t,n,r)=>ca(e)(t,n,r),ba=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ua(e)(t,n,i)},va=e=>async(t,n,r)=>ua(e)(t,n,r),ka=/^[cC][^\s-]{8,}$/,wa=/^[0-9a-z]+$/,_a=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xa=/^[0-9a-vA-V]{20}$/,$a=/^[A-Za-z0-9]{27}$/,Sa=/^[a-zA-Z0-9_-]{21}$/,Aa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ea=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ca=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ta=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,za=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pa=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Oa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ma=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ia=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Na=/^[A-Za-z0-9_-]*$/,Ra=/^\+[1-9]\d{6,14}$/,La="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Da=new RegExp(`^${La}$`);function ja(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Ua=/^-?\d+$/,Fa=/^-?\d+(?:\.\d+)?$/,Za=/^(?:true|false)$/i,Ba=/^[^A-Z]*$/,Wa=/^[^a-z]*$/,Ha=Ao("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ga={number:"number",bigint:"bigint",object:"date"},qa=Ao("$ZodCheckLessThan",(e,t)=>{Ha.init(e,t);const n=Ga[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ja=Ao("$ZodCheckGreaterThan",(e,t)=>{Ha.init(e,t);const n=Ga[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Va=Ao("$ZodCheckMultipleOf",(e,t)=>{Ha.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(0===i&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}const s=n>i?n:i;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Xa=Ao("$ZodCheckNumberFormat",(e,t)=>{Ha.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=Xo[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=s,n&&(r.pattern=Ua)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<i&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Ya=Ao("$ZodCheckMaxLength",(e,t)=>{var n;Ha.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Io(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=ta(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ka=Ao("$ZodCheckMinLength",(e,t)=>{var n;Ha.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Io(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=ta(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qa=Ao("$ZodCheckLengthEquals",(e,t)=>{var n;Ha.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Io(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,i=r.length;if(i===t.length)return;const s=ta(r),o=i>t.length;n.issues.push({origin:s,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ec=Ao("$ZodCheckStringFormat",(e,t)=>{var n,r;Ha.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),tc=Ao("$ZodCheckRegex",(e,t)=>{ec.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nc=Ao("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ba),ec.init(e,t)}),rc=Ao("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wa),ec.init(e,t)}),ic=Ao("$ZodCheckIncludes",(e,t)=>{Ha.init(e,t);const n=qo(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),sc=Ao("$ZodCheckStartsWith",(e,t)=>{Ha.init(e,t);const n=new RegExp(`^${qo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),oc=Ao("$ZodCheckEndsWith",(e,t)=>{Ha.init(e,t);const n=new RegExp(`.*${qo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ac=Ao("$ZodCheckOverwrite",(e,t)=>{Ha.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class cc{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const lc={major:4,minor:3,patch:5},uc=Ao("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lc;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,i=Yo(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(i)continue;const t=e.issues.length,o=s._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new Eo;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(i||(i=Yo(e,t)))});else{if(e.issues.length===t)continue;i||(i=Yo(e,t))}}return r?r.then(()=>e):e},n=(n,i,s)=>{if(Yo(n))return n.aborted=!0,n;const o=t(i,r,s);if(o instanceof Promise){if(!1===s.async)throw new Eo;return o.then(t=>e._zod.parse(t,s))}return e._zod.parse(o,s)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if("backward"===s.direction){const t=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,s)):n(t,i,s)}const o=e._zod.parse(i,s);if(o instanceof Promise){if(!1===s.async)throw new Eo;return o.then(e=>t(e,r,s))}return t(o,r,s)}}Lo(e,"~standard",()=>({validate:t=>{try{const n=la(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return ha(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),hc=Ao("$ZodString",(e,t)=>{var n;uc.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),dc=Ao("$ZodStringFormat",(e,t)=>{ec.init(e,t),hc.init(e,t)}),pc=Ao("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ea),dc.init(e,t)}),mc=Ao("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ca(e))}else t.pattern??(t.pattern=Ca());dc.init(e,t)}),fc=Ao("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ta),dc.init(e,t)}),gc=Ao("$ZodURL",(e,t)=>{dc.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=i.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),yc=Ao("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),dc.init(e,t)}),bc=Ao("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Sa),dc.init(e,t)}),vc=Ao("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ka),dc.init(e,t)}),kc=Ao("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=wa),dc.init(e,t)}),wc=Ao("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_a),dc.init(e,t)}),_c=Ao("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xa),dc.init(e,t)}),xc=Ao("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$a),dc.init(e,t)}),$c=Ao("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=ja({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${La}T(?:${r})$`)}(t)),dc.init(e,t)}),Sc=Ao("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Da),dc.init(e,t)}),Ac=Ao("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ja(t)}$`)),dc.init(e,t)}),Ec=Ao("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Aa),dc.init(e,t)}),Cc=Ao("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=za),dc.init(e,t),e._zod.bag.format="ipv4"}),Tc=Ao("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Pa),dc.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),zc=Ao("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Oa),dc.init(e,t)}),Pc=Ao("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ma),dc.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Oc(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Mc=Ao("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ia),dc.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Oc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ic=Ao("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Na),dc.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Na.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Oc(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Nc=Ao("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ra),dc.init(e,t)}),Rc=Ao("$ZodJWT",(e,t)=>{dc.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&"JWT"!==i?.typ||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Lc=Ao("$ZodNumber",(e,t)=>{uc.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),Dc=Ao("$ZodNumberFormat",(e,t)=>{Xa.init(e,t),Lc.init(e,t)}),jc=Ao("$ZodBoolean",(e,t)=>{uc.init(e,t),e._zod.pattern=Za,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Uc=Ao("$ZodUnknown",(e,t)=>{uc.init(e,t),e._zod.parse=e=>e}),Fc=Ao("$ZodNever",(e,t)=>{uc.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Zc(e,t,n){e.issues.length&&t.issues.push(...Ko(n,e.issues)),t.value[n]=e.value}const Bc=Ao("$ZodArray",(e,t)=>{uc.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let e=0;e<i.length;e++){const o=i[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?s.push(a.then(t=>Zc(t,n,e))):Zc(a,n,e)}return s.length?Promise.all(s).then(()=>n):n}});function Wc(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Ko(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Hc(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Gc(e,t,n,r,i,s){const o=[],a=i.keySet,c=i.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const i in t){if(a.has(i))continue;if("never"===l){o.push(i);continue}const s=c.run({value:t[i],issues:[]},r);s instanceof Promise?e.push(s.then(e=>Wc(e,n,i,t,u))):Wc(s,n,i,t,u)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const qc=Ao("$ZodObject",(e,t)=>{uc.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Mo(()=>Hc(t));Lo(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const i=Zo,s=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],l=o.shape;for(const e of o.keys){const r=l[e],i="optional"===r._zod.optout,s=r._zod.run({value:a[e],issues:[]},n);s instanceof Promise?c.push(s.then(n=>Wc(n,t,e,a,i))):Wc(s,t,e,a,i)}return s?Gc(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Jc=Ao("$ZodObjectJIT",(e,t)=>{qc.init(e,t);const n=e._zod.parse,r=Mo(()=>Hc(t));let i;const s=Zo,o=!To.jitless,a=o&&Bo.value,c=t.catchall;let l;e._zod.parse=(u,h)=>{l??(l=r.value);const d=u.value;return s(d)?o&&a&&!1===h?.async&&!0!==h.jitless?(i||(i=(e=>{const t=new cc(["shape","payload","ctx"]),n=r.value,i=e=>{const t=Uo(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let o=0;for(const e of n.keys)s[e]="key_"+o++;t.write("const newResult = {};");for(const r of n.keys){const n=s[r],o=Uo(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${i(r)};`),c?t.write(`\n if (${n}.issues.length) {\n if (${o} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${o}, ...iss.path] : [${o}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${o} in input) {\n newResult[${o}] = undefined;\n }\n } else {\n newResult[${o}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${o}, ...iss.path] : [${o}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${o} in input) {\n newResult[${o}] = undefined;\n }\n } else {\n newResult[${o}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),u=i(u,h),c?Gc([],d,u,h,l,e):u):n(u,h):(u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u)}});function Vc(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const i=e.filter(e=>!Yo(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ea(e,r,zo())))}),t)}const Xc=Ao("$ZodUnion",(e,t)=>{uc.init(e,t),Lo(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Lo(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Lo(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Lo(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>No(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(n)return r(i,s);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:i.value,issues:[]},s);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>Vc(t,i,e,s)):Vc(a,i,e,s)}}),Yc=Ao("$ZodIntersection",(e,t)=>{uc.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,i=t.left._zod.run({value:r,issues:[]},n),s=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,n])=>Qc(e,t,n)):Qc(e,i,s)}});function Kc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Wo(e)&&Wo(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),i={...e,...t};for(const n of r){const r=Kc(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=Kc(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Qc(e,t,n){const r=new Map;let i;for(const n of t.issues)if("unrecognized_keys"===n.code){i??(i=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&i&&e.issues.push({...i,keys:s}),Yo(e))return e;const o=Kc(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const el=Ao("$ZodEnum",(e,t)=>{uc.init(e,t);const n=Po(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Go.has(typeof e)).map(e=>"string"==typeof e?qo(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{const s=t.value;return r.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),tl=Ao("$ZodTransform",(e,t)=>{uc.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Co(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Eo;return n.value=i,n}});function nl(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const rl=Ao("$ZodOptional",(e,t)=>{uc.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Lo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Lo(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${No(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>nl(t,e.value)):nl(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),il=Ao("$ZodExactOptional",(e,t)=>{rl.init(e,t),Lo(e._zod,"values",()=>t.innerType._zod.values),Lo(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),sl=Ao("$ZodNullable",(e,t)=>{uc.init(e,t),Lo(e._zod,"optin",()=>t.innerType._zod.optin),Lo(e._zod,"optout",()=>t.innerType._zod.optout),Lo(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${No(e.source)}|null)$`):void 0}),Lo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),ol=Ao("$ZodDefault",(e,t)=>{uc.init(e,t),e._zod.optin="optional",Lo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>al(e,t)):al(r,t)}});function al(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const cl=Ao("$ZodPrefault",(e,t)=>{uc.init(e,t),e._zod.optin="optional",Lo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ll=Ao("$ZodNonOptional",(e,t)=>{uc.init(e,t),Lo(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ul(t,e)):ul(i,e)}});function ul(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const hl=Ao("$ZodCatch",(e,t)=>{uc.init(e,t),Lo(e._zod,"optin",()=>t.innerType._zod.optin),Lo(e._zod,"optout",()=>t.innerType._zod.optout),Lo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ea(e,n,zo()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ea(e,n,zo()))},input:e.value}),e.issues=[]),e)}}),dl=Ao("$ZodPipe",(e,t)=>{uc.init(e,t),Lo(e._zod,"values",()=>t.in._zod.values),Lo(e._zod,"optin",()=>t.in._zod.optin),Lo(e._zod,"optout",()=>t.out._zod.optout),Lo(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>pl(e,t.in,n)):pl(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>pl(e,t.out,n)):pl(r,t.out,n)}});function pl(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ml=Ao("$ZodReadonly",(e,t)=>{uc.init(e,t),Lo(e._zod,"propValues",()=>t.innerType._zod.propValues),Lo(e._zod,"values",()=>t.innerType._zod.values),Lo(e._zod,"optin",()=>t.innerType?._zod?.optin),Lo(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(fl):fl(r)}});function fl(e){return e.value=Object.freeze(e.value),e}const gl=Ao("$ZodCustom",(e,t)=>{Ha.init(e,t),uc.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>yl(t,n,r,e));yl(i,n,r,e)}});function yl(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(na(e))}}var bl;(bl=globalThis).__zod_globalRegistry??(bl.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const vl=globalThis.__zod_globalRegistry;function kl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Vo(t)})}function wl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Vo(t)})}function _l(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Vo(t)})}function xl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Vo(t)})}function $l(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Vo(t)})}function Sl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Vo(t)})}function Al(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Vo(t)})}function El(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Vo(t)})}function Cl(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Vo(t)})}function Tl(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Vo(t)})}function zl(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Vo(t)})}function Pl(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Vo(t)})}function Ol(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Vo(t)})}function Ml(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Vo(t)})}function Il(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Vo(t)})}function Nl(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Vo(t)})}function Rl(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Vo(t)})}function Ll(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Vo(t)})}function Dl(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Vo(t)})}function jl(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Vo(t)})}function Ul(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Vo(t)})}function Fl(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Vo(t)})}function Zl(e,t){return new e({type:"never",...Vo(t)})}function Bl(e,t){return new qa({check:"less_than",...Vo(t),value:e,inclusive:!1})}function Wl(e,t){return new qa({check:"less_than",...Vo(t),value:e,inclusive:!0})}function Hl(e,t){return new Ja({check:"greater_than",...Vo(t),value:e,inclusive:!1})}function Gl(e,t){return new Ja({check:"greater_than",...Vo(t),value:e,inclusive:!0})}function ql(e,t){return new Va({check:"multiple_of",...Vo(t),value:e})}function Jl(e,t){return new Ya({check:"max_length",...Vo(t),maximum:e})}function Vl(e,t){return new Ka({check:"min_length",...Vo(t),minimum:e})}function Xl(e,t){return new Qa({check:"length_equals",...Vo(t),length:e})}function Yl(e,t){return new tc({check:"string_format",format:"regex",...Vo(t),pattern:e})}function Kl(e){return new nc({check:"string_format",format:"lowercase",...Vo(e)})}function Ql(e){return new rc({check:"string_format",format:"uppercase",...Vo(e)})}function eu(e,t){return new ic({check:"string_format",format:"includes",...Vo(t),includes:e})}function tu(e,t){return new sc({check:"string_format",format:"starts_with",...Vo(t),prefix:e})}function nu(e,t){return new oc({check:"string_format",format:"ends_with",...Vo(t),suffix:e})}function ru(e){return new ac({check:"overwrite",tx:e})}function iu(e){return ru(t=>t.normalize(e))}function su(){return ru(e=>e.trim())}function ou(){return ru(e=>e.toLowerCase())}function au(){return ru(e=>e.toUpperCase())}function cu(){return ru(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function lu(e){const t=uu(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(na(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(na(r))}},e(n.value,n)));return t}function uu(e,t){const n=new Ha({check:"custom",...Vo(t)});return n._zod.check=e,n}function hu(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??vl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function du(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{const n=o.schema,s=t.processors[i.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(e,t,n,r)}const s=e._zod.parent;s&&(o.ref||(o.ref=s),du(s,t,r),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),"input"===t.io&&fu(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function pu(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const i=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:i,defId:s}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${i("__shared")}#/${r}/${s}`}}if(t[1]===n)return{ref:"#"};const i=`#/${r}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:i+s}})(t);r.def={...r.schema},s&&(r.defId=s);const o=r.schema;for(const e in o)delete o[e];o.$ref=i};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){i(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}const s=e.metadataRegistry.get(n[0])?.id;(s||r.cycle||r.count>1&&"ref"===e.reused)&&i(n)}}function mu(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const i=n.def??n.schema,s={...i},o=n.ref;if(n.ref=null,o){r(o);const n=e.seen.get(o),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(i,a):(i.allOf=i.allOf??[],i.allOf.push(a)),Object.assign(i,s),t._zod.parent===o)for(const e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(a.$ref)for(const e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}const a=t._zod.parent;if(a&&a!==o){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(const e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?i.$defs=s:i.definitions=s);try{const n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:gu(t,"input",e.processors),output:gu(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function fu(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return fu(r.element,n);if("set"===r.type)return fu(r.valueType,n);if("lazy"===r.type)return fu(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return fu(r.innerType,n);if("intersection"===r.type)return fu(r.left,n)||fu(r.right,n);if("record"===r.type||"map"===r.type)return fu(r.keyType,n)||fu(r.valueType,n);if("pipe"===r.type)return fu(r.in,n)||fu(r.out,n);if("object"===r.type){for(const e in r.shape)if(fu(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(fu(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(fu(e,n))return!0;return!(!r.rest||!fu(r.rest,n))}return!1}const gu=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=hu({...i??{},target:s,io:t,processors:n});return du(e,o),pu(o,e),mu(o,e)},yu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bu=(e,t,n,r)=>{const i=e._zod.def;du(i.innerType,t,r),t.seen.get(e).ref=i.innerType},vu=Ao("ZodISODateTime",(e,t)=>{$c.init(e,t),Uu.init(e,t)}),ku=Ao("ZodISODate",(e,t)=>{Sc.init(e,t),Uu.init(e,t)}),wu=Ao("ZodISOTime",(e,t)=>{Ac.init(e,t),Uu.init(e,t)}),_u=Ao("ZodISODuration",(e,t)=>{Ec.init(e,t),Uu.init(e,t)}),xu=Ao("ZodError",(e,t)=>{ia.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e}));else if("invalid_key"===i.code)r({issues:i.issues});else if("invalid_element"===i.code)r({issues:i.issues});else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Oo,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Oo,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),$u=oa(xu),Su=aa(xu),Au=ca(xu),Eu=ua(xu),Cu=da(xu),Tu=pa(xu),zu=ma(xu),Pu=fa(xu),Ou=ga(xu),Mu=ya(xu),Iu=ba(xu),Nu=va(xu),Ru=Ao("ZodType",(e,t)=>(uc.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:gu(e,"input"),output:gu(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=hu({...n,processors:t});return du(e,r),pu(r,e),mu(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(jo(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Jo(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>$u(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Au(e,t,n),e.parseAsync=async(t,n)=>Su(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Eu(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Cu(e,t,n),e.decode=(t,n)=>Tu(e,t,n),e.encodeAsync=async(t,n)=>zu(e,t,n),e.decodeAsync=async(t,n)=>Pu(e,t,n),e.safeEncode=(t,n)=>Ou(e,t,n),e.safeDecode=(t,n)=>Mu(e,t,n),e.safeEncodeAsync=async(t,n)=>Iu(e,t,n),e.safeDecodeAsync=async(t,n)=>Nu(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Vo(n)})}(Rh,e,t)}(t,n)),e.superRefine=t=>e.check(lu(t)),e.overwrite=t=>e.check(ru(t)),e.optional=()=>Sh(e),e.exactOptional=()=>new Ah({type:"optional",innerType:e}),e.nullable=()=>Ch(e),e.nullish=()=>Sh(Ch(e)),e.nonoptional=t=>function(e,t){return new Ph({type:"nonoptional",innerType:e,...Vo(t)})}(e,t),e.array=()=>gh(e),e.or=t=>new vh({type:"union",options:[e,t],...Vo(undefined)}),e.and=t=>new kh({type:"intersection",left:e,right:t}),e.transform=t=>Ih(e,xh(t)),e.default=t=>{return n=t,new Th({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ho(n)}});var n},e.prefault=t=>{return n=t,new zh({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ho(n)}});var n},e.catch=t=>{return new Oh({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Ih(e,t),e.readonly=()=>new Nh({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return vl.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>vl.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return vl.get(e);const n=e.clone();return vl.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Lu=Ao("_ZodString",(e,t)=>{hc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:i,maximum:s,format:o,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof s&&(r.maxLength=s),o&&(r.format=yu[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Yl(...t)),e.includes=(...t)=>e.check(eu(...t)),e.startsWith=(...t)=>e.check(tu(...t)),e.endsWith=(...t)=>e.check(nu(...t)),e.min=(...t)=>e.check(Vl(...t)),e.max=(...t)=>e.check(Jl(...t)),e.length=(...t)=>e.check(Xl(...t)),e.nonempty=(...t)=>e.check(Vl(1,...t)),e.lowercase=t=>e.check(Kl(t)),e.uppercase=t=>e.check(Ql(t)),e.trim=()=>e.check(su()),e.normalize=(...t)=>e.check(iu(...t)),e.toLowerCase=()=>e.check(ou()),e.toUpperCase=()=>e.check(au()),e.slugify=()=>e.check(cu())}),Du=Ao("ZodString",(e,t)=>{hc.init(e,t),Lu.init(e,t),e.email=t=>e.check(kl(Fu,t)),e.url=t=>e.check(Al(Wu,t)),e.jwt=t=>e.check(Fl(sh,t)),e.emoji=t=>e.check(El(Hu,t)),e.guid=t=>e.check(wl(Zu,t)),e.uuid=t=>e.check(_l(Bu,t)),e.uuidv4=t=>e.check(xl(Bu,t)),e.uuidv6=t=>e.check($l(Bu,t)),e.uuidv7=t=>e.check(Sl(Bu,t)),e.nanoid=t=>e.check(Cl(Gu,t)),e.guid=t=>e.check(wl(Zu,t)),e.cuid=t=>e.check(Tl(qu,t)),e.cuid2=t=>e.check(zl(Ju,t)),e.ulid=t=>e.check(Pl(Vu,t)),e.base64=t=>e.check(Dl(nh,t)),e.base64url=t=>e.check(jl(rh,t)),e.xid=t=>e.check(Ol(Xu,t)),e.ksuid=t=>e.check(Ml(Yu,t)),e.ipv4=t=>e.check(Il(Ku,t)),e.ipv6=t=>e.check(Nl(Qu,t)),e.cidrv4=t=>e.check(Rl(eh,t)),e.cidrv6=t=>e.check(Ll(th,t)),e.e164=t=>e.check(Ul(ih,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Vo(t)})}(vu,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vo(t)})}(ku,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vo(t)})}(wu,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vo(t)})}(_u,e)}(t))});function ju(e){return function(e,t){return new e({type:"string",...Vo(t)})}(Du,e)}const Uu=Ao("ZodStringFormat",(e,t)=>{dc.init(e,t),Lu.init(e,t)}),Fu=Ao("ZodEmail",(e,t)=>{fc.init(e,t),Uu.init(e,t)}),Zu=Ao("ZodGUID",(e,t)=>{pc.init(e,t),Uu.init(e,t)}),Bu=Ao("ZodUUID",(e,t)=>{mc.init(e,t),Uu.init(e,t)}),Wu=Ao("ZodURL",(e,t)=>{gc.init(e,t),Uu.init(e,t)}),Hu=Ao("ZodEmoji",(e,t)=>{yc.init(e,t),Uu.init(e,t)}),Gu=Ao("ZodNanoID",(e,t)=>{bc.init(e,t),Uu.init(e,t)}),qu=Ao("ZodCUID",(e,t)=>{vc.init(e,t),Uu.init(e,t)}),Ju=Ao("ZodCUID2",(e,t)=>{kc.init(e,t),Uu.init(e,t)}),Vu=Ao("ZodULID",(e,t)=>{wc.init(e,t),Uu.init(e,t)}),Xu=Ao("ZodXID",(e,t)=>{_c.init(e,t),Uu.init(e,t)}),Yu=Ao("ZodKSUID",(e,t)=>{xc.init(e,t),Uu.init(e,t)}),Ku=Ao("ZodIPv4",(e,t)=>{Cc.init(e,t),Uu.init(e,t)}),Qu=Ao("ZodIPv6",(e,t)=>{Tc.init(e,t),Uu.init(e,t)}),eh=Ao("ZodCIDRv4",(e,t)=>{zc.init(e,t),Uu.init(e,t)}),th=Ao("ZodCIDRv6",(e,t)=>{Pc.init(e,t),Uu.init(e,t)}),nh=Ao("ZodBase64",(e,t)=>{Mc.init(e,t),Uu.init(e,t)}),rh=Ao("ZodBase64URL",(e,t)=>{Ic.init(e,t),Uu.init(e,t)}),ih=Ao("ZodE164",(e,t)=>{Nc.init(e,t),Uu.init(e,t)}),sh=Ao("ZodJWT",(e,t)=>{Rc.init(e,t),Uu.init(e,t)}),oh=Ao("ZodNumber",(e,t)=>{Lc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:i,maximum:s,format:o,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number","number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l),"number"==typeof i&&(r.minimum=i,"number"==typeof l&&"draft-04"!==t.target&&(l>=i?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof s&&(r.maximum=s,"number"==typeof c&&"draft-04"!==t.target&&(c<=s?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(Hl(t,n)),e.gte=(t,n)=>e.check(Gl(t,n)),e.min=(t,n)=>e.check(Gl(t,n)),e.lt=(t,n)=>e.check(Bl(t,n)),e.lte=(t,n)=>e.check(Wl(t,n)),e.max=(t,n)=>e.check(Wl(t,n)),e.int=t=>e.check(lh(t)),e.safe=t=>e.check(lh(t)),e.positive=t=>e.check(Hl(0,t)),e.nonnegative=t=>e.check(Gl(0,t)),e.negative=t=>e.check(Bl(0,t)),e.nonpositive=t=>e.check(Wl(0,t)),e.multipleOf=(t,n)=>e.check(ql(t,n)),e.step=(t,n)=>e.check(ql(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ah(e){return function(e,t){return new e({type:"number",checks:[],...Vo(t)})}(oh,e)}const ch=Ao("ZodNumberFormat",(e,t)=>{Dc.init(e,t),oh.init(e,t)});function lh(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Vo(t)})}(ch,e)}const uh=Ao("ZodBoolean",(e,t)=>{jc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function hh(e){return function(e,t){return new e({type:"boolean",...Vo(t)})}(uh,e)}const dh=Ao("ZodUnknown",(e,t)=>{Uc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function ph(){return function(e){return new e({type:"unknown"})}(dh)}const mh=Ao("ZodNever",(e,t)=>{Fc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}),fh=Ao("ZodArray",(e,t)=>{Bc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(i.minItems=o),"number"==typeof a&&(i.maxItems=a),i.type="array",i.items=du(s.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Vl(t,n)),e.nonempty=t=>e.check(Vl(1,t)),e.max=(t,n)=>e.check(Jl(t,n)),e.length=(t,n)=>e.check(Xl(t,n)),e.unwrap=()=>e.element});function gh(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vo(n)})}(fh,e,t)}const yh=Ao("ZodObject",(e,t)=>{Jc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const o=s.shape;for(const e in o)i.properties[e]=du(o[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(e=>{const n=s.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(i.required=Array.from(c)),"never"===s.catchall?._zod.def.type?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=du(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(i.additionalProperties=!1)})(e,t,n,r),Lo(e,"shape",()=>t.shape),e.keyof=()=>function(e){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wh({type:"enum",entries:t,...Vo(void 0)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ph()}),e.loose=()=>e.clone({...e._zod.def,catchall:ph()}),e.strict=()=>e.clone({...e._zod.def,catchall:Zl(mh,undefined)}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Wo(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=jo(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Do(this,"shape",n),n}});return Jo(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Wo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=jo(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Do(this,"shape",n),n}});return Jo(e,n)}(e,t),e.merge=t=>function(e,t){const n=jo(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Do(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Jo(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Jo(e,jo(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Do(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=jo(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Do(this,"shape",r),r},checks:[]});return Jo(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=jo(t._zod.def,{get shape(){const r=t._zod.def.shape,i={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Do(this,"shape",i),i},checks:[]});return Jo(t,i)}($h,e,t[0]),e.required=(...t)=>function(e,t,n){const r=jo(t._zod.def,{get shape(){const r=t._zod.def.shape,i={...r};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)i[t]=new e({type:"nonoptional",innerType:r[t]});return Do(this,"shape",i),i}});return Jo(t,r)}(Ph,e,t[0])});function bh(e,t){const n={type:"object",shape:e??{},...Vo(t)};return new yh(n)}const vh=Ao("ZodUnion",(e,t)=>{Xc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,s=!1===i.inclusive,o=i.options.map((e,n)=>du(e,t,{...r,path:[...r.path,s?"oneOf":"anyOf",n]}));s?n.oneOf=o:n.anyOf=o})(e,t,n,r),e.options=t.options}),kh=Ao("ZodIntersection",(e,t)=>{Yc.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,s=du(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=du(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];n.allOf=c})(e,t,n,r)}),wh=Ao("ZodEnum",(e,t)=>{el.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Po(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const i={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);i[r]=t.entries[r]}return new wh({...t,checks:[],...Vo(r),entries:i})},e.exclude=(e,r)=>{const i={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete i[t]}return new wh({...t,checks:[],...Vo(r),entries:i})}}),_h=Ao("ZodTransform",(e,t)=>{tl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Co(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(na(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(na(t))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xh(e){return new _h({type:"transform",transform:e})}const $h=Ao("ZodOptional",(e,t)=>{rl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bu(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Sh(e){return new $h({type:"optional",innerType:e})}const Ah=Ao("ZodExactOptional",(e,t)=>{il.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bu(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),Eh=Ao("ZodNullable",(e,t)=>{sl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,s=du(i.innerType,t,r),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ch(e){return new Eh({type:"nullable",innerType:e})}const Th=Ao("ZodDefault",(e,t)=>{ol.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;du(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),zh=Ao("ZodPrefault",(e,t)=>{cl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;du(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Ph=Ao("ZodNonOptional",(e,t)=>{ll.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;du(i.innerType,t,r),t.seen.get(e).ref=i.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),Oh=Ao("ZodCatch",(e,t)=>{hl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;let s;du(i.innerType,t,r),t.seen.get(e).ref=i.innerType;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Mh=Ao("ZodPipe",(e,t)=>{dl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,s="input"===t.io?"transform"===i.in._zod.def.type?i.out:i.in:i.out;du(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function Ih(e,t){return new Mh({type:"pipe",in:e,out:t})}const Nh=Ao("ZodReadonly",(e,t)=>{ml.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;du(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Rh=Ao("ZodCustom",(e,t)=>{gl.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function Lh(e,t){return Ih(xh(e),t)}const Dh=/^[A-Z][a-z]+\s[A-Z][a-z]+$/,jh=e=>e.normalize("NFC").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u202A-\u202E\u2066-\u2069]/g,"").trim(),Uh=bh({id:ju(),pseudonym:ju().optional(),msg:ju(),pubDate:ah(),modDate:ah().optional(),replyTo:ju().optional(),isAdmin:hh().optional()}),Fh=bh({comments:gh(Uh),isAdmin:hh()}),Zh=bh({pseudonym:Lh(e=>"string"==typeof e&&""===e.trim()?void 0:e,ju().max(80).regex(Dh).optional()),msg:ju().min(1).max(1e3).transform(jh),replyTo:ju().regex(/^[0-9A-Z]{12}$/).optional(),email:ju().optional()}),Bh=bh({id:ju(),timestamp:ah(),token:ju()}),Wh=bh({pseudonym:Lh(e=>"string"==typeof e&&""===e.trim()?void 0:e,ju().max(80).regex(Dh).optional()),msg:ju().min(1).max(1e3).transform(jh)});bh({post:ju()}),bh({post:ju(),challenge:ju(),nonce:ju().regex(/^\d+$/)}),bh({"x-comment-id":ju(),"x-comment-token":ju(),"x-comment-timestamp":ju()});const Hh=bh({username:ju(),password:ju()}),Gh=bh({success:hh(),message:ju()}),qh=bh({success:hh(),message:ju()}),Jh=bh({authenticated:hh()});bh({challenge:ju(),nonce:ah().int().positive()});const Vh=bh({challenge:ju()});let Xh=null,Yh=0;const Kh=new Map;async function Qh(e,t){return new Promise(n=>{const r=function(){if(!Xh){const e=new Blob(["\nasync function sha256(input) {\n const encoder = new TextEncoder();\n const data = encoder.encode(input);\n const hashBuffer = await crypto.subtle.digest('SHA-256', data);\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');\n return hashHex;\n}\n\nasync function solvePow(difficulty, challenge, maxRetries) {\n let nonce = 0;\n const targetPrefix = '0'.repeat(difficulty);\n let retries = 0;\n\n while (retries++ < maxRetries) {\n const hash = await sha256(challenge + ':' + nonce);\n if (hash.startsWith(targetPrefix)) {\n return nonce;\n }\n nonce++;\n }\n return -1;\n}\n\nself.onmessage = async (e) => {\n const { requestId, type, difficulty, challenge, maxRetries } = e.data;\n if (type === 'solve') {\n try {\n const nonce = await solvePow(difficulty, challenge, maxRetries);\n self.postMessage({\n requestId,\n success: nonce >= 0,\n nonce,\n });\n } catch (error) {\n self.postMessage({\n requestId,\n success: false,\n nonce: -1,\n error: error instanceof Error ? error.message : 'Unknown error',\n });\n }\n }\n};\n"],{type:"application/javascript"}),t=URL.createObjectURL(e);Xh=new Worker(t),Xh.addEventListener("message",e=>{const{requestId:t,success:n,nonce:r,error:i}=e.data,s=Kh.get(t);s&&(Kh.delete(t),i?(console.error("PoW Worker error:",i),s(-1)):n?s(r):(console.warn("Failed to solve PoW within max retries"),s(-1)))}),Xh.addEventListener("error",e=>{console.error("PoW Worker error:",e.message),Kh.forEach(e=>e(-1)),Kh.clear()})}return Xh}(),i=Yh++;Kh.set(i,n),r.postMessage({requestId:i,type:"solve",difficulty:e,challenge:t,maxRetries:1e6})})}var ed,td,nd,rd,id,sd,od,ad,cd,ld,ud,hd,dd,pd,md,fd,gd,yd,bd,vd,kd,wd,_d,xd,$d,Sd,Ad,Ed,Cd,Td,zd,Pd,Od,Md,Id,Nd,Rd,Ld,Dd,jd,Ud,Fd,Zd,Bd,Wd,Hd,Gd,qd,Jd,Vd,Xd,Yd=Object.create,Kd=Object.defineProperty,Qd=Object.getOwnPropertyDescriptor,ep=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),tp=e=>{throw TypeError(e)},np=(e,t)=>Kd(e,"name",{value:t,configurable:!0}),rp=["class","method","getter","setter","accessor","field","value","get","set"],ip=e=>void 0!==e&&"function"!=typeof e?tp("Function expected"):e,sp=(e,t,n,r,i)=>({kind:rp[e],name:t,metadata:r,addInitializer:e=>n._?tp("Already initialized"):i.push(ip(e||null))}),op=(e,t,n,r)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)1&t?s[i].call(n):r=s[i].call(n,r);return r},ap=(e,t,n,r,i,s)=>{var o,a,c,l,u,h=7&t,d=!!(8&t),p=!!(16&t),m=h>3?e.length+1:h?d?1:2:0,f=rp[h+5],g=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),b=h&&(!p&&!d&&(i=i.prototype),h<5&&(h>3||!p)&&Qd(h<4?i:{get[n](){return up(this,s)},set[n](e){return dp(this,s,e)}},n));h?p&&h<4&&np(s,(h>2?"set ":h>1?"get ":"")+n):np(i,n);for(var v=r.length-1;v>=0;v--)l=sp(h,n,c={},e[3],y),h&&(l.static=d,l.private=p,u=l.access={has:p?e=>lp(i,e):e=>n in e},3^h&&(u.get=p?e=>(1^h?up:pp)(e,i,4^h?s:b.get):e=>e[n]),h>2&&(u.set=p?(e,t)=>dp(e,i,t,4^h?s:b.set):(e,t)=>e[n]=t)),a=(0,r[v])(h?h<4?p?s:b[f]:h>4?void 0:{get:b.get,set:b.set}:i,l),c._=1,4^h||void 0===a?ip(a)&&(h>4?g.unshift(a):h?p?s=a:b[f]=a:i=a):"object"!=typeof a||null===a?tp("Object expected"):(ip(o=a.get)&&(b.get=o),ip(o=a.set)&&(b.set=o),ip(o=a.init)&&g.unshift(o));return h||((e,t)=>{return n=t,r=ep("metadata"),i=e[3],r in n?Kd(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var n,r,i})(e,i),b&&Kd(i,n,b),p?4^h?s:b:i},cp=(e,t,n)=>t.has(e)||tp("Cannot "+n),lp=(e,t)=>Object(t)!==t?tp('Cannot use the "in" operator on this value'):e.has(t),up=(e,t,n)=>(cp(e,t,"read from private field"),n?n.call(e):t.get(e)),hp=(e,t,n)=>t.has(e)?tp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),dp=(e,t,n,r)=>(cp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pp=(e,t,n)=>(cp(e,t,"access private method"),n);Sd=[oe("yangchun-comment")];class mp extends($d=ie,xd=[le({type:String})],_d=[le({type:String})],wd=[le({type:String})],kd=[le({type:String})],vd=[le({type:String})],bd=[le({type:Number})],yd=[le({type:Object,attribute:!1})],gd=[ue()],fd=[ue()],md=[ue()],pd=[ue()],dd=[ue()],hd=[ue()],ud=[ue()],ld=[ue()],cd=[ue()],ad=[ue()],od=[ue()],sd=[ue()],id=[ue()],rd=[ue()],nd=[ue()],td=[he("comment-input")],ed=[he("comment-admin")],$d){constructor(){super(...arguments),hp(this,Ed,op(Ad,8,this,"my-post")),op(Ad,11,this),hp(this,Cd,op(Ad,12,this,"http://localhost:8787")),op(Ad,15,this),hp(this,Td,op(Ad,16,this,"Admin")),op(Ad,19,this),hp(this,zd,op(Ad,20,this,"en-US")),op(Ad,23,this),hp(this,Pd,op(Ad,24,this,"MAGIC")),op(Ad,27,this),hp(this,Od,op(Ad,28,this,2)),op(Ad,31,this),hp(this,Md,op(Ad,32,this)),op(Ad,35,this),hp(this,Id,op(Ad,36,this,"")),op(Ad,39,this),hp(this,Nd,op(Ad,40,this,"")),op(Ad,43,this),hp(this,Rd,op(Ad,44,this,[])),op(Ad,47,this),hp(this,Ld,op(Ad,48,this,"")),op(Ad,51,this),hp(this,Dd,op(Ad,52,this,"")),op(Ad,55,this),hp(this,jd,op(Ad,56,this,null)),op(Ad,59,this),hp(this,Ud,op(Ad,60,this,!0)),op(Ad,63,this),hp(this,Fd,op(Ad,64,this,!1)),op(Ad,67,this),hp(this,Zd,op(Ad,68,this,!1)),op(Ad,71,this),hp(this,Bd,op(Ad,72,this,!1)),op(Ad,75,this),hp(this,Wd,op(Ad,76,this,!1)),op(Ad,79,this),hp(this,Hd,op(Ad,80,this,"")),op(Ad,83,this),hp(this,Gd,op(Ad,84,this,!1)),op(Ad,87,this),hp(this,qd,op(Ad,88,this,"")),op(Ad,91,this),hp(this,Jd,op(Ad,92,this,"")),op(Ad,95,this),hp(this,Vd,op(Ad,96,this)),op(Ad,99,this),hp(this,Xd,op(Ad,100,this)),op(Ad,103,this),this.handleAuthStatusChange=e=>{this.isAdmin=e.detail},this.handleExternalLinkClick=e=>{const t=e.detail;t&&(this.externalLinkUrl=t,this.showExternalLink=!0)},this.handleOpenLink=()=>{this.externalLinkUrl&&(window.open(this.externalLinkUrl,"_blank","noopener,noreferrer"),this.showExternalLink=!1,this.externalLinkUrl="")},this.handleCopyLink=async()=>{if(this.externalLinkUrl){try{await navigator.clipboard.writeText(this.externalLinkUrl),console.log("Link copied to clipboard")}catch(e){console.error("Failed to copy link:",e)}this.showExternalLink=!1,this.externalLinkUrl=""}}}render(){const e=F`
|
|
793
|
+
<div class="help-content">
|
|
794
|
+
<div class="help-desc">
|
|
795
|
+
${Yn("helpDesc").split("\n").map(e=>F`<p>${e}</p>`)}
|
|
796
|
+
</div>
|
|
797
|
+
<pre class="help-md-sample">
|
|
798
|
+
[${Yn("helpMdLink")}](https://example.com)
|
|
799
|
+
|
|
800
|
+

|
|
801
|
+
|
|
802
|
+
*${Yn("helpMdItalic")}*
|
|
803
|
+
|
|
804
|
+
**${Yn("helpMdBold")}**
|
|
805
|
+
|
|
806
|
+
- ${Yn("helpMdList")}
|
|
807
|
+
|
|
808
|
+
1. ${Yn("helpMdOrderedList")}
|
|
809
|
+
|
|
810
|
+
\`${Yn("helpMdInlineCode")}\`
|
|
811
|
+
|
|
812
|
+
\`\`\`
|
|
813
|
+
${Yn("helpMdCodeBlock")}
|
|
814
|
+
\`\`\`
|
|
815
|
+
|
|
816
|
+
<img src="${Yn("helpMdNoHtml")}">
|
|
817
|
+
</pre
|
|
818
|
+
>
|
|
819
|
+
<div class="help-footer">
|
|
820
|
+
Powered by${" "}
|
|
821
|
+
<a href="https://ycc.ziteh.dev/" rel="noopener noreferrer" target="_blank">
|
|
822
|
+
Yang Chun Comment
|
|
823
|
+
</a>
|
|
824
|
+
(<a
|
|
825
|
+
href="https://github.com/ziteh/yangchun-comment"
|
|
826
|
+
rel="noopener noreferrer"
|
|
827
|
+
target="_blank"
|
|
828
|
+
>GitHub</a
|
|
829
|
+
>)
|
|
830
|
+
</div>
|
|
831
|
+
</div>
|
|
832
|
+
`;return F`
|
|
833
|
+
<div class="root" part="root">
|
|
834
|
+
<!-- <slot></slot> -->
|
|
835
|
+
<comment-input
|
|
836
|
+
.draft=${this.draft}
|
|
837
|
+
.nickname=${this.nickname}
|
|
838
|
+
.editPseudonym=${this.editPseudonym}
|
|
839
|
+
.adminName=${this.adminName}
|
|
840
|
+
.isAdmin=${this.isAdmin}
|
|
841
|
+
@draft-change=${this.handleDraftChange}
|
|
842
|
+
@nickname-change=${this.handleNicknameChange}
|
|
843
|
+
@comment-submit=${this.handleCommentSubmit}
|
|
844
|
+
></comment-input>
|
|
845
|
+
<comment-info
|
|
846
|
+
.comment=${this.referenceComment}
|
|
847
|
+
.isReply=${this.isReply}
|
|
848
|
+
.errorMessage=${this.errorMessage}
|
|
849
|
+
@error-clear=${()=>this.errorMessage=""}
|
|
850
|
+
@reference-comment-cancel=${this.handleRefCommentCancel}
|
|
851
|
+
@notify-open=${()=>this.showNotify=!0}
|
|
852
|
+
@help-open=${()=>this.showHelp=!0}
|
|
853
|
+
@admin-open=${()=>this.showAdmin=!0}
|
|
854
|
+
></comment-info>
|
|
855
|
+
<comment-list
|
|
856
|
+
.comments=${this.comments}
|
|
857
|
+
.author=${this.adminName}
|
|
858
|
+
@comment-reply=${this.handleCommentReply}
|
|
859
|
+
@comment-edit=${this.handleCommentEdit}
|
|
860
|
+
@comment-delete=${this.handleCommentDelete}
|
|
861
|
+
></comment-list>
|
|
862
|
+
|
|
863
|
+
<comment-dialog
|
|
864
|
+
header=${Yn("confirmDelete")}
|
|
865
|
+
.open=${""!==this.deleteCommentId}
|
|
866
|
+
@close=${()=>this.deleteCommentId=""}
|
|
867
|
+
>
|
|
868
|
+
<p>${Yn("confirmDeleteDesc1")+this.deleteCommentId}</p>
|
|
869
|
+
<strong>${Yn("confirmDeleteDesc2")}</strong>
|
|
870
|
+
<div class="dialog-actions">
|
|
871
|
+
<button class="secondary" @click=${this.handleDeleteComment}>${Yn("delete")}</button>
|
|
872
|
+
<button @click=${()=>this.deleteCommentId=""}>${Yn("cancel")}</button>
|
|
873
|
+
</div>
|
|
874
|
+
</comment-dialog>
|
|
875
|
+
<comment-dialog
|
|
876
|
+
header="Admin"
|
|
877
|
+
.open=${this.showAdmin}
|
|
878
|
+
@close=${()=>this.showAdmin=!1}
|
|
879
|
+
>
|
|
880
|
+
<comment-admin @auth-status-change=${this.handleAuthStatusChange}></comment-admin>
|
|
881
|
+
</comment-dialog>
|
|
882
|
+
<comment-dialog
|
|
883
|
+
header=${Yn("notify")}
|
|
884
|
+
.open=${this.showNotify}
|
|
885
|
+
@close=${()=>this.showNotify=!1}
|
|
886
|
+
>
|
|
887
|
+
<p>${Yn("notifyDesc")}</p>
|
|
888
|
+
<a href="${this.rssFeedUrl}" target="_blank" rel="noopener noreferrer">RSS feed</a>
|
|
889
|
+
</comment-dialog>
|
|
890
|
+
<comment-dialog
|
|
891
|
+
header=${Yn("help")}
|
|
892
|
+
.open=${this.showHelp}
|
|
893
|
+
@close=${()=>this.showHelp=!1}
|
|
894
|
+
>
|
|
895
|
+
${e}
|
|
896
|
+
</comment-dialog>
|
|
897
|
+
<comment-dialog
|
|
898
|
+
header=${Yn("externalLinkWarning")}
|
|
899
|
+
.open=${this.showExternalLink}
|
|
900
|
+
@close=${()=>this.showExternalLink=!1}
|
|
901
|
+
>
|
|
902
|
+
<p>${Yn("externalLinkDesc")}</p>
|
|
903
|
+
<p class="external-link-url">${this.externalLinkUrl}</p>
|
|
904
|
+
<div class="dialog-actions">
|
|
905
|
+
<button class="secondary" @click=${this.handleCopyLink}>${Yn("copyLink")}</button>
|
|
906
|
+
<button @click=${this.handleOpenLink}>${Yn("openLink")}</button>
|
|
907
|
+
</div>
|
|
908
|
+
</comment-dialog>
|
|
909
|
+
</div>
|
|
910
|
+
`}willUpdate(e){if((e.has("customMessages")||e.has("lang"))&&(this.customMessages?Kn(this.customMessages):Kn([Jn,Vn].find(e=>e.bcp47===this.lang)||Jn)),(e.has("apiUrl")||e.has("prePowDifficulty")||e.has("prePowSalt"))&&this.apiUrl){console.debug("Initializing API service with URL:",this.apiUrl);const e=((e,t,n)=>{const r="my_comment_ids",i=new Map,s=(e,t,n)=>{i.set(e,{timestamp:t,token:n})},o=e=>{i.delete(e)},a=e=>{const t=i.get(e);return t?{id:e,...t}:null},c=e=>{try{const t=new Set(JSON.parse(localStorage.getItem(r)||"[]"));t.add(e),localStorage.setItem(r,JSON.stringify(Array.from(t)))}catch(e){console.warn("Failed to save my comment ID:",e)}};return{getComments:async t=>{try{const n=new URL("/api/comments",e);n.searchParams.append("post",t);const r=await fetch(n,{credentials:"include"}),i=await r.json();return Fh.parse(i)}catch(e){return console.error("Error getting comments:",e),{comments:[],isAdmin:!1}}},addComment:async(r,i,o,a)=>{try{const l=await async function(e,t){const n=`${Math.floor(Date.now()/1e3)}:${t}`;return{challenge:n,nonce:await Qh(e,n)}}(t,n);if(l.nonce<0)return console.error("Failed to solve pre-PoW"),null;console.debug("Pre-PoW solved:",l);const u=await(async(t,n)=>{try{const r=new URL("/api/pow/formal-challenge",e),i=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({challenge:t,nonce:n})});if(i.ok){const e=await i.json();return Vh.parse(e).challenge}return console.error("Failed to get formal challenge:",i.status,i.statusText),null}catch(e){return console.error("Error getting formal challenge:",e),null}})(l.challenge,l.nonce);if(!u)return console.error("Failed to get formal challenge"),null;console.debug("Using formal challenge:",u);const h=parseInt(u.split(":")[2],10);console.debug("Solving formal PoW with difficulty:",h);const d=await async function(e,t,n){return Qh(e,`${t}:${n}`)}(h,u,r);if(d<0)throw console.error("Failed to solve formal PoW"),new Error("Failed to solve proof-of-work. Please try again.");console.debug("Formal PoW solved, nonce:",d);const p=document.querySelector('input[name="email"]'),m=p?p.value:"",f=Zh.parse({pseudonym:i,msg:o,replyTo:a,email:m}),g=new URL("/api/comments",e);g.searchParams.append("post",r),g.searchParams.append("challenge",u),g.searchParams.append("nonce",d.toString());const y=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(f)});if(y.ok){const e=await y.json(),t=Bh.parse(e);return s(t.id,t.timestamp,t.token),c(t.id),t.id}return console.error("Failed to add comment:",y.status,y.statusText),null}catch(e){throw console.error("Error adding comment:",e),e}},updateComment:async(t,n,r,i)=>{const s=a(n);if(!s)return!1;try{const n=new URL("/api/comments",e);n.searchParams.append("post",t);const o=Wh.parse({pseudonym:r,msg:i});return(await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json","X-Comment-ID":s.id,"X-Comment-Token":s.token,"X-Comment-Timestamp":s.timestamp.toString()},body:JSON.stringify(o)})).ok}catch{return!1}},deleteComment:async(t,n)=>{const r=a(n);if(!r)return!1;try{const i=new URL("/api/comments",e);return i.searchParams.append("post",t),!!(await fetch(i,{method:"DELETE",headers:{"Content-Type":"application/json","X-Comment-ID":r.id,"X-Comment-Token":r.token,"X-Comment-Timestamp":r.timestamp.toString()}})).ok&&(o(n),!0)}catch{return!1}},canEditComment:e=>!!a(e),isMyComment:e=>{try{return JSON.parse(localStorage.getItem(r)||"[]").includes(e)}catch(e){return console.warn("Failed to check if my comment:",e),!1}},adminLogin:async(t,n)=>{try{const r=Hh.parse({username:t,password:n}),i=new URL("/admin/login",e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),credentials:"include"});if(s.ok){const e=await s.json();return Gh.parse(e)}return console.error("Admin login failed:",s.status,s.statusText),null}catch(e){return console.error("Error during admin login:",e),null}},adminLogout:async()=>{try{const t=new URL("/admin/logout",e),n=await fetch(t,{method:"POST",credentials:"include"});if(n.ok){const e=await n.json();return qh.parse(e).success}return!1}catch(e){return console.error("Error during admin logout:",e),!1}},checkAdminAuth:async()=>{try{const t=new URL("/admin/check",e),n=await fetch(t,{method:"GET",credentials:"include"});if(n.ok){const e=await n.json();return Jh.parse(e).authenticated}return!1}catch(e){return console.error("Error checking admin auth:",e),!1}}}})(this.apiUrl,this.prePowDifficulty,this.prePowSalt);me.setInstance(e);const t=new URL("/rss/thread",this.apiUrl);t.searchParams.append("post",this.post),this.rssFeedUrl=t.href}super.willUpdate(e)}updated(e){super.updated(e),e.has("post")&&this.updatedComments()}async firstUpdated(){console.debug("firstUpdated","apiUrl:",this.apiUrl),this.addEventListener("external-link-click",this.handleExternalLinkClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("external-link-click",this.handleExternalLinkClick),Xh&&(Kh.forEach(e=>e(-1)),Kh.clear(),Xh.terminate(),Xh=null)}async updatedComments(){try{const e=await me.getInstance().getComments(this.post);this.comments=e.comments,void 0!==e.isAdmin&&this.commentAdmin&&this.commentAdmin.updateAuthStatus(e.isAdmin)}catch(e){console.error("Error updating comments:",e)}}async handleRefCommentCancel(e){const t=e.detail;console.debug("Cancel reply to comment ID:",t),this.referenceComment?.id===t&&(this.referenceComment=null,this.isReply=!0,await this.updateComplete,this.commentInput?.focus())}handleDraftChange(e){this.draft=e.detail}handleNicknameChange(e){this.nickname=e.detail}async editedSubmit(){if(!this.referenceComment)return;if(this.isReply)return;const e=this.draft.trim();if(e)try{const t=await me.getInstance().updateComment(this.post,this.referenceComment.id,this.referenceComment.pseudonym||"",e);console.debug("Edit comment ID:",this.referenceComment.id,t),this.draft="",this.editPseudonym="",this.referenceComment=null,this.isReply=!0,await this.updatedComments()}catch(e){console.error("Failed to add comment:",e)}}async handleCommentSubmit(){if(this.referenceComment&&!this.isReply)return await this.editedSubmit(),void await this.updatedComments();const e=this.draft.trim();if(!e)return;const{pseudonym:t}=await zr(this.nickname),n=this.referenceComment&&this.referenceComment.id&&this.isReply?this.referenceComment.id:void 0;try{const r=await me.getInstance().addComment(this.post,t,e,n);console.debug("Added comment ID:",r),this.draft="",this.editPseudonym="",this.referenceComment=null,await this.updatedComments()}catch(e){return console.error("Failed to add comment:",e),void(this.errorMessage=e.message||"Failed to add comment. Please try again.")}}async handleCommentReply(e){const t=e.detail;console.debug("Reply to comment ID:",t);const n=this.comments.find(e=>e.id===t);n?(this.isReply||(this.draft=""),this.referenceComment=n,this.isReply=!0,await this.updateComplete,this.commentInput?.focus()):this.referenceComment=null}async handleCommentDelete(e){const t=e.detail;console.debug("Delete comment ID:",t),this.deleteCommentId=t}async handleCommentEdit(e){const t=e.detail;console.debug("Edit comment ID:",t);const n=this.comments.find(e=>e.id===t);n?(this.referenceComment=n,this.isReply=!1,this.draft=n.msg||"",this.editPseudonym=n.pseudonym||"",await this.updateComplete,this.commentInput?.focus()):this.referenceComment=null}async handleDeleteComment(){if(!this.deleteCommentId)return;const e=this.deleteCommentId;console.debug("Delete comment ID:",e);try{await me.getInstance().deleteComment(this.post,e)&&(console.debug("Deleted comment ID:",e),this.deleteCommentId="",await this.updatedComments())}catch(e){console.error("Failed to delete comment:",e),this.deleteCommentId=""}}}Ad=(e=>[,,,Yd(e?.[ep("metadata")]??null)])($d),Ed=new WeakMap,Cd=new WeakMap,Td=new WeakMap,zd=new WeakMap,Pd=new WeakMap,Od=new WeakMap,Md=new WeakMap,Id=new WeakMap,Nd=new WeakMap,Rd=new WeakMap,Ld=new WeakMap,Dd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,Fd=new WeakMap,Zd=new WeakMap,Bd=new WeakMap,Wd=new WeakMap,Hd=new WeakMap,Gd=new WeakMap,qd=new WeakMap,Jd=new WeakMap,Vd=new WeakMap,Xd=new WeakMap,ap(Ad,4,"post",xd,mp,Ed),ap(Ad,4,"apiUrl",_d,mp,Cd),ap(Ad,4,"adminName",wd,mp,Td),ap(Ad,4,"lang",kd,mp,zd),ap(Ad,4,"prePowSalt",vd,mp,Pd),ap(Ad,4,"prePowDifficulty",bd,mp,Od),ap(Ad,4,"customMessages",yd,mp,Md),ap(Ad,4,"draft",gd,mp,Id),ap(Ad,4,"nickname",fd,mp,Nd),ap(Ad,4,"comments",md,mp,Rd),ap(Ad,4,"editPseudonym",pd,mp,Ld),ap(Ad,4,"deleteCommentId",dd,mp,Dd),ap(Ad,4,"referenceComment",hd,mp,jd),ap(Ad,4,"isReply",ud,mp,Ud),ap(Ad,4,"showAdmin",ld,mp,Fd),ap(Ad,4,"showHelp",cd,mp,Zd),ap(Ad,4,"showNotify",ad,mp,Bd),ap(Ad,4,"showExternalLink",od,mp,Wd),ap(Ad,4,"externalLinkUrl",sd,mp,Hd),ap(Ad,4,"isAdmin",id,mp,Gd),ap(Ad,4,"rssFeedUrl",rd,mp,qd),ap(Ad,4,"errorMessage",nd,mp,Jd),ap(Ad,4,"commentInput",td,mp,Vd),ap(Ad,4,"commentAdmin",ed,mp,Xd),(mp=ap(Ad,0,"YangChunComment",Sd,mp)).styles=[de,pe,s`
|
|
911
|
+
:host {
|
|
912
|
+
display: block;
|
|
913
|
+
}
|
|
914
|
+
.dialog-actions {
|
|
915
|
+
margin-top: var(--ycc-spacing-m);
|
|
916
|
+
display: flex;
|
|
917
|
+
justify-content: flex-end;
|
|
918
|
+
gap: var(--ycc-spacing-s);
|
|
919
|
+
}
|
|
920
|
+
.help-content {
|
|
921
|
+
display: flex;
|
|
922
|
+
flex-direction: column;
|
|
923
|
+
gap: var(--ycc-spacing-m);
|
|
924
|
+
}
|
|
925
|
+
.help-desc p {
|
|
926
|
+
margin: 0 0 var(--ycc-spacing-s) 0;
|
|
927
|
+
}
|
|
928
|
+
.help-desc p:last-child {
|
|
929
|
+
margin-bottom: 0;
|
|
930
|
+
}
|
|
931
|
+
.help-md-sample {
|
|
932
|
+
background-color: var(--ycc-bg-secondary);
|
|
933
|
+
padding: var(--ycc-spacing-m);
|
|
934
|
+
border-radius: var(--ycc-radius);
|
|
935
|
+
font-family: var(--ycc-font-monospace);
|
|
936
|
+
font-size: 0.9em;
|
|
937
|
+
line-height: 1.6;
|
|
938
|
+
white-space: pre;
|
|
939
|
+
overflow-x: auto;
|
|
940
|
+
margin: 0;
|
|
941
|
+
}
|
|
942
|
+
.help-footer {
|
|
943
|
+
font-size: 0.85em;
|
|
944
|
+
color: var(--ycc-text-secondary);
|
|
945
|
+
text-align: center;
|
|
946
|
+
margin-top: var(--ycc-spacing-xs);
|
|
947
|
+
}
|
|
948
|
+
.help-footer a {
|
|
949
|
+
color: var(--ycc-primary-color);
|
|
950
|
+
text-decoration: none;
|
|
951
|
+
}
|
|
952
|
+
.help-footer a:hover {
|
|
953
|
+
text-decoration: underline;
|
|
954
|
+
}
|
|
955
|
+
.external-link-url {
|
|
956
|
+
word-break: break-all;
|
|
957
|
+
color: var(--ycc-primary-color);
|
|
958
|
+
font-family: var(--ycc-font-monospace);
|
|
959
|
+
font-size: 0.9em;
|
|
960
|
+
}
|
|
961
|
+
`],op(Ad,1,mp);export{mp as YangChunComment};
|
|
962
|
+
//# sourceMappingURL=yangchun-comment.js.map
|