@qaecy/cue-ui 0.0.21 → 0.0.23
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/112.js +1 -0
- package/149.js +1 -0
- package/245.js +1 -1
- package/247.js +3 -0
- package/284.js +1 -1
- package/{236.js → 311.js} +1 -1
- package/334.js +1 -0
- package/336.js +1 -1
- package/376.js +1 -1
- package/382.js +1 -0
- package/393.js +1 -0
- package/418.js +1 -1
- package/419.js +1 -1
- package/523.js +1 -1
- package/540.js +1 -0
- package/544.js +1 -0
- package/560.js +1 -1
- package/571.js +1 -0
- package/60.js +1 -1
- package/722.js +1 -0
- package/740.js +1 -0
- package/741.js +1 -1
- package/903.js +1 -0
- package/911.js +1 -0
- package/960.js +1 -0
- package/995.js +1 -0
- package/README.md +144 -34
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/runtime.js +1 -1
- package/344.js +0 -1
- package/371.js +0 -1
- package/443.js +0 -1
- package/570.js +0 -1
- package/613.js +0 -1
- package/710.js +0 -1
- package/774.js +0 -1
- package/83.js +0 -1
package/376.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{6376(k,g,b){function d(s,e){let t=function m(s,e){let r=0;return s.color?r=s.color:e.tables&&e.tables.layer&&e.tables.layer.layers[s.layer]&&(r=e.tables.layer.layers[s.layer].color),(null==r||16777215===r)&&(r=0),r}(s,e).toString(16);for(;t.length<6;)t="0"+t;return"#"+t}function A(s){if(s=function T(s){let e=s.replace(/\\P/g,"\n");return e=e.replace(/\\X/g,"\n"),e}(s),!s.includes(";"))return{text:w(s)};let e=s;const r={};["f","A","Q","H","W","T"].forEach(i=>{r[i]=function $(s,e,r){const t=new RegExp(`(?<=${e})(.*?)(?=${r})`,"s"),i=s.match(t);return i?i[1].trim():void 0}(s,`\\\\${i}`,";"),void 0!==r[i]&&(e=e.replace(`\\${i}${r[i]};`,""))});const t=s.lastIndexOf(";");return s=w(s.substring(t+1)),e=e.replace(s,""),{text:s,formatting:r}}function w(s){return(s=(s=(s=(s=s.replace(/\\{/g,"\0LBRACE")).replace(/\\}/g,"\0RBRACE")).replace(/[{}]/g,"")).replace(/__LBRACE__/g,"{")).replace(/__RBRACE__/g,"}")}b.r(g),b.d(g,{DrawEntitySVG:()=>x});const f="http://www.w3.org/2000/svg";class x{_svg;_currentGroup;entityMap=new Map;_idCounter=0;constructor(){this._svg=document.createElementNS(f,"svg"),this._svg.setAttribute("xmlns",f)}fromEntity(e,r,t=!0){t||this._resetSVG(),Array.isArray(e)?e.forEach(i=>this.fromEntity(i,r,!0)):"ARC"===e.type?this._drawArc(e,r):"CIRCLE"===e.type?this._drawCircle(e,r):"INSERT"===e.type?this._drawBlock(e,r):"LINE"===e.type?this._drawLine(e,r):"LWPOLYLINE"===e.type||"POLYLINE"===e.type?this._drawPath(e,r):"POINT"===e.type?this._drawPoint(e,r):"SPLINE"===e.type?this._drawSpline(e,r):"SOLID"===e.type?this._drawSolid(e,r):"ELLIPSE"===e.type?this._drawEllipse(e,r):"TEXT"===e.type?this._drawText(e,r):"MTEXT"===e.type?this._drawMtext(e,r):"DIMENSION"===e.type&&!(7&e.dimensionType)&&this._drawDimension(e,r)}asString(){return this._svg.outerHTML}asElement(){return this._svg}_resetSVG(){this._svg=document.createElementNS(f,"svg"),this._svg.setAttribute("xmlns",f),this.entityMap.clear(),this._idCounter=0}_drawBlock(e,r){const t=r.blocks[e.name];if(!t||!t.entities)return;const i=this._appendElementOfType("g",e);this._currentGroup=i;const n=this._buildGroupTransformation(e);""!==n&&i.setAttribute("transform",n),t.entities.forEach(o=>{this.fromEntity(o,r)}),this._currentGroup=void 0}_drawLine(e,r){const t=this._appendElementOfType("line",e);t.setAttribute("x1",e.vertices[0].x.toString()),t.setAttribute("y1",e.vertices[0].y.toString()),t.setAttribute("x2",e.vertices[1].x.toString()),t.setAttribute("y2",e.vertices[1].y.toString()),this._setStrokeFill(e,r,t)}_drawPath(e,r){const t=e.vertices.some(c=>void 0!==c.bulge&&Math.abs(c.bulge)>1e-4);if(2===e.vertices.length&&!t)return this._drawLine(e,r);const i=this._appendElementOfType("path",e);let n=!0===e.shape||!0===e.closed,o=e.vertices;if(!n&&o.length>3){const c=o[0],a=o[o.length-1];Math.abs(c.x-a.x)<.001&&Math.abs(c.y-a.y)<.001&&(n=!0,o=o.slice(0,-1))}const u=this._verticeArrayToPath(o,n,e.extrusion);i.setAttribute("d",u),this._setStrokeFill(e,r,i)}_drawArc(e,r){const t=this._appendElementOfType("path",e),i=this._arcPath(e.center,e.radius,e.startAngle,e.endAngle,e.extrusion);t.setAttribute("d",i),this._setStrokeFill(e,r,t)}_drawCircle(e,r){const t=this._appendElementOfType("circle",e);t.setAttribute("cx",e.center.x.toString()),t.setAttribute("cy",e.center.y.toString()),t.setAttribute("r",e.radius.toString()),this._setStrokeFill(e,r,t)}_drawText(e,r){const t=this._appendElementOfType("text",e);t.setAttribute("x",e.startPoint.x.toString()),t.setAttribute("y",e.startPoint.y.toString());const i=A(e.text);t.innerHTML=i.text,this._setTextAppearance(e,r,t)}_drawPoint(e,r){const t=this._appendElementOfType("circle",e);t.setAttribute("cx",e.position.x.toString()),t.setAttribute("cy",e.position.y.toString()),t.setAttribute("r","0.0001"),t.setAttribute("stroke",d(e,r)),t.setAttribute("fill","none"),t.setAttribute("vector-effect","non-scaling-stroke"),t.setAttribute("stroke-width","2"),t.classList.add("dxf-path")}_drawDimension(e,r){const t=r.blocks[e.block];if(!t||!t.entities)return;const i=this._appendElementOfType("g",e);this._currentGroup=i,t.entities.forEach(n=>{this.fromEntity(n,r)}),this._currentGroup=void 0}_drawEllipse(e,r){}_drawSpline(e,r){}_drawSolid(e,r){}_drawMtext(e,r){const t=this._appendElementOfType("text",e);t.setAttribute("x",e.position.x.toString()),t.setAttribute("y",e.position.y.toString());const i=A(e.text);t.innerHTML=i.text,this._setMTextAppearance(e,r,t)}_setStrokeFill(e,r,t){t.setAttribute("stroke",d(e,r)),t.setAttribute("fill","none"),t.setAttribute("stroke-width",((void 0!==e.lineweight&&e.lineweight>0?e.lineweight:25)/1e5).toString()),t.setAttribute("vector-effect","non-scaling-stroke"),t.classList.add("dxf-path")}_setTextAppearance(e,r,t){t.setAttribute("fill",d(e,r)),t.setAttribute("font-size",(e.textHeight/1e3).toString()),e.rotation&&t.setAttribute("transform",`rotate(${e.rotation})`)}_setMTextAppearance(e,r,t){t.setAttribute("fill",d(e,r)),t.setAttribute("font-size",(e.height/1e3).toString()),e.rotation&&t.setAttribute("transform",`rotate(${e.rotation})`)}_buildGroupTransformation(e){let r="";return void 0!==e.position&&(r+=` translate(${e.position.x} ${e.position.y})`),void 0!==e.xScale&&void 0!==e.yScale&&(r+=` scale(${e.xScale} ${e.yScale})`),void 0!==e.rotation&&(r+=` rotate(${e.rotation})`),r.trim()}_appendElementOfType(e,r){const t=document.createElementNS(f,e);if(r){const i="dxf-entity-"+this._idCounter++;t.setAttribute("data-dxf-id",i),this.entityMap.set(i,r)}return void 0!==this._currentGroup?this._currentGroup.appendChild(t):this._svg.appendChild(t),t}_arcPath(e,r,t,i,n){const o=e.x+r*Math.cos(t),u=e.y+r*Math.sin(t),c=e.x+r*Math.cos(i),a=e.y+r*Math.sin(i),h=n&&n.z<0;let l=i-t;for(;l<0;)l+=2*Math.PI;for(;l>2*Math.PI;)l-=2*Math.PI;return l<1e-4?`M ${o} ${u}`:`M ${o} ${u} A ${r} ${r} 0 ${l>Math.PI?1:0} ${h?0:1} ${c} ${a}`}_verticeArrayToPath(e,r=!1,t){let i="";const n=r?e.length:e.length-1;for(let o=0;o<n;o++){const{x:u,y:c,bulge:a}=e[o],{x:h,y:l}=e[(o+1)%e.length];if(void 0!==a&&Math.abs(a)>1e-4){const _=Math.sqrt((u-h)**2+(c-l)**2),p=Math.abs(a),S=_/2*(1+p*p)/(2*p),E=t&&t.z<0;0===o&&(i+=`M ${u} ${c} `),i+=`A ${S} ${S} 0 ${p>1?1:0} ${a>0?E?0:1:E?1:0} ${h} ${l} `}else 0===o&&(i+=`M ${u} ${c} `),i+=`L ${h} ${l} `}return r&&(i+=" Z"),i.trim()}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{4376(Nn,rt,k){k.d(rt,{MarkdownViewer:()=>Pn});var Ie=k(467),f=k(5802),$=k(7705),S=k(5547),Te=k(4226),Ee=k(2771),se=k(7673),st=k(4572),ot=k(1397),it=k(8141),at=k(9437);const Ce=(0,k(1853).L)(o=>function(){o(this),this.name="EmptyError",this.message="no elements in sequence"});var ct=k(5964),pt=k(6697),Re=k(9974),Oe=k(4360);function ht(o=dt){return(0,Re.N)((r,e)=>{let t=!1;r.subscribe((0,Oe._)(e,n=>{t=!0,e.next(n)},()=>t?e.complete():e.error(o())))})}function dt(){return new Ce}var gt=k(3669);function Be(o,r){const e=arguments.length>=2;return t=>t.pipe(o?(0,ct.p)((n,s)=>o(n,s,t)):gt.D,(0,pt.s)(1),e?function ut(o){return(0,Re.N)((r,e)=>{let t=!1;r.subscribe((0,Oe._)(e,n=>{t=!0,e.next(n)},()=>{t||e.next(o),e.complete()}))})}(r):ht(()=>new Ce))}var ft=k(6354),G=k(177),mt=k(345);const Pe=new f.nKC("All of the settings registered in the whole app."),oe=new f.nKC("The settings collected from all ancestor injectors"),Ne=new f.nKC("The settings for the currently loaded module."),F="__ngx_dynamic_hooks_content",ie="dynamic-component-anchor",I="__ngx_dynamic_hooks_anchor_id",C="__ngx_dynamic_hooks_anchor_parsetoken",kt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];var ae=function(o){return o[o.All=0]="All",o[o.Linear=1]="Linear",o[o.None=2]="None",o}(ae||{});const b={},$e="[a-zA-Z_$]+[a-zA-Z0-9_$]*",le="[a-zA-Z$\\-_:][a-zA-Z$\\-_:0-9\\.]*";function T(o,r){if(!r.global)throw Error("TypeError: matchAll called with a non-global RegExp argument");const e=[];let t=r.exec(o);for(;null!==t;)e.push(t),t=r.exec(o);return r.lastIndex=0,e}function ce(o){return void 0!==o?.__ngContext__}b.attributeNameNoBracketsRegex="("+le+")",b.attributeNameBracketsRegex="\\[("+le+")\\]",b.attributeNameRoundBracketsRegex="\\(("+le+")\\)",b.attributeNameRegex="(?:"+b.attributeNameNoBracketsRegex+"|"+b.attributeNameBracketsRegex+"|"+b.attributeNameRoundBracketsRegex+")",b.attributeValueDoubleQuotesRegex='"((?:\\\\.|[^"])*?)"',b.attributeValueSingleQuotesRegex="'((?:\\\\.|[^'])*?)'",b.variablePathDotNotation="\\."+$e,b.variableBracketsNotation="\\[[^\\]]*\\]",b.variablePathFunctionCall="\\([^\\)]*\\)",b.variablePathPartRegex="(?:"+b.variablePathDotNotation+"|"+b.variableBracketsNotation+"|"+b.variablePathFunctionCall+")",b.contextVariableRegex="context"+b.variablePathPartRegex+"*",b.placeholderVariablePathDotNotation="\\@@@cxtDot@@@"+$e,b.placeholderVariableBracketsNotation="@@@cxtOpenSquareBracket@@@[^\\]]*@@@cxtCloseSquareBracket@@@",b.placeholderVariablePathFunctionCall="@@@cxtOpenRoundBracket@@@[^\\)]*@@@cxtCloseRoundBracket@@@",b.placeholderVariablePathPartRegex="(?:"+b.placeholderVariablePathDotNotation+"|"+b.placeholderVariableBracketsNotation+"|"+b.placeholderVariablePathFunctionCall+")",b.placeholderContextVariableRegex="__CXT__"+b.placeholderVariablePathPartRegex+"*";class wt{constructor(r,e,t,n){this.configResolver=e,this.tagHookFinder=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHooks(r,e,t){let n=this.config.enclosing?this.tagHookFinder.findEnclosingTags(r,this.config.selector,this.config.bracketStyle,t):this.tagHookFinder.findSingleTags(r,this.config.selector,this.config.bracketStyle,t);return this.config.allowSelfClosing&&(n=[...n,...this.tagHookFinder.findSelfClosingTags(r,this.config.selector,this.config.bracketStyle,t)],n.sort((s,i)=>s.openingTagStartIndex-i.openingTagStartIndex)),n}loadComponent(r,e,t,n,s){return{component:this.config.component,hostElementTag:this.config.hostElementTag||this.config.selector,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.openingTag),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}createBindings(r){const e=this.collectRawInputs(r),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawOutputs(r),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawInputs(r){const e=this.getBindingsFromOpeningTag(r,"noBracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t=this.getBindingsFromOpeningTag(r,"bracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null);for(const[n,s]of Object.entries(e))e[n]="'"+s+"'";return{...e,...t}}collectRawOutputs(r){return this.getBindingsFromOpeningTag(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null)}getBindingsFromOpeningTag(r,e,t,n){const s={},i="(?:"+b.attributeValueDoubleQuotesRegex+"|"+b.attributeValueSingleQuotesRegex+")";let a;switch(e){case"noBracketInputs":a=b.attributeNameNoBracketsRegex;break;case"bracketInputs":a=b.attributeNameBracketsRegex;break;case"outputs":a=b.attributeNameRoundBracketsRegex}const p=T(r,new RegExp(a+"="+i,"gim"));for(const u of p){let h=u[2]||u[3];void 0===h&&"noBracketInputs"===e&&(h=""),s[u[1]]=h}const d={};for(const[u,h]of Object.entries(s))t&&t.includes(u)||n&&!n.includes(u)||(d[u]=h);return d}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}class St{constructor(r,e,t,n){this.configResolver=e,this.platformService=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHookElements(r,e,t){return Array.from(this.platformService.querySelectorAll(r,this.config.selector))}loadComponent(r,e,t,n,s){return this.scrubAngularBindingAttrs(e.element),{component:this.config.component,hostElementTag:this.config.hostElementTag,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.elementSnapshot),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}scrubAngularBindingAttrs(r){const e=Array.from(r.attributes).map(t=>t.name).filter(t=>t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")"));for(const t of e)this.platformService.removeAttribute(r,t)}createBindings(r){const e=this.collectRawBindings(r,"inputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawBindings(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawBindings(r,e,t,n){const s={},i=this.platformService.getAttributeNames(r);for(let l of i)if("inputs"===e&&(!l.startsWith("(")||!l.endsWith(")"))||"outputs"===e&&l.startsWith("(")&&l.endsWith(")")){let c=this.platformService.getAttribute(r,l);"inputs"===e&&l.startsWith("[")&&l.endsWith("]")&&""===c&&(c=void 0),"inputs"===e&&(!l.startsWith("[")||!l.endsWith("]"))&&(c=`'${c}'`),l=l.replace(/^\[|^\(|\]$|\)$/g,""),s[l]=c}const a={};for(const[l,c]of Object.entries(s))t&&t.includes(l)||n&&!n.includes(l)||(a[l]=c);return a}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}const It={component:void 0,name:void 0,parseWithRegex:!1,selector:void 0,hostElementTag:void 0,injector:void 0,allowSelfClosing:!0,enclosing:!0,bracketStyle:{opening:"<",closing:">"},parseInputs:!0,unescapeStrings:!0,inputsBlacklist:void 0,inputsWhitelist:void 0,outputsBlacklist:void 0,outputsWhitelist:void 0,allowContextInBindings:!0,allowContextFunctionCalls:!0};let Tt=(()=>{class o{constructor(){}processConfig(e){const t=JSON.parse(JSON.stringify(It));if(!e||!e.hasOwnProperty("component"))throw Error('Missing the required "component" property for the SelectorHookParserConfig. Must be either the component class or a LazyLoadComponentConfig.');if(t.component=e.component,e.component.hasOwnProperty("prototype")){const n=(0,$.HJs)(e.component);t.selector=n.selector}else{if(!e.component.hasOwnProperty("importPromise")||!e.component.hasOwnProperty("importName"))throw Error('The "component" property in the SelectorHookParserConfig must either contain the component class or a LazyLoadComponentConfig.');if(!e.hasOwnProperty("selector"))throw Error('When using lazy-loaded dynamic components, you have to specify the "selector" property in the parser config, as the real selector can\'t be known before the component is loaded.')}if(e.hasOwnProperty("name")){if("string"!=typeof e.name)throw Error('The submitted "name" property in the SelectorHookParserConfig must be of type string, was '+typeof e.name);t.name=e.name}if(e.hasOwnProperty("selector")){if("string"!=typeof e.selector)throw Error('The submitted "selector" property in the SelectorHookParserConfig must be of type string, was '+typeof e.selector);t.selector=e.selector}if(e.hasOwnProperty("hostElementTag")){if("string"!=typeof e.hostElementTag)throw Error('The submitted "hostElementTag" property in the SelectorHookParserConfig must be of type string, was '+typeof e.hostElementTag);t.hostElementTag=e.hostElementTag}if(e.hasOwnProperty("parseWithRegex")){if("boolean"!=typeof e.parseWithRegex)throw Error('The submitted "parseWithRegex" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseWithRegex);t.parseWithRegex=e.parseWithRegex}if(e.hasOwnProperty("allowSelfClosing")){if("boolean"!=typeof e.allowSelfClosing)throw Error('The submitted "allowSelfClosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowSelfClosing);t.allowSelfClosing=e.allowSelfClosing}if(e.hasOwnProperty("enclosing")){if("boolean"!=typeof e.enclosing)throw Error('The submitted "enclosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.enclosing);t.enclosing=e.enclosing}if(e.hasOwnProperty("bracketStyle")){if("object"!=typeof e.bracketStyle||"string"!=typeof e.bracketStyle.opening||"string"!=typeof e.bracketStyle.closing)throw Error('The submitted "bracketStyle" property in the SelectorHookParserConfig must have the form {opening: string, closing: string}');t.bracketStyle=e.bracketStyle}if(e.hasOwnProperty("injector")&&(t.injector=e.injector),e.hasOwnProperty("environmentInjector")&&(t.environmentInjector=e.environmentInjector),e.hasOwnProperty("unescapeStrings")){if("boolean"!=typeof e.unescapeStrings)throw Error('The submitted "unescapeStrings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.unescapeStrings);t.unescapeStrings=e.unescapeStrings}if(e.hasOwnProperty("parseInputs")){if("boolean"!=typeof e.parseInputs)throw Error('The submitted "parseInputs" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseInputs);t.parseInputs=e.parseInputs}if(e.hasOwnProperty("inputsBlacklist")){if(!Array.isArray(e.inputsBlacklist))throw Error('The submitted "inputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsBlacklist=e.inputsBlacklist}if(e.hasOwnProperty("inputsWhitelist")){if(!Array.isArray(e.inputsWhitelist))throw Error('The submitted "inputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsWhitelist=e.inputsWhitelist}if(e.hasOwnProperty("outputsBlacklist")){if(!Array.isArray(e.outputsBlacklist))throw Error('The submitted "outputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsBlacklist=e.outputsBlacklist}if(e.hasOwnProperty("outputsWhitelist")){if(!Array.isArray(e.outputsWhitelist))throw Error('The submitted "outputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsWhitelist=e.outputsWhitelist}if(e.hasOwnProperty("allowContextInBindings")){if("boolean"!=typeof e.allowContextInBindings)throw Error('The submitted "allowContextInBindings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextInBindings);t.allowContextInBindings=e.allowContextInBindings}if(e.hasOwnProperty("allowContextFunctionCalls")){if("boolean"!=typeof e.allowContextFunctionCalls)throw Error('The submitted "allowContextFunctionCalls" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextFunctionCalls);t.allowContextFunctionCalls=e.allowContextFunctionCalls}return t}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const De=new f.nKC("An injection token to retrieve an optionally user-provided PlatformService");let Et=(()=>{class o{constructor(e,t,n){this.document=e,this.rendererFactory=t,this.sanitizer=n,this.renderer=this.rendererFactory.createRenderer(null,null)}getNgVersion(){if(typeof this.document<"u"){const t=this.querySelectorAll(this.document,"[ng-version]")?.[0]?.getAttribute("ng-version");if(t)return parseInt(t,10)}return null}sanitize(e){return this.sanitizer.sanitize(S.WPN.HTML,e)||""}createElement(e){return this.renderer.createElement(e)}sortElements(e,t){return e===t?0:e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:e.sourceIndex-t.sourceIndex}cloneElement(e){return e.cloneNode(!0)}getTagName(e){return e.tagName}getOpeningTag(e){const n=e.outerHTML.length;return e.outerHTML.slice(0,"/"===e.outerHTML[n-2]?n:n-e.innerHTML.length-e.tagName.length-3)}getClosingTag(e){return e.outerHTML.slice(e.outerHTML.length-e.tagName.length-3)}getAttributeNames(e){return"function"==typeof e.getAttributeNames?e.getAttributeNames():[]}getAttribute(e,t){return"function"==typeof e.getAttribute?e.getAttribute(t):null}setAttribute(e,t,n){this.renderer.setAttribute(e,t,n)}removeAttribute(e,t){this.renderer.removeAttribute(e,t)}getParentNode(e){try{return this.renderer.parentNode(e)}catch{return null}}querySelectorAll(e,t){return Array.from(e.querySelectorAll(t))}getChildNodes(e){return Array.prototype.slice.call(e.childNodes)}appendChild(e,t){this.renderer.appendChild(e,t)}insertBefore(e,t,n){this.renderer.insertBefore(e,t,n)}clearChildNodes(e){if(e)for(;e.firstChild;)this.removeChild(e,e.firstChild)}removeChild(e,t){e.removeChild(t)}getInnerContent(e){return e.innerHTML}setInnerContent(e,t){e&&(e.innerHTML=t)}isTextNode(e){return e.nodeType===Node.TEXT_NODE}createTextNode(e){return document.createTextNode(e)}getTextContent(e){return e.textContent}dispatchEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(f.qQL),f.KVO(S._9s),f.KVO(mt.up))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),V=(()=>{class o{constructor(e,t){this.userPlatformService=e,this.defaultPlatformService=t}getFor(e){return this.userPlatformService&&"function"==typeof this.userPlatformService[e]?this.userPlatformService:this.defaultPlatformService}getNgVersion(){return this.getFor("getNgVersion").getNgVersion()}sanitize(e){return this.getFor("sanitize").sanitize(e)}createElement(e){return this.getFor("createElement").createElement(e)}sortElements(e,t){return this.getFor("sortElements").sortElements(e,t)}cloneElement(e){return this.getFor("cloneElement").cloneElement(e)}getTagName(e){return this.getFor("getTagName").getTagName(e)}getOpeningTag(e){return this.getFor("getOpeningTag").getOpeningTag(e)}getClosingTag(e){return this.getFor("getClosingTag").getClosingTag(e)}getAttributeNames(e){return this.getFor("getAttributeNames").getAttributeNames(e)}getAttribute(e,t){return this.getFor("getAttribute").getAttribute(e,t)}setAttribute(e,t,n){return this.getFor("setAttribute").setAttribute(e,t,n)}removeAttribute(e,t){return this.getFor("removeAttribute").removeAttribute(e,t)}getParentNode(e){return this.getFor("getParentNode").getParentNode(e)}querySelectorAll(e,t){return this.getFor("querySelectorAll").querySelectorAll(e,t)}getChildNodes(e){return this.getFor("getChildNodes").getChildNodes(e)}appendChild(e,t){return this.getFor("appendChild").appendChild(e,t)}insertBefore(e,t,n){return this.getFor("insertBefore").insertBefore(e,t,n)}clearChildNodes(e){return this.getFor("clearChildNodes").clearChildNodes(e)}removeChild(e,t){return this.getFor("removeChild").removeChild(e,t)}getInnerContent(e){return this.getFor("getInnerContent").getInnerContent(e)}setInnerContent(e,t){return this.getFor("setInnerContent").setInnerContent(e,t)}isTextNode(e){return this.getFor("isTextNode").isTextNode(e)}createTextNode(e){return this.getFor("createTextNode").createTextNode(e)}getTextContent(e){return this.getFor("getTextContent").getTextContent(e)}dispatchEvent(e,t,n){return this.getFor("dispatchEvent").dispatchEvent(e,t,n)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(De,8),f.KVO(Et))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),A=(()=>{class o{constructor(e){this.platformId=e}log(e,t){this.handleLog(e,t,"log")}warn(e,t){this.handleLog(e,t,"warn")}error(e,t){this.handleLog(e,t,"error")}handleLog(e,t,n){(t.logOptions?.dev&&this.isDevMode()&&(0,G.UE)(this.platformId)||t.logOptions?.prod&&!this.isDevMode()&&(0,G.UE)(this.platformId)||t.logOptions?.ssr&&!(0,G.UE)(this.platformId))&&console[n](...e)}isDevMode(){return(0,$.naY)()}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(S.Agw))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ct=(()=>{class o{constructor(e){this.logger=e}find(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){return n?this.findEnclosingHooks(e,t,n,s,i):this.findSingletagHooks(e,t)}findSingletagHooks(e,t){const n=[],s=T(e,t);for(const i of s)n.push({openingTagStartIndex:i.index,openingTagEndIndex:i.index+i[0].length,closingTagStartIndex:null,closingTagEndIndex:null});return n}findEnclosingHooks(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const a=[],l=[],c=T(e,t);for(const u of c)a.push({isOpening:!0,value:u[0],startIndex:u.index,endIndex:u.index+u[0].length});const p=T(e,n);for(const u of p)a.push({isOpening:!1,value:u[0],startIndex:u.index,endIndex:u.index+u[0].length});a.sort((u,h)=>u.startIndex-h.startIndex);const d=[];for(const[u,h]of a.entries())if(u>0&&h.startIndex<a[u-1].endIndex)this.logger.warn(['Syntax error - New tag "'+h.value+'" started at position '+h.startIndex+' before previous tag "'+a[u-1].value+'" ended at position '+a[u-1].endIndex+". Ignoring."],i);else if(h.isOpening)d.push(h);else{if(0===d.length){this.logger.warn(['Syntax error - Closing tag without preceding opening tag found: "'+h.value+'". Ignoring.'],i);continue}if(!1===s&&d.length>1){d.pop();continue}const g=d[d.length-1];l.push({openingTagStartIndex:g.startIndex,openingTagEndIndex:g.startIndex+g.value.length,closingTagStartIndex:h.startIndex,closingTagEndIndex:h.startIndex+h.value.length}),d.pop()}return d.length>0&&this.logger.warn(["Syntax error - Opening tags without corresponding closing tags found."],i),l}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Rt=(()=>{class o{constructor(e){this.hookFinder=e}findSingleTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n);return this.hookFinder.find(e,i,void 0,void 0,s)}findEnclosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n),a=this.generateClosingTagRegex(t,n);return this.hookFinder.find(e,i,a,!0,s)}findSelfClosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n,!0);return this.hookFinder.find(e,i,void 0,void 0,s)}generateOpeningTagRegex(e,t={opening:"<",closing:">"},n=!1){const s=this.escapeRegex(t.opening),i=this.escapeRegex(e),a=(n?"\\/":"")+this.escapeRegex(t.closing);return new RegExp(s+i+"(?:\\s*"+a+"|(?:\\s+"+b.attributeNameRegex+"=(?:"+b.attributeValueDoubleQuotesRegex+"|"+b.attributeValueSingleQuotesRegex+"))+\\s*"+a+")","gim")}generateClosingTagRegex(e,t={opening:"<",closing:">"}){const n=this.escapeRegex(t.opening)+"/",s=this.escapeRegex(e),i=this.escapeRegex(t.closing);return new RegExp(n+s+i,"gim")}escapeRegex(e){return e.replace(new RegExp("[-\\/\\\\^$*+?.()|[\\]{}]","g"),"\\$&")}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Ct))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ot=(()=>{class o{encodeSubstrings(e){const i=[...T(e,/'/gm).filter(p=>0===p.index||"\\"!==e[p.index-1]),...T(e,/"/gm).filter(p=>0===p.index||"\\"!==e[p.index-1]),...T(e,/`/gm).filter(p=>0===p.index||"\\"!==e[p.index-1])];i.sort((p,d)=>p.index-d.index);const a=[];let l=null;for(const p of i)l?l[0]===p[0]&&(a.push({startIndex:l.index+1,endIndex:p.index}),l=null):l=p;if(null!==l)throw Error("Input parse error. String was opened, but not closed.");return this.encodeTextSegments(e,a,this.encodeStringSpecialChars)}encodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/'/g,"@@@singlequote@@@")).replace(/"/g,"@@@doublequote@@@")).replace(/`/g,"@@@gravequote@@@")).replace(/:/g,"@@@colon@@@")).replace(/;/g,"@@@semicolon@@@")).replace(/\./g,"@@@dot@@@")).replace(/,/g,"@@@comma@@@")).replace(/\\/g,"@@@backslash@@@")).replace(/\(/g,"@@@openRoundBracket@@@")).replace(/\)/g,"@@@closeRoundBracket@@@")).replace(/\[/g,"@@@openSquareBracket@@@")).replace(/\]/g,"@@@closeSquareBracket@@@")).replace(/\{/g,"@@@openCurlyBracket@@@")).replace(/\}/g,"@@@closeCurlyBracket@@@")}decodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/@@@singlequote@@@/g,"'")).replace(/@@@doublequote@@@/g,'"')).replace(/@@@gravequote@@@/g,"`")).replace(/@@@colon@@@/g,":")).replace(/@@@semicolon@@@/g,";")).replace(/@@@dot@@@/g,".")).replace(/@@@comma@@@/g,",")).replace(/@@@backslash@@@/g,"\\")).replace(/@@@openRoundBracket@@@/g,"(")).replace(/@@@closeRoundBracket@@@/g,")")).replace(/@@@openSquareBracket@@@/g,"[")).replace(/@@@closeSquareBracket@@@/g,"]")).replace(/@@@openCurlyBracket@@@/g,"{")).replace(/@@@closeCurlyBracket@@@/g,"}")}encodeSubfunctions(e){const s=[...T(e,/\(/gm),...T(e,/\)/gm)];s.sort((c,p)=>c.index-p.index);const i=[],a=[];for(const c of s)if("("===c[0])a.push(c);else{if(0===a.length)throw Error("Input parse error. Closed function bracket without opening it first.");1===a.length&&i.push({startIndex:a[0].index+1,endIndex:c.index}),a.pop()}if(0!==a.length)throw Error("Input parse error. Opened function bracket without closing it.");return this.encodeTextSegments(e,i,this.encodeFunctionBrackets)}encodeFunctionBrackets(e){return(e=e.replace(/\(/g,"@@@fnOpenBracket@@@")).replace(/\)/g,"@@@fnCloseBracket@@@")}decodeFunctionBrackets(e){return(e=e.replace(/@@@fnOpenBracket@@@/g,"(")).replace(/@@@fnCloseBracket@@@/g,")")}encodeVariableSubbrackets(e){const s=T(e,new RegExp("(?:[a-zA-Z_$\\])])(\\[)","gm")),i=[];for(const c of s){const p=e.substring(c.index+2),h=[...T(p,/\[/gm),...T(p,/\]/gm)];h.sort((m,w)=>m.index-w.index);let g=1;for(const m of h)if(g="]"===m[0]?g-1:g+1,0===g){i.push({startIndex:c.index+2,endIndex:c.index+2+m.index});break}if(0!==g)throw Error("Input parse error. Opened bracket without closing it.")}const a=[];for(const c of i)(0===a.length||a[a.length-1].endIndex<c.startIndex)&&a.push(c);return this.encodeTextSegments(e,a,this.encodeVariableBrackets)}encodeVariableBrackets(e){return(e=e.replace(/\[/g,"@@@variableOpeningBracket@@@")).replace(/\]/g,"@@@variableClosingBracket@@@")}decodeVariableBrackets(e){return(e=e.replace(/@@@variableOpeningBracket@@@/g,"[")).replace(/@@@variableClosingBracket@@@/g,"]")}transformContextVarIntoPlacerholder(e){return(e=(e=(e=(e=(e=(e="__CXT__"+e.substring(7)).replace(/\"/g,"@@@cxtDoubleQuote@@@")).replace(/\./g,"@@@cxtDot@@@")).replace(/\[/g,"@@@cxtOpenSquareBracket@@@")).replace(/\]/g,"@@@cxtCloseSquareBracket@@@")).replace(/\(/g,"@@@cxtOpenRoundBracket@@@")).replace(/\)/g,"@@@cxtCloseRoundBracket@@@")}transformPlaceholderIntoContextVar(e){return(e=(e=(e=(e=(e=(e="context"+e.substring(7)).replace(/@@@cxtDoubleQuote@@@/g,'"')).replace(/@@@cxtDot@@@/g,".")).replace(/@@@cxtOpenSquareBracket@@@/g,"[")).replace(/@@@cxtCloseSquareBracket@@@/g,"]")).replace(/@@@cxtOpenRoundBracket@@@/g,"(")).replace(/@@@cxtCloseRoundBracket@@@/g,")")}encodeTextSegments(e,t,n){const s=[];for(const l of t){const c=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:c,endIndex:l.startIndex,string:e.substring(c,l.startIndex)}),s.push({type:"special",startIndex:l.startIndex,endIndex:l.endIndex,string:e.substring(l.startIndex,l.endIndex)})}const i=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:i,endIndex:e.length-1,string:e.substring(i)});for(const l of s)"special"===l.type&&(l.string=n(l.string));let a="";for(const l of s)a+=l.string;return a}stripSlashes(e){return e.replace(/\\(.)/g,"$1")}escapeDoubleQuotes(e){return e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Bt=(()=>{class o{constructor(e,t){this.dataTypeEncoder=e,this.logger=t}evaluate(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){if("null"===e)return null;if("undefined"!==e){if("true"===e)return!0;if("false"===e)return!1;if(!isNaN(e))return parseInt(e,10);if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`")){let c=e.substring(1,e.length-1);return c=s?this.dataTypeEncoder.stripSlashes(c):c,c}if((e=this.encodeDataTypeString(e)).startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")){const c=this.parseAsJSON(e,s);return this.loadJSONVariables(c,t,n,s,i,a,l)}if("$event"===e)return n;if(e.match(new RegExp("^\\s*"+b.contextVariableRegex+"\\s*$","gm")))return this.loadContextVariable(e,t,n,s,i,a,l);throw Error('Data type for following input was not recognized and could not be parsed: "'+e+'"')}}encodeDataTypeString(e){return e=this.dataTypeEncoder.encodeSubstrings(e),e=this.dataTypeEncoder.encodeSubfunctions(e),this.dataTypeEncoder.encodeVariableSubbrackets(e)}decodeDataTypeString(e){return e=this.dataTypeEncoder.decodeStringSpecialChars(e),e=this.dataTypeEncoder.decodeFunctionBrackets(e),(e=this.dataTypeEncoder.decodeVariableBrackets(e)).trim()}parseAsJSON(e,t){if((e=(e=(e=e.replace(/\'(\\.|[^\'])*?\'/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/\`(\\.|[^\`])*?\`/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/"?([a-z0-9A-Z_]+)"?\s*:/g,'"$1": ')).match(/"?__proto__"?\s*:/g))throw Error('Setting the "__proto__" property in a hook input object is not allowed.');if(e.match(/"?prototype"?\s*:/g))throw Error('Setting the "prototype" property in a hook input object is not allowed.');if(e.match(/"?constructor"?\s*:/g))throw Error('Setting the "constructor" property in a hook input object is not allowed.');e=this.replaceValuesInJSONString(e,"undefined",l=>"null"),e=this.replaceValuesInJSONString(e,b.contextVariableRegex,l=>'"'+this.dataTypeEncoder.transformContextVarIntoPlacerholder(l)+'"'),e=this.replaceValuesInJSONString(e,"\\$event",l=>'"__EVENT__"');const a=JSON.parse(e);return this.decodeJSONStrings(a,t),a}replaceValuesInJSONString(e,t,n){return e.replace(new RegExp("(?:(:\\s*)("+t+")(?=\\s*[,}])|([\\[,]\\s*)("+t+")(?=\\s*[\\],]))","gm"),(a,l,c,p,d)=>(l||p)+n(c||d))}decodeJSONStrings(e,t){for(const n in e)if("string"==typeof e[n]){if('__EVENT__"'===e[n]||e[n].match(new RegExp("^\\s*"+b.placeholderContextVariableRegex+"\\s*$","gm")))continue;let s=this.decodeDataTypeString(e[n]);s=t?this.dataTypeEncoder.stripSlashes(s):s,e[n]=s}else"object"==typeof e[n]&&this.decodeJSONStrings(e[n],t)}loadJSONVariables(e,t,n,s,i,a,l){for(const c in e)if("string"==typeof e[c]){if("__EVENT__"===e[c])e[c]=n;else if(e[c].match(new RegExp("^\\s*"+b.placeholderContextVariableRegex+"\\s*$","gm"))){const p=this.dataTypeEncoder.transformPlaceholderIntoContextVar(e[c].trim());e[c]=this.loadContextVariable(p,t,n,s,i,a,l)}}else"object"==typeof e[c]&&this.loadJSONVariables(e[c],t,n,s,i,a,l);return e}loadContextVariable(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){try{const c=e.substring(7);if(""===c.trim())return t;const p=[],d=T(c,new RegExp(b.variablePathPartRegex,"gm"));for(const u of d){if(u[0].startsWith(".")&&p.push({type:"property",value:u[0].substring(1)}),u[0].startsWith("[")&&u[0].endsWith("]")){let h=u[0].substring(1,u[0].length-1);h=this.decodeDataTypeString(h),h=this.evaluate(h,t,n,s,i,a),p.push({type:"property",value:h})}if(u[0].startsWith("(")&&u[0].endsWith(")")){if(!a)throw Error("Tried to call a function in a context variable. This has been disallowed in the current config.");const h=u[0].substring(1,u[0].length-1),g=[];if(""!==h)for(const m of h.split(",")){let w=this.decodeDataTypeString(m);w=this.evaluate(w,t,n,s,i,a),g.push(w)}p.push({type:"function",value:g})}}try{const u=this.fetchContextVariable(t,p);return i[this.decodeDataTypeString(e)]=u,u}catch{throw Error('The required context variable "'+this.decodeDataTypeString(e)+'" could not be found in the context object. Returning undefined instead.')}}catch(c){return this.logger.warn([c],l),void(i[this.decodeDataTypeString(e)]=void 0)}}fetchContextVariable(e,t){if("__proto__"===t[0].value)throw Error("Accessing the __proto__ property through a context variable is not allowed.");if("prototype"===t[0].value)throw Error("Accessing the prototype property through a context variable is not allowed.");if("constructor"===t[0].value)throw Error("Accessing the constructor property through a context variable is not allowed.");if(void 0===e)throw Error("Context variable path could not be resolved. Trying to access "+("property"===t[0].type?'property "'+t[0].value+'" of undefined.':"undefined function."));let n;return"property"===t[0].type?e.hasOwnProperty(t[0].value)?(n=e[t[0].value],"function"==typeof n&&(n=n.bind(e))):e.__proto__.hasOwnProperty(t[0].value)?(n=e.__proto__[t[0].value],"function"==typeof n&&(n=n.bind(e))):n=void 0:"function"===t[0].type&&(n=e(...t[0].value)),t.shift(),t.length>0&&(n=this.fetchContextVariable(n,t)),n}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Ot),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),At=(()=>{class o{constructor(e,t){this.dataTypeParser=e,this.logger=t}checkInputBindings(e,t,n,s){for(const[i,a]of Object.entries(e))if(n.parseInputs)if(a.parsed)this.updateInputBindingIfStale(a,t,n);else try{a.value=this.dataTypeParser.evaluate(a.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,a.boundContextVariables,n.allowContextFunctionCalls,s),a.parsed=!0}catch(l){this.logger.error(["Hook input parsing error\nselector: "+n.selector+"\ninput: "+i+'\nvalue: "'+a.value+'"'],s),this.logger.error([l.stack],s),delete e[i]}else a.value=a.raw}updateInputBindingIfStale(e,t,n){if(Object.keys(e.boundContextVariables).length>0){let s=!1;for(const[i,a]of Object.entries(e.boundContextVariables)){const l=this.dataTypeParser.encodeDataTypeString(i);if(this.dataTypeParser.loadContextVariable(l,t,void 0,n.unescapeStrings,{},n.allowContextFunctionCalls)!==a){s=!0;break}}s&&(e.boundContextVariables={},e.value=this.dataTypeParser.evaluate(e.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,e.boundContextVariables,n.allowContextFunctionCalls))}}checkOutputBindings(e,t,n){for(const[s,i]of Object.entries(e))i.parsed||(i.value=(a,l)=>{try{this.dataTypeParser.evaluate(i.raw,t.allowContextInBindings?l:{},a,t.unescapeStrings,i.boundContextVariables,t.allowContextFunctionCalls)}catch(c){this.logger.error(["Hook output parsing error\nselector: "+t.selector+"\noutput: "+s+'\nvalue: "'+i.value+'"'],n),this.logger.error([c.stack],n)}},i.parsed=!0)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Bt),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Pt=(()=>{class o{constructor(e,t,n,s,i,a){this.injector=e,this.parserResolver=t,this.platformService=n,this.tagHookFinder=s,this.bindingsValueManager=i,this.logger=a}resolve(e,t,n,s,i){const a=[];for(const p of e){const d=this.resolveEntry(p,t,i);d&&a.push(d)}const l=this.validateParserFunctions(a,i);if(this.checkParserNames(l,i),!n&&!s)return l;this.checkBlackAndWhitelist(l,n,s,i);const c=[];for(const p of l)p.hasOwnProperty("name")&&"string"==typeof p.name&&(n&&n.includes(p.name)||s&&!s.includes(p.name))||c.push(p);return c}resolveEntry(e,t,n){if(e.hasOwnProperty("prototype")){if((0,$.HJs)(e))return this.createSelectorHookParser({component:e});try{return t.get(e)}catch{return new e}}else if("object"==typeof e){if("Object"!==e.constructor.name)return e;try{return this.createSelectorHookParser(e)}catch(s){return this.logger.error(["Invalid parser config - "+s.message,e],n),null}}return this.logger.error(["Invalid parser config - ",e],n),null}createSelectorHookParser(e){return e.hasOwnProperty("parseWithRegex")&&e.parseWithRegex||e.hasOwnProperty("enclosing")&&!e.enclosing||e.hasOwnProperty("bracketStyle")&&e.bracketStyle?new wt(e,this.parserResolver,this.tagHookFinder,this.bindingsValueManager):new St(e,this.parserResolver,this.platformService,this.bindingsValueManager)}validateParserFunctions(e,t){const n=[];for(const s of e)"function"==typeof s.findHooks||"function"==typeof s.findHookElements?"function"==typeof s.loadComponent?"function"==typeof s.getBindings?n.push(s):this.logger.error(['Submitted parser does not implement "getBindings()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser does not implement "loadComponent()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser neither implements "findHooks()" nor "findHookElements()". One is required. Removing from list of active parsers:',s],t);return n}checkParserNames(e,t){const n=e.map(a=>a.name).filter(a=>void 0!==a),s=[],i=[];for(const a of n)s.includes(a)&&!i.includes(a)&&(this.logger.warn(['Parser name "'+a+'" is not unique and appears multiple times in the list of active parsers.'],t),i.push(a)),s.push(a)}checkBlackAndWhitelist(e,t,n,s){const i=e.map(a=>a.name).filter(a=>void 0!==a);if(t)for(const a of t)i.includes(a)||this.logger.warn(['Blacklisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s);if(n)for(const a of n)i.includes(a)||this.logger.warn(['Whitelisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(f.zZn),f.KVO(Tt),f.KVO(V),f.KVO(Rt),f.KVO(At),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Nt=(()=>{class o{constructor(e){this.parserEntryResolver=e}resolve(e,t,n,s,i,a=null,l=null,c=null,p=null){let d={};n=n||[],s=s||[];const u={options:{sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}};d=(i=i||{}).hasOwnProperty("inheritance")&&i.inheritance!==ae.Linear?this.mergeSettings(i.inheritance===ae.All?[u,...n,...s,{options:l||void 0}]:[u,i||{},{options:l||void 0}]):this.mergeSettings([u,...s,{parsers:a||void 0,options:l||void 0}]);const h=d.options;t&&"string"!=typeof t&&(h.sanitize=!1);let g=[];return a?g=this.parserEntryResolver.resolve(a,e,null,null,h):d.parsers&&(g=this.parserEntryResolver.resolve(d.parsers,e,c,p,h)),{parsers:g,options:h}}mergeSettings(e){const t={};for(const n of e){if(void 0!==n.parsers){void 0===t.parsers&&(t.parsers=[]);for(const s of n.parsers)t.parsers.includes(s)||t.parsers.push(s)}void 0!==n.options&&(void 0===t.options&&(t.options={}),t.options=this.recursiveAssign(t.options,n.options))}return t}recursiveAssign(e,t){if(Object(t)!==t)return t;Object(e)!==e&&(e={});for(const n in t)e[n]=this.recursiveAssign(e[n],t[n]);return e}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Pt))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const He="_ngx_dynamic_hooks_node_placeholder";let $t=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}findInElement(e,t,n,s,i,a){for(const l of n)if("function"==typeof l.findHooks){this.checkElement(e,t,n,s,i,a);break}}checkElement(e,t,n,s,i,a,l={counter:0,nodes:{}}){let c=this.platformService.getChildNodes(e),p="";const d={};for(const g of c)if(this.platformService.isTextNode(g))p+=this.platformService.getTextContent(g);else{const m=l.counter++;p+=`${He}__${m}__`,d[m]=g}const u=Object.keys(a).length,h=this.find(p,t,n,s,i,a);if(Object.keys(a).length>u&&(this.platformService.clearChildNodes(e),this.platformService.setInnerContent(e,h.content),c=this.platformService.getChildNodes(e),l.nodes={...l.nodes,...d}),Object.keys(l.nodes).length)for(const g of c)if(this.platformService.isTextNode(g)){let m=this.platformService.getTextContent(g);if(m){const w=T(m,new RegExp(`${He}__(\\d*)__`,"g"));if(w.length){const x=[];let R=0;for(const H of w){const L=m.substring(R,H.index),B=parseInt(H[1]);L&&x.push(this.platformService.createTextNode(L)),B&&l.nodes[B]&&(x.push(l.nodes[B]),delete l.nodes[B]),R=H.index+H[0].length}const Q=m.substring(R);Q&&x.push(this.platformService.createTextNode(Q));const j=this.platformService.getParentNode(g);for(const H of x)this.platformService.insertBefore(j,H,g);this.platformService.removeChild(j,g),c=this.platformService.getChildNodes(j)}}}for(const g of c)g.nodeType!==Node.TEXT_NODE&&this.checkElement(g,t,n,s,i,a,l)}find(e,t,n,s,i,a){if(""===e)return{content:e,hookIndex:a};i.convertHTMLEntities&&(e=this.convertHTMLEntities(e));let l=[];for(const p of n)if("function"==typeof p.findHooks)for(const d of p.findHooks(e,t,i))l.push({parser:p,hookPosition:d});l.sort((p,d)=>p.hookPosition.openingTagStartIndex-d.hookPosition.openingTagStartIndex),l=this.validateHookPositions(l,e,i);const c=[];for(const p of l){const d=Object.keys(a).length+1,u=this.getHookSegments(p.hookPosition,e);if(c.push({startIndex:p.hookPosition.openingTagStartIndex,endIndex:p.hookPosition.openingTagEndIndex,replacement:`<${ie} ${I}="${d}" ${C}="${s}">`}),c.push({startIndex:u.enclosing?p.hookPosition.closingTagStartIndex:p.hookPosition.openingTagEndIndex,endIndex:u.enclosing?p.hookPosition.closingTagEndIndex:p.hookPosition.openingTagEndIndex,replacement:`</${ie}>`}),a[d]={id:d,parser:p.parser,value:{openingTag:u.openingTag,closingTag:u.closingTag,element:null,elementSnapshot:null},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},u.enclosing&&i.fixParagraphTags){const h=this.removeTagArtifacts(u.textBefore,"<p>","</p>",u.innerValue,"</p>","<p>");u.textBefore=h.firstText,u.innerValue=h.secondText;const g=this.removeTagArtifacts(u.innerValue,"<p>","</p>",u.textAfter,"</p>","<p>");u.innerValue=g.firstText,u.textAfter=g.secondText,e=u.textBefore+u.openingTag+u.innerValue+u.closingTag+u.textAfter}}c.sort((p,d)=>{let u=d.startIndex-p.startIndex;return 0===u&&(u=d.endIndex-p.endIndex),u});for(const p of c){const d=e.substring(0,p.startIndex),u=e.substring(p.endIndex);e=d+p.replacement+u}return{content:e,hookIndex:a}}getHookSegments(e,t){const n=Number.isInteger(e.closingTagStartIndex)&&Number.isInteger(e.closingTagEndIndex);return{enclosing:n,textBefore:t.substring(0,e.openingTagStartIndex),openingTag:t.substring(e.openingTagStartIndex,e.openingTagEndIndex),innerValue:n?t.substring(e.openingTagEndIndex,e.closingTagStartIndex):null,closingTag:n?t.substring(e.closingTagStartIndex,e.closingTagEndIndex):null,textAfter:t.substring(n?e.closingTagEndIndex:e.openingTagEndIndex)}}validateHookPositions(e,t,n){const s=[];e:for(const[i,a]of e.entries()){const l=Number.isInteger(a.hookPosition.closingTagStartIndex)&&Number.isInteger(a.hookPosition.closingTagEndIndex),c=a.hookPosition;if(c.openingTagStartIndex>=c.openingTagEndIndex){this.logger.warn(["Text hook error: openingTagEndIndex has to be greater than openingTagStartIndex. Ignoring.",c],n);continue}if(l&&c.openingTagEndIndex>c.closingTagStartIndex){this.logger.warn(["Text hook error: closingTagStartIndex has to be greater than openingTagEndIndex. Ignoring.",c],n);continue}if(l&&c.closingTagStartIndex>=c.closingTagEndIndex){this.logger.warn(["Text hook error: closingTagEndIndex has to be greater than closingTagStartIndex. Ignoring.",c],n);continue}const p=e.slice(0,i);for(const d of p){const u=d.hookPosition,h=Number.isInteger(u.closingTagStartIndex)&&Number.isInteger(u.closingTagEndIndex);if(c.openingTagStartIndex===u.openingTagStartIndex&&c.openingTagEndIndex===u.openingTagEndIndex&&(!l||!h||c.closingTagStartIndex===u.closingTagStartIndex&&c.closingTagEndIndex===u.closingTagEndIndex)){this.generateHookPosWarning("A text hook with the same position as another text hook was found. There may be multiple parsers looking for the same text pattern. Ignoring duplicates.",c,u,t,n);continue e}if(c.openingTagStartIndex<u.openingTagEndIndex){this.generateHookPosWarning("Text hook error: Hook opening tag starts before previous hook opening tag ends. Ignoring.",c,u,t,n);continue e}if(h&&!(c.openingTagEndIndex<=u.closingTagStartIndex||c.openingTagStartIndex>=u.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Opening tag of hook overlaps with closing tag of previous hook. Ignoring.",c,u,t,n);continue e}if(h&&l&&!(c.closingTagEndIndex<=u.closingTagStartIndex||c.closingTagStartIndex>=u.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Closing tag of hook overlaps with closing tag of previous hook. Ignoring.",c,u,t,n);continue e}if(l&&h&&c.openingTagEndIndex<=u.closingTagStartIndex&&c.closingTagStartIndex>=u.closingTagEndIndex){this.generateHookPosWarning("Text hook error: The closing tag of a nested hook lies beyond the closing tag of the outer hook. Ignoring.",c,u,t,n);continue e}}s.push(a)}return s}generateHookPosWarning(e,t,n,s,i){const a=this.getHookSegments(n,s),l=this.getHookSegments(t,s);this.logger.warn([e+"\nFirst hook: ",{openingTag:a.openingTag,openingTagStartIndex:n.openingTagStartIndex,openingTagEndIndex:n.openingTagEndIndex,closingTag:a.closingTag,closingTagStartIndex:n.closingTagStartIndex,closingTagEndIndex:n.closingTagEndIndex},"\nSecond hook:",{openingTag:l.openingTag,openingTagStartIndex:t.openingTagStartIndex,openingTagEndIndex:t.openingTagEndIndex,closingTag:l.closingTag,closingTagStartIndex:t.closingTagStartIndex,closingTagEndIndex:t.closingTagEndIndex}],i)}removeTagArtifacts(e,t,n,s,i,a){let l=!1,c=!1;const p=e.lastIndexOf(t),d=e.lastIndexOf(n);(p>=0&&-1===d||p>d)&&(l=!0);const u=s.indexOf(i),h=s.indexOf(a);return(u>=0&&-1===h||u<h)&&(c=!0),l&&c&&(e=e.substring(0,p)+" ".repeat(t.length)+e.substring(p+t.length),s=s.substring(0,u)+" ".repeat(i.length)+s.substring(u+i.length)),{firstText:e,secondText:s}}convertHTMLEntities(e){const t=this.platformService.createElement("div");return e.replace(/&[#A-Za-z0-9]+;/gi,s=>" "===s?" ":(this.platformService.setInnerContent(t,s),this.platformService.getTextContent(t)))}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(V),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Dt=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}find(e,t,n,s,i,a){let l=[];for(const c of n)if("function"==typeof c.findHookElements)for(const p of c.findHookElements(e,t,i))l.push({parser:c,hookElement:p});l=function xt(o,r,e){return[...o].sort(function(n,s){return"function"==typeof e&&(n=e(n),s=e(s)),r(n,s)})}(l,this.platformService.sortElements.bind(this.platformService),c=>c.hookElement),l=this.validateHookElements(l,e,i);for(const c of l){const p=Object.keys(a).length+1;a[p]={id:p,parser:c.parser,value:{openingTag:this.platformService.getOpeningTag(c.hookElement),closingTag:this.platformService.getClosingTag(c.hookElement),element:c.hookElement,elementSnapshot:this.platformService.cloneElement(c.hookElement)},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},this.platformService.setAttribute(c.hookElement,I,p.toString()),this.platformService.setAttribute(c.hookElement,C,s)}return a}validateHookElements(e,t,n){const s=[];for(const[i,a]of e.entries())s.slice(0,i).findIndex(p=>p.hookElement===a.hookElement)>=0||this.platformService.getAttributeNames(a.hookElement).includes(I)||this.platformService.getAttributeNames(a.hookElement).includes(C)?this.logger.warn(["An element hook tried to use an element that was found by another hook before. There may be multiple parsers looking for the same elements. Ignoring duplicates.",a.hookElement],n):ce(a.hookElement)||s.push(a);return s}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(V),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const pe="dynamic-hooks-sanitization-placeholder",Ht=new RegExp(`</?${pe}.*?>`,"g");let Vt=(()=>{class o{constructor(e){this.platformService=e,this.attrWhitelist=[I,C,"class","href","src"]}sanitize(e,t,n){const s={};for(const c of Object.values(t)){const p=this.platformService.querySelectorAll(e,`[${I}="${c.id}"][${C}="${n}"]`)?.[0];if(p){s[c.id]=p;const d=this.platformService.getParentNode(p),u=this.platformService.getChildNodes(p),h=this.platformService.createElement(pe);this.platformService.setAttribute(h,I,c.id.toString()),this.platformService.setAttribute(h,C,n),this.platformService.insertBefore(d,h,p),this.platformService.removeChild(d,p);for(const g of u)this.platformService.appendChild(h,g)}}let i=this.platformService.getInnerContent(e);i=this.findAndEncodeTags(i,Ht);const a=console.warn;console.warn=()=>{};let l=this.platformService.sanitize(i);console.warn=a,l=this.decodeTagString(l),e.innerHTML=l||"";for(const[c,p]of Object.entries(s)){const d=this.platformService.querySelectorAll(e,`${pe}[${I}="${c}"]`)?.[0];if(d){const u=this.platformService.getParentNode(d),h=this.platformService.getChildNodes(d);this.platformService.insertBefore(u,p,d),this.platformService.removeChild(u,d);for(const g of h)this.platformService.appendChild(p,g);this.sanitizeElementAttrs(p)}}return e}sanitizeElementAttrs(e){const t=this.platformService.getAttributeNames(e),n=this.platformService.createElement("div"),s=this.platformService.createElement("span");this.platformService.appendChild(n,s);for(const l of t){try{this.platformService.setAttribute(s,l,this.platformService.getAttribute(e,l))}catch{}try{l!==I&&l!==C&&this.platformService.removeAttribute(e,l)}catch{}}n.innerHTML=this.platformService.sanitize(this.platformService.getInnerContent(n));const i=this.platformService.querySelectorAll(n,"span")[0],a=this.platformService.getAttributeNames(i);for(const l of a)try{this.platformService.setAttribute(e,l,this.platformService.getAttribute(i,l))}catch{}return e}findAndEncodeTags(e,t){let n=e;const s=T(e,t);s.sort((i,a)=>a.index-i.index);for(const i of s){const a=i.index,l=i.index+i[0].length,c=n.substring(0,a),p=this.encodeTagString(n.substring(a,l)),d=n.substring(l);n=c+p+d}return n}encodeTagString(e){return(e=(e=e.replace(/</g,"@@@hook-lt@@@")).replace(/>/g,"@@@hook-gt@@@")).replace(/"/g,"@@@hook-dq@@@")}decodeTagString(e){return(e=(e=e.replace(/@@@hook-lt@@@/g,"<")).replace(/@@@hook-gt@@@/g,">")).replace(/@@@hook-dq@@@/g,'"')}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(V))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Mt=(()=>{class o{constructor(e){this.logger=e}isEqual(e,t,n,s={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const i=this.detailedStringify(e,n),a=this.detailedStringify(t,n);return null===i.result||null===a.result?(this.logger.warn(["Objects could not be compared by value as one or both of them could not be stringified. Returning false. \n","Objects:",e,t],s),!1):i.result===a.result}detailedStringify(e,t){try{const n={count:0},s=this.decycle(e,[],t,n);return{result:JSON.stringify(s,(a,l)=>void 0===l?"undefined":"function"==typeof l||"symbol"==typeof l?l.toString():l),depthReachedCount:n.count}}catch{return{result:null,depthReachedCount:0}}}decycle(e,t=[],n=5,s){if(t.length>n)return s.count++,null;if(!e||"object"!=typeof e||e instanceof Date)return e;for(const a of t)if(this.objEqualsProperties(e,a))return null;const i=t.concat([e]);if(Array.isArray(e)){const a=[];for(const l of e)a.push(this.decycle(l,i,n,s));return a}{const a={};for(const l of Object.keys(e))a[l]=this.decycle(e[l],i,n,s);return a}}objEqualsProperties(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ve=(()=>{class o{constructor(e,t){this.deepComparer=e,this.logger=t}refresh(e,t,n,s){for(const[i,a]of Object.entries(e))this.updateBindings(a,t,n);if(s)for(const i of Object.values(e)){if(!i.componentRef)return;"function"==typeof i.componentRef.instance.onDynamicChanges&&i.componentRef.instance.onDynamicChanges({context:t})}}updateBindings(e,t,n){e.componentRef&&(e.bindings=e.parser.getBindings(e.id,e.value,t,n),this.updateComponentWithNewInputs(e,n),this.updateComponentWithNewOutputs(e,t,n),e.previousBindings={inputs:this.savePreviousBindings(e,"inputs",n.compareInputsByValue,n.compareByValueDepth),outputs:this.savePreviousBindings(e,"outputs",n.compareOutputsByValue,n.compareByValueDepth)})}savePreviousBindings(e,t,n,s){const i={};if(e.bindings.hasOwnProperty(t))for(const[a,l]of Object.entries(e.bindings[t]))i[a]={reference:l,stringified:n?this.deepComparer.detailedStringify(l,s):null};return i}updateComponentWithNewInputs(e,t){const n=e.componentRef.instance,s=this.getChangedBindings(e,"inputs",t),i=[],a=(0,$.HJs)(e.componentRef.componentType);for(const[l,c]of Object.entries(s)){const p=t.ignoreInputAliases?"propName":"templateName",d=a.inputs.find(u=>l===u[p])||a.inputs.find(u=>l.toLowerCase()===u[p].toLowerCase())||a.inputs.find(u=>l.replace(/-/g,"")===u[p])||a.inputs.find(u=>l.replace(/-/g,"").toLowerCase()===u[p].toLowerCase());if(d)i.push({propName:d.propName,templateName:d.templateName,value:c});else if(t.acceptInputsForAnyProperty){const h=Object.getOwnPropertyNames(n).find(g=>l===g)||Object.getOwnPropertyNames(n).find(g=>l.toLowerCase()===g.toLowerCase())||l;if(["__proto__","prototype","constructor"].includes(h)){this.logger.error(['Tried to overwrite a __proto__, prototype or constructor property with input "'+h+'" for hook "'+e.componentRef.componentType.name+'". This is not allowed.'],t);continue}i.push({propName:h,templateName:null,value:c})}}for(const{propName:l,templateName:c,value:p}of i)c?e.componentRef?.setInput(c,p):l&&(e.componentRef.instance[l]=p);i.length&&e.componentRef?.changeDetectorRef.detectChanges()}updateComponentWithNewOutputs(e,t,n){const s=e.componentRef.instance,i=this.getChangedBindings(e,"outputs",n),a=[],l=(0,$.HJs)(e.componentRef.componentType);for(const[c,p]of Object.entries(i)){const d=n.ignoreOutputAliases?"propName":"templateName",u=l.outputs.find(h=>c===h[d])||l.outputs.find(h=>c.toLowerCase()===h[d].toLowerCase())||l.outputs.find(h=>c.replace(/-/g,"")===h[d])||l.outputs.find(h=>c.replace(/-/g,"").toLowerCase()===h[d].toLowerCase());if(u)a.push({propName:u.propName,templateName:u.templateName,value:p});else if(n.acceptOutputsForAnyObservable){let h=Object.getOwnPropertyNames(s).find(g=>s[g]instanceof Te.c&&c===g)||Object.getOwnPropertyNames(s).find(g=>s[g]instanceof Te.c&&c.toLowerCase()===g.toLowerCase());h&&a.push({propName:h,templateName:null,value:p})}}for(const{propName:c,value:d}of a)e.outputSubscriptions[c]&&e.outputSubscriptions[c].unsubscribe(),e.outputSubscriptions[c]=e.componentRef.instance[c].subscribe(u=>{d(u,t)})}getChangedBindings(e,t,n){const s={};if(e.bindings.hasOwnProperty(t))for(const[i,a]of Object.entries(e.bindings[t]))if(e.previousBindings&&e.previousBindings[t].hasOwnProperty(i))if("inputs"===t?n.compareInputsByValue:n.compareOutputsByValue){const l=this.deepComparer.detailedStringify(a,n.compareByValueDepth);this.checkDetailedStringifyResultPair(i,e.componentRef.componentType.name,n,e.previousBindings[t][i].stringified,l)?l.result!==e.previousBindings[t][i].stringified.result&&(s[i]=a):a!==e.previousBindings[t][i].reference&&(s[i]=a)}else a!==e.previousBindings[t][i].reference&&(s[i]=a);else s[i]=a;return s}checkDetailedStringifyResultPair(e,t,n,s,i){return null===s.result&&null===i.result?(this.logger.warn(['Could stringify neither new nor old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===s.result?(this.logger.warn(['Could not stringify old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===i.result?(this.logger.warn(['Could not stringify new value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):(s.depthReachedCount>0&&i.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+" time(s) for new value and "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):s.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):i.depthReachedCount>0&&this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+' time(s) for new value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n),!0)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Mt),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),zt=(()=>{class o{constructor(e,t,n,s,i){this.platformId=e,this.appRef=t,this.componentUpdater=n,this.platformService=s,this.logger=i}init(e,t,n,s,i,a,l){const c=new Ee.m(1),p=[],d={};if(0===Object.keys(t).length)return c.next(!0),c;for(let h of this.platformService.querySelectorAll(e,`[${I}][${C}]`)){const g=parseInt(this.platformService.getAttribute(h,I));if(0===this.platformService.querySelectorAll(e,`[${I}="${g}"][${C}="${n}"]`).length){delete t[g];continue}const m=t[g];m.data=m.parser.loadComponent(m.id,m.value,s,this.platformService.getChildNodes(h),i),m.isLazy=m.data.component.hasOwnProperty("importPromise")&&m.data.component.hasOwnProperty("importName"),(0,G.UE)(this.platformId)||!m.isLazy?(!m.data.hostElementTag&&kt.includes(this.platformService.getTagName(h).toLowerCase())&&(m.data.hostElementTag=ie),m.data.hostElementTag&&(h=this.useCustomHostElement(h,m.data.hostElementTag),m.value.element=h),this.createContentSlotElements(h,m,n),d[g]=h):delete t[g]}const u=Object.keys(d).map(h=>parseInt(h));for(const[h,g]of Object.entries(t))u.includes(parseInt(h))||(this.logger.warn(["Error when trying to load components - The anchor element for the following hook was found initially, but could not be found again for loading the component. Ignoring.",g],i),delete t[h]);for(const[h,g]of Object.entries(d)){const m=t[h];p.push((0,se.of)(!0).pipe((0,ot.Z)(()=>this.loadComponentClass(m.data.component))).pipe((0,it.M)(w=>{const x=this.extractContentSlotElements(g,n);this.createComponent(m,s,g,x,i,w,a,l)})).pipe((0,at.W)(w=>(this.logger.error([w.stack],i),delete t[m.id],(0,se.of)(null)))))}return 0===p.length?(c.next(!0),c):((0,st.z)([...p]).pipe(Be()).subscribe(()=>{for(const h of Object.values(t)){const g=[];("function"==typeof h.componentRef.instance.onDynamicMount||"function"==typeof h.componentRef.instance.onDynamicChanges)&&this.findContentChildren(h.componentRef.location.nativeElement,g,t,n),"function"==typeof h.componentRef.instance.onDynamicChanges&&h.componentRef.instance.onDynamicChanges({contentChildren:g}),"function"==typeof h.componentRef.instance.onDynamicMount&&h.componentRef.instance.onDynamicMount({context:s,contentChildren:g})}for(const h of Object.values(d))this.platformService.removeAttribute(h,I),this.platformService.removeAttribute(h,C),this.platformService.removeAttribute(h,"ng-version");c.next(!0)}),c)}useCustomHostElement(e,t){const n=this.platformService.createElement(t);this.platformService.setAttribute(n,I,this.platformService.getAttribute(e,I)),this.platformService.setAttribute(n,C,this.platformService.getAttribute(e,C)),this.platformService.removeAttribute(e,I),this.platformService.removeAttribute(e,C);const s=this.platformService.getChildNodes(e);for(const i of s)this.platformService.appendChild(n,i);return this.platformService.insertBefore(this.platformService.getParentNode(e),n,e),this.platformService.removeChild(this.platformService.getParentNode(e),e),n}createContentSlotElements(e,t,n){let s;s=t.data.hasOwnProperty("content")&&Array.isArray(t.data.content)?t.data.content:[this.platformService.getChildNodes(e)],this.platformService.clearChildNodes(e);for(const[i,a]of s.entries())if(null!=a){const l=this.platformService.createElement("dynamic-component-contentslot");this.platformService.setAttribute(l,"slotIndex",i.toString()),this.platformService.setAttribute(l,"parsetoken",n);for(const c of a)this.platformService.appendChild(l,c);this.platformService.appendChild(e,l)}}extractContentSlotElements(e,t){const n=[],s=this.platformService.getChildNodes(e).filter(i=>"DYNAMIC-COMPONENT-CONTENTSLOT"===this.platformService.getTagName(i)&&this.platformService.getAttribute(i,"parsetoken")===t);for(const i of s){const a=this.platformService.getAttribute(i,"slotIndex");n[parseInt(a)]=this.platformService.getChildNodes(i)}return this.platformService.clearChildNodes(e),n}loadComponentClass(e){const t=new Ee.m(1);if(e.hasOwnProperty("prototype"))t.next(e);else if("function"==typeof e)e().then(n=>{t.next(n)});else{if(!e.hasOwnProperty("importPromise")||!e.hasOwnProperty("importName"))throw Error('The "component" property of a returned HookData object must either contain the component class, a function that returns a promise with the component class or an explicit LazyLoadComponentConfig');if(e.importPromise instanceof Promise)throw Error('When lazy-loading a component, the "importPromise"-field must contain a function returning the import-promise, but it contained the promise itself.');e.importPromise().then(n=>{const s=e.importName,i=Object.prototype.hasOwnProperty.call(n,s)?n[s]:n.default;t.next(i)})}return t}createComponent(e,t,n,s,i,a,l,c){const p=(0,$.a0P)(a,{hostElement:n,environmentInjector:e.data.environmentInjector||l,elementInjector:e.data.injector||c,projectableNodes:s});e.componentRef=p,this.mapOutputsToHTMLEvents(e,i),this.componentUpdater.updateBindings(e,t,i),"function"==typeof e.componentRef.instance.onDynamicChanges&&void 0!==t&&e.componentRef.instance.onDynamicChanges({context:t}),this.appRef.attachView(p.hostView),p.changeDetectorRef.detectChanges()}mapOutputsToHTMLEvents(e,t){const n=(0,$.HJs)(e.componentRef.componentType);for(const s of n.outputs){const i=t.ignoreOutputAliases?s.propName:s.templateName;e.htmlEventSubscriptions[i]=e.componentRef.instance[s.propName].subscribe(a=>{t.triggerDOMEvents&&this.platformService.dispatchEvent(e.componentRef?.location.nativeElement,i,a)})}}findContentChildren(e,t=[],n,s){const i=this.platformService.getChildNodes(e);null!=i&&i.length>0&&i.forEach((a,l)=>{let c=!1;const p=this.platformService.getAttribute(a,C);if(null!==p&&p===s&&this.platformService.getAttribute(a,I)){const u=parseInt(this.platformService.getAttribute(a,I),10);n.hasOwnProperty(u)&&(t.push({componentRef:n[u].componentRef,contentChildren:[],hookValue:n[u].value}),c=!0)}this.findContentChildren(a,c?t[t.length-1].contentChildren:t,n,s)})}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(S.Agw),f.KVO(S.o8S),f.KVO(Ve),f.KVO(V),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Me=(()=>{class o{constructor(e,t,n,s,i,a,l,c,p,d,u){this.allSettings=e,this.ancestorSettings=t,this.moduleSettings=n,this.settingsResolver=s,this.textHookFinder=i,this.elementHookFinder=a,this.contentSanitizer=l,this.componentCreator=c,this.platformService=p,this.environmentInjector=d,this.injector=u}parse(e=null,t=null,n=null,s=null,i=null,a=null,l=null,c={},p=null,d=null){const u=p||this.environmentInjector,h=d||this.injector,{parsers:g,options:m}=this.settingsResolver.resolve(h,e,this.allSettings,this.ancestorSettings,this.moduleSettings,t,s,i,a);if(!e)return(0,se.of)({element:l||this.platformService.createElement("div"),hookIndex:c,context:n,usedParsers:g,usedOptions:m,usedInjector:h,usedEnvironmentInjector:u,destroy:()=>this.destroy(c)});const w=Math.random().toString(36).substring(2,12);let x="string"==typeof e?this.platformService.createElement("div"):e;if(this.platformService.setAttribute(x,F,"1"),"string"==typeof e){const R=this.textHookFinder.find(e,n,g,w,m,c);this.platformService.setInnerContent(x,R.content)}else this.textHookFinder.findInElement(x,n,g,w,m,c);if(c=this.elementHookFinder.find(x,n,g,w,m,c),m?.sanitize&&this.contentSanitizer.sanitize(x,c,w),l&&l!==x){this.platformService.removeAttribute(x,F),this.platformService.setAttribute(l,F,"1"),this.platformService.clearChildNodes(l);for(const R of this.platformService.getChildNodes(x))this.platformService.appendChild(l,R);x=l}return this.componentCreator.init(x,c,w,n,m,u,h).pipe(Be()).pipe((0,ft.T)(R=>(this.platformService.removeAttribute(x,F),{element:x,hookIndex:c,context:n,usedParsers:g,usedOptions:m,usedInjector:h,usedEnvironmentInjector:u,destroy:()=>this.destroy(c)})))}destroy(e){if(e){for(const t of Object.values(e))t.componentRef&&t.componentRef.destroy();for(const t of Object.values(e)){for(const n of Object.values(t.outputSubscriptions))n&&n.unsubscribe();for(const n of Object.values(t.htmlEventSubscriptions))n&&n.unsubscribe()}}}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Pe,8),f.KVO(oe,8),f.KVO(Ne,8),f.KVO(Nt),f.KVO($t),f.KVO(Dt),f.KVO(Vt),f.KVO(zt),f.KVO(V),f.KVO(f.uvJ),f.KVO(f.zZn))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),qt=(()=>{class o{constructor(e,t,n,s,i,a){this.hostElement=e,this.dynamicHooksService=t,this.componentUpdater=n,this.platformService=s,this.environmentInjector=i,this.injector=a,this.content=null,this.context=null,this.globalParsersBlacklist=null,this.globalParsersWhitelist=null,this.parsers=null,this.options=null,this.componentsLoaded=new f.bkB,this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.token=Math.random().toString(36).substring(2,12),this.initialized=!1}ngDoCheck(){this.activeOptions.updateOnPushOnly||this.refresh(!1)}ngOnChanges(e){e.hasOwnProperty("content")||e.hasOwnProperty("globalParsersBlacklist")||e.hasOwnProperty("globalParsersWhitelist")||e.hasOwnProperty("parsers")||e.hasOwnProperty("options")?(this.reset(),this.parse(this.content)):e.hasOwnProperty("context")&&this.refresh(!0)}ngAfterViewInit(){}ngAfterViewChecked(){}ngOnDestroy(){this.reset()}reset(){this.dynamicHooksService.destroy(this.hookIndex),this.platformService.setInnerContent(this.hostElement.nativeElement,""),this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.initialized=!1}parse(e){this.dynamicHooksService.parse(e,this.parsers,this.context,this.options,this.globalParsersBlacklist,this.globalParsersWhitelist,this.hostElement.nativeElement,this.hookIndex,this.environmentInjector,this.injector).subscribe(t=>{this.activeParsers=t.usedParsers,this.activeOptions=t.usedOptions,this.initialized=!0;const n=Object.values(this.hookIndex).map(s=>({hookId:s.id,hookValue:s.value,hookParser:s.parser,componentRef:s.componentRef}));this.componentsLoaded.emit(n)})}refresh(e){this.initialized&&this.componentUpdater.refresh(this.hookIndex,this.context,this.activeOptions,e)}static{this.\u0275fac=function(t){return new(t||o)(S.rXU(S.aKT),S.rXU(Me),S.rXU(Ve),S.rXU(V),S.rXU(f.uvJ),S.rXU(f.zZn))}}static{this.\u0275cmp=S.VBU({type:o,selectors:[["ngx-dynamic-hooks"]],inputs:{content:"content",context:"context",globalParsersBlacklist:"globalParsersBlacklist",globalParsersWhitelist:"globalParsersWhitelist",parsers:"parsers",options:"options"},outputs:{componentsLoaded:"componentsLoaded"},features:[S.OA$],decls:0,vars:0,template:function(t,n){},encapsulation:2})}}return o})();var M={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function ze(o){M=o}var W={exec:()=>null};function y(o,r=""){let e="string"==typeof o?o:o.source;const t={replace:(n,s)=>{let i="string"==typeof s?s:s.source;return i=i.replace(E.caret,"$1"),e=e.replace(n,i),t},getRegex:()=>new RegExp(e,r)};return t}var E={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]\] /,listReplaceTask:/^\[[ 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:o=>new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,de=/(?:[*+-]|\d{1,9}[.)])/,je=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Le=y(je).replace(/bull/g,de).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(),Xt=y(je).replace(/bull/g,de).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(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,fe=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yt=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),en=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,de).getRegex(),J="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",me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tn=y("^ {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",me).replace("tag",J).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fe=y(ge).replace("hr",K).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",J).getRegex(),be={blockquote:y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fe).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Yt,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:K,html:tn,lheading:Le,list:en,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Fe,table:W,text:/^[^\n]+/},_e=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).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",J).getRegex(),rn={...be,lheading:Xt,table:_e,paragraph:y(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_e).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",J).getRegex()},sn={...be,html:y("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",me).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:W,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(ge).replace("hr",K).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},We=/^( {2,}|\\)\n(?!\s*$)/,Y=/[\p{P}\p{S}]/u,ye=/[\s\p{P}\p{S}]/u,Ke=/[^\s\p{P}\p{S}]/u,cn=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ye).getRegex(),qe=/(?!~)[\p{P}\p{S}]/u,Ze=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dn=y(Ze,"u").replace(/punct/g,Y).getRegex(),gn=y(Ze,"u").replace(/punct/g,qe).getRegex(),Ue="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fn=y(Ue,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,ye).replace(/punct/g,Y).getRegex(),mn=y(Ue,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,qe).getRegex(),bn=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,ye).replace(/punct/g,Y).getRegex(),yn=y(/\\(punct)/,"gu").replace(/punct/g,Y).getRegex(),vn=y(/^<(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(),kn=y(me).replace("(?:--\x3e|$)","--\x3e").getRegex(),xn=y("^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",kn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ee=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wn=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ee).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qe=y(/^!?\[(label)\]\[(ref)\]/).replace("label",ee).replace("ref",fe).getRegex(),Ge=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",fe).getRegex(),ve={_backpedal:W,anyPunctuation:yn,autolink:vn,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:We,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:W,emStrongLDelim:dn,emStrongRDelimAst:fn,emStrongRDelimUnd:bn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:wn,nolink:Ge,punctuation:cn,reflink:Qe,reflinkSearch:y("reflink|nolink(?!\\()","g").replace("reflink",Qe).replace("nolink",Ge).getRegex(),tag:xn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:W},In={...ve,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",ee).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee).getRegex()},ke={...ve,emStrongRDelimAst:mn,emStrongLDelim:gn,url:y(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Tn={...ke,br:y(We).replace("{2,}","*").getRegex(),text:y(ke.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},te={normal:be,gfm:rn,pedantic:sn},q={normal:ve,gfm:ke,breaks:Tn,pedantic:In},En={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe=o=>En[o];function O(o,r){if(r){if(E.escapeTest.test(o))return o.replace(E.escapeReplace,Xe)}else if(E.escapeTestNoEncode.test(o))return o.replace(E.escapeReplaceNoEncode,Xe);return o}function Je(o){try{o=encodeURI(o).replace(E.percentDecode,"%")}catch{return null}return o}function Ye(o,r){const t=o.replace(E.findPipe,(s,i,a)=>{let l=!1,c=i;for(;--c>=0&&"\\"===a[c];)l=!l;return l?"|":" |"}).split(E.splitPipe);let n=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),r)if(t.length>r)t.splice(r);else for(;t.length<r;)t.push("");for(;n<t.length;n++)t[n]=t[n].trim().replace(E.slashPipe,"|");return t}function Z(o,r,e){const t=o.length;if(0===t)return"";let n=0;for(;n<t;){const s=o.charAt(t-n-1);if(s!==r||e){if(s===r||!e)break;n++}else n++}return o.slice(0,t-n)}function et(o,r,e,t,n){const s=r.href,i=r.title||null,a=o[1].replace(n.other.outputLinkReplace,"$1");t.state.inLink=!0;const l={type:"!"===o[0].charAt(0)?"image":"link",raw:e,href:s,title:i,text:a,tokens:t.inlineTokens(a)};return t.state.inLink=!1,l}var ne=class{options;rules;lexer;constructor(o){this.options=o||M}space(o){const r=this.rules.block.newline.exec(o);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(o){const r=this.rules.block.code.exec(o);if(r){const e=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Z(e,"\n")}}}fences(o){const r=this.rules.block.fences.exec(o);if(r){const e=r[0],t=function Rn(o,r,e){const t=o.match(e.other.indentCodeCompensation);if(null===t)return r;const n=t[1];return r.split("\n").map(s=>{const i=s.match(e.other.beginningSpace);if(null===i)return s;const[a]=i;return a.length>=n.length?s.slice(n.length):s}).join("\n")}(e,r[3]||"",this.rules);return{type:"code",raw:e,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:t}}}heading(o){const r=this.rules.block.heading.exec(o);if(r){let e=r[2].trim();if(this.rules.other.endingHash.test(e)){const t=Z(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(o){const r=this.rules.block.hr.exec(o);if(r)return{type:"hr",raw:Z(r[0],"\n")}}blockquote(o){const r=this.rules.block.blockquote.exec(o);if(r){let e=Z(r[0],"\n").split("\n"),t="",n="";const s=[];for(;e.length>0;){let i=!1;const a=[];let l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),i=!0;else{if(i)break;a.push(e[l])}e=e.slice(l);const c=a.join("\n"),p=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}\n${c}`:c,n=n?`${n}\n${p}`:p;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=d,0===e.length)break;const u=s.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){const h=u,g=h.raw+"\n"+e.join("\n"),m=this.blockquote(g);s[s.length-1]=m,t=t.substring(0,t.length-h.raw.length)+m.raw,n=n.substring(0,n.length-h.text.length)+m.text;break}if("list"===u?.type){const h=u,g=h.raw+"\n"+e.join("\n"),m=this.list(g);s[s.length-1]=m,t=t.substring(0,t.length-u.raw.length)+m.raw,n=n.substring(0,n.length-h.raw.length)+m.raw,e=g.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:t,tokens:s,text:n}}}list(o){let r=this.rules.block.list.exec(o);if(r){let e=r[1].trim();const t=e.length>1,n={type:"list",raw:"",ordered:t,start:t?+e.slice(0,-1):"",loose:!1,items:[]};e=t?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=t?e:"[*+-]");const s=this.rules.other.listItemRegex(e);let i=!1;for(;o;){let l=!1,c="",p="";if(!(r=s.exec(o))||this.rules.block.hr.test(o))break;c=r[0],o=o.substring(c.length);let d=r[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),u=o.split("\n",1)[0],h=!d.trim(),g=0;if(this.options.pedantic?(g=2,p=d.trimStart()):h?g=r[1].length+1:(g=r[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=d.slice(g),g+=r[1].length),h&&this.rules.other.blankLine.test(u)&&(c+=u+"\n",o=o.substring(u.length+1),l=!0),!l){const x=this.rules.other.nextBulletRegex(g),R=this.rules.other.hrRegex(g),Q=this.rules.other.fencesBeginRegex(g),j=this.rules.other.headingBeginRegex(g),H=this.rules.other.htmlBeginRegex(g);for(;o;){const L=o.split("\n",1)[0];let B;if(u=L,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),B=u):B=u.replace(this.rules.other.tabCharGlobal," "),Q.test(u)||j.test(u)||H.test(u)||x.test(u)||R.test(u))break;if(B.search(this.rules.other.nonSpaceChar)>=g||!u.trim())p+="\n"+B.slice(g);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Q.test(d)||j.test(d)||R.test(d))break;p+="\n"+u}!h&&!u.trim()&&(h=!0),c+=L+"\n",o=o.substring(L.length+1),d=B.slice(g)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let w,m=null;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(w="[ ] "!==m[0],p=p.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:c,task:!!m,checked:w,loose:!1,text:p,tokens:[]}),n.raw+=c}const a=n.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),n.raw=n.raw.trimEnd();for(let l=0;l<n.items.length;l++)if(this.lexer.state.top=!1,n.items[l].tokens=this.lexer.blockTokens(n.items[l].text,[]),!n.loose){const c=n.items[l].tokens.filter(d=>"space"===d.type),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=p}if(n.loose)for(let l=0;l<n.items.length;l++)n.items[l].loose=!0;return n}}html(o){const r=this.rules.block.html.exec(o);if(r)return{type:"html",block:!0,raw:r[0],pre:"pre"===r[1]||"script"===r[1]||"style"===r[1],text:r[0]}}def(o){const r=this.rules.block.def.exec(o);if(r){const e=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:e,raw:r[0],href:t,title:n}}}table(o){const r=this.rules.block.table.exec(o);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const e=Ye(r[1]),t=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(e.length===t.length){for(const i of t)this.rules.other.tableAlignRight.test(i)?s.align.push("right"):this.rules.other.tableAlignCenter.test(i)?s.align.push("center"):this.rules.other.tableAlignLeft.test(i)?s.align.push("left"):s.align.push(null);for(let i=0;i<e.length;i++)s.header.push({text:e[i],tokens:this.lexer.inline(e[i]),header:!0,align:s.align[i]});for(const i of n)s.rows.push(Ye(i,s.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[l]})));return s}}lheading(o){const r=this.rules.block.lheading.exec(o);if(r)return{type:"heading",raw:r[0],depth:"="===r[2].charAt(0)?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(o){const r=this.rules.block.paragraph.exec(o);if(r){const e="\n"===r[1].charAt(r[1].length-1)?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:e,tokens:this.lexer.inline(e)}}}text(o){const r=this.rules.block.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(o){const r=this.rules.inline.escape.exec(o);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(o){const r=this.rules.inline.tag.exec(o);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(o){const r=this.rules.inline.link.exec(o);if(r){const e=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const s=Z(e.slice(0,-1),"\\");if((e.length-s.length)%2==0)return}else{const s=function Cn(o,r){if(-1===o.indexOf(r[1]))return-1;let e=0;for(let t=0;t<o.length;t++)if("\\"===o[t])t++;else if(o[t]===r[0])e++;else if(o[t]===r[1]&&(e--,e<0))return t;return e>0?-2:-1}(r[2],"()");if(-2===s)return;if(s>-1){const a=(0===r[0].indexOf("!")?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let t=r[2],n="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(t);s&&(t=s[1],n=s[3])}else n=r[3]?r[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(t=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?t.slice(1):t.slice(1,-1)),et(r,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(o,r){let e;if((e=this.rules.inline.reflink.exec(o))||(e=this.rules.inline.nolink.exec(o))){const n=r[(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!n){const s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return et(e,n,e[0],this.lexer,this.rules)}}emStrong(o,r,e=""){let t=this.rules.inline.emStrongLDelim.exec(o);if(!(!t||t[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!t[1]&&!t[2]||!e||this.rules.inline.punctuation.exec(e))){const s=[...t[0]].length-1;let i,a,l=s,c=0;const p="*"===t[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,r=r.slice(-1*o.length+s);null!=(t=p.exec(r));){if(i=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!i)continue;if(a=[...i].length,t[3]||t[4]){l+=a;continue}if((t[5]||t[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const d=[...t[0]][0].length,u=o.slice(0,s+t.index+d+a);if(Math.min(s,a)%2){const g=u.slice(1,-1);return{type:"em",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}const h=u.slice(2,-2);return{type:"strong",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(o){const r=this.rules.inline.code.exec(o);if(r){let e=r[2].replace(this.rules.other.newLineCharGlobal," ");const t=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return t&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:r[0],text:e}}}br(o){const r=this.rules.inline.br.exec(o);if(r)return{type:"br",raw:r[0]}}del(o){const r=this.rules.inline.del.exec(o);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(o){const r=this.rules.inline.autolink.exec(o);if(r){let e,t;return"@"===r[2]?(e=r[1],t="mailto:"+e):(e=r[1],t=e),{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(o){let r;if(r=this.rules.inline.url.exec(o)){let e,t;if("@"===r[2])e=r[0],t="mailto:"+e;else{let n;do{n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??""}while(n!==r[0]);e=r[0],t="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(o){const r=this.rules.inline.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],escaped:this.lexer.state.inRawBlock}}},P=class we{tokens;options;state;tokenizer;inlineQueue;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||M,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:E,block:te.normal,inline:q.normal};this.options.pedantic?(e.block=te.pedantic,e.inline=q.pedantic):this.options.gfm&&(e.block=te.gfm,e.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=e}static get rules(){return{block:te,inline:q}}static lex(r,e){return new we(e).lex(r)}static lexInline(r,e){return new we(e).inlineTokens(r)}lex(r){r=r.replace(E.carriageReturn,"\n"),this.blockTokens(r,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,e=[],t=!1){for(this.options.pedantic&&(r=r.replace(E.tabCharGlobal," ").replace(E.spaceLine,""));r;){let n;if(this.options.extensions?.block?.some(i=>!!(n=i.call({lexer:this},r,e))&&(r=r.substring(n.raw.length),e.push(n),!0)))continue;if(n=this.tokenizer.space(r)){r=r.substring(n.raw.length);const i=e.at(-1);1===n.raw.length&&void 0!==i?i.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(n=this.tokenizer.fences(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(r)){r=r.substring(n.raw.length),e.push(n);continue}let s=r;if(this.options.extensions?.startBlock){let i=1/0;const a=r.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),"number"==typeof l&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(s=r.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){const i=e.at(-1);t&&"paragraph"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n),t=s.length!==r.length,r=r.substring(n.raw.length);continue}if(n=this.tokenizer.text(r)){r=r.substring(n.raw.length);const i=e.at(-1);"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(r){const i="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(i);break}throw new Error(i)}}return this.state.top=!0,e}inline(r,e=[]){return this.inlineQueue.push({src:r,tokens:e}),e}inlineTokens(r,e=[]){let t=r,n=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(t));)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(t));)t=t.slice(0,n.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(t));)t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,i="";for(;r;){let a;if(s||(i=""),s=!1,this.options.extensions?.inline?.some(c=>!!(a=c.call({lexer:this},r,e))&&(r=r.substring(a.raw.length),e.push(a),!0)))continue;if(a=this.tokenizer.escape(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.tag(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.link(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(a.raw.length);const c=e.at(-1);"text"===a.type&&"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(a=this.tokenizer.emStrong(r,t,i)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.codespan(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.br(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.del(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.autolink(r)){r=r.substring(a.raw.length),e.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(r))){r=r.substring(a.raw.length),e.push(a);continue}let l=r;if(this.options.extensions?.startInline){let c=1/0;const p=r.slice(1);let d;this.options.extensions.startInline.forEach(u=>{d=u.call({lexer:this},p),"number"==typeof d&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=r.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){r=r.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(i=a.raw.slice(-1)),s=!0;const c=e.at(-1);"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(r){const c="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return e}},U=class{options;parser;constructor(o){this.options=o||M}space(o){return""}code({text:o,lang:r,escaped:e}){const t=(r||"").match(E.notSpaceStart)?.[0],n=o.replace(E.endingNewline,"")+"\n";return t?'<pre><code class="language-'+O(t)+'">'+(e?n:O(n,!0))+"</code></pre>\n":"<pre><code>"+(e?n:O(n,!0))+"</code></pre>\n"}blockquote({tokens:o}){return`<blockquote>\n${this.parser.parse(o)}</blockquote>\n`}html({text:o}){return o}heading({tokens:o,depth:r}){return`<h${r}>${this.parser.parseInline(o)}</h${r}>\n`}hr(o){return"<hr>\n"}list(o){const r=o.ordered,e=o.start;let t="";for(let i=0;i<o.items.length;i++)t+=this.listitem(o.items[i]);const n=r?"ol":"ul";return"<"+n+(r&&1!==e?' start="'+e+'"':"")+">\n"+t+"</"+n+">\n"}listitem(o){let r="";if(o.task){const e=this.checkbox({checked:!!o.checked});o.loose?"paragraph"===o.tokens[0]?.type?(o.tokens[0].text=e+" "+o.tokens[0].text,o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&"text"===o.tokens[0].tokens[0].type&&(o.tokens[0].tokens[0].text=e+" "+O(o.tokens[0].tokens[0].text),o.tokens[0].tokens[0].escaped=!0)):o.tokens.unshift({type:"text",raw:e+" ",text:e+" ",escaped:!0}):r+=e+" "}return r+=this.parser.parse(o.tokens,!!o.loose),`<li>${r}</li>\n`}checkbox({checked:o}){return"<input "+(o?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>\n`}table(o){let r="",e="";for(let n=0;n<o.header.length;n++)e+=this.tablecell(o.header[n]);r+=this.tablerow({text:e});let t="";for(let n=0;n<o.rows.length;n++){const s=o.rows[n];e="";for(let i=0;i<s.length;i++)e+=this.tablecell(s[i]);t+=this.tablerow({text:e})}return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+r+"</thead>\n"+t+"</table>\n"}tablerow({text:o}){return`<tr>\n${o}</tr>\n`}tablecell(o){const r=this.parser.parseInline(o.tokens),e=o.header?"th":"td";return(o.align?`<${e} align="${o.align}">`:`<${e}>`)+r+`</${e}>\n`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${O(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:r,tokens:e}){const t=this.parser.parseInline(e),n=Je(o);if(null===n)return t;let s='<a href="'+(o=n)+'"';return r&&(s+=' title="'+O(r)+'"'),s+=">"+t+"</a>",s}image({href:o,title:r,text:e,tokens:t}){t&&(e=this.parser.parseInline(t,this.parser.textRenderer));const n=Je(o);if(null===n)return O(e);let s=`<img src="${o=n}" alt="${e}"`;return r&&(s+=` title="${O(r)}"`),s+=">",s}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:O(o.text)}},xe=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},N=class Se{options;renderer;textRenderer;constructor(r){this.options=r||M,this.options.renderer=this.options.renderer||new U,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xe}static parse(r,e){return new Se(e).parse(r)}static parseInline(r,e){return new Se(e).parseInline(r)}parse(r,e=!0){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==l||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){t+=l||"";continue}}const i=s;switch(i.type){case"space":t+=this.renderer.space(i);continue;case"hr":t+=this.renderer.hr(i);continue;case"heading":t+=this.renderer.heading(i);continue;case"code":t+=this.renderer.code(i);continue;case"table":t+=this.renderer.table(i);continue;case"blockquote":t+=this.renderer.blockquote(i);continue;case"list":t+=this.renderer.list(i);continue;case"html":t+=this.renderer.html(i);continue;case"paragraph":t+=this.renderer.paragraph(i);continue;case"text":{let a=i,l=this.renderer.text(a);for(;n+1<r.length&&"text"===r[n+1].type;)a=r[++n],l+="\n"+this.renderer.text(a);t+=e?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue}default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(r,e=this.renderer){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){t+=a||"";continue}}const i=s;switch(i.type){case"escape":case"text":t+=e.text(i);break;case"html":t+=e.html(i);break;case"link":t+=e.link(i);break;case"image":t+=e.image(i);break;case"strong":t+=e.strong(i);break;case"em":t+=e.em(i);break;case"codespan":t+=e.codespan(i);break;case"br":t+=e.br(i);break;case"del":t+=e.del(i);break;default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}},re=class{options;block;constructor(r){this.options=r||M}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?P.lex:P.lexInline}provideParser(){return this.block?N.parse:N.parseInline}},z=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=N;Renderer=U;TextRenderer=xe;Lexer=P;Tokenizer=ne;Hooks=re;constructor(...o){this.use(...o)}walkTokens(o,r){let e=[];for(const t of o)switch(e=e.concat(r.call(this,t)),t.type){case"table":{const n=t;for(const s of n.header)e=e.concat(this.walkTokens(s.tokens,r));for(const s of n.rows)for(const i of s)e=e.concat(this.walkTokens(i.tokens,r));break}case"list":e=e.concat(this.walkTokens(t.items,r));break;default:{const n=t;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(s=>{const i=n[s].flat(1/0);e=e.concat(this.walkTokens(i,r))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,r)))}}return e}use(...o){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{const t={...e};if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const s=r.renderers[n.name];r.renderers[n.name]=s?function(...i){let a=n.renderer.apply(this,i);return!1===a&&(a=s.apply(this,i)),a}:n.renderer}if("tokenizer"in n){if(!n.level||"block"!==n.level&&"inline"!==n.level)throw new Error("extension level must be 'block' or 'inline'");const s=r[n.level];s?s.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&("block"===n.level?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:"inline"===n.level&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),t.extensions=r),e.renderer){const n=this.defaults.renderer||new U(this.defaults);for(const s in e.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=e.renderer[s],l=n[s];n[s]=(...c)=>{let p=a.apply(n,c);return!1===p&&(p=l.apply(n,c)),p||""}}t.renderer=n}if(e.tokenizer){const n=this.defaults.tokenizer||new ne(this.defaults);for(const s in e.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=e.tokenizer[s],l=n[s];n[s]=(...c)=>{let p=a.apply(n,c);return!1===p&&(p=l.apply(n,c)),p}}t.tokenizer=n}if(e.hooks){const n=this.defaults.hooks||new re;for(const s in e.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=e.hooks[s],l=n[s];n[s]=re.passThroughHooks.has(s)?c=>{if(this.defaults.async)return Promise.resolve(a.call(n,c)).then(d=>l.call(n,d));const p=a.call(n,c);return l.call(n,p)}:(...c)=>{let p=a.apply(n,c);return!1===p&&(p=l.apply(n,c)),p}}t.hooks=n}if(e.walkTokens){const n=this.defaults.walkTokens,s=e.walkTokens;t.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),n&&(a=a.concat(n.call(this,i))),a}}this.defaults={...this.defaults,...t}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,r){return P.lex(o,r??this.defaults)}parser(o,r){return N.parse(o,r??this.defaults)}parseMarkdown(o){return(e,t)=>{const n={...t},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===n.async)return i(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 e>"u"||null===e)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=o);const a=s.hooks?s.hooks.provideLexer():o?P.lex:P.lexInline,l=s.hooks?s.hooks.provideParser():o?N.parse:N.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(e):e).then(c=>a(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let c=a(e,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let p=l(c,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(c){return i(c)}}}onError(o,r){return e=>{if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",o){const t="<p>An error occurred:</p><pre>"+O(e.message+"",!0)+"</pre>";return r?Promise.resolve(t):t}if(r)return Promise.reject(e);throw e}}};function v(o,r){return z.parse(o,r)}v.options=v.setOptions=function(o){return z.setOptions(o),ze(v.defaults=z.defaults),v},v.getDefaults=function he(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},v.defaults=M,v.use=function(...o){return z.use(...o),ze(v.defaults=z.defaults),v},v.walkTokens=function(o,r){return z.walkTokens(o,r)},v.parseInline=z.parseInline,v.Parser=N,v.parser=N.parse,v.Renderer=U,v.TextRenderer=xe,v.Lexer=P,v.lexer=P.lex,v.Tokenizer=ne,v.Hooks=re,v.parse=v;var tt=k(58),nt=k(2306),Bn=k(140);class An extends U{baseSize;documentListHandlers;entityListHandlers;_handlers;context={};counters={};getIndex(r){const e=this.counters[r]||0;return this.counters[r]=e+1,e}constructor(r="m",e){super(),this.baseSize=r,this._handlers=e,this.documentListHandlers=e?.documentList,this.entityListHandlers=e?.entityList,this.setupRenderers()}resetContext(){this.context={},this.counters={}}getContext(){return this.context}scaleSize(r){const e=["xs","s","m","l","xl"],t=e.indexOf(this.baseSize),n=e.indexOf(r);return e[Math.max(0,Math.min(e.length-1,n+(t-2)))]}setupRenderers(){this.heading=({tokens:r,depth:e})=>{const i=this.scaleSize({1:"xl",2:"l",3:"l",4:"m",5:"m",6:"s"}[e]),a={1:"bold",2:"semibold",3:"semibold",4:"semibold",5:"medium",6:"medium"}[e],l=this.parser?.parseInline(r)||"";return`<cue-typography size="${i}" weight="${a}"${this.getIndex("heading")>0?' style="margin-top: 24px; display: block;"':' style="display: block;"'}>${l}</cue-typography>\n`},this.paragraph=({tokens:r})=>{const e=this.scaleSize("m"),t=this.parser?.parseInline(r)||"";return/^(?:\s*,?\s*<cue-href-chip\b[^>]*><\/cue-href-chip>)+\s*$/.test(t)?`<div style="display: flex; gap: 6px; flex-wrap: wrap;">${t.replace(/(<\/cue-href-chip>)\s*,?\s*/g,"$1").trim()}</div>\n`:`<div class="cue-md-p"><cue-typography size="${e}" weight="regular">${t}</cue-typography></div>\n`},this.listitem=({tokens:r})=>{const e=this.scaleSize("m");return`<li class="cue-md-li" style="font-size: var(--cue-font-${e}-size);"><cue-typography size="${e}" weight="regular">${this.parser?.parseInline(r)||""}</cue-typography></li>`},this.tablecell=({tokens:r,header:e,align:t})=>{const n=e?"th":"td",i=e?"semibold":"regular";return`<${n}${t?` style="text-align: ${t}"`:""}><cue-typography size="${this.scaleSize("m")}" weight="${i}">${this.parser?.parseInline(r)||""}</cue-typography></${n}>`},this.blockquote=({text:r,tokens:e})=>/^\[!(NOTE|WARNING|IMPORTANT|TIP|CAUTION)\]/i.test(r.trimStart())?"":`<blockquote class="cue-md-blockquote"><cue-typography size="${this.scaleSize("m")}" weight="regular">${this.parser?.parse(e)||""}</cue-typography></blockquote>`,this.link=({href:r,title:e,tokens:t})=>{const n=this.parser?.parseInline(t)||"";if(!r){const i=this.getIndex("hrefchip"),a=`hrefchip_menuitems_${i}`,l=`hrefchip_id_${i}`,c=`hrefchip_click_${i}`,p=n.replace(/<[^>]*>/g,"");return this.context[l]=p,this.context[a]=()=>this._handlers?.hrefChip?.menuItems?.(p)??[],this.context[c]=()=>{this._handlers?.hrefChip?.clicked?.(p)},`<cue-href-chip [label]="context.${l}" [menuItems]="context.${a}()" (clicked)="context.${c}()"></cue-href-chip>`}return`<a href="${r}"${e?` title="${e}"`:""} target="_blank" rel="noopener noreferrer">${n}</a>`},this.codespan=({text:r})=>`<code class="cue-code-inline">${r}</code>`,this.code=r=>{const e="36px";if("document-list"===r.lang){const t=r.documentRefs;if(!t||0===t.length)return"";const s=`doc_refs_${this.getIndex("doc")}`;return this.context[s]=t,this._handlers?.availableContentCategories&&(this.context.availableContentCategories=this._handlers.availableContentCategories),`<cue-document-list [documentRefs]="context.${s}" [documentdata]="context.documentdata" [handlers]="context.documentlisthandlers" [availableContentCategories]="context.availableContentCategories" (clickedDocument)="context.documentclickedrow($event)" style="margin-bottom: ${e};"></cue-document-list>`}if("entity-list"===r.lang){const t=r.iris;if(!t)return"";const s=`entity_iris_${this.getIndex("entity")}`;return this.context[s]=t,this._handlers?.availableEntityCategories&&(this.context.availableEntityCategories=this._handlers.availableEntityCategories),this._handlers?.availableEntityRelationships&&(this.context.availableEntityRelationships=this._handlers.availableEntityRelationships),`<cue-ent-list [entities]="context.${s}" [entitydata]="context.entitydata" [entityLocations]="context.entitylocations" [handlers]="context.entitylisthandlers" [availableEntityCategories]="context.availableEntityCategories" [availableEntityRelationships]="context.availableEntityRelationships" [mapboxToken]="context.mapboxToken" (rowClicked)="context.entityclickedrow($event)" style="margin-bottom: ${e};"></cue-ent-list>`}if("map"===r.lang){const t=r.mapData;if(!t||!t.layers)return"";const n=this.getIndex("map"),s=`map_layers_${n}`,i=`map_settings_${n}`;return this.context[s]=t.layers,this.context[i]=t.settings,`<cue-card style="height: 300px; display: block; margin-bottom: ${e};" [padded]="false"><cue-map [layers]="context.${s}" [settings]="context.${i}"></cue-map></cue-card>`}return`<div style="margin-bottom: ${e};">${super.code(r)}</div>`}}walkTokens(r){return(0,Ie.A)(function*(){if("code"===r.type&&"document-list"===r.lang){const e=r.text.split("\n").filter(s=>s.trim().length>0),t=new Map,n=[];for(const s of e){const i=s.trim(),a=i.match(/^(.+)\?page=(\d+)$/);if(a){const l=a[1],c=a[2];t.has(l)||(t.set(l,{id:l,pages:[]}),n.push(l));const p=t.get(l);p.pages||(p.pages=[]),p.pages.push({id:i,page:c,relevance:0})}else t.has(i)||(t.set(i,{id:i}),n.push(i))}r.documentRefs=n.map(s=>t.get(s))}if("code"===r.type&&"entity-list"===r.lang){const e=r.text.split("\n").filter(t=>t.trim().length>0);r.iris=e}if("code"===r.type&&"map"===r.lang){const e=r.text.split("\n").filter(l=>l.trim().length>0),t=e[0]?.trim()||"",n=e.slice(1),s={};n.forEach(l=>{const c=l.split(";"),p=c[0]?.trim(),d=c[1]?.trim(),u=c[2]?.trim();if(!p||!d)return;const h=(0,tt.S)(d);if(!h)return;const g=(0,tt.n)(h);let m={};if(u)try{m=JSON.parse(u)}catch{}s[p]||(s[p]=[]),s[p].push({type:"Feature",properties:m,geometry:g})});const i=[];Object.keys(s).forEach(l=>{const c=new nt.ux(l);c.collection=new Bn.o(s[l]),i.push(c)});const a=new nt.yY;a.mapboxToken=t,a.contextMenu.showFlyTo=!1,r.mapData={layers:i,settings:a}}})()}}let Pn=(()=>{class o{envInjector=(0,f.WQX)(f.uvJ);fileURL=$.hFB.required();html=(0,f.vPA)("");hookOptions={sanitize:!1,globalParsersBlueprint:{environmentInjector:this.envInjector}};parsers=[{component:{importPromise:()=>Promise.resolve().then(k.bind(k,2245)),importName:"Typography"},selector:"cue-typography"}];onFile=(0,f.QZP)((()=>{var e=this;return(0,Ie.A)(function*(){const n=yield(yield fetch(e.fileURL())).text(),s=new An("m");s.resetContext();const i=yield v.parse(n,{gfm:!0,breaks:!1,renderer:s,async:!0,walkTokens:s.walkTokens.bind(s)});e.html.set(i)})})());static \u0275fac=function(t){return new(t||o)};static \u0275cmp=S.VBU({type:o,selectors:[["cue-md-viewer"]],inputs:{fileURL:[1,"fileURL"]},decls:2,vars:3,consts:[[1,"page"],[3,"parsers","content","options"]],template:function(t,n){1&t&&(S.j41(0,"div",0),S.nrm(1,"ngx-dynamic-hooks",1),S.k0s()),2&t&&(S.R7$(),S.Y8G("parsers",n.parsers)("content",n.html())("options",n.hookOptions))},dependencies:[qt],styles:[".page[_ngcontent-%COMP%]{overflow-y:auto;height:100%;padding:16px;box-sizing:border-box}[_nghost-%COMP%] cue-typography{display:inline-block}[_nghost-%COMP%] .cue-md-p{margin-bottom:24px;opacity:.9;line-height:1.6;display:block}[_nghost-%COMP%] .cue-md-p:last-child{margin-bottom:0}[_nghost-%COMP%] .cue-md-blockquote{margin-bottom:24px;opacity:.9;border-left:4px solid var(--cue-border-color);padding-left:16px}[_nghost-%COMP%] ul, [_nghost-%COMP%] ol{margin-bottom:24px;padding-left:28px;font-family:var(--cue-font-family);opacity:.9;line-height:1.6}[_nghost-%COMP%] li.cue-md-li{margin-bottom:12px}[_nghost-%COMP%] table{margin-bottom:24px;border-collapse:collapse;width:100%}[_nghost-%COMP%] th, [_nghost-%COMP%] td{padding:8px 12px;border-bottom:1px solid var(--cue-border-color, #eee);text-align:left}[_nghost-%COMP%] th cue-typography{font-weight:var(--cue-font-weight-semibold)}[_nghost-%COMP%] .cue-code-inline{background-color:var(--cue-border-color);padding:0 4px;border-radius:4px;font-family:monospace;font-size:1.1em;font-weight:500;color:var(--cue-main-foreground)}"],changeDetection:0})}return o})()}}]);
|
package/382.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[382],{2382(P,f,r){r.d(f,{CueDocumentList:()=>A});var p=r(467),a=r(7705),c=r(5802),h=r(2271),C=r(2960),v=r(2065),w=r(4372),O=r(5381),b=r(2245),o=r(5547);function M(i,E){if(1&i&&(o.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),o.EFF(2),o.k0s()()),2&i){const t=o.XpG();o.R7$(2),o.SpI(" ",t.errorMessage()," ")}}function I(i,E){if(1&i){const t=o.RV6();o.j41(0,"cue-doc-list",3),o.bIt("clickedDocument",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedDocument.emit(s))})("clickedDownloadDocument",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedDownloadDocument.emit(s))})("clickedOpenInDir",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedOpenInDir.emit(s))})("clickedOpen",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedOpen.emit(s))}),o.k0s()}if(2&i){const t=o.XpG();o.Y8G("documentRefs",t.documentRefs())("documentData",t.documentData())("handlers",t.handlers())("availableContentCategories",t.availableContentCategories())("detailedView",t.detailedView())("simple",t.simple())("pageSize",t.pageSize())("prefetchPages",t.prefetchPages())("showOpenInDocumentViewerAction",t.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",t.showOpenInFileManagerAction())("customOverlayActions",t.customOverlayActions())("variant",t.variant())}}function D(i){return i.split("?")[0].trim()}let A=(()=>{class i{projectId=(0,a.hFB)(void 0);uuids=(0,a.hFB)([]);sdkState=(0,a.hFB)(void 0);detailedView=(0,a.hFB)(!1);simple=(0,a.hFB)(!1);pageSize=(0,a.hFB)(10);prefetchPages=(0,a.hFB)(3);showOpenInDocumentViewerAction=(0,a.hFB)(!1);showOpenInFileManagerAction=(0,a.hFB)(!1);customMenuItems=(0,a.hFB)([]);variant=(0,a.hFB)("none");clickedDocument=(0,a.CGW)();clickedDownloadDocument=(0,a.CGW)();clickedOpenInDir=(0,a.CGW)();clickedOpen=(0,a.CGW)();state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);documentData=(0,c.vPA)({});availableContentCategories=(0,c.vPA)(void 0);documentRefs=(0,h.EW)(()=>{const t=new Set;return(this.uuids()??[]).map(D).filter(e=>!!e).filter(e=>!t.has(e)&&(t.add(e),!0)).map(e=>({id:e}))});customOverlayActions=(0,h.EW)(()=>(this.customMenuItems()||[]).map(e=>({label:e.label,icon:e.icon,action:s=>{e.action(s.rowData,s)}})));handlers=(0,h.EW)(()=>{var t=this;const e=this._docs();if(e)return{requestData:(s=(0,p.A)(function*(n){const m=n.map(D).filter(u=>!!u),d=m.filter(u=>!t.documentData()[u]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:m.length,missingCount:d.length,missing:d}),d.length)try{const u=e,l=t.simple()&&u.fetchDocumentDataSimple?yield u.fetchDocumentDataSimple(d):yield e.fetchDocumentData(d);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(l).length,ids:Object.keys(l)});const g={};Object.values(l).forEach(_=>{g[_.id]=function y(i){return{id:i.id,path:i.path,suffix:i.suffix,size:i.size,contentIRI:i.contentIRI,providerId:i.providerId,tags:i.tags??[],summary:i.summary??"",categories:i.categories??[],subject:i.subject,relevance:0}}(_)}),Object.keys(g).length>0&&t.documentData.update(_=>({..._,...g}))}catch(u){console.error("[CueDocumentListWC] Failed to fetch document data:",u),t.errorMessage.set(u instanceof Error?u.message:String(u)),t.state.set("error")}}),function(m){return s.apply(this,arguments)}),requestDownload:function(){var s=(0,p.A)(function*(n){const m=t._cue(),d=t.projectId();if(m&&d)try{const u=yield m.storage.getDownloadUrl(d,n.id,n.suffix,"raw"),l=yield fetch(u);if(!l.ok)throw new Error(`Download failed: ${l.status} ${l.statusText}`);const g=yield l.blob(),_=(0,w.M)(n.path)||`${n.id}${n.suffix||""}`;(0,v.KE)(g,_)}catch(u){console.error("[CueDocumentListWC] Failed to download document:",u)}});return function(m){return s.apply(this,arguments)}}(),requestOpen:(s,n)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:s,document:n})},requestOpenInDir:(s,n)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:s,document:n})}};var s});_cue=(0,c.vPA)(void 0);_docs=(0,c.vPA)(void 0);_ownedView;_unsubscribeCategories;_lastSetupSignature;constructor(){(0,c.QZP)(()=>{const t=this.projectId(),e=this.sdkState(),s=e?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:t,uuids:this.uuids().length,hasSdkState:!!e,hasCue:!!e?.cue,hasView:!!e?.view,hasDocuments:!!e?.documents}),!t||!e)return this._clearRuntimeState(),void this.state.set("idle");const n={projectId:t,cue:e.cue,view:e.view,documents:e.documents,language:s,simple:this.simple()};if(this._isSameSetupSignature(n))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(t,e),this._lastSetupSignature=n,this.state.set("ready"),this.errorMessage.set(null)}),(0,c.QZP)(()=>{const t=new Set(this.documentRefs().map(e=>e.id));this.documentData.update(e=>Object.fromEntries(Object.entries(e).filter(([n])=>t.has(n))))})}ngOnDestroy(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(t,e){const s=e.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(e.availableContentCategories?e.availableContentCategories:void 0),e.documents)return e.documents.setLanguage(s),this._docs.set(e.documents),void this._cue.set(e.cue);if(e.view)return e.view.setLanguage(s),this._docs.set(e.view.documents),this._cue.set(e.cue),void(this.simple()||this._bindCategoriesFromView(e.view));if(e.cue){if(this.simple())return this._docs.set(e.cue.createProjectDocuments(t)),this._cue.set(e.cue),void this.availableContentCategories.set(void 0);const n=e.cue.createProjectView(t,{language:s});return this._ownedView=n,this._docs.set(n.documents),this._cue.set(e.cue),void this._bindCategoriesFromView(n)}this._docs.set(void 0),this._cue.set(void 0),this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindCategoriesFromView(t){const e=()=>{this.availableContentCategories.set(t.availableContentCategories.get())};e(),this._unsubscribeCategories=t.availableContentCategories.subscribe(e)}_clearRuntimeState(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._docs.set(void 0),this._cue.set(void 0),this.documentData.set({}),this.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_isSameSetupSignature(t){const e=this._lastSetupSignature;return!!e&&e.projectId===t.projectId&&e.cue===t.cue&&e.view===t.view&&e.documents===t.documents&&e.language===t.language&&e.simple===t.simple}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=o.VBU({type:i,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],variant:[1,"variant"]},outputs:{clickedDocument:"clickedDocument",clickedDownloadDocument:"clickedDownloadDocument",clickedOpenInDir:"clickedOpenInDir",clickedOpen:"clickedOpen"},decls:2,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[3,"documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"color","#c44","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"]],template:function(e,s){1&e&&o.nVh(0,M,3,1,"cue-flexcontainer",0)(1,I,1,12,"cue-doc-list",1),2&e&&o.vxM("error"===s.state()?0:1)},dependencies:[C.g,O.n,b.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return i})()}}]);
|
package/393.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[393],{3393(se,O,g){g.d(O,{IDBuilder:()=>oe});var s=g(5802),T=g(5332);const I=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,F=function V(i){if(!function N(i){return"string"==typeof i&&I.test(i)}(i))throw TypeError("Invalid UUID");var r,e=new Uint8Array(16);return e[0]=(r=parseInt(i.slice(0,8),16))>>>24,e[1]=r>>>16&255,e[2]=r>>>8&255,e[3]=255&r,e[4]=(r=parseInt(i.slice(9,13),16))>>>8,e[5]=255&r,e[6]=(r=parseInt(i.slice(14,18),16))>>>8,e[7]=255&r,e[8]=(r=parseInt(i.slice(19,23),16))>>>8,e[9]=255&r,e[10]=(r=parseInt(i.slice(24,36),16))/1099511627776&255,e[11]=r/4294967296&255,e[12]=r>>>24&255,e[13]=r>>>16&255,e[14]=r>>>8&255,e[15]=255&r,e};function j(i,r,e,t){switch(i){case 0:return r&e^~r&t;case 1:case 3:return r^e^t;case 2:return r&e^r&t^e&t}}function C(i,r){return i<<r|i>>>32-r}const R=function L(i,r,e){function t(n,o,u,h){var d;if("string"==typeof n&&(n=function A(i){i=unescape(encodeURIComponent(i));for(var r=[],e=0;e<i.length;++e)r.push(i.charCodeAt(e));return r}(n)),"string"==typeof o&&(o=F(o)),16!==(null===(d=o)||void 0===d?void 0:d.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+n.length);if(c.set(o),c.set(n,o.length),(c=e(c))[6]=15&c[6]|r,c[8]=63&c[8]|128,u){h=h||0;for(var f=0;f<16;++f)u[h+f]=c[f];return u}return(0,T.k)(c)}try{t.name=i}catch{}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}("v5",80,function H(i){var r=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof i){var t=unescape(encodeURIComponent(i));i=[];for(var n=0;n<t.length;++n)i.push(t.charCodeAt(n))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);for(var u=Math.ceil((i.length/4+2)/16),h=new Array(u),d=0;d<u;++d){for(var c=new Uint32Array(16),f=0;f<16;++f)c[f]=i[64*d+4*f]<<24|i[64*d+4*f+1]<<16|i[64*d+4*f+2]<<8|i[64*d+4*f+3];h[d]=c}h[u-1][14]=8*(i.length-1)/Math.pow(2,32),h[u-1][14]=Math.floor(h[u-1][14]),h[u-1][15]=8*(i.length-1)&4294967295;for(var y=0;y<u;++y){for(var m=new Uint32Array(80),v=0;v<16;++v)m[v]=h[y][v];for(var p=16;p<80;++p)m[p]=C(m[p-3]^m[p-8]^m[p-14]^m[p-16],1);for(var b=e[0],M=e[1],x=e[2],_=e[3],P=e[4],S=0;S<80;++S){var D=Math.floor(S/20),re=C(b,5)+j(D,M,x,_)+P+r[D]+m[S]>>>0;P=_,_=x,x=C(M,30)>>>0,M=b,b=re}e[0]=e[0]+b>>>0,e[1]=e[1]+M>>>0,e[2]=e[2]+x>>>0,e[3]=e[3]+_>>>0,e[4]=e[4]+P>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,255&e[0],e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,255&e[1],e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,255&e[2],e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,255&e[3],e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,255&e[4]]}),B={\u00e4:"ae",a\u0308:"ae",\u00c4:"AE",\u00f6:"oe",\u00d6:"OE",\u00fc:"ue",u\u0308:"ue",\u00dc:"UE",U\u0308:"UE",\u00df:"ss",\u00e6:"ae",\u00c6:"AE",\u00f8:"oe",\u00d8:"OE",\u00e5:"aa",\u00c5:"AA",\u00e1:"a",\u00c1:"A",\u00f0:"d",\u00d0:"D",\u00e9:"e",\u00c9:"E",\u00ed:"i",\u00cd:"I",\u00f3:"o",\u00d3:"O",\u00fa:"u",\u00da:"U",\u00fd:"y",\u00dd:"Y",\u00fe:"th",\u00de:"Th"};var a=g(5547),l=g(7705),w=g(2271),Y=g(5971),$=g(3319),W=g(7089);let K=(()=>{class i{element;enabled=(0,l.hFB)(!1,{alias:"cueAutoMultiline"});value=(0,l.hFB)("",{alias:"autoMultilineValue"});buttonOffset=(0,l.hFB)(0,{alias:"autoMultilineButtonOffset"});shouldSwitchToMultiline=(0,l.CGW)();multilinePasted=(0,l.CGW)();measureSpan;hasSwitched=!1;constructor(e){this.element=e,(0,s.QZP)(()=>{this.value();this.enabled()&&this.measureSpan&&!this.hasSwitched&&setTimeout(()=>this.checkOverflow(),0)})}ngAfterViewInit(){this.enabled()&&(this.createMeasurementSpan(),setTimeout(()=>this.checkOverflow(),0))}onPaste(e){if(!this.enabled()||this.hasSwitched)return;const t=e.clipboardData?.getData("text");if(t&&t.includes("\n")){e.preventDefault();const n=this.element.nativeElement,o=n.selectionStart||0,u=n.value,h=u.substring(0,o)+t+u.substring(n.selectionEnd||o);this.hasSwitched=!0,this.multilinePasted.emit(h)}}createMeasurementSpan(){this.measureSpan=document.createElement("span"),this.measureSpan.style.position="absolute",this.measureSpan.style.visibility="hidden",this.measureSpan.style.whiteSpace="nowrap",this.measureSpan.style.pointerEvents="none";const e=this.element.nativeElement,t=window.getComputedStyle(e);this.measureSpan.style.font=t.font,this.measureSpan.style.padding=t.padding,e.parentElement?.appendChild(this.measureSpan)}checkOverflow(){if(!this.enabled()||!this.measureSpan||this.hasSwitched)return;const e=this.element.nativeElement;this.measureSpan.textContent=this.value(),this.measureSpan.offsetWidth>e.offsetWidth-this.buttonOffset()&&(this.hasSwitched=!0,this.shouldSwitchToMultiline.emit())}ngOnDestroy(){this.measureSpan&&this.measureSpan.remove()}static \u0275fac=function(t){return new(t||i)(a.rXU(a.aKT))};static \u0275dir=a.FsC({type:i,selectors:[["","cueAutoMultiline",""]],hostBindings:function(t,n){1&t&&a.bIt("paste",function(u){return n.onPaste(u)})},inputs:{enabled:[1,"cueAutoMultiline","enabled"],value:[1,"autoMultilineValue","value"],buttonOffset:[1,"autoMultilineButtonOffset","buttonOffset"]},outputs:{shouldSwitchToMultiline:"shouldSwitchToMultiline",multilinePasted:"multilinePasted"}})}return i})(),Q=(()=>{class i{element;enabled=(0,l.hFB)(!0,{alias:"cueShiftEnter"});shiftEnterPressed=(0,l.CGW)();constructor(e){this.element=e}onKeyDown(e){if(this.enabled()&&"Enter"===e.key&&e.shiftKey){e.preventDefault();const t=this.element.nativeElement,n=t.selectionStart||0,o=t.value,u=o.substring(0,n)+"\n"+o.substring(n);this.shiftEnterPressed.emit({newValue:u,cursorPosition:n+1})}}static \u0275fac=function(t){return new(t||i)(a.rXU(a.aKT))};static \u0275dir=a.FsC({type:i,selectors:[["","cueShiftEnter",""]],hostBindings:function(t,n){1&t&&a.bIt("keydown",function(u){return n.onKeyDown(u)})},inputs:{enabled:[1,"cueShiftEnter","enabled"]},outputs:{shiftEnterPressed:"shiftEnterPressed"}})}return i})();const Z=["inputElement"],J=["textareaElement"];function q(i,r){if(1&i){const e=a.RV6();a.j41(0,"input",4,0),a.mxI("valueChange",function(n){s.eBV(e);const o=a.XpG();return a.DH7(o.value,n)||(o.value=n),s.Njj(n)}),a.bIt("shiftEnterPressed",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.handleShiftEnter(n))})("shouldSwitchToMultiline",function(){s.eBV(e);const n=a.XpG();return s.Njj(n.switchToMultiline())})("multilinePasted",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.handleMultilinePaste(n))})("keyup",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.update(n))})("input",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.update(n))}),a.k0s()}if(2&i){const e=a.XpG();a.R50("value",e.value),a.Y8G("placeholder",e.placeholder())("cueShiftEnter",e.responsiveMode())("cueAutoMultiline",e.responsiveMode())("autoMultilineValue",e.value())("autoMultilineButtonOffset",e.showSubmitButton()?60:0)}}function ee(i,r){if(1&i){const e=a.RV6();a.j41(0,"textarea",5,1),a.mxI("valueChange",function(n){s.eBV(e);const o=a.XpG();return a.DH7(o.value,n)||(o.value=n),s.Njj(n)}),a.bIt("keyup",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.update(n))}),a.k0s(),a.j41(2,"div",6),a.bIt("mousedown",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.startDrag(n))}),a.nrm(3,"div",7),a.k0s()}if(2&i){const e=a.XpG();a.R50("value",e.value),a.Y8G("placeholder",e.placeholder())}}function te(i,r){if(1&i){const e=a.RV6();a.j41(0,"cue-button",8),a.bIt("click",function(){s.eBV(e);const n=a.XpG();return s.Njj(n.searchInProgress()?n.cancel():n.submit())}),a.nrm(1,"cue-button-icon",9),a.k0s()}if(2&i){const e=a.XpG();a.AVh("multiline-button",e.effectiveMultiLineMode()),a.Y8G("variant",e.buttonVariant())("size",e.buttonSize())("cueTooltip",e.buttonTooltip()),a.R7$(),a.Y8G("icon",e.searchInProgress()?e.cancelIcon():e.submitIcon())}}let ne=(()=>{class i{renderer=(0,s.WQX)(a.sFG);placeholder=(0,l.hFB)("Search...");value=(0,l.geq)("");searchInProgress=(0,l.geq)(!1);searchFailed=(0,l.hFB)(!1);size=(0,l.hFB)("l");debounceTime=(0,l.hFB)(200);variant=(0,l.hFB)("secondary");showSubmitButton=(0,l.hFB)(!0);submitIcon=(0,l.hFB)("search");cancelIcon=(0,l.hFB)("close");buttonTooltip=(0,l.hFB)("");buttonVariant=(0,l.hFB)("accent");multiLineMode=(0,l.hFB)(!1);responsiveMode=(0,l.hFB)(!1);autoMultiLineMode=(0,s.vPA)(!1);effectiveMultiLineMode=(0,w.EW)(()=>this.multiLineMode()||this.responsiveMode()&&this.autoMultiLineMode());inputElement=(0,l.ebz)("inputElement");textareaElement=(0,l.ebz)("textareaElement");valueChange=(0,l.CGW)();valueSubmit=(0,l.CGW)();_debounceTimer;_value="";isDragging=(0,s.vPA)(!1);dragStartY=0;dragStartHeight=0;constructor(){(0,s.QZP)(()=>{this.effectiveMultiLineMode()&&this.responsiveMode()&&setTimeout(()=>{const t=this.textareaElement()?.nativeElement;if(t){t.focus();const n=t.value.length;t.setSelectionRange(n,n)}},0)}),(0,s.QZP)(()=>{this.value();const t=this.textareaElement()?.nativeElement;if(t&&this.effectiveMultiLineMode()){t.style.height="auto";const n=Math.min(t.scrollHeight,250);t.style.height=`${n}px`}})}startDrag(e){e.preventDefault();const t=this.textareaElement()?.nativeElement;if(!t)return;this.isDragging.set(!0),this.dragStartY=e.clientY;const n=window.getComputedStyle(t),o=parseFloat(n.height);this.dragStartHeight=o,t.style.height=`${o}px`;const u=this.onDragMove.bind(this),h=this.onDragEnd.bind(this);this.renderer.listen("document","mousemove",u);const d=this.renderer.listen("document","mouseup",c=>{h(c),d()})}onDragMove(e){if(!this.isDragging())return;const t=this.textareaElement()?.nativeElement;if(!t)return;const o=Math.max(64,this.dragStartHeight+(e.clientY-this.dragStartY));t.style.height=`${o}px`}onDragEnd(e){this.isDragging.set(!1)}switchToMultiline(){this.autoMultiLineMode.set(!0)}handleShiftEnter(e){this.value.set(e.newValue),this._value=e.newValue,this.autoMultiLineMode.set(!0),setTimeout(()=>{const t=this.textareaElement()?.nativeElement;t&&(t.focus(),t.setSelectionRange(e.cursorPosition,e.cursorPosition))},0)}handleMultilinePaste(e){this.value.set(e),this._value=e,this.autoMultiLineMode.set(!0),setTimeout(()=>{const t=this.textareaElement()?.nativeElement;if(t){t.focus();const n=t.value.length;t.setSelectionRange(n,n)}},0)}handleEnterKey(){this.multiLineMode()||this.responsiveMode()&&this.effectiveMultiLineMode()||this.submit()}update(e){this._value=e.target.value,this.value.set(this._value),clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.valueChange.emit(this._value)},this.debounceTime())}submit(){this.valueSubmit.emit(this._value);const e=this.textareaElement()?.nativeElement;e&&(e.style.height="")}cancel(){this._value="",this.searchInProgress.set(!1),this.valueChange.emit(this._value)}buttonSize=(0,w.EW)(()=>"s"===this.size()?"xs":"m");hostStyles=(0,w.EW)(()=>{const t="s"===this.size()?"--height: calc(32rem / 16); --search-button-right: calc(4rem / 16); --search-input-padding-x: 1em; --search-font-size: 0.875em;":"";return`\n color: var(--cue-${this.variant()}Contrast);\n background-color: var(--cue-${this.variant()});\n ${t}\n `});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=a.VBU({type:i,selectors:[["cue-search-bar"]],viewQuery:function(t,n){1&t&&a.wEZ(n.inputElement,Z,5)(n.textareaElement,J,5),2&t&&a.NyB(2)},hostVars:6,hostBindings:function(t,n){1&t&&a.bIt("keydown.enter",function(){return n.handleEnterKey()},a.EBC),2&t&&(a.Aen(n.hostStyles()),a.AVh("pulsing",n.searchInProgress()&&!n.searchFailed())("failed",n.searchFailed()))},inputs:{placeholder:[1,"placeholder"],value:[1,"value"],searchInProgress:[1,"searchInProgress"],searchFailed:[1,"searchFailed"],size:[1,"size"],debounceTime:[1,"debounceTime"],variant:[1,"variant"],showSubmitButton:[1,"showSubmitButton"],submitIcon:[1,"submitIcon"],cancelIcon:[1,"cancelIcon"],buttonTooltip:[1,"buttonTooltip"],buttonVariant:[1,"buttonVariant"],multiLineMode:[1,"multiLineMode"],responsiveMode:[1,"responsiveMode"]},outputs:{value:"valueChange",searchInProgress:"searchInProgressChange",valueChange:"valueChange",valueSubmit:"valueSubmit"},decls:3,vars:2,consts:[["inputElement",""],["textareaElement",""],["type","text",1,"search-input",3,"value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],[1,"search-button",3,"multiline-button","variant","size","cueTooltip"],["type","text",1,"search-input",3,"valueChange","shiftEnterPressed","shouldSwitchToMultiline","multilinePasted","keyup","input","value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],["rows","1",1,"search-input","multiline",3,"valueChange","keyup","value","placeholder"],[1,"drag-handle",3,"mousedown"],[1,"drag-handle-icon"],[1,"search-button",3,"click","variant","size","cueTooltip"],[3,"icon"]],template:function(t,n){1&t&&(a.nVh(0,q,2,6,"input",2)(1,ee,4,2),a.nVh(2,te,2,6,"cue-button",3)),2&t&&(a.vxM(n.effectiveMultiLineMode()?1:0),a.R7$(2),a.vxM(n.showSubmitButton()?2:-1))},dependencies:[Y.$,$.a,W.d,K,Q],styles:['[_nghost-%COMP%]{--height: 4rem ;border-radius:var(--height);font-family:var(--cue-font-family);position:relative;height:var(--height);display:flex;align-items:stretch}@container cue-container (width < 20em){[_nghost-%COMP%]{--height: 2.125rem }}[_nghost-%COMP%]:has(textarea.multiline){border-radius:1.25rem;min-height:var(--height);height:auto}.pulsing[_nghost-%COMP%]{animation:pulse-border 1.5s infinite ease-in-out}.failed[_nghost-%COMP%]{animation:_ngcontent-%COMP%_pulse-border-red 1.5s infinite ease-in-out}@keyframes _ngcontent-%COMP%_pulse-border-red{0%,to{box-shadow:0 0 #ef444466}50%{box-shadow:0 0 0 8px #ef44441a}}cue-button[_ngcontent-%COMP%]{position:absolute;right:var(--search-button-right, .625em);top:50%;transform:translateY(-50%)}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.625em;top:auto;transform:none}@container cue-container (width < 20em){cue-button[_ngcontent-%COMP%]{right:.25em}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.25em}}cue-typography[_ngcontent-%COMP%]{display:contents}cue-typography[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1;display:flex;align-items:stretch}input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{all:unset;font:inherit;font-size:var(--search-font-size, 1em);padding:0 var(--search-input-padding-x, 2em);flex:1;min-width:0;width:100%;height:100%;background-color:transparent;color:inherit;border-radius:4rem}input[_ngcontent-%COMP%]:focus-visible, textarea[_ngcontent-%COMP%]:focus-visible{outline:1px solid currentColor;outline-offset:2px}input[_ngcontent-%COMP%]::placeholder, textarea[_ngcontent-%COMP%]::placeholder{color:currentColor;opacity:.6}input[_ngcontent-%COMP%]::-ms-input-placeholder, textarea[_ngcontent-%COMP%]::-ms-input-placeholder{color:currentColor}@container cue-container (width < 20em){input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{padding:0 1em}}textarea.multiline[_ngcontent-%COMP%]{font-size:.875em;line-height:1.5;padding:1em 4em 2em 2em;resize:none;min-height:var(--height);border-radius:1.25rem;box-sizing:border-box;overflow-y:auto;scrollbar-gutter:stable}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar{width:10px}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#ffffff1a;border-top:28px solid transparent;border-bottom:28px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#fff6;border-radius:5px;border:2px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:#ffffff80}@container cue-container (width < 20em){textarea.multiline[_ngcontent-%COMP%]{padding:.75em 3em 1.75em 1em}}.drag-handle[_ngcontent-%COMP%]{position:absolute;bottom:4px;left:50%;transform:translate(-50%);width:48px;height:24px;display:flex;align-items:center;justify-content:center;cursor:ns-resize;z-index:2;transition:opacity .2s ease;opacity:.6}.drag-handle[_ngcontent-%COMP%]:hover, .drag-handle[_ngcontent-%COMP%]:active{opacity:1}.drag-handle-icon[_ngcontent-%COMP%]{position:relative;width:24px;height:12px}.drag-handle-icon[_ngcontent-%COMP%]:before, .drag-handle-icon[_ngcontent-%COMP%]:after{content:"";position:absolute;width:16px;height:2px;background-color:currentColor;border-radius:1px;left:50%;transform:translate(-50%)}.drag-handle-icon[_ngcontent-%COMP%]:before{top:2px}.drag-handle-icon[_ngcontent-%COMP%]:after{bottom:2px}'],changeDetection:0})}return i})();var ie=g(5381),ae=g(2245);let oe=(()=>{class i{id=(0,s.vPA)("");updateId(e){this.id.set(function E(i,r=!1){return i=function X(i,r=!1){let e=i;for(const t in B)e=e.replace(new RegExp(t,"g"),B[t]);return r&&e!==i&&console.info(`${i} -> ${e}`),e}(i,r),R(i,"daca0510-72b5-48ba-9091-b918ca18136b")}(e))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=a.VBU({type:i,selectors:[["cue-id-builder"]],decls:4,vars:2,consts:[["direction","column","align","center"],["placeholder","Text string...",2,"width","100%","text-align","start",3,"valueChange","showSubmitButton"]],template:function(t,n){1&t&&(a.j41(0,"cue-flexcontainer",0)(1,"cue-search-bar",1),a.bIt("valueChange",function(u){return n.updateId(u)}),a.k0s(),a.j41(2,"cue-typography"),a.EFF(3),a.k0s()()),2&t&&(a.R7$(),a.Y8G("showSubmitButton",!1),a.R7$(2),a.JRh(n.id()))},dependencies:[ne,ie.n,ae.Typography],encapsulation:2})}return i})()}}]);
|