directus-extension-texttoanything 1.7.2 → 1.7.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.
- package/dist/app.js +1 -1
- package/package.json +125 -125
package/dist/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{defineOperationApp as t,useStores as e,useApi as i,defineModule as s,defineInterface as n}from"@directus/extensions-sdk";import*as a from"vue";import{resolveComponent as r,openBlock as o,createBlock as l,withCtx as h,createVNode as c,createCommentVNode as d,ref as u,createElementBlock as p,createTextVNode as g,pushScopeId as f,popScopeId as m,createElementVNode as v,defineComponent as b,computed as y,watch as w,nextTick as x,onMounted as A,toDisplayString as _,normalizeStyle as S,unref as T,Fragment as k,resolveDynamicComponent as C,withModifiers as E,createSlots as M,resolveDirective as P,renderList as D,normalizeClass as I,withDirectives as R,inject as L,onBeforeUnmount as F,reactive as N,onUnmounted as O,Teleport as B,renderSlot as z}from"vue";var j=t({id:"ttabarcode",name:"TTA generate barcode",icon:"barcode",description:"Generate a barcode trough Text to anything!",overview:({barcodeContent:t})=>[{label:"barcode content",text:t}],options:[{field:"barcodeContent",name:"content",type:"string",meta:{width:"full",interface:"input"}},{field:"barcodeType",name:"type",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:["auspost","azteccode","azteccodecompact","aztecrune","bc412","channelcode","codablockf","code11","code128","code16k","code2of5","code32","code39","code39ext","code49","code93","code93ext","codeone","coop2of5","daft","databarexpanded","databarexpandedcomposite","databarexpandedstacked","databarexpandedstackedcomposite","databarlimited","databarlimitedcomposite","databaromni","databaromnicomposite","databarstacked","databarstackedcomposite","databarstackedomni","databarstackedomnicomposite","databartruncated","databartruncatedcomposite","datalogic2of5","datamatrix","datamatrixrectangular","datamatrixrectangularextension","dotcode","ean13","ean13composite","ean14","ean2","ean5","ean8","ean8composite","flattermarken","gs1-128","gs1-128composite","gs1-cc","gs1datamatrix","gs1datamatrixrectangular","gs1dldatamatrix","gs1dlqrcode","gs1dotcode","gs1northamericancoupon","gs1qrcode","hanxin","hibcazteccode","hibccodablockf","hibccode128","hibccode39","hibcdatamatrix","hibcdatamatrixrectangular","hibcmicropdf417","hibcpdf417","hibcqrcode","iata2of5","identcode","industrial2of5","interleaved2of5","isbn","ismn","issn","itf14","japanpost","kix","leitcode","mailmark","mands","matrix2of5","maxicode","micropdf417","microqrcode","msi","onecode","pdf417","pdf417compact","pharmacode","pharmacode2","planet","plessey","posicode","postnet","pzn","qrcode","rationalizedCodabar","raw","rectangularmicroqrcode","royalmail","sscc18","swissqrcode","symbol","telepen","telepennumeric","ultracode","upca","upcacomposite","upce","upcecomposite"].map((t=>({text:t,value:t})))}}},{field:"scale",name:"scale",type:"number",meta:{width:"full",interface:"input"}},{field:"height",name:"height",type:"number",meta:{width:"full",interface:"input"}},{field:"includetext",name:"include text",type:"boolean",meta:{width:"full",interface:"boolean"}}]}),V=t({id:"ttapdf",name:"TTA generate PDF",icon:"picture_as_pdf",description:"Generate a PDF trough Text to anything!",overview:({filename:t})=>[{label:"File name",text:t}],options:[{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"pdfoptions",name:"Options",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json",placeholder:JSON.stringify({html:"<h1>Hello world!</h1>",format:"A4",landscape:!1,margin:10,marginRight:5,marginLeft:5},null,2),template:JSON.stringify({html:"<h1>Hello world!</h1>",format:"A4",landscape:!1,margin:10,marginRight:5,marginLeft:5},null,2)}}}]}),H=t({id:"ttapdftemplate",name:"TTA generate PDF from template",icon:"picture_as_pdf",description:"Generate a PDF based on a template trough Text to anything!",overview:({filename:t})=>[{label:"File name",text:t}],options:t=>[{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"mode",name:"Mode",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:[{value:"online",text:"Online"},{value:"offline",text:"Offline"}]}}},{field:"template",name:"Template",type:"string",meta:{interface:"online"==t.mode?"TTA-pdf-online-template-selector":"TTA-pdf-template-selector",options:{},note:"When selecting the online mode, you will be able to select a template from the TextToAnything dashboard. (https://app.texttoanything.nl)"}},{field:"templatevariables",name:"Template variables",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json"}}}]}),$=t({id:"ttaqrcode",name:"TTA generate QRcode",icon:"qr_code",description:"Generate a QRcode trough Text to anything!",overview:({content:t})=>[{label:"QRCode content",text:t}],options:[{field:"content",name:"QRCode content",type:"string",meta:{width:"full",interface:"input"}},{field:"lightColor",name:"Light color",type:"string",meta:{width:"full",interface:"select-color"}},{field:"darkColor",name:"Dark color",type:"string",meta:{width:"full",interface:"select-color"}},{field:"margin",name:"Margin",type:"integer",meta:{width:"half",interface:"input"}},{field:"width",name:"Width",type:"integer",meta:{width:"half",interface:"input"}}]});const U=String.raw`[A-Za-z][^/\s>]*`,G=String.raw`\B"(?:\\[^<>\n]|[^\\"<>\n])*"(?!\w)`,q=String.raw`\B'(?:\\[^<>\n]|[^\\'<>\n])*'(?!\w)`,W=String.raw`${G}|${q}`,K=String.raw`"(?<quotedAttrValue>[^"]*)"`,X=String.raw`'(?<singleQuotedAttrValue>[^']*)'`,Y=String.raw`(?<unquotedAttrValue>[^\s"'\`=<>]+)`,Q=String.raw`[^=\s>/"']+(?=[=>\s]|$)`,J=String.raw`${K}|${X}|${Y}`,Z=String.raw`(?<attrName>${Q})(?:\s*=\s*(?:${J}))?`,tt=String.raw`${W}|[^\s>]*[^\s>/]|[^\s>]*/(?!\s*>)`,et=String.raw`(?<attrSpace>\s*)(?:${Z}|(?<attrText>${tt}))`,it={comment:String.raw`<!--.*?-->`,dtd:String.raw`<![^>]+>`,startTag:String.raw`<(?<startTagName>${U})(?<attrs>(?:${et})*)\s*(?<closingSlash>/?)\s*>`,endTag:String.raw`</(?<endTagName>${U})\s*>`,space:String.raw`\s+`,text:String.raw`[^<\s"']+|${W}|['"]`,wildcard:String.raw`.`},st=Object.entries(it).map((([t,e])=>`(?<${t}>${e})`)).join("|");const nt=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]);function at(t,e=" ",i=80){const s=new RegExp(st,"gys"),n=new RegExp(et,"gy"),a=[];let r=null,o=0,l=0,h="",c=0,d="";const u=()=>{if(d&&"\n"!=d){const t=h.indexOf("\n"),e=-1==t?h.length:t;l+d.length+e>i&&(d="\n")}const t="\n"==d&&h?e.repeat(c):"",s=`${d}${t}${h}`;if(s){const t=s.lastIndexOf("\n");-1==t?l+=s.length:l=s.length-t-1,a.push(s)}h=d=""},p=(...t)=>{for(const e of t)!r&&/^\s+$/.test(e)?(u(),d=e):(h||(c=o),h+=e)};for(const e of function*(t,e){let i,{lastIndex:s}=t;for(;i=t.exec(e);)yield i,({lastIndex:s}=t);if(s!=e.length)throw new Error("Failed to parse string")}(s,t)){if(at.__strict&&e.groups.wildcard)throw new Error("Unexpected wildcard");if(e.groups.endTag){const t=e.groups.endTagName.toLowerCase();t==r&&(r=null),r||(--o,p(`</${t}>`))}if(r)p(e[0]);else if(e.groups.space)p(...e[0].match(/\n/g)?.slice(0,2)??[" "]);else if(e.groups.comment||e.groups.dtd||e.groups.text||e.groups.wildcard)p(e[0]);else if(e.groups.startTag){const t=e.groups.startTagName.toLowerCase();if(p(`<${t}`),++o,e.groups.attrs){let t,i,{lastIndex:s}=n;for(;t=n.exec(e.groups.attrs);){if(({lastIndex:s}=n),at.__strict&&t.groups.attrText)throw new Error("Unexpected attr text");t.groups.attrText?(t.groups.attrSpace&&p(/\n/.test(t.groups.attrSpace)?"\n":" "),p(t.groups.attrText)):(!t.groups.attrSpace&&i?.groups.attrText||p(/\n/.test(t.groups.attrSpace)?"\n":" "),p(`${t.groups.attrName}${t.groups.quotedAttrValue?`="${t.groups.quotedAttrValue}"`:t.groups.singleQuotedAttrValue?`='${t.groups.singleQuotedAttrValue}'`:t.groups.unquotedAttrValue?`=${t.groups.unquotedAttrValue}`:""}`)),i=t}if(s!=e.groups.attrs.length)throw new Error("Failed to parse attributes")}const i=Boolean(e.groups.closingSlash);p(i?" />":">"),i||nt.has(t)?--o:["pre","textarea","script","style"].includes(t)&&(r=t)}}u();let g=!1;for(;/^\s+$/.test(a[a.length-1]);){const t=a.pop();/\n/.test(t)&&(g=!0)}return g&&a.push("\n"),a.join("")}at.default=at;var rt=at;class ot{constructor(t,e,i,s,n){this.kind=t,this.input=e,this.begin=i,this.end=s,this.file=n}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let i=0;i<this.begin;i++)"\n"===this.input[i]?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}class lt{liquidMethodMissing(t){}}const ht=Object.prototype.toString,ct=String.prototype.toLowerCase,dt=Object.hasOwnProperty;function ut(t){return"string"==typeof t}function pt(t){return"function"==typeof t}function gt(t){return t&&pt(t.then)}function ft(t){return t&&pt(t.next)&&pt(t.throw)&&pt(t.return)}function mt(t){return ut(t=yt(t))?t:_t(t)?"":St(t)?t.map((t=>mt(t))).join(""):String(t)}function vt(t){return St(t=yt(t))?t:ut(t)&&t.length>0?[t]:Et(e=t)&&Symbol.iterator in e?Array.from(t):Et(t)?Object.keys(t).map((e=>[e,t[e]])):[];var e}function bt(t){return _t(t=yt(t))?[]:St(t)?t:[t]}function yt(t){return t instanceof lt&&pt(t.valueOf)?t.valueOf():t}function wt(t){return t=Number(t),isNaN(t)?0:t}function xt(t){return"number"==typeof t}function At(t){return t&&pt(t.toLiquid)?At(t.toLiquid()):t}function _t(t){return null==t}function St(t){return"[object Array]"===ht.call(t)}function Tt(t){return t&&xt(t.length)}function kt(t,e){t=t||{};for(const i in t)if(dt.call(t,i)&&!1===e(t[i],i,t))break;return t}function Ct(t){return t[t.length-1]}function Et(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Mt(t,e,i=1){const s=[];for(let n=t;n<e;n+=i)s.push(n);return s}function Pt(t,e,i=" "){return Dt(t,e,i,((t,e)=>e+t))}function Dt(t,e,i,s){let n=e-(t=String(t)).length;for(;n-- >0;)t=s(t,i);return t}function It(t){return t}function Rt(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=ct.call(t))<(e=ct.call(e))?-1:t>e?1:0}function Lt(t){return function(...e){return t.call(this,...e.map(yt))}}function Ft(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*Nt(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const Ot="__liquidClass__";class Bt extends Error{constructor(t,e){super("string"==typeof t?t:t.message),this.context="","string"!=typeof t&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,Ot,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:qt(this.token),enumerable:!1}),this.message=function(t,e){e.file&&(t+=`, file:${e.file}`);const[i,s]=e.getPosition();return t+=`, line:${i}, col:${s}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(t){return"LiquidError"===(null==t?void 0:t[Ot])}}class zt extends Bt{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class jt extends Bt{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class Vt extends Bt{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class Ht extends Bt{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return"LiquidErrors"===t.name}}class $t extends Bt{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class Ut extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class Gt extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function qt(t){const[e,i]=t.getPosition(),s=t.input.split("\n"),n=Math.max(e-2,1),a=Math.min(e+3,s.length);return Mt(n,a+1).map((t=>{let n=`${t===e?">> ":" "}${Pt(String(t),String(a).length)}| `;const r=t===e?"\n"+Pt("^",i+n.length):"";return n+=s[t-1],n+=r,n})).join("\n")}const Wt=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function Kt(t){const e=t.charCodeAt(0);return e>=128?!Wt[e]:!!(1&Wt[e])}function Xt(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new Gt(i)}}function Yt(t,e=`unexpected ${JSON.stringify(t)}`){Xt(!t,e)}Wt[160]=Wt[5760]=Wt[6158]=Wt[8192]=Wt[8193]=Wt[8194]=Wt[8195]=Wt[8196]=Wt[8197]=Wt[8198]=Wt[8199]=Wt[8200]=Wt[8201]=Wt[8202]=Wt[8232]=Wt[8233]=Wt[8239]=Wt[8287]=Wt[12288]=4,Wt[8220]=Wt[8221]=128;class Qt extends lt{equals(t){return!(t instanceof Qt)&&(ut(t=yt(t))||St(t)?0===t.length:!!Et(t)&&0===Object.keys(t).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof Qt}}class Jt extends Qt{equals(t){return!1===t||(!!_t(yt(t))||(ut(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof Jt}}class Zt extends lt{constructor(t,e,i){super(),this.i=0,this.length=t,this.name=`${i}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return 0===this.i}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class te{constructor(){this.buffer=""}write(t){this.buffer+=mt(t)}}class ee{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class ie{constructor(){this.buffer=""}write(t){"string"!=typeof(t=yt(t))&&""===this.buffer?this.buffer=t:this.buffer=mt(this.buffer)+mt(t)}}class se extends lt{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new te;return yield this.superBlockRender(t),t.buffer}}function ne(t){return t&&pt(t.equals)&&pt(t.gt)&&pt(t.geq)&&pt(t.lt)&&pt(t.leq)}const ae=new class extends lt{equals(t){return _t(yt(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},re={true:!0,false:!1,nil:ae,null:ae,empty:new Qt,blank:new Jt};function oe(t){const e={};for(const[i,s]of Object.entries(t)){let t=e;for(let e=0;e<i.length;e++){const s=i[e];t[s]=t[s]||{},e===i.length-1&&Kt(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var le=function(){return le=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},le.apply(this,arguments)};function he(t,e,i,s){return new(i||(i=Promise))((function(n,a){function r(t){try{l(s.next(t))}catch(t){a(t)}}function o(t){try{l(s.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((s=s.apply(t,e||[])).next())}))}function ce(t){return he(this,void 0,void 0,(function*(){if(!ft(t))return t;let e,i=!1,s="next";do{const n=t[s](e);i=n.done,e=n.value,s="next";try{ft(e)&&(e=ce(e)),gt(e)&&(e=yield e)}catch(t){s="throw",e=t}}while(!i);return e}))}function de(t){if(!ft(t))return t;let e,i=!1,s="next";do{const n=t[s](e);if(i=n.done,e=n.value,s="next",ft(e))try{e=de(e)}catch(t){s="throw",e=t}}while(!i);return e}const ue=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function pe(t){const e=function(t){const e=t.getFullYear();return!(3&e||!(e%100||e%400==0&&e))}(t)?29:28;return[31,e,31,30,31,30,31,31,30,31,30,31]}function ge(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=pe(t)[i];return e+t.getDate()}function fe(t,e){const i=ge(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const me={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},ve=new Set("aAbBceklpP");function be(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),n=i%60;return(t.getTimezoneOffset()>0?"-":"+")+Pt(s,2,"0")+(e.flags[":"]?":":"")+Pt(n,2,"0")}const ye={a:t=>t.getShortWeekdayName(),A:t=>t.getLongWeekdayName(),b:t=>t.getShortMonthName(),B:t=>t.getLongMonthName(),c:t=>t.toLocaleString(),C:t=>function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t),d:t=>t.getDate(),e:t=>t.getDate(),H:t=>t.getHours(),I:t=>String(t.getHours()%12||12),j:t=>ge(t),k:t=>t.getHours(),l:t=>String(t.getHours()%12||12),L:t=>t.getMilliseconds(),m:t=>t.getMonth()+1,M:t=>t.getMinutes(),N:(t,e)=>{const i=Number(e.width)||9;return function(t,e,i=" "){return Dt(t,e,i,((t,e)=>t+e))}(String(t.getMilliseconds()).slice(0,i),i,"0")},p:t=>t.getHours()<12?"AM":"PM",P:t=>t.getHours()<12?"am":"pm",q:t=>function(t){const e=t.getDate();if([11,12,13].includes(e))return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(t),s:t=>Math.round(t.getTime()/1e3),S:t=>t.getSeconds(),u:t=>t.getDay()||7,U:t=>fe(t,0),w:t=>t.getDay(),W:t=>fe(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:be,Z:(t,e)=>t.getTimeZoneName()||be(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function we(t,e){let i,s="",n=e;for(;i=ue.exec(n);)s+=n.slice(0,i.index),n=n.slice(i.index+i[0].length),s+=xe(t,i);return s+n}function xe(t,e){const[i,s="",n,a,r]=e,o=ye[r];if(!o)return i;const l={};for(const t of s)l[t]=!0;let h=String(o(t,{flags:l,width:n,modifier:a})),c=ve.has(r)?" ":"0",d=n||me[r]||0;var u;return l["^"]?h=h.toUpperCase():l["#"]&&(u=h,h=[...u].some((t=>t>="a"&&t<="z"))?u.toUpperCase():u.toLowerCase()),l._?c=" ":l[0]&&(c="0"),l["-"]&&(d=0),Pt(h,d,c)}function Ae(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}ye.h=ye.b;const _e=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,Se=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=Se.map((t=>t.slice(0,3))),ke=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ce=ke.map((t=>t.slice(0,3)));class Ee{constructor(t,e,i){this.locale=e,this.DateTimeFormat=Ae(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=ut(i)?Ee.getTimezoneOffset(i,this.date):i,this.timezoneName=ut(i)?i:"";const s=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),n=this.date.getTime()+s;this.displayDate=new Date(n)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return(null==e?void 0:e.timeZone)?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var t;return null!==(t=this.format({month:"long"}))&&void 0!==t?t:Se[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:Te[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:ke[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Ce[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const i=t.match(_e);if(i&&"Z"===i[1])return new Ee(+new Date(t),e,0);if(i&&i[2]&&i[3]&&i[4]){const[,,s,n,a]=i,r=("+"===s?-1:1)*(60*parseInt(n,10)+parseInt(a,10));return new Ee(+new Date(t),e,r)}return new Ee(t,e)}static getTimezoneOffset(t,e){const i=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),n=new Date(i);return(+new Date(s)-+n)/6e4}}class Me{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=wt(t),Xt(this.base+t<=this.limit,this.message),this.base+=t}check(t){Xt((t=wt(t))<=this.limit,this.message)}}class Pe extends ot{constructor(t,[e,i],s,n,a,r,o,l){super(t,s,n,a,l),this.trimLeft=!1,this.trimRight=!1;const h="-"===s[e],c="-"===s[i-1];let d=h?e+1:e,u=c?i-1:i;for(;d<u&&4&Wt[s.charCodeAt(d)];)d++;for(;u>d&&4&Wt[s.charCodeAt(u-1)];)u--;this.contentRange=[d,u],this.trimLeft=h||r,this.trimRight=c||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class De extends Pe{constructor(t,e,i,s,n){const{trimTagLeft:a,trimTagRight:r,tagDelimiterLeft:o,tagDelimiterRight:l}=s,[h,c]=[e+o.length,i-l.length];super(Wi.Tag,[h,c],t,e,i,a,r,n),this.tokenizer=new Si(t,s.operators,n,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class Ie extends Pe{constructor(t,e,i,s,n){const{trimOutputLeft:a,trimOutputRight:r,outputDelimiterLeft:o,outputDelimiterRight:l}=s,h=[e+o.length,i-l.length];super(Wi.Output,h,t,e,i,a,r,n)}}class Re extends ot{constructor(t,e,i,s){super(Wi.HTML,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class Le extends ot{constructor(t,e,i,s){super(Wi.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class Fe extends ot{constructor(t,e,i,s){super(Wi.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class Ne extends ot{constructor(t,e,i,s){super(Wi.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=re[this.literal]}}const Oe={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Be={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class ze extends ot{constructor(t,e,i,s){super(Wi.Operator,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in Oe?Oe[t]:1}}class je extends ot{constructor(t,e,i,s,n,a){super(Wi.PropertyAccess,i,s,n,a),this.variable=t,this.props=e}}class Ve extends ot{constructor(t,e,i,s,n,a){super(Wi.Filter,i,s,n,a),this.name=t,this.args=e}}class He extends ot{constructor(t,e,i,s,n,a){super(Wi.Hash,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=n,this.file=a}}const $e=/[\da-fA-F]/,Ue=/[0-7]/,Ge={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function qe(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class We extends ot{constructor(t,e,i,s){super(Wi.Quoted,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=function(t){let e="";for(let i=1;i<t.length-1;i++)if("\\"===t[i])if(void 0!==Ge[t[i+1]])e+=Ge[t[++i]];else if("u"===t[i+1]){let s=0,n=i+2;for(;n<=i+5&&$e.test(t[n]);)s=16*s+qe(t[n++]);i=n-1,e+=String.fromCharCode(s)}else if(Ue.test(t[i+1])){let s=i+1,n=0;for(;s<=i+3&&Ue.test(t[s]);)n=8*n+qe(t[s++]);i=s-1,e+=String.fromCharCode(n)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class Ke extends ot{constructor(t,e,i,s,n,a){super(Wi.Range,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=n,this.file=a}}class Xe extends Pe{constructor(t,e,i,s,n){super(Wi.Tag,[e,i],t,e,i,!1,!1,n),this.tokenizer=new Si(t,s.operators,n,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class Ye extends ot{constructor(t,e,i,s,n,a){super(Wi.FilteredValue,i,s,n,a),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=n,this.file=a}}const Qe={now:()=>Date.now()};function Je(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||Qe}class Ze{renderTemplatesToNodeStream(t,e){const i=new ee;return Promise.resolve().then((()=>ce(this.renderTemplates(t,e,i)))).then((()=>i.end()),(t=>i.error(t))),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new ie:new te);const s=[];for(const n of t){e.renderLimit.check(Je().now());try{const t=yield n.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(t){const i=Bt.is(t)?t:new Vt(t,n);if(!e.opts.catchAllErrors)throw i;s.push(i)}}if(s.length)throw new Ht(s);return i.buffer}}class ti{constructor(t){this.postfix=[...ii(t)]}*evaluate(t,e){Xt(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(Qi(s)){const e=i.pop();let n;if(1===Be[s.operator])n=yield t.opts.operators[s.operator](e,t);else{const a=i.pop();n=yield t.opts.operators[s.operator](a,e,t)}i.push(n)}else i.push(yield ei(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*ei(t,e,i=!1){if(t)return"content"in t?t.content:is(t)?yield function*(t,e,i){const s=[];for(const i of t.props)s.push(yield ei(i,e,!1));try{if(t.variable){const n=yield ei(t.variable,e,i);return yield e._getFromScope(n,s)}return yield e._get(s)}catch(e){if(i&&"InternalUndefinedVariableError"===e.name)return null;throw new $t(e,t)}}(t,e,i):ns(t)?yield function*(t,e){const i=yield ei(t.lhs,e),s=yield ei(t.rhs,e);return e.memoryLimit.use(s-i+1),Mt(+i,+s+1)}(t,e):void 0}function*ii(t){const e=[];for(const i of t)if(Qi(i)){for(;e.length&&e[e.length-1].getPrecedence()>i.getPrecedence();)yield e.pop();e.push(i)}else yield i;for(;e.length;)yield e.pop()}function si(t,e){return!ni(t,e)}function ni(t,e){return t=yt(t),e.opts.jsTruthy?!t:!1===t||null==t}const ai={"==":ri,"!=":(t,e)=>!ri(t,e),">":(t,e)=>ne(t)?t.gt(e):ne(e)?e.lt(t):yt(t)>yt(e),"<":(t,e)=>ne(t)?t.lt(e):ne(e)?e.gt(t):yt(t)<yt(e),">=":(t,e)=>ne(t)?t.geq(e):ne(e)?e.leq(t):yt(t)>=yt(e),"<=":(t,e)=>ne(t)?t.leq(e):ne(e)?e.geq(t):yt(t)<=yt(e),contains:(t,e)=>St(t=yt(t))?t.some((t=>ri(t,e))):!!pt(null==t?void 0:t.indexOf)&&t.indexOf(yt(e))>-1,not:(t,e)=>ni(yt(t),e),and:(t,e,i)=>si(yt(t),i)&&si(yt(e),i),or:(t,e,i)=>si(yt(t),i)||si(yt(e),i)};function ri(t,e){return ne(t)?t.equals(e):ne(e)?e.equals(t):(t=yt(t),e=yt(e),St(t)?St(e)&&function(t,e){return t.length===e.length&&!t.some(((t,i)=>!ri(t,e[i])))}(t,e):t===e)}let oi=class{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}};class li{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new oi("HEAD",null,null,null),this.tail=new oi("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const i=new oi(t,e,this.head.next,this.head);this.head.next.prev=i,this.head.next=i,this.cache[t]=i,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function hi(t,e){const i=document.createElement("base");i.href=t;const s=document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild);const n=document.createElement("a");n.href=e;const a=n.href;return s.removeChild(i),a}var ci=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Ct(t)&&(t+="/"),hi(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((t,e,s)=>{const n=s.split("/").pop();return/\.\w+$/.test(n)?t:e+s+i}))},readFile:function(t){return he(this,void 0,void 0,(function*(){return new Promise(((e,i)=>{const s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?e(s.responseText):i(new Error(s.statusText))},s.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},s.open("GET",t),s.send()}))}))},readFileSync:function(t){const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||e.status>=300)throw new Error(e.statusText);return e.responseText},exists:function(t){return he(this,void 0,void 0,(function*(){return!0}))},existsSync:function(t){return!0},dirname:function(t){return hi(t,".")},sep:"/"});function di(t,e=0){return JSON.stringify(t,null,e)}var ui={default:function(t,e,...i){return St(t=yt(t))||ut(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(ni(t,this.context)?e:t)},raw:{raw:!0,handler:It},jsonify:di,to_integer:function(t){return Number(t)},json:di,inspect:function(t,e=0){const i=[];return JSON.stringify(t,(function(t,e){if("object"!=typeof e||null===e)return e;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)}),e)}};const pi={"&":"&","<":"<",">":">",'"':""","'":"'"},gi={"&":"&","<":"<",">":">",""":'"',"'":"'"};function fi(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,(t=>pi[t]))}function mi(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,(t=>gi[t]))}var vi=Object.freeze({__proto__:null,escape:fi,xml_escape:function(t){return fi.call(this,t)},escape_once:function(t){return fi.call(this,mi.call(this,t))},newline_to_br:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class bi{constructor(t){this.mapping=t,this.sep="/"}exists(t){return he(this,void 0,void 0,(function*(){return this.existsSync(t)}))}existsSync(t){return!_t(this.mapping[t])}readFile(t){return he(this,void 0,void 0,(function*(){return this.readFileSync(t)}))}readFileSync(t){const e=this.mapping[t];if(_t(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,i){if(e+=i,"."===t)return e;const s=t.split(/\/+/);for(const t of e.split(this.sep))"."!==t&&""!==t&&(".."===t?(s.length>1||""!==s[0])&&s.pop():s.push(t));return s.join(this.sep)}}const yi={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:ci,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:ai,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function wi(t){var e,i,s;if(t.hasOwnProperty("root")&&(t.hasOwnProperty("partials")||(t.partials=t.root),t.hasOwnProperty("layouts")||(t.layouts=t.root)),t.hasOwnProperty("cache")){let e;e="number"==typeof t.cache?t.cache>0?new li(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new li(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},yi),t.jekyllInclude?{dynamicPartials:!1}:{}),t)).fs.dirname&&t.fs.sep||!t.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),t.relativeReference=!1),t.root=xi(t.root),t.partials=xi(t.partials),t.layouts=xi(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?fi:"json"===s?ui.json:(Xt(pt(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=Ae())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new bi(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function xi(t){let e=[];return St(t)&&(e=t),ut(t)&&(e=[t]),e}function Ai(t,e){if(!t||!Ji(t))return;const i=e?4:16;for(;Wt[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function _i(t,e){if(!t||!Ji(t))return;const i=e?4:16;for(;Wt[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class Si{constructor(t,e=yi.operators,i,s){this.input=t,this.file=i,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=oe(e),this.literalTrie=oe(re)}readExpression(){return new ti(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(!e)return;yield e}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(-1!==t)return new ze(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e,i=t,s=this.p;for(;i[this.input[s]]&&s<this.N;)i=i[this.input[s++]],i.end&&(e=i);return e?e.needBoundary&&Kt(this.peek(s-this.p))?-1:s:-1}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new Ye(e,i,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const t=this.readFilterArg();t&&e.push(t),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),(()=>`unexpected character ${this.snapshot()}`))}while(","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new Ve(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),":"!==this.peek())return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=yi){const e=[];for(;this.p<this.N;){const i=this.readTopLevelToken(t);e.push(i)}return function(t,e){let i=!1;for(let s=0;s<t.length;s++){const n=t[s];rs(n)&Wi.Delimited&&(!i&&n.trimLeft&&Ai(t[s-1],e.greedy),Zi(n)&&("raw"===n.name?i=!0:"endraw"===n.name&&(i=!1)),!i&&n.trimRight&&_i(t[s+1],e.greedy))}}(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:i}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(i)?this.readOutputToken(t):this.readHTMLToken([e,i])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some((t=>this.match(t)));)++this.p;return new Re(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:i}=this,s=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.error(`tag ${this.snapshot(s)} not closed`,s);const n=new De(i,s,this.p,t,e);return"raw"===n.name&&(this.rawBeginAt=s),n}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;)if(e&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1}readOutputToken(t=yi){const{file:e,input:i}=this,{outputDelimiterRight:s}=t,n=this.p;if(-1===this.readToDelimiter(s,!0))throw this.error(`output ${this.snapshot(n)} not closed`,n);return new Ie(i,n,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:i}=t,s=this.p;let n=this.readTo(e)-e.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(i)){const e=this.p;return s===n?(this.rawBeginAt=-1,new De(this.input,s,e,t,this.file)):(this.p=n,new Re(this.input,s,n,this.file))}if(this.rmatch(e))break;this.p++}else n=this.readTo(e)-e.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=yi){const e=[];for(;this.p<this.N;){const i=this.readLiquidTagToken(t);i&&e.push(i)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter("\n");const i=this.p;return new Xe(this.input,e,i,t,this.file)}error(t,e=this.p){return new zt(t,new Fe(this.input,e,this.N,this.file))}assert(t,e,i){if(!t)throw this.error("function"==typeof e?e():e,i)}snapshot(t=this.p){return JSON.stringify(function(t,e){return t.length>e?t.slice(0,e-3)+"...":t}(this.input.slice(t,this.N),32))}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&Kt(this.peek());)++this.p;return new Fe(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const i=this.readHash(t);if(!i)return e;e.push(i)}}readHash(t){this.skipBlank(),","===this.peek()&&++this.p;const e=this.p,i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const n=ut(t)?t:t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new He(this.input,e,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),i=this.readProperties(!e);return i.length?new je(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new je(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;)if("["!==this.peek()){if(t&&!e.length){const t=this.readNonEmptyIdentifier();if(t){e.push(t);continue}}if("."!==this.peek()||"."===this.peek(1))break;{this.p++;const t=this.readNonEmptyIdentifier();if(!t)break;e.push(t)}}else{this.p++;const t=this.readValue()||new Fe(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),e.push(t)}return e}readNumber(){this.skipBlank();let t=!1,e=!1,i=0;for(64&this.peekType()&&i++;this.p+i<=this.N;)if(32&this.peekType(i))e=!0,i++;else{if("."!==this.peek(i)||"."===this.peek(i+1))break;if(t||!e)return;t=!0,i++}if(e&&!Kt(this.peek(i))){const t=new Le(this.input,this.p,this.p+i,this.file);return this.advance(i),t}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(-1===t)return;const e=new Ne(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if("("!==this.peek())return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax");const i=this.readValueOrThrow();return this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new Ke(this.input,t,this.p,e,i,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,(()=>`unexpected token ${this.snapshot()}, value expected`)),t}readQuoted(){this.skipBlank();const t=this.p;if(!(8&this.peekType()))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new We(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,i=[","," ",e],s=new Set(i);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(i)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:Wt[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;4&this.peekType();)++this.p}}class Ti{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const i=this.handlers[t];return!!i&&(i.call(this,e),!0)}start(){let t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t))continue;if(Zi(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class ki{constructor(t){this.token=t}}class Ci extends ki{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class Ei{constructor(t,e){this.hash={};const i=t instanceof Si?t:new Si(t,{});for(const t of i.readHashes(e))this.hash[t.name.content]=t.value}*render(t){const e={};for(const i of Object.keys(this.hash))e[i]=void 0===this.hash[i]||(yield ei(this.hash[i],t));return e}}function Mi(t){return St(t)}class Pi{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=pt(e)?e:pt(null==e?void 0:e.handler)?e.handler:It,this.raw=!pt(e)&&!!(null==e?void 0:e.raw),this.args=t.args,this.liquid=i}*render(t,e){const i=[];for(const t of this.args)Mi(t)?i.push([t[0],yield ei(t[1],e)]):i.push(yield ei(t,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class Di{constructor(t,e){this.filters=[];const i="string"==typeof t?new Si(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map((t=>new Pi(t,this.getFilter(e,t.name),e)))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let i=yield this.initial.evaluate(t,e);for(const e of this.filters)i=yield e.render(i,t);return i}getFilter(t,e){const i=t.filters[e];return Xt(i||!t.options.strictFilters,(()=>`undefined filter: ${e}`)),i}}class Ii extends ki{constructor(t,e){var i;super(t);const s=new Si(t.input,e.options.operators,t.file,t.contentRange);this.value=new Di(s.readFilteredValue(),e);const n=this.value.filters,a=e.options.outputEscape;if(!(null===(i=n[n.length-1])||void 0===i?void 0:i.raw)&&a){const t=new Ve(toString.call(a),[],"",0,0);n.push(new Pi(t,a,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class Ri extends ki{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class Li{constructor(t,e){this.segments=t,this.location=e}toString(){return Gi(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof Li?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class Fi{constructor(){this.map=new Map}get(t){const e=Gi([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(Gi([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const Ni={partials:!0};function*Oi(t,e,i){const s=new Fi,n=new Fi,a=new Fi,r=new ji(new Set),o=new Set;function l(t,e){s.push(t);const i=e.alias(t);if(void 0!==i){const t=i.segments[0];ut(t)&&!r.has(t)&&n.push(i)}else{const i=t.segments[0];ut(i)&&!e.has(i)&&n.push(t)}for(const i of t.segments)i instanceof Li&&l(i,e)}function*h(t,s){if(t.arguments)for(const e of t.arguments())for(const t of Vi(e))l(t,s);if(t.localScope)for(const e of t.localScope()){s.add(e.content),s.deleteAlias(e.content);const[t,i]=e.getPosition();a.push(new Li([e.content],{row:t,col:i,file:e.file}))}if(t.children)if(t.partialScope){const n=t.partialScope();if(void 0===n){for(const n of yield t.children(e,i))yield h(n,s);return}if(o.has(n.name))return;const a=new Set,r=n.isolated?new ji(a):s.push(a);for(const t of n.scope)if(ut(t))a.add(t);else{const[e,i]=t;a.add(e);const s=Array.from(Vi(i));s.length&&r.setAlias(e,s[0].segments)}for(const s of yield t.children(e,i))yield h(s,r),o.add(n.name);r.pop()}else{t.blockScope&&s.push(new Set(t.blockScope()));for(const n of yield t.children(e,i))yield h(n,s);t.blockScope&&s.pop()}}for(const e of t)yield h(e,r);return{variables:s.asObject(),globals:n.asObject(),locals:a.asObject()}}function Bi(t,e={}){return ce(Oi(t,Object.assign(Object.assign({},Ni),e).partials,!1))}function zi(t,e={}){return de(Oi(t,Object.assign(Object.assign({},Ni),e).partials,!0))}class ji{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return null===(t=this.stack.pop())||void 0===t?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!ut(e))return;const i=this.getAlias(e);return void 0!==i?new Li([...i,...t.segments.slice(1)],t.location):void 0}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*Vi(t){as(t)?yield*Hi(t):t instanceof Di&&(yield*function*(t){for(const e of t.initial.postfix)as(e)&&(yield*Hi(e));for(const e of t.filters)for(const t of e.args)Mi(t)&&t[1]?yield*Hi(t[1]):as(t)&&(yield*Hi(t))}(t))}function*Hi(t){ns(t)?(yield*Hi(t.lhs),yield*Hi(t.rhs)):is(t)&&(yield $i(t))}function $i(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,ts(s)||es(s)||ss(s)?e.push(s.content):is(s)&&e.push(...$i(s).segments);for(const s of t.props.slice(1))i=i||s.file,ts(s)||es(s)||ss(s)?e.push(s.content):is(s)&&e.push($i(s));const[n,a]=t.getPosition();return new Li(e,{row:n,col:a,file:i})}const Ui=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function Gi(t,e=!1){const i=[],s=t[0];ut(s)&&(!e||s.match(Ui)?i.push(`${s}`):i.push(`['${s}']`));for(const e of t.slice(1))e instanceof Li?i.push(`[${Gi(e.segments)}]`):ut(e)?e.match(Ui)?i.push(`.${e}`):i.push(`['${e}']`):i.push(`[${e}]`);return i.join("")}var qi,Wi,Ki;!function(t){t.Partials="partials",t.Layouts="layouts",t.Root="root"}(qi||(qi={}));class Xi{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;Xt(e,"`fs.sep` is required for relative reference");const i=new RegExp(["."+e,".."+e,"./","../"].map((t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|"));this.shouldLoadRelative=t=>i.test(t)}else this.shouldLoadRelative=t=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,i,s){const{fs:n}=this.options,a=this.options[e];for(const r of this.candidates(t,a,s,e!==qi.Root))if(i?n.existsSync(r):yield n.exists(r))return r;throw this.lookupError(t,a)}*candidates(t,e,i,s){const{fs:n,extname:a}=this.options;if(this.shouldLoadRelative(t)&&i){const r=n.resolve(this.dirname(i),t,a);for(const t of e)if(!s||this.contains(t,r)){yield r;break}}for(const i of e){const e=n.resolve(i,t,a);s&&!this.contains(i,e)||(yield e)}if(void 0!==n.fallback){const e=n.fallback(t);void 0!==e&&(yield e)}}dirname(t){const e=this.options.fs;return Xt(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const i=new Error("ENOENT");return i.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,i.code="ENOENT",i}}class Yi{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Xi(this.liquid.options),this.parseLimit=new Me("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new Si(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(i)}parseTokens(t){let e;const i=[],s=[];for(;e=t.shift();)try{i.push(this.parseToken(e,t))}catch(t){if(!this.liquid.options.catchAllErrors)throw t;s.push(t)}if(s.length)throw new Ht(s);return i}parseToken(t,e){try{if(Zi(t)){const i=this.liquid.tags[t.name];return Xt(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return rs(t)===Wi.Output?new Ii(t,this.liquid):new Ri(t)}catch(e){if(Bt.is(e))throw e;throw new jt(e,t)}}parseStream(t){return new Ti(t,((t,e)=>this.parseToken(t,e)))}*_parseFileCached(t,e,i=qi.Root,s){const n=this.cache,a=this.loader.shouldLoadRelative(t)?s+","+t:i+":"+t,r=yield n.read(a);if(r)return r;const o=this._parseFile(t,e,i,s),l=e?yield o:ce(o);n.write(a,l);try{return yield l}catch(t){throw n.remove(a),t}}*_parseFile(t,e,i=qi.Root,s){const n=yield this.loader.lookup(t,i,e,s);return this.parse(e?this.fs.readFileSync(n):yield this.fs.readFile(n),n)}}function Qi(t){return rs(t)===Wi.Operator}function Ji(t){return rs(t)===Wi.HTML}function Zi(t){return rs(t)===Wi.Tag}function ts(t){return rs(t)===Wi.Quoted}function es(t){return rs(t)===Wi.Number}function is(t){return rs(t)===Wi.PropertyAccess}function ss(t){return rs(t)===Wi.Word}function ns(t){return rs(t)===Wi.Range}function as(t){return(1667&rs(t))>0}function rs(t){return t?t.kind:-1}!function(t){t[t.Number=1]="Number",t[t.Literal=2]="Literal",t[t.Tag=4]="Tag",t[t.Output=8]="Output",t[t.HTML=16]="HTML",t[t.Filter=32]="Filter",t[t.Hash=64]="Hash",t[t.PropertyAccess=128]="PropertyAccess",t[t.Word=256]="Word",t[t.Range=512]="Range",t[t.Quoted=1024]="Quoted",t[t.Operator=2048]="Operator",t[t.FilteredValue=4096]="FilteredValue",t[t.Delimited=12]="Delimited"}(Wi||(Wi={}));class os{constructor(t={},e=yi,i={},{memoryLimit:s,renderLimit:n}={}){var a,r,o,l,h;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!i.sync,this.opts=e,this.globals=null!==(a=i.globals)&&void 0!==a?a:e.globals,this.environments=Et(t)?t:Object(t),this.strictVariables=null!==(r=i.strictVariables)&&void 0!==r?r:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=i.ownPropertyOnly)&&void 0!==o?o:e.ownPropertyOnly,this.memoryLimit=null!=s?s:new Me("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=n?n:new Me("template render",Je().now()+(null!==(h=i.renderLimit)&&void 0!==h?h:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map((t=>[t,this.getRegister(t)]))}restoreRegister(t){return t.forEach((([t,e])=>this.setRegister(t,e)))}getAll(){return[this.globals,this.environments,...this.scopes].reduce(((t,e)=>le(t,e)),{})}get(t){return this.getSync(t)}getSync(t){return de(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return de(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){ut(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield ls(t,e[s],this.ownPropertyOnly),i&&void 0===t)throw new Ut(e.slice(0,s+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new os(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(t){for(let e=this.scopes.length-1;e>=0;e--){const i=this.scopes[e];if(t in i)return i}return t in this.environments?this.environments:this.globals}}function ls(t,e,i){if(t=At(t),e=yt(e),_t(t))return t;if(St(t)&&e<0)return t[t.length+ +e];const s=function(t,e,i){return!i||dt.call(t,e)||t instanceof lt?t[e]:void 0}(t,e,i);return void 0===s&&t instanceof lt?t.liquidMethodMissing(e):pt(s)?s.call(t):"size"===e?function(t){if(dt.call(t,"size")||void 0!==t.size)return t.size;if(St(t)||ut(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return St(t)?t[0]:t.first}(t):"last"===e?function(t){return St(t)?t[t.length-1]:t.last}(t):s}!function(t){t[t.OUTPUT=0]="OUTPUT",t[t.STORE=1]="STORE"}(Ki||(Ki={}));const hs=Lt(Math.abs),cs=Lt(Math.max),ds=Lt(Math.min),us=Lt(Math.ceil),ps=Lt(((t,e,i=!1)=>i?Math.floor(t/e):t/e)),gs=Lt(Math.floor),fs=Lt(((t,e)=>t-e)),ms=Lt(((t,e)=>t%e)),vs=Lt(((t,e)=>t*e));var bs=Object.freeze({__proto__:null,abs:hs,at_least:cs,at_most:ds,ceil:us,divided_by:ps,floor:gs,minus:fs,modulo:ms,times:vs,round:function(t,e=0){t=yt(t),e=yt(e);const i=Math.pow(10,e);return Math.round(t*i)/i},plus:function(t,e){return t=yt(t),e=yt(e),Number(t)+Number(e)}});const ys=/[^\p{M}\p{L}\p{Nd}]+/gu,ws={raw:/\s+/g,default:ys,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:ys,none:null};var xs=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(mt(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(mt(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(mt(t)).replace(/%20/g,"+").replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())),uri_escape:t=>encodeURI(mt(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=mt(t);const s=ws[e];return s&&("latin"===e&&(t=function(t){return t.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(t)),t=t.replace(s,"-").replace(/^-|-$/g,"")),i?t:t.toLowerCase()}});const As=Lt((function(t,e){const i=bt(t),s=_t(e)?" ":mt(e),n=i.length*(1+s.length);return this.context.memoryLimit.use(n),i.join(s)})),_s=Lt((t=>Tt(t)?Ct(t):"")),Ss=Lt((t=>Tt(t)?t[0]:"")),Ts=Lt((function(t){const e=bt(t);return this.context.memoryLimit.use(e.length),[...e].reverse()}));function ks(t,e=[]){const i=bt(t),s=bt(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function Cs(t){return this.context.opts.jekyllWhere?e=>{return Qt.is(t)?ri(e,t):St(e)?(i=t,e.some((t=>ri(t,i)))):ri(e,t);var i}:void 0===t?t=>si(t,this.context):e=>ri(e,t)}function*Es(t,e,i,s){const n=[];e=bt(e),this.context.memoryLimit.use(e.length);const a=new Si(mt(i)).readScopeValue();for(const t of e)n.push(yield ei(a,this.context.spawn(t)));const r=Cs.call(this,s);return e.filter(((e,i)=>r(n[i])===t))}function*Ms(t,e,i,s){const n=[],a=new Di(mt(s),this.liquid),r=bt(e);this.context.memoryLimit.use(r.length);for(const e of r){this.context.push({[i]:e});const s=yield a.value(this.context);this.context.pop(),s===t&&n.push(e)}return n}function*Ps(t,e,i){const s=new Si(mt(e)).readScopeValue(),n=bt(t),a=Cs.call(this,i);for(let t=0;t<n.length;t++){if(a(yield ei(s,this.context.spawn(n[t]))))return[t,n[t]]}}function*Ds(t,e,i){const s=new Di(mt(i),this.liquid),n=bt(t);for(let t=0;t<n.length;t++){this.context.push({[e]:n[t]});const i=yield s.value(this.context);if(this.context.pop(),i)return[t,n[t]]}}var Is=Object.freeze({__proto__:null,join:As,last:_s,first:Ss,reverse:Ts,sort:function*(t,e){const i=[],s=bt(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push([t,e?yield this.context._getFromScope(t,mt(e).split("."),!1):t]);return i.sort(((t,e)=>{const i=t[1],s=e[1];return i<s?-1:i>s?1:0})).map((t=>t[0]))},sort_natural:function(t,e){const i=mt(e),s=void 0===e?Rt:(t,e)=>Rt(t[i],e[i]),n=bt(t);return this.context.memoryLimit.use(n.length),[...n].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=bt(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push(yield this.context._getFromScope(t,mt(e),!1));return i},sum:function*(t,e){let i=0;const s=bt(t);for(const t of s){const s=Number(e?yield this.context._getFromScope(t,mt(e),!1):t);i+=Number.isNaN(s)?0:s}return i},compact:function(t){const e=bt(t);return this.context.memoryLimit.use(e.length),e.filter((t=>!_t(yt(t))))},concat:ks,push:function(t,e){return ks.call(this,t,[e])},unshift:function(t,e){const i=bt(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...bt(t)];return e.pop(),e},shift:function(t){const e=bt(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return _t(t=yt(t))?[]:(St(t)||(t=mt(t)),e=e<0?t.length+e:e,this.context.memoryLimit.use(i),t.slice(e,e+i))},where:function*(t,e,i){return yield*Es.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*Es.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*Ms.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*Ms.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=vt(t);const s=new Si(mt(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const e of t){const t=yield ei(s,this.context.spawn(e));i.has(t)||i.set(t,[]),i.get(t).push(e)}return[...i.entries()].map((([t,e])=>({name:t,items:e})))},group_by_exp:function*(t,e,i){const s=new Map,n=new Di(mt(i),this.liquid);t=vt(t),this.context.memoryLimit.use(t.length);for(const i of t){this.context.push({[e]:i});const t=yield n.value(this.context);this.context.pop(),s.has(t)||s.set(t,[]),s.get(t).push(i)}return[...s.entries()].map((([t,e])=>({name:t,items:e})))},has:function*(t,e,i){return!!(yield*Ps.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*Ds.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*Ps.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*Ds.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*Ps.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*Ds.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=bt(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(_t(t=yt(t)))return[];St(t)||(t=mt(t)),this.context.memoryLimit.use(e);const i=[...t].sort((()=>Math.random()-.5));return 1===e?i[0]:i.slice(0,e)}});function Rs(t,e,i){var s,n,a;const r=(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)+(null!==(n=null==e?void 0:e.length)&&void 0!==n?n:0)+(null!==(a=null==i?void 0:i.length)&&void 0!==a?a:0);this.context.memoryLimit.use(r);const o=Fs(t,this.context.opts,i);return o?we(o,e=_t(e=yt(e))?this.context.opts.dateFormat:mt(e)):t}function Ls(t,e,i,s){const n=Fs(t,this.context.opts);if(!n)return t;if("ordinal"===i){const t=n.getDate();return we(n,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return we(n,`%d ${e} %Y`)}function Fs(t,e,i){let s;const n=null!=i?i:e.timezoneOffset,a=e.locale;return s="now"===(t=yt(t))||"today"===t?new Ee(Date.now(),a,n):xt(t)?new Ee(1e3*t,a,n):ut(t)?/^\d+$/.test(t)?new Ee(1e3*+t,a,n):e.preserveTimezones&&void 0===i?Ee.createDateFixedToTimezone(t,a):new Ee(t,a,n):new Ee(t,a,n),s.valid()?s:void 0}var Ns=Object.freeze({__proto__:null,date:Rs,date_to_xmlschema:function(t){return Rs.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return Rs.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return Ls.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return Ls.call(this,t,"%B",e,i)}});const Os=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,Bs=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var zs=Object.freeze({__proto__:null,append:function(t,e){Xt(2===arguments.length,"append expect 2 arguments");const i=mt(t),s=mt(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){Xt(2===arguments.length,"prepend expect 2 arguments");const i=mt(t),s=mt(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),e?(e=Ft(mt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),mt(e).toUpperCase()},remove:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),i.split(mt(e)).join("")},remove_first:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),i.replace(mt(e),"")},remove_last:function(t,e){const i=mt(t);this.context.memoryLimit.use(i.length);const s=mt(e),n=i.lastIndexOf(s);return-1===n?i:i.substring(0,n)+i.substring(n+s.length)},rstrip:function(t,e){return t=mt(t),this.context.memoryLimit.use(t.length),e?(e=Ft(mt(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=mt(t);this.context.memoryLimit.use(i.length);const s=i.split(mt(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),e?(e=Ft(mt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=mt(t);return this.context.memoryLimit.use(s.length),s.split(mt(e)).join(i)},replace_first:function(t,e,i){const s=mt(t);return this.context.memoryLimit.use(s.length),s.replace(mt(e),i)},replace_last:function(t,e,i){const s=mt(t);this.context.memoryLimit.use(s.length);const n=mt(e),a=s.lastIndexOf(n);if(-1===a)return s;const r=mt(i);return s.substring(0,a)+r+s.substring(a+n.length)},truncate:function(t,e=50,i="..."){const s=mt(t);return this.context.memoryLimit.use(s.length),s.length<=e?t:s.substring(0,e-i.length)+i},truncatewords:function(t,e=15,i="..."){const s=mt(t);this.context.memoryLimit.use(s.length);const n=s.split(/\s+/);e<=0&&(e=1);let a=n.slice(0,e).join(" ");return n.length>=e&&(a+=i),a},normalize_whitespace:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=mt(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(Os)||[]).length+(t.match(Bs)||[]).length;case"auto":return Os.test(t)?t.match(Os).length+(t.match(Bs)||[]).length:t.split(/\s+/).length;default:return t.split(/\s+/).length}},array_to_sentence_string:function(t,e="and"){switch(this.context.memoryLimit.use(t.length),t.length){case 0:return"";case 1:return t[0];case 2:return`${t[0]} ${e} ${t[1]}`;default:return`${t.slice(0,-1).join(", ")}, ${e} ${t[t.length-1]}`}}});const js=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},vi),bs),xs),Is),Ns),zs),ui);const Vs=["offset","limit","reversed"];function Hs(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(ts(e)){return $s(i.parse(e.content))}return e}const s=[...t.readFileNameTemplate(e.options)],n=$s(i.parseTokens(s));return"none"===n?void 0:n}function $s(t){return 1===t.length&&Ji(t[0].token)?t[0].token.getContent():t}function*Us(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield ei(t,e)}class Gs extends Zt{constructor(t,e,i,s){super(t,i,s),this.length=t,this.cols=e}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const qs={assign:class extends Ci{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new Di(this.tokenizer.readFilteredValue(),this.liquid)}*render(t){t.bottom()[this.key]=yield this.value.value(t,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer.readIdentifier(),a=this.tokenizer.readIdentifier(),r=this.tokenizer.readValue();if(!n.size()||"in"!==a.content||!r)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=n.content,this.collection=r,this.hash=new Ei(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",(()=>o=this.templates)).on("tag:else",(t=>{Yt(t.args),o=this.elseTemplates})).on("tag:endfor",(t=>{Yt(t.args),l.stop()})).on("template",(t=>o.push(t))).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)}));l.start()}*render(t,e){const i=this.liquid.renderer;let s=vt(yield ei(this.collection,t));if(!s.length)return void(yield i.renderTemplates(this.elseTemplates,t,e));const n="continue-"+this.variable+"-"+this.collection.getText();t.push({continue:t.getRegister(n)});const a=yield this.hash.render(t);t.pop();s=(this.liquid.options.orderedFilterParameters?Object.keys(a).filter((t=>Vs.includes(t))):Vs.filter((t=>void 0!==a[t]))).reduce(((t,e)=>{return"offset"===e?(i=t,s=a.offset,i.slice(s)):"limit"===e?function(t,e){return t.slice(0,e)}(t,a.limit):function(t){return[...t].reverse()}(t);var i,s}),s),t.setRegister(n,(a.offset||0)+s.length);const r={forloop:new Zt(s.length,this.collection.getText(),this.variable)};t.push(r);for(const n of s){if(r[this.variable]=n,t.continueCalled=t.breakCalled=!1,yield i.renderTemplates(this.templates,t,e),t.breakCalled)break;r.forloop.next()}t.continueCalled=t.breakCalled=!1,t.pop()}*children(){const t=this.templates.slice();return this.elseTemplates&&t.push(...this.elseTemplates),t}*arguments(){yield this.collection;for(const t of Object.values(this.hash.hash))as(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends Ci{constructor(t,e,i,s){for(super(t,e,i),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;e.length;){const t=e.shift();if(Zi(t)&&"endcapture"===t.name)return;this.templates.push(s.parseToken(t,e))}throw new Error(`tag ${t.getText()} not closed`)}readVariable(){let t=this.tokenizer.readIdentifier();if(t.content)return t;if(t=this.tokenizer.readQuoted(),t)return t;throw this.tokenizer.error("invalid capture name")}*render(t){const e=this.liquid.renderer,i=yield e.renderTemplates(this.templates,t);t.bottom()[this.variable]=i}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new Di(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let n=[],a=0;const r=s.parseStream(e).on("tag:when",(t=>{if(a>0)return;n=[];const e=[];for(;!t.tokenizer.end();)e.push(t.tokenizer.readValueOrThrow()),t.tokenizer.skipBlank(),","===t.tokenizer.peek()?t.tokenizer.readTo(","):t.tokenizer.readTo("or");this.branches.push({values:e,templates:n})})).on("tag:else",(()=>{a++,n=this.elseTemplates})).on("tag:endcase",(()=>r.stop())).on("template",(t=>{n===this.elseTemplates&&1!==a||n.push(t)})).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)}));r.start()}*render(t,e){const i=this.liquid.renderer,s=yt(yield this.value.value(t,t.opts.lenientIf));let n=!1;for(const a of this.branches)for(const r of a.values){if(ri(s,yield ei(r,t,t.opts.lenientIf))){yield i.renderTemplates(a.templates,t,e),n=!0;break}}n||(yield i.renderTemplates(this.elseTemplates,t,e))}*arguments(){yield this.value,yield*this.branches.flatMap((t=>t.values))}*children(){const t=this.branches.flatMap((t=>t.templates));return this.elseTemplates&&t.push(...this.elseTemplates),t}},comment:class extends Ci{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(Zi(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends Ci{constructor(t,e,i,s){super(t,e,i);const{tokenizer:n}=t;this.file=Hs(n,this.liquid,s),this.currentFile=t.file;const a=n.p;"with"===n.readIdentifier().content?(n.skipBlank(),":"!==n.peek()?this.withVar=n.readValue():n.p=a):n.p=a,this.hash=new Ei(n,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:n}=this,{renderer:a}=i,r=yield Us(this.file,t,i);Xt(r,(()=>`illegal file path "${r}"`));const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",Ki.OUTPUT);const l=yield s.render(t);n&&(l[r]=yield ei(n,t));const h=yield i._parsePartialFile(r,t.sync,this.currentFile);t.push(t.opts.jekyllInclude?{include:l}:l),yield a.renderTemplates(h,t,e),t.pop(),t.restoreRegister(o)}*children(t,e){return t&&ut(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(ut(this.file)){let t;return this.liquid.options.jekyllInclude?t=["include"]:(t=Object.keys(this.hash.hash),this.withVar&&t.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:t}}}*arguments(){yield*Object.values(this.hash.hash).filter(as),as(this.file)&&(yield this.file),as(this.withVar)&&(yield this.withVar)}},render:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer;for(this.file=Hs(n,this.liquid,s),this.currentFile=t.file;!n.end();){n.skipBlank();const t=n.p,e=n.readIdentifier();if(("with"===e.content||"for"===e.content)&&(n.skipBlank(),":"!==n.peek())){const t=n.readValue();if(t){const i=n.p;let s;"as"===n.readIdentifier().content?s=n.readIdentifier():n.p=i,this[e.content]={value:t,alias:s&&s.content},n.skipBlank(),","===n.peek()&&n.advance();continue}}n.p=t;break}this.hash=new Ei(n,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,n=yield Us(this.file,t,i);Xt(n,(()=>`illegal file path "${n}"`));const a=t.spawn(),r=a.bottom();if(le(r,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;r[i||n]=yield ei(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=vt(yield ei(s,t));r.forloop=new Zt(l.length,s.getText(),o);for(const t of l){r[o]=t;const s=yield i._parsePartialFile(n,a.sync,this.currentFile);yield i.renderer.renderTemplates(s,a,e),r.forloop.next()}}else{const t=yield i._parsePartialFile(n,a.sync,this.currentFile);yield i.renderer.renderTemplates(t,a,e)}}*children(t,e){return t&&ut(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(ut(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;ut(i)?t.push([i,e]):ut(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;ut(i)?t.push([i,e]):ut(this.file)&&t.push([this.file,e])}return{name:this.file,isolated:!0,scope:t}}}*arguments(){for(const t of Object.values(this.hash.hash))as(t)&&(yield t);if(this.with){const{value:t}=this.with;as(t)&&(yield t)}if(this.for){const{value:t}=this.for;as(t)&&(yield t)}}},decrement:class extends Ci{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;xt(i[this.variable])||(i[this.variable]=0),e.write(mt(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends Ci{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;xt(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(mt(s))}*localScope(){yield this.identifier}},cycle:class extends Ci{constructor(t,e,i){super(t,e,i),this.candidates=[];const s=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),s&&(":"===this.tokenizer.peek()?(this.group=s,this.tokenizer.advance()):this.candidates.push(s));!this.tokenizer.end();){const t=this.tokenizer.readValue();t&&this.candidates.push(t),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,(()=>`empty candidates: "${t.getText()}"`))}*render(t,e){const i=`cycle:${yield ei(this.group,t)}:`+this.candidates.join(","),s=t.getRegister("cycle");let n=s[i];void 0===n&&(n=s[i]=0);const a=this.candidates[n];return n=(n+1)%this.candidates.length,s[i]=n,yield ei(a,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.branches=[];let n=[];s.parseStream(e).on("start",(()=>this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]}))).on("tag:elsif",(t=>{Xt(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]})})).on("tag:else",(t=>{Yt(t.args),Xt(!this.elseTemplates,"duplicated else"),n=this.elseTemplates=[]})).on("tag:endif",(function(t){Yt(t.args),this.stop()})).on("template",(t=>n.push(t))).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)})).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,templates:n}of this.branches){if(si(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(n,t,e))}yield i.renderTemplates(this.elseTemplates||[],t,e)}*children(){const t=this.branches.flatMap((t=>t.templates));return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map((t=>t.value))}},layout:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.file=Hs(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new Ei(this.tokenizer,i.options.keyValueSeparator),this.templates=s.parseTokens(e)}*render(t,e){const{liquid:i,args:s,file:n}=this,{renderer:a}=i;if(void 0===n)return t.setRegister("blockMode",Ki.OUTPUT),void(yield a.renderTemplates(this.templates,t,e));const r=yield Us(this.file,t,i);Xt(r,(()=>`illegal file path "${r}"`));const o=yield i._parseLayoutFile(r,t.sync,this.currentFile);t.setRegister("blockMode",Ki.STORE);const l=yield a.renderTemplates(this.templates,t),h=t.getRegister("blocks");void 0===h[""]&&(h[""]=(t,e)=>e.write(l)),t.setRegister("blockMode",Ki.OUTPUT),t.push(yield s.render(t)),yield a.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&ut(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))as(t)&&(yield t);as(this.file)&&(yield this.file)}partialScope(){if(ut(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.templates=[];const n=/\w+/.exec(t.args);for(this.block=n?n[0]:"";e.length;){const t=e.shift();if(Zi(t)&&"endblock"===t.name)return;const i=s.parseToken(t,e);this.templates.push(i)}throw new Error(`tag ${t.getText()} not closed`)}*render(t,e){const i=this.getBlockRender(t);t.getRegister("blockMode")===Ki.STORE?t.getRegister("blocks")[this.block]=i:yield i(new se,e)}getBlockRender(t){const{liquid:e,templates:i}=this,s=t.getRegister("blocks")[this.block],n=function*(s,n){t.push({block:s}),yield e.renderer.renderTemplates(i,t,n),t.pop()};return s?(t,e)=>s(new se((e=>n(t,e))),e):n}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends Ci{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(Zi(t)&&"endraw"===t.name)return;this.tokens.push(t)}throw new Error(`tag ${t.getText()} not closed`)}render(){return this.tokens.map((t=>t.getText())).join("")}},tablerow:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const a=this.tokenizer.readIdentifier(),r=this.tokenizer.readValue();if("in"!==a.content||!r)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=n.content,this.collection=r,this.args=new Ei(this.tokenizer,i.options.keyValueSeparator),this.templates=[];const l=s.parseStream(e).on("start",(()=>o=this.templates)).on("tag:endtablerow",(()=>l.stop())).on("template",(t=>o.push(t))).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)}));l.start()}*render(t,e){let i=vt(yield ei(this.collection,t));const s=yield this.args.render(t),n=s.offset||0,a=void 0===s.limit?i.length:s.limit;i=i.slice(n,n+a);const r=s.cols||i.length,o=this.liquid.renderer,l=new Gs(i.length,r,this.collection.getText(),this.variable),h={tablerowloop:l};t.push(h);for(let s=0;s<i.length;s++,l.next())h[this.variable]=i[s],0===l.col0()&&(1!==l.row()&&e.write("</tr>"),e.write(`<tr class="row${l.row()}">`)),e.write(`<td class="col${l.col()}">`),yield o.renderTemplates(this.templates,t,e),e.write("</td>");i.length&&e.write("</tr>"),t.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const t of Object.values(this.args.hash))as(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[];let n=[],a=0;s.parseStream(e).on("start",(()=>this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),test:ni,templates:n=[]}))).on("tag:elsif",(t=>{a>0?n=[]:this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),test:si,templates:n=[]})})).on("tag:else",(()=>{a++,n=this.elseTemplates})).on("tag:endunless",(function(){this.stop()})).on("template",(t=>{n===this.elseTemplates&&1!==a||n.push(t)})).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)})).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,test:n,templates:a}of this.branches){if(n(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(a,t,e))}yield i.renderTemplates(this.elseTemplates,t,e)}*children(){const t=this.branches.flatMap((t=>t.templates));return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map((t=>t.value))}},break:class extends Ci{render(t,e){t.breakCalled=!0}},continue:class extends Ci{render(t,e){t.continueCalled=!0}},echo:class extends Ci{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new Di(this.tokenizer.readFilteredValue(),this.liquid))}*render(t,e){if(!this.value)return;const i=yield this.value.value(t,!1);e.write(i)}*arguments(){this.value&&(yield this.value)}},liquid:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(n)}*render(t,e){yield this.liquid.renderer.renderTemplates(this.templates,t,e)}*children(){return this.templates}},"#":class extends Ci{constructor(t,e,i){if(super(t,e,i),-1!==t.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class Ws{constructor(t={}){this.renderer=new Ze,this.filters={},this.tags={},this.options=wi(t),this.parser=new Yi(this),kt(qs,((t,e)=>this.registerTag(e,t))),kt(js,((t,e)=>this.registerFilter(e,t)))}parse(t,e){return new Yi(this).parse(t,e)}_render(t,e,i){const s=e instanceof os?e:new os(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return he(this,void 0,void 0,(function*(){return ce(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderSync(t,e,i){return de(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new os(e,this.options,i);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,e,i){const s=this.parse(t);return this._render(s,e,i)}parseAndRender(t,e,i){return he(this,void 0,void 0,(function*(){return ce(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}parseAndRenderSync(t,e,i){return de(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new Yi(this).parseFile(t,e,qi.Partials,i)}_parseLayoutFile(t,e,i){return new Yi(this).parseFile(t,e,qi.Layouts,i)}_parseFile(t,e,i,s){return new Yi(this).parseFile(t,e,i,s)}parseFile(t,e){return he(this,void 0,void 0,(function*(){return ce(new Yi(this).parseFile(t,!1,e))}))}parseFileSync(t,e){return de(new Yi(this).parseFile(t,!0,e))}*_renderFile(t,e,i){const s=yield this._parseFile(t,i.sync,i.lookupType);return yield this._render(s,e,i)}renderFile(t,e,i){return he(this,void 0,void 0,(function*(){return ce(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderFileSync(t,e,i){return de(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return he(this,void 0,void 0,(function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)}))}_evalValue(t,e){const i=new Di(t,this),s=e instanceof os?e:new os(e,this.options);return i.value(s)}evalValue(t,e){return he(this,void 0,void 0,(function*(){return ce(this._evalValue(t,e))}))}evalValueSync(t,e){return de(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){var i;this.tags[t]=pt(e)?e:(i=e,class extends Ci{constructor(t,e,s){super(t,e,s),pt(i.parse)&&i.parse.call(this,t,e)}*render(t,e){const s=yield new Ei(this.token.args,t.opts.keyValueSeparator).render(t);return yield i.render.call(this,t,e,s)}})}plugin(t){return t.call(this,Ws)}express(){const t=this;let e=!0;return function(i,s,n){if(e){e=!1;const i=xi(this.root);t.options.root.unshift(...i),t.options.layouts.unshift(...i),t.options.partials.unshift(...i)}t.renderFile(i,s).then((t=>n(null,t)),n)}}analyze(t,e={}){return he(this,void 0,void 0,(function*(){return Bi(t,e)}))}analyzeSync(t,e={}){return zi(t,e)}parseAndAnalyze(t,e,i={}){return he(this,void 0,void 0,(function*(){return Bi(this.parse(t,e),i)}))}parseAndAnalyzeSync(t,e,i={}){return zi(this.parse(t,e),i)}variables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Object.keys(i.variables)}))}variablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap((t=>t.map((t=>String(t)))))))}))}fullVariablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap((t=>t.map((t=>String(t)))))))}variableSegments(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}))}variableSegmentsSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}globalVariables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Object.keys(i.globals)}))}globalVariablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap((t=>t.map((t=>String(t)))))))}))}globalFullVariablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap((t=>t.map((t=>String(t)))))))}globalVariableSegments(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}))}globalVariableSegmentsSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}}const Ks={render:function(t,e){const i=r("v-icon"),s=r("v-list-item-icon"),n=r("v-text-overflow"),a=r("v-list-item-content"),u=r("v-list-item"),p=r("v-list");return o(),l(p,{nav:""},{default:h((()=>[c(u,{href:"https://app.texttoanything.nl/"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"open_in_new"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Text to anything dashboard"})])),_:1})])),_:1}),c(u,{to:"/tta_settings/templates"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"code"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Templates"})])),_:1})])),_:1}),c(u,{to:"/tta_settings/flowsLogExplorer"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"short_text"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Flows log explorer"})])),_:1})])),_:1}),c(u,{to:"/tta_settings/settings"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"settings"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Settings"})])),_:1})])),_:1}),d(' <v-list-item to="/tta_settings/usage">\n <v-list-item-icon><v-icon name="bar_chart" /></v-list-item-icon>\n <v-list-item-content>\n <v-text-overflow text="Usage" />\n </v-list-item-content>\n </v-list-item> ')])),_:1})},__file:"settingsmodule/src/TTAnav.vue"},Xs=t=>(f("data-v-4a16637c"),t=t(),m(),t),Ys={key:0,class:"popover"},Qs=Xs((()=>v("br",null,null,-1))),Js=Xs((()=>v("ul",null,[v("li",null,"HTML - preview as webpage"),v("li",null,"PDF (Preview) - watermarked, free"),v("li",null,"PDF - final version, without watermark"),v("li",null,"Code - preview without test input")],-1)));var Zs={__name:"explainPreviewMode",props:{text:{type:String,required:!0}},setup(t){const e=u(!1);return(t,i)=>{const s=r("v-icon");return o(),p("div",{class:"info-popover",onMouseenter:i[0]||(i[0]=t=>e.value=!0),onMouseleave:i[1]||(i[1]=t=>e.value=!1)},[c(s,{name:"question_mark",class:"info-icon"}),e.value?(o(),p("div",Ys,[g(" The preview mode has 4 modes: "),Qs,Js])):d("v-if",!0)],32)}}},tn=[],en=[];function sn(t,e){if(t&&"undefined"!=typeof document){var i,s=!0===e.prepend?"prepend":"append",n=!0===e.singleTag,a="string"==typeof e.container?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var r=tn.indexOf(a);-1===r&&(r=tn.push(a)-1,en[r]={}),i=en[r]&&en[r][s]?en[r][s]:en[r][s]=o()}else i=o();65279===t.charCodeAt(0)&&(t=t.substring(1)),i.styleSheet?i.styleSheet.cssText+=t:i.appendChild(document.createTextNode(t))}function o(){var t=document.createElement("style");if(t.setAttribute("type","text/css"),e.attributes)for(var i=Object.keys(e.attributes),n=0;n<i.length;n++)t.setAttribute(i[n],e.attributes[i[n]]);var r="prepend"===s?"afterbegin":"beforeend";return a.insertAdjacentElement(r,t),t}}sn("\n.info-popover[data-v-4a16637c] {\n position: relative;\n display: flex;\n color: var(--theme--foreground-subdued);\n}\n.info-icon[data-v-4a16637c] {\n margin: auto;\n}\n.popover[data-v-4a16637c] {\n position: absolute;\n top: 175%;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--theme--background);\n color: var(--theme--foreground);\n border: 1px solid var(--theme--border);\n padding: 0.5rem;\n border-radius: 4px;\n white-space: nowrap;\n z-index: 1000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n}\n",{}),Zs.__scopeId="data-v-4a16637c",Zs.__file="settingsmodule/src/pages/templates/explainPreviewMode.vue";const nn=v("div",{class:"field half"},[v("div",{class:"type-label"},"Template name")],-1),an=v("div",{class:"field half"},[v("div",{class:"type-label"},"Description")],-1),rn=v("div",{class:"field half"},[v("div",{class:"type-label"},"Format")],-1),on=v("div",{class:"field half"},[v("div",{class:"type-label"},"Orientation")],-1),ln={key:0,class:"TTA-popup"},hn={class:"TTA-toolbar"},cn={class:"right-side"},dn={class:"setwidth"},un={class:"TTA-action"},pn={class:"TTA-wapper"},gn={class:"devFields"},fn={id:"partSelect"},mn=["src","srcDoc"],vn={class:"tta-notice"},bn=v("a",{href:"https://app.texttoanything.nl",target:"_blank"},"TTA app",-1);var yn=b({__name:"templates",setup(t){const{useCollectionsStore:s,useFlowsStore:n,useNotificationsStore:a}=e(),f=n(),m=a(),b=y((()=>f.flows.filter((t=>"webhook"===t.trigger&&"POST"==t.options.method)).map((t=>({text:t.name,value:t.id}))))),M=u([]),P=u(!1),D=u(!1),I=u("Development"),R=u("html"),L=u(""),F=u(!1),N=u(),O=u(50),B=y((()=>100-O.value)),z=y((()=>100-B.value)),j=u("");function V(t){"Header"==I.value?G.value.header=t:"Body"==I.value?G.value.template=t:G.value.footer=t}function H(t){"Fixed"==G.value.input_type?G.value.input_fixed=t:G.value.input_flow_body=t}w((()=>I.value),(t=>{"Development"==t&&(j.value=""),"Header"==t&&(j.value=G.value.header),"Body"==t&&(j.value=G.value.template),"Footer"==t&&(j.value=G.value.footer)}),{immediate:!0});const $=i(),U={template:"<h1>Hello {{name}}!</h1>",id:-1,name:"",description:"",collection:"",format:"A4",orientation:"portrait",header:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; \n -webkit-print-color-adjust: exact;\n }\n</style>\n<div style='width:100%'>\n <span class='date'></span>\n <span class='title' style='float:right'></span>\n</div>",footer:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; -webkit-print-color-adjust: exact;\n }\n</style>\n<div\n style=‘width:100%’>\n <div style=‘float:right’><span\n class='pageNumber'></span> / <span class='totalPages'></span>\n </div>\n</div>",input_type:"Fixed",input_fixed:'{"name": "World!"}',input_flow:"",input_flow_body:"{}"},G=u(structuredClone(U)),q=new Ws;async function W(t){if("Flow"==G.value.input_type&&!G.value.input_flow)return;L.value="rendering";let e={};try{if("Flow"==G.value.input_type){const t=await $.post("/flows/trigger/"+G.value.input_flow,JSON.parse(G.value.input_flow_body));if("object"!=typeof t.data)throw new Error("Output of flow should be an object, not an "+typeof t.data);if("name"in t.data&&"code"in t.data&&"status"in t.data)throw new Error(JSON.stringify(t.data));e=t.data}else null==G.value.input_fixed&&(G.value.input_fixed="{}"),e=JSON.parse(G.value.input_fixed);if("html"==t||"code"==t){const i=(G.value.header||"")+(G.value.template||"")+(G.value.footer||""),s=new Blob(['<style>\n .date:before{content: "Date here";font-style: italic; }\n .title:before{content: "Title here";font-style: italic; }\n .pageNumber:before{content: "Pagenumber";font-style: italic; }\n .totalPages:before{content: "Total pages";font-style: italic; }\n </style>'+("code"==t?i:await q.render(q.parse(i),e))],{type:"text/html"});L.value=URL.createObjectURL(s)}else{const t=q.parse(G.value.header||""),i=q.parse(G.value.template),s=q.parse(G.value.footer||""),n=await q.render(t,e),a=await q.render(i,e),r=await q.render(s,e),o=await fetch("/tta/pdf?preview="+("pdf-preview"==R.value?"preview":""),{body:JSON.stringify({...G.value,input_fixed:void 0,input_flow:void 0,input_flow_body:void 0,input_type:void 0,id:void 0,header:n,html:a,footer:r,landscape:"portrait"!=G.value.orientation}),method:"POST",headers:{"Content-Type":"application/json"}}).then((t=>t.blob())).then((t=>URL.createObjectURL(t)));L.value=o}}catch(t){console.error(t),m.add({title:"Error while generating PDF",text:"Please check your console/terminal for the error.",type:"error",dialog:!0}),L.value=URL.createObjectURL(new Blob(["Error occurred: "+((null==t?void 0:t.message)||t)],{type:"text/html"}))}}async function K(){const t=await $.get("/items/TTA_htmltemplates",{params:{limit:-1}});M.value=t.data.data}async function X(){-1==G.value.id?await $.post("/items/TTA_htmltemplates",{...G.value,id:void 0}):await $.patch("/items/TTA_htmltemplates/"+G.value.id,{...G.value,id:void 0}),P.value=!1,K()}async function Y(){await $.delete("/items/TTA_htmltemplates/"+N.value),M.value=M.value.filter((t=>t.id!=N.value)),F.value=!1}function Q({item:t}){G.value=t,D.value=!0}function J(){G.value=structuredClone(U),D.value=!1}function Z(){G.value.template=rt(G.value.template),G.value.footer=rt(G.value.footer),G.value.header=rt(G.value.header)}return w((()=>G.value.id),((t,e)=>{t!=e&&(I.value="",x((()=>{I.value="Body"})))})),w((()=>[G.value.header,G.value.template,G.value.footer,G.value.input_type,G.value.input_flow,G.value.input_fixed,R.value]),(()=>{["html","code"].includes(R.value)&&W(R.value)}),{deep:!0,immediate:!0}),A((async()=>{O.value=parseInt(localStorage.getItem("TTA-widthPartition")||"50"),K()})),w((()=>O.value),(t=>localStorage.setItem("TTA-widthPartition",t+""))),(t,e)=>{const i=r("v-icon"),s=r("v-button"),n=r("v-card-title"),a=r("v-input"),u=r("v-list-item-content"),f=r("v-list-item"),m=r("v-select"),y=r("v-list"),w=r("v-card-text"),x=r("v-card-actions"),A=r("v-card"),$=r("v-dialog"),U=r("VSelect"),q=r("v-slider"),K=r("VButton"),tt=r("VIcon"),et=r("v-table"),it=r("VNotice"),st=r("private-view");return o(),l(st,{title:"Offline templates"},{navigation:h((()=>[c(Ks)])),actions:h((()=>[c(s,{rounded:"",icon:"",onClick:e[0]||(e[0]=t=>P.value=!0)},{default:h((()=>[c(i,{name:"add"})])),_:1}),c($,{modelValue:P.value,"onUpdate:modelValue":e[6]||(e[6]=t=>P.value=t),persistent:!0},{default:h((()=>[c(A,null,{default:h((()=>[c(n,null,{default:h((()=>[g("Create a new HTML template")])),_:1}),c(w,null,{default:h((()=>[c(y,null,{default:h((()=>[c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[nn,c(a,{modelValue:G.value.name,"onUpdate:modelValue":e[1]||(e[1]=t=>G.value.name=t),placeholder:"Template name"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[an,c(a,{modelValue:G.value.description,"onUpdate:modelValue":e[2]||(e[2]=t=>G.value.description=t),placeholder:"Description"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[rn,c(m,{modelValue:G.value.format,"onUpdate:modelValue":e[3]||(e[3]=t=>G.value.format=t),placeholder:"Size",items:["A1","A2","A3","A4","A5","A6","Letter","Legal","Tabloid","Ledger"].map((t=>({text:t,value:t})))},null,8,["modelValue","items"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[on,c(m,{modelValue:G.value.orientation,"onUpdate:modelValue":e[4]||(e[4]=t=>G.value.orientation=t),placeholder:"Orientation",items:["portrait","landscape"].map((t=>({text:t,value:t})))},null,8,["modelValue","items"])])),_:1})])),_:1})])),_:1})])),_:1}),c(x,null,{default:h((()=>[c(s,{secondary:"",onClick:e[5]||(e[5]=t=>P.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{disabled:!G.value.collection||!G.value.name||!G.value.format,onClick:X},{default:h((()=>[g(" Save ")])),_:1},8,["disabled"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),default:h((()=>[D.value?(o(),p("div",ln,[v("div",hn,[v("div",{onClick:e[7]||(e[7]=t=>P.value=!0),class:"TTA-template-title"},[g(_(G.value.name)+" ",1),c(i,{name:"edit"})]),v("div",cn,[c(U,{modelValue:R.value,"onUpdate:modelValue":e[8]||(e[8]=t=>R.value=t),items:[{text:"HTML",value:"html"},{text:"PDF (Preview)",value:"pdf-preview"},{text:"PDF",value:"pdf"},{text:"Code",value:"code"}],style:{width:"170px"}},null,8,["modelValue","items"]),c(Zs,{text:"This is helpful info."}),v("div",{class:"TTA-action",onClick:Z},[c(i,{name:"vertical_align_center"})]),v("div",{class:"TTA-action",onClick:X},[c(i,{name:"save"})]),v("div",dn,[c(q,{modelValue:O.value,"onUpdate:modelValue":e[9]||(e[9]=t=>O.value=t),min:10,max:90,class:"TTA-slider"},null,8,["modelValue"])]),v("div",un,[c(i,{name:"close",onClick:J})])])]),v("div",pn,[v("div",{style:S("width: "+T(z)+"%"),class:"TTA-editor-wrapper"},["Development"==I.value?(o(),p(k,{key:0},[v("div",gn,[c(m,{modelValue:G.value.input_type,"onUpdate:modelValue":e[10]||(e[10]=t=>G.value.input_type=t),class:"max-w-input",items:[{value:"Flow",text:"Flow"},{value:"Fixed",text:"Fixed"}]},null,8,["modelValue"]),"Flow"==G.value.input_type?(o(),l(m,{key:0,modelValue:G.value.input_flow,"onUpdate:modelValue":e[11]||(e[11]=t=>G.value.input_flow=t),class:"max-w-input",items:T(b)},null,8,["modelValue","items"])):d("v-if",!0)]),"Fixed"==G.value.input_type?(o(),l(C("interface-input-code"),{key:0,class:"TTA-editor",value:G.value.input_fixed,language:"json",onInput:H},null,40,["value"])):d("v-if",!0),"Flow"==G.value.input_type?(o(),l(C("interface-input-code"),{key:1,class:"TTA-editor",value:G.value.input_flow_body,language:"json",onInput:H},null,40,["value"])):d("v-if",!0)],64)):d("v-if",!0),"Development"!=I.value?(o(),l(C("interface-input-code"),{key:1,class:"TTA-editor",value:j.value,language:"htmlmixed",onInput:V},null,40,["value"])):d("v-if",!0),v("div",fn,[c(m,{modelValue:I.value,"onUpdate:modelValue":e[12]||(e[12]=t=>I.value=t),items:[{value:"Header",text:"Header"},{value:"Body",text:"Body"},{value:"Footer",text:"Footer"},{value:"Development",text:"Test input"}]},null,8,["modelValue"])])],4),v("iframe",{class:"TTA-preview",src:"rendering"==L.value?void 0:L.value,srcDoc:"rendering"==L.value?T('\n <html>\n <head>\n <style>\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n font-family: sans-serif;\n background: #f9f9f9;\n }\n .spinner {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n .loader {\n border: 6px solid #f3f3f3;\n border-top: 6px solid #3498db;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n margin-bottom: 10px;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n </head>\n <body>\n <div class="spinner">\n <div class="loader"></div>\n <div>Loading...</div>\n </div>\n </body>\n </html>'):void 0,style:S("width: "+T(B)+"%")},null,12,mn),R.value.startsWith("pdf")?(o(),l(K,{key:0,onClick:e[13]||(e[13]=t=>{W("pdf")}),icon:!0,outlined:!1,id:"generatePDF"},{default:h((()=>[c(i,{name:"refresh"})])),_:1})):d("v-if",!0)])])):d("v-if",!0),c(et,{headers:[{text:"Name",value:"name",sortable:!1},{text:"Description",value:"description",width:600,sortable:!1},{text:"Format",value:"format",sortable:!1},{text:"",value:"del",width:60,sortable:!1}],"onClick:row":Q,items:M.value},{"item.del":h((({item:t})=>[c(K,{onClick:E((e=>{return i=t.id,N.value=i,void(F.value=!0);var i}),["stop"]),outlined:!0,icon:!0,rounded:!0},{default:h((()=>[c(tt,{name:"delete"})])),_:2},1032,["onClick"])])),_:1},8,["items"]),v("div",vn,[c(it,null,{default:h((()=>[g(" You can create online templates in the "),bn,g(" for a better editor experience. ")])),_:1})]),c($,{modelValue:F.value,"onUpdate:modelValue":e[15]||(e[15]=t=>F.value=t),persistent:!0},{default:h((()=>[c(A,null,{default:h((()=>[c(n,null,{default:h((()=>[g(" Are you sure you want to delete this item? This action can not be undone. ")])),_:1}),c(x,null,{default:h((()=>[c(s,{secondary:"",onClick:e[14]||(e[14]=t=>F.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{kind:"danger",onClick:Y},{default:h((()=>[g(" Proceed ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})}}});sn("\n.TTA-popup {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 100;\n display: flex;\n flex-direction: column;\n background-color: var(--theme--form--field--input--background-subdued);\n}\n.TTA-toolbar {\n background-color: var(--theme--form--field--input--background-subdued);\n display: flex;\n justify-content: space-between;\n}\n.TTA-toolbar .right-side {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.TTA-toolbar .TTA-slider {\n padding-top: 5px;\n}\n.TTA-toolbar .TTA-action {\n padding: 5px;\n cursor: pointer;\n}\n.TTA-toolbar .setwidth {\n display: flex;\n gap: 10px;\n padding-top: 6px;\n}\n.TTA-toolbar .TTA-template-title {\n margin: auto 0;\n font-size: 18px;\n cursor: pointer;\n padding-right: 5px;\n padding-left: 20px;\n border-bottom: 1px solid var(--v-list-item-border-color);\n}\n.TTA-toolbar .TTA-template-title i {\n padding-left: 5px;\n}\n.TTA-wapper {\n display: flex;\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n}\n.TTA-preview {\n flex-grow: 1;\n background-color: white;\n border: 0;\n}\n.TTA-editor {\n flex-grow: 1;\n height: 100%;\n width: 100%;\n max-height: calc(100vh - 130px);\n}\n.TTA-wapper .TTA-editor-wrapper {\n position: relative;\n}\n.TTA-editor > div {\n height: 100% !important;\n border-radius: 0 !important;\n}\n.TTA-editor .CodeMirror {\n height: 100%;\n}\n.TTA-wapper #partSelect {\n position: absolute;\n right: 0;\n top: 0;\n width: 200px;\n}\n.devFields {\n border-top: var(--theme--border-width) solid\n var(--theme--form--field--input--border-color);\n margin-left: 25px;\n margin-bottom: 10px;\n}\n.max-w-input {\n max-width: 250px;\n padding: 10px 0;\n}\n.max-w-input .v-input {\n max-width: 250px;\n margin-bottom: 5px;\n}\n#generatePDF {\n position: fixed;\n top: 69px;\n right: 10px;\n}\n.tta-notice {\n padding: 10px;\n}\n",{}),yn.__file="settingsmodule/src/pages/templates.vue";var wn=b({__name:"virusscanDialog",setup(t){const e=i(),s=u([]),n=u(!1);A((async()=>{const t=await e.get("/folders");s.value=t.data.data.map((t=>({name:t.name,id:t.id,scanning:1==t.TTA_VIRUSSCAN_ENABLED})))}));const a=y((()=>s.value.filter((t=>1==t.scanning)).length));return(t,i)=>{const l=r("VNotice"),d=r("v-button"),u=r("v-table"),f=r("v-drawer"),m=r("v-icon");return o(),p(k,null,[c(f,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=t=>n.value=t),persistent:!0,placement:"right",title:"Manage folders that are scanned for virusses",onCancel:i[1]||(i[1]=t=>n.value=!1),icon:"settings"},{default:h((()=>[c(l,null,{default:h((()=>[g(" Any uploads to the enabled folders will be scanned. ")])),_:1}),c(u,{headers:[{text:"",value:"enabled"},{text:"Name",value:"name"}],items:s.value},{"item.enabled":h((({item:t})=>[c(d,{onClick:i=>async function(t){t.scanning=!t.scanning,await e.patch("/folders/"+t.id,{TTA_VIRUSSCAN_ENABLED:t.scanning})}(t),small:"",danger:!t.scanning},{default:h((()=>[g(_(t.scanning?"Enabled":"Disabled"),1)])),_:2},1032,["onClick","danger"])])),_:1},8,["items"])])),_:1},8,["modelValue"]),c(d,{align:"left",fullWidth:"",small:"",onClick:i[2]||(i[2]=t=>n.value=!0)},{default:h((()=>[c(m,{name:"edit"}),T(a)==s.value.length?(o(),p(k,{key:0},[g(" All ")],64)):(o(),p(k,{key:1},[g(_(T(a))+"/"+_(s.value.length),1)],64)),g(" folders are being scanned ")])),_:1})],64)}}});wn.__file="settingsmodule/src/pages/settings/virusscanDialog.vue";const xn=t=>(f("data-v-7f9dbb3b"),t=t(),m(),t),An={class:"cards-wrapper"},_n=xn((()=>v("span",{class:"field-name"},"RapidAPI token",-1))),Sn=xn((()=>v("span",{class:"field-name"},"RapidAPI virusscanner token",-1))),Tn={class:"field-name info-parent"},kn=xn((()=>v("div",null,[g(" What should happen when a virus is detected? "),v("ul",null,[v("li",null," Delete threads, threads will be deleted immediately "),v("li",null," Trigger flow, the selected flow will be triggered with upload payload ")]),v("div",null," The trigger flow option is ideal for when you want to send a notification or add extra logic. The trigger flow option will not automaticly delete the file. ")],-1))),Cn={key:0},En={class:"field-name info-parent"};var Mn=b({__name:"settings",setup(t){const s=u(""),n=u(""),a=u(!1),f=u(""),m=u(""),b=u(""),w=i(),{useFlowsStore:x}=e(),_=x(),S=y((()=>_.flows.map((t=>({text:t.name,value:t.id})))));async function C(){M({TTA_KEY:s.value,TTA_KEY_VIRUS:n.value},"apikeys")}async function E(){M({TTA_VIRUSSCANNER_ENABLED:a.value,TTA_VIRUSSCANNER_MODE:f.value,TTA_VIRUSSCANNER_FLOW_ID:m.value},"virus")}async function M(t,e){b.value=e,await w.patch("/settings",t),setTimeout((()=>{b.value=""}),500)}return A((async()=>{const t=await w.get("/settings");s.value=t.data.data.TTA_KEY,n.value=t.data.data.TTA_KEY_VIRUS,m.value=t.data.data.TTA_VIRUSSCANNER_FLOW_ID,a.value=1==t.data.data.TTA_VIRUSSCANNER_ENABLED||!1,f.value=t.data.data.TTA_VIRUSSCANNER_MODE||"workflow"})),(t,e)=>{const i=r("v-card-title"),u=r("v-input"),y=r("v-card-text"),w=r("v-icon"),x=r("v-button"),A=r("v-progress-circular"),_=r("v-card-actions"),M=r("v-card"),P=r("VCheckbox"),D=r("VIcon"),I=r("VNotice"),R=r("v-hover"),L=r("v-select"),F=r("private-view");return o(),l(F,{title:"Settings"},{navigation:h((()=>[c(Ks)])),default:h((()=>[v("div",An,[c(M,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("API settings")])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[_n,c(u,{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t)},null,8,["modelValue"])])])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(x,{href:"https://rapidapi.com/Attacler/api/text-to-anything",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(w,{name:"open_in_new"}),g(" Get RapidAPI token ")])),_:1})])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[Sn,c(u,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=t=>n.value=t)},null,8,["modelValue"])])])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(x,{href:"https://rapidapi.com/Attacler/api/virusscan-texttoanything/",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(w,{name:"open_in_new"}),g(" Get RapidAPI virusscanner token ")])),_:1})])),_:1}),c(_,{class:"action-buttons"},{default:h((()=>[c(x,{onClick:C,disabled:"apikeys"==b.value,id:"save-button"},{default:h((()=>["apikeys"!=b.value?(o(),p(k,{key:0},[g(" Save ")],64)):(o(),l(A,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1}),c(M,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("Virusscanner settings")])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[c(P,{modelValue:a.value,"onUpdate:modelValue":e[2]||(e[2]=t=>a.value=t),value:!1},{default:h((()=>[g(" Automatic scanning ")])),_:1},8,["modelValue"])])])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[v("div",Tn,[g(" Mode "),c(R,null,{default:h((({hover:t})=>[c(D,{name:"info"}),t?(o(),l(I,{key:0,class:"info-popup"},{default:h((()=>[kn])),_:1})):d("v-if",!0)])),_:1})]),c(L,{modelValue:f.value,"onUpdate:modelValue":e[3]||(e[3]=t=>f.value=t),items:[{text:"Delete threats",value:"delete"},{text:"Trigger flow",value:"flow"}]},null,8,["modelValue"])]),"flow"==f.value?(o(),p("div",Cn,[v("div",En,[g(" Flow "),c(R,null,{default:h((({hover:t})=>[c(D,{name:"info"}),t?(o(),l(I,{key:0,class:"info-popup"},{default:h((()=>[g(" This flow will be triggered once a virus has been detected. ")])),_:1})):d("v-if",!0)])),_:1})]),c(L,{items:T(S),showDeselect:"",modelValue:m.value,"onUpdate:modelValue":e[4]||(e[4]=t=>m.value=t)},null,8,["items","modelValue"])])):d("v-if",!0)])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(wn)])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(x,{href:"https://texttoanything.nl/docs/directus/virusscanner",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(w,{name:"open_in_new"}),g(" Virusscanner documentation ")])),_:1})])),_:1}),c(_,{class:"action-buttons"},{default:h((()=>[c(x,{onClick:E,disabled:"virus"==b.value,id:"save-button"},{default:h((()=>["virus"!=b.value?(o(),p(k,{key:0},[g(" Save ")],64)):(o(),l(A,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1})])])),_:1})}}});sn("\n.w-full[data-v-7f9dbb3b] {\n width: 100%;\n}\n.cards-wrapper[data-v-7f9dbb3b] {\n padding: 0 2.5rem;\n display: flex;\n flex-wrap: wrap;\n gap: 2.5rem;\n}\n.fields-spacing[data-v-7f9dbb3b] {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n#save-button[data-v-7f9dbb3b] {\n margin-left: auto;\n}\n.info-parent[data-v-7f9dbb3b] {\n position: relative;\n display: flex;\n gap: 5px;\n}\n.info-parent .info-popup[data-v-7f9dbb3b] {\n position: absolute;\n top: 25px;\n left: 0;\n z-index: 10;\n}\n",{}),Mn.__scopeId="data-v-7f9dbb3b",Mn.__file="settingsmodule/src/pages/settings.vue";var Pn=b({__name:"dateTimePicker",props:{value:{type:[String,null],required:!0}},setup(t,{emit:e}){const i=t,s=u(),n=u(i.value);const a=y((()=>function(t){const e=new Date(t||-1);return e instanceof Date&&!isNaN(e.getTime())&&1970!=e.getFullYear()}(null==n?void 0:n.value)));return w((()=>n.value),(()=>{a.value&&(console.log(" Updating with",n.value),e("update:modelValue",n.value))})),(t,e)=>{const i=r("v-input"),l=r("v-date-picker"),d=r("v-menu");return o(),p("div",null,[c(d,{ref_key:"dateTimeMenu",ref:s,"close-on-content-click":!1,attached:"","full-height":"",seamless:""},{activator:h((({toggle:t,active:e})=>[c(i,{active:e,clickable:"",readonly:"",placeholder:T(a)?void 0:n.value,onClick:t},M({_:2},[T(a)?{name:"prepend",fn:h((()=>[g(_(n.value),1)])),key:"0"}:void 0]),1032,["active","placeholder","onClick"])])),default:h((()=>{var t;return[c(l,{type:"date","use-24":!0,"include-seconds":!1,"model-value":n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),onClose:null==(t=s.value)?void 0:t.deactivate},null,8,["model-value","onClose"])]})),_:1},512)])}}});sn("\n.v-icon.today-icon[data-v-42405105]:hover,\n.v-icon.today-icon.active[data-v-42405105] {\n --v-icon-color: var(--theme--primary);\n}\n.v-icon.clear-icon[data-v-42405105]:hover,\n.v-icon.clear-icon.active[data-v-42405105] {\n --v-icon-color: var(--theme--danger);\n}\n",{}),Pn.__scopeId="data-v-42405105",Pn.__file="settingsmodule/src/components/dateTimePicker.vue";var Dn={d:(t,e)=>{for(var i in e)Dn.o(e,i)&&!Dn.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},In={};function Rn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}function Ln(t,e){if(t){if("string"==typeof t)return Rn(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Rn(t,e):void 0}}function Fn(t){return function(t){if(Array.isArray(t))return Rn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ln(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nn(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Dn.d(In,{Z:()=>ta});const On=(Vn={computed:()=>a.computed,createTextVNode:()=>a.createTextVNode,createVNode:()=>a.createVNode,defineComponent:()=>a.defineComponent,reactive:()=>a.reactive,ref:()=>a.ref,watch:()=>a.watch,watchEffect:()=>a.watchEffect},Hn={},Dn.d(Hn,Vn),Hn),Bn=(0,On.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var t=this.data,e=this.onClick;return(0,On.createVNode)("span",{class:"vjs-tree-brackets",onClick:e},[t])}}),zn=(0,On.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(t,e){var i=e.emit;return{uiType:(0,On.computed)((function(){return t.isMultiple?"checkbox":"radio"})),model:(0,On.computed)({get:function(){return t.checked},set:function(t){return i("update:modelValue",t)}})}},render:function(){var t=this.uiType,e=this.model,i=this.$emit;return(0,On.createVNode)("label",{class:["vjs-check-controller",e?"is-checked":""],onClick:function(t){return t.stopPropagation()}},[(0,On.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(t)},null),(0,On.createVNode)("input",{checked:e,class:"vjs-check-controller-original is-".concat(t),type:t,onChange:function(){return i("change",e)}},null)])}}),jn=(0,On.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var t=this.nodeType,e=this.onClick,i="objectStart"===t||"arrayStart"===t;return i||"objectCollapsed"===t||"arrayCollapsed"===t?(0,On.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(i?"open":"close"),onClick:e},[(0,On.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,On.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var Vn,Hn;function $n(t){return $n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$n(t)}function Un(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Gn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=(arguments.length>3?arguments[3]:void 0)||{},n=s.key,a=s.index,r=s.type,o=void 0===r?"content":r,l=s.showComma,h=void 0!==l&&l,c=s.length,d=void 0===c?1:c,u=Un(t);if("array"===u){var p=qn(t.map((function(t,s,n){return Gn(t,"".concat(e,"[").concat(s,"]"),i+1,{index:s,showComma:s!==n.length-1,length:d,type:o})})));return[Gn("[",e,i,{showComma:!1,key:n,length:t.length,type:"arrayStart"})[0]].concat(p,Gn("]",e,i,{showComma:h,length:t.length,type:"arrayEnd"})[0])}if("object"===u){var g=Object.keys(t),f=qn(g.map((function(s,n,a){return Gn(t[s],/^[a-zA-Z_]\w*$/.test(s)?"".concat(e,".").concat(s):"".concat(e,'["').concat(s,'"]'),i+1,{key:s,showComma:n!==a.length-1,length:d,type:o})})));return[Gn("{",e,i,{showComma:!1,key:n,index:a,length:g.length,type:"objectStart"})[0]].concat(f,Gn("}",e,i,{showComma:h,length:g.length,type:"objectEnd"})[0])}return[{content:t,level:i,key:n,index:a,path:e,showComma:h,length:d,type:o}]}function qn(t){if("function"==typeof Array.prototype.flat)return t.flat();for(var e=Fn(t),i=[];e.length;){var s=e.shift();Array.isArray(s)?e.unshift.apply(e,Fn(s)):i.push(s)}return i}function Wn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null==t)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if("object"!==$n(t))return t;if(e.get(t))return e.get(t);if(Array.isArray(t)){var i=t.map((function(t){return Wn(t,e)}));return e.set(t,i),i}var s={};for(var n in t)s[n]=Wn(t[n],e);return e.set(t,s),s}function Kn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function Xn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Kn(Object(i),!0).forEach((function(e){Nn(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Kn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Yn={showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const Qn=(0,On.defineComponent)({name:"TreeNode",props:Xn(Xn({},Yn),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(t,e){var i=e.emit,s=(0,On.computed)((function(){return Un(t.node.content)})),n=(0,On.computed)((function(){return"vjs-value vjs-value-".concat(s.value)})),a=(0,On.computed)((function(){return t.showDoubleQuotes?'"'.concat(t.node.key,'"'):t.node.key})),r=(0,On.computed)((function(){return"multiple"===t.selectableType})),o=(0,On.computed)((function(){return"single"===t.selectableType})),l=(0,On.computed)((function(){return t.nodeSelectable(t.node)&&(r.value||o.value)})),h=(0,On.reactive)({editing:!1}),c=function(e){var s,n,a="null"===(n=null===(s=e.target)||void 0===s?void 0:s.value)?null:"undefined"===n?void 0:"true"===n||"false"!==n&&(n[0]+n[n.length-1]==='""'||n[0]+n[n.length-1]==="''"?n.slice(1,-1):"number"==typeof Number(n)&&!isNaN(Number(n))||"NaN"===n?Number(n):n);i("valueChange",a,t.node.path)},d=(0,On.computed)((function(){var e,i=null===(e=t.node)||void 0===e?void 0:e.content;return null===i?i="null":void 0===i&&(i="undefined"),"string"===s.value?'"'.concat(i,'"'):i+""})),u=function(){var e=t.renderNodeValue;return e?e({node:t.node,defaultValue:d.value}):d.value},p=function(){i("bracketsClick",!t.collapsed,t.node)},g=function(){i("iconClick",!t.collapsed,t.node)},f=function(){i("selectedChange",t.node)},m=function(){i("nodeClick",t.node),l.value&&t.selectOnClickNode&&i("selectedChange",t.node)},v=function(e){if(t.editable&&!h.editing){h.editing=!0;var i=function t(i){var s;i.target!==e.target&&(null===(s=i.target)||void 0===s?void 0:s.parentElement)!==e.target&&(h.editing=!1,document.removeEventListener("click",t))};document.removeEventListener("click",i),document.addEventListener("click",i)}};return function(){var e,i=t.node;return(0,On.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":t.showSelectController,"has-carets":t.showIcon,"is-highlight":t.highlightSelectedNode&&t.checked,dark:"dark"===t.theme},onClick:m,style:t.style},[t.showLineNumber&&(0,On.createVNode)("span",{class:"vjs-node-index"},[i.id+1]),t.showSelectController&&l.value&&"objectEnd"!==i.type&&"arrayEnd"!==i.type&&(0,On.createVNode)(zn,{isMultiple:r.value,checked:t.checked,onChange:f},null),(0,On.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(i.level)).map((function(e,i){return(0,On.createVNode)("div",{key:i,class:{"vjs-indent-unit":!0,"has-line":t.showLine}},null)})),t.showIcon&&(0,On.createVNode)(jn,{nodeType:i.type,onClick:g},null)]),i.key&&(0,On.createVNode)("span",{class:"vjs-key"},[(e=t.renderNodeKey,e?e({node:t.node,defaultKey:a.value||""}):a.value),(0,On.createVNode)("span",{class:"vjs-colon"},[":".concat(t.showKeyValueSpace?" ":"")])]),(0,On.createVNode)("span",null,["content"!==i.type&&i.content?(0,On.createVNode)(Bn,{data:i.content.toString(),onClick:p},null):(0,On.createVNode)("span",{class:n.value,onClick:!t.editable||t.editableTrigger&&"click"!==t.editableTrigger?void 0:v,onDblclick:t.editable&&"dblclick"===t.editableTrigger?v:void 0},[t.editable&&h.editing?(0,On.createVNode)("input",{value:d.value,onChange:c,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):u()]),i.showComma&&(0,On.createVNode)("span",null,[","]),t.showLength&&t.collapsed&&(0,On.createVNode)("span",{class:"vjs-comment"},[(0,On.createTextVNode)(" // "),i.length,(0,On.createTextVNode)(" items ")])])])}}});function Jn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function Zn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(i),!0).forEach((function(e){Nn(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Jn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}const ta=(0,On.defineComponent)({name:"Tree",props:Zn(Zn({},Yn),{},{data:{type:[String,Number,Boolean,Array,Object],default:null},collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},rootPath:{type:String,default:"root"},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue"],emits:["nodeClick","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(t,e){var i=e.emit,s=e.slots,n=(0,On.ref)(),a=(0,On.computed)((function(){return Gn(t.data,t.rootPath)})),r=function(e,i){return a.value.reduce((function(s,n){var a,r=n.level>=e||n.length>=i,o=null===(a=t.pathCollapsible)||void 0===a?void 0:a.call(t,n);return"objectStart"!==n.type&&"arrayStart"!==n.type||!r&&!o?s:Zn(Zn({},s),{},Nn({},n.path,1))}),{})},o=(0,On.reactive)({translateY:0,visibleData:null,hiddenPaths:r(t.deep,t.collapsedNodeLength)}),l=(0,On.computed)((function(){for(var t=null,e=[],i=a.value.length,s=0;s<i;s++){var n=Zn(Zn({},a.value[s]),{},{id:s}),r=o.hiddenPaths[n.path];if(t&&t.path===n.path){var l="objectStart"===t.type,h=Zn(Zn(Zn({},n),t),{},{showComma:n.showComma,content:l?"{...}":"[...]",type:l?"objectCollapsed":"arrayCollapsed"});t=null,e.push(h)}else{if(r&&!t){t=n;continue}if(t)continue;e.push(n)}}return e})),h=(0,On.computed)((function(){var e=t.selectedValue;return e&&"multiple"===t.selectableType&&Array.isArray(e)?e:[e]})),c=(0,On.computed)((function(){return!t.selectableType||t.selectOnClickNode||t.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."})),d=function(){var e=l.value;if(t.virtual){var i,s=t.height/t.itemHeight,a=(null===(i=n.value)||void 0===i?void 0:i.scrollTop)||0,r=Math.floor(a/t.itemHeight),h=r<0?0:r+s>e.length?e.length-s:r;h<0&&(h=0);var c=h+s;o.translateY=h*t.itemHeight,o.visibleData=e.filter((function(t,e){return e>=h&&e<c}))}else o.visibleData=e},u=function(){d()},p=function(e){var s,n=e.path,a=t.selectableType;if("multiple"===a){var r=h.value.findIndex((function(t){return t===n})),o=Fn(h.value);-1!==r?o.splice(r,1):o.push(n),i("update:selectedValue",o),i("selectedChange",o,Fn(h.value))}else if("single"===a&&h.value[0]!==n){var l=(s=h.value,function(t){if(Array.isArray(t))return t}(s)||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,s,n=[],a=!0,r=!1;try{for(e=e.call(t);!(a=(i=e.next()).done)&&(n.push(i.value),1!==n.length);a=!0);}catch(t){r=!0,s=t}finally{try{a||null==e.return||e.return()}finally{if(r)throw s}}return n}}(s)||Ln(s,1)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],c=n;i("update:selectedValue",c),i("selectedChange",c,l)}},g=function(t){i("nodeClick",t)},f=function(t,e){if(t)o.hiddenPaths=Zn(Zn({},o.hiddenPaths),{},Nn({},e,1));else{var i=Zn({},o.hiddenPaths);delete i[e],o.hiddenPaths=i}},m=function(e,s){t.collapsedOnClickBrackets&&f(e,s.path),i("bracketsClick",e,s)},v=function(t,e){f(t,e.path),i("iconClick",t,e)},b=function(e,s){var n=Wn(t.data),a=t.rootPath;new Function("data","val","data".concat(s.slice(a.length),"=val"))(n,e),i("update:data",n)};return(0,On.watchEffect)((function(){c.value&&function(t){throw new Error("[VueJSONPretty] ".concat(t))}(c.value)})),(0,On.watchEffect)((function(){l.value&&d()})),(0,On.watch)((function(){return t.deep}),(function(e){e&&(o.hiddenPaths=r(e,t.collapsedNodeLength))})),(0,On.watch)((function(){return t.collapsedNodeLength}),(function(e){e&&(o.hiddenPaths=r(t.deep,e))})),function(){var e,i,r=null!==(e=t.renderNodeKey)&&void 0!==e?e:s.renderNodeKey,c=null!==(i=t.renderNodeValue)&&void 0!==i?i:s.renderNodeValue,d=o.visibleData&&o.visibleData.map((function(e){return(0,On.createVNode)(Qn,{key:e.id,node:e,collapsed:!!o.hiddenPaths[e.path],theme:t.theme,showDoubleQuotes:t.showDoubleQuotes,showLength:t.showLength,checked:h.value.includes(e.path),selectableType:t.selectableType,showLine:t.showLine,showLineNumber:t.showLineNumber,showSelectController:t.showSelectController,selectOnClickNode:t.selectOnClickNode,nodeSelectable:t.nodeSelectable,highlightSelectedNode:t.highlightSelectedNode,editable:t.editable,editableTrigger:t.editableTrigger,showIcon:t.showIcon,showKeyValueSpace:t.showKeyValueSpace,renderNodeKey:r,renderNodeValue:c,onNodeClick:g,onBracketsClick:m,onIconClick:v,onSelectedChange:p,onValueChange:b,style:t.itemHeight&&20!==t.itemHeight?{lineHeight:"".concat(t.itemHeight,"px")}:{}},null)}));return(0,On.createVNode)("div",{ref:n,class:{"vjs-tree":!0,"is-virtual":t.virtual,dark:"dark"===t.theme},onScroll:t.virtual?u:void 0,style:t.showLineNumber?Zn({paddingLeft:"".concat(12*Number(a.value.length.toString().length),"px")},t.style):t.style},[t.virtual?(0,On.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(t.height,"px")}},[(0,On.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(l.value.length*t.itemHeight,"px")}},[(0,On.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(o.translateY,"px)")}},[d])])]):d])}}});var ea=In.Z;sn('.vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit{width:1em}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-value{word-break:break-word}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}',{});const ia=t=>(f("data-v-2ded8f93"),t=t(),m(),t),sa={class:"content"},na=ia((()=>v("div",{class:"header"},[v("span",{class:"dot success"}),v("span",{class:"type-label"}," Trigger ")],-1))),aa={class:"inset"},ra={class:"steps"},oa={class:"header"},la={class:"type-label"},ha={class:"subdued"},ca={class:"inset"};var da=b({__name:"displayFlowLogs",props:{currentLog:{type:null,required:!0}},setup(t,{emit:e}){const{currentLog:i}=t,s=u(""),n=y((()=>{const{data:t}=i;if(!t)return[];return((null==t?void 0:t.steps)||[]).map((e=>({...e,status:"resolve"===e.status?"success":"error",operationType:e.operationType||"",options:e.options?e.options:null,data:t.data[e.key]?t.data[e.key]:null})))}));function a(t,e){console.log(i),s.value=t+e.path.substring(4)}function f(){navigator.clipboard.writeText(s.value)}return(i,u)=>{const m=r("v-icon"),b=r("v-button"),y=r("v-detail"),w=r("v-drawer"),x=P("tooltip");return o(),l(w,{modelValue:!0,title:"Flow log",icon:"fact_check",onEsc:u[1]||(u[1]=t=>e("close")),onCancel:u[2]||(u[2]=t=>e("close"))},{actions:h((()=>[s.value?(o(),l(b,{key:0,class:"ml-auto",onClick:f},{default:h((()=>[g(_(s.value)+" ",1),c(m,{name:"copy_all"})])),_:1})):d("v-if",!0)])),default:h((()=>[v("div",sa,[na,v("div",aa,[c(y,{label:"Payload",class:"payload"},{default:h((()=>[c(T(ea),{data:t.currentLog.data.data.$trigger,virtual:"",onNodeClick:u[0]||(u[0]=t=>a("$trigger",t)),selectableType:"single"},null,8,["data"])])),_:1})]),v("div",ra,[(o(!0),p(k,null,D(T(n),(t=>(o(),p("div",{key:t.id,class:"step"},[v("div",oa,[v("span",{class:I(["dot",t.status])},null,2),R((o(),p("span",la,[g(_(t.key)+" ",1),v("span",ha," "+_(t.operationType),1)])),[[x,t.key]])]),v("div",ca,[t.options?(o(),l(y,{key:0,label:"Options"},{default:h((()=>[c(T(ea),{data:t.options,virtual:""},null,8,["data"])])),_:2},1024)):d("v-if",!0),null!==t.data?(o(),l(y,{key:1,label:"Payload",class:"payload"},{default:h((()=>[c(T(ea),{data:t.data,virtual:"",onNodeClick:e=>a(t.key,e),selectableType:"single"},null,8,["data","onNodeClick"])])),_:2},1024)):d("v-if",!0)])])))),128))])])])),_:1})}}});sn("\n.content[data-v-2ded8f93] {\n padding: 1rem;\n}\n.header[data-v-2ded8f93] {\n font-size: 1.2rem;\n font-weight: bold;\n}\n.dot[data-v-2ded8f93] {\n width: 0.75rem;\n height: 0.75rem;\n border-radius: 50%;\n margin-right: 0.5rem;\n display: inline-block;\n}\n.dot.success[data-v-2ded8f93] {\n background-color: var(--primary);\n}\n.dot.error[data-v-2ded8f93] {\n background-color: var(--red);\n}\n.step[data-v-2ded8f93] {\n margin: 0.5rem 0;\n position: relative;\n}\n.inset[data-v-2ded8f93] {\n border-left: var(--theme--border-width) solid\n var(--theme--border-color-subdued);\n margin-left: 0.35rem;\n padding-top: 5px;\n padding-left: 1rem;\n margin-top: -5px;\n}\n",{});sn("\n.payload .vjs-value,\n.payload .vjs-key {\n cursor: pointer;\n}\n",{}),da.__scopeId="data-v-2ded8f93",da.__file="settingsmodule/src/components/displayFlowLogs.vue";const ua=t=>(f("data-v-231dc418"),t=t(),m(),t),pa={class:"px-5 w-full"},ga=["title"],fa=["title"],ma={class:"filters"},va=ua((()=>v("h2",null,"Filter",-1))),ba=ua((()=>v("div",{class:"field-name"},"Flow",-1))),ya=ua((()=>v("div",{class:"field-name"},"From date",-1))),wa=ua((()=>v("div",{class:"field-name"},"To date",-1))),xa=ua((()=>v("div",{class:"field-name"},"Sorting order",-1)));var Aa=b({__name:"flowLogsExplorer",setup(t){const{useFlowsStore:s}=e(),n=i(),a=s(),p=u(),f=u([]),m=u(),b=u(),w=u(""),x=u("all"),S=u(),k=u("Descending");async function C(){const t=await n.get("/revisions",{params:{"filter[_and][0][collection][_eq]":"directus_flows","filter[_and][1][item][_eq]":p.value||void 0,"filter[_and][2][version][_null]":!0,"filter[_and][3][activity][action][_eq]":"run","filter[_and][4][activity][timestamp][_gte]":m.value?m.value:void 0,"filter[_and][4][activity][timestamp][_lte]":b.value?b.value+"T23:59:59":void 0,"fields[0]":"*","fields[1]":"activity.*",limit:2e3,sort:"Descending"==k.value?["-activity.timestamp"]:["activity.timestamp"]}});f.value=t.data.data}A((()=>{const t=new Date;t.setDate(t.getDate()-7),m.value=t.toISOString().split("T")[0],b.value=(new Date).toISOString().split("T")[0]}));const E=y((()=>{if(!w.value&&"all"==x.value)return f.value;let t=f.value;return"all"!=x.value&&(t=t.filter((t=>t.data.steps[t.data.steps.length-1].status==("error"==x.value?"reject":"resolve")))),w.value&&(t=f.value.filter((t=>{const e=t.data.data.$trigger;return JSON.stringify(e).toLowerCase().includes(w.value.toLowerCase())}))),t})),M=y((()=>a.flows.map((t=>({text:t.name,value:t.id})))));function P(t){var e;if(0==t.data.steps.length)return"";const i=null==(e=t.data.steps[t.data.steps.length-1])?void 0:e.key;return i?t.data.data[i]:""}function D(t){S.value=t.item}function R(t){if(0==t.data.steps.length)return!1;return"resolve"!=t.data.steps[t.data.steps.length-1].status}return(t,e)=>{const i=r("v-icon"),s=r("v-table"),n=r("v-select"),a=r("v-button"),u=r("v-input"),f=r("VSelect"),y=r("private-view");return o(),l(y,{title:"Flow logs explorer"},{navigation:h((()=>[c(Ks)])),sidebar:h((()=>[v("div",ma,[va,v("div",null,[ba,c(n,{items:T(M),showDeselect:"",modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=t=>p.value=t)},null,8,["items","modelValue"])]),v("div",null,[ya,m.value?(o(),l(Pn,{key:0,modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=t=>m.value=t),value:m.value},null,8,["modelValue","value"])):d("v-if",!0)]),v("div",null,[wa,b.value?(o(),l(Pn,{key:0,modelValue:b.value,"onUpdate:modelValue":e[2]||(e[2]=t=>b.value=t),value:b.value},null,8,["modelValue","value"])):d("v-if",!0)]),v("div",null,[xa,c(n,{modelValue:k.value,"onUpdate:modelValue":e[3]||(e[3]=t=>k.value=t),items:["Descending","Ascending"]},null,8,["modelValue"])]),c(a,{onClick:C,fullWidth:!0},{default:h((()=>[g("Search")])),_:1}),v("div",null,[g(" Input filter "),c(u,{modelValue:w.value,"onUpdate:modelValue":e[4]||(e[4]=t=>w.value=t),placeholder:"Input filter",class:"w-full"},null,8,["modelValue"])]),v("div",null,[g(" Status "),c(f,{modelValue:x.value,"onUpdate:modelValue":e[5]||(e[5]=t=>x.value=t),items:[{text:"All",value:"all"},{text:"Error",value:"error"},{text:"Success",value:"success"}]},null,8,["modelValue"])])]),S.value?(o(),l(da,{key:0,onClose:e[6]||(e[6]=t=>S.value=null),currentLog:S.value},null,8,["currentLog"])):d("v-if",!0)])),default:h((()=>[v("div",pa,[c(s,{headers:[{text:"Status",value:"status",sortable:!1,width:100},{text:"Timestamp",value:"timestamp",sortable:!1,width:100},{text:"Input",value:"input",sortable:!1,width:1e3},{text:"Output",value:"output",sortable:!1,width:1e3}],items:T(E),"onClick:row":D},{"item.status":h((({item:t})=>[c(i,{name:R(t)?"error":"check_circle",class:I(["flowLogStatus",{error:R(t),success:!R(t)}])},null,8,["name","class"])])),"item.timestamp":h((({item:t})=>[g(_(new Date(t.activity.timestamp).toLocaleDateString()),1)])),"item.input":h((({item:t})=>[v("div",{title:JSON.stringify(t.data.data.$trigger,null,2)},_(t.data.data.$trigger),9,ga)])),"item.output":h((({item:t})=>[v("div",{title:JSON.stringify(P(t),null,2)},_(P(t)),9,fa)])),_:1},8,["items"])])])),_:1})}}});sn("\n.w-full[data-v-231dc418] {\n width: 100%;\n}\n.px-5[data-v-231dc418] {\n padding: 0 2.5rem;\n}\n.date-input[data-v-231dc418] {\n min-width: 300px;\n}\n.filters[data-v-231dc418] {\n padding: 10px 5px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.filters h2[data-v-231dc418] {\n font-size: 1.5rem;\n font-weight: bold;\n}\n.grow[data-v-231dc418],\n.grow button[data-v-231dc418] {\n flex-grow: 1;\n}\n.flowLogStatus.success[data-v-231dc418] {\n color: var(--primary);\n}\n.flowLogStatus.error[data-v-231dc418] {\n color: var(--red);\n}\n",{}),Aa.__scopeId="data-v-231dc418",Aa.__file="settingsmodule/src/pages/flowLogsExplorer.vue";var _a=s({id:"tta_settings",name:"Text to anything settings",icon:"text_fields",routes:[{path:"",redirect:"/tta_settings/templates"},{path:"templates",component:yn},{path:"settings",component:Mn},{path:"flowsLogExplorer",component:Aa}]}),Sa=b({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=L("api"),n=u(0),a=u([]);return A((async()=>{w((()=>n.value),((t,i)=>{t!=i&&e("input",t)}));const t=await s.get("/tta/pdf/onlineTemplates");a.value=t.data.map((t=>({text:t.name,value:t.id}))),t.data.find((t=>t.id==i.value))?n.value=parseInt(i.value):n.value=null})),(t,e)=>{const i=r("v-select");return o(),l(i,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),items:a.value},null,8,["modelValue","items"])}}});Sa.__file="pdf/PDFOnlineTemplateSelector/src/interface.vue";var Ta=n({id:"TTA-pdf-online-template-selector",name:"PDF online template selector",icon:"picture_as_pdf",description:"Selector for an online PDF template for Text To Anything",component:Sa,options:null,types:["string"]}),ka=b({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=L("api"),n=u(""),a=u([]);return A((async()=>{w((()=>n.value),((t,i)=>{t!=i&&e("input",t)}));const t=await s.get("/items/TTA_htmltemplates");a.value=t.data.data.map((t=>({text:t.name,value:t.id}))),n.value=i.value})),(t,e)=>{const i=r("v-select");return o(),l(i,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),items:a.value},null,8,["modelValue","items"])}}});ka.__file="pdf/PDFTemplateSelector/src/interface.vue";var Ca=n({id:"TTA-pdf-template-selector",name:"PDF template selector",icon:"picture_as_pdf",description:"Selector for a PDF template for Text To Anything",component:ka,options:null,types:["string"]}),Ea=b({__name:"interface",props:{label:{type:String,required:!0},flow:{type:null,required:!0},primaryKey:{type:null,required:!0}},setup(t){const e=t,s=i(),n=u(!1);async function a(){n.value=!0;try{const t=await s.post("/flows/trigger/"+e.flow,{id:e.primaryKey});window.open("/assets/"+t.data,"_blank")}catch(t){}n.value=!1}return(t,i)=>{const s=r("v-button");return o(),l(s,{onClick:a,loading:n.value,disabled:n.value},{default:h((()=>[g(_(e.label),1)])),_:1},8,["loading","disabled"])}}});Ea.__file="pdf/GeneratePDFFromTemplateInterface/src/interface.vue";var Ma=n({id:"tta-download-interface",name:"Download interface",icon:"sim_card_download",description:"Download files based on a flow. (Text to anything)",hideLabel:!0,hideLoader:!0,component:Ea,options:()=>{const{useFlowsStore:t}=e(),i=t();return[{field:"label",type:"string",name:"$t:label",meta:{width:"full",interface:"system-input-translated-string",options:{placeholder:"$t:label"}}},{field:"flow",name:"$t:operations.trigger.flow",type:"string",meta:{width:"full",interface:"select-dropdown",options:{choices:y((()=>i.flows.filter((t=>"webhook"===t.trigger&&"POST"==t.options.method)).map((t=>({text:t.name,value:t.id}))))),iconRight:"bolt",placeholder:"$t:a_flow_uuid"}}}]},types:["string"]});
|
|
1
|
+
import{defineOperationApp as t,useStores as e,useApi as i,defineModule as s,defineInterface as n}from"@directus/extensions-sdk";import*as a from"vue";import{resolveComponent as r,openBlock as o,createBlock as l,withCtx as h,createVNode as c,createCommentVNode as d,ref as u,createElementBlock as p,createTextVNode as g,pushScopeId as f,popScopeId as m,createElementVNode as v,defineComponent as b,computed as y,watch as w,nextTick as x,onMounted as A,toDisplayString as _,normalizeStyle as S,unref as T,Fragment as k,resolveDynamicComponent as C,withModifiers as E,createSlots as M,resolveDirective as P,renderList as D,normalizeClass as I,withDirectives as R,inject as L,onBeforeUnmount as F,reactive as N,onUnmounted as O,Teleport as B,renderSlot as z}from"vue";var j=t({id:"ttabarcode",name:"TTA generate barcode",icon:"barcode",description:"Generate a barcode trough Text to anything!",overview:({barcodeContent:t})=>[{label:"barcode content",text:t}],options:[{field:"barcodeContent",name:"content",type:"string",meta:{width:"full",interface:"input"}},{field:"barcodeType",name:"type",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:["auspost","azteccode","azteccodecompact","aztecrune","bc412","channelcode","codablockf","code11","code128","code16k","code2of5","code32","code39","code39ext","code49","code93","code93ext","codeone","coop2of5","daft","databarexpanded","databarexpandedcomposite","databarexpandedstacked","databarexpandedstackedcomposite","databarlimited","databarlimitedcomposite","databaromni","databaromnicomposite","databarstacked","databarstackedcomposite","databarstackedomni","databarstackedomnicomposite","databartruncated","databartruncatedcomposite","datalogic2of5","datamatrix","datamatrixrectangular","datamatrixrectangularextension","dotcode","ean13","ean13composite","ean14","ean2","ean5","ean8","ean8composite","flattermarken","gs1-128","gs1-128composite","gs1-cc","gs1datamatrix","gs1datamatrixrectangular","gs1dldatamatrix","gs1dlqrcode","gs1dotcode","gs1northamericancoupon","gs1qrcode","hanxin","hibcazteccode","hibccodablockf","hibccode128","hibccode39","hibcdatamatrix","hibcdatamatrixrectangular","hibcmicropdf417","hibcpdf417","hibcqrcode","iata2of5","identcode","industrial2of5","interleaved2of5","isbn","ismn","issn","itf14","japanpost","kix","leitcode","mailmark","mands","matrix2of5","maxicode","micropdf417","microqrcode","msi","onecode","pdf417","pdf417compact","pharmacode","pharmacode2","planet","plessey","posicode","postnet","pzn","qrcode","rationalizedCodabar","raw","rectangularmicroqrcode","royalmail","sscc18","swissqrcode","symbol","telepen","telepennumeric","ultracode","upca","upcacomposite","upce","upcecomposite"].map((t=>({text:t,value:t})))}}},{field:"scale",name:"scale",type:"number",meta:{width:"full",interface:"input"}},{field:"height",name:"height",type:"number",meta:{width:"full",interface:"input"}},{field:"includetext",name:"include text",type:"boolean",meta:{width:"full",interface:"boolean"}}]}),V=t({id:"ttapdf",name:"TTA generate PDF",icon:"picture_as_pdf",description:"Generate a PDF trough Text to anything!",overview:({filename:t})=>[{label:"File name",text:t}],options:[{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"pdfoptions",name:"Options",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json",placeholder:JSON.stringify({html:"<h1>Hello world!</h1>",format:"A4",landscape:!1,margin:10,marginRight:5,marginLeft:5},null,2),template:JSON.stringify({html:"<h1>Hello world!</h1>",format:"A4",landscape:!1,margin:10,marginRight:5,marginLeft:5},null,2)}}}]}),H=t({id:"ttapdftemplate",name:"TTA generate PDF from template",icon:"picture_as_pdf",description:"Generate a PDF based on a template trough Text to anything!",overview:({filename:t})=>[{label:"File name",text:t}],options:t=>[{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"mode",name:"Mode",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:[{value:"online",text:"Online"},{value:"offline",text:"Offline"}]}}},{field:"template",name:"Template",type:"string",meta:{interface:"online"==t.mode?"TTA-pdf-online-template-selector":"TTA-pdf-template-selector",options:{},note:"When selecting the online mode, you will be able to select a template from the TextToAnything dashboard. (https://app.texttoanything.nl)"}},{field:"templatevariables",name:"Template variables",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json"}}}]}),$=t({id:"ttaqrcode",name:"TTA generate QRcode",icon:"qr_code",description:"Generate a QRcode trough Text to anything!",overview:({content:t})=>[{label:"QRCode content",text:t}],options:[{field:"content",name:"QRCode content",type:"string",meta:{width:"full",interface:"input"}},{field:"lightColor",name:"Light color",type:"string",meta:{width:"full",interface:"select-color"}},{field:"darkColor",name:"Dark color",type:"string",meta:{width:"full",interface:"select-color"}},{field:"margin",name:"Margin",type:"integer",meta:{width:"half",interface:"input"}},{field:"width",name:"Width",type:"integer",meta:{width:"half",interface:"input"}}]});const U=String.raw`[A-Za-z][^/\s>]*`,G=String.raw`\B"(?:\\[^<>\n]|[^\\"<>\n])*"(?!\w)`,q=String.raw`\B'(?:\\[^<>\n]|[^\\'<>\n])*'(?!\w)`,W=String.raw`${G}|${q}`,K=String.raw`"(?<quotedAttrValue>[^"]*)"`,X=String.raw`'(?<singleQuotedAttrValue>[^']*)'`,Y=String.raw`(?<unquotedAttrValue>[^\s"'\`=<>]+)`,Q=String.raw`[^=\s>/"']+(?=[=>\s]|$)`,J=String.raw`${K}|${X}|${Y}`,Z=String.raw`(?<attrName>${Q})(?:\s*=\s*(?:${J}))?`,tt=String.raw`${W}|[^\s>]*[^\s>/]|[^\s>]*/(?!\s*>)`,et=String.raw`(?<attrSpace>\s*)(?:${Z}|(?<attrText>${tt}))`,it={comment:String.raw`<!--.*?-->`,dtd:String.raw`<![^>]+>`,startTag:String.raw`<(?<startTagName>${U})(?<attrs>(?:${et})*)\s*(?<closingSlash>/?)\s*>`,endTag:String.raw`</(?<endTagName>${U})\s*>`,space:String.raw`\s+`,text:String.raw`[^<\s"']+|${W}|['"]`,wildcard:String.raw`.`},st=Object.entries(it).map((([t,e])=>`(?<${t}>${e})`)).join("|");const nt=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]);function at(t,e=" ",i=80){const s=new RegExp(st,"gys"),n=new RegExp(et,"gy"),a=[];let r=null,o=0,l=0,h="",c=0,d="";const u=()=>{if(d&&"\n"!=d){const t=h.indexOf("\n"),e=-1==t?h.length:t;l+d.length+e>i&&(d="\n")}const t="\n"==d&&h?e.repeat(c):"",s=`${d}${t}${h}`;if(s){const t=s.lastIndexOf("\n");-1==t?l+=s.length:l=s.length-t-1,a.push(s)}h=d=""},p=(...t)=>{for(const e of t)!r&&/^\s+$/.test(e)?(u(),d=e):(h||(c=o),h+=e)};for(const e of function*(t,e){let i,{lastIndex:s}=t;for(;i=t.exec(e);)yield i,({lastIndex:s}=t);if(s!=e.length)throw new Error("Failed to parse string")}(s,t)){if(at.__strict&&e.groups.wildcard)throw new Error("Unexpected wildcard");if(e.groups.endTag){const t=e.groups.endTagName.toLowerCase();t==r&&(r=null),r||(--o,p(`</${t}>`))}if(r)p(e[0]);else if(e.groups.space)p(...e[0].match(/\n/g)?.slice(0,2)??[" "]);else if(e.groups.comment||e.groups.dtd||e.groups.text||e.groups.wildcard)p(e[0]);else if(e.groups.startTag){const t=e.groups.startTagName.toLowerCase();if(p(`<${t}`),++o,e.groups.attrs){let t,i,{lastIndex:s}=n;for(;t=n.exec(e.groups.attrs);){if(({lastIndex:s}=n),at.__strict&&t.groups.attrText)throw new Error("Unexpected attr text");t.groups.attrText?(t.groups.attrSpace&&p(/\n/.test(t.groups.attrSpace)?"\n":" "),p(t.groups.attrText)):(!t.groups.attrSpace&&i?.groups.attrText||p(/\n/.test(t.groups.attrSpace)?"\n":" "),p(`${t.groups.attrName}${t.groups.quotedAttrValue?`="${t.groups.quotedAttrValue}"`:t.groups.singleQuotedAttrValue?`='${t.groups.singleQuotedAttrValue}'`:t.groups.unquotedAttrValue?`=${t.groups.unquotedAttrValue}`:""}`)),i=t}if(s!=e.groups.attrs.length)throw new Error("Failed to parse attributes")}const i=Boolean(e.groups.closingSlash);p(i?" />":">"),i||nt.has(t)?--o:["pre","textarea","script","style"].includes(t)&&(r=t)}}u();let g=!1;for(;/^\s+$/.test(a[a.length-1]);){const t=a.pop();/\n/.test(t)&&(g=!0)}return g&&a.push("\n"),a.join("")}at.default=at;var rt=at;class ot{constructor(t,e,i,s,n){this.kind=t,this.input=e,this.begin=i,this.end=s,this.file=n}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let i=0;i<this.begin;i++)"\n"===this.input[i]?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}class lt{liquidMethodMissing(t){}}const ht=Object.prototype.toString,ct=String.prototype.toLowerCase,dt=Object.hasOwnProperty;function ut(t){return"string"==typeof t}function pt(t){return"function"==typeof t}function gt(t){return t&&pt(t.then)}function ft(t){return t&&pt(t.next)&&pt(t.throw)&&pt(t.return)}function mt(t){return ut(t=yt(t))?t:_t(t)?"":St(t)?t.map((t=>mt(t))).join(""):String(t)}function vt(t){return St(t=yt(t))?t:ut(t)&&t.length>0?[t]:Et(e=t)&&Symbol.iterator in e?Array.from(t):Et(t)?Object.keys(t).map((e=>[e,t[e]])):[];var e}function bt(t){return _t(t=yt(t))?[]:St(t)?t:[t]}function yt(t){return t instanceof lt&&pt(t.valueOf)?t.valueOf():t}function wt(t){return t=Number(t),isNaN(t)?0:t}function xt(t){return"number"==typeof t}function At(t){return t&&pt(t.toLiquid)?At(t.toLiquid()):t}function _t(t){return null==t}function St(t){return"[object Array]"===ht.call(t)}function Tt(t){return t&&xt(t.length)}function kt(t,e){t=t||{};for(const i in t)if(dt.call(t,i)&&!1===e(t[i],i,t))break;return t}function Ct(t){return t[t.length-1]}function Et(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Mt(t,e,i=1){const s=[];for(let n=t;n<e;n+=i)s.push(n);return s}function Pt(t,e,i=" "){return Dt(t,e,i,((t,e)=>e+t))}function Dt(t,e,i,s){let n=e-(t=String(t)).length;for(;n-- >0;)t=s(t,i);return t}function It(t){return t}function Rt(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=ct.call(t))<(e=ct.call(e))?-1:t>e?1:0}function Lt(t){return function(...e){return t.call(this,...e.map(yt))}}function Ft(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*Nt(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const Ot="__liquidClass__";class Bt extends Error{constructor(t,e){super("string"==typeof t?t:t.message),this.context="","string"!=typeof t&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,Ot,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:qt(this.token),enumerable:!1}),this.message=function(t,e){e.file&&(t+=`, file:${e.file}`);const[i,s]=e.getPosition();return t+=`, line:${i}, col:${s}`}(this.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)}static is(t){return"LiquidError"===(null==t?void 0:t[Ot])}}class zt extends Bt{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class jt extends Bt{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class Vt extends Bt{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class Ht extends Bt{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return"LiquidErrors"===t.name}}class $t extends Bt{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class Ut extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class Gt extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function qt(t){const[e,i]=t.getPosition(),s=t.input.split("\n"),n=Math.max(e-2,1),a=Math.min(e+3,s.length);return Mt(n,a+1).map((t=>{let n=`${t===e?">> ":" "}${Pt(String(t),String(a).length)}| `;const r=t===e?"\n"+Pt("^",i+n.length):"";return n+=s[t-1],n+=r,n})).join("\n")}const Wt=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function Kt(t){const e=t.charCodeAt(0);return e>=128?!Wt[e]:!!(1&Wt[e])}function Xt(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new Gt(i)}}function Yt(t,e=`unexpected ${JSON.stringify(t)}`){Xt(!t,e)}Wt[160]=Wt[5760]=Wt[6158]=Wt[8192]=Wt[8193]=Wt[8194]=Wt[8195]=Wt[8196]=Wt[8197]=Wt[8198]=Wt[8199]=Wt[8200]=Wt[8201]=Wt[8202]=Wt[8232]=Wt[8233]=Wt[8239]=Wt[8287]=Wt[12288]=4,Wt[8220]=Wt[8221]=128;class Qt extends lt{equals(t){return!(t instanceof Qt)&&(ut(t=yt(t))||St(t)?0===t.length:!!Et(t)&&0===Object.keys(t).length)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof Qt}}class Jt extends Qt{equals(t){return!1===t||(!!_t(yt(t))||(ut(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof Jt}}class Zt extends lt{constructor(t,e,i){super(),this.i=0,this.length=t,this.name=`${i}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return 0===this.i}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class te{constructor(){this.buffer=""}write(t){this.buffer+=mt(t)}}class ee{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class ie{constructor(){this.buffer=""}write(t){"string"!=typeof(t=yt(t))&&""===this.buffer?this.buffer=t:this.buffer=mt(this.buffer)+mt(t)}}class se extends lt{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new te;return yield this.superBlockRender(t),t.buffer}}function ne(t){return t&&pt(t.equals)&&pt(t.gt)&&pt(t.geq)&&pt(t.lt)&&pt(t.leq)}const ae=new class extends lt{equals(t){return _t(yt(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},re={true:!0,false:!1,nil:ae,null:ae,empty:new Qt,blank:new Jt};function oe(t){const e={};for(const[i,s]of Object.entries(t)){let t=e;for(let e=0;e<i.length;e++){const s=i[e];t[s]=t[s]||{},e===i.length-1&&Kt(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var le=function(){return le=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},le.apply(this,arguments)};function he(t,e,i,s){return new(i||(i=Promise))((function(n,a){function r(t){try{l(s.next(t))}catch(t){a(t)}}function o(t){try{l(s.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((s=s.apply(t,e||[])).next())}))}function ce(t){return he(this,void 0,void 0,(function*(){if(!ft(t))return t;let e,i=!1,s="next";do{const n=t[s](e);i=n.done,e=n.value,s="next";try{ft(e)&&(e=ce(e)),gt(e)&&(e=yield e)}catch(t){s="throw",e=t}}while(!i);return e}))}function de(t){if(!ft(t))return t;let e,i=!1,s="next";do{const n=t[s](e);if(i=n.done,e=n.value,s="next",ft(e))try{e=de(e)}catch(t){s="throw",e=t}}while(!i);return e}const ue=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function pe(t){const e=function(t){const e=t.getFullYear();return!(3&e||!(e%100||e%400==0&&e))}(t)?29:28;return[31,e,31,30,31,30,31,31,30,31,30,31]}function ge(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=pe(t)[i];return e+t.getDate()}function fe(t,e){const i=ge(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const me={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},ve=new Set("aAbBceklpP");function be(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),n=i%60;return(t.getTimezoneOffset()>0?"-":"+")+Pt(s,2,"0")+(e.flags[":"]?":":"")+Pt(n,2,"0")}const ye={a:t=>t.getShortWeekdayName(),A:t=>t.getLongWeekdayName(),b:t=>t.getShortMonthName(),B:t=>t.getLongMonthName(),c:t=>t.toLocaleString(),C:t=>function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t),d:t=>t.getDate(),e:t=>t.getDate(),H:t=>t.getHours(),I:t=>String(t.getHours()%12||12),j:t=>ge(t),k:t=>t.getHours(),l:t=>String(t.getHours()%12||12),L:t=>t.getMilliseconds(),m:t=>t.getMonth()+1,M:t=>t.getMinutes(),N:(t,e)=>{const i=Number(e.width)||9;return function(t,e,i=" "){return Dt(t,e,i,((t,e)=>t+e))}(String(t.getMilliseconds()).slice(0,i),i,"0")},p:t=>t.getHours()<12?"AM":"PM",P:t=>t.getHours()<12?"am":"pm",q:t=>function(t){const e=t.getDate();if([11,12,13].includes(e))return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(t),s:t=>Math.round(t.getTime()/1e3),S:t=>t.getSeconds(),u:t=>t.getDay()||7,U:t=>fe(t,0),w:t=>t.getDay(),W:t=>fe(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:be,Z:(t,e)=>t.getTimeZoneName()||be(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function we(t,e){let i,s="",n=e;for(;i=ue.exec(n);)s+=n.slice(0,i.index),n=n.slice(i.index+i[0].length),s+=xe(t,i);return s+n}function xe(t,e){const[i,s="",n,a,r]=e,o=ye[r];if(!o)return i;const l={};for(const t of s)l[t]=!0;let h=String(o(t,{flags:l,width:n,modifier:a})),c=ve.has(r)?" ":"0",d=n||me[r]||0;var u;return l["^"]?h=h.toUpperCase():l["#"]&&(u=h,h=[...u].some((t=>t>="a"&&t<="z"))?u.toUpperCase():u.toLowerCase()),l._?c=" ":l[0]&&(c="0"),l["-"]&&(d=0),Pt(h,d,c)}function Ae(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}ye.h=ye.b;const _e=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,Se=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=Se.map((t=>t.slice(0,3))),ke=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ce=ke.map((t=>t.slice(0,3)));class Ee{constructor(t,e,i){this.locale=e,this.DateTimeFormat=Ae(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=ut(i)?Ee.getTimezoneOffset(i,this.date):i,this.timezoneName=ut(i)?i:"";const s=6e4*(this.date.getTimezoneOffset()-this.timezoneOffset),n=this.date.getTime()+s;this.displayDate=new Date(n)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return(null==e?void 0:e.timeZone)?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){return this.timezoneFixed?this.timezoneName:this.DateTimeFormat?this.DateTimeFormat().resolvedOptions().timeZone:void 0}getLongMonthName(){var t;return null!==(t=this.format({month:"long"}))&&void 0!==t?t:Se[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:Te[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:ke[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Ce[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const i=t.match(_e);if(i&&"Z"===i[1])return new Ee(+new Date(t),e,0);if(i&&i[2]&&i[3]&&i[4]){const[,,s,n,a]=i,r=("+"===s?-1:1)*(60*parseInt(n,10)+parseInt(a,10));return new Ee(+new Date(t),e,r)}return new Ee(t,e)}static getTimezoneOffset(t,e){const i=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),n=new Date(i);return(+new Date(s)-+n)/6e4}}class Me{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=wt(t),Xt(this.base+t<=this.limit,this.message),this.base+=t}check(t){Xt((t=wt(t))<=this.limit,this.message)}}class Pe extends ot{constructor(t,[e,i],s,n,a,r,o,l){super(t,s,n,a,l),this.trimLeft=!1,this.trimRight=!1;const h="-"===s[e],c="-"===s[i-1];let d=h?e+1:e,u=c?i-1:i;for(;d<u&&4&Wt[s.charCodeAt(d)];)d++;for(;u>d&&4&Wt[s.charCodeAt(u-1)];)u--;this.contentRange=[d,u],this.trimLeft=h||r,this.trimRight=c||o}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class De extends Pe{constructor(t,e,i,s,n){const{trimTagLeft:a,trimTagRight:r,tagDelimiterLeft:o,tagDelimiterRight:l}=s,[h,c]=[e+o.length,i-l.length];super(Wi.Tag,[h,c],t,e,i,a,r,n),this.tokenizer=new Si(t,s.operators,n,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class Ie extends Pe{constructor(t,e,i,s,n){const{trimOutputLeft:a,trimOutputRight:r,outputDelimiterLeft:o,outputDelimiterRight:l}=s,h=[e+o.length,i-l.length];super(Wi.Output,h,t,e,i,a,r,n)}}class Re extends ot{constructor(t,e,i,s){super(Wi.HTML,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class Le extends ot{constructor(t,e,i,s){super(Wi.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class Fe extends ot{constructor(t,e,i,s){super(Wi.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class Ne extends ot{constructor(t,e,i,s){super(Wi.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=re[this.literal]}}const Oe={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Be={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class ze extends ot{constructor(t,e,i,s){super(Wi.Operator,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in Oe?Oe[t]:1}}class je extends ot{constructor(t,e,i,s,n,a){super(Wi.PropertyAccess,i,s,n,a),this.variable=t,this.props=e}}class Ve extends ot{constructor(t,e,i,s,n,a){super(Wi.Filter,i,s,n,a),this.name=t,this.args=e}}class He extends ot{constructor(t,e,i,s,n,a){super(Wi.Hash,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=n,this.file=a}}const $e=/[\da-fA-F]/,Ue=/[0-7]/,Ge={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function qe(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class We extends ot{constructor(t,e,i,s){super(Wi.Quoted,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=function(t){let e="";for(let i=1;i<t.length-1;i++)if("\\"===t[i])if(void 0!==Ge[t[i+1]])e+=Ge[t[++i]];else if("u"===t[i+1]){let s=0,n=i+2;for(;n<=i+5&&$e.test(t[n]);)s=16*s+qe(t[n++]);i=n-1,e+=String.fromCharCode(s)}else if(Ue.test(t[i+1])){let s=i+1,n=0;for(;s<=i+3&&Ue.test(t[s]);)n=8*n+qe(t[s++]);i=s-1,e+=String.fromCharCode(n)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class Ke extends ot{constructor(t,e,i,s,n,a){super(Wi.Range,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=n,this.file=a}}class Xe extends Pe{constructor(t,e,i,s,n){super(Wi.Tag,[e,i],t,e,i,!1,!1,n),this.tokenizer=new Si(t,s.operators,n,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class Ye extends ot{constructor(t,e,i,s,n,a){super(Wi.FilteredValue,i,s,n,a),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=n,this.file=a}}const Qe={now:()=>Date.now()};function Je(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||Qe}class Ze{renderTemplatesToNodeStream(t,e){const i=new ee;return Promise.resolve().then((()=>ce(this.renderTemplates(t,e,i)))).then((()=>i.end()),(t=>i.error(t))),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new ie:new te);const s=[];for(const n of t){e.renderLimit.check(Je().now());try{const t=yield n.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(t){const i=Bt.is(t)?t:new Vt(t,n);if(!e.opts.catchAllErrors)throw i;s.push(i)}}if(s.length)throw new Ht(s);return i.buffer}}class ti{constructor(t){this.postfix=[...ii(t)]}*evaluate(t,e){Xt(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(Qi(s)){const e=i.pop();let n;if(1===Be[s.operator])n=yield t.opts.operators[s.operator](e,t);else{const a=i.pop();n=yield t.opts.operators[s.operator](a,e,t)}i.push(n)}else i.push(yield ei(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*ei(t,e,i=!1){if(t)return"content"in t?t.content:is(t)?yield function*(t,e,i){const s=[];for(const i of t.props)s.push(yield ei(i,e,!1));try{if(t.variable){const n=yield ei(t.variable,e,i);return yield e._getFromScope(n,s)}return yield e._get(s)}catch(e){if(i&&"InternalUndefinedVariableError"===e.name)return null;throw new $t(e,t)}}(t,e,i):ns(t)?yield function*(t,e){const i=yield ei(t.lhs,e),s=yield ei(t.rhs,e);return e.memoryLimit.use(s-i+1),Mt(+i,+s+1)}(t,e):void 0}function*ii(t){const e=[];for(const i of t)if(Qi(i)){for(;e.length&&e[e.length-1].getPrecedence()>i.getPrecedence();)yield e.pop();e.push(i)}else yield i;for(;e.length;)yield e.pop()}function si(t,e){return!ni(t,e)}function ni(t,e){return t=yt(t),e.opts.jsTruthy?!t:!1===t||null==t}const ai={"==":ri,"!=":(t,e)=>!ri(t,e),">":(t,e)=>ne(t)?t.gt(e):ne(e)?e.lt(t):yt(t)>yt(e),"<":(t,e)=>ne(t)?t.lt(e):ne(e)?e.gt(t):yt(t)<yt(e),">=":(t,e)=>ne(t)?t.geq(e):ne(e)?e.leq(t):yt(t)>=yt(e),"<=":(t,e)=>ne(t)?t.leq(e):ne(e)?e.geq(t):yt(t)<=yt(e),contains:(t,e)=>St(t=yt(t))?t.some((t=>ri(t,e))):!!pt(null==t?void 0:t.indexOf)&&t.indexOf(yt(e))>-1,not:(t,e)=>ni(yt(t),e),and:(t,e,i)=>si(yt(t),i)&&si(yt(e),i),or:(t,e,i)=>si(yt(t),i)||si(yt(e),i)};function ri(t,e){return ne(t)?t.equals(e):ne(e)?e.equals(t):(t=yt(t),e=yt(e),St(t)?St(e)&&function(t,e){return t.length===e.length&&!t.some(((t,i)=>!ri(t,e[i])))}(t,e):t===e)}let oi=class{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}};class li{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new oi("HEAD",null,null,null),this.tail=new oi("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const i=new oi(t,e,this.head.next,this.head);this.head.next.prev=i,this.head.next=i,this.cache[t]=i,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function hi(t,e){const i=document.createElement("base");i.href=t;const s=document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild);const n=document.createElement("a");n.href=e;const a=n.href;return s.removeChild(i),a}var ci=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Ct(t)&&(t+="/"),hi(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((t,e,s)=>{const n=s.split("/").pop();return/\.\w+$/.test(n)?t:e+s+i}))},readFile:function(t){return he(this,void 0,void 0,(function*(){return new Promise(((e,i)=>{const s=new XMLHttpRequest;s.onload=()=>{s.status>=200&&s.status<300?e(s.responseText):i(new Error(s.statusText))},s.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},s.open("GET",t),s.send()}))}))},readFileSync:function(t){const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||e.status>=300)throw new Error(e.statusText);return e.responseText},exists:function(t){return he(this,void 0,void 0,(function*(){return!0}))},existsSync:function(t){return!0},dirname:function(t){return hi(t,".")},sep:"/"});function di(t,e=0){return JSON.stringify(t,null,e)}var ui={default:function(t,e,...i){return St(t=yt(t))||ut(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(ni(t,this.context)?e:t)},raw:{raw:!0,handler:It},jsonify:di,to_integer:function(t){return Number(t)},json:di,inspect:function(t,e=0){const i=[];return JSON.stringify(t,(function(t,e){if("object"!=typeof e||null===e)return e;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)}),e)}};const pi={"&":"&","<":"<",">":">",'"':""","'":"'"},gi={"&":"&","<":"<",">":">",""":'"',"'":"'"};function fi(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,(t=>pi[t]))}function mi(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,(t=>gi[t]))}var vi=Object.freeze({__proto__:null,escape:fi,xml_escape:function(t){return fi.call(this,t)},escape_once:function(t){return fi.call(this,mi.call(this,t))},newline_to_br:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class bi{constructor(t){this.mapping=t,this.sep="/"}exists(t){return he(this,void 0,void 0,(function*(){return this.existsSync(t)}))}existsSync(t){return!_t(this.mapping[t])}readFile(t){return he(this,void 0,void 0,(function*(){return this.readFileSync(t)}))}readFileSync(t){const e=this.mapping[t];if(_t(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,i){if(e+=i,"."===t)return e;const s=t.split(/\/+/);for(const t of e.split(this.sep))"."!==t&&""!==t&&(".."===t?(s.length>1||""!==s[0])&&s.pop():s.push(t));return s.join(this.sep)}}const yi={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:ci,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:ai,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function wi(t){var e,i,s;if(t.hasOwnProperty("root")&&(t.hasOwnProperty("partials")||(t.partials=t.root),t.hasOwnProperty("layouts")||(t.layouts=t.root)),t.hasOwnProperty("cache")){let e;e="number"==typeof t.cache?t.cache>0?new li(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new li(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},yi),t.jekyllInclude?{dynamicPartials:!1}:{}),t)).fs.dirname&&t.fs.sep||!t.relativeReference||(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),t.relativeReference=!1),t.root=xi(t.root),t.partials=xi(t.partials),t.layouts=xi(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?fi:"json"===s?ui.json:(Xt(pt(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=Ae())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new bi(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function xi(t){let e=[];return St(t)&&(e=t),ut(t)&&(e=[t]),e}function Ai(t,e){if(!t||!Ji(t))return;const i=e?4:16;for(;Wt[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function _i(t,e){if(!t||!Ji(t))return;const i=e?4:16;for(;Wt[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class Si{constructor(t,e=yi.operators,i,s){this.input=t,this.file=i,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=oe(e),this.literalTrie=oe(re)}readExpression(){return new ti(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(!e)return;yield e}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(-1!==t)return new ze(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e,i=t,s=this.p;for(;i[this.input[s]]&&s<this.N;)i=i[this.input[s++]],i.end&&(e=i);return e?e.needBoundary&&Kt(this.peek(s-this.p))?-1:s:-1}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new Ye(e,i,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert("|"===this.read(),'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),":"===this.peek())do{++this.p;const t=this.readFilterArg();t&&e.push(t),this.skipBlank(),this.assert(this.end()||","===this.peek()||"|"===this.peek(),(()=>`unexpected character ${this.snapshot()}`))}while(","===this.peek());else if("|"!==this.peek()&&!this.end())throw this.error('expected ":" after filter name');return new Ve(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),":"!==this.peek())return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=yi){const e=[];for(;this.p<this.N;){const i=this.readTopLevelToken(t);e.push(i)}return function(t,e){let i=!1;for(let s=0;s<t.length;s++){const n=t[s];rs(n)&Wi.Delimited&&(!i&&n.trimLeft&&Ai(t[s-1],e.greedy),Zi(n)&&("raw"===n.name?i=!0:"endraw"===n.name&&(i=!1)),!i&&n.trimRight&&_i(t[s+1],e.greedy))}}(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:i}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(i)?this.readOutputToken(t):this.readHTMLToken([e,i])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some((t=>this.match(t)));)++this.p;return new Re(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:i}=this,s=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.error(`tag ${this.snapshot(s)} not closed`,s);const n=new De(i,s,this.p,t,e);return"raw"===n.name&&(this.rawBeginAt=s),n}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;)if(e&&8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1}readOutputToken(t=yi){const{file:e,input:i}=this,{outputDelimiterRight:s}=t,n=this.p;if(-1===this.readToDelimiter(s,!0))throw this.error(`output ${this.snapshot(n)} not closed`,n);return new Ie(i,n,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:i}=t,s=this.p;let n=this.readTo(e)-e.length;for(;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(i)){const e=this.p;return s===n?(this.rawBeginAt=-1,new De(this.input,s,e,t,this.file)):(this.p=n,new Re(this.input,s,n,this.file))}if(this.rmatch(e))break;this.p++}else n=this.readTo(e)-e.length;throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=yi){const e=[];for(;this.p<this.N;){const i=this.readLiquidTagToken(t);i&&e.push(i)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter("\n");const i=this.p;return new Xe(this.input,e,i,t,this.file)}error(t,e=this.p){return new zt(t,new Fe(this.input,e,this.N,this.file))}assert(t,e,i){if(!t)throw this.error("function"==typeof e?e():e,i)}snapshot(t=this.p){return JSON.stringify(function(t,e){return t.length>e?t.slice(0,e-3)+"...":t}(this.input.slice(t,this.N),32))}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&Kt(this.peek());)++this.p;return new Fe(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const i=this.readHash(t);if(!i)return e;e.push(i)}}readHash(t){this.skipBlank(),","===this.peek()&&++this.p;const e=this.p,i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const n=ut(t)?t:t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new He(this.input,e,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),i=this.readProperties(!e);return i.length?new je(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new je(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;)if("["!==this.peek()){if(t&&!e.length){const t=this.readNonEmptyIdentifier();if(t){e.push(t);continue}}if("."!==this.peek()||"."===this.peek(1))break;{this.p++;const t=this.readNonEmptyIdentifier();if(!t)break;e.push(t)}}else{this.p++;const t=this.readValue()||new Fe(this.input,this.p,this.p,this.file);this.assert(-1!==this.readTo("]"),"[ not closed"),e.push(t)}return e}readNumber(){this.skipBlank();let t=!1,e=!1,i=0;for(64&this.peekType()&&i++;this.p+i<=this.N;)if(32&this.peekType(i))e=!0,i++;else{if("."!==this.peek(i)||"."===this.peek(i+1))break;if(t||!e)return;t=!0,i++}if(e&&!Kt(this.peek(i))){const t=new Le(this.input,this.p,this.p+i,this.file);return this.advance(i),t}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(-1===t)return;const e=new Ne(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if("("!==this.peek())return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert("."===this.read()&&"."===this.read(),"invalid range syntax");const i=this.readValueOrThrow();return this.skipBlank(),this.assert(")"===this.read(),"invalid range syntax"),new Ke(this.input,t,this.p,e,i,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,(()=>`unexpected token ${this.snapshot()}, value expected`)),t}readQuoted(){this.skipBlank();const t=this.p;if(!(8&this.peekType()))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new We(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,i=[","," ",e],s=new Set(i);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(i)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:Wt[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;4&this.peekType();)++this.p}}class Ti{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const i=this.handlers[t];return!!i&&(i.call(this,e),!0)}start(){let t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t))continue;if(Zi(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class ki{constructor(t){this.token=t}}class Ci extends ki{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class Ei{constructor(t,e){this.hash={};const i=t instanceof Si?t:new Si(t,{});for(const t of i.readHashes(e))this.hash[t.name.content]=t.value}*render(t){const e={};for(const i of Object.keys(this.hash))e[i]=void 0===this.hash[i]||(yield ei(this.hash[i],t));return e}}function Mi(t){return St(t)}class Pi{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=pt(e)?e:pt(null==e?void 0:e.handler)?e.handler:It,this.raw=!pt(e)&&!!(null==e?void 0:e.raw),this.args=t.args,this.liquid=i}*render(t,e){const i=[];for(const t of this.args)Mi(t)?i.push([t[0],yield ei(t[1],e)]):i.push(yield ei(t,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class Di{constructor(t,e){this.filters=[];const i="string"==typeof t?new Si(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map((t=>new Pi(t,this.getFilter(e,t.name),e)))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&"default"===this.filters[0].name;let i=yield this.initial.evaluate(t,e);for(const e of this.filters)i=yield e.render(i,t);return i}getFilter(t,e){const i=t.filters[e];return Xt(i||!t.options.strictFilters,(()=>`undefined filter: ${e}`)),i}}class Ii extends ki{constructor(t,e){var i;super(t);const s=new Si(t.input,e.options.operators,t.file,t.contentRange);this.value=new Di(s.readFilteredValue(),e);const n=this.value.filters,a=e.options.outputEscape;if(!(null===(i=n[n.length-1])||void 0===i?void 0:i.raw)&&a){const t=new Ve(toString.call(a),[],"",0,0);n.push(new Pi(t,a,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class Ri extends ki{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class Li{constructor(t,e){this.segments=t,this.location=e}toString(){return Gi(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof Li?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class Fi{constructor(){this.map=new Map}get(t){const e=Gi([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(Gi([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const Ni={partials:!0};function*Oi(t,e,i){const s=new Fi,n=new Fi,a=new Fi,r=new ji(new Set),o=new Set;function l(t,e){s.push(t);const i=e.alias(t);if(void 0!==i){const t=i.segments[0];ut(t)&&!r.has(t)&&n.push(i)}else{const i=t.segments[0];ut(i)&&!e.has(i)&&n.push(t)}for(const i of t.segments)i instanceof Li&&l(i,e)}function*h(t,s){if(t.arguments)for(const e of t.arguments())for(const t of Vi(e))l(t,s);if(t.localScope)for(const e of t.localScope()){s.add(e.content),s.deleteAlias(e.content);const[t,i]=e.getPosition();a.push(new Li([e.content],{row:t,col:i,file:e.file}))}if(t.children)if(t.partialScope){const n=t.partialScope();if(void 0===n){for(const n of yield t.children(e,i))yield h(n,s);return}if(o.has(n.name))return;const a=new Set,r=n.isolated?new ji(a):s.push(a);for(const t of n.scope)if(ut(t))a.add(t);else{const[e,i]=t;a.add(e);const s=Array.from(Vi(i));s.length&&r.setAlias(e,s[0].segments)}for(const s of yield t.children(e,i))yield h(s,r),o.add(n.name);r.pop()}else{t.blockScope&&s.push(new Set(t.blockScope()));for(const n of yield t.children(e,i))yield h(n,s);t.blockScope&&s.pop()}}for(const e of t)yield h(e,r);return{variables:s.asObject(),globals:n.asObject(),locals:a.asObject()}}function Bi(t,e={}){return ce(Oi(t,Object.assign(Object.assign({},Ni),e).partials,!1))}function zi(t,e={}){return de(Oi(t,Object.assign(Object.assign({},Ni),e).partials,!0))}class ji{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return null===(t=this.stack.pop())||void 0===t?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!ut(e))return;const i=this.getAlias(e);return void 0!==i?new Li([...i,...t.segments.slice(1)],t.location):void 0}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*Vi(t){as(t)?yield*Hi(t):t instanceof Di&&(yield*function*(t){for(const e of t.initial.postfix)as(e)&&(yield*Hi(e));for(const e of t.filters)for(const t of e.args)Mi(t)&&t[1]?yield*Hi(t[1]):as(t)&&(yield*Hi(t))}(t))}function*Hi(t){ns(t)?(yield*Hi(t.lhs),yield*Hi(t.rhs)):is(t)&&(yield $i(t))}function $i(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,ts(s)||es(s)||ss(s)?e.push(s.content):is(s)&&e.push(...$i(s).segments);for(const s of t.props.slice(1))i=i||s.file,ts(s)||es(s)||ss(s)?e.push(s.content):is(s)&&e.push($i(s));const[n,a]=t.getPosition();return new Li(e,{row:n,col:a,file:i})}const Ui=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function Gi(t,e=!1){const i=[],s=t[0];ut(s)&&(!e||s.match(Ui)?i.push(`${s}`):i.push(`['${s}']`));for(const e of t.slice(1))e instanceof Li?i.push(`[${Gi(e.segments)}]`):ut(e)?e.match(Ui)?i.push(`.${e}`):i.push(`['${e}']`):i.push(`[${e}]`);return i.join("")}var qi,Wi,Ki;!function(t){t.Partials="partials",t.Layouts="layouts",t.Root="root"}(qi||(qi={}));class Xi{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;Xt(e,"`fs.sep` is required for relative reference");const i=new RegExp(["."+e,".."+e,"./","../"].map((t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|"));this.shouldLoadRelative=t=>i.test(t)}else this.shouldLoadRelative=t=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,i,s){const{fs:n}=this.options,a=this.options[e];for(const r of this.candidates(t,a,s,e!==qi.Root))if(i?n.existsSync(r):yield n.exists(r))return r;throw this.lookupError(t,a)}*candidates(t,e,i,s){const{fs:n,extname:a}=this.options;if(this.shouldLoadRelative(t)&&i){const r=n.resolve(this.dirname(i),t,a);for(const t of e)if(!s||this.contains(t,r)){yield r;break}}for(const i of e){const e=n.resolve(i,t,a);s&&!this.contains(i,e)||(yield e)}if(void 0!==n.fallback){const e=n.fallback(t);void 0!==e&&(yield e)}}dirname(t){const e=this.options.fs;return Xt(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const i=new Error("ENOENT");return i.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,i.code="ENOENT",i}}class Yi{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Xi(this.liquid.options),this.parseLimit=new Me("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new Si(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(i)}parseTokens(t){let e;const i=[],s=[];for(;e=t.shift();)try{i.push(this.parseToken(e,t))}catch(t){if(!this.liquid.options.catchAllErrors)throw t;s.push(t)}if(s.length)throw new Ht(s);return i}parseToken(t,e){try{if(Zi(t)){const i=this.liquid.tags[t.name];return Xt(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return rs(t)===Wi.Output?new Ii(t,this.liquid):new Ri(t)}catch(e){if(Bt.is(e))throw e;throw new jt(e,t)}}parseStream(t){return new Ti(t,((t,e)=>this.parseToken(t,e)))}*_parseFileCached(t,e,i=qi.Root,s){const n=this.cache,a=this.loader.shouldLoadRelative(t)?s+","+t:i+":"+t,r=yield n.read(a);if(r)return r;const o=this._parseFile(t,e,i,s),l=e?yield o:ce(o);n.write(a,l);try{return yield l}catch(t){throw n.remove(a),t}}*_parseFile(t,e,i=qi.Root,s){const n=yield this.loader.lookup(t,i,e,s);return this.parse(e?this.fs.readFileSync(n):yield this.fs.readFile(n),n)}}function Qi(t){return rs(t)===Wi.Operator}function Ji(t){return rs(t)===Wi.HTML}function Zi(t){return rs(t)===Wi.Tag}function ts(t){return rs(t)===Wi.Quoted}function es(t){return rs(t)===Wi.Number}function is(t){return rs(t)===Wi.PropertyAccess}function ss(t){return rs(t)===Wi.Word}function ns(t){return rs(t)===Wi.Range}function as(t){return(1667&rs(t))>0}function rs(t){return t?t.kind:-1}!function(t){t[t.Number=1]="Number",t[t.Literal=2]="Literal",t[t.Tag=4]="Tag",t[t.Output=8]="Output",t[t.HTML=16]="HTML",t[t.Filter=32]="Filter",t[t.Hash=64]="Hash",t[t.PropertyAccess=128]="PropertyAccess",t[t.Word=256]="Word",t[t.Range=512]="Range",t[t.Quoted=1024]="Quoted",t[t.Operator=2048]="Operator",t[t.FilteredValue=4096]="FilteredValue",t[t.Delimited=12]="Delimited"}(Wi||(Wi={}));class os{constructor(t={},e=yi,i={},{memoryLimit:s,renderLimit:n}={}){var a,r,o,l,h;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!i.sync,this.opts=e,this.globals=null!==(a=i.globals)&&void 0!==a?a:e.globals,this.environments=Et(t)?t:Object(t),this.strictVariables=null!==(r=i.strictVariables)&&void 0!==r?r:this.opts.strictVariables,this.ownPropertyOnly=null!==(o=i.ownPropertyOnly)&&void 0!==o?o:e.ownPropertyOnly,this.memoryLimit=null!=s?s:new Me("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=n?n:new Me("template render",Je().now()+(null!==(h=i.renderLimit)&&void 0!==h?h:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map((t=>[t,this.getRegister(t)]))}restoreRegister(t){return t.forEach((([t,e])=>this.setRegister(t,e)))}getAll(){return[this.globals,this.environments,...this.scopes].reduce(((t,e)=>le(t,e)),{})}get(t){return this.getSync(t)}getSync(t){return de(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return de(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){ut(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield ls(t,e[s],this.ownPropertyOnly),i&&void 0===t)throw new Ut(e.slice(0,s+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new os(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(t){for(let e=this.scopes.length-1;e>=0;e--){const i=this.scopes[e];if(t in i)return i}return t in this.environments?this.environments:this.globals}}function ls(t,e,i){if(t=At(t),e=yt(e),_t(t))return t;if(St(t)&&e<0)return t[t.length+ +e];const s=function(t,e,i){return!i||dt.call(t,e)||t instanceof lt?t[e]:void 0}(t,e,i);return void 0===s&&t instanceof lt?t.liquidMethodMissing(e):pt(s)?s.call(t):"size"===e?function(t){if(dt.call(t,"size")||void 0!==t.size)return t.size;if(St(t)||ut(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return St(t)?t[0]:t.first}(t):"last"===e?function(t){return St(t)?t[t.length-1]:t.last}(t):s}!function(t){t[t.OUTPUT=0]="OUTPUT",t[t.STORE=1]="STORE"}(Ki||(Ki={}));const hs=Lt(Math.abs),cs=Lt(Math.max),ds=Lt(Math.min),us=Lt(Math.ceil),ps=Lt(((t,e,i=!1)=>i?Math.floor(t/e):t/e)),gs=Lt(Math.floor),fs=Lt(((t,e)=>t-e)),ms=Lt(((t,e)=>t%e)),vs=Lt(((t,e)=>t*e));var bs=Object.freeze({__proto__:null,abs:hs,at_least:cs,at_most:ds,ceil:us,divided_by:ps,floor:gs,minus:fs,modulo:ms,times:vs,round:function(t,e=0){t=yt(t),e=yt(e);const i=Math.pow(10,e);return Math.round(t*i)/i},plus:function(t,e){return t=yt(t),e=yt(e),Number(t)+Number(e)}});const ys=/[^\p{M}\p{L}\p{Nd}]+/gu,ws={raw:/\s+/g,default:ys,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:ys,none:null};var xs=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(mt(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(mt(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(mt(t)).replace(/%20/g,"+").replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())),uri_escape:t=>encodeURI(mt(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=mt(t);const s=ws[e];return s&&("latin"===e&&(t=function(t){return t.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}(t)),t=t.replace(s,"-").replace(/^-|-$/g,"")),i?t:t.toLowerCase()}});const As=Lt((function(t,e){const i=bt(t),s=_t(e)?" ":mt(e),n=i.length*(1+s.length);return this.context.memoryLimit.use(n),i.join(s)})),_s=Lt((t=>Tt(t)?Ct(t):"")),Ss=Lt((t=>Tt(t)?t[0]:"")),Ts=Lt((function(t){const e=bt(t);return this.context.memoryLimit.use(e.length),[...e].reverse()}));function ks(t,e=[]){const i=bt(t),s=bt(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function Cs(t){return this.context.opts.jekyllWhere?e=>{return Qt.is(t)?ri(e,t):St(e)?(i=t,e.some((t=>ri(t,i)))):ri(e,t);var i}:void 0===t?t=>si(t,this.context):e=>ri(e,t)}function*Es(t,e,i,s){const n=[];e=bt(e),this.context.memoryLimit.use(e.length);const a=new Si(mt(i)).readScopeValue();for(const t of e)n.push(yield ei(a,this.context.spawn(t)));const r=Cs.call(this,s);return e.filter(((e,i)=>r(n[i])===t))}function*Ms(t,e,i,s){const n=[],a=new Di(mt(s),this.liquid),r=bt(e);this.context.memoryLimit.use(r.length);for(const e of r){this.context.push({[i]:e});const s=yield a.value(this.context);this.context.pop(),s===t&&n.push(e)}return n}function*Ps(t,e,i){const s=new Si(mt(e)).readScopeValue(),n=bt(t),a=Cs.call(this,i);for(let t=0;t<n.length;t++){if(a(yield ei(s,this.context.spawn(n[t]))))return[t,n[t]]}}function*Ds(t,e,i){const s=new Di(mt(i),this.liquid),n=bt(t);for(let t=0;t<n.length;t++){this.context.push({[e]:n[t]});const i=yield s.value(this.context);if(this.context.pop(),i)return[t,n[t]]}}var Is=Object.freeze({__proto__:null,join:As,last:_s,first:Ss,reverse:Ts,sort:function*(t,e){const i=[],s=bt(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push([t,e?yield this.context._getFromScope(t,mt(e).split("."),!1):t]);return i.sort(((t,e)=>{const i=t[1],s=e[1];return i<s?-1:i>s?1:0})).map((t=>t[0]))},sort_natural:function(t,e){const i=mt(e),s=void 0===e?Rt:(t,e)=>Rt(t[i],e[i]),n=bt(t);return this.context.memoryLimit.use(n.length),[...n].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=bt(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push(yield this.context._getFromScope(t,mt(e),!1));return i},sum:function*(t,e){let i=0;const s=bt(t);for(const t of s){const s=Number(e?yield this.context._getFromScope(t,mt(e),!1):t);i+=Number.isNaN(s)?0:s}return i},compact:function(t){const e=bt(t);return this.context.memoryLimit.use(e.length),e.filter((t=>!_t(yt(t))))},concat:ks,push:function(t,e){return ks.call(this,t,[e])},unshift:function(t,e){const i=bt(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...bt(t)];return e.pop(),e},shift:function(t){const e=bt(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return _t(t=yt(t))?[]:(St(t)||(t=mt(t)),e=e<0?t.length+e:e,this.context.memoryLimit.use(i),t.slice(e,e+i))},where:function*(t,e,i){return yield*Es.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*Es.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*Ms.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*Ms.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=vt(t);const s=new Si(mt(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const e of t){const t=yield ei(s,this.context.spawn(e));i.has(t)||i.set(t,[]),i.get(t).push(e)}return[...i.entries()].map((([t,e])=>({name:t,items:e})))},group_by_exp:function*(t,e,i){const s=new Map,n=new Di(mt(i),this.liquid);t=vt(t),this.context.memoryLimit.use(t.length);for(const i of t){this.context.push({[e]:i});const t=yield n.value(this.context);this.context.pop(),s.has(t)||s.set(t,[]),s.get(t).push(i)}return[...s.entries()].map((([t,e])=>({name:t,items:e})))},has:function*(t,e,i){return!!(yield*Ps.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*Ds.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*Ps.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*Ds.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*Ps.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*Ds.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=bt(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(_t(t=yt(t)))return[];St(t)||(t=mt(t)),this.context.memoryLimit.use(e);const i=[...t].sort((()=>Math.random()-.5));return 1===e?i[0]:i.slice(0,e)}});function Rs(t,e,i){var s,n,a;const r=(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)+(null!==(n=null==e?void 0:e.length)&&void 0!==n?n:0)+(null!==(a=null==i?void 0:i.length)&&void 0!==a?a:0);this.context.memoryLimit.use(r);const o=Fs(t,this.context.opts,i);return o?we(o,e=_t(e=yt(e))?this.context.opts.dateFormat:mt(e)):t}function Ls(t,e,i,s){const n=Fs(t,this.context.opts);if(!n)return t;if("ordinal"===i){const t=n.getDate();return we(n,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return we(n,`%d ${e} %Y`)}function Fs(t,e,i){let s;const n=null!=i?i:e.timezoneOffset,a=e.locale;return s="now"===(t=yt(t))||"today"===t?new Ee(Date.now(),a,n):xt(t)?new Ee(1e3*t,a,n):ut(t)?/^\d+$/.test(t)?new Ee(1e3*+t,a,n):e.preserveTimezones&&void 0===i?Ee.createDateFixedToTimezone(t,a):new Ee(t,a,n):new Ee(t,a,n),s.valid()?s:void 0}var Ns=Object.freeze({__proto__:null,date:Rs,date_to_xmlschema:function(t){return Rs.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return Rs.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return Ls.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return Ls.call(this,t,"%B",e,i)}});const Os=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,Bs=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var zs=Object.freeze({__proto__:null,append:function(t,e){Xt(2===arguments.length,"append expect 2 arguments");const i=mt(t),s=mt(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){Xt(2===arguments.length,"prepend expect 2 arguments");const i=mt(t),s=mt(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),e?(e=Ft(mt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),mt(e).toUpperCase()},remove:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),i.split(mt(e)).join("")},remove_first:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),i.replace(mt(e),"")},remove_last:function(t,e){const i=mt(t);this.context.memoryLimit.use(i.length);const s=mt(e),n=i.lastIndexOf(s);return-1===n?i:i.substring(0,n)+i.substring(n+s.length)},rstrip:function(t,e){return t=mt(t),this.context.memoryLimit.use(t.length),e?(e=Ft(mt(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=mt(t);this.context.memoryLimit.use(i.length);const s=i.split(mt(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=mt(t);return this.context.memoryLimit.use(i.length),e?(e=Ft(mt(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=mt(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=mt(t);return this.context.memoryLimit.use(s.length),s.split(mt(e)).join(i)},replace_first:function(t,e,i){const s=mt(t);return this.context.memoryLimit.use(s.length),s.replace(mt(e),i)},replace_last:function(t,e,i){const s=mt(t);this.context.memoryLimit.use(s.length);const n=mt(e),a=s.lastIndexOf(n);if(-1===a)return s;const r=mt(i);return s.substring(0,a)+r+s.substring(a+n.length)},truncate:function(t,e=50,i="..."){const s=mt(t);return this.context.memoryLimit.use(s.length),s.length<=e?t:s.substring(0,e-i.length)+i},truncatewords:function(t,e=15,i="..."){const s=mt(t);this.context.memoryLimit.use(s.length);const n=s.split(/\s+/);e<=0&&(e=1);let a=n.slice(0,e).join(" ");return n.length>=e&&(a+=i),a},normalize_whitespace:function(t){const e=mt(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=mt(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(Os)||[]).length+(t.match(Bs)||[]).length;case"auto":return Os.test(t)?t.match(Os).length+(t.match(Bs)||[]).length:t.split(/\s+/).length;default:return t.split(/\s+/).length}},array_to_sentence_string:function(t,e="and"){switch(this.context.memoryLimit.use(t.length),t.length){case 0:return"";case 1:return t[0];case 2:return`${t[0]} ${e} ${t[1]}`;default:return`${t.slice(0,-1).join(", ")}, ${e} ${t[t.length-1]}`}}});const js=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},vi),bs),xs),Is),Ns),zs),ui);const Vs=["offset","limit","reversed"];function Hs(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(ts(e)){return $s(i.parse(e.content))}return e}const s=[...t.readFileNameTemplate(e.options)],n=$s(i.parseTokens(s));return"none"===n?void 0:n}function $s(t){return 1===t.length&&Ji(t[0].token)?t[0].token.getContent():t}function*Us(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield ei(t,e)}class Gs extends Zt{constructor(t,e,i,s){super(t,i,s),this.length=t,this.cols=e}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return 0===this.col0()}col_last(){return this.col()===this.cols}}const qs={assign:class extends Ci{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert("="===this.tokenizer.peek(),'expected "="'),this.tokenizer.advance(),this.value=new Di(this.tokenizer.readFilteredValue(),this.liquid)}*render(t){t.bottom()[this.key]=yield this.value.value(t,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},for:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer.readIdentifier(),a=this.tokenizer.readIdentifier(),r=this.tokenizer.readValue();if(!n.size()||"in"!==a.content||!r)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=n.content,this.collection=r,this.hash=new Ei(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",(()=>o=this.templates)).on("tag:else",(t=>{Yt(t.args),o=this.elseTemplates})).on("tag:endfor",(t=>{Yt(t.args),l.stop()})).on("template",(t=>o.push(t))).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)}));l.start()}*render(t,e){const i=this.liquid.renderer;let s=vt(yield ei(this.collection,t));if(!s.length)return void(yield i.renderTemplates(this.elseTemplates,t,e));const n="continue-"+this.variable+"-"+this.collection.getText();t.push({continue:t.getRegister(n)});const a=yield this.hash.render(t);t.pop();s=(this.liquid.options.orderedFilterParameters?Object.keys(a).filter((t=>Vs.includes(t))):Vs.filter((t=>void 0!==a[t]))).reduce(((t,e)=>{return"offset"===e?(i=t,s=a.offset,i.slice(s)):"limit"===e?function(t,e){return t.slice(0,e)}(t,a.limit):function(t){return[...t].reverse()}(t);var i,s}),s),t.setRegister(n,(a.offset||0)+s.length);const r={forloop:new Zt(s.length,this.collection.getText(),this.variable)};t.push(r);for(const n of s){if(r[this.variable]=n,t.continueCalled=t.breakCalled=!1,yield i.renderTemplates(this.templates,t,e),t.breakCalled)break;r.forloop.next()}t.continueCalled=t.breakCalled=!1,t.pop()}*children(){const t=this.templates.slice();return this.elseTemplates&&t.push(...this.elseTemplates),t}*arguments(){yield this.collection;for(const t of Object.values(this.hash.hash))as(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends Ci{constructor(t,e,i,s){for(super(t,e,i),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;e.length;){const t=e.shift();if(Zi(t)&&"endcapture"===t.name)return;this.templates.push(s.parseToken(t,e))}throw new Error(`tag ${t.getText()} not closed`)}readVariable(){let t=this.tokenizer.readIdentifier();if(t.content)return t;if(t=this.tokenizer.readQuoted(),t)return t;throw this.tokenizer.error("invalid capture name")}*render(t){const e=this.liquid.renderer,i=yield e.renderTemplates(this.templates,t);t.bottom()[this.variable]=i}*children(){return this.templates}*localScope(){yield this.identifier}},case:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new Di(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let n=[],a=0;const r=s.parseStream(e).on("tag:when",(t=>{if(a>0)return;n=[];const e=[];for(;!t.tokenizer.end();)e.push(t.tokenizer.readValueOrThrow()),t.tokenizer.skipBlank(),","===t.tokenizer.peek()?t.tokenizer.readTo(","):t.tokenizer.readTo("or");this.branches.push({values:e,templates:n})})).on("tag:else",(()=>{a++,n=this.elseTemplates})).on("tag:endcase",(()=>r.stop())).on("template",(t=>{n===this.elseTemplates&&1!==a||n.push(t)})).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)}));r.start()}*render(t,e){const i=this.liquid.renderer,s=yt(yield this.value.value(t,t.opts.lenientIf));let n=!1;for(const a of this.branches)for(const r of a.values){if(ri(s,yield ei(r,t,t.opts.lenientIf))){yield i.renderTemplates(a.templates,t,e),n=!0;break}}n||(yield i.renderTemplates(this.elseTemplates,t,e))}*arguments(){yield this.value,yield*this.branches.flatMap((t=>t.values))}*children(){const t=this.branches.flatMap((t=>t.templates));return this.elseTemplates&&t.push(...this.elseTemplates),t}},comment:class extends Ci{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(Zi(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends Ci{constructor(t,e,i,s){super(t,e,i);const{tokenizer:n}=t;this.file=Hs(n,this.liquid,s),this.currentFile=t.file;const a=n.p;"with"===n.readIdentifier().content?(n.skipBlank(),":"!==n.peek()?this.withVar=n.readValue():n.p=a):n.p=a,this.hash=new Ei(n,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:n}=this,{renderer:a}=i,r=yield Us(this.file,t,i);Xt(r,(()=>`illegal file path "${r}"`));const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",Ki.OUTPUT);const l=yield s.render(t);n&&(l[r]=yield ei(n,t));const h=yield i._parsePartialFile(r,t.sync,this.currentFile);t.push(t.opts.jekyllInclude?{include:l}:l),yield a.renderTemplates(h,t,e),t.pop(),t.restoreRegister(o)}*children(t,e){return t&&ut(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(ut(this.file)){let t;return this.liquid.options.jekyllInclude?t=["include"]:(t=Object.keys(this.hash.hash),this.withVar&&t.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:t}}}*arguments(){yield*Object.values(this.hash.hash).filter(as),as(this.file)&&(yield this.file),as(this.withVar)&&(yield this.withVar)}},render:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer;for(this.file=Hs(n,this.liquid,s),this.currentFile=t.file;!n.end();){n.skipBlank();const t=n.p,e=n.readIdentifier();if(("with"===e.content||"for"===e.content)&&(n.skipBlank(),":"!==n.peek())){const t=n.readValue();if(t){const i=n.p;let s;"as"===n.readIdentifier().content?s=n.readIdentifier():n.p=i,this[e.content]={value:t,alias:s&&s.content},n.skipBlank(),","===n.peek()&&n.advance();continue}}n.p=t;break}this.hash=new Ei(n,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,n=yield Us(this.file,t,i);Xt(n,(()=>`illegal file path "${n}"`));const a=t.spawn(),r=a.bottom();if(le(r,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;r[i||n]=yield ei(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=vt(yield ei(s,t));r.forloop=new Zt(l.length,s.getText(),o);for(const t of l){r[o]=t;const s=yield i._parsePartialFile(n,a.sync,this.currentFile);yield i.renderer.renderTemplates(s,a,e),r.forloop.next()}}else{const t=yield i._parsePartialFile(n,a.sync,this.currentFile);yield i.renderer.renderTemplates(t,a,e)}}*children(t,e){return t&&ut(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(ut(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;ut(i)?t.push([i,e]):ut(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;ut(i)?t.push([i,e]):ut(this.file)&&t.push([this.file,e])}return{name:this.file,isolated:!0,scope:t}}}*arguments(){for(const t of Object.values(this.hash.hash))as(t)&&(yield t);if(this.with){const{value:t}=this.with;as(t)&&(yield t)}if(this.for){const{value:t}=this.for;as(t)&&(yield t)}}},decrement:class extends Ci{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;xt(i[this.variable])||(i[this.variable]=0),e.write(mt(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends Ci{constructor(t,e,i){super(t,e,i),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const i=t.environments;xt(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(mt(s))}*localScope(){yield this.identifier}},cycle:class extends Ci{constructor(t,e,i){super(t,e,i),this.candidates=[];const s=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),s&&(":"===this.tokenizer.peek()?(this.group=s,this.tokenizer.advance()):this.candidates.push(s));!this.tokenizer.end();){const t=this.tokenizer.readValue();t&&this.candidates.push(t),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,(()=>`empty candidates: "${t.getText()}"`))}*render(t,e){const i=`cycle:${yield ei(this.group,t)}:`+this.candidates.join(","),s=t.getRegister("cycle");let n=s[i];void 0===n&&(n=s[i]=0);const a=this.candidates[n];return n=(n+1)%this.candidates.length,s[i]=n,yield ei(a,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.branches=[];let n=[];s.parseStream(e).on("start",(()=>this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]}))).on("tag:elsif",(t=>{Xt(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]})})).on("tag:else",(t=>{Yt(t.args),Xt(!this.elseTemplates,"duplicated else"),n=this.elseTemplates=[]})).on("tag:endif",(function(t){Yt(t.args),this.stop()})).on("template",(t=>n.push(t))).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)})).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,templates:n}of this.branches){if(si(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(n,t,e))}yield i.renderTemplates(this.elseTemplates||[],t,e)}*children(){const t=this.branches.flatMap((t=>t.templates));return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map((t=>t.value))}},layout:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.file=Hs(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new Ei(this.tokenizer,i.options.keyValueSeparator),this.templates=s.parseTokens(e)}*render(t,e){const{liquid:i,args:s,file:n}=this,{renderer:a}=i;if(void 0===n)return t.setRegister("blockMode",Ki.OUTPUT),void(yield a.renderTemplates(this.templates,t,e));const r=yield Us(this.file,t,i);Xt(r,(()=>`illegal file path "${r}"`));const o=yield i._parseLayoutFile(r,t.sync,this.currentFile);t.setRegister("blockMode",Ki.STORE);const l=yield a.renderTemplates(this.templates,t),h=t.getRegister("blocks");void 0===h[""]&&(h[""]=(t,e)=>e.write(l)),t.setRegister("blockMode",Ki.OUTPUT),t.push(yield s.render(t)),yield a.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&ut(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))as(t)&&(yield t);as(this.file)&&(yield this.file)}partialScope(){if(ut(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.templates=[];const n=/\w+/.exec(t.args);for(this.block=n?n[0]:"";e.length;){const t=e.shift();if(Zi(t)&&"endblock"===t.name)return;const i=s.parseToken(t,e);this.templates.push(i)}throw new Error(`tag ${t.getText()} not closed`)}*render(t,e){const i=this.getBlockRender(t);t.getRegister("blockMode")===Ki.STORE?t.getRegister("blocks")[this.block]=i:yield i(new se,e)}getBlockRender(t){const{liquid:e,templates:i}=this,s=t.getRegister("blocks")[this.block],n=function*(s,n){t.push({block:s}),yield e.renderer.renderTemplates(i,t,n),t.pop()};return s?(t,e)=>s(new se((e=>n(t,e))),e):n}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends Ci{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(Zi(t)&&"endraw"===t.name)return;this.tokens.push(t)}throw new Error(`tag ${t.getText()} not closed`)}render(){return this.tokens.map((t=>t.getText())).join("")}},tablerow:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const a=this.tokenizer.readIdentifier(),r=this.tokenizer.readValue();if("in"!==a.content||!r)throw new Error(`illegal tag: ${t.getText()}`);let o;this.variable=n.content,this.collection=r,this.args=new Ei(this.tokenizer,i.options.keyValueSeparator),this.templates=[];const l=s.parseStream(e).on("start",(()=>o=this.templates)).on("tag:endtablerow",(()=>l.stop())).on("template",(t=>o.push(t))).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)}));l.start()}*render(t,e){let i=vt(yield ei(this.collection,t));const s=yield this.args.render(t),n=s.offset||0,a=void 0===s.limit?i.length:s.limit;i=i.slice(n,n+a);const r=s.cols||i.length,o=this.liquid.renderer,l=new Gs(i.length,r,this.collection.getText(),this.variable),h={tablerowloop:l};t.push(h);for(let s=0;s<i.length;s++,l.next())h[this.variable]=i[s],0===l.col0()&&(1!==l.row()&&e.write("</tr>"),e.write(`<tr class="row${l.row()}">`)),e.write(`<td class="col${l.col()}">`),yield o.renderTemplates(this.templates,t,e),e.write("</td>");i.length&&e.write("</tr>"),t.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const t of Object.values(this.args.hash))as(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends Ci{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[];let n=[],a=0;s.parseStream(e).on("start",(()=>this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),test:ni,templates:n=[]}))).on("tag:elsif",(t=>{a>0?n=[]:this.branches.push({value:new Di(t.tokenizer.readFilteredValue(),this.liquid),test:si,templates:n=[]})})).on("tag:else",(()=>{a++,n=this.elseTemplates})).on("tag:endunless",(function(){this.stop()})).on("template",(t=>{n===this.elseTemplates&&1!==a||n.push(t)})).on("end",(()=>{throw new Error(`tag ${t.getText()} not closed`)})).start()}*render(t,e){const i=this.liquid.renderer;for(const{value:s,test:n,templates:a}of this.branches){if(n(yield s.value(t,t.opts.lenientIf),t))return void(yield i.renderTemplates(a,t,e))}yield i.renderTemplates(this.elseTemplates,t,e)}*children(){const t=this.branches.flatMap((t=>t.templates));return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map((t=>t.value))}},break:class extends Ci{render(t,e){t.breakCalled=!0}},continue:class extends Ci{render(t,e){t.continueCalled=!0}},echo:class extends Ci{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new Di(this.tokenizer.readFilteredValue(),this.liquid))}*render(t,e){if(!this.value)return;const i=yield this.value.value(t,!1);e.write(i)}*arguments(){this.value&&(yield this.value)}},liquid:class extends Ci{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(n)}*render(t,e){yield this.liquid.renderer.renderTemplates(this.templates,t,e)}*children(){return this.templates}},"#":class extends Ci{constructor(t,e,i){if(super(t,e,i),-1!==t.args.search(/\n\s*[^#\s]/g))throw new Error("every line of an inline comment must start with a '#' character")}render(){}}};class Ws{constructor(t={}){this.renderer=new Ze,this.filters={},this.tags={},this.options=wi(t),this.parser=new Yi(this),kt(qs,((t,e)=>this.registerTag(e,t))),kt(js,((t,e)=>this.registerFilter(e,t)))}parse(t,e){return new Yi(this).parse(t,e)}_render(t,e,i){const s=e instanceof os?e:new os(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return he(this,void 0,void 0,(function*(){return ce(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderSync(t,e,i){return de(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new os(e,this.options,i);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,e,i){const s=this.parse(t);return this._render(s,e,i)}parseAndRender(t,e,i){return he(this,void 0,void 0,(function*(){return ce(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}parseAndRenderSync(t,e,i){return de(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new Yi(this).parseFile(t,e,qi.Partials,i)}_parseLayoutFile(t,e,i){return new Yi(this).parseFile(t,e,qi.Layouts,i)}_parseFile(t,e,i,s){return new Yi(this).parseFile(t,e,i,s)}parseFile(t,e){return he(this,void 0,void 0,(function*(){return ce(new Yi(this).parseFile(t,!1,e))}))}parseFileSync(t,e){return de(new Yi(this).parseFile(t,!0,e))}*_renderFile(t,e,i){const s=yield this._parseFile(t,i.sync,i.lookupType);return yield this._render(s,e,i)}renderFile(t,e,i){return he(this,void 0,void 0,(function*(){return ce(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderFileSync(t,e,i){return de(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return he(this,void 0,void 0,(function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)}))}_evalValue(t,e){const i=new Di(t,this),s=e instanceof os?e:new os(e,this.options);return i.value(s)}evalValue(t,e){return he(this,void 0,void 0,(function*(){return ce(this._evalValue(t,e))}))}evalValueSync(t,e){return de(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){var i;this.tags[t]=pt(e)?e:(i=e,class extends Ci{constructor(t,e,s){super(t,e,s),pt(i.parse)&&i.parse.call(this,t,e)}*render(t,e){const s=yield new Ei(this.token.args,t.opts.keyValueSeparator).render(t);return yield i.render.call(this,t,e,s)}})}plugin(t){return t.call(this,Ws)}express(){const t=this;let e=!0;return function(i,s,n){if(e){e=!1;const i=xi(this.root);t.options.root.unshift(...i),t.options.layouts.unshift(...i),t.options.partials.unshift(...i)}t.renderFile(i,s).then((t=>n(null,t)),n)}}analyze(t,e={}){return he(this,void 0,void 0,(function*(){return Bi(t,e)}))}analyzeSync(t,e={}){return zi(t,e)}parseAndAnalyze(t,e,i={}){return he(this,void 0,void 0,(function*(){return Bi(this.parse(t,e),i)}))}parseAndAnalyzeSync(t,e,i={}){return zi(this.parse(t,e),i)}variables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Object.keys(i.variables)}))}variablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap((t=>t.map((t=>String(t)))))))}))}fullVariablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.variables).flatMap((t=>t.map((t=>String(t)))))))}variableSegments(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}))}variableSegmentsSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}globalVariables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Object.keys(i.globals)}))}globalVariablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap((t=>t.map((t=>String(t)))))))}))}globalFullVariablesSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(i.globals).flatMap((t=>t.map((t=>String(t)))))))}globalVariableSegments(t,e={}){return he(this,void 0,void 0,(function*(){const i=yield Bi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}))}globalVariableSegmentsSync(t,e={}){const i=zi(ut(t)?this.parse(t):t,e);return Array.from(Nt(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}}const Ks={render:function(t,e){const i=r("v-icon"),s=r("v-list-item-icon"),n=r("v-text-overflow"),a=r("v-list-item-content"),u=r("v-list-item"),p=r("v-list");return o(),l(p,{nav:""},{default:h((()=>[c(u,{href:"https://app.texttoanything.nl/"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"open_in_new"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Text to anything dashboard"})])),_:1})])),_:1}),c(u,{to:"/tta_settings/templates"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"code"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Templates"})])),_:1})])),_:1}),c(u,{to:"/tta_settings/flowsLogExplorer"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"short_text"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Flows log explorer"})])),_:1})])),_:1}),c(u,{to:"/tta_settings/settings"},{default:h((()=>[c(s,null,{default:h((()=>[c(i,{name:"settings"})])),_:1}),c(a,null,{default:h((()=>[c(n,{text:"Settings"})])),_:1})])),_:1}),d(' <v-list-item to="/tta_settings/usage">\n <v-list-item-icon><v-icon name="bar_chart" /></v-list-item-icon>\n <v-list-item-content>\n <v-text-overflow text="Usage" />\n </v-list-item-content>\n </v-list-item> ')])),_:1})},__file:"settingsmodule/src/TTAnav.vue"},Xs=t=>(f("data-v-4a16637c"),t=t(),m(),t),Ys={key:0,class:"popover"},Qs=Xs((()=>v("br",null,null,-1))),Js=Xs((()=>v("ul",null,[v("li",null,"HTML - preview as webpage"),v("li",null,"PDF (Preview) - watermarked, free"),v("li",null,"PDF - final version, without watermark"),v("li",null,"Code - preview without test input")],-1)));var Zs={__name:"explainPreviewMode",props:{text:{type:String,required:!0}},setup(t){const e=u(!1);return(t,i)=>{const s=r("v-icon");return o(),p("div",{class:"info-popover",onMouseenter:i[0]||(i[0]=t=>e.value=!0),onMouseleave:i[1]||(i[1]=t=>e.value=!1)},[c(s,{name:"question_mark",class:"info-icon"}),e.value?(o(),p("div",Ys,[g(" The preview mode has 4 modes: "),Qs,Js])):d("v-if",!0)],32)}}},tn=[],en=[];function sn(t,e){if(t&&"undefined"!=typeof document){var i,s=!0===e.prepend?"prepend":"append",n=!0===e.singleTag,a="string"==typeof e.container?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var r=tn.indexOf(a);-1===r&&(r=tn.push(a)-1,en[r]={}),i=en[r]&&en[r][s]?en[r][s]:en[r][s]=o()}else i=o();65279===t.charCodeAt(0)&&(t=t.substring(1)),i.styleSheet?i.styleSheet.cssText+=t:i.appendChild(document.createTextNode(t))}function o(){var t=document.createElement("style");if(t.setAttribute("type","text/css"),e.attributes)for(var i=Object.keys(e.attributes),n=0;n<i.length;n++)t.setAttribute(i[n],e.attributes[i[n]]);var r="prepend"===s?"afterbegin":"beforeend";return a.insertAdjacentElement(r,t),t}}sn("\n.info-popover[data-v-4a16637c] {\n position: relative;\n display: flex;\n color: var(--theme--foreground-subdued);\n}\n.info-icon[data-v-4a16637c] {\n margin: auto;\n}\n.popover[data-v-4a16637c] {\n position: absolute;\n top: 175%;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--theme--background);\n color: var(--theme--foreground);\n border: 1px solid var(--theme--border);\n padding: 0.5rem;\n border-radius: 4px;\n white-space: nowrap;\n z-index: 1000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n}\n",{}),Zs.__scopeId="data-v-4a16637c",Zs.__file="settingsmodule/src/pages/templates/explainPreviewMode.vue";const nn=v("div",{class:"field half"},[v("div",{class:"type-label"}," Template name ")],-1),an=v("div",{class:"field half"},[v("div",{class:"type-label"}," Description ")],-1),rn=v("div",{class:"field half"},[v("div",{class:"type-label"},"Format")],-1),on=v("div",{class:"field half"},[v("div",{class:"type-label"}," Orientation ")],-1),ln={key:0,class:"TTA-popup"},hn={class:"TTA-toolbar"},cn={class:"right-side"},dn={class:"setwidth"},un={class:"TTA-action"},pn={class:"TTA-wapper"},gn={class:"devFields"},fn={id:"partSelect"},mn=["src","srcDoc"],vn={class:"tta-notice"},bn=v("a",{href:"https://app.texttoanything.nl",target:"_blank"},"TTA app",-1);var yn=b({__name:"templates",setup(t){const{useCollectionsStore:s,useFlowsStore:n,useNotificationsStore:a}=e(),f=n(),m=a(),b=y((()=>f.flows.filter((t=>"webhook"===t.trigger&&"POST"==t.options.method)).map((t=>({text:t.name,value:t.id}))))),M=u([]),P=u(!1),D=u(!1),I=u("Development"),R=u("html"),L=u(""),F=u(!1),N=u(),O=u(50),B=y((()=>100-O.value)),z=y((()=>100-B.value)),j=u("");function V(t){"Header"==I.value?G.value.header=t:"Body"==I.value?G.value.template=t:G.value.footer=t}function H(t){"Fixed"==G.value.input_type?G.value.input_fixed=t:G.value.input_flow_body=t}w((()=>I.value),(t=>{"Development"==t&&(j.value=""),"Header"==t&&(j.value=G.value.header),"Body"==t&&(j.value=G.value.template),"Footer"==t&&(j.value=G.value.footer)}),{immediate:!0});const $=i(),U={template:"<h1>Hello {{name}}!</h1>",id:-1,name:"",description:"",collection:"",format:"A4",orientation:"portrait",header:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; \n -webkit-print-color-adjust: exact;\n }\n</style>\n<div style='width:100%'>\n <span class='date'></span>\n <span class='title' style='float:right'></span>\n</div>",footer:"\x3c!-- Any content/styling here is seperated from the body on render--\x3e\n<style> \n #header, #footer { \n margin: 0 !important; \n padding: 0 !important; \n font-size: 9px; -webkit-print-color-adjust: exact;\n }\n</style>\n<div\n style=‘width:100%’>\n <div style=‘float:right’><span\n class='pageNumber'></span> / <span class='totalPages'></span>\n </div>\n</div>",input_type:"Fixed",input_fixed:'{"name": "World!"}',input_flow:"",input_flow_body:"{}"},G=u(structuredClone(U)),q=new Ws;async function W(t){if("Flow"==G.value.input_type&&!G.value.input_flow)return;L.value="rendering";let e={};try{if("Flow"==G.value.input_type){const t=await $.post("/flows/trigger/"+G.value.input_flow,JSON.parse(G.value.input_flow_body));if("object"!=typeof t.data)throw new Error("Output of flow should be an object, not an "+typeof t.data);if("name"in t.data&&"code"in t.data&&"status"in t.data)throw new Error(JSON.stringify(t.data));e=t.data}else null==G.value.input_fixed&&(G.value.input_fixed="{}"),e=JSON.parse(G.value.input_fixed);if("html"==t||"code"==t){const i=(G.value.header||"")+(G.value.template||"")+(G.value.footer||""),s=new Blob(['<style>\n .date:before{content: "Date here";font-style: italic; }\n .title:before{content: "Title here";font-style: italic; }\n .pageNumber:before{content: "Pagenumber";font-style: italic; }\n .totalPages:before{content: "Total pages";font-style: italic; }\n </style>'+("code"==t?i:await q.render(q.parse(i),e))],{type:"text/html"});L.value=URL.createObjectURL(s)}else{const t=q.parse(G.value.header||""),i=q.parse(G.value.template),s=q.parse(G.value.footer||""),n=await q.render(t,e),a=await q.render(i,e),r=await q.render(s,e),o=await fetch("/tta/pdf?preview="+("pdf-preview"==R.value?"preview":""),{body:JSON.stringify({...G.value,input_fixed:void 0,input_flow:void 0,input_flow_body:void 0,input_type:void 0,id:void 0,header:n,html:a,footer:r,landscape:"portrait"!=G.value.orientation}),method:"POST",headers:{"Content-Type":"application/json"}}).then((t=>t.blob())).then((t=>URL.createObjectURL(t)));L.value=o}}catch(t){console.error(t),m.add({title:"Error while generating PDF",text:"Please check your console/terminal for the error.",type:"error",dialog:!0}),L.value=URL.createObjectURL(new Blob(["Error occurred: "+((null==t?void 0:t.message)||t)],{type:"text/html"}))}}async function K(){const t=await $.get("/items/TTA_htmltemplates",{params:{limit:-1}});M.value=t.data.data}async function X(){-1==G.value.id?await $.post("/items/TTA_htmltemplates",{...G.value,id:void 0}):await $.patch("/items/TTA_htmltemplates/"+G.value.id,{...G.value,id:void 0}),P.value=!1,K()}async function Y(){await $.delete("/items/TTA_htmltemplates/"+N.value),M.value=M.value.filter((t=>t.id!=N.value)),F.value=!1}function Q({item:t}){G.value=t,D.value=!0}function J(){G.value=structuredClone(U),D.value=!1}function Z(){G.value.template=rt(G.value.template),G.value.footer=rt(G.value.footer),G.value.header=rt(G.value.header)}return w((()=>G.value.id),((t,e)=>{t!=e&&(I.value="",x((()=>{I.value="Body"})))})),w((()=>[G.value.header,G.value.template,G.value.footer,G.value.input_type,G.value.input_flow,G.value.input_fixed,R.value]),(()=>{["html","code"].includes(R.value)&&W(R.value)}),{deep:!0,immediate:!0}),A((async()=>{O.value=parseInt(localStorage.getItem("TTA-widthPartition")||"50"),K()})),w((()=>O.value),(t=>localStorage.setItem("TTA-widthPartition",t+""))),(t,e)=>{const i=r("v-icon"),s=r("v-button"),n=r("v-card-title"),a=r("v-input"),u=r("v-list-item-content"),f=r("v-list-item"),m=r("v-select"),y=r("v-list"),w=r("v-card-text"),x=r("v-card-actions"),A=r("v-card"),$=r("v-dialog"),U=r("VSelect"),q=r("v-slider"),K=r("VButton"),tt=r("VIcon"),et=r("v-table"),it=r("VNotice"),st=r("private-view");return o(),l(st,{title:"Offline templates"},{navigation:h((()=>[c(Ks)])),actions:h((()=>[c(s,{rounded:"",icon:"",onClick:e[0]||(e[0]=t=>P.value=!0)},{default:h((()=>[c(i,{name:"add"})])),_:1}),c($,{modelValue:P.value,"onUpdate:modelValue":e[6]||(e[6]=t=>P.value=t),persistent:!0},{default:h((()=>[c(A,null,{default:h((()=>[c(n,null,{default:h((()=>[g("Create a new HTML template")])),_:1}),c(w,null,{default:h((()=>[c(y,null,{default:h((()=>[c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[nn,c(a,{modelValue:G.value.name,"onUpdate:modelValue":e[1]||(e[1]=t=>G.value.name=t),placeholder:"Template name"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[an,c(a,{modelValue:G.value.description,"onUpdate:modelValue":e[2]||(e[2]=t=>G.value.description=t),placeholder:"Description"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[rn,c(m,{modelValue:G.value.format,"onUpdate:modelValue":e[3]||(e[3]=t=>G.value.format=t),placeholder:"Size",items:["A1","A2","A3","A4","A5","A6","Letter","Legal","Tabloid","Ledger"].map((t=>({text:t,value:t})))},null,8,["modelValue","items"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[on,c(m,{modelValue:G.value.orientation,"onUpdate:modelValue":e[4]||(e[4]=t=>G.value.orientation=t),placeholder:"Orientation",items:["portrait","landscape"].map((t=>({text:t,value:t})))},null,8,["modelValue","items"])])),_:1})])),_:1})])),_:1})])),_:1}),c(x,null,{default:h((()=>[c(s,{secondary:"",onClick:e[5]||(e[5]=t=>P.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{disabled:!G.value.name||!G.value.format,onClick:X},{default:h((()=>[g(" Save ")])),_:1},8,["disabled"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),default:h((()=>[D.value?(o(),p("div",ln,[v("div",hn,[v("div",{onClick:e[7]||(e[7]=t=>P.value=!0),class:"TTA-template-title"},[g(_(G.value.name)+" ",1),c(i,{name:"edit"})]),v("div",cn,[c(U,{modelValue:R.value,"onUpdate:modelValue":e[8]||(e[8]=t=>R.value=t),items:[{text:"HTML",value:"html"},{text:"PDF (Preview)",value:"pdf-preview"},{text:"PDF",value:"pdf"},{text:"Code",value:"code"}],style:{width:"170px"}},null,8,["modelValue","items"]),c(Zs,{text:"This is helpful info."}),v("div",{class:"TTA-action",onClick:Z},[c(i,{name:"vertical_align_center"})]),v("div",{class:"TTA-action",onClick:X},[c(i,{name:"save"})]),v("div",dn,[c(q,{modelValue:O.value,"onUpdate:modelValue":e[9]||(e[9]=t=>O.value=t),min:10,max:90,class:"TTA-slider"},null,8,["modelValue"])]),v("div",un,[c(i,{name:"close",onClick:J})])])]),v("div",pn,[v("div",{style:S("width: "+T(z)+"%"),class:"TTA-editor-wrapper"},["Development"==I.value?(o(),p(k,{key:0},[v("div",gn,[c(m,{modelValue:G.value.input_type,"onUpdate:modelValue":e[10]||(e[10]=t=>G.value.input_type=t),class:"max-w-input",items:[{value:"Flow",text:"Flow"},{value:"Fixed",text:"Fixed"}]},null,8,["modelValue"]),"Flow"==G.value.input_type?(o(),l(m,{key:0,modelValue:G.value.input_flow,"onUpdate:modelValue":e[11]||(e[11]=t=>G.value.input_flow=t),class:"max-w-input",items:T(b)},null,8,["modelValue","items"])):d("v-if",!0)]),"Fixed"==G.value.input_type?(o(),l(C("interface-input-code"),{key:0,class:"TTA-editor",value:G.value.input_fixed,language:"json",onInput:H},null,40,["value"])):d("v-if",!0),"Flow"==G.value.input_type?(o(),l(C("interface-input-code"),{key:1,class:"TTA-editor",value:G.value.input_flow_body,language:"json",onInput:H},null,40,["value"])):d("v-if",!0)],64)):d("v-if",!0),"Development"!=I.value?(o(),l(C("interface-input-code"),{key:1,class:"TTA-editor",value:j.value,language:"htmlmixed",onInput:V},null,40,["value"])):d("v-if",!0),v("div",fn,[c(m,{modelValue:I.value,"onUpdate:modelValue":e[12]||(e[12]=t=>I.value=t),items:[{value:"Header",text:"Header"},{value:"Body",text:"Body"},{value:"Footer",text:"Footer"},{value:"Development",text:"Test input"}]},null,8,["modelValue"])])],4),v("iframe",{class:"TTA-preview",src:"rendering"==L.value?void 0:L.value,srcDoc:"rendering"==L.value?T('\n <html>\n <head>\n <style>\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n font-family: sans-serif;\n background: #f9f9f9;\n }\n .spinner {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n .loader {\n border: 6px solid #f3f3f3;\n border-top: 6px solid #3498db;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n margin-bottom: 10px;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n </head>\n <body>\n <div class="spinner">\n <div class="loader"></div>\n <div>Loading...</div>\n </div>\n </body>\n </html>'):void 0,style:S("width: "+T(B)+"%")},null,12,mn),R.value.startsWith("pdf")?(o(),l(K,{key:0,onClick:e[13]||(e[13]=t=>{W("pdf")}),icon:!0,outlined:!1,id:"generatePDF"},{default:h((()=>[c(i,{name:"refresh"})])),_:1})):d("v-if",!0)])])):d("v-if",!0),c(et,{headers:[{text:"Name",value:"name",sortable:!1},{text:"Description",value:"description",width:600,sortable:!1},{text:"Format",value:"format",sortable:!1},{text:"",value:"del",width:60,sortable:!1}],"onClick:row":Q,items:M.value},{"item.del":h((({item:t})=>[c(K,{onClick:E((e=>{return i=t.id,N.value=i,void(F.value=!0);var i}),["stop"]),outlined:!0,icon:!0,rounded:!0},{default:h((()=>[c(tt,{name:"delete"})])),_:2},1032,["onClick"])])),_:1},8,["items"]),v("div",vn,[c(it,null,{default:h((()=>[g(" You can create online templates in the "),bn,g(" for a better editor experience. ")])),_:1})]),c($,{modelValue:F.value,"onUpdate:modelValue":e[15]||(e[15]=t=>F.value=t),persistent:!0},{default:h((()=>[c(A,null,{default:h((()=>[c(n,null,{default:h((()=>[g(" Are you sure you want to delete this item? This action can not be undone. ")])),_:1}),c(x,null,{default:h((()=>[c(s,{secondary:"",onClick:e[14]||(e[14]=t=>F.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{kind:"danger",onClick:Y},{default:h((()=>[g(" Proceed ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})}}});sn("\n.TTA-popup {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 100;\n display: flex;\n flex-direction: column;\n background-color: var(--theme--form--field--input--background-subdued);\n}\n.TTA-toolbar {\n background-color: var(--theme--form--field--input--background-subdued);\n display: flex;\n justify-content: space-between;\n}\n.TTA-toolbar .right-side {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n.TTA-toolbar .TTA-slider {\n padding-top: 5px;\n}\n.TTA-toolbar .TTA-action {\n padding: 5px;\n cursor: pointer;\n}\n.TTA-toolbar .setwidth {\n display: flex;\n gap: 10px;\n padding-top: 6px;\n}\n.TTA-toolbar .TTA-template-title {\n margin: auto 0;\n font-size: 18px;\n cursor: pointer;\n padding-right: 5px;\n padding-left: 20px;\n border-bottom: 1px solid var(--v-list-item-border-color);\n}\n.TTA-toolbar .TTA-template-title i {\n padding-left: 5px;\n}\n.TTA-wapper {\n display: flex;\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n}\n.TTA-preview {\n flex-grow: 1;\n background-color: white;\n border: 0;\n}\n.TTA-editor {\n flex-grow: 1;\n height: 100%;\n width: 100%;\n max-height: calc(100vh - 130px);\n}\n.TTA-wapper .TTA-editor-wrapper {\n position: relative;\n}\n.TTA-editor > div {\n height: 100% !important;\n border-radius: 0 !important;\n}\n.TTA-editor .CodeMirror {\n height: 100%;\n}\n.TTA-wapper #partSelect {\n position: absolute;\n right: 0;\n top: 0;\n width: 200px;\n}\n.devFields {\n border-top: var(--theme--border-width) solid\n var(--theme--form--field--input--border-color);\n margin-left: 25px;\n margin-bottom: 10px;\n}\n.max-w-input {\n max-width: 250px;\n padding: 10px 0;\n}\n.max-w-input .v-input {\n max-width: 250px;\n margin-bottom: 5px;\n}\n#generatePDF {\n position: fixed;\n top: 69px;\n right: 10px;\n}\n.tta-notice {\n padding: 10px;\n}\n",{}),yn.__file="settingsmodule/src/pages/templates.vue";var wn=b({__name:"virusscanDialog",setup(t){const e=i(),s=u([]),n=u(!1);A((async()=>{const t=await e.get("/folders");s.value=t.data.data.map((t=>({name:t.name,id:t.id,scanning:1==t.TTA_VIRUSSCAN_ENABLED})))}));const a=y((()=>s.value.filter((t=>1==t.scanning)).length));return(t,i)=>{const l=r("VNotice"),d=r("v-button"),u=r("v-table"),f=r("v-drawer"),m=r("v-icon");return o(),p(k,null,[c(f,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=t=>n.value=t),persistent:!0,placement:"right",title:"Manage folders that are scanned for virusses",onCancel:i[1]||(i[1]=t=>n.value=!1),icon:"settings"},{default:h((()=>[c(l,null,{default:h((()=>[g(" Any uploads to the enabled folders will be scanned. ")])),_:1}),c(u,{headers:[{text:"",value:"enabled"},{text:"Name",value:"name"}],items:s.value},{"item.enabled":h((({item:t})=>[c(d,{onClick:i=>async function(t){t.scanning=!t.scanning,await e.patch("/folders/"+t.id,{TTA_VIRUSSCAN_ENABLED:t.scanning})}(t),small:"",danger:!t.scanning},{default:h((()=>[g(_(t.scanning?"Enabled":"Disabled"),1)])),_:2},1032,["onClick","danger"])])),_:1},8,["items"])])),_:1},8,["modelValue"]),c(d,{align:"left",fullWidth:"",small:"",onClick:i[2]||(i[2]=t=>n.value=!0)},{default:h((()=>[c(m,{name:"edit"}),T(a)==s.value.length?(o(),p(k,{key:0},[g(" All ")],64)):(o(),p(k,{key:1},[g(_(T(a))+"/"+_(s.value.length),1)],64)),g(" folders are being scanned ")])),_:1})],64)}}});wn.__file="settingsmodule/src/pages/settings/virusscanDialog.vue";const xn=t=>(f("data-v-7f9dbb3b"),t=t(),m(),t),An={class:"cards-wrapper"},_n=xn((()=>v("span",{class:"field-name"},"RapidAPI token",-1))),Sn=xn((()=>v("span",{class:"field-name"},"RapidAPI virusscanner token",-1))),Tn={class:"field-name info-parent"},kn=xn((()=>v("div",null,[g(" What should happen when a virus is detected? "),v("ul",null,[v("li",null," Delete threads, threads will be deleted immediately "),v("li",null," Trigger flow, the selected flow will be triggered with upload payload ")]),v("div",null," The trigger flow option is ideal for when you want to send a notification or add extra logic. The trigger flow option will not automaticly delete the file. ")],-1))),Cn={key:0},En={class:"field-name info-parent"};var Mn=b({__name:"settings",setup(t){const s=u(""),n=u(""),a=u(!1),f=u(""),m=u(""),b=u(""),w=i(),{useFlowsStore:x}=e(),_=x(),S=y((()=>_.flows.map((t=>({text:t.name,value:t.id})))));async function C(){M({TTA_KEY:s.value,TTA_KEY_VIRUS:n.value},"apikeys")}async function E(){M({TTA_VIRUSSCANNER_ENABLED:a.value,TTA_VIRUSSCANNER_MODE:f.value,TTA_VIRUSSCANNER_FLOW_ID:m.value},"virus")}async function M(t,e){b.value=e,await w.patch("/settings",t),setTimeout((()=>{b.value=""}),500)}return A((async()=>{const t=await w.get("/settings");s.value=t.data.data.TTA_KEY,n.value=t.data.data.TTA_KEY_VIRUS,m.value=t.data.data.TTA_VIRUSSCANNER_FLOW_ID,a.value=1==t.data.data.TTA_VIRUSSCANNER_ENABLED||!1,f.value=t.data.data.TTA_VIRUSSCANNER_MODE||"workflow"})),(t,e)=>{const i=r("v-card-title"),u=r("v-input"),y=r("v-card-text"),w=r("v-icon"),x=r("v-button"),A=r("v-progress-circular"),_=r("v-card-actions"),M=r("v-card"),P=r("VCheckbox"),D=r("VIcon"),I=r("VNotice"),R=r("v-hover"),L=r("v-select"),F=r("private-view");return o(),l(F,{title:"Settings"},{navigation:h((()=>[c(Ks)])),default:h((()=>[v("div",An,[c(M,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("API settings")])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[_n,c(u,{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t)},null,8,["modelValue"])])])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(x,{href:"https://rapidapi.com/Attacler/api/text-to-anything",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(w,{name:"open_in_new"}),g(" Get RapidAPI token ")])),_:1})])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[Sn,c(u,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=t=>n.value=t)},null,8,["modelValue"])])])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(x,{href:"https://rapidapi.com/Attacler/api/virusscan-texttoanything/",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(w,{name:"open_in_new"}),g(" Get RapidAPI virusscanner token ")])),_:1})])),_:1}),c(_,{class:"action-buttons"},{default:h((()=>[c(x,{onClick:C,disabled:"apikeys"==b.value,id:"save-button"},{default:h((()=>["apikeys"!=b.value?(o(),p(k,{key:0},[g(" Save ")],64)):(o(),l(A,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1}),c(M,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("Virusscanner settings")])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[c(P,{modelValue:a.value,"onUpdate:modelValue":e[2]||(e[2]=t=>a.value=t),value:!1},{default:h((()=>[g(" Automatic scanning ")])),_:1},8,["modelValue"])])])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[v("div",null,[v("div",Tn,[g(" Mode "),c(R,null,{default:h((({hover:t})=>[c(D,{name:"info"}),t?(o(),l(I,{key:0,class:"info-popup"},{default:h((()=>[kn])),_:1})):d("v-if",!0)])),_:1})]),c(L,{modelValue:f.value,"onUpdate:modelValue":e[3]||(e[3]=t=>f.value=t),items:[{text:"Delete threats",value:"delete"},{text:"Trigger flow",value:"flow"}]},null,8,["modelValue"])]),"flow"==f.value?(o(),p("div",Cn,[v("div",En,[g(" Flow "),c(R,null,{default:h((({hover:t})=>[c(D,{name:"info"}),t?(o(),l(I,{key:0,class:"info-popup"},{default:h((()=>[g(" This flow will be triggered once a virus has been detected. ")])),_:1})):d("v-if",!0)])),_:1})]),c(L,{items:T(S),showDeselect:"",modelValue:m.value,"onUpdate:modelValue":e[4]||(e[4]=t=>m.value=t)},null,8,["items","modelValue"])])):d("v-if",!0)])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(wn)])),_:1}),c(y,{class:"fields-spacing"},{default:h((()=>[c(x,{href:"https://texttoanything.nl/docs/directus/virusscanner",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(w,{name:"open_in_new"}),g(" Virusscanner documentation ")])),_:1})])),_:1}),c(_,{class:"action-buttons"},{default:h((()=>[c(x,{onClick:E,disabled:"virus"==b.value,id:"save-button"},{default:h((()=>["virus"!=b.value?(o(),p(k,{key:0},[g(" Save ")],64)):(o(),l(A,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1})])])),_:1})}}});sn("\n.w-full[data-v-7f9dbb3b] {\n width: 100%;\n}\n.cards-wrapper[data-v-7f9dbb3b] {\n padding: 0 2.5rem;\n display: flex;\n flex-wrap: wrap;\n gap: 2.5rem;\n}\n.fields-spacing[data-v-7f9dbb3b] {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n#save-button[data-v-7f9dbb3b] {\n margin-left: auto;\n}\n.info-parent[data-v-7f9dbb3b] {\n position: relative;\n display: flex;\n gap: 5px;\n}\n.info-parent .info-popup[data-v-7f9dbb3b] {\n position: absolute;\n top: 25px;\n left: 0;\n z-index: 10;\n}\n",{}),Mn.__scopeId="data-v-7f9dbb3b",Mn.__file="settingsmodule/src/pages/settings.vue";var Pn=b({__name:"dateTimePicker",props:{value:{type:[String,null],required:!0}},setup(t,{emit:e}){const i=t,s=u(),n=u(i.value);const a=y((()=>function(t){const e=new Date(t||-1);return e instanceof Date&&!isNaN(e.getTime())&&1970!=e.getFullYear()}(null==n?void 0:n.value)));return w((()=>n.value),(()=>{a.value&&(console.log(" Updating with",n.value),e("update:modelValue",n.value))})),(t,e)=>{const i=r("v-input"),l=r("v-date-picker"),d=r("v-menu");return o(),p("div",null,[c(d,{ref_key:"dateTimeMenu",ref:s,"close-on-content-click":!1,attached:"","full-height":"",seamless:""},{activator:h((({toggle:t,active:e})=>[c(i,{active:e,clickable:"",readonly:"",placeholder:T(a)?void 0:n.value,onClick:t},M({_:2},[T(a)?{name:"prepend",fn:h((()=>[g(_(n.value),1)])),key:"0"}:void 0]),1032,["active","placeholder","onClick"])])),default:h((()=>{var t;return[c(l,{type:"date","use-24":!0,"include-seconds":!1,"model-value":n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),onClose:null==(t=s.value)?void 0:t.deactivate},null,8,["model-value","onClose"])]})),_:1},512)])}}});sn("\n.v-icon.today-icon[data-v-42405105]:hover,\n.v-icon.today-icon.active[data-v-42405105] {\n --v-icon-color: var(--theme--primary);\n}\n.v-icon.clear-icon[data-v-42405105]:hover,\n.v-icon.clear-icon.active[data-v-42405105] {\n --v-icon-color: var(--theme--danger);\n}\n",{}),Pn.__scopeId="data-v-42405105",Pn.__file="settingsmodule/src/components/dateTimePicker.vue";var Dn={d:(t,e)=>{for(var i in e)Dn.o(e,i)&&!Dn.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},In={};function Rn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}function Ln(t,e){if(t){if("string"==typeof t)return Rn(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Rn(t,e):void 0}}function Fn(t){return function(t){if(Array.isArray(t))return Rn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ln(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nn(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Dn.d(In,{Z:()=>ta});const On=(Vn={computed:()=>a.computed,createTextVNode:()=>a.createTextVNode,createVNode:()=>a.createVNode,defineComponent:()=>a.defineComponent,reactive:()=>a.reactive,ref:()=>a.ref,watch:()=>a.watch,watchEffect:()=>a.watchEffect},Hn={},Dn.d(Hn,Vn),Hn),Bn=(0,On.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var t=this.data,e=this.onClick;return(0,On.createVNode)("span",{class:"vjs-tree-brackets",onClick:e},[t])}}),zn=(0,On.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(t,e){var i=e.emit;return{uiType:(0,On.computed)((function(){return t.isMultiple?"checkbox":"radio"})),model:(0,On.computed)({get:function(){return t.checked},set:function(t){return i("update:modelValue",t)}})}},render:function(){var t=this.uiType,e=this.model,i=this.$emit;return(0,On.createVNode)("label",{class:["vjs-check-controller",e?"is-checked":""],onClick:function(t){return t.stopPropagation()}},[(0,On.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(t)},null),(0,On.createVNode)("input",{checked:e,class:"vjs-check-controller-original is-".concat(t),type:t,onChange:function(){return i("change",e)}},null)])}}),jn=(0,On.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var t=this.nodeType,e=this.onClick,i="objectStart"===t||"arrayStart"===t;return i||"objectCollapsed"===t||"arrayCollapsed"===t?(0,On.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(i?"open":"close"),onClick:e},[(0,On.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,On.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var Vn,Hn;function $n(t){return $n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$n(t)}function Un(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Gn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=(arguments.length>3?arguments[3]:void 0)||{},n=s.key,a=s.index,r=s.type,o=void 0===r?"content":r,l=s.showComma,h=void 0!==l&&l,c=s.length,d=void 0===c?1:c,u=Un(t);if("array"===u){var p=qn(t.map((function(t,s,n){return Gn(t,"".concat(e,"[").concat(s,"]"),i+1,{index:s,showComma:s!==n.length-1,length:d,type:o})})));return[Gn("[",e,i,{showComma:!1,key:n,length:t.length,type:"arrayStart"})[0]].concat(p,Gn("]",e,i,{showComma:h,length:t.length,type:"arrayEnd"})[0])}if("object"===u){var g=Object.keys(t),f=qn(g.map((function(s,n,a){return Gn(t[s],/^[a-zA-Z_]\w*$/.test(s)?"".concat(e,".").concat(s):"".concat(e,'["').concat(s,'"]'),i+1,{key:s,showComma:n!==a.length-1,length:d,type:o})})));return[Gn("{",e,i,{showComma:!1,key:n,index:a,length:g.length,type:"objectStart"})[0]].concat(f,Gn("}",e,i,{showComma:h,length:g.length,type:"objectEnd"})[0])}return[{content:t,level:i,key:n,index:a,path:e,showComma:h,length:d,type:o}]}function qn(t){if("function"==typeof Array.prototype.flat)return t.flat();for(var e=Fn(t),i=[];e.length;){var s=e.shift();Array.isArray(s)?e.unshift.apply(e,Fn(s)):i.push(s)}return i}function Wn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null==t)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if("object"!==$n(t))return t;if(e.get(t))return e.get(t);if(Array.isArray(t)){var i=t.map((function(t){return Wn(t,e)}));return e.set(t,i),i}var s={};for(var n in t)s[n]=Wn(t[n],e);return e.set(t,s),s}function Kn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function Xn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Kn(Object(i),!0).forEach((function(e){Nn(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Kn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Yn={showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const Qn=(0,On.defineComponent)({name:"TreeNode",props:Xn(Xn({},Yn),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(t,e){var i=e.emit,s=(0,On.computed)((function(){return Un(t.node.content)})),n=(0,On.computed)((function(){return"vjs-value vjs-value-".concat(s.value)})),a=(0,On.computed)((function(){return t.showDoubleQuotes?'"'.concat(t.node.key,'"'):t.node.key})),r=(0,On.computed)((function(){return"multiple"===t.selectableType})),o=(0,On.computed)((function(){return"single"===t.selectableType})),l=(0,On.computed)((function(){return t.nodeSelectable(t.node)&&(r.value||o.value)})),h=(0,On.reactive)({editing:!1}),c=function(e){var s,n,a="null"===(n=null===(s=e.target)||void 0===s?void 0:s.value)?null:"undefined"===n?void 0:"true"===n||"false"!==n&&(n[0]+n[n.length-1]==='""'||n[0]+n[n.length-1]==="''"?n.slice(1,-1):"number"==typeof Number(n)&&!isNaN(Number(n))||"NaN"===n?Number(n):n);i("valueChange",a,t.node.path)},d=(0,On.computed)((function(){var e,i=null===(e=t.node)||void 0===e?void 0:e.content;return null===i?i="null":void 0===i&&(i="undefined"),"string"===s.value?'"'.concat(i,'"'):i+""})),u=function(){var e=t.renderNodeValue;return e?e({node:t.node,defaultValue:d.value}):d.value},p=function(){i("bracketsClick",!t.collapsed,t.node)},g=function(){i("iconClick",!t.collapsed,t.node)},f=function(){i("selectedChange",t.node)},m=function(){i("nodeClick",t.node),l.value&&t.selectOnClickNode&&i("selectedChange",t.node)},v=function(e){if(t.editable&&!h.editing){h.editing=!0;var i=function t(i){var s;i.target!==e.target&&(null===(s=i.target)||void 0===s?void 0:s.parentElement)!==e.target&&(h.editing=!1,document.removeEventListener("click",t))};document.removeEventListener("click",i),document.addEventListener("click",i)}};return function(){var e,i=t.node;return(0,On.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":t.showSelectController,"has-carets":t.showIcon,"is-highlight":t.highlightSelectedNode&&t.checked,dark:"dark"===t.theme},onClick:m,style:t.style},[t.showLineNumber&&(0,On.createVNode)("span",{class:"vjs-node-index"},[i.id+1]),t.showSelectController&&l.value&&"objectEnd"!==i.type&&"arrayEnd"!==i.type&&(0,On.createVNode)(zn,{isMultiple:r.value,checked:t.checked,onChange:f},null),(0,On.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(i.level)).map((function(e,i){return(0,On.createVNode)("div",{key:i,class:{"vjs-indent-unit":!0,"has-line":t.showLine}},null)})),t.showIcon&&(0,On.createVNode)(jn,{nodeType:i.type,onClick:g},null)]),i.key&&(0,On.createVNode)("span",{class:"vjs-key"},[(e=t.renderNodeKey,e?e({node:t.node,defaultKey:a.value||""}):a.value),(0,On.createVNode)("span",{class:"vjs-colon"},[":".concat(t.showKeyValueSpace?" ":"")])]),(0,On.createVNode)("span",null,["content"!==i.type&&i.content?(0,On.createVNode)(Bn,{data:i.content.toString(),onClick:p},null):(0,On.createVNode)("span",{class:n.value,onClick:!t.editable||t.editableTrigger&&"click"!==t.editableTrigger?void 0:v,onDblclick:t.editable&&"dblclick"===t.editableTrigger?v:void 0},[t.editable&&h.editing?(0,On.createVNode)("input",{value:d.value,onChange:c,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):u()]),i.showComma&&(0,On.createVNode)("span",null,[","]),t.showLength&&t.collapsed&&(0,On.createVNode)("span",{class:"vjs-comment"},[(0,On.createTextVNode)(" // "),i.length,(0,On.createTextVNode)(" items ")])])])}}});function Jn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function Zn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(i),!0).forEach((function(e){Nn(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Jn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}const ta=(0,On.defineComponent)({name:"Tree",props:Zn(Zn({},Yn),{},{data:{type:[String,Number,Boolean,Array,Object],default:null},collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},rootPath:{type:String,default:"root"},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue"],emits:["nodeClick","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(t,e){var i=e.emit,s=e.slots,n=(0,On.ref)(),a=(0,On.computed)((function(){return Gn(t.data,t.rootPath)})),r=function(e,i){return a.value.reduce((function(s,n){var a,r=n.level>=e||n.length>=i,o=null===(a=t.pathCollapsible)||void 0===a?void 0:a.call(t,n);return"objectStart"!==n.type&&"arrayStart"!==n.type||!r&&!o?s:Zn(Zn({},s),{},Nn({},n.path,1))}),{})},o=(0,On.reactive)({translateY:0,visibleData:null,hiddenPaths:r(t.deep,t.collapsedNodeLength)}),l=(0,On.computed)((function(){for(var t=null,e=[],i=a.value.length,s=0;s<i;s++){var n=Zn(Zn({},a.value[s]),{},{id:s}),r=o.hiddenPaths[n.path];if(t&&t.path===n.path){var l="objectStart"===t.type,h=Zn(Zn(Zn({},n),t),{},{showComma:n.showComma,content:l?"{...}":"[...]",type:l?"objectCollapsed":"arrayCollapsed"});t=null,e.push(h)}else{if(r&&!t){t=n;continue}if(t)continue;e.push(n)}}return e})),h=(0,On.computed)((function(){var e=t.selectedValue;return e&&"multiple"===t.selectableType&&Array.isArray(e)?e:[e]})),c=(0,On.computed)((function(){return!t.selectableType||t.selectOnClickNode||t.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."})),d=function(){var e=l.value;if(t.virtual){var i,s=t.height/t.itemHeight,a=(null===(i=n.value)||void 0===i?void 0:i.scrollTop)||0,r=Math.floor(a/t.itemHeight),h=r<0?0:r+s>e.length?e.length-s:r;h<0&&(h=0);var c=h+s;o.translateY=h*t.itemHeight,o.visibleData=e.filter((function(t,e){return e>=h&&e<c}))}else o.visibleData=e},u=function(){d()},p=function(e){var s,n=e.path,a=t.selectableType;if("multiple"===a){var r=h.value.findIndex((function(t){return t===n})),o=Fn(h.value);-1!==r?o.splice(r,1):o.push(n),i("update:selectedValue",o),i("selectedChange",o,Fn(h.value))}else if("single"===a&&h.value[0]!==n){var l=(s=h.value,function(t){if(Array.isArray(t))return t}(s)||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,s,n=[],a=!0,r=!1;try{for(e=e.call(t);!(a=(i=e.next()).done)&&(n.push(i.value),1!==n.length);a=!0);}catch(t){r=!0,s=t}finally{try{a||null==e.return||e.return()}finally{if(r)throw s}}return n}}(s)||Ln(s,1)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],c=n;i("update:selectedValue",c),i("selectedChange",c,l)}},g=function(t){i("nodeClick",t)},f=function(t,e){if(t)o.hiddenPaths=Zn(Zn({},o.hiddenPaths),{},Nn({},e,1));else{var i=Zn({},o.hiddenPaths);delete i[e],o.hiddenPaths=i}},m=function(e,s){t.collapsedOnClickBrackets&&f(e,s.path),i("bracketsClick",e,s)},v=function(t,e){f(t,e.path),i("iconClick",t,e)},b=function(e,s){var n=Wn(t.data),a=t.rootPath;new Function("data","val","data".concat(s.slice(a.length),"=val"))(n,e),i("update:data",n)};return(0,On.watchEffect)((function(){c.value&&function(t){throw new Error("[VueJSONPretty] ".concat(t))}(c.value)})),(0,On.watchEffect)((function(){l.value&&d()})),(0,On.watch)((function(){return t.deep}),(function(e){e&&(o.hiddenPaths=r(e,t.collapsedNodeLength))})),(0,On.watch)((function(){return t.collapsedNodeLength}),(function(e){e&&(o.hiddenPaths=r(t.deep,e))})),function(){var e,i,r=null!==(e=t.renderNodeKey)&&void 0!==e?e:s.renderNodeKey,c=null!==(i=t.renderNodeValue)&&void 0!==i?i:s.renderNodeValue,d=o.visibleData&&o.visibleData.map((function(e){return(0,On.createVNode)(Qn,{key:e.id,node:e,collapsed:!!o.hiddenPaths[e.path],theme:t.theme,showDoubleQuotes:t.showDoubleQuotes,showLength:t.showLength,checked:h.value.includes(e.path),selectableType:t.selectableType,showLine:t.showLine,showLineNumber:t.showLineNumber,showSelectController:t.showSelectController,selectOnClickNode:t.selectOnClickNode,nodeSelectable:t.nodeSelectable,highlightSelectedNode:t.highlightSelectedNode,editable:t.editable,editableTrigger:t.editableTrigger,showIcon:t.showIcon,showKeyValueSpace:t.showKeyValueSpace,renderNodeKey:r,renderNodeValue:c,onNodeClick:g,onBracketsClick:m,onIconClick:v,onSelectedChange:p,onValueChange:b,style:t.itemHeight&&20!==t.itemHeight?{lineHeight:"".concat(t.itemHeight,"px")}:{}},null)}));return(0,On.createVNode)("div",{ref:n,class:{"vjs-tree":!0,"is-virtual":t.virtual,dark:"dark"===t.theme},onScroll:t.virtual?u:void 0,style:t.showLineNumber?Zn({paddingLeft:"".concat(12*Number(a.value.length.toString().length),"px")},t.style):t.style},[t.virtual?(0,On.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(t.height,"px")}},[(0,On.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(l.value.length*t.itemHeight,"px")}},[(0,On.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(o.translateY,"px)")}},[d])])]):d])}}});var ea=In.Z;sn('.vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit{width:1em}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-value{word-break:break-word}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}',{});const ia=t=>(f("data-v-2ded8f93"),t=t(),m(),t),sa={class:"content"},na=ia((()=>v("div",{class:"header"},[v("span",{class:"dot success"}),v("span",{class:"type-label"}," Trigger ")],-1))),aa={class:"inset"},ra={class:"steps"},oa={class:"header"},la={class:"type-label"},ha={class:"subdued"},ca={class:"inset"};var da=b({__name:"displayFlowLogs",props:{currentLog:{type:null,required:!0}},setup(t,{emit:e}){const{currentLog:i}=t,s=u(""),n=y((()=>{const{data:t}=i;if(!t)return[];return((null==t?void 0:t.steps)||[]).map((e=>({...e,status:"resolve"===e.status?"success":"error",operationType:e.operationType||"",options:e.options?e.options:null,data:t.data[e.key]?t.data[e.key]:null})))}));function a(t,e){console.log(i),s.value=t+e.path.substring(4)}function f(){navigator.clipboard.writeText(s.value)}return(i,u)=>{const m=r("v-icon"),b=r("v-button"),y=r("v-detail"),w=r("v-drawer"),x=P("tooltip");return o(),l(w,{modelValue:!0,title:"Flow log",icon:"fact_check",onEsc:u[1]||(u[1]=t=>e("close")),onCancel:u[2]||(u[2]=t=>e("close"))},{actions:h((()=>[s.value?(o(),l(b,{key:0,class:"ml-auto",onClick:f},{default:h((()=>[g(_(s.value)+" ",1),c(m,{name:"copy_all"})])),_:1})):d("v-if",!0)])),default:h((()=>[v("div",sa,[na,v("div",aa,[c(y,{label:"Payload",class:"payload"},{default:h((()=>[c(T(ea),{data:t.currentLog.data.data.$trigger,virtual:"",onNodeClick:u[0]||(u[0]=t=>a("$trigger",t)),selectableType:"single"},null,8,["data"])])),_:1})]),v("div",ra,[(o(!0),p(k,null,D(T(n),(t=>(o(),p("div",{key:t.id,class:"step"},[v("div",oa,[v("span",{class:I(["dot",t.status])},null,2),R((o(),p("span",la,[g(_(t.key)+" ",1),v("span",ha," "+_(t.operationType),1)])),[[x,t.key]])]),v("div",ca,[t.options?(o(),l(y,{key:0,label:"Options"},{default:h((()=>[c(T(ea),{data:t.options,virtual:""},null,8,["data"])])),_:2},1024)):d("v-if",!0),null!==t.data?(o(),l(y,{key:1,label:"Payload",class:"payload"},{default:h((()=>[c(T(ea),{data:t.data,virtual:"",onNodeClick:e=>a(t.key,e),selectableType:"single"},null,8,["data","onNodeClick"])])),_:2},1024)):d("v-if",!0)])])))),128))])])])),_:1})}}});sn("\n.content[data-v-2ded8f93] {\n padding: 1rem;\n}\n.header[data-v-2ded8f93] {\n font-size: 1.2rem;\n font-weight: bold;\n}\n.dot[data-v-2ded8f93] {\n width: 0.75rem;\n height: 0.75rem;\n border-radius: 50%;\n margin-right: 0.5rem;\n display: inline-block;\n}\n.dot.success[data-v-2ded8f93] {\n background-color: var(--primary);\n}\n.dot.error[data-v-2ded8f93] {\n background-color: var(--red);\n}\n.step[data-v-2ded8f93] {\n margin: 0.5rem 0;\n position: relative;\n}\n.inset[data-v-2ded8f93] {\n border-left: var(--theme--border-width) solid\n var(--theme--border-color-subdued);\n margin-left: 0.35rem;\n padding-top: 5px;\n padding-left: 1rem;\n margin-top: -5px;\n}\n",{});sn("\n.payload .vjs-value,\n.payload .vjs-key {\n cursor: pointer;\n}\n",{}),da.__scopeId="data-v-2ded8f93",da.__file="settingsmodule/src/components/displayFlowLogs.vue";const ua=t=>(f("data-v-231dc418"),t=t(),m(),t),pa={class:"px-5 w-full"},ga=["title"],fa=["title"],ma={class:"filters"},va=ua((()=>v("h2",null,"Filter",-1))),ba=ua((()=>v("div",{class:"field-name"},"Flow",-1))),ya=ua((()=>v("div",{class:"field-name"},"From date",-1))),wa=ua((()=>v("div",{class:"field-name"},"To date",-1))),xa=ua((()=>v("div",{class:"field-name"},"Sorting order",-1)));var Aa=b({__name:"flowLogsExplorer",setup(t){const{useFlowsStore:s}=e(),n=i(),a=s(),p=u(),f=u([]),m=u(),b=u(),w=u(""),x=u("all"),S=u(),k=u("Descending");async function C(){const t=await n.get("/revisions",{params:{"filter[_and][0][collection][_eq]":"directus_flows","filter[_and][1][item][_eq]":p.value||void 0,"filter[_and][2][version][_null]":!0,"filter[_and][3][activity][action][_eq]":"run","filter[_and][4][activity][timestamp][_gte]":m.value?m.value:void 0,"filter[_and][4][activity][timestamp][_lte]":b.value?b.value+"T23:59:59":void 0,"fields[0]":"*","fields[1]":"activity.*",limit:2e3,sort:"Descending"==k.value?["-activity.timestamp"]:["activity.timestamp"]}});f.value=t.data.data}A((()=>{const t=new Date;t.setDate(t.getDate()-7),m.value=t.toISOString().split("T")[0],b.value=(new Date).toISOString().split("T")[0]}));const E=y((()=>{if(!w.value&&"all"==x.value)return f.value;let t=f.value;return"all"!=x.value&&(t=t.filter((t=>t.data.steps[t.data.steps.length-1].status==("error"==x.value?"reject":"resolve")))),w.value&&(t=f.value.filter((t=>{const e=t.data.data.$trigger;return JSON.stringify(e).toLowerCase().includes(w.value.toLowerCase())}))),t})),M=y((()=>a.flows.map((t=>({text:t.name,value:t.id})))));function P(t){var e;if(0==t.data.steps.length)return"";const i=null==(e=t.data.steps[t.data.steps.length-1])?void 0:e.key;return i?t.data.data[i]:""}function D(t){S.value=t.item}function R(t){if(0==t.data.steps.length)return!1;return"resolve"!=t.data.steps[t.data.steps.length-1].status}return(t,e)=>{const i=r("v-icon"),s=r("v-table"),n=r("v-select"),a=r("v-button"),u=r("v-input"),f=r("VSelect"),y=r("private-view");return o(),l(y,{title:"Flow logs explorer"},{navigation:h((()=>[c(Ks)])),sidebar:h((()=>[v("div",ma,[va,v("div",null,[ba,c(n,{items:T(M),showDeselect:"",modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=t=>p.value=t)},null,8,["items","modelValue"])]),v("div",null,[ya,m.value?(o(),l(Pn,{key:0,modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=t=>m.value=t),value:m.value},null,8,["modelValue","value"])):d("v-if",!0)]),v("div",null,[wa,b.value?(o(),l(Pn,{key:0,modelValue:b.value,"onUpdate:modelValue":e[2]||(e[2]=t=>b.value=t),value:b.value},null,8,["modelValue","value"])):d("v-if",!0)]),v("div",null,[xa,c(n,{modelValue:k.value,"onUpdate:modelValue":e[3]||(e[3]=t=>k.value=t),items:["Descending","Ascending"]},null,8,["modelValue"])]),c(a,{onClick:C,fullWidth:!0},{default:h((()=>[g("Search")])),_:1}),v("div",null,[g(" Input filter "),c(u,{modelValue:w.value,"onUpdate:modelValue":e[4]||(e[4]=t=>w.value=t),placeholder:"Input filter",class:"w-full"},null,8,["modelValue"])]),v("div",null,[g(" Status "),c(f,{modelValue:x.value,"onUpdate:modelValue":e[5]||(e[5]=t=>x.value=t),items:[{text:"All",value:"all"},{text:"Error",value:"error"},{text:"Success",value:"success"}]},null,8,["modelValue"])])]),S.value?(o(),l(da,{key:0,onClose:e[6]||(e[6]=t=>S.value=null),currentLog:S.value},null,8,["currentLog"])):d("v-if",!0)])),default:h((()=>[v("div",pa,[c(s,{headers:[{text:"Status",value:"status",sortable:!1,width:100},{text:"Timestamp",value:"timestamp",sortable:!1,width:100},{text:"Input",value:"input",sortable:!1,width:1e3},{text:"Output",value:"output",sortable:!1,width:1e3}],items:T(E),"onClick:row":D},{"item.status":h((({item:t})=>[c(i,{name:R(t)?"error":"check_circle",class:I(["flowLogStatus",{error:R(t),success:!R(t)}])},null,8,["name","class"])])),"item.timestamp":h((({item:t})=>[g(_(new Date(t.activity.timestamp).toLocaleDateString()),1)])),"item.input":h((({item:t})=>[v("div",{title:JSON.stringify(t.data.data.$trigger,null,2)},_(t.data.data.$trigger),9,ga)])),"item.output":h((({item:t})=>[v("div",{title:JSON.stringify(P(t),null,2)},_(P(t)),9,fa)])),_:1},8,["items"])])])),_:1})}}});sn("\n.w-full[data-v-231dc418] {\n width: 100%;\n}\n.px-5[data-v-231dc418] {\n padding: 0 2.5rem;\n}\n.date-input[data-v-231dc418] {\n min-width: 300px;\n}\n.filters[data-v-231dc418] {\n padding: 10px 5px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.filters h2[data-v-231dc418] {\n font-size: 1.5rem;\n font-weight: bold;\n}\n.grow[data-v-231dc418],\n.grow button[data-v-231dc418] {\n flex-grow: 1;\n}\n.flowLogStatus.success[data-v-231dc418] {\n color: var(--primary);\n}\n.flowLogStatus.error[data-v-231dc418] {\n color: var(--red);\n}\n",{}),Aa.__scopeId="data-v-231dc418",Aa.__file="settingsmodule/src/pages/flowLogsExplorer.vue";var _a=s({id:"tta_settings",name:"Text to anything settings",icon:"text_fields",routes:[{path:"",redirect:"/tta_settings/templates"},{path:"templates",component:yn},{path:"settings",component:Mn},{path:"flowsLogExplorer",component:Aa}]}),Sa=b({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=L("api"),n=u(0),a=u([]);return A((async()=>{w((()=>n.value),((t,i)=>{t!=i&&e("input",t)}));const t=await s.get("/tta/pdf/onlineTemplates");a.value=t.data.map((t=>({text:t.name,value:t.id}))),t.data.find((t=>t.id==i.value))?n.value=parseInt(i.value):n.value=null})),(t,e)=>{const i=r("v-select");return o(),l(i,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),items:a.value},null,8,["modelValue","items"])}}});Sa.__file="pdf/PDFOnlineTemplateSelector/src/interface.vue";var Ta=n({id:"TTA-pdf-online-template-selector",name:"PDF online template selector",icon:"picture_as_pdf",description:"Selector for an online PDF template for Text To Anything",component:Sa,options:null,types:["string"]}),ka=b({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=L("api"),n=u(""),a=u([]);return A((async()=>{w((()=>n.value),((t,i)=>{t!=i&&e("input",t)}));const t=await s.get("/items/TTA_htmltemplates");a.value=t.data.data.map((t=>({text:t.name,value:t.id}))),n.value=i.value})),(t,e)=>{const i=r("v-select");return o(),l(i,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),items:a.value},null,8,["modelValue","items"])}}});ka.__file="pdf/PDFTemplateSelector/src/interface.vue";var Ca=n({id:"TTA-pdf-template-selector",name:"PDF template selector",icon:"picture_as_pdf",description:"Selector for a PDF template for Text To Anything",component:ka,options:null,types:["string"]}),Ea=b({__name:"interface",props:{label:{type:String,required:!0},flow:{type:null,required:!0},primaryKey:{type:null,required:!0}},setup(t){const e=t,s=i(),n=u(!1);async function a(){n.value=!0;try{const t=await s.post("/flows/trigger/"+e.flow,{id:e.primaryKey});window.open("/assets/"+t.data,"_blank")}catch(t){}n.value=!1}return(t,i)=>{const s=r("v-button");return o(),l(s,{onClick:a,loading:n.value,disabled:n.value},{default:h((()=>[g(_(e.label),1)])),_:1},8,["loading","disabled"])}}});Ea.__file="pdf/GeneratePDFFromTemplateInterface/src/interface.vue";var Ma=n({id:"tta-download-interface",name:"Download interface",icon:"sim_card_download",description:"Download files based on a flow. (Text to anything)",hideLabel:!0,hideLoader:!0,component:Ea,options:()=>{const{useFlowsStore:t}=e(),i=t();return[{field:"label",type:"string",name:"$t:label",meta:{width:"full",interface:"system-input-translated-string",options:{placeholder:"$t:label"}}},{field:"flow",name:"$t:operations.trigger.flow",type:"string",meta:{width:"full",interface:"select-dropdown",options:{choices:y((()=>i.flows.filter((t=>"webhook"===t.trigger&&"POST"==t.options.method)).map((t=>({text:t.name,value:t.id}))))),iconRight:"bolt",placeholder:"$t:a_flow_uuid"}}}]},types:["string"]});
|
|
2
2
|
/**
|
|
3
3
|
* @licstart The following is the entire license notice for the
|
|
4
4
|
* JavaScript code in this page
|
package/package.json
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/Attacler/TextToAnything-Directus/issues"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/Attacler/TextToAnything-Directus.git"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"directus",
|
|
20
|
-
"directus-extension",
|
|
21
|
-
"directus-custom-bundle"
|
|
22
|
-
],
|
|
23
|
-
"files": [
|
|
24
|
-
"dist"
|
|
25
|
-
],
|
|
26
|
-
"directus:extension": {
|
|
27
|
-
"type": "bundle",
|
|
28
|
-
"path": {
|
|
29
|
-
"app": "dist/app.js",
|
|
30
|
-
"api": "dist/api.js"
|
|
2
|
+
"name": "directus-extension-texttoanything",
|
|
3
|
+
"description": "Generate PDF`s/QRcodes/Barcodes, use OCR and virusscanner within Directus!",
|
|
4
|
+
"version": "1.7.3",
|
|
5
|
+
"icon": "text_fields",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Attacler/Bart",
|
|
8
|
+
"email": "info@texttoanything.nl"
|
|
31
9
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "operation",
|
|
51
|
-
"name": "GeneratePDFFromTemplate",
|
|
52
|
-
"source": {
|
|
53
|
-
"app": "pdf/GeneratePDFGenerateFromTemplate/src/app.ts",
|
|
54
|
-
"api": "pdf/GeneratePDFGenerateFromTemplate/src/api.ts"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "operation",
|
|
59
|
-
"name": "GenerateQRCode",
|
|
60
|
-
"source": {
|
|
61
|
-
"app": "GenerateQRCode/src/app.ts",
|
|
62
|
-
"api": "GenerateQRCode/src/api.ts"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "hook",
|
|
67
|
-
"name": "bootstrap",
|
|
68
|
-
"source": "installationhook/src/index.ts"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"type": "module",
|
|
72
|
-
"name": "settings module",
|
|
73
|
-
"source": "settingsmodule/src/index.ts"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"type": "interface",
|
|
77
|
-
"name": "Online PDF template selector",
|
|
78
|
-
"source": "pdf/PDFOnlineTemplateSelector/src/index.ts"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"type": "interface",
|
|
82
|
-
"name": "PDF template selector",
|
|
83
|
-
"source": "pdf/PDFTemplateSelector/src/index.ts"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"type": "interface",
|
|
87
|
-
"name": "PDF generator interface",
|
|
88
|
-
"source": "pdf/GeneratePDFFromTemplateInterface/src/index.ts"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"type": "interface",
|
|
92
|
-
"name": "ocr/OCR-interface",
|
|
93
|
-
"source": "ocr/OCR-interface/src/index.ts"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"type": "endpoint",
|
|
97
|
-
"name": "Text To Anything endpoint",
|
|
98
|
-
"source": "TTA-endpoint/src/index.ts"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"type": "operation",
|
|
102
|
-
"name": "OCR-operator",
|
|
103
|
-
"source": {
|
|
104
|
-
"app": "ocr/OCR-operator/app.ts",
|
|
105
|
-
"api": "ocr/OCR-operator/api.ts"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Attacler/TextToAnything-Directus/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/Attacler/TextToAnything-Directus.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"directus",
|
|
20
|
+
"directus-extension",
|
|
21
|
+
"directus-custom-bundle"
|
|
22
|
+
],
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
108
25
|
],
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
26
|
+
"directus:extension": {
|
|
27
|
+
"type": "bundle",
|
|
28
|
+
"path": {
|
|
29
|
+
"app": "dist/app.js",
|
|
30
|
+
"api": "dist/api.js"
|
|
31
|
+
},
|
|
32
|
+
"entries": [
|
|
33
|
+
{
|
|
34
|
+
"type": "operation",
|
|
35
|
+
"name": "GenerateBarcode",
|
|
36
|
+
"source": {
|
|
37
|
+
"app": "GenerateBarcode/src/app.ts",
|
|
38
|
+
"api": "GenerateBarcode/src/api.ts"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "operation",
|
|
43
|
+
"name": "GeneratePDF",
|
|
44
|
+
"source": {
|
|
45
|
+
"app": "pdf/GeneratePDF/src/app.ts",
|
|
46
|
+
"api": "pdf/GeneratePDF/src/api.ts"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "operation",
|
|
51
|
+
"name": "GeneratePDFFromTemplate",
|
|
52
|
+
"source": {
|
|
53
|
+
"app": "pdf/GeneratePDFGenerateFromTemplate/src/app.ts",
|
|
54
|
+
"api": "pdf/GeneratePDFGenerateFromTemplate/src/api.ts"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "operation",
|
|
59
|
+
"name": "GenerateQRCode",
|
|
60
|
+
"source": {
|
|
61
|
+
"app": "GenerateQRCode/src/app.ts",
|
|
62
|
+
"api": "GenerateQRCode/src/api.ts"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "hook",
|
|
67
|
+
"name": "bootstrap",
|
|
68
|
+
"source": "installationhook/src/index.ts"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "module",
|
|
72
|
+
"name": "settings module",
|
|
73
|
+
"source": "settingsmodule/src/index.ts"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "interface",
|
|
77
|
+
"name": "Online PDF template selector",
|
|
78
|
+
"source": "pdf/PDFOnlineTemplateSelector/src/index.ts"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "interface",
|
|
82
|
+
"name": "PDF template selector",
|
|
83
|
+
"source": "pdf/PDFTemplateSelector/src/index.ts"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "interface",
|
|
87
|
+
"name": "PDF generator interface",
|
|
88
|
+
"source": "pdf/GeneratePDFFromTemplateInterface/src/index.ts"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "interface",
|
|
92
|
+
"name": "ocr/OCR-interface",
|
|
93
|
+
"source": "ocr/OCR-interface/src/index.ts"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": "endpoint",
|
|
97
|
+
"name": "Text To Anything endpoint",
|
|
98
|
+
"source": "TTA-endpoint/src/index.ts"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "operation",
|
|
102
|
+
"name": "OCR-operator",
|
|
103
|
+
"source": {
|
|
104
|
+
"app": "ocr/OCR-operator/app.ts",
|
|
105
|
+
"api": "ocr/OCR-operator/api.ts"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"host": "^10.0.0 || ^11.0.0"
|
|
110
|
+
},
|
|
111
|
+
"scripts": {
|
|
112
|
+
"build": "directus-extension build",
|
|
113
|
+
"dev": "directus-extension build -w --no-minify",
|
|
114
|
+
"add": "directus-extension add"
|
|
115
|
+
},
|
|
116
|
+
"devDependencies": {
|
|
117
|
+
"@directus/extensions-sdk": "9.22.1",
|
|
118
|
+
"@types/node": "^22.15.3",
|
|
119
|
+
"typescript": "^5.8.3",
|
|
120
|
+
"vue": "^3.5.13"
|
|
121
|
+
},
|
|
122
|
+
"dependencies": {
|
|
123
|
+
"busboy": "^1.6.0",
|
|
124
|
+
"html-format": "^1.1.6",
|
|
125
|
+
"liquidjs": "^10.21.1",
|
|
126
|
+
"pdfjs-dist": "^5.3.31",
|
|
127
|
+
"vue-json-pretty": "^2.4.0"
|
|
128
|
+
}
|
|
129
129
|
}
|