pennsieve-dashboard 0.1.2 → 0.1.3
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.
|
@@ -88,7 +88,7 @@ var Zs = /* @__PURE__ */ ye({
|
|
|
88
88
|
]));
|
|
89
89
|
}
|
|
90
90
|
}), nr = rr;
|
|
91
|
-
const nt = Xs("
|
|
91
|
+
const nt = Xs("globalPensieveDashVars", () => {
|
|
92
92
|
const o = F([]), e = F({}), t = "dashboard-globalVarsStore", i = F(null), s = F([]), r = F([]), l = F({}), n = rs({});
|
|
93
93
|
function u(C, k) {
|
|
94
94
|
n[C] = k;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(V,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("pinia"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","element-plus"],a):(V=typeof globalThis<"u"?globalThis:V||self,a(V["pennsieve-dashboard"]={},V.Vue,V.Pinia,V.ElementPlus))})(this,function(V,a,oe,mt){"use strict";var cn=Object.defineProperty;var dn=(V,a,oe)=>a in V?cn(V,a,{enumerable:!0,configurable:!0,writable:!0,value:oe}):V[a]=oe;var B=(V,a,oe)=>dn(V,typeof a!="symbol"?a+"":a,oe);/*! Element Plus Icons Vue v2.3.2 */var Ht;var ss=a.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),rs=ss,ns=a.defineComponent({name:"Close",__name:"close",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),os=ns,ls=a.defineComponent({name:"Edit",__name:"edit",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),a.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),Qt=ls,as=a.defineComponent({name:"Lock",__name:"lock",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),hs=as,cs=a.defineComponent({name:"Unlock",__name:"unlock",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),ds=cs;const Ne=oe.defineStore("globalVars",()=>{const o=a.ref([]),e=a.ref({}),t="dashboard-globalVarsStore",i=a.ref(null),s=a.ref([]),r=a.ref([]),l=a.ref({}),n=a.reactive({});function d(S,v){n[S]=v}function h(S={}){for(const v of Object.keys(n))delete n[v];Object.assign(n,S)}const c=S=>{delete n[S],O()};function f(){for(const S of Object.keys(n))delete n[S]}function p(){return JSON.parse(JSON.stringify(n))}const _=S=>r.value.find(v=>v.id===S),x=(S,v)=>{s.value.push({name:S,value:v})},z=()=>{s.value=[]},H=S=>{const v=N(S);l.value=v},D=()=>l.value;function N(S){const v={};if(!S||typeof S!="object")return v;for(const[R,L]of Object.entries(S))if(L&&typeof L=="object"&&!(a.isRef(L)||a.isReactive(L))){const Y=Object.getPrototypeOf(L)===Object.prototype;v[R]=Y?{...L}:a.markRaw(L)}else v[R]=L;return v}const C=S=>{const v=r.value.find(R=>R.id===S);v&&(v.Props=v.Props||{},v.Props.locked=!v.Props.locked)},y=S=>S.map(v=>{const R=e.value[v.componentKey];return R?{...v,component:R}:null}).filter(v=>!!v);function w(){var v,R;return(((R=(v=i.value)==null?void 0:v.save)==null?void 0:R.call(v))??[]).map(L=>{const Y=r.value.find(Pt=>Pt.id===L.id);if(!Y||!Y.componentKey)return console.warn(`save: missing item or componentKey for id=${L==null?void 0:L.id}`),null;const{x:_e,y:ye,w:Ee,h:Ot}=L;return{id:Y.id,componentKey:Y.componentKey,componentName:Y.componentName,hideHeader:Y.hideHeader,Props:Y.Props??{},x:_e,y:ye,w:Ee,h:Ot}}).filter(L=>!!L)}const O=()=>{var v;const S={version:1,items:w(),filters:p()};((v=S.items)==null?void 0:v.length)<1||localStorage.setItem(t,JSON.stringify(S))},P=()=>{const S=localStorage.getItem(t);if(!S){r.value=o.value,h({});return}try{const v=JSON.parse(S);r.value=Array.isArray(v.items)?y(v.items):o.value,h(v.filters??{})}catch(v){console.error("Failed to parse globalVarsStore:",v),r.value=o.value,h({})}};return a.watch(n,()=>O(),{deep:!0}),{DASHBOARD_ITEMS:r,DefaultLayout:o,ComponentRegistry:e,optionsData:s,gridInstance:i,Services:l,Filters:n,setFilter:d,clearFilter:c,clearAllFilters:f,resetFilters:h,getDashItem:_,toggleWidgetLock:C,addOptionsDataItems:x,clearOptionsDataItems:z,saveToLocalStorage:O,loadFromLocalStorage:P,setOptionServices:H,getServices:D}}),us={class:"widget-settings-container"},ps={class:"widget-setting"},fs={class:"dialog-footer"},gs=a.defineComponent({__name:"TextWidgetSettings",props:{showDialog:{type:Boolean},reactiveSourceValue:{},manualEntryValue:{},hideHeaderValue:{type:Boolean}},emits:["close-dialog","update-text-var"],setup(o,{emit:e}){const t=Ne(),{optionsData:i}=oe.storeToRefs(t),s=e,r=o,l=a.computed({get:()=>r.showDialog,set:f=>{f||s("close-dialog")}}),n=a.ref(r.reactiveSourceValue??""),d=a.ref(r.manualEntryValue??""),h=a.ref(!!r.hideHeaderValue);a.watch(()=>r.reactiveSourceValue,f=>{n.value=f??""}),a.watch(()=>r.manualEntryValue,f=>{d.value=f??""},{immediate:!0}),a.watch(()=>r.hideHeaderValue,f=>{h.value=!!f});function c(){var x;const f=(n.value||"").trim(),p=f!=="",_=p?null:((x=d.value)==null?void 0:x.trim())||"";s("update-text-var",{reactiveSource:p?f:null,manualEdit:_,hideHeader:h.value}),l.value=!1}return(f,p)=>{const _=a.resolveComponent("el-option"),x=a.resolveComponent("el-select"),z=a.resolveComponent("el-input"),H=a.resolveComponent("el-checkbox"),D=a.resolveComponent("el-button"),N=a.resolveComponent("el-dialog");return a.openBlock(),a.createBlock(N,{class:"full-dialog-dashboard",modelValue:l.value,"onUpdate:modelValue":p[4]||(p[4]=C=>l.value=C),title:"Text Widget Settings","append-to-body":!0},{footer:a.withCtx(()=>[a.createElementVNode("div",fs,[a.createVNode(D,{class:"secondary",onClick:p[3]||(p[3]=C=>l.value=!1)},{default:a.withCtx(()=>[...p[8]||(p[8]=[a.createTextVNode("Cancel",-1)])]),_:1}),a.createVNode(D,{onClick:c},{default:a.withCtx(()=>[...p[9]||(p[9]=[a.createTextVNode("Save",-1)])]),_:1})])]),default:a.withCtx(()=>[a.createElementVNode("div",us,[a.createElementVNode("div",ps,[p[5]||(p[5]=a.createElementVNode("h4",null,"Select This Widget's Value",-1)),p[6]||(p[6]=a.createElementVNode("h5",null,"Select From Variables",-1)),a.createVNode(x,{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=C=>n.value=C),class:"text-settings-height"},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(_,{value:"",key:"__manual__",label:"Manual entry"})),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),C=>(a.openBlock(),a.createBlock(_,{key:C.name,label:C.name,value:C.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),p[7]||(p[7]=a.createElementVNode("h5",null,"Manual Entry",-1)),a.createVNode(z,{modelValue:d.value,"onUpdate:modelValue":p[1]||(p[1]=C=>d.value=C),class:"text-settings-height"},null,8,["modelValue"]),a.createVNode(H,{modelValue:h.value,"onUpdate:modelValue":p[2]||(p[2]=C=>h.value=C),label:"Hide Header"},null,8,["modelValue"])])])]),_:1},8,["modelValue"])}}}),we=(o,e)=>{const t=o.__vccOpts||o;for(const[i,s]of e)t[i]=s;return t},ms=we(gs,[["__scopeId","data-v-769ea864"]]),_s={key:0},ys=we(a.defineComponent({inheritAttrs:!1,__name:"TextWidget",props:{displayText:{},bindedKey:{},widgetID:{},hideHeader:{type:Boolean}},setup(o){const e=Ne(),t=o;a.inject("dashboard:globalVars",null);const i=a.ref(t.displayText??"");a.watch(()=>t.displayText,D=>{i.value=D??""},{immediate:!0});const s=a.computed(()=>!!(t.bindedKey&&t.bindedKey.trim()!=="")),r=a.computed(()=>{var y;const D=(y=t.bindedKey)==null?void 0:y.trim();if(!D)return"—";const N=e.optionsData.find(w=>(w==null?void 0:w.name)===D),C=N==null?void 0:N.value;return Array.isArray(C)?C.join(", "):C&&typeof C=="object"?JSON.stringify(C):C??"—"}),l=a.ref("Text Widget"),n=a.shallowRef([{comp:Qt,event:_,tooltip:"open Text settings"}]),d=a.ref(!1),h=a.ref(null);function c(){var D,N;d.value=!0,(N=(D=h.value)==null?void 0:D.focus)==null||N.call(D)}function f(){d.value=!1}const p=a.ref(!1);function _(){p.value=!0}function x(){p.value=!1,e.saveToLocalStorage()}function z({manualEdit:D,reactiveSource:N,hideHeader:C}){const y=e.getDashItem(t.widgetID);y&&(y.hideHeader=C,N&&N.trim()!==""?(y.Props=y.Props||{},y.Props.bindedKey=N,y.Props.displayText=null,y.componentName=H(N)):(y.Props=y.Props||{},y.Props.bindedKey=null,y.Props.displayText=D??"",y.componentName=D??"Text"),e.saveToLocalStorage())}function H(D){return D?D.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,N=>N.toUpperCase()):""}return(D,N)=>{const C=a.resolveComponent("el-input"),y=a.resolveDirective("click-out");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.renderSlot(D.$slots,"default",{widgetName:l.value,childIcons:n.value},void 0,!0),a.createElementVNode("div",a.mergeProps({class:"text-widget-wrap"},D.$attrs),[s.value?(a.openBlock(),a.createElementBlock("div",_s,[a.createElementVNode("h2",null,a.toDisplayString(r.value),1)])):a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:1,onKeyup:a.withKeys(f,["enter"]),class:"tw-flex"},[a.withDirectives(a.createElementVNode("div",null,[a.createVNode(C,{ref_key:"textUserInput",ref:h,modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=w=>i.value=w),onFocus:N[1]||(N[1]=w=>{var O,P;return(P=(O=w.target)==null?void 0:O.select)==null?void 0:P.call(O)})},null,8,["modelValue"])],512),[[a.vShow,d.value]]),a.withDirectives(a.createElementVNode("div",{onClick:N[2]||(N[2]=w=>c()),class:"tw-w-full tw-h-full"},[a.createElementVNode("h2",null,a.toDisplayString(i.value),1)],512),[[a.vShow,!d.value]])],32)),[[y,f]])],16),a.createVNode(ms,{"show-dialog":p.value,"reactive-source-value":t.bindedKey||"","manual-entry-value":i.value,"hide-header-value":t.hideHeader||!1,onCloseDialog:x,onUpdateTextVar:z},null,8,["show-dialog","reactive-source-value","manual-entry-value","hide-header-value"])],64)}}}),[["__scopeId","data-v-4743c11f"]]);function _t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var be=_t();function Jt(o){be=o}var Le={exec:()=>null};function M(o,e=""){let t=typeof o=="string"?o:o.source,i={replace:(s,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(Z.caret,"$1"),t=t.replace(s,l),i},getRegex:()=>new RegExp(t,e)};return i}var Z={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+));?/ig,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})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\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")},ws=/^(?:[ \t]*(?:\n|$))+/,bs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ks=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yt=/(?:[*+-]|\d{1,9}[.)])/,ei=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ti=M(ei).replace(/bull/g,yt).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(),Es=M(ei).replace(/bull/g,yt).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(),wt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vs=/^[^\n]+/,bt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ts=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rs=M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yt).getRegex(),je="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",xt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cs=M("^ {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[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xt).replace("tag",je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ii=M(wt).replace("hr",ze).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",je).getRegex(),Ss=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ii).getRegex(),kt={blockquote:Ss,code:bs,def:Ts,fences:xs,heading:ks,hr:ze,html:Cs,lheading:ti,list:Rs,newline:ws,paragraph:ii,table:Le,text:vs},si=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",je).getRegex(),As={...kt,lheading:Es,table:si,paragraph:M(wt).replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",si).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",je).getRegex()},Ds={...kt,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xt).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:Le,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(wt).replace("hr",ze).replace("heading",` *#{1,6} *[^
|
|
1
|
+
(function(V,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("pinia"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","element-plus"],a):(V=typeof globalThis<"u"?globalThis:V||self,a(V["pennsieve-dashboard"]={},V.Vue,V.Pinia,V.ElementPlus))})(this,function(V,a,oe,mt){"use strict";var cn=Object.defineProperty;var dn=(V,a,oe)=>a in V?cn(V,a,{enumerable:!0,configurable:!0,writable:!0,value:oe}):V[a]=oe;var B=(V,a,oe)=>dn(V,typeof a!="symbol"?a+"":a,oe);/*! Element Plus Icons Vue v2.3.2 */var Ht;var ss=a.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),rs=ss,ns=a.defineComponent({name:"Close",__name:"close",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),os=ns,ls=a.defineComponent({name:"Edit",__name:"edit",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),a.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),Qt=ls,as=a.defineComponent({name:"Lock",__name:"lock",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),hs=as,cs=a.defineComponent({name:"Unlock",__name:"unlock",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),ds=cs;const Ne=oe.defineStore("globalPensieveDashVars",()=>{const o=a.ref([]),e=a.ref({}),t="dashboard-globalVarsStore",i=a.ref(null),s=a.ref([]),r=a.ref([]),l=a.ref({}),n=a.reactive({});function d(S,v){n[S]=v}function h(S={}){for(const v of Object.keys(n))delete n[v];Object.assign(n,S)}const c=S=>{delete n[S],O()};function f(){for(const S of Object.keys(n))delete n[S]}function p(){return JSON.parse(JSON.stringify(n))}const _=S=>r.value.find(v=>v.id===S),x=(S,v)=>{s.value.push({name:S,value:v})},z=()=>{s.value=[]},H=S=>{const v=N(S);l.value=v},D=()=>l.value;function N(S){const v={};if(!S||typeof S!="object")return v;for(const[R,L]of Object.entries(S))if(L&&typeof L=="object"&&!(a.isRef(L)||a.isReactive(L))){const Y=Object.getPrototypeOf(L)===Object.prototype;v[R]=Y?{...L}:a.markRaw(L)}else v[R]=L;return v}const C=S=>{const v=r.value.find(R=>R.id===S);v&&(v.Props=v.Props||{},v.Props.locked=!v.Props.locked)},y=S=>S.map(v=>{const R=e.value[v.componentKey];return R?{...v,component:R}:null}).filter(v=>!!v);function w(){var v,R;return(((R=(v=i.value)==null?void 0:v.save)==null?void 0:R.call(v))??[]).map(L=>{const Y=r.value.find(Pt=>Pt.id===L.id);if(!Y||!Y.componentKey)return console.warn(`save: missing item or componentKey for id=${L==null?void 0:L.id}`),null;const{x:_e,y:ye,w:Ee,h:Ot}=L;return{id:Y.id,componentKey:Y.componentKey,componentName:Y.componentName,hideHeader:Y.hideHeader,Props:Y.Props??{},x:_e,y:ye,w:Ee,h:Ot}}).filter(L=>!!L)}const O=()=>{var v;const S={version:1,items:w(),filters:p()};((v=S.items)==null?void 0:v.length)<1||localStorage.setItem(t,JSON.stringify(S))},P=()=>{const S=localStorage.getItem(t);if(!S){r.value=o.value,h({});return}try{const v=JSON.parse(S);r.value=Array.isArray(v.items)?y(v.items):o.value,h(v.filters??{})}catch(v){console.error("Failed to parse globalVarsStore:",v),r.value=o.value,h({})}};return a.watch(n,()=>O(),{deep:!0}),{DASHBOARD_ITEMS:r,DefaultLayout:o,ComponentRegistry:e,optionsData:s,gridInstance:i,Services:l,Filters:n,setFilter:d,clearFilter:c,clearAllFilters:f,resetFilters:h,getDashItem:_,toggleWidgetLock:C,addOptionsDataItems:x,clearOptionsDataItems:z,saveToLocalStorage:O,loadFromLocalStorage:P,setOptionServices:H,getServices:D}}),us={class:"widget-settings-container"},ps={class:"widget-setting"},fs={class:"dialog-footer"},gs=a.defineComponent({__name:"TextWidgetSettings",props:{showDialog:{type:Boolean},reactiveSourceValue:{},manualEntryValue:{},hideHeaderValue:{type:Boolean}},emits:["close-dialog","update-text-var"],setup(o,{emit:e}){const t=Ne(),{optionsData:i}=oe.storeToRefs(t),s=e,r=o,l=a.computed({get:()=>r.showDialog,set:f=>{f||s("close-dialog")}}),n=a.ref(r.reactiveSourceValue??""),d=a.ref(r.manualEntryValue??""),h=a.ref(!!r.hideHeaderValue);a.watch(()=>r.reactiveSourceValue,f=>{n.value=f??""}),a.watch(()=>r.manualEntryValue,f=>{d.value=f??""},{immediate:!0}),a.watch(()=>r.hideHeaderValue,f=>{h.value=!!f});function c(){var x;const f=(n.value||"").trim(),p=f!=="",_=p?null:((x=d.value)==null?void 0:x.trim())||"";s("update-text-var",{reactiveSource:p?f:null,manualEdit:_,hideHeader:h.value}),l.value=!1}return(f,p)=>{const _=a.resolveComponent("el-option"),x=a.resolveComponent("el-select"),z=a.resolveComponent("el-input"),H=a.resolveComponent("el-checkbox"),D=a.resolveComponent("el-button"),N=a.resolveComponent("el-dialog");return a.openBlock(),a.createBlock(N,{class:"full-dialog-dashboard",modelValue:l.value,"onUpdate:modelValue":p[4]||(p[4]=C=>l.value=C),title:"Text Widget Settings","append-to-body":!0},{footer:a.withCtx(()=>[a.createElementVNode("div",fs,[a.createVNode(D,{class:"secondary",onClick:p[3]||(p[3]=C=>l.value=!1)},{default:a.withCtx(()=>[...p[8]||(p[8]=[a.createTextVNode("Cancel",-1)])]),_:1}),a.createVNode(D,{onClick:c},{default:a.withCtx(()=>[...p[9]||(p[9]=[a.createTextVNode("Save",-1)])]),_:1})])]),default:a.withCtx(()=>[a.createElementVNode("div",us,[a.createElementVNode("div",ps,[p[5]||(p[5]=a.createElementVNode("h4",null,"Select This Widget's Value",-1)),p[6]||(p[6]=a.createElementVNode("h5",null,"Select From Variables",-1)),a.createVNode(x,{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=C=>n.value=C),class:"text-settings-height"},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(_,{value:"",key:"__manual__",label:"Manual entry"})),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),C=>(a.openBlock(),a.createBlock(_,{key:C.name,label:C.name,value:C.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),p[7]||(p[7]=a.createElementVNode("h5",null,"Manual Entry",-1)),a.createVNode(z,{modelValue:d.value,"onUpdate:modelValue":p[1]||(p[1]=C=>d.value=C),class:"text-settings-height"},null,8,["modelValue"]),a.createVNode(H,{modelValue:h.value,"onUpdate:modelValue":p[2]||(p[2]=C=>h.value=C),label:"Hide Header"},null,8,["modelValue"])])])]),_:1},8,["modelValue"])}}}),we=(o,e)=>{const t=o.__vccOpts||o;for(const[i,s]of e)t[i]=s;return t},ms=we(gs,[["__scopeId","data-v-769ea864"]]),_s={key:0},ys=we(a.defineComponent({inheritAttrs:!1,__name:"TextWidget",props:{displayText:{},bindedKey:{},widgetID:{},hideHeader:{type:Boolean}},setup(o){const e=Ne(),t=o;a.inject("dashboard:globalVars",null);const i=a.ref(t.displayText??"");a.watch(()=>t.displayText,D=>{i.value=D??""},{immediate:!0});const s=a.computed(()=>!!(t.bindedKey&&t.bindedKey.trim()!=="")),r=a.computed(()=>{var y;const D=(y=t.bindedKey)==null?void 0:y.trim();if(!D)return"—";const N=e.optionsData.find(w=>(w==null?void 0:w.name)===D),C=N==null?void 0:N.value;return Array.isArray(C)?C.join(", "):C&&typeof C=="object"?JSON.stringify(C):C??"—"}),l=a.ref("Text Widget"),n=a.shallowRef([{comp:Qt,event:_,tooltip:"open Text settings"}]),d=a.ref(!1),h=a.ref(null);function c(){var D,N;d.value=!0,(N=(D=h.value)==null?void 0:D.focus)==null||N.call(D)}function f(){d.value=!1}const p=a.ref(!1);function _(){p.value=!0}function x(){p.value=!1,e.saveToLocalStorage()}function z({manualEdit:D,reactiveSource:N,hideHeader:C}){const y=e.getDashItem(t.widgetID);y&&(y.hideHeader=C,N&&N.trim()!==""?(y.Props=y.Props||{},y.Props.bindedKey=N,y.Props.displayText=null,y.componentName=H(N)):(y.Props=y.Props||{},y.Props.bindedKey=null,y.Props.displayText=D??"",y.componentName=D??"Text"),e.saveToLocalStorage())}function H(D){return D?D.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,N=>N.toUpperCase()):""}return(D,N)=>{const C=a.resolveComponent("el-input"),y=a.resolveDirective("click-out");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.renderSlot(D.$slots,"default",{widgetName:l.value,childIcons:n.value},void 0,!0),a.createElementVNode("div",a.mergeProps({class:"text-widget-wrap"},D.$attrs),[s.value?(a.openBlock(),a.createElementBlock("div",_s,[a.createElementVNode("h2",null,a.toDisplayString(r.value),1)])):a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:1,onKeyup:a.withKeys(f,["enter"]),class:"tw-flex"},[a.withDirectives(a.createElementVNode("div",null,[a.createVNode(C,{ref_key:"textUserInput",ref:h,modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=w=>i.value=w),onFocus:N[1]||(N[1]=w=>{var O,P;return(P=(O=w.target)==null?void 0:O.select)==null?void 0:P.call(O)})},null,8,["modelValue"])],512),[[a.vShow,d.value]]),a.withDirectives(a.createElementVNode("div",{onClick:N[2]||(N[2]=w=>c()),class:"tw-w-full tw-h-full"},[a.createElementVNode("h2",null,a.toDisplayString(i.value),1)],512),[[a.vShow,!d.value]])],32)),[[y,f]])],16),a.createVNode(ms,{"show-dialog":p.value,"reactive-source-value":t.bindedKey||"","manual-entry-value":i.value,"hide-header-value":t.hideHeader||!1,onCloseDialog:x,onUpdateTextVar:z},null,8,["show-dialog","reactive-source-value","manual-entry-value","hide-header-value"])],64)}}}),[["__scopeId","data-v-4743c11f"]]);function _t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var be=_t();function Jt(o){be=o}var Le={exec:()=>null};function M(o,e=""){let t=typeof o=="string"?o:o.source,i={replace:(s,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(Z.caret,"$1"),t=t.replace(s,l),i},getRegex:()=>new RegExp(t,e)};return i}var Z={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+));?/ig,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})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\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")},ws=/^(?:[ \t]*(?:\n|$))+/,bs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ks=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yt=/(?:[*+-]|\d{1,9}[.)])/,ei=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ti=M(ei).replace(/bull/g,yt).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(),Es=M(ei).replace(/bull/g,yt).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(),wt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vs=/^[^\n]+/,bt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ts=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rs=M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yt).getRegex(),je="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",xt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cs=M("^ {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[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xt).replace("tag",je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ii=M(wt).replace("hr",ze).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",je).getRegex(),Ss=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ii).getRegex(),kt={blockquote:Ss,code:bs,def:Ts,fences:xs,heading:ks,hr:ze,html:Cs,lheading:ti,list:Rs,newline:ws,paragraph:ii,table:Le,text:vs},si=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",je).getRegex(),As={...kt,lheading:Es,table:si,paragraph:M(wt).replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",si).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",je).getRegex()},Ds={...kt,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xt).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:Le,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(wt).replace("hr",ze).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",ti).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ns=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ls=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ri=/^( {2,}|\\)\n(?!\s*$)/,zs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ye=/[\p{P}\p{S}]/u,Et=/[\s\p{P}\p{S}]/u,ni=/[^\s\p{P}\p{S}]/u,Ms=M(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Et).getRegex(),oi=/(?!~)[\p{P}\p{S}]/u,Is=/(?!~)[\s\p{P}\p{S}]/u,Hs=/(?:[^\s\p{P}\p{S}]|~)/u,Os=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,li=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ps=M(li,"u").replace(/punct/g,Ye).getRegex(),Bs=M(li,"u").replace(/punct/g,oi).getRegex(),ai="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$s=M(ai,"gu").replace(/notPunctSpace/g,ni).replace(/punctSpace/g,Et).replace(/punct/g,Ye).getRegex(),Us=M(ai,"gu").replace(/notPunctSpace/g,Hs).replace(/punctSpace/g,Is).replace(/punct/g,oi).getRegex(),Fs=M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ni).replace(/punctSpace/g,Et).replace(/punct/g,Ye).getRegex(),Ws=M(/\\(punct)/,"gu").replace(/punct/g,Ye).getRegex(),Gs=M(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Vs=M(xt).replace("(?:-->|$)","-->").getRegex(),qs=M("^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",Vs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xe=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,js=M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hi=M(/^!?\[(label)\]\[(ref)\]/).replace("label",Xe).replace("ref",bt).getRegex(),ci=M(/^!?\[(ref)\](?:\[\])?/).replace("ref",bt).getRegex(),Ys=M("reflink|nolink(?!\\()","g").replace("reflink",hi).replace("nolink",ci).getRegex(),vt={_backpedal:Le,anyPunctuation:Ws,autolink:Gs,blockSkip:Os,br:ri,code:Ls,del:Le,emStrongLDelim:Ps,emStrongRDelimAst:$s,emStrongRDelimUnd:Fs,escape:Ns,link:js,nolink:ci,punctuation:Ms,reflink:hi,reflinkSearch:Ys,tag:qs,text:zs,url:Le},Xs={...vt,link:M(/^!?\[(label)\]\((.*?)\)/).replace("label",Xe).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xe).getRegex()},Tt={...vt,emStrongRDelimAst:Us,emStrongLDelim:Bs,url:M(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ks={...Tt,br:M(ri).replace("{2,}","*").getRegex(),text:M(Tt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ke={normal:kt,gfm:As,pedantic:Ds},Me={normal:vt,gfm:Tt,breaks:Ks,pedantic:Xs},Zs={"&":"&","<":"<",">":">",'"':""","'":"'"},di=o=>Zs[o];function le(o,e){if(e){if(Z.escapeTest.test(o))return o.replace(Z.escapeReplace,di)}else if(Z.escapeTestNoEncode.test(o))return o.replace(Z.escapeReplaceNoEncode,di);return o}function ui(o){try{o=encodeURI(o).replace(Z.percentDecode,"%")}catch{return null}return o}function pi(o,e){var r;let t=o.replace(Z.findPipe,(l,n,d)=>{let h=!1,c=n;for(;--c>=0&&d[c]==="\\";)h=!h;return h?"|":" |"}),i=t.split(Z.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(Z.slashPipe,"|");return i}function Ie(o,e,t){let i=o.length;if(i===0)return"";let s=0;for(;s<i&&o.charAt(i-s-1)===e;)s++;return o.slice(0,i-s)}function Qs(o,e){if(o.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<o.length;i++)if(o[i]==="\\")i++;else if(o[i]===e[0])t++;else if(o[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function fi(o,e,t,i,s){let r=e.href,l=e.title||null,n=o[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:o[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:l,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,d}function Js(o,e,t){let i=o.match(t.other.indentCodeCompensation);if(i===null)return e;let s=i[1];return e.split(`
|
|
3
3
|
`).map(r=>{let l=r.match(t.other.beginningSpace);if(l===null)return r;let[n]=l;return n.length>=s.length?r.slice(s.length):r}).join(`
|
|
4
4
|
`)}var Ze=class{constructor(o){B(this,"options");B(this,"rules");B(this,"lexer");this.options=o||be}space(o){let e=this.rules.block.newline.exec(o);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(o){let e=this.rules.block.code.exec(o);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Ie(t,`
|