@nodefony/monitoring-bundle
Version:
Nodefony Framework Bundle Monitoring
2 lines • 700 kB
JavaScript
/*! For license information please see monitoring.js.LICENSE.txt */
var monitoring;(()=>{var __webpack_modules__={989:module=>{var t;window,t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){(function(t){e.exports=t.$=n(9)}).call(this,n(3))},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i<n.length;i++){var o=n[i],s=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=r.parseRtpMap(s),c=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?r.parseFmtp(c[0]):{},a.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(a.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),s=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,l=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));l.length>0&&l[0].length>1&&l[0][0]===c&&(t=l[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&c&&n.push({ssrc:c});var u=r.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=u}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var s=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},e.exports=r},function(e,t,n){"use strict";var r,i,o,s=n(17),a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function c(){o=!1}function l(e){if(e){if(e!==r){if(e.length!==a.length)throw new Error("Custom alphabet for shortid must be "+a.length+" unique characters. You submitted "+e.length+" characters: "+e);var t=e.split("").filter((function(e,t,n){return t!==n.lastIndexOf(e)}));if(t.length)throw new Error("Custom alphabet for shortid must be "+a.length+" unique characters. These characters were not unique: "+t.join(", "));r=e,c()}}else r!==a&&(r=a,c())}function u(){return o||(o=function(){r||l(a);for(var e,t=r.split(""),n=[],i=s.nextValue();t.length>0;)i=s.nextValue(),e=Math.floor(i*t.length),n.push(t.splice(e,1)[0]);return n.join("")}())}e.exports={get:function(){return r||a},characters:function(e){return l(e),r},seed:function(e){s.seed(e),i!==e&&(c(),i=e)},lookup:function(e){return u()[e]},shuffled:u}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(t){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";e.exports=function(){var e=/%%|%(\d+\$)?([\-+'#0 ]*)(\*\d+\$|\*|\d+)?(?:\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length>=t?"":new Array(1+t-e.length>>>0).join(n);return r?e+i:i+e},o=function(e,t,n,r,o,s){var a=r-e.length;return a>0&&(e=n||!o?i(e,r,s,n):[e.slice(0,t.length),i("",a,"0",!0),e.slice(t.length)].join("")),e},s=function(e,t,n,r,s,a,c){var l=e>>>0;return e=(n=n&&l&&{2:"0b",8:"0",16:"0x"}[t]||"")+i(l.toString(t),a||0,"0",!1),o(e,n,r,s,c)},a=function(e,t,n,r,i,s){return null!=r&&(e=e.slice(0,r)),o(e,"",t,n,i,s)},c=function(e,r,c,l,u,p){var h,f,d,g,y;if("%%"===e)return"%";var m,v=!1,b="",w=!1,x=!1,k=" ",S=c.length;for(m=0;m<S;m++)switch(c.charAt(m)){case" ":b=" ";break;case"+":b="+";break;case"-":v=!0;break;case"'":k=c.charAt(m+1);break;case"0":w=!0,k="0";break;case"#":x=!0}if((l=l?"*"===l?+t[n++]:"*"===l.charAt(0)?+t[l.slice(1,-1)]:+l:0)<0&&(l=-l,v=!0),!isFinite(l))throw new Error("sprintf: (minimum-)width must be finite");switch(u=u?"*"===u?+t[n++]:"*"===u.charAt(0)?+t[u.slice(1,-1)]:+u:"fFeE".indexOf(p)>-1?6:"d"===p?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],p){case"s":return a(y+"",v,l,u,w,k);case"c":return a(String.fromCharCode(+y),v,l,u,w);case"b":return s(y,2,x,v,l,u,w);case"o":return s(y,8,x,v,l,u,w);case"x":return s(y,16,x,v,l,u,w);case"X":return s(y,16,x,v,l,u,w).toUpperCase();case"u":return s(y,10,x,v,l,u,w);case"i":case"d":return h=+y||0,y=(f=(h=Math.round(h-h%1))<0?"-":b)+i(String(Math.abs(h)),u,"0",!1),o(y,f,v,l,w);case"e":case"E":case"f":case"F":case"g":case"G":return f=(h=+y)<0?"-":b,d=["toExponential","toFixed","toPrecision"]["efg".indexOf(p.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(p)%2],y=f+Math.abs(h)[d](u),o(y,f,v,l,w)[g]();default:return e}};return r.replace(e,c)}},function(e,t){e.exports=n(47)},function(e,t,n){e.exports=n(3)()},function(e,t,n){e.exports=function e(){const t={VERSION:"1.14.0"};return n(4)(t),n(5)(t),n(6)(t),n(8)(t),n(9)(t),n(10)(t),n(19)(t),n(20)(t),n(22)(t),n(23)(t),n(24)(t),n(25)(t),n(26)(t),n(27)(t),n(28)(t),t.exports.factory=e,t.exports}},function(e,t){e.exports=function(e){"use strict";function t(t,n){if(t.template.options.rethrow)throw"string"==typeof n&&(n=new e.Error(n)),"TwigException"!==n.type||n.file||(n.file=t.template.id),n;if(e.log.error("Error parsing twig template "+t.template.id+": "),n.stack?e.log.error(n.stack):e.log.error(n.toString()),e.debug)return n.toString()}return e.trace=!1,e.debug=!1,e.cache=!0,e.noop=function(){},e.merge=function(e,t,n){return Object.keys(t).forEach((r=>{(!n||r in e)&&(e[r]=t[r])})),e},e.Error=function(e,t){this.message=e,this.name="TwigException",this.type="TwigException",this.file=t},e.Error.prototype.toString=function(){return this.name+": "+this.message},e.log={trace(...t){e.trace&&console&&console.log(Array.prototype.slice.call(t))},debug(...t){e.debug&&console&&console.log(Array.prototype.slice.call(t))}},"undefined"==typeof console?e.log.error=function(){}:void 0!==console.error?e.log.error=function(...e){console.error(...e)}:void 0!==console.log&&(e.log.error=function(...e){console.log(...e)}),e.token={},e.token.type={output:"output",logic:"logic",comment:"comment",raw:"raw",outputWhitespacePre:"output_whitespace_pre",outputWhitespacePost:"output_whitespace_post",outputWhitespaceBoth:"output_whitespace_both",logicWhitespacePre:"logic_whitespace_pre",logicWhitespacePost:"logic_whitespace_post",logicWhitespaceBoth:"logic_whitespace_both"},e.token.definitions=[{type:e.token.type.raw,open:"{% raw %}",close:"{% endraw %}"},{type:e.token.type.raw,open:"{% verbatim %}",close:"{% endverbatim %}"},{type:e.token.type.outputWhitespacePre,open:"{{-",close:"}}"},{type:e.token.type.outputWhitespacePost,open:"{{",close:"-}}"},{type:e.token.type.outputWhitespaceBoth,open:"{{-",close:"-}}"},{type:e.token.type.logicWhitespacePre,open:"{%-",close:"%}"},{type:e.token.type.logicWhitespacePost,open:"{%",close:"-%}"},{type:e.token.type.logicWhitespaceBoth,open:"{%-",close:"-%}"},{type:e.token.type.output,open:"{{",close:"}}"},{type:e.token.type.logic,open:"{%",close:"%}"},{type:e.token.type.comment,open:"{#",close:"#}"}],e.token.strings=['"',"'"],e.token.findStart=function(t){const n={position:null,def:null};let r=null;const i=e.token.definitions.length;let o,s,a,c;for(o=0;o<i;o++)s=e.token.definitions[o],a=t.indexOf(s.open),c=t.indexOf(s.close),e.log.trace("Twig.token.findStart: ","Searching for ",s.open," found at ",a),a>=0&&s.open.length!==s.close.length&&c<0||(a>=0&&(null===n.position||a<n.position)?(n.position=a,n.def=s,r=c):a>=0&&null!==n.position&&a===n.position&&(s.open.length>n.def.open.length?(n.position=a,n.def=s,r=c):s.open.length===n.def.open.length&&(s.close.length,n.def.close.length,c>=0&&c<r&&(n.position=a,n.def=s,r=c))));return n},e.token.findEnd=function(t,n,r){let i,o,s=null,a=!1,c=0,l=null,u=null,p=null,h=null,f=null,d=null;for(;!a;){if(l=null,u=null,p=t.indexOf(n.close,c),!(p>=0))throw new e.Error("Unable to find closing bracket '"+n.close+"' opened near template position "+r);if(s=p,a=!0,n.type===e.token.type.comment)break;if(n.type===e.token.type.raw)break;for(o=e.token.strings.length,i=0;i<o;i+=1)f=t.indexOf(e.token.strings[i],c),f>0&&f<p&&(null===l||f<l)&&(l=f,u=e.token.strings[i]);if(null!==l)for(h=l+1,s=null,a=!1;;){if(d=t.indexOf(u,h),d<0)throw e.Error("Unclosed string in template");if("\\"!==t.substr(d-1,1)){c=d+1;break}h=d+1}}return s},e.tokenize=function(t){const n=[];let r=0,i=null,o=null;for(;t.length>0;)if(i=e.token.findStart(t),e.log.trace("Twig.tokenize: ","Found token: ",i),null===i.position)n.push({type:e.token.type.raw,value:t}),t="";else{if(i.position>0&&n.push({type:e.token.type.raw,value:t.substring(0,i.position)}),t=t.substr(i.position+i.def.open.length),r+=i.position+i.def.open.length,o=e.token.findEnd(t,i.def,r),e.log.trace("Twig.tokenize: ","Token ends at ",o),n.push({type:i.def.type,value:t.substring(0,o).trim()}),"\n"===t.substr(o+i.def.close.length,1))switch(i.def.type){case"logic_whitespace_pre":case"logic_whitespace_post":case"logic_whitespace_both":case"logic":o+=1}t=t.substr(o+i.def.close.length),r+=o+i.def.close.length}return n},e.compile=function(t){const n=this;try{const r=[],i=[];let o=[],s=null,a=null,c=null,l=null,u=null,p=null,h=null,f=null,d=null,g=null,y=null,m=null;const v=function(t){e.expression.compile.call(n,t),i.length>0?o.push(t):r.push(t)},b=function(t){if(a=e.logic.compile.call(n,t),g=a.type,y=e.logic.handler[g].open,m=e.logic.handler[g].next,e.log.trace("Twig.compile: ","Compiled logic token to ",a," next is: ",m," open is : ",y),void 0!==y&&!y){if(l=i.pop(),h=e.logic.handler[l.type],h.next.indexOf(g)<0)throw new Error(g+" not expected after a "+l.type);l.output=l.output||[],l.output=l.output.concat(o),o=[],d={type:e.token.type.logic,token:l},i.length>0?o.push(d):r.push(d)}void 0!==m&&m.length>0?(e.log.trace("Twig.compile: ","Pushing ",a," to logic stack."),i.length>0&&(l=i.pop(),l.output=l.output||[],l.output=l.output.concat(o),i.push(l),o=[]),i.push(a)):void 0!==y&&y&&(d={type:e.token.type.logic,token:a},i.length>0?o.push(d):r.push(d))};for(;t.length>0;){switch(s=t.shift(),u=r[r.length-1],p=o[o.length-1],f=t[0],e.log.trace("Compiling token ",s),s.type){case e.token.type.raw:i.length>0?o.push(s):r.push(s);break;case e.token.type.logic:b.call(n,s);break;case e.token.type.comment:break;case e.token.type.output:v.call(n,s);break;case e.token.type.logicWhitespacePre:case e.token.type.logicWhitespacePost:case e.token.type.logicWhitespaceBoth:case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:switch(s.type!==e.token.type.outputWhitespacePost&&s.type!==e.token.type.logicWhitespacePost&&(u&&u.type===e.token.type.raw&&(r.pop(),null===u.value.match(/^\s*$/)&&(u.value=u.value.trim(),r.push(u))),p&&p.type===e.token.type.raw&&(o.pop(),null===p.value.match(/^\s*$/)&&(p.value=p.value.trim(),o.push(p)))),s.type){case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:v.call(n,s);break;case e.token.type.logicWhitespacePre:case e.token.type.logicWhitespacePost:case e.token.type.logicWhitespaceBoth:b.call(n,s)}s.type!==e.token.type.outputWhitespacePre&&s.type!==e.token.type.logicWhitespacePre&&f&&f.type===e.token.type.raw&&(t.shift(),null===f.value.match(/^\s*$/)&&(f.value=f.value.trim(),t.unshift(f)))}e.log.trace("Twig.compile: "," Output: ",r," Logic Stack: ",i," Pending Output: ",o)}if(i.length>0)throw c=i.pop(),new Error("Unable to find an end tag for "+c.type+", expecting one of "+c.next);return r}catch(t){if(n.options.rethrow)throw"TwigException"!==t.type||t.file||(t.file=n.id),t;e.log.error("Error compiling twig template "+n.id+": "),t.stack?e.log.error(t.stack):e.log.error(t.toString())}},e.prepare=function(t){e.log.debug("Twig.prepare: ","Tokenizing ",t);const n=e.tokenize.call(this,t);e.log.debug("Twig.prepare: ","Compiling ",n);const r=e.compile.call(this,n);return e.log.debug("Twig.prepare: ","Compiled ",r),r},e.output=function(t){const{autoescape:n}=this.options;if(!n)return t.join("");const r="string"==typeof n?n:"html",i=t.map((t=>(!t||!0===t.twigMarkup||t.twigMarkup===r||"html"===r&&"html_attr"===t.twigMarkup||(t=e.filters.escape(t,[r])),t)));return 0===i.length?"":new e.Markup(i.join(""),!0)},e.Templates={loaders:{},parsers:{},registry:{}},e.validateId=function(t){if("prototype"===t)throw new e.Error(t+" is not a valid twig identifier");if(e.cache&&Object.hasOwnProperty.call(e.Templates.registry,t))throw new e.Error("There is already a template with the ID "+t);return!0},e.Templates.registerLoader=function(t,n,r){if("function"!=typeof n)throw new e.Error("Unable to add loader for "+t+": Invalid function reference given.");r&&(n=n.bind(r)),this.loaders[t]=n},e.Templates.unRegisterLoader=function(e){this.isRegisteredLoader(e)&&delete this.loaders[e]},e.Templates.isRegisteredLoader=function(e){return Object.hasOwnProperty.call(this.loaders,e)},e.Templates.registerParser=function(t,n,r){if("function"!=typeof n)throw new e.Error("Unable to add parser for "+t+": Invalid function regerence given.");r&&(n=n.bind(r)),this.parsers[t]=n},e.Templates.unRegisterParser=function(e){this.isRegisteredParser(e)&&delete this.parsers[e]},e.Templates.isRegisteredParser=function(e){return Object.hasOwnProperty.call(this.parsers,e)},e.Templates.save=function(t){if(void 0===t.id)throw new e.Error("Unable to save template with no id");e.Templates.registry[t.id]=t},e.Templates.load=function(t){return Object.hasOwnProperty.call(e.Templates.registry,t)?e.Templates.registry[t]:null},e.Templates.loadRemote=function(t,n,r,i){const o=void 0===n.id?t:n.id,s=e.Templates.registry[o];return e.cache&&void 0!==s?("function"==typeof r&&r(s),s):(n.parser=n.parser||"twig",n.id=o,void 0===n.async&&(n.async=!0),(this.loaders[n.method]||this.loaders.fs).call(this,t,n,r,i))},e.Block=function(e,t){this.template=e,this.token=t},e.Block.prototype.render=function(t,n){const r=t.template;let i;return t.template=this.template,i=this.token.expression?e.expression.parseAsync.call(t,this.token.output,n):t.parseAsync(this.token.output,n),i.then((r=>e.expression.parseAsync.call(t,{type:e.expression.type.string,value:r},n))).then((e=>(t.template=r,e)))},e.ParseState=function(e,t){this.renderedBlocks={},this.overrideBlocks=void 0===t?{}:t,this.context={},this.macros={},this.nestingStack=[],this.template=e},e.ParseState.prototype.getBlock=function(e,t){let n;return!0!==t&&(n=this.overrideBlocks[e]),void 0===n&&(n=this.template.getBlock(e,t)),void 0===n&&null!==this.template.parentTemplate&&(n=this.template.parentTemplate.getBlock(e)),n},e.ParseState.prototype.getBlocks=function(e){let t={};return!1!==e&&null!==this.template.parentTemplate&&this.template.parentTemplate!==this.template&&(t=this.template.parentTemplate.getBlocks()),t={...t,...this.template.getBlocks(),...this.overrideBlocks},t},e.ParseState.prototype.getNestingStackToken=function(e){let t;return this.nestingStack.forEach((n=>{void 0===t&&n.type===e&&(t=n)})),t},e.ParseState.prototype.parse=function(n,r,i){const o=this;let s=[],a=null,c=!0,l=null,u=!0;function p(e){s.push(e)}function h(e){void 0!==e.chain&&(u=e.chain),void 0!==e.context&&(o.context=e.context),void 0!==e.output&&s.push(e.output)}if(r&&(o.context=r),l=e.async.forEach(n,(t=>{switch(e.log.debug("Twig.ParseState.parse: ","Parsing token: ",t),t.type){case e.token.type.raw:s.push(e.filters.raw(t.value));break;case e.token.type.logic:return e.logic.parseAsync.call(o,t.token,o.context,u).then(h);case e.token.type.comment:break;case e.token.type.outputWhitespacePre:case e.token.type.outputWhitespacePost:case e.token.type.outputWhitespaceBoth:case e.token.type.output:return e.log.debug("Twig.ParseState.parse: ","Output token: ",t.stack),e.expression.parseAsync.call(o,t.stack,o.context).then(p)}})).then((()=>(s=e.output.call(o.template,s),c=!1,s))).catch((e=>{i&&t(o,e),a=e})),i)return l;if(null!==a)return t(o,a);if(c)throw new e.Error("You are using Twig.js in sync mode in combination with async extensions.");return s},e.Template=function(t){const{data:n,id:r,base:i,path:o,url:s,name:a,method:c,options:l}=t;this.base=i,this.blocks={defined:{},imported:{}},this.id=r,this.method=c,this.name=a,this.options=l,this.parentTemplate=null,this.path=o,this.url=s,function(e,t){const n=Object.prototype.toString.call(t).slice(8,-1);return null!=t&&"String"===n}(0,n)?this.tokens=e.prepare.call(this,n):this.tokens=n,void 0!==r&&e.Templates.save(this)},e.Template.prototype.getBlock=function(e,t){let n;return!0!==t&&(n=this.blocks.defined[e]),void 0===n&&(n=this.blocks.imported[e]),n},e.Template.prototype.getBlocks=function(){let e={};return e={...e,...this.blocks.imported,...this.blocks.defined},e},e.Template.prototype.render=function(t,n,r){const i=this;return n=n||{},e.async.potentiallyAsync(i,r,(()=>{const r=new e.ParseState(i,n.blocks);return r.parseAsync(i.tokens,t).then((t=>{let o,s;return null!==i.parentTemplate?(i.options.allowInlineIncludes&&(o=e.Templates.load(i.parentTemplate),o&&(o.options=i.options)),o||(s=e.path.parsePath(i,i.parentTemplate),o=e.Templates.loadRemote(s,{method:i.getLoaderMethod(),base:i.base,async:!1,id:s,options:i.options})),i.parentTemplate=o,i.parentTemplate.renderAsync(r.context,{blocks:r.getBlocks(!1),isInclude:!0})):!0===n.isInclude?t:t.valueOf()}))}))},e.Template.prototype.importFile=function(t){let n,r=null;if(!this.url&&this.options.allowInlineIncludes){if(t=this.path?e.path.parsePath(this,t):t,n=e.Templates.load(t),!n&&(n=e.Templates.loadRemote(r,{id:t,method:this.getLoaderMethod(),async:!1,path:t,options:this.options}),!n))throw new e.Error("Unable to find the template "+t);return n.options=this.options,n}return r=e.path.parsePath(this,t),n=e.Templates.loadRemote(r,{method:this.getLoaderMethod(),base:this.base,async:!1,options:this.options,id:r}),n},e.Template.prototype.getLoaderMethod=function(){return this.path?"fs":this.url?"ajax":this.method||"fs"},e.Template.prototype.compile=function(t){return e.compiler.compile(this,t)},e.Markup=function(e,t){if("string"!=typeof e||0===e.length)return e;const n=new String(e);return n.twigMarkup=void 0===t||t,n},e}},function(e,t){e.exports=function(e){return e.compiler={module:{}},e.compiler.compile=function(t,n){const r=JSON.stringify(t.tokens),{id:i}=t;let o=null;if(n.module){if(void 0===e.compiler.module[n.module])throw new e.Error("Unable to find module type "+n.module);o=e.compiler.module[n.module](i,r,n.twig)}else o=e.compiler.wrap(i,r);return o},e.compiler.module={amd:(t,n,r)=>'define(["'+r+'"], function (Twig) {\n\tvar twig, templates;\ntwig = Twig.twig;\ntemplates = '+e.compiler.wrap(t,n)+"\n\treturn templates;\n});",node:(t,n)=>'var twig = require("twig").twig;\nexports.template = '+e.compiler.wrap(t,n),cjs2:(t,n,r)=>'module.declare([{ twig: "'+r+'" }], function (require, exports, module) {\n\tvar twig = require("twig").twig;\n\texports.template = '+e.compiler.wrap(t,n)+"\n});"},e.compiler.wrap=function(e,t){return'twig({id:"'+e.replace('"','\\"')+'", data:'+t+", precompiled: true});\n"},e}},function(e,t,n){e.exports=function(e){"use strict";function t(t,n,r){return n?e.expression.parseAsync.call(t,n,r):e.Promise.resolve(!1)}for(e.expression={},n(7)(e),e.expression.reservedWords=["true","false","null","TRUE","FALSE","NULL","_context","and","b-and","or","b-or","b-xor","in","not in","if","matches","starts","ends","with"],e.expression.type={comma:"Twig.expression.type.comma",operator:{unary:"Twig.expression.type.operator.unary",binary:"Twig.expression.type.operator.binary"},string:"Twig.expression.type.string",bool:"Twig.expression.type.bool",slice:"Twig.expression.type.slice",array:{start:"Twig.expression.type.array.start",end:"Twig.expression.type.array.end"},object:{start:"Twig.expression.type.object.start",end:"Twig.expression.type.object.end"},parameter:{start:"Twig.expression.type.parameter.start",end:"Twig.expression.type.parameter.end"},subexpression:{start:"Twig.expression.type.subexpression.start",end:"Twig.expression.type.subexpression.end"},key:{period:"Twig.expression.type.key.period",brackets:"Twig.expression.type.key.brackets"},filter:"Twig.expression.type.filter",_function:"Twig.expression.type._function",variable:"Twig.expression.type.variable",number:"Twig.expression.type.number",_null:"Twig.expression.type.null",context:"Twig.expression.type.context",test:"Twig.expression.type.test"},e.expression.set={operations:[e.expression.type.filter,e.expression.type.operator.unary,e.expression.type.operator.binary,e.expression.type.array.end,e.expression.type.object.end,e.expression.type.parameter.end,e.expression.type.subexpression.end,e.expression.type.comma,e.expression.type.test],expressions:[e.expression.type._function,e.expression.type.bool,e.expression.type.string,e.expression.type.variable,e.expression.type.number,e.expression.type._null,e.expression.type.context,e.expression.type.parameter.start,e.expression.type.array.start,e.expression.type.object.start,e.expression.type.subexpression.start,e.expression.type.operator.unary]},e.expression.set.operationsExtended=e.expression.set.operations.concat([e.expression.type.key.period,e.expression.type.key.brackets,e.expression.type.slice]),e.expression.fn={compile:{push(e,t,n){n.push(e)},pushBoth(e,t,n){n.push(e),t.push(e)}},parse:{push(e,t){t.push(e)},pushValue(e,t){t.push(e.value)}}},e.expression.definitions=[{type:e.expression.type.test,regex:/^is\s+(not)?\s*([a-zA-Z_]\w*(\s?as)?)/,next:e.expression.set.operations.concat([e.expression.type.parameter.start]),compile(e,t,n){e.filter=e.match[2],e.modifier=e.match[1],delete e.match,delete e.value,n.push(e)},parse(n,r,i){const o=r.pop();return t(this,n.params,i).then((t=>{const i=e.test(n.filter,o,t);"not"===n.modifier?r.push(!i):r.push(i)}))}},{type:e.expression.type.comma,regex:/^,/,next:e.expression.set.expressions.concat([e.expression.type.array.end,e.expression.type.object.end]),compile(t,n,r){let i,o=n.length-1;for(delete t.match,delete t.value;o>=0;o--){if(i=n.pop(),i.type===e.expression.type.object.start||i.type===e.expression.type.parameter.start||i.type===e.expression.type.array.start){n.push(i);break}r.push(i)}r.push(t)}},{type:e.expression.type.number,regex:/^-?\d+(\.\d+)?/,next:e.expression.set.operations,compile(e,t,n){e.value=Number(e.value),n.push(e)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.operator.binary,regex:/(^\?\?|^\?:|^(b-and)|^(b-or)|^(b-xor)|^[+\-~%?]|^[:](?!\d\])|^[!=]==?|^[!<>]=?|^\*\*?|^\/\/?|^(and)[(|\s+]|^(or)[(|\s+]|^(in)[(|\s+]|^(not in)[(|\s+]|^(matches)|^(starts with)|^(ends with)|^\.\.)/,next:e.expression.set.expressions,transform(e,t){switch(e[0]){case"and(":case"or(":case"in(":case"not in(":return t[t.length-1].value=e[2],e[0];default:return""}},compile(t,n,r){delete t.match,t.value=t.value.trim();const{value:i}=t,o=e.expression.operator.lookup(i,t);for(e.log.trace("Twig.expression.compile: ","Operator: ",o," from ",i);n.length>0&&(n[n.length-1].type===e.expression.type.operator.unary||n[n.length-1].type===e.expression.type.operator.binary)&&(o.associativity===e.expression.operator.leftToRight&&o.precidence>=n[n.length-1].precidence||o.associativity===e.expression.operator.rightToLeft&&o.precidence>n[n.length-1].precidence);){const e=n.pop();r.push(e)}if(":"===i)if(n[n.length-1]&&"?"===n[n.length-1].value);else{const n=r.pop();if(n.type===e.expression.type.string||n.type===e.expression.type.variable)t.key=n.value;else if(n.type===e.expression.type.number)t.key=n.value.toString();else{if(!n.expression||n.type!==e.expression.type.parameter.end&&n.type!==e.expression.type.subexpression.end)throw new e.Error("Unexpected value before ':' of "+n.type+" = "+n.value);t.params=n.params}r.push(t)}else n.push(o)},parse(t,n,r){const i=this;if(t.key)n.push(t);else{if(t.params)return e.expression.parseAsync.call(i,t.params,r).then((e=>{t.key=e,n.push(t),r.loop||delete t.params}));e.expression.operator.parse(t.value,n)}}},{type:e.expression.type.operator.unary,regex:/(^not\s+)/,next:e.expression.set.expressions,compile(t,n,r){delete t.match,t.value=t.value.trim();const{value:i}=t,o=e.expression.operator.lookup(i,t);for(e.log.trace("Twig.expression.compile: ","Operator: ",o," from ",i);n.length>0&&(n[n.length-1].type===e.expression.type.operator.unary||n[n.length-1].type===e.expression.type.operator.binary)&&(o.associativity===e.expression.operator.leftToRight&&o.precidence>=n[n.length-1].precidence||o.associativity===e.expression.operator.rightToLeft&&o.precidence>n[n.length-1].precidence);){const e=n.pop();r.push(e)}n.push(o)},parse(t,n){e.expression.operator.parse(t.value,n)}},{type:e.expression.type.string,regex:/^(["'])(?:(?=(\\?))\2[\s\S])*?\1/,next:e.expression.set.operationsExtended,compile(t,n,r){let{value:i}=t;delete t.match,i='"'===i.substring(0,1)?i.replace('\\"','"'):i.replace("\\'","'"),t.value=i.substring(1,i.length-1).replace(/\\n/g,"\n").replace(/\\r/g,"\r"),e.log.trace("Twig.expression.compile: ","String value: ",t.value),r.push(t)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.subexpression.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.subexpression.end]),compile(e,t,n){e.value="(",n.push(e),t.push(e)},parse:e.expression.fn.parse.push},{type:e.expression.type.subexpression.end,regex:/^\)/,next:e.expression.set.operationsExtended,validate(t,n){let r=n.length-1,i=!1,o=!1,s=0;for(;!i&&r>=0;){const t=n[r];i=t.type===e.expression.type.subexpression.start,i&&o&&(o=!1,i=!1),t.type===e.expression.type.parameter.start?s++:t.type===e.expression.type.parameter.end?s--:t.type===e.expression.type.subexpression.end&&(o=!0),r--}return i&&0===s},compile(t,n,r){let i;const o=t;for(i=n.pop();n.length>0&&i.type!==e.expression.type.subexpression.start;)r.push(i),i=n.pop();const s=[];for(;t.type!==e.expression.type.subexpression.start;)s.unshift(t),t=r.pop();s.unshift(t),i=n[n.length-1],void 0===i||i.type!==e.expression.type._function&&i.type!==e.expression.type.filter&&i.type!==e.expression.type.test&&i.type!==e.expression.type.key.brackets?(o.expression=!0,s.pop(),s.shift(),o.params=s,r.push(o)):(o.expression=!1,i.params=s)},parse(t,n,r){if(t.expression)return e.expression.parseAsync.call(this,t.params,r).then((e=>{n.push(e)}));throw new e.Error("Unexpected subexpression end when token is not marked as an expression")}},{type:e.expression.type.parameter.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.parameter.end]),validate(t,n){const r=n[n.length-1];return r&&e.expression.reservedWords.indexOf(r.value.trim())<0},compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.parameter.end,regex:/^\)/,next:e.expression.set.operationsExtended,compile(t,n,r){let i;const o=t;for(i=n.pop();n.length>0&&i.type!==e.expression.type.parameter.start;)r.push(i),i=n.pop();const s=[];for(;t.type!==e.expression.type.parameter.start;)s.unshift(t),t=r.pop();s.unshift(t),void 0===(t=r[r.length-1])||t.type!==e.expression.type._function&&t.type!==e.expression.type.filter&&t.type!==e.expression.type.test&&t.type!==e.expression.type.key.brackets?(o.expression=!0,s.pop(),s.shift(),o.params=s,r.push(o)):(o.expression=!1,t.params=s)},parse(t,n,r){const i=[];let o=!1,s=null;if(t.expression)return e.expression.parseAsync.call(this,t.params,r).then((e=>{n.push(e)}));for(;n.length>0;){if(s=n.pop(),s&&s.type&&s.type===e.expression.type.parameter.start){o=!0;break}i.unshift(s)}if(!o)throw new e.Error("Expected end of parameter set.");n.push(i)}},{type:e.expression.type.slice,regex:/^\[(\d*:\d*)\]/,next:e.expression.set.operationsExtended,compile(e,t,n){const r=e.match[1].split(":"),i=r[0]?parseInt(r[0],10):void 0,o=r[1]?parseInt(r[1],10):void 0;e.value="slice",e.params=[i,o],o||(e.params=[i]),n.push(e)},parse(t,n){const r=n.pop(),{params:i}=t;n.push(e.filter.call(this,t.value,r,i))}},{type:e.expression.type.array.start,regex:/^\[/,next:e.expression.set.expressions.concat([e.expression.type.array.end]),compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.array.end,regex:/^\]/,next:e.expression.set.operationsExtended,compile(t,n,r){let i,o=n.length-1;for(;o>=0&&(i=n.pop(),i.type!==e.expression.type.array.start);o--)r.push(i);r.push(t)},parse(t,n){const r=[];let i=!1,o=null;for(;n.length>0;){if(o=n.pop(),o.type&&o.type===e.expression.type.array.start){i=!0;break}r.unshift(o)}if(!i)throw new e.Error("Expected end of array.");n.push(r)}},{type:e.expression.type.object.start,regex:/^\{/,next:e.expression.set.expressions.concat([e.expression.type.object.end]),compile:e.expression.fn.compile.pushBoth,parse:e.expression.fn.parse.push},{type:e.expression.type.object.end,regex:/^\}/,next:e.expression.set.operationsExtended,compile(t,n,r){let i,o=n.length-1;for(;o>=0&&(i=n.pop(),!i||i.type!==e.expression.type.object.start);o--)r.push(i);r.push(t)},parse(t,n){const r={};let i=!1,o=null,s=!1,a=null;for(;n.length>0;){if(o=n.pop(),o&&o.type&&o.type===e.expression.type.object.start){i=!0;break}if(o&&o.type&&(o.type===e.expression.type.operator.binary||o.type===e.expression.type.operator.unary)&&o.key){if(!s)throw new e.Error("Missing value for key '"+o.key+"' in object definition.");r[o.key]=a,void 0===r._keys&&(r._keys=[]),r._keys.unshift(o.key),a=null,s=!1}else s=!0,a=o}if(!i)throw new e.Error("Unexpected end of object.");n.push(r)}},{type:e.expression.type.filter,regex:/^\|\s?([a-zA-Z_][a-zA-Z0-9_-]*)/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile(e,t,n){e.value=e.match[1],n.push(e)},parse(n,r,i){const o=r.pop(),s=this;return t(s,n.params,i).then((t=>e.filter.call(s,n.value,o,t))).then((e=>{r.push(e)}))}},{type:e.expression.type._function,regex:/^([a-zA-Z_]\w*)\s*\(/,next:e.expression.type.parameter.start,validate:t=>t[1]&&e.expression.reservedWords.indexOf(t[1])<0,transform:()=>"(",compile(e,t,n){const r=e.match[1];e.fn=r,delete e.match,delete e.value,n.push(e)},parse(n,r,i){const o=this,{fn:s}=n;let a;return t(o,n.params,i).then((t=>{if(e.functions[s])a=e.functions[s].apply(o,t);else{if("function"!=typeof i[s])throw new e.Error(s+" function does not exist and is not defined in the context");a=i[s](...t)}return a})).then((e=>{r.push(e)}))}},{type:e.expression.type.variable,regex:/^[a-zA-Z_]\w*/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,validate:t=>e.expression.reservedWords.indexOf(t[0])<0,parse(t,n,r){const i=this;return e.expression.resolveAsync.call(i,r[t.value],r).then((r=>{if(i.template.options.strictVariables&&void 0===r)throw new e.Error('Variable "'+t.value+'" does not exist.');n.push(r)}))}},{type:e.expression.type.key.period,regex:/^\.(\w+)/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile(e,t,n){e.key=e.match[1],delete e.match,delete e.value,n.push(e)},parse(n,r,i,o){const s=this,{key:a}=n,c=r.pop();let l;if(c&&!Object.prototype.hasOwnProperty.call(c,a)&&s.template.options.strictVariables)throw Object.keys(c).length>0?new e.Error('Key "'+a+'" for object with keys "'+Object.keys(c).join(", ")+'" does not exist.'):new e.Error('Key "'+a+'" does not exist as the object is empty.');return t(s,n.params,i).then((t=>{if(null==c)l=void 0;else{const e=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)};l="object"==typeof c&&a in c?c[a]:c["get"+e(a)]?c["get"+e(a)]:c["is"+e(a)]?c["is"+e(a)]:void 0}return e.expression.resolveAsync.call(s,l,i,t,o,c)})).then((e=>{r.push(e)}))}},{type:e.expression.type.key.brackets,regex:/^\[([^\]:]*)\]/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile(t,n,r){const i=t.match[1];delete t.value,delete t.match,t.stack=e.expression.compile({value:i}).stack,r.push(t)},parse(n,r,i,o){const s=this;let a,c,l=null;return t(s,n.params,i).then((t=>(l=t,e.expression.parseAsync.call(s,n.stack,i)))).then((t=>{if(a=r.pop(),a&&!Object.prototype.hasOwnProperty.call(a,t)&&s.template.options.strictVariables){const n=Object.keys(a);throw n.length>0?new e.Error('Key "'+t+'" for array with keys "'+n.join(", ")+'" does not exist.'):new e.Error('Key "'+t+'" does not exist as the array is empty.')}return null==a?null:(c="object"==typeof a&&t in a?a[t]:null,e.expression.resolveAsync.call(s,c,a,l,o))})).then((e=>{r.push(e)}))}},{type:e.expression.type._null,regex:/^(null|NULL|none|NONE)/,next:e.expression.set.operations,compile(e,t,n){delete e.match,e.value=null,n.push(e)},parse:e.expression.fn.parse.pushValue},{type:e.expression.type.context,regex:/^_context/,next:e.expression.set.operationsExtended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,parse(e,t,n){t.push(n)}},{type:e.expression.type.bool,regex:/^(true|TRUE|false|FALSE)/,next:e.expression.set.operations,compile(e,t,n){e.value="true"===e.match[0].toLowerCase(),delete e.match,n.push(e)},parse:e.expression.fn.parse.pushValue}],e.expression.resolveAsync=function(t,n,r,i,o){const s=this;if("function"!=typeof t)return e.Promise.resolve(t);let a=e.Promise.resolve(r);if(i&&i.type===e.expression.type.parameter.end){const t=!0;a=a.then((()=>i.params&&e.expression.parseAsync.call(s,i.params,n,t))).then((e=>(i.cleanup=!0,e)))}return a.then((e=>t.apply(o||n,e||[])))},e.expression.resolve=function(t,n,r,i,o){return e.async.potentiallyAsync(this,!1,(function(){return e.expression.resolveAsync.call(this,t,n,r,i,o)}))},e.expression.handler={},e.expression.extendType=function(t){e.expression.type[t]="Twig.expression.type."+t},e.expression.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);e.expression.handler[t.type]=t};e.expression.definitions.length>0;)e.expression.extend(e.expression.definitions.shift());return e.expression.tokenize=function(t){const n=[];let r,i,o,s,a,c=0,l=null,u=[];const p=function(...t){let i=arguments.length-2;const o=new Array(i);for(;i-- >0;)o[i]=t[i];if(e.log.trace("Twig.expression.tokenize","Matched a ",r," regular expression of ",o),l&&l.indexOf(r)<0)return u.push(r+" cannot follow a "+n[n.length-1].type+" at template:"+c+" near '"+o[0].substring(0,20)+"...'"),o[0];const p=e.expression.handler[r];return p.validate&&!p.validate(o,n)?o[0]:(u=[],n.push({type:r,value:o[0],match:o}),a=!0,l=s,c+=o[0].length,p.transform?p.transform(o,n):"")};for(e.log.debug("Twig.expression.tokenize","Tokenizing expression ",t);t.length>0;){for(r in t=t.trim(),e.expression.handler)if(Object.hasOwnProperty.call(e.expression.handler,r)){if(s=e.expression.handler[r].next,i=e.expression.handler[r].regex,e.log.trace("Checking type ",r," on ",t),a=!1,Array.isArray(i))for(o=i.length;o-- >0;)t=t.replace(i[o],p);else t=t.replace(i,p);if(a)break}if(!a)throw u.length>0?new e.Error(u.join(" OR ")):new e.Error("Unable to parse '"+t+"' at template position"+c)}return e.log.trace("Twig.expression.tokenize","Tokenized to ",n),n},e.expression.compile=function(t){const n=t.value,r=e.expression.tokenize(n);let i=null;const o=[],s=[];let a=null;for(e.log.trace("Twig.expression.compile: ","Compiling ",n);r.length>0;)i=r.shift(),a=e.expression.handler[i.type],e.log.trace("Twig.expression.compile: ","Compiling ",i),a.compile(i,s,o),e.log.trace("Twig.expression.compile: ","Stack is",s),e.log.trace("Twig.expression.compile: ","Output is",o);for(;s.length>0;)o.push(s.pop());return e.log.trace("Twig.expression.compile: ","Final output is",o),t.stack=o,delete t.value,t},e.expression.parse=function(t,n,r,i){const o=this;Array.isArray(t)||(t=[t]);const s=[],a=[],c=e.expression.type.operator.binary;return e.async.potentiallyAsync(o,i,(()=>e.async.forEach(t,((r,i)=>{let l,u=null,p=null;if(!r.cleanup)return t.length>i+1&&(p=t[i+1]),u=e.expression.handler[r.type],u.parse&&(l=u.parse.call(o,r,s,n,p)),r.type===c&&n.loop&&a.push(r),l})).then((()=>{let e=a.length,t=null;for(;e-- >0;)t=a[e],t.params&&t.key&&delete t.key;if(r){const e=s.splice(0);s.push(e)}return s.pop()}))))},e}},function(e,t){e.exports=function(e){"use strict";e.expression.operator={leftToRight:"leftToRight",rightToLeft:"rightToLeft"};const t=function(e,t){if(null==t)return null;if(void 0!==t.indexOf)return(e===t||""!==e)&&t.indexOf(e)>-1;let n;for(n in t)if(Object.hasOwnProperty.call(t,n)&&t[n]===e)return!0;return!1};return e.expression.operator.lookup=function(t,n){switch(t){case"..":n.precidence=20,n.associativity=e.expression.operator.leftToRight;break;case",":n.precidence=18,n.associativity=e.expression.operator.leftToRight;break;case"?:":case"?":case":":n.precidence=16,n.associativity=e.expression.operator.rightToLeft;break;case"??":n.precidence=15,n.associativity=e.expression.operator.rightToLeft;break;case"or":n.precidence=14,n.associativity=e.expression.operator.leftToRight;break;case"and":n.precidence=13,n.associativity=e.expression.operator.leftToRight;break;case"b-or":n.precidence=12,n.associativity=e.expression.operator.leftToRight;break;case"b-xor":n.precidence=11,n.associativity=e.expression.operator.leftToRight;break;case"b-and":n.precidence=10,n.associativity=e.expression.operator.leftToRight;break;case"==":case"!=":n.precidence=9,n.associativity=e.expression.operator.leftToRight;break;case"<":case"<=":case">":case">=":case"not in":case"in":n.precidence=8,n.associativity=e.expression.operator.leftToRight;break;case"~":case"+":case"-":n.precidence=6,n.associativity=e.expression.operator.leftToRight;break;case"//":case"**":case"*":case"/":case"%":n.precidence=5,n.associativity=e.expression.operator.leftToRight;break;case"not":n.precidence=3,n.associativity=e.expression.operator.rightToLeft;break;case"matches":case"starts with":case"ends with":n.precidence=8,n.associativity=e.expression.operator.leftToRight;break;default:throw new e.Error("Failed to lookup operator: "+t+" is an unknown operator.")}return n.operator=t,n},e.expression.operator.parse=function(n,r){let i,o,s;if(e.log.trace("Twig.expression.operator.parse: ","Handling ",n),"?"===n&&(s=r.pop()),o=r.pop(),"not"!==n&&(i=r.pop()),"in"!==n&&"not in"!==n&&"??"!==n&&(i&&Array.isArray(i)&&(i=i.length),o&&Array.isArray(o)&&(o=o.length)),"matches"===n&&o&&"string"==typeof o){const e=o.match(/^\/(.*)\/([gims]?)$/),t=e[1],n=e[2];o=new RegExp(t,n)}switch(n){case":":break;case"??":void 0===i&&(i=o,o=s,s=void 0),null!=i?r.push(i):r.push(o);break;case"?:":e.lib.boolval(i)?r.push(i):r.push(o);break;case"?":void 0===i&&(i=o,o=s,s=void 0),e.lib.boolval(i)?r.push(o):r.push(s);break;case"+":o=parseFloat(o),i=parseFloat(i),r.push(i+o);break;case"-":o=parseFloat(o),i=parseFloat(i),r.push(i-o);break;c