directus-extension-texttoanything 1.7.8 → 1.7.9
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 +1 -1
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 _,createElementVNode as m,defineComponent as v,computed as b,watch as y,nextTick as w,onMounted as x,resolveDirective as A,toDisplayString as k,withDirectives as T,normalizeStyle as S,unref as E,Fragment as C,resolveDynamicComponent as R,withModifiers as M,defineModel as P,isRef as L,createSlots as D,renderList as I,normalizeClass as O,inject as N,onBeforeUnmount as F,reactive as B,onUnmounted as j,Teleport as z,renderSlot as V}from"vue";var U,H=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"}}]}),$=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:"folder",name:"Target folder",type:"uuid",meta:{width:"full",interface:"system-folder",note:"The file will be placed in the selected folder."}},{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)}}}]}),W=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:"folder",name:"Target folder",type:"uuid",meta:{width:"full",interface:"system-folder",note:"The file will be placed in the selected folder."}},{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"mode",name:"Template source",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:[{value:"online",text:"TTA Dashboard"},{value:"offline",text:"Directus"}]},note:"When selecting 'TTA Dashboard', you will be able to select a template from the TextToAnything dashboard. (https://app.texttoanything.nl)"}},{field:"template",name:"Template",type:"string",meta:{interface:"online"==t.mode?"TTA-pdf-online-template-selector":"TTA-pdf-template-selector",options:{}}},{field:"templatevariables",name:"Template variables",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json"}}}]}),G=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"}}]}),q={exports:{}},K={},X={exports:{}},Y={},Q={};function J(){if(U)return Q;function t(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function e(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function i(i,s){this.__indent_cache=new e(i,s),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return U=1,t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},t.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},t.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},t.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},e.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},e.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},e.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},e.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},i.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,i){for(var s=this.__lines.length-2;s>=0;){var n=this.__lines[s];if(n.is_empty())break;if(0!==n.item(0).indexOf(e)&&n.item(-1)!==i){this.__lines.splice(s+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},Q.Output=i,Q}var Z,tt={};function et(){if(Z)return tt;return Z=1,tt.Token=function(t,e,i,s){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},tt}var it,st={};function nt(){return it||(it=1,a="(?:"+(n="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(i="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",r="(?:"+n+"|["+(e="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+i+(s="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(t=st).identifier=new RegExp(a+r,"g"),t.identifierStart=new RegExp(a),t.identifierMatch=new RegExp("(?:"+n+"|["+e+i+s+"])+"),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")),st;var t,e,i,s,n,a,r}var at,rt,ot={},lt={};function ht(){if(at)return lt;function t(t,i){this.raw_options=e(t,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function e(t,e){var s,n={};for(s in t=i(t))s!==e&&(n[s]=t[s]);if(e&&t[e])for(s in t[e])n[s]=t[e][s];return n}function i(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}return at=1,t.prototype._get_array=function(t,e){var i=this.raw_options[t],s=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(s=i.concat()):"string"==typeof i&&(s=i.split(/[^a-zA-Z0-9_\/\-]+/)),s},t.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},t.prototype._get_characters=function(t,e){var i=this.raw_options[t],s=e||"";return"string"==typeof i&&(s=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),s},t.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var s=parseInt(i,10);return isNaN(s)&&(s=e),s},t.prototype._get_selection=function(t,e,i){var s=this._get_selection_list(t,e,i);if(1!==s.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return s[0]},t.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var s=this._get_array(t,i);if(!this._is_valid_selection(s,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return s},t.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},lt.Options=t,lt.normalizeOpts=i,lt.mergeOpts=e,lt}function ct(){if(rt)return ot;rt=1;var t=ht().Options,e=["before-newline","after-newline","preserve-newline"];function i(i){t.call(this,i,"js");var s=this.raw_options.brace_style||null;"expand-strict"===s?this.raw_options.brace_style="expand":"collapse-preserve-inline"===s?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<n.length;a++)"preserve-inline"===n[a]?this.brace_preserve_inline=!0:this.brace_style=n[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",e),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return i.prototype=new t,ot.Options=i,ot}var dt,ut={},pt={};function gt(){if(dt)return pt;dt=1;var t=RegExp.prototype.hasOwnProperty("sticky");function e(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}return e.prototype.restart=function(){this.__position=0},e.prototype.back=function(){this.__position>0&&(this.__position-=1)},e.prototype.hasNext=function(){return this.__position<this.__input_length},e.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},e.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},e.prototype.__match=function(e,i){e.lastIndex=i;var s=e.exec(this.__input);return!s||t&&e.sticky||s.index!==i&&(s=null),s},e.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},e.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},e.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},e.prototype.read=function(t,e,i){var s,n="";return t&&(s=this.match(t))&&(n+=s[0]),!e||!s&&t||(n+=this.readUntil(e,i)),n},e.prototype.readUntil=function(t,e){var i,s=this.__position;t.lastIndex=this.__position;var n=t.exec(this.__input);return n?(s=n.index,e&&(s+=n[0].length)):s=this.__input_length,i=this.__input.substring(this.__position,s),this.__position=s,i},e.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},e.prototype.get_regexp=function(e,i){var s=null,n="g";return i&&t&&(n="y"),"string"==typeof e&&""!==e?s=new RegExp(e,n):e&&(s=new RegExp(e.source,n)),s},e.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},e.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},e.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},pt.InputScanner=e,pt}var ft,_t={},mt={};var vt,bt,yt,wt={},xt={};function At(){if(vt)return xt;function t(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}return vt=1,t.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},t.prototype.read_match=function(){return this._input.match(this._match_pattern)},t.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},t.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},t.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},t.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){},xt.Pattern=t,xt}function kt(){if(yt)return _t;yt=1;var t=gt().InputScanner,e=et().Token,i=function(){if(ft)return mt;function t(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}return ft=1,t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position<this.__tokens_length},t.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},t.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},t.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},mt.TokenStream=t,mt}().TokenStream,s=function(){if(bt)return wt;bt=1;var t=At().Pattern;function e(e,i){t.call(this,e,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return e.prototype=new t,e.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},e.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},e.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},e.prototype._create=function(){return new e(this._input,this)},e.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,s=[],n=t.exec(e);n;)s.push(e.substring(i,n.index)),i=n.index+n[0].length,n=t.exec(e);return i<e.length?s.push(e.substring(i,e.length)):s.push(""),s},wt.WhitespacePattern=e,wt}().WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(e,i){this._input=new t(e),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};return a.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new i,this._reset();for(var s=new e(n.START,""),a=null,r=[],o=new i;s.type!==n.EOF;){for(t=this._get_next_token(s,a);this._is_comment(t);)o.add(t),t=this._get_next_token(s,a);o.isEmpty()||(t.comments_before=o,o=new i),t.parent=a,this._is_opening(t)?(r.push(a),a=t):a&&this._is_closing(t,a)&&(t.opened=a,a.closed=t,a=r.pop(),t.parent=a),t.previous=s,s.next=t,this.__tokens.add(t),s=t}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(n.RAW,i):this._create_token(n.EOF,"")},a.prototype._is_comment=function(t){return!1},a.prototype._is_opening=function(t){return!1},a.prototype._is_closing=function(t,e){return!1},a.prototype._create_token=function(t,i){return new e(t,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},_t.Tokenizer=a,_t.TOKEN=n,_t}var Tt,St={};function Et(){if(Tt)return St;function t(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}return Tt=1,t.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},t.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},St.Directives=t,St}var Ct,Rt,Mt,Pt,Lt={};function Dt(){if(Ct)return Lt;Ct=1;var t=At().Pattern,e={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function i(i,s){t.call(this,i,s),this.__template_pattern=null,this._disabled=Object.assign({},e),this._excluded=Object.assign({},e),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var n=new t(i);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}return i.prototype=new t,i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){this.__set_templated_pattern()},i.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},i.prototype.read_options=function(t){var i=this._create();for(var s in e)i._disabled[s]=-1===t.templating.indexOf(s);return i._update(),i},i.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},i.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},i.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},i.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Lt.TemplatablePattern=i,Lt}function It(){if(Rt)return ut;Rt=1;var t=gt().InputScanner,e=kt().Tokenizer,i=kt().TOKEN,s=Et().Directives,n=nt(),a=At().Pattern,r=Dt().TemplatablePattern;function o(t,e){return-1!==e.indexOf(t)}var l={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},h=new s(/\/\*/,/\*\//),c=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,d=/[0-9]/,u=/[^\d\.]/,p=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=(g="\\?\\.(?!\\d) "+(g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var f,_=new RegExp(g),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),b=new RegExp("^(?:"+v.join("|")+")$"),y=function(t,i){e.call(this,t,i),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var s=new a(this._input),o=new r(this._input).read_options(this._options);this.__patterns={template:o,identifier:o.starting_with(n.identifier).matching(n.identifierMatch),number:s.matching(c),punct:s.matching(_),comment:s.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:s.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:s.matching(/<!--/),html_comment_end:s.matching(/-->/),include:s.starting_with(/#include/).until_after(n.lineBreak),shebang:s.starting_with(/#!/).until_after(n.lineBreak),xml:s.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:o.until(/['\\\n\r\u2028\u2029]/),double_quote:o.until(/["\\\n\r\u2028\u2029]/),template_text:o.until(/[`\\$]/),template_expression:o.until(/[`}\\]/)}};return(y.prototype=new e)._is_comment=function(t){return t.type===l.COMMENT||t.type===l.BLOCK_COMMENT||t.type===l.UNKNOWN},y.prototype._is_opening=function(t){return t.type===l.START_BLOCK||t.type===l.START_EXPR},y.prototype._is_closing=function(t,e){return(t.type===l.END_BLOCK||t.type===l.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},y.prototype._reset=function(){f=!1},y.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var s=this._input.peek();return null===s?this._create_token(l.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(s))||this._read_string(s))||this._read_pair(s,this._input.peek(1)))||this._read_word(t))||this._read_singles(s))||this._read_comment(s))||this._read_regexp(s,t))||this._read_xml(s,t))||this._read_punctuation())||this._create_token(l.UNKNOWN,this._input.next())},y.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(n.allLineBreaks,"\n"),t.type!==l.DOT&&(t.type!==l.RESERVED||"set"!==t.text&&"get"!==t.text)&&b.test(e)?"in"!==e&&"of"!==e||t.type!==l.WORD&&t.type!==l.STRING?this._create_token(l.RESERVED,e):this._create_token(l.OPERATOR,e):this._create_token(l.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(l.WORD,e):void 0},y.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(l.START_EXPR,t):")"===t||"]"===t?e=this._create_token(l.END_EXPR,t):"{"===t?e=this._create_token(l.START_BLOCK,t):"}"===t?e=this._create_token(l.END_BLOCK,t):";"===t?e=this._create_token(l.SEMICOLON,t):"."===t&&u.test(this._input.peek(1))?e=this._create_token(l.DOT,t):","===t&&(e=this._create_token(l.COMMA,t)),e&&this._input.next(),e},y.prototype._read_pair=function(t,e){var i=null;return"#"===t&&"{"===e&&(i=this._create_token(l.START_BLOCK,t+e)),i&&(this._input.next(),this._input.next()),i},y.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(l.EQUALS,t):"?."===t?this._create_token(l.DOT,t):this._create_token(l.OPERATOR,t)},y.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(l.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(l.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(d)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(l.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(n.newline);)e+=this._input.next();return f=!0,this._create_token(l.COMMENT,e)}}else if(f&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return f=!1,this._create_token(l.COMMENT,e);return null},y.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var s=h.get_directives(i);s&&"start"===s.ignore&&(i+=h.readIgnored(this._input)),i=i.replace(n.allLineBreaks,"\n"),(e=this._create_token(l.BLOCK_COMMENT,i)).directives=s}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(l.COMMENT,i))}return e},y.prototype._read_string=function(e){if("`"===e||"'"===e||'"'===e){var i=this._input.next();return this.has_char_escapes=!1,i+="`"===e?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(i=function(e){var i="",s=0,n=new t(e),a=null;for(;n.hasNext();)if((a=n.match(/([\s]|[^\\]|\\\\)+/g))&&(i+=a[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())a=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){i+="\\",n.hasNext()&&(i+=n.next());continue}(a=n.match(/u([0-9A-Fa-f]{4})/g))||(a=n.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!a)return e;if((s=parseInt(a[1],16))>126&&s<=255&&0===a[0].indexOf("x"))return e;i+=s>=0&&s<32||s>1114111?"\\"+a[0]:34===s||39===s||92===s?"\\"+String.fromCharCode(s):String.fromCharCode(s)}return i}(i)),this._input.peek()===e&&(i+=this._input.next()),i=i.replace(n.allLineBreaks,"\n"),this._create_token(l.STRING,i)}return null},y.prototype._allow_regexp_or_xml=function(t){return t.type===l.RESERVED&&o(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===l.END_EXPR&&")"===t.text&&t.opened.previous.type===l.RESERVED&&o(t.opened.previous.text,["if","while","for"])||o(t.type,[l.COMMENT,l.START_EXPR,l.START_BLOCK,l.START,l.END_BLOCK,l.OPERATOR,l.EQUALS,l.EOF,l.SEMICOLON,l.COMMA])},y.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),s=!1,a=!1;this._input.hasNext()&&(s||a||this._input.peek()!==t)&&!this._input.testChar(n.newline);)i+=this._input.peek(),s?s=!1:(s="\\"===this._input.peek(),"["===this._input.peek()?a=!0:"]"===this._input.peek()&&(a=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(n.identifier)),this._create_token(l.STRING,i)}return null},y.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",s=this.__patterns.xml.read_match();if(s){for(var a=s[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),r=0===a.indexOf("{"),o=0;s;){var h=!!s[1],c=s[2];if(!(!!s[s.length-1]||"![CDATA["===c.slice(0,8))&&(c===a||r&&c.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(h?--o:++o),i+=s[0],o<=0)break;s=this.__patterns.xml.read_match()}return s||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(n.allLineBreaks,"\n"),this._create_token(l.STRING,i)}}return null},y.prototype._read_string_recursive=function(t,e,i){var s,a;"'"===t?a=this.__patterns.single_quote:'"'===t?a=this.__patterns.double_quote:"`"===t?a=this.__patterns.template_text:"}"===t&&(a=this.__patterns.template_expression);for(var r=a.read(),o="";this._input.hasNext();){if((o=this._input.next())===t||!e&&n.newline.test(o)){this._input.back();break}"\\"===o&&this._input.hasNext()?("x"===(s=this._input.peek())||"u"===s?this.has_char_escapes=!0:"\r"===s&&"\n"===this._input.peek(1)&&this._input.next(),o+=this._input.next()):i&&("${"===i&&"$"===o&&"{"===this._input.peek()&&(o+=this._input.next()),i===o&&(o+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(o+=this._input.next()))),r+=o+=a.read()}return r},ut.Tokenizer=y,ut.TOKEN=l,ut.positionable_operators=p.slice(),ut.line_starters=m.slice(),ut}function Ot(){if(Mt)return Y;Mt=1;var t=J().Output,e=et().Token,i=nt(),s=ct().Options,n=It().Tokenizer,a=It().line_starters,r=It().positionable_operators,o=It().TOKEN;function l(t,e){return-1!==e.indexOf(t)}function h(t){return t.replace(/^\s+/g,"")}function c(t,e){return t&&t.type===o.RESERVED&&t.text===e}function d(t,e){return t&&t.type===o.RESERVED&&l(t.text,e)}var u=["case","return","do","if","throw","else","await","break","continue","async"],p=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),g=[p.before_newline,p.preserve_newline],f="BlockStatement",_="Statement",m="ObjectLiteral",v="ArrayLiteral",b="ForInitializer",y="Conditional",w="Expression";function x(t,e){e.multiline_frame||e.mode===b||e.mode===y||t.remove_indent(e.start_line_index)}function A(t){return t===v}function k(t){return l(t,[w,b,y])}function T(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(e)}T.prototype.create_flags=function(t,i){var s=0;return t&&(s=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>s&&(s=t.line_indent_level)),{mode:i,parent:t,last_token:t?t.last_token:new e(o.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:s,alignment:0,line_indent_level:t?t.line_indent_level:s,start_line_index:this._output.get_line_number(),ternary_depth:0}},T.prototype._reset=function(e){var i=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new t(this._options,i),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f);var s=new n(e,this._options);return this._tokens=s.tokenize(),e},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&i.lineBreak.test(t||"")&&(e=t.match(i.lineBreak)[0]));for(var s=this._tokens.next();s;)this.handle_token(s),this._last_last_text=this._flags.last_token.text,this._flags.last_token=s,s=this._tokens.next();return this._output.get_code(e)},T.prototype.handle_token=function(t,e){t.type===o.START_EXPR?this.handle_start_expr(t):t.type===o.END_EXPR?this.handle_end_expr(t):t.type===o.START_BLOCK?this.handle_start_block(t):t.type===o.END_BLOCK?this.handle_end_block(t):t.type===o.WORD||t.type===o.RESERVED?this.handle_word(t):t.type===o.SEMICOLON?this.handle_semicolon(t):t.type===o.STRING?this.handle_string(t):t.type===o.EQUALS?this.handle_equals(t):t.type===o.OPERATOR?this.handle_operator(t):t.type===o.COMMA?this.handle_comma(t):t.type===o.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===o.COMMENT?this.handle_comment(t,e):t.type===o.DOT?this.handle_dot(t):t.type===o.EOF?this.handle_eof(t):(t.type,o.UNKNOWN,this.handle_unknown(t,e))},T.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,s=this._options.keep_array_indentation&&A(this._flags.mode);if(t.comments_before)for(var n=t.comments_before.next();n;)this.handle_whitespace_and_comments(n,e),this.handle_token(n,e),n=t.comments_before.next();if(s)for(var a=0;a<i;a+=1)this.print_newline(a>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var r=1;r<i;r+=1)this.print_newline(!0,e)}};var S=["async","break","continue","return","throw","yield"];return T.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(l(this._flags.last_token.text,r)||l(t.text,r)){var s=l(this._flags.last_token.text,r)&&l(this._options.operator_position,g)||l(t.text,r);i=i&&s}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(d(this._flags.last_token,S))return;this._output.set_wrap_point()}}},T.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==o.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==_||this._flags.if_block&&c(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},T.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},T.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===o.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},T.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===_&&x(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.start_of_object_property=function(){return this._flags.parent.mode===m&&this._flags.mode===_&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},T.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||d(this._flags.last_token,["var","let","const"])&&t.type===o.WORD)||c(this._flags.last_token,"do"))||!(this._flags.parent.mode===m&&this._flags.mode===_)&&d(this._flags.last_token,S)&&!t.newlines)||c(this._flags.last_token,"else")&&!(c(t,"if")&&!t.comments_before))||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===b||this._previous_flags.mode===y))||this._flags.last_token.type===o.WORD&&this._flags.mode===f&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==o.WORD&&t.type!==o.RESERVED)||this._flags.mode===m&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(_),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,d(t,["do","for","if","while"])),!0)},T.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=w;if("["===t.text){if(this._flags.last_token.type===o.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=v,A(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),l(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=b):l(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=y):l(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(l(this._flags.last_token.text,a)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var s=this._tokens.peek(-4);d(i,["async","function"])||"*"===i.text&&d(s,["async","function"])?this._output.space_before_token=!0:this._flags.mode===m?"{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==s.text&&","!==s.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===o.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(l(this._last_last_text,["function","yield"])||this._flags.mode===m&&l(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===o.START_BLOCK?this.print_newline():this._flags.last_token.type!==o.END_EXPR&&this._flags.last_token.type!==o.START_EXPR&&this._flags.last_token.type!==o.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==o.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},T.prototype.handle_end_expr=function(t){for(;this._flags.mode===_;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==o.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),x(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===y&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},T.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(f),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f):i&&(l(i.text,[":",","])&&l(e.type,[o.STRING,o.WORD,o.RESERVED])||l(e.text,["get","set","..."])&&l(i.type,[o.WORD,o.RESERVED]))?l(this._last_last_text,["class","interface"])&&!l(i.text,[":",","])?this.set_mode(f):this.set_mode(m):this._flags.last_token.type===o.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(f):l(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(m):this.set_mode(f),this._flags.last_token&&d(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var s=!e.comments_before&&"}"===e.text,n=s&&"function"===this._flags.last_word&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var a=0,r=null;this._flags.inline_frame=!0;do{if(a+=1,(r=this._tokens.peek(a-1)).newlines){this._flags.inline_frame=!1;break}}while(r.type!==o.EOF&&(r.type!==o.END_BLOCK||r.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(n||this._flags.last_token.type===o.EQUALS||d(this._flags.last_token,u)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!A(this._previous_flags.mode)||this._flags.last_token.type!==o.START_EXPR&&this._flags.last_token.type!==o.COMMA||((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(l(this._flags.last_token.type,[o.START_BLOCK,o.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),s||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},T.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===_;)this.restore_mode();var e=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(A(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},T.prototype.handle_word=function(t){if(t.type===o.RESERVED)if(l(t.text,["set","get"])&&this._flags.mode!==m)t.type=o.WORD;else if("import"===t.text&&l(this._tokens.peek().text,["(","."]))t.type=o.WORD;else if(l(t.text,["as","from"])&&!this._flags.import_block)t.type=o.WORD;else if(this._flags.mode===m){":"===this._tokens.peek().text&&(t.type=o.WORD)}if(this.start_of_statement(t)?d(this._flags.last_token,["var","let","const"])&&t.type===o.WORD&&(this._flags.declaration_statement=!0):!t.newlines||k(this._flags.mode)||this._flags.last_token.type===o.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===o.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(c(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&c(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===_;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(t,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==o.COMMA&&this._flags.last_token.type!==o.START_EXPR&&this._flags.last_token.type!==o.EQUALS&&this._flags.last_token.type!==o.OPERATOR||this.start_of_object_property()||l(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===m||this.allow_wrap_or_preserved_newline(t),c(t,"function"))return(l(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!l(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==o.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,S)||c(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===o.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!k(this._flags.mode)&&!A(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":d(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===f?e="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&k(this._flags.mode)?e="SPACE":this._flags.last_token.type===o.STRING?e="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||"*"===this._flags.last_token.text&&(l(this._last_last_text,["function","yield"])||this._flags.mode===m&&l(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===o.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),d(t,a)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(t,["else","catch","finally"]))?(this._flags.last_token.type!==o.END_BLOCK||this._previous_flags.mode!==f||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?d(this._flags.last_token,u)||"declare"===this._flags.last_token.text&&d(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?this._flags.last_token.type===o.START_EXPR&&d(t,["var","let","const"])||":"===this._flags.last_token.text||(c(t,"if")&&c(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(t,a)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==o.WORD&&t.previous.type!==o.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===o.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&c(t,"from")&&(this._flags.import_block=!1))},T.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==_||this._flags.if_block&&c(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},T.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==o.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==o.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},T.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},T.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(k(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===m||this._flags.mode===_&&this._flags.parent.mode===m?(this._flags.mode===_&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},T.prototype.handle_operator=function(t){var e="*"===t.text&&(d(this._flags.last_token,["function","yield"])||l(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),i=l(t.text,["-","+"])&&(l(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||l(this._flags.last_token.text,a)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var s=!e;this.handle_whitespace_and_comments(t,s)}if("*"!==t.text||this._flags.last_token.type!==o.DOT)if("::"!==t.text)if(l(t.text,["-","+"])&&this.start_of_object_property())this.print_token(t);else{if(this._flags.last_token.type===o.OPERATOR&&l(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==o.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var n=!0,h=!0,c=!1;if(":"===t.text?0===this._flags.ternary_depth?n=!1:(this._flags.ternary_depth-=1,c=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&l(t.text,r)){var m=":"===t.text,v=m&&c,b=m&&!c;switch(this._options.operator_position){case p.before_newline:return this._output.space_before_token=!b,this.print_token(t),m&&!v||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case p.after_newline:return this._output.space_before_token=!0,!m||v?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case p.preserve_newline:return b||this.allow_wrap_or_preserved_newline(t),n=!(this._output.just_added_newline()||b),this._output.space_before_token=n,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),n=!1;var y=this._tokens.peek();h=y&&l(y.type,[o.WORD,o.RESERVED])}else if("..."===t.text)this.allow_wrap_or_preserved_newline(t),n=this._flags.last_token.type===o.START_BLOCK,h=!1;else if(l(t.text,["--","++","!","~"])||i){if(this._flags.last_token.type!==o.COMMA&&this._flags.last_token.type!==o.START_EXPR||this.allow_wrap_or_preserved_newline(t),n=!1,h=!1,t.newlines&&("--"===t.text||"++"===t.text||"~"===t.text)){var w=d(this._flags.last_token,u)&&t.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&k(this._flags.mode)&&(n=!0),this._flags.last_token.type===o.RESERVED?n=!0:this._flags.last_token.type===o.END_EXPR?n=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===o.OPERATOR&&(n=l(t.text,["--","-","++","+"])&&l(this._flags.last_token.text,["--","-","++","+"]),l(t.text,["+","-"])&&l(this._flags.last_token.text,["--","++"])&&(h=!0)),(this._flags.mode!==f||this._flags.inline_frame)&&this._flags.mode!==_||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||n,this.print_token(t),this._output.space_before_token=h}else this.print_token(t);else this.print_token(t)},T.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):i.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},T.prototype.print_block_commment=function(t,e){var s,n=function(t){for(var e=[],s=(t=t.replace(i.allLineBreaks,"\n")).indexOf("\n");-1!==s;)e.push(t.substring(0,s)),s=(t=t.substring(s+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),a=!1,r=!1,o=t.whitespace_before,l=o.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(a=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),r=function(t,e){for(var i,s=0,n=t.length;s<n;s++)if((i=t[s])&&0!==i.indexOf(e))return!1;return!0}(n,o),a&&(this._flags.alignment=1),s=0;s<n.length;s++)a?(this.print_token_line_indentation(t),this._output.add_token(h(n[s]))):r&&n[s]?(this.print_token_line_indentation(t),this._output.add_token(n[s].substring(l))):(this._output.current_line.set_indent(-1),this._output.add_token(n[s])),this.print_newline(!1,e);this._flags.alignment=0}},T.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},T.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),d(this._flags.last_token,u)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},T.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},T.prototype.handle_eof=function(t){for(;this._flags.mode===_;)this.restore_mode();this.handle_whitespace_and_comments(t)},Y.Beautifier=T,Y}var Nt,Ft,Bt,jt={exports:{}},zt={},Vt={};function Ut(){if(Nt)return Vt;Nt=1;var t=ht().Options;function e(e){t.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<s.length;n++)"expand"!==s[n]?this.brace_style="collapse":this.brace_style=s[n]}return e.prototype=new t,Vt.Options=e,Vt}function Ht(){if(Bt)return jt.exports;Bt=1;var t=function(){if(Ft)return zt;Ft=1;var t=Ut().Options,e=J().Output,i=gt().InputScanner,s=new(0,Et().Directives)(/\/\*/,/\*\//),n=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=/\s/,o=/(?:\s|\n)+/g,l=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,h=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function c(e,i){this._source_text=e||"",this._options=new t(i),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return c.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},c.prototype.eatWhitespace=function(t){for(var e=r.test(this._input.peek()),i=0;r.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},c.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},c.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},c.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},c.prototype.indent=function(){this._indentLevel++},c.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},c.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,c=this._options.eol;"auto"===c&&(c="\n",t&&n.test(t||"")&&(c=t.match(n)[0]));var d=(t=t.replace(a,"\n")).match(/^[\t ]*/)[0];this._output=new e(this._options,d),this._input=new i(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var u,p,g=0,f=!1,_=!1,m=!1,v=!1,b=!1,y=this._ch,w=!1;u=""!==this._input.read(o),p=y,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(l),A=s.get_directives(x);A&&"start"===A.ignore&&(x+=s.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(h)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(u),this.print_string(this._ch);var k=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);k.match(/[ :]$/)&&(k=this.eatString(": ").replace(/\s+$/,""),this.print_string(k),this._output.space_before_token=!0),0===g&&-1!==k.indexOf(":")&&(_=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(u),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var T=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);T.match(/[ :]$/)&&(T=this.eatString(": ").replace(/\s+$/,""),this.print_string(T),this._output.space_before_token=!0),0===g&&-1!==T.indexOf(":")?(_=!0,this.indent()):T in this.NESTED_AT_RULE?(this._nestedLevel+=1,T in this.CONDITIONAL_GROUP_RULE&&(m=!0)):0!==g||_||(v=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(u),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)_&&(_=!1,this.outdent()),v=!1,m?(m=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===p?this._output.space_before_token=!1:","!==p&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===p&&this._output.trim(!0),_&&(this.outdent(),_=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var S=0;S<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;S++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[S])){w=!0;break}!f&&!m||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==g?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),_||(_=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var E='"'===p||"'"===p;this.preserveSingleSpace(E||u),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===g?(_&&(this.outdent(),_=!1),v=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),g++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),g&&(g--,this.outdent()));else{var C=!1;this._input.lookBack("with")&&(C=!0),this.preserveSingleSpace(u||C),this.print_string(this._ch),_&&"$"===p&&this._options.selector_separator_newline?(this._output.add_new_line(),b=!0):(this.eatWhitespace(),g++,this.indent())}else if(")"===this._ch)g&&(g--,this.outdent()),b&&";"===this._input.peek()&&this._options.selector_separator_newline&&(b=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||_&&!b||0!==g||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||_||0!==g)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(u),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),r.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var R='"'===p||"'"===p;this.preserveSingleSpace(R||u),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&r.test(this._ch)&&(this._ch=""));return this._output.get_code(c)},zt.Beautifier=c,zt}().Beautifier,e=Ut().Options;return jt.exports=function(e,i){return new t(e,i).beautify()},jt.exports.defaultOptions=function(){return new e},jt.exports}var $t,Wt={exports:{}},Gt={},qt={};function Kt(){if($t)return qt;$t=1;var t=ht().Options;function e(e){t.call(this,e,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return e.prototype=new t,qt.Options=e,qt}var Xt,Yt,Qt,Jt,Zt={};function te(){if(Xt)return Zt;Xt=1;var t=kt().Tokenizer,e=kt().TOKEN,i=Et().Directives,s=Dt().TemplatablePattern,n=At().Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:e.START,RAW:e.RAW,EOF:e.EOF},r=new i(/<\!--/,/-->/),o=function(e,i){t.call(this,e,i),this._current_tag_name="";var a=new s(this._input).read_options(this._options),r=new n(this._input);if(this.__patterns={word:a.until(/[\n\r\t <]/),word_control_flow_close_excluded:a.until(/[\n\r\t <}]/),single_quote:a.until_after(/'/),double_quote:a.until_after(/"/),attribute:a.until(/[\n\r\t =>]|\/>/),element_name:a.until(/[\n\r\t >\/]/),angular_control_flow_start:r.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(/<!--/).until_after(/-->/),cdata:r.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:r.starting_with(/<!\[/).until_after(/]>/),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(o).until_after(o)}};return(o.prototype=new t)._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return t.type===a.TAG_OPEN||t.type===a.CONTROL_FLOW_OPEN},o.prototype._is_closing=function(t,e){return t.type===a.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])||t.type===a.CONTROL_FLOW_CLOSE&&"}"===t.text&&e.text.endsWith("{")},o.prototype._reset=function(){this._current_tag_name=""},o.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var s=this._input.peek();return null===s?this._create_token(a.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(s,e))||this._read_attribute(s,t,e))||this._read_close(s,e))||this._read_script_and_style(s,t))||this._read_control_flows(s,e))||this._read_raw_content(s,t,e))||this._read_content_word(s,e))||this._read_comment_or_cdata(s))||this._read_processing(s))||this._read_open(s,e))||this._create_token(a.UNKNOWN,this._input.next())},o.prototype._read_comment_or_cdata=function(t){var e=null,i=null,s=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(s=r.get_directives(i))&&"start"===s.ignore&&(i+=r.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(a.COMMENT,i)).directives=s));return e},o.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var s=this._input.peek(1);"!"!==s&&"?"!==s||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(a.COMMENT,i)).directives=null)}return e},o.prototype._read_open=function(t,e){var i=null,s=null;return e&&e.type!==a.CONTROL_FLOW_OPEN||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),s=this._create_token(a.TAG_OPEN,i)),s},o.prototype._read_open_handlebars=function(t,e){var i=null,s=null;return e&&e.type!==a.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===t&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),s=this._create_token(a.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),s=this._create_token(a.TAG_OPEN,i))),s},o.prototype._read_control_flows=function(t,e){var i="",s=null;if(!this._options.templating.includes("angular"))return s;if("@"===t){if(""===(i=this.__patterns.angular_control_flow_start.read()))return s;for(var n=i.endsWith("(")?1:0,r=0;!i.endsWith("{")||n!==r;){var o=this._input.next();if(null===o)break;"("===o?n++:")"===o&&r++,i+=o}s=this._create_token(a.CONTROL_FLOW_OPEN,i)}else"}"===t&&e&&e.type===a.CONTROL_FLOW_OPEN&&(i=this._input.next(),s=this._create_token(a.CONTROL_FLOW_CLOSE,i));return s},o.prototype._read_close=function(t,e){var i=null,s=null;return e&&e.type===a.TAG_OPEN&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),s=this._create_token(a.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),s=this._create_token(a.TAG_CLOSE,"}}"))),s},o.prototype._read_attribute=function(t,e,i){var s=null,n="";if(i&&"<"===i.text[0])if("="===t)s=this._create_token(a.EQUALS,this._input.next());else if('"'===t||"'"===t){var r=this._input.next();r+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),s=this._create_token(a.VALUE,r)}else(n=this.__patterns.attribute.read())&&(s=e.type===a.EQUALS?this._create_token(a.VALUE,n):this._create_token(a.ATTRIBUTE,n));return s},o.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},o.prototype._read_raw_content=function(t,e,i){var s="";if(i&&"{"===i.text[0])s=this.__patterns.handlebars_raw_close.read();else if(e.type===a.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var n=e.opened.text.substr(1).toLowerCase();this._is_content_unformatted(n)&&(s=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig")))}return s?this._create_token(a.TEXT,s):null},o.prototype._read_script_and_style=function(t,e){if(e.type===a.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var i=e.opened.text.substr(1).toLowerCase();if("script"===i||"style"===i){var s=this._read_comment_or_cdata(t);if(s)return s.type=a.TEXT,s;var n=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig"));if(n)return this._create_token(a.TEXT,n)}}return null},o.prototype._read_content_word=function(t,e){var i="";return this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(i=this.__patterns.unformatted_content_delimiter.read()),i||(i=e&&e.type===a.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),i?this._create_token(a.TEXT,i):null},Zt.Tokenizer=o,Zt.TOKEN=a,Zt}function ee(){if(Yt)return Gt;Yt=1;var t=Kt().Options,e=J().Output,i=te().Tokenizer,s=te().TOKEN,n=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=function(t,i){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new e(t,i)};r.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},r.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},r.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},r.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},r.prototype.print_preserved_newlines=function(t){var e=0;t.type!==s.TEXT&&t.previous.type!==s.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},r.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},r.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},r.prototype.print_newline=function(t){this._output.add_new_line(t)},r.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},r.prototype.indent=function(){this.indent_level++},r.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},r.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var o=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==s.EOF&&t.closed!==i;){if(i.type===s.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===s.EQUALS&&i.next.next&&i.next.next.type===s.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function l(t,e){return-1!==e.indexOf(t)}function h(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function c(t){this._printer=t,this._current_frame=null}function d(e,i,s,n){this._source_text=e||"",i=i||{},this._js_beautify=s,this._css_beautify=n,this._tag_stack=null;var a=new t(i,"html");this._options=a,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}c.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},c.prototype.record_tag=function(t){var e=new h(this._current_frame,t,this._printer.indent_level);this._current_frame=e},c.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},c.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},c.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},c.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&n.test(t)&&(e=t.match(n)[0]));var o=(t=t.replace(a,"\n")).match(/^[\t ]*/)[0],l={text:"",type:""},h=new u(this._options),d=new r(this._options,o),p=new i(t,this._options).tokenize();this._tag_stack=new c(d);for(var g=null,f=p.next();f.type!==s.EOF;)f.type===s.TAG_OPEN||f.type===s.COMMENT?h=g=this._handle_tag_open(d,f,h,l,p):f.type===s.ATTRIBUTE||f.type===s.EQUALS||f.type===s.VALUE||f.type===s.TEXT&&!h.tag_complete?g=this._handle_inside_tag(d,f,h,l):f.type===s.TAG_CLOSE?g=this._handle_tag_close(d,f,h):f.type===s.TEXT?g=this._handle_text(d,f,h):f.type===s.CONTROL_FLOW_OPEN?g=this._handle_control_flow_open(d,f):f.type===s.CONTROL_FLOW_CLOSE?g=this._handle_control_flow_close(d,f):d.add_raw_token(f),l=g,f=p.next();return d._output.get_code(e)},d.prototype._handle_control_flow_open=function(t,e){var i={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),t.indent(),i},d.prototype._handle_control_flow_close=function(t,e){var i={text:e.text,type:e.type};return t.deindent(),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),i},d.prototype._handle_tag_close=function(t,e,i){var s={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),s},d.prototype._handle_inside_tag=function(t,e,i,n){var a=i.has_wrapped_attrs,r={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):"{"===i.tag_start_char&&e.type===s.TEXT?t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e):(e.type===s.ATTRIBUTE?t.set_space_before_token(!0):(e.type===s.EQUALS||e.type===s.VALUE&&e.previous.type===s.EQUALS)&&t.set_space_before_token(!1),e.type===s.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),a=a||0!==e.newlines),this._is_wrap_attributes_force&&i.attr_count>=this._options.wrap_attributes_min_attrs&&(n.type!==s.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(t.print_newline(!1),a=!0)),t.print_token(e),a=a||t.previous_token_wrapped(),i.has_wrapped_attrs=a),r},d.prototype._handle_text=function(t,e,i){var s={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),s},d.prototype._print_custom_beatifier_text=function(t,e,i){var s=this;if(""!==e.text){var n,a=e.text,r=1,o="",l="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?n=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?n=this._css_beautify:"html"===i.custom_beautifier_name&&(n=function(t,e){return new d(t,e,s._js_beautify,s._css_beautify).beautify()}),"keep"===this._options.indent_scripts?r=0:"separate"===this._options.indent_scripts&&(r=-t.indent_level);var h=t.get_full_indent(r);if(a=a.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===a[0]&&a.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(a);if(!c)return void t.add_raw_token(e);o=h+c[1]+"\n",a=c[4],c[5]&&(l=h+c[5]),a=a.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(e.whitespace_before=c[0])}if(a)if(n){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,a=n(h+a,new u)}else{var p=e.whitespace_before;p&&(a=a.replace(new RegExp("\n("+p+")?","g"),"\n")),a=h+a.replace(/\n/g,"\n"+h)}o&&(a=a?o+a+"\n"+l:o+l),t.print_newline(!1),a&&(e.text=a,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},d.prototype._handle_tag_open=function(t,e,i,n,a){var r=this._get_tag_open_token(e);if(!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==s.TAG_OPEN||r.is_start_tag?(t.traverse_whitespace(e),this._set_tag_position(t,e,r,i,n),r.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),r.start_tag_token=this._tag_stack.try_pop(r.tag_name)),r.is_start_tag&&this._is_wrap_attributes_force){var o,l=0;do{(o=a.peek(l)).type===s.ATTRIBUTE&&(r.attr_count+=1),l+=1}while(o.type!==s.EOF&&o.type!==s.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(r.alignment_size=e.text.length+1),r.tag_complete||r.is_unformatted||(t.alignment_size=r.alignment_size),r};var u=function(t,e,i){if(this.parent=e||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",i){var n;this.tag_start_char=i.text[0],this.text=i.text,"<"===this.tag_start_char?(n=i.text.match(/^<([^\s>]*)/),this.tag_check=n?n[1]:""):(n=i.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",(i.text.startsWith("{{#>")||i.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==i.next?this.tag_check=i.next.text.split(" ")[0]:this.tag_check=i.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),i.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||i.closed&&"/>"===i.closed.text;var a=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(a=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!t.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(a)))}else this.tag_complete=!0};d.prototype._get_tag_open_token=function(t){var e=new u(this._options,this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||l(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&l(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&l(e.tag_check,this._options.content_unformatted),e.is_inline_element=l(e.tag_name,this._options.inline)||this._options.inline_custom_elements&&e.tag_name.includes("-")||"{"===e.tag_start_char,e},d.prototype._set_tag_position=function(t,e,i,n,a){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=o(i.tag_check,e)))),l(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&a.type===s.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var r=!1;r=(r=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(a.type===s.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==a.type,(i.is_content_unformatted||i.is_unformatted)&&(r=!1),r&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===a.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},d.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var p=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],g=["a","audio","del","ins","map","noscript","video"];return d.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==p.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==g.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},Gt.Beautifier=d,Gt}function ie(){if(Jt)return K;Jt=1;var t=function(){if(Pt)return X.exports;Pt=1;var t=Ot().Beautifier,e=ct().Options;return X.exports=function(e,i){return new t(e,i).beautify()},X.exports.defaultOptions=function(){return new e},X.exports}(),e=Ht(),i=function(){if(Qt)return Wt.exports;Qt=1;var t=ee().Beautifier,e=Kt().Options;return Wt.exports=function(e,i,s,n){return new t(e,i,s,n).beautify()},Wt.exports.defaultOptions=function(){return new e},Wt.exports}();function s(s,n,a,r){return i(s,n,a=a||t,r=r||e)}return s.defaultOptions=i.defaultOptions,K.js=t,K.css=e,K.html=s,K}!function(t){var e,i,s,n,a=ie();a.js_beautify=a.js,a.css_beautify=a.css,a.html_beautify=a.html,t.exports=(e=a,i=a,s=a,n=function(t,i){return e.js_beautify(t,i)},n.js=e.js_beautify,n.css=i.css_beautify,n.html=s.html_beautify,n.js_beautify=e.js_beautify,n.css_beautify=i.css_beautify,n.html_beautify=s.html_beautify,n)}(q);class se{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 ne{liquidMethodMissing(t){}}const ae=Object.prototype.toString,re=String.prototype.toLowerCase,oe=Object.hasOwnProperty;function le(t){return"string"==typeof t}function he(t){return"function"==typeof t}function ce(t){return t&&he(t.then)}function de(t){return t&&he(t.next)&&he(t.throw)&&he(t.return)}function ue(t){return le(t=fe(t))?t:be(t)?"":ye(t)?t.map((t=>ue(t))).join(""):String(t)}function pe(t){return ye(t=fe(t))?t:le(t)&&t.length>0?[t]:ke(e=t)&&Symbol.iterator in e?Array.from(t):ke(t)?Object.keys(t).map((e=>[e,t[e]])):[];var e}function ge(t){return be(t=fe(t))?[]:ye(t)?t:[t]}function fe(t){return t instanceof ne&&he(t.valueOf)?t.valueOf():t}function _e(t){return t=Number(t),isNaN(t)?0:t}function me(t){return"number"==typeof t}function ve(t){return t&&he(t.toLiquid)?ve(t.toLiquid()):t}function be(t){return null==t}function ye(t){return"[object Array]"===ae.call(t)}function we(t){return t&&me(t.length)}function xe(t,e){t=t||{};for(const i in t)if(oe.call(t,i)&&!1===e(t[i],i,t))break;return t}function Ae(t){return t[t.length-1]}function ke(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Te(t,e,i=1){const s=[];for(let n=t;n<e;n+=i)s.push(n);return s}function Se(t,e,i=" "){return Ee(t,e,i,((t,e)=>e+t))}function Ee(t,e,i,s){let n=e-(t=String(t)).length;for(;n-- >0;)t=s(t,i);return t}function Ce(t){return t}function Re(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=re.call(t))<(e=re.call(e))?-1:t>e?1:0}function Me(t){return function(...e){return t.call(this,...e.map(fe))}}function Pe(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*Le(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const De="__liquidClass__";class Ie 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,De,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:Ue(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[De])}}class Oe extends Ie{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class Ne extends Ie{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class Fe extends Ie{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class Be extends Ie{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 je extends Ie{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class ze extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class Ve extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function Ue(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 Te(n,a+1).map((t=>{let n=`${t===e?">> ":" "}${Se(String(t),String(a).length)}| `;const r=t===e?"\n"+Se("^",i+n.length):"";return n+=s[t-1],n+=r,n})).join("\n")}const He=[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 $e(t){const e=t.charCodeAt(0);return e>=128?!He[e]:!!(1&He[e])}function We(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new Ve(i)}}function Ge(t,e=`unexpected ${JSON.stringify(t)}`){We(!t,e)}He[160]=He[5760]=He[6158]=He[8192]=He[8193]=He[8194]=He[8195]=He[8196]=He[8197]=He[8198]=He[8199]=He[8200]=He[8201]=He[8202]=He[8232]=He[8233]=He[8239]=He[8287]=He[12288]=4,He[8220]=He[8221]=128;class qe extends ne{equals(t){return!(t instanceof qe)&&(le(t=fe(t))||ye(t)?0===t.length:!!ke(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 qe}}class Ke extends qe{equals(t){return!1===t||(!!be(fe(t))||(le(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof Ke}}class Xe extends ne{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 Ye{constructor(){this.buffer=""}write(t){this.buffer+=ue(t)}}class Qe{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Je{constructor(){this.buffer=""}write(t){"string"!=typeof(t=fe(t))&&""===this.buffer?this.buffer=t:this.buffer=ue(this.buffer)+ue(t)}}class Ze extends ne{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new Ye;return yield this.superBlockRender(t),t.buffer}}function ti(t){return t&&he(t.equals)&&he(t.gt)&&he(t.geq)&&he(t.lt)&&he(t.leq)}const ei=new class extends ne{equals(t){return be(fe(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},ii={true:!0,false:!1,nil:ei,null:ei,empty:new qe,blank:new Ke};function si(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&&$e(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var ni=function(){return ni=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},ni.apply(this,arguments)};function ai(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 ri(t){return ai(this,void 0,void 0,(function*(){if(!de(t))return t;let e,i=!1,s="next";do{const n=t[s](e);i=n.done,e=n.value,s="next";try{de(e)&&(e=ri(e)),ce(e)&&(e=yield e)}catch(t){s="throw",e=t}}while(!i);return e}))}function oi(t){if(!de(t))return t;let e,i=!1,s="next";do{const n=t[s](e);if(i=n.done,e=n.value,s="next",de(e))try{e=oi(e)}catch(t){s="throw",e=t}}while(!i);return e}const li=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function hi(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 ci(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=hi(t)[i];return e+t.getDate()}function di(t,e){const i=ci(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const ui={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},pi=new Set("aAbBceklpP");function gi(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),n=i%60;return(t.getTimezoneOffset()>0?"-":"+")+Se(s,2,"0")+(e.flags[":"]?":":"")+Se(n,2,"0")}const fi={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=>ci(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 Ee(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=>di(t,0),w:t=>t.getDay(),W:t=>di(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:gi,Z:(t,e)=>t.getTimeZoneName()||gi(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function _i(t,e){let i,s="",n=e;for(;i=li.exec(n);)s+=n.slice(0,i.index),n=n.slice(i.index+i[0].length),s+=mi(t,i);return s+n}function mi(t,e){const[i,s="",n,a,r]=e,o=fi[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=pi.has(r)?" ":"0",d=n||ui[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),Se(h,d,c)}function vi(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}fi.h=fi.b;const bi=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,yi=["January","February","March","April","May","June","July","August","September","October","November","December"],wi=yi.map((t=>t.slice(0,3))),xi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ai=xi.map((t=>t.slice(0,3)));class ki{constructor(t,e,i){this.locale=e,this.DateTimeFormat=vi(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=le(i)?ki.getTimezoneOffset(i,this.date):i,this.timezoneName=le(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:yi[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:wi[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:xi[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Ai[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(bi);if(i&&"Z"===i[1])return new ki(+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 ki(+new Date(t),e,r)}return new ki(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 Ti{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=_e(t),We(this.base+t<=this.limit,this.message),this.base+=t}check(t){We((t=_e(t))<=this.limit,this.message)}}class Si extends se{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&He[s.charCodeAt(d)];)d++;for(;u>d&&4&He[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 Ei extends Si{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(Hs.Tag,[h,c],t,e,i,a,r,n),this.tokenizer=new ys(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 Ci extends Si{constructor(t,e,i,s,n){const{trimOutputLeft:a,trimOutputRight:r,outputDelimiterLeft:o,outputDelimiterRight:l}=s,h=[e+o.length,i-l.length];super(Hs.Output,h,t,e,i,a,r,n)}}class Ri extends se{constructor(t,e,i,s){super(Hs.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 Mi extends se{constructor(t,e,i,s){super(Hs.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class Pi extends se{constructor(t,e,i,s){super(Hs.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class Li extends se{constructor(t,e,i,s){super(Hs.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=ii[this.literal]}}const Di={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Ii={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class Oi extends se{constructor(t,e,i,s){super(Hs.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 Di?Di[t]:1}}class Ni extends se{constructor(t,e,i,s,n,a){super(Hs.PropertyAccess,i,s,n,a),this.variable=t,this.props=e}}class Fi extends se{constructor(t,e,i,s,n,a){super(Hs.Filter,i,s,n,a),this.name=t,this.args=e}}class Bi extends se{constructor(t,e,i,s,n,a){super(Hs.Hash,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=n,this.file=a}}const ji=/[\da-fA-F]/,zi=/[0-7]/,Vi={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function Ui(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class Hi extends se{constructor(t,e,i,s){super(Hs.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!==Vi[t[i+1]])e+=Vi[t[++i]];else if("u"===t[i+1]){let s=0,n=i+2;for(;n<=i+5&&ji.test(t[n]);)s=16*s+Ui(t[n++]);i=n-1,e+=String.fromCharCode(s)}else if(zi.test(t[i+1])){let s=i+1,n=0;for(;s<=i+3&&zi.test(t[s]);)n=8*n+Ui(t[s++]);i=s-1,e+=String.fromCharCode(n)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class $i extends se{constructor(t,e,i,s,n,a){super(Hs.Range,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=n,this.file=a}}class Wi extends Si{constructor(t,e,i,s,n){super(Hs.Tag,[e,i],t,e,i,!1,!1,n),this.tokenizer=new ys(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 Gi extends se{constructor(t,e,i,s,n,a){super(Hs.FilteredValue,i,s,n,a),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=n,this.file=a}}const qi={now:()=>Date.now()};function Ki(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||qi}class Xi{renderTemplatesToNodeStream(t,e){const i=new Qe;return Promise.resolve().then((()=>ri(this.renderTemplates(t,e,i)))).then((()=>i.end()),(t=>i.error(t))),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new Je:new Ye);const s=[];for(const n of t){e.renderLimit.check(Ki().now());try{const t=yield n.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(t){const i=Ie.is(t)?t:new Fe(t,n);if(!e.opts.catchAllErrors)throw i;s.push(i)}}if(s.length)throw new Be(s);return i.buffer}}class Yi{constructor(t){this.postfix=[...Ji(t)]}*evaluate(t,e){We(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(qs(s)){const e=i.pop();let n;if(1===Ii[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 Qi(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*Qi(t,e,i=!1){if(t)return"content"in t?t.content:Js(t)?yield function*(t,e,i){const s=[];for(const i of t.props)s.push(yield Qi(i,e,!1));try{if(t.variable){const n=yield Qi(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 je(e,t)}}(t,e,i):tn(t)?yield function*(t,e){const i=yield Qi(t.lhs,e),s=yield Qi(t.rhs,e);return e.memoryLimit.use(s-i+1),Te(+i,+s+1)}(t,e):void 0}function*Ji(t){const e=[];for(const i of t)if(qs(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 Zi(t,e){return!ts(t,e)}function ts(t,e){return t=fe(t),e.opts.jsTruthy?!t:!1===t||null==t}const es={"==":is,"!=":(t,e)=>!is(t,e),">":(t,e)=>ti(t)?t.gt(e):ti(e)?e.lt(t):fe(t)>fe(e),"<":(t,e)=>ti(t)?t.lt(e):ti(e)?e.gt(t):fe(t)<fe(e),">=":(t,e)=>ti(t)?t.geq(e):ti(e)?e.leq(t):fe(t)>=fe(e),"<=":(t,e)=>ti(t)?t.leq(e):ti(e)?e.geq(t):fe(t)<=fe(e),contains:(t,e)=>ye(t=fe(t))?t.some((t=>is(t,e))):!!he(null==t?void 0:t.indexOf)&&t.indexOf(fe(e))>-1,not:(t,e)=>ts(fe(t),e),and:(t,e,i)=>Zi(fe(t),i)&&Zi(fe(e),i),or:(t,e,i)=>Zi(fe(t),i)||Zi(fe(e),i)};function is(t,e){return ti(t)?t.equals(e):ti(e)?e.equals(t):(t=fe(t),e=fe(e),ye(t)?ye(e)&&function(t,e){return t.length===e.length&&!t.some(((t,i)=>!is(t,e[i])))}(t,e):t===e)}let ss=class{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}};class ns{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new ss("HEAD",null,null,null),this.tail=new ss("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 ss(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 as(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 rs=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Ae(t)&&(t+="/"),as(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((t,e,s)=>{const n=s.split("/").pop();return/\.\w+$/.test(n)?t:e+s+i}))},readFile:function(t){return ai(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 ai(this,void 0,void 0,(function*(){return!0}))},existsSync:function(t){return!0},dirname:function(t){return as(t,".")},sep:"/"});function os(t,e=0){return JSON.stringify(t,null,e)}var ls={default:function(t,e,...i){return ye(t=fe(t))||le(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(ts(t,this.context)?e:t)},raw:{raw:!0,handler:Ce},jsonify:os,to_integer:function(t){return Number(t)},json:os,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 hs={"&":"&","<":"<",">":">",'"':""","'":"'"},cs={"&":"&","<":"<",">":">",""":'"',"'":"'"};function ds(t){return t=ue(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,(t=>hs[t]))}function us(t){return t=ue(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,(t=>cs[t]))}var ps=Object.freeze({__proto__:null,escape:ds,xml_escape:function(t){return ds.call(this,t)},escape_once:function(t){return ds.call(this,us.call(this,t))},newline_to_br:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class gs{constructor(t){this.mapping=t,this.sep="/"}exists(t){return ai(this,void 0,void 0,(function*(){return this.existsSync(t)}))}existsSync(t){return!be(this.mapping[t])}readFile(t){return ai(this,void 0,void 0,(function*(){return this.readFileSync(t)}))}readFileSync(t){const e=this.mapping[t];if(be(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 fs={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:rs,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:es,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function _s(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 ns(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new ns(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},fs),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=ms(t.root),t.partials=ms(t.partials),t.layouts=ms(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?ds:"json"===s?ls.json:(We(he(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=vi())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new gs(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function ms(t){let e=[];return ye(t)&&(e=t),le(t)&&(e=[t]),e}function vs(t,e){if(!t||!Ks(t))return;const i=e?4:16;for(;He[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function bs(t,e){if(!t||!Ks(t))return;const i=e?4:16;for(;He[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class ys{constructor(t,e=fs.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=si(e),this.literalTrie=si(ii)}readExpression(){return new Yi(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 Oi(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&&$e(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 Gi(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 Fi(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=fs){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];sn(n)&Hs.Delimited&&(!i&&n.trimLeft&&vs(t[s-1],e.greedy),Xs(n)&&("raw"===n.name?i=!0:"endraw"===n.name&&(i=!1)),!i&&n.trimRight&&bs(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 Ri(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 Ei(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=fs){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 Ci(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 Ei(this.input,s,e,t,this.file)):(this.p=n,new Ri(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=fs){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 Wi(this.input,e,i,t,this.file)}error(t,e=this.p){return new Oe(t,new Pi(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()&&$e(this.peek());)++this.p;return new Pi(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=le(t)?t:t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new Bi(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 Ni(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new Ni(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 Pi(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&&!$e(this.peek(i))){const t=new Mi(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 Li(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 $i(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 Hi(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:He[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 ws{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(Xs(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 xs{constructor(t){this.token=t}}class As extends xs{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class ks{constructor(t,e){this.hash={};const i=t instanceof ys?t:new ys(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 Qi(this.hash[i],t));return e}}function Ts(t){return ye(t)}class Ss{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=he(e)?e:he(null==e?void 0:e.handler)?e.handler:Ce,this.raw=!he(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)Ts(t)?i.push([t[0],yield Qi(t[1],e)]):i.push(yield Qi(t,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class Es{constructor(t,e){this.filters=[];const i="string"==typeof t?new ys(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map((t=>new Ss(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 We(i||!t.options.strictFilters,(()=>`undefined filter: ${e}`)),i}}class Cs extends xs{constructor(t,e){var i;super(t);const s=new ys(t.input,e.options.operators,t.file,t.contentRange);this.value=new Es(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 Fi(toString.call(a),[],"",0,0);n.push(new Ss(t,a,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class Rs extends xs{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class Ms{constructor(t,e){this.segments=t,this.location=e}toString(){return Vs(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof Ms?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class Ps{constructor(){this.map=new Map}get(t){const e=Vs([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(Vs([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const Ls={partials:!0};function*Ds(t,e,i){const s=new Ps,n=new Ps,a=new Ps,r=new Ns(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];le(t)&&!r.has(t)&&n.push(i)}else{const i=t.segments[0];le(i)&&!e.has(i)&&n.push(t)}for(const i of t.segments)i instanceof Ms&&l(i,e)}function*h(t,s){if(t.arguments)for(const e of t.arguments())for(const t of Fs(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 Ms([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 Ns(a):s.push(a);for(const t of n.scope)if(le(t))a.add(t);else{const[e,i]=t;a.add(e);const s=Array.from(Fs(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 Is(t,e={}){return ri(Ds(t,Object.assign(Object.assign({},Ls),e).partials,!1))}function Os(t,e={}){return oi(Ds(t,Object.assign(Object.assign({},Ls),e).partials,!0))}class Ns{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(!le(e))return;const i=this.getAlias(e);return void 0!==i?new Ms([...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*Fs(t){en(t)?yield*Bs(t):t instanceof Es&&(yield*function*(t){for(const e of t.initial.postfix)en(e)&&(yield*Bs(e));for(const e of t.filters)for(const t of e.args)Ts(t)&&t[1]?yield*Bs(t[1]):en(t)&&(yield*Bs(t))}(t))}function*Bs(t){tn(t)?(yield*Bs(t.lhs),yield*Bs(t.rhs)):Js(t)&&(yield js(t))}function js(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,Ys(s)||Qs(s)||Zs(s)?e.push(s.content):Js(s)&&e.push(...js(s).segments);for(const s of t.props.slice(1))i=i||s.file,Ys(s)||Qs(s)||Zs(s)?e.push(s.content):Js(s)&&e.push(js(s));const[n,a]=t.getPosition();return new Ms(e,{row:n,col:a,file:i})}const zs=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function Vs(t,e=!1){const i=[],s=t[0];le(s)&&(!e||s.match(zs)?i.push(`${s}`):i.push(`['${s}']`));for(const e of t.slice(1))e instanceof Ms?i.push(`[${Vs(e.segments)}]`):le(e)?e.match(zs)?i.push(`.${e}`):i.push(`['${e}']`):i.push(`[${e}]`);return i.join("")}var Us,Hs,$s;!function(t){t.Partials="partials",t.Layouts="layouts",t.Root="root"}(Us||(Us={}));class Ws{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;We(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!==Us.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 We(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 Gs{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 Ws(this.liquid.options),this.parseLimit=new Ti("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new ys(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 Be(s);return i}parseToken(t,e){try{if(Xs(t)){const i=this.liquid.tags[t.name];return We(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return sn(t)===Hs.Output?new Cs(t,this.liquid):new Rs(t)}catch(e){if(Ie.is(e))throw e;throw new Ne(e,t)}}parseStream(t){return new ws(t,((t,e)=>this.parseToken(t,e)))}*_parseFileCached(t,e,i=Us.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:ri(o);n.write(a,l);try{return yield l}catch(t){throw n.remove(a),t}}*_parseFile(t,e,i=Us.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 qs(t){return sn(t)===Hs.Operator}function Ks(t){return sn(t)===Hs.HTML}function Xs(t){return sn(t)===Hs.Tag}function Ys(t){return sn(t)===Hs.Quoted}function Qs(t){return sn(t)===Hs.Number}function Js(t){return sn(t)===Hs.PropertyAccess}function Zs(t){return sn(t)===Hs.Word}function tn(t){return sn(t)===Hs.Range}function en(t){return(1667&sn(t))>0}function sn(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"}(Hs||(Hs={}));class nn{constructor(t={},e=fs,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=ke(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 Ti("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=n?n:new Ti("template render",Ki().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)=>ni(t,e)),{})}get(t){return this.getSync(t)}getSync(t){return oi(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return oi(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){le(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield an(t,e[s],this.ownPropertyOnly),i&&void 0===t)throw new ze(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 nn(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 an(t,e,i){if(t=ve(t),e=fe(e),be(t))return t;if(ye(t)&&e<0)return t[t.length+ +e];const s=function(t,e,i){return!i||oe.call(t,e)||t instanceof ne?t[e]:void 0}(t,e,i);return void 0===s&&t instanceof ne?t.liquidMethodMissing(e):he(s)?s.call(t):"size"===e?function(t){if(oe.call(t,"size")||void 0!==t.size)return t.size;if(ye(t)||le(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return ye(t)?t[0]:t.first}(t):"last"===e?function(t){return ye(t)?t[t.length-1]:t.last}(t):s}!function(t){t[t.OUTPUT=0]="OUTPUT",t[t.STORE=1]="STORE"}($s||($s={}));const rn=Me(Math.abs),on=Me(Math.max),ln=Me(Math.min),hn=Me(Math.ceil),cn=Me(((t,e,i=!1)=>i?Math.floor(t/e):t/e)),dn=Me(Math.floor),un=Me(((t,e)=>t-e)),pn=Me(((t,e)=>t%e)),gn=Me(((t,e)=>t*e));var fn=Object.freeze({__proto__:null,abs:rn,at_least:on,at_most:ln,ceil:hn,divided_by:cn,floor:dn,minus:un,modulo:pn,times:gn,round:function(t,e=0){t=fe(t),e=fe(e);const i=Math.pow(10,e);return Math.round(t*i)/i},plus:function(t,e){return t=fe(t),e=fe(e),Number(t)+Number(e)}});const _n=/[^\p{M}\p{L}\p{Nd}]+/gu,mn={raw:/\s+/g,default:_n,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:_n,none:null};var vn=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(ue(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(ue(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(ue(t)).replace(/%20/g,"+").replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())),uri_escape:t=>encodeURI(ue(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=ue(t);const s=mn[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 bn=Me((function(t,e){const i=ge(t),s=be(e)?" ":ue(e),n=i.length*(1+s.length);return this.context.memoryLimit.use(n),i.join(s)})),yn=Me((t=>we(t)?Ae(t):"")),wn=Me((t=>we(t)?t[0]:"")),xn=Me((function(t){const e=ge(t);return this.context.memoryLimit.use(e.length),[...e].reverse()}));function An(t,e=[]){const i=ge(t),s=ge(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function kn(t){return this.context.opts.jekyllWhere?e=>{return qe.is(t)?is(e,t):ye(e)?(i=t,e.some((t=>is(t,i)))):is(e,t);var i}:void 0===t?t=>Zi(t,this.context):e=>is(e,t)}function*Tn(t,e,i,s){const n=[];e=ge(e),this.context.memoryLimit.use(e.length);const a=new ys(ue(i)).readScopeValue();for(const t of e)n.push(yield Qi(a,this.context.spawn(t)));const r=kn.call(this,s);return e.filter(((e,i)=>r(n[i])===t))}function*Sn(t,e,i,s){const n=[],a=new Es(ue(s),this.liquid),r=ge(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*En(t,e,i){const s=new ys(ue(e)).readScopeValue(),n=ge(t),a=kn.call(this,i);for(let t=0;t<n.length;t++){if(a(yield Qi(s,this.context.spawn(n[t]))))return[t,n[t]]}}function*Cn(t,e,i){const s=new Es(ue(i),this.liquid),n=ge(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 Rn=Object.freeze({__proto__:null,join:bn,last:yn,first:wn,reverse:xn,sort:function*(t,e){const i=[],s=ge(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push([t,e?yield this.context._getFromScope(t,ue(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=ue(e),s=void 0===e?Re:(t,e)=>Re(t[i],e[i]),n=ge(t);return this.context.memoryLimit.use(n.length),[...n].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=ge(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push(yield this.context._getFromScope(t,ue(e),!1));return i},sum:function*(t,e){let i=0;const s=ge(t);for(const t of s){const s=Number(e?yield this.context._getFromScope(t,ue(e),!1):t);i+=Number.isNaN(s)?0:s}return i},compact:function(t){const e=ge(t);return this.context.memoryLimit.use(e.length),e.filter((t=>!be(fe(t))))},concat:An,push:function(t,e){return An.call(this,t,[e])},unshift:function(t,e){const i=ge(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...ge(t)];return e.pop(),e},shift:function(t){const e=ge(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return be(t=fe(t))?[]:(ye(t)||(t=ue(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*Tn.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*Tn.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*Sn.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*Sn.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=pe(t);const s=new ys(ue(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const e of t){const t=yield Qi(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 Es(ue(i),this.liquid);t=pe(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*En.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*Cn.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*En.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*Cn.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*En.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*Cn.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=ge(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(be(t=fe(t)))return[];ye(t)||(t=ue(t)),this.context.memoryLimit.use(e);const i=[...t].sort((()=>Math.random()-.5));return 1===e?i[0]:i.slice(0,e)}});function Mn(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=Ln(t,this.context.opts,i);return o?_i(o,e=be(e=fe(e))?this.context.opts.dateFormat:ue(e)):t}function Pn(t,e,i,s){const n=Ln(t,this.context.opts);if(!n)return t;if("ordinal"===i){const t=n.getDate();return _i(n,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return _i(n,`%d ${e} %Y`)}function Ln(t,e,i){let s;const n=null!=i?i:e.timezoneOffset,a=e.locale;return s="now"===(t=fe(t))||"today"===t?new ki(Date.now(),a,n):me(t)?new ki(1e3*t,a,n):le(t)?/^\d+$/.test(t)?new ki(1e3*+t,a,n):e.preserveTimezones&&void 0===i?ki.createDateFixedToTimezone(t,a):new ki(t,a,n):new ki(t,a,n),s.valid()?s:void 0}var Dn=Object.freeze({__proto__:null,date:Mn,date_to_xmlschema:function(t){return Mn.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return Mn.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return Pn.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return Pn.call(this,t,"%B",e,i)}});const In=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,On=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var Nn=Object.freeze({__proto__:null,append:function(t,e){We(2===arguments.length,"append expect 2 arguments");const i=ue(t),s=ue(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){We(2===arguments.length,"prepend expect 2 arguments");const i=ue(t),s=ue(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),e?(e=Pe(ue(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),ue(e).toUpperCase()},remove:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),i.split(ue(e)).join("")},remove_first:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),i.replace(ue(e),"")},remove_last:function(t,e){const i=ue(t);this.context.memoryLimit.use(i.length);const s=ue(e),n=i.lastIndexOf(s);return-1===n?i:i.substring(0,n)+i.substring(n+s.length)},rstrip:function(t,e){return t=ue(t),this.context.memoryLimit.use(t.length),e?(e=Pe(ue(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=ue(t);this.context.memoryLimit.use(i.length);const s=i.split(ue(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),e?(e=Pe(ue(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=ue(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=ue(t);return this.context.memoryLimit.use(s.length),s.split(ue(e)).join(i)},replace_first:function(t,e,i){const s=ue(t);return this.context.memoryLimit.use(s.length),s.replace(ue(e),i)},replace_last:function(t,e,i){const s=ue(t);this.context.memoryLimit.use(s.length);const n=ue(e),a=s.lastIndexOf(n);if(-1===a)return s;const r=ue(i);return s.substring(0,a)+r+s.substring(a+n.length)},truncate:function(t,e=50,i="..."){const s=ue(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=ue(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=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=ue(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(In)||[]).length+(t.match(On)||[]).length;case"auto":return In.test(t)?t.match(In).length+(t.match(On)||[]).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 Fn=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ps),fn),vn),Rn),Dn),Nn),ls);const Bn=["offset","limit","reversed"];function jn(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(Ys(e)){const t=i.parse(function(t){return t.content}(e));return zn(t)}return e}const s=[...t.readFileNameTemplate(e.options)],n=zn(i.parseTokens(s));return"none"===n?void 0:n}function zn(t){return 1===t.length&&Ks(t[0].token)?t[0].token.getContent():t}function*Vn(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield Qi(t,e)}class Un extends Xe{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 Hn={assign:class extends As{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 Es(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 As{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 ks(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",(()=>o=this.templates)).on("tag:else",(t=>{Ge(t.args),o=this.elseTemplates})).on("tag:endfor",(t=>{Ge(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=pe(yield Qi(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=>Bn.includes(t))):Bn.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 Xe(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))en(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends As{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(Xs(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 As{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new Es(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=fe(yield this.value.value(t,t.opts.lenientIf));let n=!1;for(const a of this.branches)for(const r of a.values){if(is(s,yield Qi(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 As{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(Xs(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends As{constructor(t,e,i,s){super(t,e,i);const{tokenizer:n}=t;this.file=jn(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 ks(n,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:n}=this,{renderer:a}=i,r=yield Vn(this.file,t,i);We(r,(()=>`illegal file path "${r}"`));const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",$s.OUTPUT);const l=yield s.render(t);n&&(l[r]=yield Qi(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&&le(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(le(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(en),en(this.file)&&(yield this.file),en(this.withVar)&&(yield this.withVar)}},render:class extends As{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer;for(this.file=jn(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 ks(n,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,n=yield Vn(this.file,t,i);We(n,(()=>`illegal file path "${n}"`));const a=t.spawn(),r=a.bottom();if(ni(r,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;r[i||n]=yield Qi(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=pe(yield Qi(s,t));r.forloop=new Xe(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&&le(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(le(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;le(i)?t.push([i,e]):le(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;le(i)?t.push([i,e]):le(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))en(t)&&(yield t);if(this.with){const{value:t}=this.with;en(t)&&(yield t)}if(this.for){const{value:t}=this.for;en(t)&&(yield t)}}},decrement:class extends As{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;me(i[this.variable])||(i[this.variable]=0),e.write(ue(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends As{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;me(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(ue(s))}*localScope(){yield this.identifier}},cycle:class extends As{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 Qi(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 Qi(a,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends As{constructor(t,e,i,s){super(t,e,i),this.branches=[];let n=[];s.parseStream(e).on("start",(()=>this.branches.push({value:new Es(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]}))).on("tag:elsif",(t=>{We(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new Es(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]})})).on("tag:else",(t=>{Ge(t.args),We(!this.elseTemplates,"duplicated else"),n=this.elseTemplates=[]})).on("tag:endif",(function(t){Ge(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(Zi(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 As{constructor(t,e,i,s){super(t,e,i),this.file=jn(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new ks(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",$s.OUTPUT),void(yield a.renderTemplates(this.templates,t,e));const r=yield Vn(this.file,t,i);We(r,(()=>`illegal file path "${r}"`));const o=yield i._parseLayoutFile(r,t.sync,this.currentFile);t.setRegister("blockMode",$s.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",$s.OUTPUT),t.push(yield s.render(t)),yield a.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&le(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))en(t)&&(yield t);en(this.file)&&(yield this.file)}partialScope(){if(le(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends As{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(Xs(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")===$s.STORE?t.getRegister("blocks")[this.block]=i:yield i(new Ze,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 Ze((e=>n(t,e))),e):n}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends As{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(Xs(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 As{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 ks(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=pe(yield Qi(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 Un(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))en(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends As{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 Es(t.tokenizer.readFilteredValue(),this.liquid),test:ts,templates:n=[]}))).on("tag:elsif",(t=>{a>0?n=[]:this.branches.push({value:new Es(t.tokenizer.readFilteredValue(),this.liquid),test:Zi,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 As{render(t,e){t.breakCalled=!0}},continue:class extends As{render(t,e){t.continueCalled=!0}},echo:class extends As{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new Es(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 As{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 As{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 $n{constructor(t={}){this.renderer=new Xi,this.filters={},this.tags={},this.options=_s(t),this.parser=new Gs(this),xe(Hn,((t,e)=>this.registerTag(e,t))),xe(Fn,((t,e)=>this.registerFilter(e,t)))}parse(t,e){return new Gs(this).parse(t,e)}_render(t,e,i){const s=e instanceof nn?e:new nn(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return ai(this,void 0,void 0,(function*(){return ri(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderSync(t,e,i){return oi(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new nn(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 ai(this,void 0,void 0,(function*(){return ri(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}parseAndRenderSync(t,e,i){return oi(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new Gs(this).parseFile(t,e,Us.Partials,i)}_parseLayoutFile(t,e,i){return new Gs(this).parseFile(t,e,Us.Layouts,i)}_parseFile(t,e,i,s){return new Gs(this).parseFile(t,e,i,s)}parseFile(t,e){return ai(this,void 0,void 0,(function*(){return ri(new Gs(this).parseFile(t,!1,e))}))}parseFileSync(t,e){return oi(new Gs(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 ai(this,void 0,void 0,(function*(){return ri(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderFileSync(t,e,i){return oi(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return ai(this,void 0,void 0,(function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)}))}_evalValue(t,e){const i=new Es(t,this),s=e instanceof nn?e:new nn(e,this.options);return i.value(s)}evalValue(t,e){return ai(this,void 0,void 0,(function*(){return ri(this._evalValue(t,e))}))}evalValueSync(t,e){return oi(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){this.tags[t]=he(e)?e:function(t){return class extends As{constructor(e,i,s){super(e,i,s),he(t.parse)&&t.parse.call(this,e,i)}*render(e,i){const s=yield new ks(this.token.args,e.opts.keyValueSeparator).render(e);return yield t.render.call(this,e,i,s)}}}(e)}plugin(t){return t.call(this,$n)}express(){const t=this;let e=!0;return function(i,s,n){if(e){e=!1;const i=ms(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 ai(this,void 0,void 0,(function*(){return Is(t,e)}))}analyzeSync(t,e={}){return Os(t,e)}parseAndAnalyze(t,e,i={}){return ai(this,void 0,void 0,(function*(){return Is(this.parse(t,e),i)}))}parseAndAnalyzeSync(t,e,i={}){return Os(this.parse(t,e),i)}variables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Object.keys(i.variables)}))}variablesSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(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=Os(le(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 ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}))}variableSegmentsSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}globalVariables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Object.keys(i.globals)}))}globalVariablesSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(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=Os(le(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 ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}))}globalVariableSegmentsSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}}const Wn={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"},Gn=t=>(f("data-v-4a16637c"),t=t(),_(),t),qn={key:0,class:"popover"},Kn=Gn((()=>m("br",null,null,-1))),Xn=Gn((()=>m("ul",null,[m("li",null,"HTML - preview as webpage"),m("li",null,"PDF (Preview) - watermarked, free"),m("li",null,"PDF - final version, without watermark"),m("li",null,"Code - preview without test input")],-1)));var Yn={__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",qn,[g(" The preview mode has 4 modes: "),Kn,Xn])):d("v-if",!0)],32)}}},Qn=[],Jn=[];function Zn(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=Qn.indexOf(a);-1===r&&(r=Qn.push(a)-1,Jn[r]={}),i=Jn[r]&&Jn[r][s]?Jn[r][s]:Jn[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}}Zn("\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",{}),Yn.__scopeId="data-v-4a16637c",Yn.__file="settingsmodule/src/pages/templates/explainPreviewMode.vue";const ta=m("div",{class:"field half"},[m("div",{class:"type-label"}," Template name ")],-1),ea=m("div",{class:"field half"},[m("div",{class:"type-label"}," Description ")],-1),ia=m("div",{class:"field half"},[m("div",{class:"type-label"},"Format")],-1),sa=m("div",{class:"field half"},[m("div",{class:"type-label"}," Orientation ")],-1),na={key:0,class:"TTA-popup"},aa={class:"TTA-toolbar"},ra={class:"right-side"},oa={class:"setwidth"},la={class:"TTA-action"},ha={class:"TTA-wapper"},ca={class:"devFields"},da={id:"partSelect"},ua=["src","srcDoc"],pa={class:"tta-notice"},ga=m("a",{href:"https://app.texttoanything.nl",target:"_blank"},"TTA app",-1);var fa=v({__name:"templates",setup(t){const{useFlowsStore:s,useNotificationsStore:n}=e(),a=s(),f=n(),_=b((()=>a.flows.filter((t=>"webhook"===t.trigger&&"POST"==t.options.method)).map((t=>({text:t.name,value:t.id}))))),v=u([{text:"Name",value:"name",sortable:!1,width:300},{text:"Description",value:"description",sortable:!1,width:400},{text:"Format",value:"format",sortable:!1,width:100},{text:"",value:"del",width:60,sortable:!1}]),P=u([]),L=u(!1),D=u(!1),I=u("Development"),O=u("html"),N=u(""),F=u(!1),B=u(),j=u(50),z=b((()=>100-j.value)),V=b((()=>100-z.value)),U=u("");function H(){"Development"==I.value&&(U.value=""),"Header"==I.value&&(U.value=X.value.header),"Body"==I.value&&(U.value=X.value.template),"Footer"==I.value&&(U.value=X.value.footer)}function $(t){"Header"==I.value?X.value.header=t:"Body"==I.value?X.value.template=t:X.value.footer=t}function W(t){"Fixed"==X.value.input_type?X.value.input_fixed=t:X.value.input_flow_body=t}y((()=>I.value),(()=>{H()}),{immediate:!0});const G=i(),K={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:"{}"},X=u(structuredClone(K)),Y=new $n;async function Q(t){if("Flow"==X.value.input_type&&!X.value.input_flow)return;N.value="rendering";let e={};try{if("Flow"==X.value.input_type){const t=await G.post("/flows/trigger/"+X.value.input_flow,JSON.parse(X.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==X.value.input_fixed&&(X.value.input_fixed="{}");try{e=JSON.parse(X.value.input_fixed)}catch(t){}}if("html"==t||"code"==t){const i=(X.value.header||"")+(X.value.template||"")+(X.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 Y.render(Y.parse(i),e))],{type:"text/html"});N.value=URL.createObjectURL(s)}else{const t=Y.parse(X.value.header||""),i=Y.parse(X.value.template),s=Y.parse(X.value.footer||""),n=await Y.render(t,e),a=await Y.render(i,e),r=await Y.render(s,e),o=await fetch("/tta/pdf?preview="+("pdf-preview"==O.value?"preview":""),{body:JSON.stringify({...X.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"!=X.value.orientation}),method:"POST",headers:{"Content-Type":"application/json"}}).then((t=>t.blob())).then((t=>URL.createObjectURL(t)));N.value=o}}catch(t){console.error(t),f.add({title:"Error while generating PDF",text:"Please check your console/terminal for the error.",type:"error",dialog:!0}),N.value=URL.createObjectURL(new Blob(["Error occurred: "+((null==t?void 0:t.message)||t)],{type:"text/html"}))}}async function J(){const t=await G.get("/items/TTA_htmltemplates",{params:{limit:-1}});P.value=t.data.data}async function Z(){-1==X.value.id?await G.post("/items/TTA_htmltemplates",{...X.value,id:void 0}):await G.patch("/items/TTA_htmltemplates/"+X.value.id,{...X.value,id:void 0}),L.value=!1,J()}async function tt(){await G.delete("/items/TTA_htmltemplates/"+B.value),P.value=P.value.filter((t=>t.id!=B.value)),F.value=!1}function et({item:t}){X.value=t,D.value=!0}function it(){X.value=structuredClone(K),D.value=!1}function st(){const t={wrap_line_length:0,indent_inner_html:!0};X.value.template=q.exports.html(X.value.template,t),X.value.footer=q.exports.html(X.value.footer,t),X.value.header=q.exports.html(X.value.header,t),H()}return y((()=>X.value.id),((t,e)=>{t!=e&&(I.value="",w((()=>{I.value="Body"})))})),y((()=>[X.value.header,X.value.template,X.value.footer,X.value.input_type,X.value.input_flow,X.value.input_fixed,O.value]),(()=>{["html","code"].includes(O.value)&&Q(O.value)}),{deep:!0,immediate:!0}),x((async()=>{j.value=parseInt(localStorage.getItem("TTA-widthPartition")||"50"),J()})),y((()=>j.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"),b=r("v-select"),y=r("v-list"),w=r("v-card-text"),x=r("v-card-actions"),H=r("v-card"),G=r("v-dialog"),q=r("VSelect"),K=r("v-slider"),Y=r("VButton"),J=r("VIcon"),nt=r("v-table"),at=r("VNotice"),rt=r("private-view"),ot=A("tooltip");return o(),l(rt,{title:"Offline templates"},{navigation:h((()=>[c(Wn)])),actions:h((()=>[c(s,{rounded:"",icon:"",onClick:e[0]||(e[0]=t=>L.value=!0)},{default:h((()=>[c(i,{name:"add"})])),_:1}),c(G,{modelValue:L.value,"onUpdate:modelValue":e[6]||(e[6]=t=>L.value=t),persistent:!0},{default:h((()=>[c(H,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((()=>[ta,c(a,{modelValue:X.value.name,"onUpdate:modelValue":e[1]||(e[1]=t=>X.value.name=t),placeholder:"Template name"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[ea,c(a,{modelValue:X.value.description,"onUpdate:modelValue":e[2]||(e[2]=t=>X.value.description=t),placeholder:"Description"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[ia,c(b,{modelValue:X.value.format,"onUpdate:modelValue":e[3]||(e[3]=t=>X.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((()=>[sa,c(b,{modelValue:X.value.orientation,"onUpdate:modelValue":e[4]||(e[4]=t=>X.value.orientation=t),placeholder:"Orientation",items:[{value:"portrait",text:"Portrait"},{value:"landscape",text:"Landscape"}]},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1}),c(x,null,{default:h((()=>[c(s,{secondary:"",onClick:e[5]||(e[5]=t=>L.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{disabled:!X.value.name||!X.value.format,onClick:Z},{default:h((()=>[g(" Save ")])),_:1},8,["disabled"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),default:h((()=>[D.value?(o(),p("div",na,[m("div",aa,[m("div",{onClick:e[7]||(e[7]=t=>L.value=!0),class:"TTA-template-title"},[g(k(X.value.name)+" ",1),c(i,{name:"edit"})]),m("div",ra,[c(q,{modelValue:O.value,"onUpdate:modelValue":e[8]||(e[8]=t=>O.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(Yn,{text:"This is helpful info."}),T((o(),p("div",{class:"TTA-action",onClick:st},[c(i,{name:"vertical_align_center"})])),[[ot,"Click to format your HTML",void 0,{bottom:!0}]]),T((o(),p("div",{class:"TTA-action",onClick:Z},[c(i,{name:"save"})])),[[ot,"Click to save the template",void 0,{bottom:!0}]]),m("div",oa,[c(K,{modelValue:j.value,"onUpdate:modelValue":e[9]||(e[9]=t=>j.value=t),min:10,max:90,class:"TTA-slider"},null,8,["modelValue"])]),m("div",la,[c(i,{name:"close",onClick:it})])])]),m("div",ha,[m("div",{style:S("width: "+E(V)+"%"),class:"TTA-editor-wrapper"},["Development"==I.value?(o(),p(C,{key:0},[m("div",ca,[c(b,{modelValue:X.value.input_type,"onUpdate:modelValue":e[10]||(e[10]=t=>X.value.input_type=t),class:"max-w-input",items:[{value:"Flow",text:"Flow"},{value:"Fixed",text:"Fixed"}]},null,8,["modelValue"]),"Flow"==X.value.input_type?(o(),l(b,{key:0,modelValue:X.value.input_flow,"onUpdate:modelValue":e[11]||(e[11]=t=>X.value.input_flow=t),class:"max-w-input",items:E(_)},null,8,["modelValue","items"])):d("v-if",!0)]),"Fixed"==X.value.input_type?(o(),l(R("interface-input-code"),{key:0,class:"TTA-editor",value:X.value.input_fixed,language:"json",onInput:W},null,40,["value"])):d("v-if",!0),"Flow"==X.value.input_type?(o(),l(R("interface-input-code"),{key:1,class:"TTA-editor",value:X.value.input_flow_body,language:"json",onInput:W},null,40,["value"])):d("v-if",!0)],64)):d("v-if",!0),"Development"!=I.value?(o(),l(R("interface-input-code"),{key:1,class:"TTA-editor",value:U.value,language:"htmlmixed",onInput:$},null,40,["value"])):d("v-if",!0),m("div",da,[c(b,{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),m("iframe",{class:"TTA-preview",src:"rendering"==N.value?void 0:N.value,srcDoc:"rendering"==N.value?E('\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: "+E(z)+"%")},null,12,ua),O.value.startsWith("pdf")?(o(),l(Y,{key:0,onClick:e[13]||(e[13]=t=>{Q("pdf")}),icon:!0,outlined:!1,id:"generatePDF"},{default:h((()=>[c(i,{name:"refresh"})])),_:1})):d("v-if",!0)])])):d("v-if",!0),c(nt,{headers:v.value,"onUpdate:headers":e[14]||(e[14]=t=>v.value=t),"show-resize":"","onClick:row":et,items:P.value},{"item.del":h((({item:t})=>[c(Y,{onClick:M((e=>{return i=t.id,B.value=i,void(F.value=!0);var i}),["stop"]),outlined:!0,icon:!0,rounded:!0},{default:h((()=>[c(J,{name:"delete"})])),_:2},1032,["onClick"])])),_:1},8,["headers","items"]),m("div",pa,[c(at,null,{default:h((()=>[g(" You can create online templates in the "),ga,g(" for a better editor experience. ")])),_:1})]),c(G,{modelValue:F.value,"onUpdate:modelValue":e[16]||(e[16]=t=>F.value=t),persistent:!0},{default:h((()=>[c(H,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[15]||(e[15]=t=>F.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{kind:"danger",onClick:tt},{default:h((()=>[g(" Proceed ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})}}});Zn("\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}\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-editor .CodeMirror-dialog.CodeMirror-dialog-top {\n position: fixed !important;\n bottom: 0 !important;\n z-index: 100 !important;\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",{}),fa.__file="settingsmodule/src/pages/templates.vue";var _a=v({__name:"virusscanDialog",setup(t){const e=i(),s=u([]),n=u(!1);x((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=b((()=>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"),_=r("v-icon");return o(),p(C,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(k(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(_,{name:"edit"}),E(a)==s.value.length?(o(),p(C,{key:0},[g(" All ")],64)):(o(),p(C,{key:1},[g(k(E(a))+"/"+k(s.value.length),1)],64)),g(" folders are being scanned ")])),_:1})],64)}}});_a.__file="settingsmodule/src/pages/settings/virusscanDialog.vue";var ma=v({__name:"passwordField",setup(t){const e=P(),i=u(!0);function s(){i.value=!i.value}return(t,n)=>{const a=r("VIcon"),d=r("VInput"),u=A("tooltip");return o(),l(d,{modelValue:E(e),"onUpdate:modelValue":n[0]||(n[0]=t=>L(e)?e.value=t:null),type:i.value?"password":"text"},{append:h((()=>[T(c(a,{clickable:"",onClick:s,name:i.value?"visibility":"visibility_off"},null,8,["name"]),[[u,i.value?"Show value":"Hide value"]])])),_:1},8,["modelValue","type"])}}});ma.__file="settingsmodule/src/components/passwordField.vue";const va=t=>(f("data-v-7f9dbb3b"),t=t(),_(),t),ba={class:"cards-wrapper"},ya=va((()=>m("span",{class:"field-name"},"RapidAPI token",-1))),wa=va((()=>m("span",{class:"field-name"},"RapidAPI virusscanner token",-1))),xa={class:"field-name info-parent"},Aa=va((()=>m("div",null,[g(" What should happen when a virus is detected? "),m("ul",null,[m("li",null," Delete threads, threads will be deleted immediately "),m("li",null," Trigger flow, the selected flow will be triggered with upload payload ")]),m("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))),ka={key:0},Ta={class:"field-name info-parent"};var Sa=v({__name:"settings",setup(t){const s=u(""),n=u(""),a=u(!1),f=u(""),_=u(""),v=u(""),y=i(),{useFlowsStore:w}=e(),A=w(),k=b((()=>A.flows.map((t=>({text:t.name,value:t.id})))));async function T(){R({TTA_KEY:s.value,TTA_KEY_VIRUS:n.value},"apikeys")}async function S(){R({TTA_VIRUSSCANNER_ENABLED:a.value,TTA_VIRUSSCANNER_MODE:f.value,TTA_VIRUSSCANNER_FLOW_ID:_.value},"virus")}async function R(t,e){v.value=e,await y.patch("/settings",t),setTimeout((()=>{v.value=""}),500)}return x((async()=>{const t=await y.get("/settings");s.value=t.data.data.TTA_KEY,n.value=t.data.data.TTA_KEY_VIRUS,_.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||"delete"})),(t,e)=>{const i=r("v-card-title"),u=r("v-card-text"),b=r("v-icon"),y=r("v-button"),w=r("v-progress-circular"),x=r("v-card-actions"),A=r("v-card"),R=r("VCheckbox"),M=r("VIcon"),P=r("VNotice"),L=r("v-hover"),D=r("v-select"),I=r("private-view");return o(),l(I,{title:"Settings"},{navigation:h((()=>[c(Wn)])),default:h((()=>[m("div",ba,[c(A,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("API settings")])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[ya,c(ma,{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t)},null,8,["modelValue"])])])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(y,{href:"https://rapidapi.com/Attacler/api/text-to-anything",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(b,{name:"open_in_new"}),g(" Get RapidAPI token ")])),_:1})])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[wa,c(ma,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=t=>n.value=t)},null,8,["modelValue"])])])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(y,{href:"https://rapidapi.com/Attacler/api/virusscan-texttoanything/",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(b,{name:"open_in_new"}),g(" Get RapidAPI virusscanner token ")])),_:1})])),_:1}),c(x,{class:"action-buttons"},{default:h((()=>[c(y,{onClick:T,disabled:"apikeys"==v.value,id:"save-button"},{default:h((()=>["apikeys"!=v.value?(o(),p(C,{key:0},[g(" Save ")],64)):(o(),l(w,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1}),c(A,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("Virusscanner settings")])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[c(R,{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(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[m("div",xa,[g(" Mode "),c(L,null,{default:h((({hover:t})=>[c(M,{name:"info"}),t?(o(),l(P,{key:0,class:"info-popup"},{default:h((()=>[Aa])),_:1})):d("v-if",!0)])),_:1})]),c(D,{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",ka,[m("div",Ta,[g(" Flow "),c(L,null,{default:h((({hover:t})=>[c(M,{name:"info"}),t?(o(),l(P,{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(D,{items:E(k),showDeselect:"",modelValue:_.value,"onUpdate:modelValue":e[4]||(e[4]=t=>_.value=t)},null,8,["items","modelValue"])])):d("v-if",!0)])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(_a)])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(y,{href:"https://texttoanything.nl/docs/directus/virusscanner",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(b,{name:"open_in_new"}),g(" Virusscanner documentation ")])),_:1})])),_:1}),c(x,{class:"action-buttons"},{default:h((()=>[c(y,{onClick:S,disabled:"virus"==v.value,id:"save-button"},{default:h((()=>["virus"!=v.value?(o(),p(C,{key:0},[g(" Save ")],64)):(o(),l(w,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1})])])),_:1})}}});Zn("\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",{}),Sa.__scopeId="data-v-7f9dbb3b",Sa.__file="settingsmodule/src/pages/settings.vue";var Ea=v({__name:"dateTimePicker",props:{value:{type:[String,null],required:!0}},setup(t,{emit:e}){const i=t,s=u(),n=u(i.value);const a=b((()=>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 y((()=>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:E(a)?void 0:n.value,onClick:t},D({_:2},[E(a)?{name:"prepend",fn:h((()=>[g(k(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)])}}});Zn("\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",{}),Ea.__scopeId="data-v-42405105",Ea.__file="settingsmodule/src/components/dateTimePicker.vue";var Ca={d:(t,e)=>{for(var i in e)Ca.o(e,i)&&!Ca.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ra={};function Ma(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 Pa(t,e){if(t){if("string"==typeof t)return Ma(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)?Ma(t,e):void 0}}function La(t){return function(t){if(Array.isArray(t))return Ma(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Pa(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 Da(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Ca.d(Ra,{Z:()=>Qa});const Ia=(Ba={computed:()=>a.computed,createTextVNode:()=>a.createTextVNode,createVNode:()=>a.createVNode,defineComponent:()=>a.defineComponent,reactive:()=>a.reactive,ref:()=>a.ref,watch:()=>a.watch,watchEffect:()=>a.watchEffect},ja={},Ca.d(ja,Ba),ja),Oa=(0,Ia.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var t=this.data,e=this.onClick;return(0,Ia.createVNode)("span",{class:"vjs-tree-brackets",onClick:e},[t])}}),Na=(0,Ia.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,Ia.computed)((function(){return t.isMultiple?"checkbox":"radio"})),model:(0,Ia.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,Ia.createVNode)("label",{class:["vjs-check-controller",e?"is-checked":""],onClick:function(t){return t.stopPropagation()}},[(0,Ia.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(t)},null),(0,Ia.createVNode)("input",{checked:e,class:"vjs-check-controller-original is-".concat(t),type:t,onChange:function(){return i("change",e)}},null)])}}),Fa=(0,Ia.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,Ia.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(i?"open":"close"),onClick:e},[(0,Ia.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,Ia.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 Ba,ja;function za(t){return za="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},za(t)}function Va(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ua(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=Va(t);if("array"===u){var p=Ha(t.map((function(t,s,n){return Ua(t,"".concat(e,"[").concat(s,"]"),i+1,{index:s,showComma:s!==n.length-1,length:d,type:o})})));return[Ua("[",e,i,{showComma:!1,key:n,length:t.length,type:"arrayStart"})[0]].concat(p,Ua("]",e,i,{showComma:h,length:t.length,type:"arrayEnd"})[0])}if("object"===u){var g=Object.keys(t),f=Ha(g.map((function(s,n,a){return Ua(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[Ua("{",e,i,{showComma:!1,key:n,index:a,length:g.length,type:"objectStart"})[0]].concat(f,Ua("}",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 Ha(t){if("function"==typeof Array.prototype.flat)return t.flat();for(var e=La(t),i=[];e.length;){var s=e.shift();Array.isArray(s)?e.unshift.apply(e,La(s)):i.push(s)}return i}function $a(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"!==za(t))return t;if(e.get(t))return e.get(t);if(Array.isArray(t)){var i=t.map((function(t){return $a(t,e)}));return e.set(t,i),i}var s={};for(var n in t)s[n]=$a(t[n],e);return e.set(t,s),s}function Wa(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 Ga(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Wa(Object(i),!0).forEach((function(e){Da(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Wa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var qa={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 Ka=(0,Ia.defineComponent)({name:"TreeNode",props:Ga(Ga({},qa),{},{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,Ia.computed)((function(){return Va(t.node.content)})),n=(0,Ia.computed)((function(){return"vjs-value vjs-value-".concat(s.value)})),a=(0,Ia.computed)((function(){return t.showDoubleQuotes?'"'.concat(t.node.key,'"'):t.node.key})),r=(0,Ia.computed)((function(){return"multiple"===t.selectableType})),o=(0,Ia.computed)((function(){return"single"===t.selectableType})),l=(0,Ia.computed)((function(){return t.nodeSelectable(t.node)&&(r.value||o.value)})),h=(0,Ia.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,Ia.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)},_=function(){i("nodeClick",t.node),l.value&&t.selectOnClickNode&&i("selectedChange",t.node)},m=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,Ia.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:_,style:t.style},[t.showLineNumber&&(0,Ia.createVNode)("span",{class:"vjs-node-index"},[i.id+1]),t.showSelectController&&l.value&&"objectEnd"!==i.type&&"arrayEnd"!==i.type&&(0,Ia.createVNode)(Na,{isMultiple:r.value,checked:t.checked,onChange:f},null),(0,Ia.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(i.level)).map((function(e,i){return(0,Ia.createVNode)("div",{key:i,class:{"vjs-indent-unit":!0,"has-line":t.showLine}},null)})),t.showIcon&&(0,Ia.createVNode)(Fa,{nodeType:i.type,onClick:g},null)]),i.key&&(0,Ia.createVNode)("span",{class:"vjs-key"},[(e=t.renderNodeKey,e?e({node:t.node,defaultKey:a.value||""}):a.value),(0,Ia.createVNode)("span",{class:"vjs-colon"},[":".concat(t.showKeyValueSpace?" ":"")])]),(0,Ia.createVNode)("span",null,["content"!==i.type&&i.content?(0,Ia.createVNode)(Oa,{data:i.content.toString(),onClick:p},null):(0,Ia.createVNode)("span",{class:n.value,onClick:!t.editable||t.editableTrigger&&"click"!==t.editableTrigger?void 0:m,onDblclick:t.editable&&"dblclick"===t.editableTrigger?m:void 0},[t.editable&&h.editing?(0,Ia.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,Ia.createVNode)("span",null,[","]),t.showLength&&t.collapsed&&(0,Ia.createVNode)("span",{class:"vjs-comment"},[(0,Ia.createTextVNode)(" // "),i.length,(0,Ia.createTextVNode)(" items ")])])])}}});function Xa(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 Ya(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Xa(Object(i),!0).forEach((function(e){Da(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Xa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}const Qa=(0,Ia.defineComponent)({name:"Tree",props:Ya(Ya({},qa),{},{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,Ia.ref)(),a=(0,Ia.computed)((function(){return Ua(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:Ya(Ya({},s),{},Da({},n.path,1))}),{})},o=(0,Ia.reactive)({translateY:0,visibleData:null,hiddenPaths:r(t.deep,t.collapsedNodeLength)}),l=(0,Ia.computed)((function(){for(var t=null,e=[],i=a.value.length,s=0;s<i;s++){var n=Ya(Ya({},a.value[s]),{},{id:s}),r=o.hiddenPaths[n.path];if(t&&t.path===n.path){var l="objectStart"===t.type,h=Ya(Ya(Ya({},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,Ia.computed)((function(){var e=t.selectedValue;return e&&"multiple"===t.selectableType&&Array.isArray(e)?e:[e]})),c=(0,Ia.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=La(h.value);-1!==r?o.splice(r,1):o.push(n),i("update:selectedValue",o),i("selectedChange",o,La(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)||Pa(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=Ya(Ya({},o.hiddenPaths),{},Da({},e,1));else{var i=Ya({},o.hiddenPaths);delete i[e],o.hiddenPaths=i}},_=function(e,s){t.collapsedOnClickBrackets&&f(e,s.path),i("bracketsClick",e,s)},m=function(t,e){f(t,e.path),i("iconClick",t,e)},v=function(e,s){var n=$a(t.data),a=t.rootPath;new Function("data","val","data".concat(s.slice(a.length),"=val"))(n,e),i("update:data",n)};return(0,Ia.watchEffect)((function(){c.value&&function(t){throw new Error("[VueJSONPretty] ".concat(t))}(c.value)})),(0,Ia.watchEffect)((function(){l.value&&d()})),(0,Ia.watch)((function(){return t.deep}),(function(e){e&&(o.hiddenPaths=r(e,t.collapsedNodeLength))})),(0,Ia.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,Ia.createVNode)(Ka,{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:_,onIconClick:m,onSelectedChange:p,onValueChange:v,style:t.itemHeight&&20!==t.itemHeight?{lineHeight:"".concat(t.itemHeight,"px")}:{}},null)}));return(0,Ia.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?Ya({paddingLeft:"".concat(12*Number(a.value.length.toString().length),"px")},t.style):t.style},[t.virtual?(0,Ia.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(t.height,"px")}},[(0,Ia.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(l.value.length*t.itemHeight,"px")}},[(0,Ia.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(o.translateY,"px)")}},[d])])]):d])}}});var Ja=Ra.Z;Zn('.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 Za=t=>(f("data-v-2ded8f93"),t=t(),_(),t),tr={class:"content"},er=Za((()=>m("div",{class:"header"},[m("span",{class:"dot success"}),m("span",{class:"type-label"}," Trigger ")],-1))),ir={class:"inset"},sr={class:"steps"},nr={class:"header"},ar={class:"type-label"},rr={class:"subdued"},or={class:"inset"};var lr=v({__name:"displayFlowLogs",props:{currentLog:{type:null,required:!0}},setup(t,{emit:e}){const{currentLog:i}=t,s=u(""),n=b((()=>{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 _=r("v-icon"),v=r("v-button"),b=r("v-detail"),y=r("v-drawer"),w=A("tooltip");return o(),l(y,{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(v,{key:0,class:"ml-auto",onClick:f},{default:h((()=>[g(k(s.value)+" ",1),c(_,{name:"copy_all"})])),_:1})):d("v-if",!0)])),default:h((()=>[m("div",tr,[er,m("div",ir,[c(b,{label:"Payload",class:"payload"},{default:h((()=>[c(E(Ja),{data:t.currentLog.data.data.$trigger,virtual:"",onNodeClick:u[0]||(u[0]=t=>a("$trigger",t)),selectableType:"single"},null,8,["data"])])),_:1})]),m("div",sr,[(o(!0),p(C,null,I(E(n),(t=>(o(),p("div",{key:t.id,class:"step"},[m("div",nr,[m("span",{class:O(["dot",t.status])},null,2),T((o(),p("span",ar,[g(k(t.key)+" ",1),m("span",rr," "+k(t.operationType),1)])),[[w,t.key]])]),m("div",or,[t.options?(o(),l(b,{key:0,label:"Options"},{default:h((()=>[c(E(Ja),{data:t.options,virtual:""},null,8,["data"])])),_:2},1024)):d("v-if",!0),null!==t.data?(o(),l(b,{key:1,label:"Payload",class:"payload"},{default:h((()=>[c(E(Ja),{data:t.data,virtual:"",onNodeClick:e=>a(t.key,e),selectableType:"single"},null,8,["data","onNodeClick"])])),_:2},1024)):d("v-if",!0)])])))),128))])])])),_:1})}}});Zn("\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",{});Zn("\n.payload .vjs-value,\n.payload .vjs-key {\n cursor: pointer;\n}\n",{}),lr.__scopeId="data-v-2ded8f93",lr.__file="settingsmodule/src/components/displayFlowLogs.vue";const hr=t=>(f("data-v-231dc418"),t=t(),_(),t),cr={class:"px-5 w-full"},dr=["title"],ur=["title"],pr={class:"filters"},gr=hr((()=>m("h2",null,"Filter",-1))),fr=hr((()=>m("div",{class:"field-name"},"Flow",-1))),_r=hr((()=>m("div",{class:"field-name"},"From date",-1))),mr=hr((()=>m("div",{class:"field-name"},"To date",-1))),vr=hr((()=>m("div",{class:"field-name"},"Sorting order",-1)));var br=v({__name:"flowLogsExplorer",setup(t){const{useFlowsStore:s}=e(),n=i(),a=s(),p=u(),f=u([]),_=u(),v=u(),y=u(""),w=u("all"),A=u(),T=u("Descending");async function S(){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]":_.value?_.value:void 0,"filter[_and][4][activity][timestamp][_lte]":v.value?v.value+"T23:59:59":void 0,"fields[0]":"*","fields[1]":"activity.*",limit:2e3,sort:"Descending"==T.value?["-activity.timestamp"]:["activity.timestamp"]}});f.value=t.data.data}x((()=>{const t=new Date;t.setDate(t.getDate()-7),_.value=t.toISOString().split("T")[0],v.value=(new Date).toISOString().split("T")[0]}));const C=b((()=>{if(!y.value&&"all"==w.value)return f.value;let t=f.value;return"all"!=w.value&&(t=t.filter((t=>t.data.steps[t.data.steps.length-1].status==("error"==w.value?"reject":"resolve")))),y.value&&(t=f.value.filter((t=>{const e=t.data.data.$trigger;return JSON.stringify(e).toLowerCase().includes(y.value.toLowerCase())}))),t})),R=b((()=>a.flows.map((t=>({text:t.name,value:t.id})))));function M(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 P(t){A.value=t.item}function L(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"),b=r("private-view");return o(),l(b,{title:"Flow logs explorer"},{navigation:h((()=>[c(Wn)])),sidebar:h((()=>[m("div",pr,[gr,m("div",null,[fr,c(n,{items:E(R),showDeselect:"",modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=t=>p.value=t)},null,8,["items","modelValue"])]),m("div",null,[_r,_.value?(o(),l(Ea,{key:0,modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=t=>_.value=t),value:_.value},null,8,["modelValue","value"])):d("v-if",!0)]),m("div",null,[mr,v.value?(o(),l(Ea,{key:0,modelValue:v.value,"onUpdate:modelValue":e[2]||(e[2]=t=>v.value=t),value:v.value},null,8,["modelValue","value"])):d("v-if",!0)]),m("div",null,[vr,c(n,{modelValue:T.value,"onUpdate:modelValue":e[3]||(e[3]=t=>T.value=t),items:["Descending","Ascending"]},null,8,["modelValue"])]),c(a,{onClick:S,fullWidth:!0},{default:h((()=>[g("Search")])),_:1}),m("div",null,[g(" Input filter "),c(u,{modelValue:y.value,"onUpdate:modelValue":e[4]||(e[4]=t=>y.value=t),placeholder:"Input filter",class:"w-full"},null,8,["modelValue"])]),m("div",null,[g(" Status "),c(f,{modelValue:w.value,"onUpdate:modelValue":e[5]||(e[5]=t=>w.value=t),items:[{text:"All",value:"all"},{text:"Error",value:"error"},{text:"Success",value:"success"}]},null,8,["modelValue"])])]),A.value?(o(),l(lr,{key:0,onClose:e[6]||(e[6]=t=>A.value=null),currentLog:A.value},null,8,["currentLog"])):d("v-if",!0)])),default:h((()=>[m("div",cr,[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:E(C),"onClick:row":P},{"item.status":h((({item:t})=>[c(i,{name:L(t)?"error":"check_circle",class:O(["flowLogStatus",{error:L(t),success:!L(t)}])},null,8,["name","class"])])),"item.timestamp":h((({item:t})=>[g(k(new Date(t.activity.timestamp).toLocaleDateString()),1)])),"item.input":h((({item:t})=>[m("div",{title:JSON.stringify(t.data.data.$trigger,null,2)},k(t.data.data.$trigger),9,dr)])),"item.output":h((({item:t})=>[m("div",{title:JSON.stringify(M(t),null,2)},k(M(t)),9,ur)])),_:1},8,["items"])])])),_:1})}}});Zn("\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",{}),br.__scopeId="data-v-231dc418",br.__file="settingsmodule/src/pages/flowLogsExplorer.vue";var yr=s({id:"tta_settings",name:"Text to anything settings",icon:"text_fields",routes:[{path:"",redirect:"/tta_settings/templates"},{path:"templates",component:fa},{path:"settings",component:Sa},{path:"flowsLogExplorer",component:br}]}),wr=v({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=N("api"),n=u(0),a=u([]);return x((async()=>{y((()=>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"])}}});wr.__file="pdf/PDFOnlineTemplateSelector/src/interface.vue";var xr=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:wr,options:null,types:["string"]}),Ar=v({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=N("api"),n=u(""),a=u([]);return x((async()=>{y((()=>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"])}}});Ar.__file="pdf/PDFTemplateSelector/src/interface.vue";var kr=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:Ar,options:null,types:["string"]});const Tr={style:{display:"none"}};var Sr=v({__name:"interface",props:{label:{type:String,required:!0},flow:{type:null,required:!0},primaryKey:{type:null,required:!0},disableOnEdit:{type:Boolean,required:!0}},setup(t){const s=t,n=i(),{useNotificationsStore:a}=e(),d=a(),f=u(!1),_=u(!1);function v(){const t=document.querySelector('.header-bar button:has([data-icon="check"])');_.value=!t||t.hasAttribute("disabled")}const y=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"disabled"===t.attributeName&&v()}))}));function w(){const t=document.querySelector('.header-bar button:has([data-icon="check"])');return!!t&&(y.observe(t,{attributes:!0,attributeFilter:["disabled"]}),v(),!0)}x((()=>{if(!w()){const t=setInterval((()=>{w()&&clearInterval(t)}),500);setTimeout((()=>clearInterval(t)),5e3)}})),F((()=>{y.disconnect()}));const S=b((()=>!!f.value||!!s.disableOnEdit&&!_.value));async function R(){var t;if(!S.value){f.value=!0;try{const e=await n.post("/flows/trigger/"+s.flow,{id:s.primaryKey});if("string"==typeof e.data)return window.open("/assets/"+e.data,"_blank"),void(f.value=!1);(null==(t=null==e?void 0:e.data)?void 0:t.message)&&await new Promise((t=>{var i;d.add({title:(null==(i=null==e?void 0:e.data)?void 0:i.title)||"TTA notification",text:e.data.message,dialog:!0,dismissAction:async()=>{t(!0)}})})),(null==e?void 0:e.data.redirectURL)&&("current"==e.data.redirectTarget?window.location=e.data.redirectURL:window.open(e.data.redirectURL)),f.value=!1}catch(t){}f.value=!1}}return(t,e)=>{const i=r("VButton"),n=A("tooltip");return o(),p(C,null,[T((o(),l(i,{onClick:R,loading:f.value,disabled:E(S)},{default:h((()=>[g(k(s.label),1)])),_:1},8,["loading","disabled"])),[[n,E(S)?"Please save first":null]]),m("div",Tr,[c(i,{loading:!0,disabled:!0})])],64)}}});Sr.__file="pdf/GeneratePDFFromTemplateInterface/src/interface.vue";var Er=n({id:"tta-download-interface",name:"Trigger flow button",icon:"sim_card_download",description:"Trigger a flow with a button, with support for downloading files. (Text to anything)",hideLabel:!0,hideLoader:!0,component:Sr,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:b((()=>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"}}},{field:"disableOnEdit",name:"Disable on Edit",type:"boolean",meta:{width:"full",interface:"boolean",options:{label:"Disable button if there are unsaved changes"}},schema:{default_value:!1}}]},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 _,createElementVNode as m,defineComponent as v,computed as b,watch as y,nextTick as w,onMounted as x,resolveDirective as A,toDisplayString as k,withDirectives as T,normalizeStyle as S,unref as E,Fragment as C,resolveDynamicComponent as R,withModifiers as M,defineModel as P,isRef as L,createSlots as D,renderList as I,normalizeClass as O,inject as N,onBeforeUnmount as F,reactive as B,onUnmounted as j,Teleport as z,renderSlot as V}from"vue";var U,H=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"}}]}),$=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:"folder",name:"Target folder",type:"uuid",meta:{width:"full",interface:"system-folder",note:"The file will be placed in the selected folder."}},{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)}}}]}),W=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:"folder",name:"Target folder",type:"uuid",meta:{width:"full",interface:"system-folder",note:"The file will be placed in the selected folder."}},{field:"filename",name:"File name",type:"string",meta:{width:"full",interface:"input"}},{field:"mode",name:"Template source",type:"dropdown",meta:{interface:"select-dropdown",options:{choices:[{value:"online",text:"TTA Dashboard"},{value:"offline",text:"Directus"}]},note:"When selecting 'TTA Dashboard', you will be able to select a template from the TextToAnything dashboard. (https://app.texttoanything.nl)"}},{field:"template",name:"Template",type:"string",meta:{interface:"online"==t.mode?"TTA-pdf-online-template-selector":"TTA-pdf-template-selector",options:{}}},{field:"templatevariables",name:"Template variables",type:"json",meta:{width:"full",interface:"input-code",options:{language:"json"}}}]}),G=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"}}]}),q={exports:{}},K={},X={exports:{}},Y={},Q={};function J(){if(U)return Q;function t(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function e(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function i(i,s){this.__indent_cache=new e(i,s),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return U=1,t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},t.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},t.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},t.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},e.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},e.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},e.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},e.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},i.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,i){for(var s=this.__lines.length-2;s>=0;){var n=this.__lines[s];if(n.is_empty())break;if(0!==n.item(0).indexOf(e)&&n.item(-1)!==i){this.__lines.splice(s+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},Q.Output=i,Q}var Z,tt={};function et(){if(Z)return tt;return Z=1,tt.Token=function(t,e,i,s){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},tt}var it,st={};function nt(){return it||(it=1,a="(?:"+(n="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(i="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",r="(?:"+n+"|["+(e="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+i+(s="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(t=st).identifier=new RegExp(a+r,"g"),t.identifierStart=new RegExp(a),t.identifierMatch=new RegExp("(?:"+n+"|["+e+i+s+"])+"),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")),st;var t,e,i,s,n,a,r}var at,rt,ot={},lt={};function ht(){if(at)return lt;function t(t,i){this.raw_options=e(t,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function e(t,e){var s,n={};for(s in t=i(t))s!==e&&(n[s]=t[s]);if(e&&t[e])for(s in t[e])n[s]=t[e][s];return n}function i(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}return at=1,t.prototype._get_array=function(t,e){var i=this.raw_options[t],s=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(s=i.concat()):"string"==typeof i&&(s=i.split(/[^a-zA-Z0-9_\/\-]+/)),s},t.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},t.prototype._get_characters=function(t,e){var i=this.raw_options[t],s=e||"";return"string"==typeof i&&(s=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),s},t.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var s=parseInt(i,10);return isNaN(s)&&(s=e),s},t.prototype._get_selection=function(t,e,i){var s=this._get_selection_list(t,e,i);if(1!==s.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return s[0]},t.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var s=this._get_array(t,i);if(!this._is_valid_selection(s,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return s},t.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},lt.Options=t,lt.normalizeOpts=i,lt.mergeOpts=e,lt}function ct(){if(rt)return ot;rt=1;var t=ht().Options,e=["before-newline","after-newline","preserve-newline"];function i(i){t.call(this,i,"js");var s=this.raw_options.brace_style||null;"expand-strict"===s?this.raw_options.brace_style="expand":"collapse-preserve-inline"===s?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<n.length;a++)"preserve-inline"===n[a]?this.brace_preserve_inline=!0:this.brace_style=n[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",e),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return i.prototype=new t,ot.Options=i,ot}var dt,ut={},pt={};function gt(){if(dt)return pt;dt=1;var t=RegExp.prototype.hasOwnProperty("sticky");function e(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}return e.prototype.restart=function(){this.__position=0},e.prototype.back=function(){this.__position>0&&(this.__position-=1)},e.prototype.hasNext=function(){return this.__position<this.__input_length},e.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},e.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},e.prototype.__match=function(e,i){e.lastIndex=i;var s=e.exec(this.__input);return!s||t&&e.sticky||s.index!==i&&(s=null),s},e.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},e.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},e.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},e.prototype.read=function(t,e,i){var s,n="";return t&&(s=this.match(t))&&(n+=s[0]),!e||!s&&t||(n+=this.readUntil(e,i)),n},e.prototype.readUntil=function(t,e){var i,s=this.__position;t.lastIndex=this.__position;var n=t.exec(this.__input);return n?(s=n.index,e&&(s+=n[0].length)):s=this.__input_length,i=this.__input.substring(this.__position,s),this.__position=s,i},e.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},e.prototype.get_regexp=function(e,i){var s=null,n="g";return i&&t&&(n="y"),"string"==typeof e&&""!==e?s=new RegExp(e,n):e&&(s=new RegExp(e.source,n)),s},e.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},e.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},e.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},pt.InputScanner=e,pt}var ft,_t={},mt={};var vt,bt,yt,wt={},xt={};function At(){if(vt)return xt;function t(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}return vt=1,t.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},t.prototype.read_match=function(){return this._input.match(this._match_pattern)},t.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},t.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},t.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},t.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){},xt.Pattern=t,xt}function kt(){if(yt)return _t;yt=1;var t=gt().InputScanner,e=et().Token,i=function(){if(ft)return mt;function t(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}return ft=1,t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position<this.__tokens_length},t.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},t.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},t.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},mt.TokenStream=t,mt}().TokenStream,s=function(){if(bt)return wt;bt=1;var t=At().Pattern;function e(e,i){t.call(this,e,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return e.prototype=new t,e.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},e.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},e.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},e.prototype._create=function(){return new e(this._input,this)},e.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,s=[],n=t.exec(e);n;)s.push(e.substring(i,n.index)),i=n.index+n[0].length,n=t.exec(e);return i<e.length?s.push(e.substring(i,e.length)):s.push(""),s},wt.WhitespacePattern=e,wt}().WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(e,i){this._input=new t(e),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};return a.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new i,this._reset();for(var s=new e(n.START,""),a=null,r=[],o=new i;s.type!==n.EOF;){for(t=this._get_next_token(s,a);this._is_comment(t);)o.add(t),t=this._get_next_token(s,a);o.isEmpty()||(t.comments_before=o,o=new i),t.parent=a,this._is_opening(t)?(r.push(a),a=t):a&&this._is_closing(t,a)&&(t.opened=a,a.closed=t,a=r.pop(),t.parent=a),t.previous=s,s.next=t,this.__tokens.add(t),s=t}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(n.RAW,i):this._create_token(n.EOF,"")},a.prototype._is_comment=function(t){return!1},a.prototype._is_opening=function(t){return!1},a.prototype._is_closing=function(t,e){return!1},a.prototype._create_token=function(t,i){return new e(t,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},_t.Tokenizer=a,_t.TOKEN=n,_t}var Tt,St={};function Et(){if(Tt)return St;function t(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}return Tt=1,t.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},t.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},St.Directives=t,St}var Ct,Rt,Mt,Pt,Lt={};function Dt(){if(Ct)return Lt;Ct=1;var t=At().Pattern,e={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function i(i,s){t.call(this,i,s),this.__template_pattern=null,this._disabled=Object.assign({},e),this._excluded=Object.assign({},e),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var n=new t(i);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}return i.prototype=new t,i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){this.__set_templated_pattern()},i.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},i.prototype.read_options=function(t){var i=this._create();for(var s in e)i._disabled[s]=-1===t.templating.indexOf(s);return i._update(),i},i.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},i.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},i.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},i.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Lt.TemplatablePattern=i,Lt}function It(){if(Rt)return ut;Rt=1;var t=gt().InputScanner,e=kt().Tokenizer,i=kt().TOKEN,s=Et().Directives,n=nt(),a=At().Pattern,r=Dt().TemplatablePattern;function o(t,e){return-1!==e.indexOf(t)}var l={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},h=new s(/\/\*/,/\*\//),c=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,d=/[0-9]/,u=/[^\d\.]/,p=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=(g="\\?\\.(?!\\d) "+(g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var f,_=new RegExp(g),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),b=new RegExp("^(?:"+v.join("|")+")$"),y=function(t,i){e.call(this,t,i),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var s=new a(this._input),o=new r(this._input).read_options(this._options);this.__patterns={template:o,identifier:o.starting_with(n.identifier).matching(n.identifierMatch),number:s.matching(c),punct:s.matching(_),comment:s.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:s.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:s.matching(/<!--/),html_comment_end:s.matching(/-->/),include:s.starting_with(/#include/).until_after(n.lineBreak),shebang:s.starting_with(/#!/).until_after(n.lineBreak),xml:s.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:o.until(/['\\\n\r\u2028\u2029]/),double_quote:o.until(/["\\\n\r\u2028\u2029]/),template_text:o.until(/[`\\$]/),template_expression:o.until(/[`}\\]/)}};return(y.prototype=new e)._is_comment=function(t){return t.type===l.COMMENT||t.type===l.BLOCK_COMMENT||t.type===l.UNKNOWN},y.prototype._is_opening=function(t){return t.type===l.START_BLOCK||t.type===l.START_EXPR},y.prototype._is_closing=function(t,e){return(t.type===l.END_BLOCK||t.type===l.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},y.prototype._reset=function(){f=!1},y.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var s=this._input.peek();return null===s?this._create_token(l.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(s))||this._read_string(s))||this._read_pair(s,this._input.peek(1)))||this._read_word(t))||this._read_singles(s))||this._read_comment(s))||this._read_regexp(s,t))||this._read_xml(s,t))||this._read_punctuation())||this._create_token(l.UNKNOWN,this._input.next())},y.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(n.allLineBreaks,"\n"),t.type!==l.DOT&&(t.type!==l.RESERVED||"set"!==t.text&&"get"!==t.text)&&b.test(e)?"in"!==e&&"of"!==e||t.type!==l.WORD&&t.type!==l.STRING?this._create_token(l.RESERVED,e):this._create_token(l.OPERATOR,e):this._create_token(l.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(l.WORD,e):void 0},y.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(l.START_EXPR,t):")"===t||"]"===t?e=this._create_token(l.END_EXPR,t):"{"===t?e=this._create_token(l.START_BLOCK,t):"}"===t?e=this._create_token(l.END_BLOCK,t):";"===t?e=this._create_token(l.SEMICOLON,t):"."===t&&u.test(this._input.peek(1))?e=this._create_token(l.DOT,t):","===t&&(e=this._create_token(l.COMMA,t)),e&&this._input.next(),e},y.prototype._read_pair=function(t,e){var i=null;return"#"===t&&"{"===e&&(i=this._create_token(l.START_BLOCK,t+e)),i&&(this._input.next(),this._input.next()),i},y.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(l.EQUALS,t):"?."===t?this._create_token(l.DOT,t):this._create_token(l.OPERATOR,t)},y.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(l.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(l.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(d)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(l.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(n.newline);)e+=this._input.next();return f=!0,this._create_token(l.COMMENT,e)}}else if(f&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return f=!1,this._create_token(l.COMMENT,e);return null},y.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var s=h.get_directives(i);s&&"start"===s.ignore&&(i+=h.readIgnored(this._input)),i=i.replace(n.allLineBreaks,"\n"),(e=this._create_token(l.BLOCK_COMMENT,i)).directives=s}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(l.COMMENT,i))}return e},y.prototype._read_string=function(e){if("`"===e||"'"===e||'"'===e){var i=this._input.next();return this.has_char_escapes=!1,i+="`"===e?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(i=function(e){var i="",s=0,n=new t(e),a=null;for(;n.hasNext();)if((a=n.match(/([\s]|[^\\]|\\\\)+/g))&&(i+=a[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())a=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){i+="\\",n.hasNext()&&(i+=n.next());continue}(a=n.match(/u([0-9A-Fa-f]{4})/g))||(a=n.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!a)return e;if((s=parseInt(a[1],16))>126&&s<=255&&0===a[0].indexOf("x"))return e;i+=s>=0&&s<32||s>1114111?"\\"+a[0]:34===s||39===s||92===s?"\\"+String.fromCharCode(s):String.fromCharCode(s)}return i}(i)),this._input.peek()===e&&(i+=this._input.next()),i=i.replace(n.allLineBreaks,"\n"),this._create_token(l.STRING,i)}return null},y.prototype._allow_regexp_or_xml=function(t){return t.type===l.RESERVED&&o(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===l.END_EXPR&&")"===t.text&&t.opened.previous.type===l.RESERVED&&o(t.opened.previous.text,["if","while","for"])||o(t.type,[l.COMMENT,l.START_EXPR,l.START_BLOCK,l.START,l.END_BLOCK,l.OPERATOR,l.EQUALS,l.EOF,l.SEMICOLON,l.COMMA])},y.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),s=!1,a=!1;this._input.hasNext()&&(s||a||this._input.peek()!==t)&&!this._input.testChar(n.newline);)i+=this._input.peek(),s?s=!1:(s="\\"===this._input.peek(),"["===this._input.peek()?a=!0:"]"===this._input.peek()&&(a=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(n.identifier)),this._create_token(l.STRING,i)}return null},y.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",s=this.__patterns.xml.read_match();if(s){for(var a=s[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),r=0===a.indexOf("{"),o=0;s;){var h=!!s[1],c=s[2];if(!(!!s[s.length-1]||"![CDATA["===c.slice(0,8))&&(c===a||r&&c.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(h?--o:++o),i+=s[0],o<=0)break;s=this.__patterns.xml.read_match()}return s||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(n.allLineBreaks,"\n"),this._create_token(l.STRING,i)}}return null},y.prototype._read_string_recursive=function(t,e,i){var s,a;"'"===t?a=this.__patterns.single_quote:'"'===t?a=this.__patterns.double_quote:"`"===t?a=this.__patterns.template_text:"}"===t&&(a=this.__patterns.template_expression);for(var r=a.read(),o="";this._input.hasNext();){if((o=this._input.next())===t||!e&&n.newline.test(o)){this._input.back();break}"\\"===o&&this._input.hasNext()?("x"===(s=this._input.peek())||"u"===s?this.has_char_escapes=!0:"\r"===s&&"\n"===this._input.peek(1)&&this._input.next(),o+=this._input.next()):i&&("${"===i&&"$"===o&&"{"===this._input.peek()&&(o+=this._input.next()),i===o&&(o+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(o+=this._input.next()))),r+=o+=a.read()}return r},ut.Tokenizer=y,ut.TOKEN=l,ut.positionable_operators=p.slice(),ut.line_starters=m.slice(),ut}function Ot(){if(Mt)return Y;Mt=1;var t=J().Output,e=et().Token,i=nt(),s=ct().Options,n=It().Tokenizer,a=It().line_starters,r=It().positionable_operators,o=It().TOKEN;function l(t,e){return-1!==e.indexOf(t)}function h(t){return t.replace(/^\s+/g,"")}function c(t,e){return t&&t.type===o.RESERVED&&t.text===e}function d(t,e){return t&&t.type===o.RESERVED&&l(t.text,e)}var u=["case","return","do","if","throw","else","await","break","continue","async"],p=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),g=[p.before_newline,p.preserve_newline],f="BlockStatement",_="Statement",m="ObjectLiteral",v="ArrayLiteral",b="ForInitializer",y="Conditional",w="Expression";function x(t,e){e.multiline_frame||e.mode===b||e.mode===y||t.remove_indent(e.start_line_index)}function A(t){return t===v}function k(t){return l(t,[w,b,y])}function T(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(e)}T.prototype.create_flags=function(t,i){var s=0;return t&&(s=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>s&&(s=t.line_indent_level)),{mode:i,parent:t,last_token:t?t.last_token:new e(o.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:s,alignment:0,line_indent_level:t?t.line_indent_level:s,start_line_index:this._output.get_line_number(),ternary_depth:0}},T.prototype._reset=function(e){var i=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new t(this._options,i),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f);var s=new n(e,this._options);return this._tokens=s.tokenize(),e},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&i.lineBreak.test(t||"")&&(e=t.match(i.lineBreak)[0]));for(var s=this._tokens.next();s;)this.handle_token(s),this._last_last_text=this._flags.last_token.text,this._flags.last_token=s,s=this._tokens.next();return this._output.get_code(e)},T.prototype.handle_token=function(t,e){t.type===o.START_EXPR?this.handle_start_expr(t):t.type===o.END_EXPR?this.handle_end_expr(t):t.type===o.START_BLOCK?this.handle_start_block(t):t.type===o.END_BLOCK?this.handle_end_block(t):t.type===o.WORD||t.type===o.RESERVED?this.handle_word(t):t.type===o.SEMICOLON?this.handle_semicolon(t):t.type===o.STRING?this.handle_string(t):t.type===o.EQUALS?this.handle_equals(t):t.type===o.OPERATOR?this.handle_operator(t):t.type===o.COMMA?this.handle_comma(t):t.type===o.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===o.COMMENT?this.handle_comment(t,e):t.type===o.DOT?this.handle_dot(t):t.type===o.EOF?this.handle_eof(t):(t.type,o.UNKNOWN,this.handle_unknown(t,e))},T.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,s=this._options.keep_array_indentation&&A(this._flags.mode);if(t.comments_before)for(var n=t.comments_before.next();n;)this.handle_whitespace_and_comments(n,e),this.handle_token(n,e),n=t.comments_before.next();if(s)for(var a=0;a<i;a+=1)this.print_newline(a>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var r=1;r<i;r+=1)this.print_newline(!0,e)}};var S=["async","break","continue","return","throw","yield"];return T.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(l(this._flags.last_token.text,r)||l(t.text,r)){var s=l(this._flags.last_token.text,r)&&l(this._options.operator_position,g)||l(t.text,r);i=i&&s}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(d(this._flags.last_token,S))return;this._output.set_wrap_point()}}},T.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==o.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==_||this._flags.if_block&&c(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},T.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},T.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===o.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},T.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===_&&x(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.start_of_object_property=function(){return this._flags.parent.mode===m&&this._flags.mode===_&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},T.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||d(this._flags.last_token,["var","let","const"])&&t.type===o.WORD)||c(this._flags.last_token,"do"))||!(this._flags.parent.mode===m&&this._flags.mode===_)&&d(this._flags.last_token,S)&&!t.newlines)||c(this._flags.last_token,"else")&&!(c(t,"if")&&!t.comments_before))||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===b||this._previous_flags.mode===y))||this._flags.last_token.type===o.WORD&&this._flags.mode===f&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==o.WORD&&t.type!==o.RESERVED)||this._flags.mode===m&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(_),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,d(t,["do","for","if","while"])),!0)},T.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=w;if("["===t.text){if(this._flags.last_token.type===o.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=v,A(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),l(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=b):l(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=y):l(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(l(this._flags.last_token.text,a)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var s=this._tokens.peek(-4);d(i,["async","function"])||"*"===i.text&&d(s,["async","function"])?this._output.space_before_token=!0:this._flags.mode===m?"{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==s.text&&","!==s.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===o.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(l(this._last_last_text,["function","yield"])||this._flags.mode===m&&l(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===o.START_BLOCK?this.print_newline():this._flags.last_token.type!==o.END_EXPR&&this._flags.last_token.type!==o.START_EXPR&&this._flags.last_token.type!==o.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==o.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},T.prototype.handle_end_expr=function(t){for(;this._flags.mode===_;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==o.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),x(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===y&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},T.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(f),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f):i&&(l(i.text,[":",","])&&l(e.type,[o.STRING,o.WORD,o.RESERVED])||l(e.text,["get","set","..."])&&l(i.type,[o.WORD,o.RESERVED]))?l(this._last_last_text,["class","interface"])&&!l(i.text,[":",","])?this.set_mode(f):this.set_mode(m):this._flags.last_token.type===o.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(f):l(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(m):this.set_mode(f),this._flags.last_token&&d(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var s=!e.comments_before&&"}"===e.text,n=s&&"function"===this._flags.last_word&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var a=0,r=null;this._flags.inline_frame=!0;do{if(a+=1,(r=this._tokens.peek(a-1)).newlines){this._flags.inline_frame=!1;break}}while(r.type!==o.EOF&&(r.type!==o.END_BLOCK||r.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(n||this._flags.last_token.type===o.EQUALS||d(this._flags.last_token,u)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!A(this._previous_flags.mode)||this._flags.last_token.type!==o.START_EXPR&&this._flags.last_token.type!==o.COMMA||((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(l(this._flags.last_token.type,[o.START_BLOCK,o.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),s||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},T.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===_;)this.restore_mode();var e=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(A(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},T.prototype.handle_word=function(t){if(t.type===o.RESERVED)if(l(t.text,["set","get"])&&this._flags.mode!==m)t.type=o.WORD;else if("import"===t.text&&l(this._tokens.peek().text,["(","."]))t.type=o.WORD;else if(l(t.text,["as","from"])&&!this._flags.import_block)t.type=o.WORD;else if(this._flags.mode===m){":"===this._tokens.peek().text&&(t.type=o.WORD)}if(this.start_of_statement(t)?d(this._flags.last_token,["var","let","const"])&&t.type===o.WORD&&(this._flags.declaration_statement=!0):!t.newlines||k(this._flags.mode)||this._flags.last_token.type===o.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===o.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(c(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&c(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===_;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(t,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==o.COMMA&&this._flags.last_token.type!==o.START_EXPR&&this._flags.last_token.type!==o.EQUALS&&this._flags.last_token.type!==o.OPERATOR||this.start_of_object_property()||l(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===m||this.allow_wrap_or_preserved_newline(t),c(t,"function"))return(l(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!l(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==o.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,S)||c(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===o.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!k(this._flags.mode)&&!A(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":d(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===f?e="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&k(this._flags.mode)?e="SPACE":this._flags.last_token.type===o.STRING?e="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||"*"===this._flags.last_token.text&&(l(this._last_last_text,["function","yield"])||this._flags.mode===m&&l(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===o.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),d(t,a)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(t,["else","catch","finally"]))?(this._flags.last_token.type!==o.END_BLOCK||this._previous_flags.mode!==f||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?d(this._flags.last_token,u)||"declare"===this._flags.last_token.text&&d(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?this._flags.last_token.type===o.START_EXPR&&d(t,["var","let","const"])||":"===this._flags.last_token.text||(c(t,"if")&&c(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(t,a)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==o.WORD&&t.previous.type!==o.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===o.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&c(t,"from")&&(this._flags.import_block=!1))},T.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==_||this._flags.if_block&&c(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},T.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==o.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==o.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},T.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},T.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(k(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===m||this._flags.mode===_&&this._flags.parent.mode===m?(this._flags.mode===_&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},T.prototype.handle_operator=function(t){var e="*"===t.text&&(d(this._flags.last_token,["function","yield"])||l(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),i=l(t.text,["-","+"])&&(l(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||l(this._flags.last_token.text,a)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var s=!e;this.handle_whitespace_and_comments(t,s)}if("*"!==t.text||this._flags.last_token.type!==o.DOT)if("::"!==t.text)if(l(t.text,["-","+"])&&this.start_of_object_property())this.print_token(t);else{if(this._flags.last_token.type===o.OPERATOR&&l(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==o.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var n=!0,h=!0,c=!1;if(":"===t.text?0===this._flags.ternary_depth?n=!1:(this._flags.ternary_depth-=1,c=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&l(t.text,r)){var m=":"===t.text,v=m&&c,b=m&&!c;switch(this._options.operator_position){case p.before_newline:return this._output.space_before_token=!b,this.print_token(t),m&&!v||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case p.after_newline:return this._output.space_before_token=!0,!m||v?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case p.preserve_newline:return b||this.allow_wrap_or_preserved_newline(t),n=!(this._output.just_added_newline()||b),this._output.space_before_token=n,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),n=!1;var y=this._tokens.peek();h=y&&l(y.type,[o.WORD,o.RESERVED])}else if("..."===t.text)this.allow_wrap_or_preserved_newline(t),n=this._flags.last_token.type===o.START_BLOCK,h=!1;else if(l(t.text,["--","++","!","~"])||i){if(this._flags.last_token.type!==o.COMMA&&this._flags.last_token.type!==o.START_EXPR||this.allow_wrap_or_preserved_newline(t),n=!1,h=!1,t.newlines&&("--"===t.text||"++"===t.text||"~"===t.text)){var w=d(this._flags.last_token,u)&&t.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&k(this._flags.mode)&&(n=!0),this._flags.last_token.type===o.RESERVED?n=!0:this._flags.last_token.type===o.END_EXPR?n=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===o.OPERATOR&&(n=l(t.text,["--","-","++","+"])&&l(this._flags.last_token.text,["--","-","++","+"]),l(t.text,["+","-"])&&l(this._flags.last_token.text,["--","++"])&&(h=!0)),(this._flags.mode!==f||this._flags.inline_frame)&&this._flags.mode!==_||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||n,this.print_token(t),this._output.space_before_token=h}else this.print_token(t);else this.print_token(t)},T.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):i.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},T.prototype.print_block_commment=function(t,e){var s,n=function(t){for(var e=[],s=(t=t.replace(i.allLineBreaks,"\n")).indexOf("\n");-1!==s;)e.push(t.substring(0,s)),s=(t=t.substring(s+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),a=!1,r=!1,o=t.whitespace_before,l=o.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(a=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),r=function(t,e){for(var i,s=0,n=t.length;s<n;s++)if((i=t[s])&&0!==i.indexOf(e))return!1;return!0}(n,o),a&&(this._flags.alignment=1),s=0;s<n.length;s++)a?(this.print_token_line_indentation(t),this._output.add_token(h(n[s]))):r&&n[s]?(this.print_token_line_indentation(t),this._output.add_token(n[s].substring(l))):(this._output.current_line.set_indent(-1),this._output.add_token(n[s])),this.print_newline(!1,e);this._flags.alignment=0}},T.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},T.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),d(this._flags.last_token,u)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},T.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},T.prototype.handle_eof=function(t){for(;this._flags.mode===_;)this.restore_mode();this.handle_whitespace_and_comments(t)},Y.Beautifier=T,Y}var Nt,Ft,Bt,jt={exports:{}},zt={},Vt={};function Ut(){if(Nt)return Vt;Nt=1;var t=ht().Options;function e(e){t.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<s.length;n++)"expand"!==s[n]?this.brace_style="collapse":this.brace_style=s[n]}return e.prototype=new t,Vt.Options=e,Vt}function Ht(){if(Bt)return jt.exports;Bt=1;var t=function(){if(Ft)return zt;Ft=1;var t=Ut().Options,e=J().Output,i=gt().InputScanner,s=new(0,Et().Directives)(/\/\*/,/\*\//),n=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=/\s/,o=/(?:\s|\n)+/g,l=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,h=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function c(e,i){this._source_text=e||"",this._options=new t(i),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return c.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},c.prototype.eatWhitespace=function(t){for(var e=r.test(this._input.peek()),i=0;r.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},c.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},c.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},c.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},c.prototype.indent=function(){this._indentLevel++},c.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},c.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,c=this._options.eol;"auto"===c&&(c="\n",t&&n.test(t||"")&&(c=t.match(n)[0]));var d=(t=t.replace(a,"\n")).match(/^[\t ]*/)[0];this._output=new e(this._options,d),this._input=new i(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var u,p,g=0,f=!1,_=!1,m=!1,v=!1,b=!1,y=this._ch,w=!1;u=""!==this._input.read(o),p=y,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(l),A=s.get_directives(x);A&&"start"===A.ignore&&(x+=s.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(h)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(u),this.print_string(this._ch);var k=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);k.match(/[ :]$/)&&(k=this.eatString(": ").replace(/\s+$/,""),this.print_string(k),this._output.space_before_token=!0),0===g&&-1!==k.indexOf(":")&&(_=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(u),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var T=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);T.match(/[ :]$/)&&(T=this.eatString(": ").replace(/\s+$/,""),this.print_string(T),this._output.space_before_token=!0),0===g&&-1!==T.indexOf(":")?(_=!0,this.indent()):T in this.NESTED_AT_RULE?(this._nestedLevel+=1,T in this.CONDITIONAL_GROUP_RULE&&(m=!0)):0!==g||_||(v=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(u),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)_&&(_=!1,this.outdent()),v=!1,m?(m=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===p?this._output.space_before_token=!1:","!==p&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===p&&this._output.trim(!0),_&&(this.outdent(),_=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var S=0;S<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;S++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[S])){w=!0;break}!f&&!m||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==g?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),_||(_=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var E='"'===p||"'"===p;this.preserveSingleSpace(E||u),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===g?(_&&(this.outdent(),_=!1),v=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),g++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),g&&(g--,this.outdent()));else{var C=!1;this._input.lookBack("with")&&(C=!0),this.preserveSingleSpace(u||C),this.print_string(this._ch),_&&"$"===p&&this._options.selector_separator_newline?(this._output.add_new_line(),b=!0):(this.eatWhitespace(),g++,this.indent())}else if(")"===this._ch)g&&(g--,this.outdent()),b&&";"===this._input.peek()&&this._options.selector_separator_newline&&(b=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||_&&!b||0!==g||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||_||0!==g)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(u),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),r.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var R='"'===p||"'"===p;this.preserveSingleSpace(R||u),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&r.test(this._ch)&&(this._ch=""));return this._output.get_code(c)},zt.Beautifier=c,zt}().Beautifier,e=Ut().Options;return jt.exports=function(e,i){return new t(e,i).beautify()},jt.exports.defaultOptions=function(){return new e},jt.exports}var $t,Wt={exports:{}},Gt={},qt={};function Kt(){if($t)return qt;$t=1;var t=ht().Options;function e(e){t.call(this,e,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return e.prototype=new t,qt.Options=e,qt}var Xt,Yt,Qt,Jt,Zt={};function te(){if(Xt)return Zt;Xt=1;var t=kt().Tokenizer,e=kt().TOKEN,i=Et().Directives,s=Dt().TemplatablePattern,n=At().Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:e.START,RAW:e.RAW,EOF:e.EOF},r=new i(/<\!--/,/-->/),o=function(e,i){t.call(this,e,i),this._current_tag_name="";var a=new s(this._input).read_options(this._options),r=new n(this._input);if(this.__patterns={word:a.until(/[\n\r\t <]/),word_control_flow_close_excluded:a.until(/[\n\r\t <}]/),single_quote:a.until_after(/'/),double_quote:a.until_after(/"/),attribute:a.until(/[\n\r\t =>]|\/>/),element_name:a.until(/[\n\r\t >\/]/),angular_control_flow_start:r.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(/<!--/).until_after(/-->/),cdata:r.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:r.starting_with(/<!\[/).until_after(/]>/),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(o).until_after(o)}};return(o.prototype=new t)._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return t.type===a.TAG_OPEN||t.type===a.CONTROL_FLOW_OPEN},o.prototype._is_closing=function(t,e){return t.type===a.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])||t.type===a.CONTROL_FLOW_CLOSE&&"}"===t.text&&e.text.endsWith("{")},o.prototype._reset=function(){this._current_tag_name=""},o.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var s=this._input.peek();return null===s?this._create_token(a.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(s,e))||this._read_attribute(s,t,e))||this._read_close(s,e))||this._read_script_and_style(s,t))||this._read_control_flows(s,e))||this._read_raw_content(s,t,e))||this._read_content_word(s,e))||this._read_comment_or_cdata(s))||this._read_processing(s))||this._read_open(s,e))||this._create_token(a.UNKNOWN,this._input.next())},o.prototype._read_comment_or_cdata=function(t){var e=null,i=null,s=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(s=r.get_directives(i))&&"start"===s.ignore&&(i+=r.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(a.COMMENT,i)).directives=s));return e},o.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var s=this._input.peek(1);"!"!==s&&"?"!==s||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(a.COMMENT,i)).directives=null)}return e},o.prototype._read_open=function(t,e){var i=null,s=null;return e&&e.type!==a.CONTROL_FLOW_OPEN||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),s=this._create_token(a.TAG_OPEN,i)),s},o.prototype._read_open_handlebars=function(t,e){var i=null,s=null;return e&&e.type!==a.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===t&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),s=this._create_token(a.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),s=this._create_token(a.TAG_OPEN,i))),s},o.prototype._read_control_flows=function(t,e){var i="",s=null;if(!this._options.templating.includes("angular"))return s;if("@"===t){if(""===(i=this.__patterns.angular_control_flow_start.read()))return s;for(var n=i.endsWith("(")?1:0,r=0;!i.endsWith("{")||n!==r;){var o=this._input.next();if(null===o)break;"("===o?n++:")"===o&&r++,i+=o}s=this._create_token(a.CONTROL_FLOW_OPEN,i)}else"}"===t&&e&&e.type===a.CONTROL_FLOW_OPEN&&(i=this._input.next(),s=this._create_token(a.CONTROL_FLOW_CLOSE,i));return s},o.prototype._read_close=function(t,e){var i=null,s=null;return e&&e.type===a.TAG_OPEN&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),s=this._create_token(a.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),s=this._create_token(a.TAG_CLOSE,"}}"))),s},o.prototype._read_attribute=function(t,e,i){var s=null,n="";if(i&&"<"===i.text[0])if("="===t)s=this._create_token(a.EQUALS,this._input.next());else if('"'===t||"'"===t){var r=this._input.next();r+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),s=this._create_token(a.VALUE,r)}else(n=this.__patterns.attribute.read())&&(s=e.type===a.EQUALS?this._create_token(a.VALUE,n):this._create_token(a.ATTRIBUTE,n));return s},o.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},o.prototype._read_raw_content=function(t,e,i){var s="";if(i&&"{"===i.text[0])s=this.__patterns.handlebars_raw_close.read();else if(e.type===a.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var n=e.opened.text.substr(1).toLowerCase();this._is_content_unformatted(n)&&(s=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig")))}return s?this._create_token(a.TEXT,s):null},o.prototype._read_script_and_style=function(t,e){if(e.type===a.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var i=e.opened.text.substr(1).toLowerCase();if("script"===i||"style"===i){var s=this._read_comment_or_cdata(t);if(s)return s.type=a.TEXT,s;var n=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig"));if(n)return this._create_token(a.TEXT,n)}}return null},o.prototype._read_content_word=function(t,e){var i="";return this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(i=this.__patterns.unformatted_content_delimiter.read()),i||(i=e&&e.type===a.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),i?this._create_token(a.TEXT,i):null},Zt.Tokenizer=o,Zt.TOKEN=a,Zt}function ee(){if(Yt)return Gt;Yt=1;var t=Kt().Options,e=J().Output,i=te().Tokenizer,s=te().TOKEN,n=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=function(t,i){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new e(t,i)};r.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},r.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},r.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},r.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},r.prototype.print_preserved_newlines=function(t){var e=0;t.type!==s.TEXT&&t.previous.type!==s.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},r.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},r.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},r.prototype.print_newline=function(t){this._output.add_new_line(t)},r.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},r.prototype.indent=function(){this.indent_level++},r.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},r.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var o=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==s.EOF&&t.closed!==i;){if(i.type===s.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===s.EQUALS&&i.next.next&&i.next.next.type===s.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function l(t,e){return-1!==e.indexOf(t)}function h(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function c(t){this._printer=t,this._current_frame=null}function d(e,i,s,n){this._source_text=e||"",i=i||{},this._js_beautify=s,this._css_beautify=n,this._tag_stack=null;var a=new t(i,"html");this._options=a,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}c.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},c.prototype.record_tag=function(t){var e=new h(this._current_frame,t,this._printer.indent_level);this._current_frame=e},c.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},c.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},c.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},c.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&n.test(t)&&(e=t.match(n)[0]));var o=(t=t.replace(a,"\n")).match(/^[\t ]*/)[0],l={text:"",type:""},h=new u(this._options),d=new r(this._options,o),p=new i(t,this._options).tokenize();this._tag_stack=new c(d);for(var g=null,f=p.next();f.type!==s.EOF;)f.type===s.TAG_OPEN||f.type===s.COMMENT?h=g=this._handle_tag_open(d,f,h,l,p):f.type===s.ATTRIBUTE||f.type===s.EQUALS||f.type===s.VALUE||f.type===s.TEXT&&!h.tag_complete?g=this._handle_inside_tag(d,f,h,l):f.type===s.TAG_CLOSE?g=this._handle_tag_close(d,f,h):f.type===s.TEXT?g=this._handle_text(d,f,h):f.type===s.CONTROL_FLOW_OPEN?g=this._handle_control_flow_open(d,f):f.type===s.CONTROL_FLOW_CLOSE?g=this._handle_control_flow_close(d,f):d.add_raw_token(f),l=g,f=p.next();return d._output.get_code(e)},d.prototype._handle_control_flow_open=function(t,e){var i={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),t.indent(),i},d.prototype._handle_control_flow_close=function(t,e){var i={text:e.text,type:e.type};return t.deindent(),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),i},d.prototype._handle_tag_close=function(t,e,i){var s={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),s},d.prototype._handle_inside_tag=function(t,e,i,n){var a=i.has_wrapped_attrs,r={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):"{"===i.tag_start_char&&e.type===s.TEXT?t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e):(e.type===s.ATTRIBUTE?t.set_space_before_token(!0):(e.type===s.EQUALS||e.type===s.VALUE&&e.previous.type===s.EQUALS)&&t.set_space_before_token(!1),e.type===s.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),a=a||0!==e.newlines),this._is_wrap_attributes_force&&i.attr_count>=this._options.wrap_attributes_min_attrs&&(n.type!==s.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(t.print_newline(!1),a=!0)),t.print_token(e),a=a||t.previous_token_wrapped(),i.has_wrapped_attrs=a),r},d.prototype._handle_text=function(t,e,i){var s={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),s},d.prototype._print_custom_beatifier_text=function(t,e,i){var s=this;if(""!==e.text){var n,a=e.text,r=1,o="",l="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?n=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?n=this._css_beautify:"html"===i.custom_beautifier_name&&(n=function(t,e){return new d(t,e,s._js_beautify,s._css_beautify).beautify()}),"keep"===this._options.indent_scripts?r=0:"separate"===this._options.indent_scripts&&(r=-t.indent_level);var h=t.get_full_indent(r);if(a=a.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===a[0]&&a.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(a);if(!c)return void t.add_raw_token(e);o=h+c[1]+"\n",a=c[4],c[5]&&(l=h+c[5]),a=a.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(e.whitespace_before=c[0])}if(a)if(n){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,a=n(h+a,new u)}else{var p=e.whitespace_before;p&&(a=a.replace(new RegExp("\n("+p+")?","g"),"\n")),a=h+a.replace(/\n/g,"\n"+h)}o&&(a=a?o+a+"\n"+l:o+l),t.print_newline(!1),a&&(e.text=a,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},d.prototype._handle_tag_open=function(t,e,i,n,a){var r=this._get_tag_open_token(e);if(!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==s.TAG_OPEN||r.is_start_tag?(t.traverse_whitespace(e),this._set_tag_position(t,e,r,i,n),r.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),r.start_tag_token=this._tag_stack.try_pop(r.tag_name)),r.is_start_tag&&this._is_wrap_attributes_force){var o,l=0;do{(o=a.peek(l)).type===s.ATTRIBUTE&&(r.attr_count+=1),l+=1}while(o.type!==s.EOF&&o.type!==s.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(r.alignment_size=e.text.length+1),r.tag_complete||r.is_unformatted||(t.alignment_size=r.alignment_size),r};var u=function(t,e,i){if(this.parent=e||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",i){var n;this.tag_start_char=i.text[0],this.text=i.text,"<"===this.tag_start_char?(n=i.text.match(/^<([^\s>]*)/),this.tag_check=n?n[1]:""):(n=i.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",(i.text.startsWith("{{#>")||i.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==i.next?this.tag_check=i.next.text.split(" ")[0]:this.tag_check=i.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),i.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||i.closed&&"/>"===i.closed.text;var a=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(a=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!t.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(a)))}else this.tag_complete=!0};d.prototype._get_tag_open_token=function(t){var e=new u(this._options,this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||l(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&l(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&l(e.tag_check,this._options.content_unformatted),e.is_inline_element=l(e.tag_name,this._options.inline)||this._options.inline_custom_elements&&e.tag_name.includes("-")||"{"===e.tag_start_char,e},d.prototype._set_tag_position=function(t,e,i,n,a){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=o(i.tag_check,e)))),l(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&a.type===s.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var r=!1;r=(r=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(a.type===s.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==a.type,(i.is_content_unformatted||i.is_unformatted)&&(r=!1),r&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===a.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},d.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var p=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],g=["a","audio","del","ins","map","noscript","video"];return d.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==p.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==g.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},Gt.Beautifier=d,Gt}function ie(){if(Jt)return K;Jt=1;var t=function(){if(Pt)return X.exports;Pt=1;var t=Ot().Beautifier,e=ct().Options;return X.exports=function(e,i){return new t(e,i).beautify()},X.exports.defaultOptions=function(){return new e},X.exports}(),e=Ht(),i=function(){if(Qt)return Wt.exports;Qt=1;var t=ee().Beautifier,e=Kt().Options;return Wt.exports=function(e,i,s,n){return new t(e,i,s,n).beautify()},Wt.exports.defaultOptions=function(){return new e},Wt.exports}();function s(s,n,a,r){return i(s,n,a=a||t,r=r||e)}return s.defaultOptions=i.defaultOptions,K.js=t,K.css=e,K.html=s,K}!function(t){var e,i,s,n,a=ie();a.js_beautify=a.js,a.css_beautify=a.css,a.html_beautify=a.html,t.exports=(e=a,i=a,s=a,n=function(t,i){return e.js_beautify(t,i)},n.js=e.js_beautify,n.css=i.css_beautify,n.html=s.html_beautify,n.js_beautify=e.js_beautify,n.css_beautify=i.css_beautify,n.html_beautify=s.html_beautify,n)}(q);class se{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 ne{liquidMethodMissing(t){}}const ae=Object.prototype.toString,re=String.prototype.toLowerCase,oe=Object.hasOwnProperty;function le(t){return"string"==typeof t}function he(t){return"function"==typeof t}function ce(t){return t&&he(t.then)}function de(t){return t&&he(t.next)&&he(t.throw)&&he(t.return)}function ue(t){return le(t=fe(t))?t:be(t)?"":ye(t)?t.map((t=>ue(t))).join(""):String(t)}function pe(t){return ye(t=fe(t))?t:le(t)&&t.length>0?[t]:ke(e=t)&&Symbol.iterator in e?Array.from(t):ke(t)?Object.keys(t).map((e=>[e,t[e]])):[];var e}function ge(t){return be(t=fe(t))?[]:ye(t)?t:[t]}function fe(t){return t instanceof ne&&he(t.valueOf)?t.valueOf():t}function _e(t){return t=Number(t),isNaN(t)?0:t}function me(t){return"number"==typeof t}function ve(t){return t&&he(t.toLiquid)?ve(t.toLiquid()):t}function be(t){return null==t}function ye(t){return"[object Array]"===ae.call(t)}function we(t){return t&&me(t.length)}function xe(t,e){t=t||{};for(const i in t)if(oe.call(t,i)&&!1===e(t[i],i,t))break;return t}function Ae(t){return t[t.length-1]}function ke(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}function Te(t,e,i=1){const s=[];for(let n=t;n<e;n+=i)s.push(n);return s}function Se(t,e,i=" "){return Ee(t,e,i,((t,e)=>e+t))}function Ee(t,e,i,s){let n=e-(t=String(t)).length;for(;n-- >0;)t=s(t,i);return t}function Ce(t){return t}function Re(t,e){return null==t&&null==e?0:null==t?1:null==e||(t=re.call(t))<(e=re.call(e))?-1:t>e?1:0}function Me(t){return function(...e){return t.call(this,...e.map(fe))}}function Pe(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*Le(t){const e=new Set;for(const i of t){const t=JSON.stringify(i);e.has(t)||(e.add(t),yield i)}}const De="__liquidClass__";class Ie 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,De,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:Ue(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[De])}}class Oe extends Ie{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class Ne extends Ie{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class Fe extends Ie{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return"RenderError"===t.name}}class Be extends Ie{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 je extends Ie{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class ze extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class Ve extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function Ue(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 Te(n,a+1).map((t=>{let n=`${t===e?">> ":" "}${Se(String(t),String(a).length)}| `;const r=t===e?"\n"+Se("^",i+n.length):"";return n+=s[t-1],n+=r,n})).join("\n")}const He=[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 $e(t){const e=t.charCodeAt(0);return e>=128?!He[e]:!!(1&He[e])}function We(t,e){if(!t){const i="function"==typeof e?e():e||`expect ${t} to be true`;throw new Ve(i)}}function Ge(t,e=`unexpected ${JSON.stringify(t)}`){We(!t,e)}He[160]=He[5760]=He[6158]=He[8192]=He[8193]=He[8194]=He[8195]=He[8196]=He[8197]=He[8198]=He[8199]=He[8200]=He[8201]=He[8202]=He[8232]=He[8233]=He[8239]=He[8287]=He[12288]=4,He[8220]=He[8221]=128;class qe extends ne{equals(t){return!(t instanceof qe)&&(le(t=fe(t))||ye(t)?0===t.length:!!ke(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 qe}}class Ke extends qe{equals(t){return!1===t||(!!be(fe(t))||(le(t)?/^\s*$/.test(t):super.equals(t)))}static is(t){return t instanceof Ke}}class Xe extends ne{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 Ye{constructor(){this.buffer=""}write(t){this.buffer+=ue(t)}}class Qe{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class Je{constructor(){this.buffer=""}write(t){"string"!=typeof(t=fe(t))&&""===this.buffer?this.buffer=t:this.buffer=ue(this.buffer)+ue(t)}}class Ze extends ne{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new Ye;return yield this.superBlockRender(t),t.buffer}}function ti(t){return t&&he(t.equals)&&he(t.gt)&&he(t.geq)&&he(t.lt)&&he(t.leq)}const ei=new class extends ne{equals(t){return be(fe(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},ii={true:!0,false:!1,nil:ei,null:ei,empty:new qe,blank:new Ke};function si(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&&$e(i[e])&&(t[s].needBoundary=!0),t=t[s]}t.data=s,t.end=!0}return e}var ni=function(){return ni=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},ni.apply(this,arguments)};function ai(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 ri(t){return ai(this,void 0,void 0,(function*(){if(!de(t))return t;let e,i=!1,s="next";do{const n=t[s](e);i=n.done,e=n.value,s="next";try{de(e)&&(e=ri(e)),ce(e)&&(e=yield e)}catch(t){s="throw",e=t}}while(!i);return e}))}function oi(t){if(!de(t))return t;let e,i=!1,s="next";do{const n=t[s](e);if(i=n.done,e=n.value,s="next",de(e))try{e=oi(e)}catch(t){s="throw",e=t}}while(!i);return e}const li=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function hi(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 ci(t){let e=0;for(let i=0;i<t.getMonth();++i)e+=hi(t)[i];return e+t.getDate()}function di(t,e){const i=ci(t)+(e-t.getDay()),s=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((i-s)/7)+1)}const ui={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},pi=new Set("aAbBceklpP");function gi(t,e){const i=Math.abs(t.getTimezoneOffset()),s=Math.floor(i/60),n=i%60;return(t.getTimezoneOffset()>0?"-":"+")+Se(s,2,"0")+(e.flags[":"]?":":"")+Se(n,2,"0")}const fi={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=>ci(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 Ee(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=>di(t,0),w:t=>t.getDay(),W:t=>di(t,1),x:t=>t.toLocaleDateString(),X:t=>t.toLocaleTimeString(),y:t=>t.getFullYear().toString().slice(2,4),Y:t=>t.getFullYear(),z:gi,Z:(t,e)=>t.getTimeZoneName()||gi(t,e),t:()=>"\t",n:()=>"\n","%":()=>"%"};function _i(t,e){let i,s="",n=e;for(;i=li.exec(n);)s+=n.slice(0,i.index),n=n.slice(i.index+i[0].length),s+=mi(t,i);return s+n}function mi(t,e){const[i,s="",n,a,r]=e,o=fi[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=pi.has(r)?" ":"0",d=n||ui[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),Se(h,d,c)}function vi(){return"undefined"!=typeof Intl?Intl.DateTimeFormat:void 0}fi.h=fi.b;const bi=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,yi=["January","February","March","April","May","June","July","August","September","October","November","December"],wi=yi.map((t=>t.slice(0,3))),xi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ai=xi.map((t=>t.slice(0,3)));class ki{constructor(t,e,i){this.locale=e,this.DateTimeFormat=vi(),this.date=new Date(t),this.timezoneFixed=void 0!==i,void 0===i&&(i=this.date.getTimezoneOffset()),this.timezoneOffset=le(i)?ki.getTimezoneOffset(i,this.date):i,this.timezoneName=le(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:yi[this.getMonth()]}getShortMonthName(){var t;return null!==(t=this.format({month:"short"}))&&void 0!==t?t:wi[this.getMonth()]}getLongWeekdayName(){var t;return null!==(t=this.format({weekday:"long"}))&&void 0!==t?t:xi[this.displayDate.getDay()]}getShortWeekdayName(){var t;return null!==(t=this.format({weekday:"short"}))&&void 0!==t?t:Ai[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(bi);if(i&&"Z"===i[1])return new ki(+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 ki(+new Date(t),e,r)}return new ki(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 Ti{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){t=_e(t),We(this.base+t<=this.limit,this.message),this.base+=t}check(t){We((t=_e(t))<=this.limit,this.message)}}class Si extends se{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&He[s.charCodeAt(d)];)d++;for(;u>d&&4&He[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 Ei extends Si{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(Hs.Tag,[h,c],t,e,i,a,r,n),this.tokenizer=new ys(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 Ci extends Si{constructor(t,e,i,s,n){const{trimOutputLeft:a,trimOutputRight:r,outputDelimiterLeft:o,outputDelimiterRight:l}=s,h=[e+o.length,i-l.length];super(Hs.Output,h,t,e,i,a,r,n)}}class Ri extends se{constructor(t,e,i,s){super(Hs.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 Mi extends se{constructor(t,e,i,s){super(Hs.Number,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=Number(this.getText())}}class Pi extends se{constructor(t,e,i,s){super(Hs.Word,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.content=this.getText()}}class Li extends se{constructor(t,e,i,s){super(Hs.Literal,t,e,i,s),this.input=t,this.begin=e,this.end=i,this.file=s,this.literal=this.getText(),this.content=ii[this.literal]}}const Di={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Ii={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class Oi extends se{constructor(t,e,i,s){super(Hs.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 Di?Di[t]:1}}class Ni extends se{constructor(t,e,i,s,n,a){super(Hs.PropertyAccess,i,s,n,a),this.variable=t,this.props=e}}class Fi extends se{constructor(t,e,i,s,n,a){super(Hs.Filter,i,s,n,a),this.name=t,this.args=e}}class Bi extends se{constructor(t,e,i,s,n,a){super(Hs.Hash,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.name=s,this.value=n,this.file=a}}const ji=/[\da-fA-F]/,zi=/[0-7]/,Vi={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function Ui(t){const e=t.charCodeAt(0);return e>=97?e-87:e>=65?e-55:e-48}class Hi extends se{constructor(t,e,i,s){super(Hs.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!==Vi[t[i+1]])e+=Vi[t[++i]];else if("u"===t[i+1]){let s=0,n=i+2;for(;n<=i+5&&ji.test(t[n]);)s=16*s+Ui(t[n++]);i=n-1,e+=String.fromCharCode(s)}else if(zi.test(t[i+1])){let s=i+1,n=0;for(;s<=i+3&&zi.test(t[s]);)n=8*n+Ui(t[s++]);i=s-1,e+=String.fromCharCode(n)}else e+=t[++i];else e+=t[i];return e}(this.getText())}}class $i extends se{constructor(t,e,i,s,n,a){super(Hs.Range,t,e,i,a),this.input=t,this.begin=e,this.end=i,this.lhs=s,this.rhs=n,this.file=a}}class Wi extends Si{constructor(t,e,i,s,n){super(Hs.Tag,[e,i],t,e,i,!1,!1,n),this.tokenizer=new ys(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 Gi extends se{constructor(t,e,i,s,n,a){super(Hs.FilteredValue,i,s,n,a),this.initial=t,this.filters=e,this.input=i,this.begin=s,this.end=n,this.file=a}}const qi={now:()=>Date.now()};function Ki(){return"object"==typeof global&&global.performance||"object"==typeof window&&window.performance||qi}class Xi{renderTemplatesToNodeStream(t,e){const i=new Qe;return Promise.resolve().then((()=>ri(this.renderTemplates(t,e,i)))).then((()=>i.end()),(t=>i.error(t))),i.stream}*renderTemplates(t,e,i){i||(i=e.opts.keepOutputType?new Je:new Ye);const s=[];for(const n of t){e.renderLimit.check(Ki().now());try{const t=yield n.render(e,i);if(t&&i.write(t),e.breakCalled||e.continueCalled)break}catch(t){const i=Ie.is(t)?t:new Fe(t,n);if(!e.opts.catchAllErrors)throw i;s.push(i)}}if(s.length)throw new Be(s);return i.buffer}}class Yi{constructor(t){this.postfix=[...Ji(t)]}*evaluate(t,e){We(t,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix)if(qs(s)){const e=i.pop();let n;if(1===Ii[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 Qi(s,t,e));return i[0]}valid(){return!!this.postfix.length}}function*Qi(t,e,i=!1){if(t)return"content"in t?t.content:Js(t)?yield function*(t,e,i){const s=[];for(const i of t.props)s.push(yield Qi(i,e,!1));try{if(t.variable){const n=yield Qi(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 je(e,t)}}(t,e,i):tn(t)?yield function*(t,e){const i=yield Qi(t.lhs,e),s=yield Qi(t.rhs,e);return e.memoryLimit.use(s-i+1),Te(+i,+s+1)}(t,e):void 0}function*Ji(t){const e=[];for(const i of t)if(qs(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 Zi(t,e){return!ts(t,e)}function ts(t,e){return t=fe(t),e.opts.jsTruthy?!t:!1===t||null==t}const es={"==":is,"!=":(t,e)=>!is(t,e),">":(t,e)=>ti(t)?t.gt(e):ti(e)?e.lt(t):fe(t)>fe(e),"<":(t,e)=>ti(t)?t.lt(e):ti(e)?e.gt(t):fe(t)<fe(e),">=":(t,e)=>ti(t)?t.geq(e):ti(e)?e.leq(t):fe(t)>=fe(e),"<=":(t,e)=>ti(t)?t.leq(e):ti(e)?e.geq(t):fe(t)<=fe(e),contains:(t,e)=>ye(t=fe(t))?t.some((t=>is(t,e))):!!he(null==t?void 0:t.indexOf)&&t.indexOf(fe(e))>-1,not:(t,e)=>ts(fe(t),e),and:(t,e,i)=>Zi(fe(t),i)&&Zi(fe(e),i),or:(t,e,i)=>Zi(fe(t),i)||Zi(fe(e),i)};function is(t,e){return ti(t)?t.equals(e):ti(e)?e.equals(t):(t=fe(t),e=fe(e),ye(t)?ye(e)&&function(t,e){return t.length===e.length&&!t.some(((t,i)=>!is(t,e[i])))}(t,e):t===e)}let ss=class{constructor(t,e,i,s){this.key=t,this.value=e,this.next=i,this.prev=s}};class ns{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new ss("HEAD",null,null,null),this.tail=new ss("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 ss(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 as(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 rs=Object.freeze({__proto__:null,resolve:function(t,e,i){return t.length&&"/"!==Ae(t)&&(t+="/"),as(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,((t,e,s)=>{const n=s.split("/").pop();return/\.\w+$/.test(n)?t:e+s+i}))},readFile:function(t){return ai(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 ai(this,void 0,void 0,(function*(){return!0}))},existsSync:function(t){return!0},dirname:function(t){return as(t,".")},sep:"/"});function os(t,e=0){return JSON.stringify(t,null,e)}var ls={default:function(t,e,...i){return ye(t=fe(t))||le(t)?t.length?t:e:(!1!==t||!new Map(i).get("allow_false"))&&(ts(t,this.context)?e:t)},raw:{raw:!0,handler:Ce},jsonify:os,to_integer:function(t){return Number(t)},json:os,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 hs={"&":"&","<":"<",">":">",'"':""","'":"'"},cs={"&":"&","<":"<",">":">",""":'"',"'":"'"};function ds(t){return t=ue(t),this.context.memoryLimit.use(t.length),t.replace(/&|<|>|"|'/g,(t=>hs[t]))}function us(t){return t=ue(t),this.context.memoryLimit.use(t.length),t.replace(/&(amp|lt|gt|#34|#39);/g,(t=>cs[t]))}var ps=Object.freeze({__proto__:null,escape:ds,xml_escape:function(t){return ds.call(this,t)},escape_once:function(t){return ds.call(this,us.call(this,t))},newline_to_br:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"<br />\n")},strip_html:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}});class gs{constructor(t){this.mapping=t,this.sep="/"}exists(t){return ai(this,void 0,void 0,(function*(){return this.existsSync(t)}))}existsSync(t){return!be(this.mapping[t])}readFile(t){return ai(this,void 0,void 0,(function*(){return this.readFileSync(t)}))}readFileSync(t){const e=this.mapping[t];if(be(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 fs={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:rs,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:es,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function _s(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 ns(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new ns(1024):void 0,t.cache=e}return(t=Object.assign(Object.assign(Object.assign({},fs),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=ms(t.root),t.partials=ms(t.partials),t.layouts=ms(t.layouts),t.outputEscape=t.outputEscape&&("escape"===(s=t.outputEscape)?ds:"json"===s?ls.json:(We(he(s),"`outputEscape` need to be of type string or function"),s)),t.locale||(t.locale=null!==(i=null===(e=vi())||void 0===e?void 0:e().resolvedOptions().locale)&&void 0!==i?i:"en-US"),t.templates&&(t.fs=new gs(t.templates),t.relativeReference=!0,t.root=t.partials=t.layouts="."),t}function ms(t){let e=[];return ye(t)&&(e=t),le(t)&&(e=[t]),e}function vs(t,e){if(!t||!Ks(t))return;const i=e?4:16;for(;He[t.input.charCodeAt(t.end-1-t.trimRight)]&i;)t.trimRight++}function bs(t,e){if(!t||!Ks(t))return;const i=e?4:16;for(;He[t.input.charCodeAt(t.begin+t.trimLeft)]&i;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}class ys{constructor(t,e=fs.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=si(e),this.literalTrie=si(ii)}readExpression(){return new Yi(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 Oi(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&&$e(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 Gi(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 Fi(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=fs){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];sn(n)&Hs.Delimited&&(!i&&n.trimLeft&&vs(t[s-1],e.greedy),Xs(n)&&("raw"===n.name?i=!0:"endraw"===n.name&&(i=!1)),!i&&n.trimRight&&bs(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 Ri(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 Ei(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=fs){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 Ci(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 Ei(this.input,s,e,t,this.file)):(this.p=n,new Ri(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=fs){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 Wi(this.input,e,i,t,this.file)}error(t,e=this.p){return new Oe(t,new Pi(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()&&$e(this.peek());)++this.p;return new Pi(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=le(t)?t:t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new Bi(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 Ni(e,i,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new Ni(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 Pi(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&&!$e(this.peek(i))){const t=new Mi(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 Li(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 $i(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 Hi(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:He[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 ws{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(Xs(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 xs{constructor(t){this.token=t}}class As extends xs{constructor(t,e,i){super(t),this.name=t.name,this.liquid=i,this.tokenizer=t.tokenizer}}class ks{constructor(t,e){this.hash={};const i=t instanceof ys?t:new ys(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 Qi(this.hash[i],t));return e}}function Ts(t){return ye(t)}class Ss{constructor(t,e,i){this.token=t,this.name=t.name,this.handler=he(e)?e:he(null==e?void 0:e.handler)?e.handler:Ce,this.raw=!he(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)Ts(t)?i.push([t[0],yield Qi(t[1],e)]):i.push(yield Qi(t,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...i])}}class Es{constructor(t,e){this.filters=[];const i="string"==typeof t?new ys(t,e.options.operators).readFilteredValue():t;this.initial=i.initial,this.filters=i.filters.map((t=>new Ss(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 We(i||!t.options.strictFilters,(()=>`undefined filter: ${e}`)),i}}class Cs extends xs{constructor(t,e){var i;super(t);const s=new ys(t.input,e.options.operators,t.file,t.contentRange);this.value=new Es(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 Fi(toString.call(a),[],"",0,0);n.push(new Ss(t,a,e))}}*render(t,e){const i=yield this.value.value(t,!1);e.write(i)}*arguments(){yield this.value}}class Rs extends xs{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class Ms{constructor(t,e){this.segments=t,this.location=e}toString(){return Vs(this.segments,!0)}toArray(){return Array.from(function*t(...e){for(const i of e)i instanceof Ms?yield Array.from(t(...i.segments)):yield i}(...this.segments))}}class Ps{constructor(){this.map=new Map}get(t){const e=Vs([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(Vs([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const Ls={partials:!0};function*Ds(t,e,i){const s=new Ps,n=new Ps,a=new Ps,r=new Ns(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];le(t)&&!r.has(t)&&n.push(i)}else{const i=t.segments[0];le(i)&&!e.has(i)&&n.push(t)}for(const i of t.segments)i instanceof Ms&&l(i,e)}function*h(t,s){if(t.arguments)for(const e of t.arguments())for(const t of Fs(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 Ms([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 Ns(a):s.push(a);for(const t of n.scope)if(le(t))a.add(t);else{const[e,i]=t;a.add(e);const s=Array.from(Fs(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 Is(t,e={}){return ri(Ds(t,Object.assign(Object.assign({},Ls),e).partials,!1))}function Os(t,e={}){return oi(Ds(t,Object.assign(Object.assign({},Ls),e).partials,!0))}class Ns{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(!le(e))return;const i=this.getAlias(e);return void 0!==i?new Ms([...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*Fs(t){en(t)?yield*Bs(t):t instanceof Es&&(yield*function*(t){for(const e of t.initial.postfix)en(e)&&(yield*Bs(e));for(const e of t.filters)for(const t of e.args)Ts(t)&&t[1]?yield*Bs(t[1]):en(t)&&(yield*Bs(t))}(t))}function*Bs(t){tn(t)?(yield*Bs(t.lhs),yield*Bs(t.rhs)):Js(t)&&(yield js(t))}function js(t){const e=[];let i=t.file;const s=t.props[0];i=i||s.file,Ys(s)||Qs(s)||Zs(s)?e.push(s.content):Js(s)&&e.push(...js(s).segments);for(const s of t.props.slice(1))i=i||s.file,Ys(s)||Qs(s)||Zs(s)?e.push(s.content):Js(s)&&e.push(js(s));const[n,a]=t.getPosition();return new Ms(e,{row:n,col:a,file:i})}const zs=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function Vs(t,e=!1){const i=[],s=t[0];le(s)&&(!e||s.match(zs)?i.push(`${s}`):i.push(`['${s}']`));for(const e of t.slice(1))e instanceof Ms?i.push(`[${Vs(e.segments)}]`):le(e)?e.match(zs)?i.push(`.${e}`):i.push(`['${e}']`):i.push(`[${e}]`);return i.join("")}var Us,Hs,$s;!function(t){t.Partials="partials",t.Layouts="layouts",t.Root="root"}(Us||(Us={}));class Ws{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;We(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!==Us.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 We(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 Gs{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 Ws(this.liquid.options),this.parseLimit=new Ti("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const i=new ys(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 Be(s);return i}parseToken(t,e){try{if(Xs(t)){const i=this.liquid.tags[t.name];return We(i,`tag "${t.name}" not found`),new i(t,e,this.liquid,this)}return sn(t)===Hs.Output?new Cs(t,this.liquid):new Rs(t)}catch(e){if(Ie.is(e))throw e;throw new Ne(e,t)}}parseStream(t){return new ws(t,((t,e)=>this.parseToken(t,e)))}*_parseFileCached(t,e,i=Us.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:ri(o);n.write(a,l);try{return yield l}catch(t){throw n.remove(a),t}}*_parseFile(t,e,i=Us.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 qs(t){return sn(t)===Hs.Operator}function Ks(t){return sn(t)===Hs.HTML}function Xs(t){return sn(t)===Hs.Tag}function Ys(t){return sn(t)===Hs.Quoted}function Qs(t){return sn(t)===Hs.Number}function Js(t){return sn(t)===Hs.PropertyAccess}function Zs(t){return sn(t)===Hs.Word}function tn(t){return sn(t)===Hs.Range}function en(t){return(1667&sn(t))>0}function sn(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"}(Hs||(Hs={}));class nn{constructor(t={},e=fs,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=ke(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 Ti("memory alloc",null!==(l=i.memoryLimit)&&void 0!==l?l:e.memoryLimit),this.renderLimit=null!=n?n:new Ti("template render",Ki().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)=>ni(t,e)),{})}get(t){return this.getSync(t)}getSync(t){return oi(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return oi(this._getFromScope(t,e))}*_getFromScope(t,e,i=this.strictVariables){le(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield an(t,e[s],this.ownPropertyOnly),i&&void 0===t)throw new ze(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 nn(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 an(t,e,i){if(t=ve(t),e=fe(e),be(t))return t;if(ye(t)&&e<0)return t[t.length+ +e];const s=function(t,e,i){return!i||oe.call(t,e)||t instanceof ne?t[e]:void 0}(t,e,i);return void 0===s&&t instanceof ne?t.liquidMethodMissing(e):he(s)?s.call(t):"size"===e?function(t){if(oe.call(t,"size")||void 0!==t.size)return t.size;if(ye(t)||le(t))return t.length;if("object"==typeof t)return Object.keys(t).length}(t):"first"===e?function(t){return ye(t)?t[0]:t.first}(t):"last"===e?function(t){return ye(t)?t[t.length-1]:t.last}(t):s}!function(t){t[t.OUTPUT=0]="OUTPUT",t[t.STORE=1]="STORE"}($s||($s={}));const rn=Me(Math.abs),on=Me(Math.max),ln=Me(Math.min),hn=Me(Math.ceil),cn=Me(((t,e,i=!1)=>i?Math.floor(t/e):t/e)),dn=Me(Math.floor),un=Me(((t,e)=>t-e)),pn=Me(((t,e)=>t%e)),gn=Me(((t,e)=>t*e));var fn=Object.freeze({__proto__:null,abs:rn,at_least:on,at_most:ln,ceil:hn,divided_by:cn,floor:dn,minus:un,modulo:pn,times:gn,round:function(t,e=0){t=fe(t),e=fe(e);const i=Math.pow(10,e);return Math.round(t*i)/i},plus:function(t,e){return t=fe(t),e=fe(e),Number(t)+Number(e)}});const _n=/[^\p{M}\p{L}\p{Nd}]+/gu,mn={raw:/\s+/g,default:_n,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:_n,none:null};var vn=Object.freeze({__proto__:null,url_decode:t=>decodeURIComponent(ue(t)).replace(/\+/g," "),url_encode:t=>encodeURIComponent(ue(t)).replace(/%20/g,"+"),cgi_escape:t=>encodeURIComponent(ue(t)).replace(/%20/g,"+").replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())),uri_escape:t=>encodeURI(ue(t)).replace(/%5B/g,"[").replace(/%5D/g,"]"),slugify:function(t,e="default",i=!1){t=ue(t);const s=mn[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 bn=Me((function(t,e){const i=ge(t),s=be(e)?" ":ue(e),n=i.length*(1+s.length);return this.context.memoryLimit.use(n),i.join(s)})),yn=Me((t=>we(t)?Ae(t):"")),wn=Me((t=>we(t)?t[0]:"")),xn=Me((function(t){const e=ge(t);return this.context.memoryLimit.use(e.length),[...e].reverse()}));function An(t,e=[]){const i=ge(t),s=ge(e);return this.context.memoryLimit.use(i.length+s.length),i.concat(s)}function kn(t){return this.context.opts.jekyllWhere?e=>{return qe.is(t)?is(e,t):ye(e)?(i=t,e.some((t=>is(t,i)))):is(e,t);var i}:void 0===t?t=>Zi(t,this.context):e=>is(e,t)}function*Tn(t,e,i,s){const n=[];e=ge(e),this.context.memoryLimit.use(e.length);const a=new ys(ue(i)).readScopeValue();for(const t of e)n.push(yield Qi(a,this.context.spawn(t)));const r=kn.call(this,s);return e.filter(((e,i)=>r(n[i])===t))}function*Sn(t,e,i,s){const n=[],a=new Es(ue(s),this.liquid),r=ge(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*En(t,e,i){const s=new ys(ue(e)).readScopeValue(),n=ge(t),a=kn.call(this,i);for(let t=0;t<n.length;t++){if(a(yield Qi(s,this.context.spawn(n[t]))))return[t,n[t]]}}function*Cn(t,e,i){const s=new Es(ue(i),this.liquid),n=ge(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 Rn=Object.freeze({__proto__:null,join:bn,last:yn,first:wn,reverse:xn,sort:function*(t,e){const i=[],s=ge(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push([t,e?yield this.context._getFromScope(t,ue(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=ue(e),s=void 0===e?Re:(t,e)=>Re(t[i],e[i]),n=ge(t);return this.context.memoryLimit.use(n.length),[...n].sort(s)},size:t=>t&&t.length||0,map:function*(t,e){const i=[],s=ge(t);this.context.memoryLimit.use(s.length);for(const t of s)i.push(yield this.context._getFromScope(t,ue(e),!1));return i},sum:function*(t,e){let i=0;const s=ge(t);for(const t of s){const s=Number(e?yield this.context._getFromScope(t,ue(e),!1):t);i+=Number.isNaN(s)?0:s}return i},compact:function(t){const e=ge(t);return this.context.memoryLimit.use(e.length),e.filter((t=>!be(fe(t))))},concat:An,push:function(t,e){return An.call(this,t,[e])},unshift:function(t,e){const i=ge(t);this.context.memoryLimit.use(i.length);const s=[...i];return s.unshift(e),s},pop:function(t){const e=[...ge(t)];return e.pop(),e},shift:function(t){const e=ge(t);this.context.memoryLimit.use(e.length);const i=[...e];return i.shift(),i},slice:function(t,e,i=1){return be(t=fe(t))?[]:(ye(t)||(t=ue(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*Tn.call(this,!0,t,e,i)},reject:function*(t,e,i){return yield*Tn.call(this,!1,t,e,i)},where_exp:function*(t,e,i){return yield*Sn.call(this,!0,t,e,i)},reject_exp:function*(t,e,i){return yield*Sn.call(this,!1,t,e,i)},group_by:function*(t,e){const i=new Map;t=pe(t);const s=new ys(ue(e)).readScopeValue();this.context.memoryLimit.use(t.length);for(const e of t){const t=yield Qi(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 Es(ue(i),this.liquid);t=pe(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*En.call(this,t,e,i))},has_exp:function*(t,e,i){return!!(yield*Cn.call(this,t,e,i))},find_index:function*(t,e,i){const s=yield*En.call(this,t,e,i);return s?s[0]:void 0},find_index_exp:function*(t,e,i){const s=yield*Cn.call(this,t,e,i);return s?s[0]:void 0},find:function*(t,e,i){const s=yield*En.call(this,t,e,i);return s?s[1]:void 0},find_exp:function*(t,e,i){const s=yield*Cn.call(this,t,e,i);return s?s[1]:void 0},uniq:function(t){return t=ge(t),this.context.memoryLimit.use(t.length),[...new Set(t)]},sample:function(t,e=1){if(be(t=fe(t)))return[];ye(t)||(t=ue(t)),this.context.memoryLimit.use(e);const i=[...t].sort((()=>Math.random()-.5));return 1===e?i[0]:i.slice(0,e)}});function Mn(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=Ln(t,this.context.opts,i);return o?_i(o,e=be(e=fe(e))?this.context.opts.dateFormat:ue(e)):t}function Pn(t,e,i,s){const n=Ln(t,this.context.opts);if(!n)return t;if("ordinal"===i){const t=n.getDate();return _i(n,"US"===s?`${e} ${t}%q, %Y`:`${t}%q ${e} %Y`)}return _i(n,`%d ${e} %Y`)}function Ln(t,e,i){let s;const n=null!=i?i:e.timezoneOffset,a=e.locale;return s="now"===(t=fe(t))||"today"===t?new ki(Date.now(),a,n):me(t)?new ki(1e3*t,a,n):le(t)?/^\d+$/.test(t)?new ki(1e3*+t,a,n):e.preserveTimezones&&void 0===i?ki.createDateFixedToTimezone(t,a):new ki(t,a,n):new ki(t,a,n),s.valid()?s:void 0}var Dn=Object.freeze({__proto__:null,date:Mn,date_to_xmlschema:function(t){return Mn.call(this,t,"%Y-%m-%dT%H:%M:%S%:z")},date_to_rfc822:function(t){return Mn.call(this,t,"%a, %d %b %Y %H:%M:%S %z")},date_to_string:function(t,e,i){return Pn.call(this,t,"%b",e,i)},date_to_long_string:function(t,e,i){return Pn.call(this,t,"%B",e,i)}});const In=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,On=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;var Nn=Object.freeze({__proto__:null,append:function(t,e){We(2===arguments.length,"append expect 2 arguments");const i=ue(t),s=ue(e);return this.context.memoryLimit.use(i.length+s.length),i+s},prepend:function(t,e){We(2===arguments.length,"prepend expect 2 arguments");const i=ue(t),s=ue(e);return this.context.memoryLimit.use(i.length+s.length),s+i},lstrip:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),e?(e=Pe(ue(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"")):i.replace(/^\s+/,"")},downcase:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.toLowerCase()},upcase:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),ue(e).toUpperCase()},remove:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),i.split(ue(e)).join("")},remove_first:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),i.replace(ue(e),"")},remove_last:function(t,e){const i=ue(t);this.context.memoryLimit.use(i.length);const s=ue(e),n=i.lastIndexOf(s);return-1===n?i:i.substring(0,n)+i.substring(n+s.length)},rstrip:function(t,e){return t=ue(t),this.context.memoryLimit.use(t.length),e?(e=Pe(ue(e)),t.replace(new RegExp(`[${e}]+$`,"g"),"")):t.replace(/\s+$/,"")},split:function(t,e){const i=ue(t);this.context.memoryLimit.use(i.length);const s=i.split(ue(e));for(;s.length&&""===s[s.length-1];)s.pop();return s},strip:function(t,e){const i=ue(t);return this.context.memoryLimit.use(i.length),e?(e=Pe(ue(e)),i.replace(new RegExp(`^[${e}]+`,"g"),"").replace(new RegExp(`[${e}]+$`,"g"),"")):i.trim()},strip_newlines:function(t){const e=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"")},capitalize:function(t){return t=ue(t),this.context.memoryLimit.use(t.length),t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,i){const s=ue(t);return this.context.memoryLimit.use(s.length),s.split(ue(e)).join(i)},replace_first:function(t,e,i){const s=ue(t);return this.context.memoryLimit.use(s.length),s.replace(ue(e),i)},replace_last:function(t,e,i){const s=ue(t);this.context.memoryLimit.use(s.length);const n=ue(e),a=s.lastIndexOf(n);if(-1===a)return s;const r=ue(i);return s.substring(0,a)+r+s.substring(a+n.length)},truncate:function(t,e=50,i="..."){const s=ue(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=ue(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=ue(t);return this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(t,e){const i=ue(t);if(this.context.memoryLimit.use(i.length),!(t=i.trim()))return 0;switch(e){case"cjk":return(t.match(In)||[]).length+(t.match(On)||[]).length;case"auto":return In.test(t)?t.match(In).length+(t.match(On)||[]).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 Fn=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ps),fn),vn),Rn),Dn),Nn),ls);const Bn=["offset","limit","reversed"];function jn(t,e,i){if(e.options.dynamicPartials){const e=t.readValue();if(t.assert(e,"illegal file path"),"none"===e.getText())return;if(Ys(e)){const t=i.parse(function(t){return t.content}(e));return zn(t)}return e}const s=[...t.readFileNameTemplate(e.options)],n=zn(i.parseTokens(s));return"none"===n?void 0:n}function zn(t){return 1===t.length&&Ks(t[0].token)?t[0].token.getContent():t}function*Vn(t,e,i){return"string"==typeof t?t:Array.isArray(t)?i.renderer.renderTemplates(t,e):yield Qi(t,e)}class Un extends Xe{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 Hn={assign:class extends As{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 Es(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 As{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 ks(this.tokenizer,i.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];const l=s.parseStream(e).on("start",(()=>o=this.templates)).on("tag:else",(t=>{Ge(t.args),o=this.elseTemplates})).on("tag:endfor",(t=>{Ge(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=pe(yield Qi(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=>Bn.includes(t))):Bn.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 Xe(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))en(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}},capture:class extends As{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(Xs(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 As{constructor(t,e,i,s){super(t,e,i),this.branches=[],this.elseTemplates=[],this.value=new Es(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=fe(yield this.value.value(t,t.opts.lenientIf));let n=!1;for(const a of this.branches)for(const r of a.values){if(is(s,yield Qi(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 As{constructor(t,e,i){for(super(t,e,i);e.length;){const t=e.shift();if(Xs(t)&&"endcomment"===t.name)return}throw new Error(`tag ${t.getText()} not closed`)}render(){}},include:class extends As{constructor(t,e,i,s){super(t,e,i);const{tokenizer:n}=t;this.file=jn(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 ks(n,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s,withVar:n}=this,{renderer:a}=i,r=yield Vn(this.file,t,i);We(r,(()=>`illegal file path "${r}"`));const o=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",$s.OUTPUT);const l=yield s.render(t);n&&(l[r]=yield Qi(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&&le(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(le(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(en),en(this.file)&&(yield this.file),en(this.withVar)&&(yield this.withVar)}},render:class extends As{constructor(t,e,i,s){super(t,e,i);const n=this.tokenizer;for(this.file=jn(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 ks(n,i.options.keyValueSeparator)}*render(t,e){const{liquid:i,hash:s}=this,n=yield Vn(this.file,t,i);We(n,(()=>`illegal file path "${n}"`));const a=t.spawn(),r=a.bottom();if(ni(r,yield s.render(t)),this.with){const{value:e,alias:i}=this.with;r[i||n]=yield Qi(e,t)}if(this.for){const{value:s,alias:o}=this.for,l=pe(yield Qi(s,t));r.forloop=new Xe(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&&le(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(le(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:i}=this.with;le(i)?t.push([i,e]):le(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:i}=this.for;le(i)?t.push([i,e]):le(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))en(t)&&(yield t);if(this.with){const{value:t}=this.with;en(t)&&(yield t)}if(this.for){const{value:t}=this.for;en(t)&&(yield t)}}},decrement:class extends As{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;me(i[this.variable])||(i[this.variable]=0),e.write(ue(--i[this.variable]))}*localScope(){yield this.identifier}},increment:class extends As{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;me(i[this.variable])||(i[this.variable]=0);const s=i[this.variable];i[this.variable]++,e.write(ue(s))}*localScope(){yield this.identifier}},cycle:class extends As{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 Qi(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 Qi(a,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},if:class extends As{constructor(t,e,i,s){super(t,e,i),this.branches=[];let n=[];s.parseStream(e).on("start",(()=>this.branches.push({value:new Es(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]}))).on("tag:elsif",(t=>{We(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new Es(t.tokenizer.readFilteredValue(),this.liquid),templates:n=[]})})).on("tag:else",(t=>{Ge(t.args),We(!this.elseTemplates,"duplicated else"),n=this.elseTemplates=[]})).on("tag:endif",(function(t){Ge(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(Zi(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 As{constructor(t,e,i,s){super(t,e,i),this.file=jn(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new ks(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",$s.OUTPUT),void(yield a.renderTemplates(this.templates,t,e));const r=yield Vn(this.file,t,i);We(r,(()=>`illegal file path "${r}"`));const o=yield i._parseLayoutFile(r,t.sync,this.currentFile);t.setRegister("blockMode",$s.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",$s.OUTPUT),t.push(yield s.render(t)),yield a.renderTemplates(o,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&le(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))en(t)&&(yield t);en(this.file)&&(yield this.file)}partialScope(){if(le(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},block:class extends As{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(Xs(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")===$s.STORE?t.getRegister("blocks")[this.block]=i:yield i(new Ze,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 Ze((e=>n(t,e))),e):n}*children(){return this.templates}blockScope(){return["block"]}},raw:class extends As{constructor(t,e,i){for(super(t,e,i),this.tokens=[];e.length;){const t=e.shift();if(Xs(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 As{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 ks(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=pe(yield Qi(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 Un(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))en(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}},unless:class extends As{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 Es(t.tokenizer.readFilteredValue(),this.liquid),test:ts,templates:n=[]}))).on("tag:elsif",(t=>{a>0?n=[]:this.branches.push({value:new Es(t.tokenizer.readFilteredValue(),this.liquid),test:Zi,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 As{render(t,e){t.breakCalled=!0}},continue:class extends As{render(t,e){t.continueCalled=!0}},echo:class extends As{constructor(t,e,i){super(t,e,i),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new Es(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 As{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 As{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 $n{constructor(t={}){this.renderer=new Xi,this.filters={},this.tags={},this.options=_s(t),this.parser=new Gs(this),xe(Hn,((t,e)=>this.registerTag(e,t))),xe(Fn,((t,e)=>this.registerFilter(e,t)))}parse(t,e){return new Gs(this).parse(t,e)}_render(t,e,i){const s=e instanceof nn?e:new nn(e,this.options,i);return this.renderer.renderTemplates(t,s)}render(t,e,i){return ai(this,void 0,void 0,(function*(){return ri(this._render(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderSync(t,e,i){return oi(this._render(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderToNodeStream(t,e,i={}){const s=new nn(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 ai(this,void 0,void 0,(function*(){return ri(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}parseAndRenderSync(t,e,i){return oi(this._parseAndRender(t,e,Object.assign(Object.assign({},i),{sync:!0})))}_parsePartialFile(t,e,i){return new Gs(this).parseFile(t,e,Us.Partials,i)}_parseLayoutFile(t,e,i){return new Gs(this).parseFile(t,e,Us.Layouts,i)}_parseFile(t,e,i,s){return new Gs(this).parseFile(t,e,i,s)}parseFile(t,e){return ai(this,void 0,void 0,(function*(){return ri(new Gs(this).parseFile(t,!1,e))}))}parseFileSync(t,e){return oi(new Gs(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 ai(this,void 0,void 0,(function*(){return ri(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!1})))}))}renderFileSync(t,e,i){return oi(this._renderFile(t,e,Object.assign(Object.assign({},i),{sync:!0})))}renderFileToNodeStream(t,e,i){return ai(this,void 0,void 0,(function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,i)}))}_evalValue(t,e){const i=new Es(t,this),s=e instanceof nn?e:new nn(e,this.options);return i.value(s)}evalValue(t,e){return ai(this,void 0,void 0,(function*(){return ri(this._evalValue(t,e))}))}evalValueSync(t,e){return oi(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){this.tags[t]=he(e)?e:function(t){return class extends As{constructor(e,i,s){super(e,i,s),he(t.parse)&&t.parse.call(this,e,i)}*render(e,i){const s=yield new ks(this.token.args,e.opts.keyValueSeparator).render(e);return yield t.render.call(this,e,i,s)}}}(e)}plugin(t){return t.call(this,$n)}express(){const t=this;let e=!0;return function(i,s,n){if(e){e=!1;const i=ms(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 ai(this,void 0,void 0,(function*(){return Is(t,e)}))}analyzeSync(t,e={}){return Os(t,e)}parseAndAnalyze(t,e,i={}){return ai(this,void 0,void 0,(function*(){return Is(this.parse(t,e),i)}))}parseAndAnalyzeSync(t,e,i={}){return Os(this.parse(t,e),i)}variables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Object.keys(i.variables)}))}variablesSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Object.keys(i.variables)}fullVariables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(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=Os(le(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 ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}))}variableSegmentsSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.variables).flatMap((t=>t.map((t=>t.toArray()))))))}globalVariables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Object.keys(i.globals)}))}globalVariablesSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Object.keys(i.globals)}globalFullVariables(t,e={}){return ai(this,void 0,void 0,(function*(){const i=yield Is(le(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=Os(le(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 ai(this,void 0,void 0,(function*(){const i=yield Is(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}))}globalVariableSegmentsSync(t,e={}){const i=Os(le(t)?this.parse(t):t,e);return Array.from(Le(Object.values(i.globals).flatMap((t=>t.map((t=>t.toArray()))))))}}const Wn={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"},Gn=t=>(f("data-v-4a16637c"),t=t(),_(),t),qn={key:0,class:"popover"},Kn=Gn((()=>m("br",null,null,-1))),Xn=Gn((()=>m("ul",null,[m("li",null,"HTML - preview as webpage"),m("li",null,"PDF (Preview) - watermarked, free"),m("li",null,"PDF - final version, without watermark"),m("li",null,"Code - preview without test input")],-1)));var Yn={__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",qn,[g(" The preview mode has 4 modes: "),Kn,Xn])):d("v-if",!0)],32)}}},Qn=[],Jn=[];function Zn(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=Qn.indexOf(a);-1===r&&(r=Qn.push(a)-1,Jn[r]={}),i=Jn[r]&&Jn[r][s]?Jn[r][s]:Jn[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}}Zn("\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",{}),Yn.__scopeId="data-v-4a16637c",Yn.__file="settingsmodule/src/pages/templates/explainPreviewMode.vue";const ta=m("div",{class:"field half"},[m("div",{class:"type-label"}," Template name ")],-1),ea=m("div",{class:"field half"},[m("div",{class:"type-label"}," Description ")],-1),ia=m("div",{class:"field half"},[m("div",{class:"type-label"},"Format")],-1),sa=m("div",{class:"field half"},[m("div",{class:"type-label"}," Orientation ")],-1),na={key:0,class:"TTA-popup"},aa={class:"TTA-toolbar"},ra={class:"right-side"},oa={class:"setwidth"},la={class:"TTA-action"},ha={class:"TTA-wapper"},ca={class:"devFields"},da={id:"partSelect"},ua=["src","srcDoc"],pa={class:"tta-notice"},ga=m("a",{href:"https://app.texttoanything.nl",target:"_blank"},"TTA app",-1);var fa=v({__name:"templates",setup(t){const{useFlowsStore:s,useNotificationsStore:n}=e(),a=s(),f=n(),_=b((()=>a.flows.filter((t=>"webhook"===t.trigger&&"POST"==t.options.method)).map((t=>({text:t.name,value:t.id}))))),v=u([{text:"Name",value:"name",sortable:!1,width:300},{text:"Description",value:"description",sortable:!1,width:400},{text:"Format",value:"format",sortable:!1,width:100},{text:"",value:"del",width:60,sortable:!1}]),P=u([]),L=u(!1),D=u(!1),I=u("Development"),O=u("html"),N=u(""),F=u(!1),B=u(),j=u(50),z=b((()=>100-j.value)),V=b((()=>100-z.value)),U=u("");function H(){"Development"==I.value&&(U.value=""),"Header"==I.value&&(U.value=X.value.header),"Body"==I.value&&(U.value=X.value.template),"Footer"==I.value&&(U.value=X.value.footer)}function $(t){"Header"==I.value?X.value.header=t:"Body"==I.value?X.value.template=t:X.value.footer=t}function W(t){"Fixed"==X.value.input_type?X.value.input_fixed=t:X.value.input_flow_body=t}y((()=>I.value),(()=>{H()}),{immediate:!0});const G=i(),K={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:"{}"},X=u(structuredClone(K)),Y=new $n;async function Q(t){if("Flow"==X.value.input_type&&!X.value.input_flow)return;N.value="rendering";let e={};try{if("Flow"==X.value.input_type){const t=await G.post("/flows/trigger/"+X.value.input_flow,JSON.parse(X.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==X.value.input_fixed&&(X.value.input_fixed="{}");try{e=JSON.parse(X.value.input_fixed)}catch(t){}}if("html"==t||"code"==t){const i=(X.value.header||"")+(X.value.template||"")+(X.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 Y.render(Y.parse(i),e))],{type:"text/html"});N.value=URL.createObjectURL(s)}else{const t=Y.parse(X.value.header||""),i=Y.parse(X.value.template),s=Y.parse(X.value.footer||""),n=await Y.render(t,e),a=await Y.render(i,e),r=await Y.render(s,e),o=await fetch("/tta/pdf?preview="+("pdf-preview"==O.value?"preview":""),{body:JSON.stringify({...X.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"!=X.value.orientation}),method:"POST",headers:{"Content-Type":"application/json"}}).then((t=>t.blob())).then((t=>URL.createObjectURL(t)));N.value=o}}catch(t){console.error(t),f.add({title:"Error while generating PDF",text:"Please check your console/terminal for the error.",type:"error",dialog:!0}),N.value=URL.createObjectURL(new Blob(["Error occurred: "+((null==t?void 0:t.message)||t)],{type:"text/html"}))}}async function J(){const t=await G.get("/items/TTA_htmltemplates",{params:{limit:-1}});P.value=t.data.data}async function Z(){-1==X.value.id?await G.post("/items/TTA_htmltemplates",{...X.value,id:void 0}):await G.patch("/items/TTA_htmltemplates/"+X.value.id,{...X.value,id:void 0}),L.value=!1,J()}async function tt(){await G.delete("/items/TTA_htmltemplates/"+B.value),P.value=P.value.filter((t=>t.id!=B.value)),F.value=!1}function et({item:t}){X.value=t,D.value=!0}function it(){X.value=structuredClone(K),D.value=!1}function st(){const t={wrap_line_length:0,indent_inner_html:!0};X.value.template=q.exports.html(X.value.template,t),X.value.footer=q.exports.html(X.value.footer,t),X.value.header=q.exports.html(X.value.header,t),H()}return y((()=>X.value.id),((t,e)=>{t!=e&&(I.value="",w((()=>{I.value="Body"})))})),y((()=>[X.value.header,X.value.template,X.value.footer,X.value.input_type,X.value.input_flow,X.value.input_fixed,O.value]),(()=>{["html","code"].includes(O.value)&&Q(O.value)}),{deep:!0,immediate:!0}),x((async()=>{j.value=parseInt(localStorage.getItem("TTA-widthPartition")||"50"),J()})),y((()=>j.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"),b=r("v-select"),y=r("v-list"),w=r("v-card-text"),x=r("v-card-actions"),H=r("v-card"),G=r("v-dialog"),q=r("VSelect"),K=r("v-slider"),Y=r("VButton"),J=r("VIcon"),nt=r("v-table"),at=r("VNotice"),rt=r("private-view"),ot=A("tooltip");return o(),l(rt,{title:"Offline templates"},{navigation:h((()=>[c(Wn)])),actions:h((()=>[c(s,{rounded:"",icon:"",onClick:e[0]||(e[0]=t=>L.value=!0)},{default:h((()=>[c(i,{name:"add"})])),_:1}),c(G,{modelValue:L.value,"onUpdate:modelValue":e[6]||(e[6]=t=>L.value=t),persistent:!0},{default:h((()=>[c(H,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((()=>[ta,c(a,{modelValue:X.value.name,"onUpdate:modelValue":e[1]||(e[1]=t=>X.value.name=t),placeholder:"Template name"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[ea,c(a,{modelValue:X.value.description,"onUpdate:modelValue":e[2]||(e[2]=t=>X.value.description=t),placeholder:"Description"},null,8,["modelValue"])])),_:1})])),_:1}),c(f,null,{default:h((()=>[c(u,null,{default:h((()=>[ia,c(b,{modelValue:X.value.format,"onUpdate:modelValue":e[3]||(e[3]=t=>X.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((()=>[sa,c(b,{modelValue:X.value.orientation,"onUpdate:modelValue":e[4]||(e[4]=t=>X.value.orientation=t),placeholder:"Orientation",items:[{value:"portrait",text:"Portrait"},{value:"landscape",text:"Landscape"}]},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1}),c(x,null,{default:h((()=>[c(s,{secondary:"",onClick:e[5]||(e[5]=t=>L.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{disabled:!X.value.name||!X.value.format,onClick:Z},{default:h((()=>[g(" Save ")])),_:1},8,["disabled"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),default:h((()=>[D.value?(o(),p("div",na,[m("div",aa,[m("div",{onClick:e[7]||(e[7]=t=>L.value=!0),class:"TTA-template-title"},[g(k(X.value.name)+" ",1),c(i,{name:"edit"})]),m("div",ra,[c(q,{modelValue:O.value,"onUpdate:modelValue":e[8]||(e[8]=t=>O.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(Yn,{text:"This is helpful info."}),T((o(),p("div",{class:"TTA-action",onClick:st},[c(i,{name:"vertical_align_center"})])),[[ot,"Click to format your HTML",void 0,{bottom:!0}]]),T((o(),p("div",{class:"TTA-action",onClick:Z},[c(i,{name:"save"})])),[[ot,"Click to save the template",void 0,{bottom:!0}]]),m("div",oa,[c(K,{modelValue:j.value,"onUpdate:modelValue":e[9]||(e[9]=t=>j.value=t),min:10,max:90,class:"TTA-slider"},null,8,["modelValue"])]),m("div",la,[c(i,{name:"close",onClick:it})])])]),m("div",ha,[m("div",{style:S("width: "+E(V)+"%"),class:"TTA-editor-wrapper"},["Development"==I.value?(o(),p(C,{key:0},[m("div",ca,[c(b,{modelValue:X.value.input_type,"onUpdate:modelValue":e[10]||(e[10]=t=>X.value.input_type=t),class:"max-w-input",items:[{value:"Flow",text:"Flow"},{value:"Fixed",text:"Fixed"}]},null,8,["modelValue"]),"Flow"==X.value.input_type?(o(),l(b,{key:0,modelValue:X.value.input_flow,"onUpdate:modelValue":e[11]||(e[11]=t=>X.value.input_flow=t),class:"max-w-input",items:E(_)},null,8,["modelValue","items"])):d("v-if",!0)]),"Fixed"==X.value.input_type?(o(),l(R("interface-input-code"),{key:0,class:"TTA-editor",value:X.value.input_fixed,language:"json",onInput:W},null,40,["value"])):d("v-if",!0),"Flow"==X.value.input_type?(o(),l(R("interface-input-code"),{key:1,class:"TTA-editor",value:X.value.input_flow_body,language:"json",onInput:W},null,40,["value"])):d("v-if",!0)],64)):d("v-if",!0),"Development"!=I.value?(o(),l(R("interface-input-code"),{key:1,class:"TTA-editor",value:U.value,language:"htmlmixed",onInput:$},null,40,["value"])):d("v-if",!0),m("div",da,[c(b,{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),m("iframe",{class:"TTA-preview",src:"rendering"==N.value?void 0:N.value,srcDoc:"rendering"==N.value?E('\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: "+E(z)+"%")},null,12,ua),O.value.startsWith("pdf")?(o(),l(Y,{key:0,onClick:e[13]||(e[13]=t=>{Q("pdf")}),icon:!0,outlined:!1,id:"generatePDF"},{default:h((()=>[c(i,{name:"refresh"})])),_:1})):d("v-if",!0)])])):d("v-if",!0),c(nt,{headers:v.value,"onUpdate:headers":e[14]||(e[14]=t=>v.value=t),"show-resize":"","onClick:row":et,items:P.value},{"item.del":h((({item:t})=>[c(Y,{onClick:M((e=>{return i=t.id,B.value=i,void(F.value=!0);var i}),["stop"]),outlined:!0,icon:!0,rounded:!0},{default:h((()=>[c(J,{name:"delete"})])),_:2},1032,["onClick"])])),_:1},8,["headers","items"]),m("div",pa,[c(at,null,{default:h((()=>[g(" You can create online templates in the "),ga,g(" for a better editor experience. ")])),_:1})]),c(G,{modelValue:F.value,"onUpdate:modelValue":e[16]||(e[16]=t=>F.value=t),persistent:!0},{default:h((()=>[c(H,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[15]||(e[15]=t=>F.value=!1)},{default:h((()=>[g(" Cancel ")])),_:1}),c(s,{kind:"danger",onClick:tt},{default:h((()=>[g(" Proceed ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})}}});Zn("\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}\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-editor .CodeMirror-dialog.CodeMirror-dialog-top {\n position: fixed !important;\n bottom: 0 !important;\n z-index: 100 !important;\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",{}),fa.__file="settingsmodule/src/pages/templates.vue";var _a=v({__name:"virusscanDialog",setup(t){const e=i(),s=u([]),n=u(!1);x((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=b((()=>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"),_=r("v-icon");return o(),p(C,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(k(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(_,{name:"edit"}),E(a)==s.value.length?(o(),p(C,{key:0},[g(" All ")],64)):(o(),p(C,{key:1},[g(k(E(a))+"/"+k(s.value.length),1)],64)),g(" folders are being scanned ")])),_:1})],64)}}});_a.__file="settingsmodule/src/pages/settings/virusscanDialog.vue";var ma=v({__name:"passwordField",setup(t){const e=P(),i=u(!0);function s(){i.value=!i.value}return(t,n)=>{const a=r("VIcon"),d=r("VInput"),u=A("tooltip");return o(),l(d,{modelValue:E(e),"onUpdate:modelValue":n[0]||(n[0]=t=>L(e)?e.value=t:null),type:i.value?"password":"text"},{append:h((()=>[T(c(a,{clickable:"",onClick:s,name:i.value?"visibility":"visibility_off"},null,8,["name"]),[[u,i.value?"Show value":"Hide value"]])])),_:1},8,["modelValue","type"])}}});ma.__file="settingsmodule/src/components/passwordField.vue";const va=t=>(f("data-v-7f9dbb3b"),t=t(),_(),t),ba={class:"cards-wrapper"},ya=va((()=>m("span",{class:"field-name"},"RapidAPI token",-1))),wa=va((()=>m("span",{class:"field-name"},"RapidAPI virusscanner token",-1))),xa={class:"field-name info-parent"},Aa=va((()=>m("div",null,[g(" What should happen when a virus is detected? "),m("ul",null,[m("li",null," Delete threads, threads will be deleted immediately "),m("li",null," Trigger flow, the selected flow will be triggered with upload payload ")]),m("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))),ka={key:0},Ta={class:"field-name info-parent"};var Sa=v({__name:"settings",setup(t){const s=u(""),n=u(""),a=u(!1),f=u(""),_=u(""),v=u(""),y=i(),{useFlowsStore:w}=e(),A=w(),k=b((()=>A.flows.map((t=>({text:t.name,value:t.id})))));async function T(){R({TTA_KEY:s.value,TTA_KEY_VIRUS:n.value},"apikeys")}async function S(){R({TTA_VIRUSSCANNER_ENABLED:a.value,TTA_VIRUSSCANNER_MODE:f.value,TTA_VIRUSSCANNER_FLOW_ID:_.value},"virus")}async function R(t,e){v.value=e,await y.patch("/settings",t),setTimeout((()=>{v.value=""}),500)}return x((async()=>{const t=await y.get("/settings");s.value=t.data.data.TTA_KEY,n.value=t.data.data.TTA_KEY_VIRUS,_.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||"delete"})),(t,e)=>{const i=r("v-card-title"),u=r("v-card-text"),b=r("v-icon"),y=r("v-button"),w=r("v-progress-circular"),x=r("v-card-actions"),A=r("v-card"),R=r("VCheckbox"),M=r("VIcon"),P=r("VNotice"),L=r("v-hover"),D=r("v-select"),I=r("private-view");return o(),l(I,{title:"Settings"},{navigation:h((()=>[c(Wn)])),default:h((()=>[m("div",ba,[c(A,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("API settings")])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[ya,c(ma,{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t)},null,8,["modelValue"])])])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(y,{href:"https://rapidapi.com/Attacler/api/text-to-anything",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(b,{name:"open_in_new"}),g(" Get RapidAPI token ")])),_:1})])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[wa,c(ma,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=t=>n.value=t)},null,8,["modelValue"])])])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(y,{href:"https://rapidapi.com/Attacler/api/virusscan-texttoanything/",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(b,{name:"open_in_new"}),g(" Get RapidAPI virusscanner token ")])),_:1})])),_:1}),c(x,{class:"action-buttons"},{default:h((()=>[c(y,{onClick:T,disabled:"apikeys"==v.value,id:"save-button"},{default:h((()=>["apikeys"!=v.value?(o(),p(C,{key:0},[g(" Save ")],64)):(o(),l(w,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1}),c(A,{class:"w-full"},{default:h((()=>[c(i,null,{default:h((()=>[g("Virusscanner settings")])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[c(R,{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(u,{class:"fields-spacing"},{default:h((()=>[m("div",null,[m("div",xa,[g(" Mode "),c(L,null,{default:h((({hover:t})=>[c(M,{name:"info"}),t?(o(),l(P,{key:0,class:"info-popup"},{default:h((()=>[Aa])),_:1})):d("v-if",!0)])),_:1})]),c(D,{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",ka,[m("div",Ta,[g(" Flow "),c(L,null,{default:h((({hover:t})=>[c(M,{name:"info"}),t?(o(),l(P,{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(D,{items:E(k),showDeselect:"",modelValue:_.value,"onUpdate:modelValue":e[4]||(e[4]=t=>_.value=t)},null,8,["items","modelValue"])])):d("v-if",!0)])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(_a)])),_:1}),c(u,{class:"fields-spacing"},{default:h((()=>[c(y,{href:"https://texttoanything.nl/docs/directus/virusscanner",target:"_blank",align:"left",fullWidth:"",small:""},{default:h((()=>[c(b,{name:"open_in_new"}),g(" Virusscanner documentation ")])),_:1})])),_:1}),c(x,{class:"action-buttons"},{default:h((()=>[c(y,{onClick:S,disabled:"virus"==v.value,id:"save-button"},{default:h((()=>["virus"!=v.value?(o(),p(C,{key:0},[g(" Save ")],64)):(o(),l(w,{key:1,small:!0,indeterminate:""}))])),_:1},8,["disabled"])])),_:1})])),_:1})])])),_:1})}}});Zn("\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",{}),Sa.__scopeId="data-v-7f9dbb3b",Sa.__file="settingsmodule/src/pages/settings.vue";var Ea=v({__name:"dateTimePicker",props:{value:{type:[String,null],required:!0}},setup(t,{emit:e}){const i=t,s=u(),n=u(i.value);const a=b((()=>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 y((()=>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:E(a)?void 0:n.value,onClick:t},D({_:2},[E(a)?{name:"prepend",fn:h((()=>[g(k(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)])}}});Zn("\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",{}),Ea.__scopeId="data-v-42405105",Ea.__file="settingsmodule/src/components/dateTimePicker.vue";var Ca={d:(t,e)=>{for(var i in e)Ca.o(e,i)&&!Ca.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ra={};function Ma(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 Pa(t,e){if(t){if("string"==typeof t)return Ma(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)?Ma(t,e):void 0}}function La(t){return function(t){if(Array.isArray(t))return Ma(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Pa(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 Da(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Ca.d(Ra,{Z:()=>Qa});const Ia=(Ba={computed:()=>a.computed,createTextVNode:()=>a.createTextVNode,createVNode:()=>a.createVNode,defineComponent:()=>a.defineComponent,reactive:()=>a.reactive,ref:()=>a.ref,watch:()=>a.watch,watchEffect:()=>a.watchEffect},ja={},Ca.d(ja,Ba),ja),Oa=(0,Ia.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var t=this.data,e=this.onClick;return(0,Ia.createVNode)("span",{class:"vjs-tree-brackets",onClick:e},[t])}}),Na=(0,Ia.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,Ia.computed)((function(){return t.isMultiple?"checkbox":"radio"})),model:(0,Ia.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,Ia.createVNode)("label",{class:["vjs-check-controller",e?"is-checked":""],onClick:function(t){return t.stopPropagation()}},[(0,Ia.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(t)},null),(0,Ia.createVNode)("input",{checked:e,class:"vjs-check-controller-original is-".concat(t),type:t,onChange:function(){return i("change",e)}},null)])}}),Fa=(0,Ia.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,Ia.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(i?"open":"close"),onClick:e},[(0,Ia.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,Ia.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 Ba,ja;function za(t){return za="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},za(t)}function Va(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ua(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=Va(t);if("array"===u){var p=Ha(t.map((function(t,s,n){return Ua(t,"".concat(e,"[").concat(s,"]"),i+1,{index:s,showComma:s!==n.length-1,length:d,type:o})})));return[Ua("[",e,i,{showComma:!1,key:n,length:t.length,type:"arrayStart"})[0]].concat(p,Ua("]",e,i,{showComma:h,length:t.length,type:"arrayEnd"})[0])}if("object"===u){var g=Object.keys(t),f=Ha(g.map((function(s,n,a){return Ua(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[Ua("{",e,i,{showComma:!1,key:n,index:a,length:g.length,type:"objectStart"})[0]].concat(f,Ua("}",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 Ha(t){if("function"==typeof Array.prototype.flat)return t.flat();for(var e=La(t),i=[];e.length;){var s=e.shift();Array.isArray(s)?e.unshift.apply(e,La(s)):i.push(s)}return i}function $a(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"!==za(t))return t;if(e.get(t))return e.get(t);if(Array.isArray(t)){var i=t.map((function(t){return $a(t,e)}));return e.set(t,i),i}var s={};for(var n in t)s[n]=$a(t[n],e);return e.set(t,s),s}function Wa(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 Ga(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Wa(Object(i),!0).forEach((function(e){Da(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Wa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var qa={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 Ka=(0,Ia.defineComponent)({name:"TreeNode",props:Ga(Ga({},qa),{},{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,Ia.computed)((function(){return Va(t.node.content)})),n=(0,Ia.computed)((function(){return"vjs-value vjs-value-".concat(s.value)})),a=(0,Ia.computed)((function(){return t.showDoubleQuotes?'"'.concat(t.node.key,'"'):t.node.key})),r=(0,Ia.computed)((function(){return"multiple"===t.selectableType})),o=(0,Ia.computed)((function(){return"single"===t.selectableType})),l=(0,Ia.computed)((function(){return t.nodeSelectable(t.node)&&(r.value||o.value)})),h=(0,Ia.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,Ia.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)},_=function(){i("nodeClick",t.node),l.value&&t.selectOnClickNode&&i("selectedChange",t.node)},m=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,Ia.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:_,style:t.style},[t.showLineNumber&&(0,Ia.createVNode)("span",{class:"vjs-node-index"},[i.id+1]),t.showSelectController&&l.value&&"objectEnd"!==i.type&&"arrayEnd"!==i.type&&(0,Ia.createVNode)(Na,{isMultiple:r.value,checked:t.checked,onChange:f},null),(0,Ia.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(i.level)).map((function(e,i){return(0,Ia.createVNode)("div",{key:i,class:{"vjs-indent-unit":!0,"has-line":t.showLine}},null)})),t.showIcon&&(0,Ia.createVNode)(Fa,{nodeType:i.type,onClick:g},null)]),i.key&&(0,Ia.createVNode)("span",{class:"vjs-key"},[(e=t.renderNodeKey,e?e({node:t.node,defaultKey:a.value||""}):a.value),(0,Ia.createVNode)("span",{class:"vjs-colon"},[":".concat(t.showKeyValueSpace?" ":"")])]),(0,Ia.createVNode)("span",null,["content"!==i.type&&i.content?(0,Ia.createVNode)(Oa,{data:i.content.toString(),onClick:p},null):(0,Ia.createVNode)("span",{class:n.value,onClick:!t.editable||t.editableTrigger&&"click"!==t.editableTrigger?void 0:m,onDblclick:t.editable&&"dblclick"===t.editableTrigger?m:void 0},[t.editable&&h.editing?(0,Ia.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,Ia.createVNode)("span",null,[","]),t.showLength&&t.collapsed&&(0,Ia.createVNode)("span",{class:"vjs-comment"},[(0,Ia.createTextVNode)(" // "),i.length,(0,Ia.createTextVNode)(" items ")])])])}}});function Xa(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 Ya(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Xa(Object(i),!0).forEach((function(e){Da(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Xa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}const Qa=(0,Ia.defineComponent)({name:"Tree",props:Ya(Ya({},qa),{},{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,Ia.ref)(),a=(0,Ia.computed)((function(){return Ua(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:Ya(Ya({},s),{},Da({},n.path,1))}),{})},o=(0,Ia.reactive)({translateY:0,visibleData:null,hiddenPaths:r(t.deep,t.collapsedNodeLength)}),l=(0,Ia.computed)((function(){for(var t=null,e=[],i=a.value.length,s=0;s<i;s++){var n=Ya(Ya({},a.value[s]),{},{id:s}),r=o.hiddenPaths[n.path];if(t&&t.path===n.path){var l="objectStart"===t.type,h=Ya(Ya(Ya({},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,Ia.computed)((function(){var e=t.selectedValue;return e&&"multiple"===t.selectableType&&Array.isArray(e)?e:[e]})),c=(0,Ia.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=La(h.value);-1!==r?o.splice(r,1):o.push(n),i("update:selectedValue",o),i("selectedChange",o,La(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)||Pa(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=Ya(Ya({},o.hiddenPaths),{},Da({},e,1));else{var i=Ya({},o.hiddenPaths);delete i[e],o.hiddenPaths=i}},_=function(e,s){t.collapsedOnClickBrackets&&f(e,s.path),i("bracketsClick",e,s)},m=function(t,e){f(t,e.path),i("iconClick",t,e)},v=function(e,s){var n=$a(t.data),a=t.rootPath;new Function("data","val","data".concat(s.slice(a.length),"=val"))(n,e),i("update:data",n)};return(0,Ia.watchEffect)((function(){c.value&&function(t){throw new Error("[VueJSONPretty] ".concat(t))}(c.value)})),(0,Ia.watchEffect)((function(){l.value&&d()})),(0,Ia.watch)((function(){return t.deep}),(function(e){e&&(o.hiddenPaths=r(e,t.collapsedNodeLength))})),(0,Ia.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,Ia.createVNode)(Ka,{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:_,onIconClick:m,onSelectedChange:p,onValueChange:v,style:t.itemHeight&&20!==t.itemHeight?{lineHeight:"".concat(t.itemHeight,"px")}:{}},null)}));return(0,Ia.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?Ya({paddingLeft:"".concat(12*Number(a.value.length.toString().length),"px")},t.style):t.style},[t.virtual?(0,Ia.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(t.height,"px")}},[(0,Ia.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(l.value.length*t.itemHeight,"px")}},[(0,Ia.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(o.translateY,"px)")}},[d])])]):d])}}});var Ja=Ra.Z;Zn('.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 Za=t=>(f("data-v-2ded8f93"),t=t(),_(),t),tr={class:"content"},er=Za((()=>m("div",{class:"header"},[m("span",{class:"dot success"}),m("span",{class:"type-label"}," Trigger ")],-1))),ir={class:"inset"},sr={class:"steps"},nr={class:"header"},ar={class:"type-label"},rr={class:"subdued"},or={class:"inset"};var lr=v({__name:"displayFlowLogs",props:{currentLog:{type:null,required:!0}},setup(t,{emit:e}){const{currentLog:i}=t,s=u(""),n=b((()=>{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 _=r("v-icon"),v=r("v-button"),b=r("v-detail"),y=r("v-drawer"),w=A("tooltip");return o(),l(y,{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(v,{key:0,class:"ml-auto",onClick:f},{default:h((()=>[g(k(s.value)+" ",1),c(_,{name:"copy_all"})])),_:1})):d("v-if",!0)])),default:h((()=>[m("div",tr,[er,m("div",ir,[c(b,{label:"Payload",class:"payload"},{default:h((()=>[c(E(Ja),{data:t.currentLog.data.data.$trigger,virtual:"",onNodeClick:u[0]||(u[0]=t=>a("$trigger",t)),selectableType:"single"},null,8,["data"])])),_:1})]),m("div",sr,[(o(!0),p(C,null,I(E(n),(t=>(o(),p("div",{key:t.id,class:"step"},[m("div",nr,[m("span",{class:O(["dot",t.status])},null,2),T((o(),p("span",ar,[g(k(t.key)+" ",1),m("span",rr," "+k(t.operationType),1)])),[[w,t.key]])]),m("div",or,[t.options?(o(),l(b,{key:0,label:"Options"},{default:h((()=>[c(E(Ja),{data:t.options,virtual:""},null,8,["data"])])),_:2},1024)):d("v-if",!0),null!==t.data?(o(),l(b,{key:1,label:"Payload",class:"payload"},{default:h((()=>[c(E(Ja),{data:t.data,virtual:"",onNodeClick:e=>a(t.key,e),selectableType:"single"},null,8,["data","onNodeClick"])])),_:2},1024)):d("v-if",!0)])])))),128))])])])),_:1})}}});Zn("\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",{});Zn("\n.payload .vjs-value,\n.payload .vjs-key {\n cursor: pointer;\n}\n",{}),lr.__scopeId="data-v-2ded8f93",lr.__file="settingsmodule/src/components/displayFlowLogs.vue";const hr=t=>(f("data-v-231dc418"),t=t(),_(),t),cr={class:"px-5 w-full"},dr=["title"],ur=["title"],pr={class:"filters"},gr=hr((()=>m("h2",null,"Filter",-1))),fr=hr((()=>m("div",{class:"field-name"},"Flow",-1))),_r=hr((()=>m("div",{class:"field-name"},"From date",-1))),mr=hr((()=>m("div",{class:"field-name"},"To date",-1))),vr=hr((()=>m("div",{class:"field-name"},"Sorting order",-1)));var br=v({__name:"flowLogsExplorer",setup(t){const{useFlowsStore:s}=e(),n=i(),a=s(),p=u(),f=u([]),_=u(),v=u(),y=u(""),w=u("all"),A=u(),T=u("Descending"),S=u(!1);async function C(){S.value=!0;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]":_.value?_.value:void 0,"filter[_and][4][activity][timestamp][_lte]":v.value?v.value+"T23:59:59":void 0,"fields[0]":"*","fields[1]":"activity.*",limit:2e3,sort:"Descending"==T.value?["-activity.timestamp"]:["activity.timestamp"]}});f.value=t.data.data,S.value=!1}x((()=>{const t=new Date;t.setDate(t.getDate()-7),_.value=t.toISOString().split("T")[0],v.value=(new Date).toISOString().split("T")[0]}));const R=b((()=>{if(!y.value&&"all"==w.value)return f.value;let t=f.value;return"all"!=w.value&&(t=t.filter((t=>t.data.steps[t.data.steps.length-1].status==("error"==w.value?"reject":"resolve")))),y.value&&(t=f.value.filter((t=>{const e=t.data.data.$trigger;return JSON.stringify(e).toLowerCase().includes(y.value.toLowerCase())}))),t})),M=b((()=>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 L(t){A.value=t.item}function D(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"),b=r("private-view");return o(),l(b,{title:"Flow logs explorer"},{navigation:h((()=>[c(Wn)])),sidebar:h((()=>[m("div",pr,[gr,m("div",null,[fr,c(n,{items:E(M),showDeselect:"",modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=t=>p.value=t)},null,8,["items","modelValue"])]),m("div",null,[_r,_.value?(o(),l(Ea,{key:0,modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=t=>_.value=t),value:_.value},null,8,["modelValue","value"])):d("v-if",!0)]),m("div",null,[mr,v.value?(o(),l(Ea,{key:0,modelValue:v.value,"onUpdate:modelValue":e[2]||(e[2]=t=>v.value=t),value:v.value},null,8,["modelValue","value"])):d("v-if",!0)]),m("div",null,[vr,c(n,{modelValue:T.value,"onUpdate:modelValue":e[3]||(e[3]=t=>T.value=t),items:["Descending","Ascending"]},null,8,["modelValue"])]),c(a,{onClick:C,fullWidth:!0,loading:S.value},{default:h((()=>[g("Search")])),_:1},8,["loading"]),m("div",null,[g(" Input filter "),c(u,{modelValue:y.value,"onUpdate:modelValue":e[4]||(e[4]=t=>y.value=t),placeholder:"Input filter",class:"w-full"},null,8,["modelValue"])]),m("div",null,[g(" Status "),c(f,{modelValue:w.value,"onUpdate:modelValue":e[5]||(e[5]=t=>w.value=t),items:[{text:"All",value:"all"},{text:"Error",value:"error"},{text:"Success",value:"success"}]},null,8,["modelValue"])])]),A.value?(o(),l(lr,{key:0,onClose:e[6]||(e[6]=t=>A.value=null),currentLog:A.value},null,8,["currentLog"])):d("v-if",!0)])),default:h((()=>[m("div",cr,[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:E(R),"onClick:row":L},{"item.status":h((({item:t})=>[c(i,{name:D(t)?"error":"check_circle",class:O(["flowLogStatus",{error:D(t),success:!D(t)}])},null,8,["name","class"])])),"item.timestamp":h((({item:t})=>[g(k(new Date(t.activity.timestamp).toLocaleDateString()),1)])),"item.input":h((({item:t})=>[m("div",{title:JSON.stringify(t.data.data.$trigger,null,2)},k(t.data.data.$trigger),9,dr)])),"item.output":h((({item:t})=>[m("div",{title:JSON.stringify(P(t),null,2)},k(P(t)),9,ur)])),_:1},8,["items"])])])),_:1})}}});Zn("\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",{}),br.__scopeId="data-v-231dc418",br.__file="settingsmodule/src/pages/flowLogsExplorer.vue";var yr=s({id:"tta_settings",name:"Text to anything settings",icon:"text_fields",routes:[{path:"",redirect:"/tta_settings/templates"},{path:"templates",component:fa},{path:"settings",component:Sa},{path:"flowsLogExplorer",component:br}]}),wr=v({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=N("api"),n=u(0),a=u([]);return x((async()=>{y((()=>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"])}}});wr.__file="pdf/PDFOnlineTemplateSelector/src/interface.vue";var xr=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:wr,options:null,types:["string"]}),Ar=v({__name:"interface",props:["value"],emits:["input"],setup(t,{emit:e}){const i=t,s=N("api"),n=u(""),a=u([]);return x((async()=>{y((()=>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"])}}});Ar.__file="pdf/PDFTemplateSelector/src/interface.vue";var kr=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:Ar,options:null,types:["string"]});const Tr={style:{display:"none"}};var Sr=v({__name:"interface",props:{label:{type:String,required:!0},flow:{type:null,required:!0},primaryKey:{type:null,required:!0},disableOnEdit:{type:Boolean,required:!0}},setup(t){const s=t,n=i(),{useNotificationsStore:a}=e(),d=a(),f=u(!1),_=u(!1);function v(){const t=document.querySelector('.header-bar button:has([data-icon="check"])');_.value=!t||t.hasAttribute("disabled")}const y=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"disabled"===t.attributeName&&v()}))}));function w(){const t=document.querySelector('.header-bar button:has([data-icon="check"])');return!!t&&(y.observe(t,{attributes:!0,attributeFilter:["disabled"]}),v(),!0)}x((()=>{if(!w()){const t=setInterval((()=>{w()&&clearInterval(t)}),500);setTimeout((()=>clearInterval(t)),5e3)}})),F((()=>{y.disconnect()}));const S=b((()=>!!f.value||!!s.disableOnEdit&&!_.value));async function R(){var t;if(!S.value){f.value=!0;try{const e=await n.post("/flows/trigger/"+s.flow,{id:s.primaryKey});if("string"==typeof e.data)return window.open("/assets/"+e.data,"_blank"),void(f.value=!1);(null==(t=null==e?void 0:e.data)?void 0:t.message)&&await new Promise((t=>{var i;d.add({title:(null==(i=null==e?void 0:e.data)?void 0:i.title)||"TTA notification",text:e.data.message,dialog:!0,dismissAction:async()=>{t(!0)}})})),(null==e?void 0:e.data.redirectURL)&&("current"==e.data.redirectTarget?window.location=e.data.redirectURL:window.open(e.data.redirectURL)),f.value=!1}catch(t){}f.value=!1}}return(t,e)=>{const i=r("VButton"),n=A("tooltip");return o(),p(C,null,[T((o(),l(i,{onClick:R,loading:f.value,disabled:E(S)},{default:h((()=>[g(k(s.label),1)])),_:1},8,["loading","disabled"])),[[n,E(S)?"Please save first":null]]),m("div",Tr,[c(i,{loading:!0,disabled:!0})])],64)}}});Sr.__file="pdf/GeneratePDFFromTemplateInterface/src/interface.vue";var Er=n({id:"tta-download-interface",name:"Trigger flow button",icon:"sim_card_download",description:"Trigger a flow with a button, with support for downloading files. (Text to anything)",hideLabel:!0,hideLoader:!0,component:Sr,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:b((()=>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"}}},{field:"disableOnEdit",name:"Disable on Edit",type:"boolean",meta:{width:"full",interface:"boolean",options:{label:"Disable button if there are unsaved changes"}},schema:{default_value:!1}}]},types:["string"]});
|
|
2
2
|
/**
|
|
3
3
|
* @licstart The following is the entire license notice for the
|
|
4
4
|
* JavaScript code in this page
|