diff --git a/.obsidian/canvas.json b/.obsidian/canvas.json new file mode 100644 index 00000000..9f05d5a2 --- /dev/null +++ b/.obsidian/canvas.json @@ -0,0 +1,5 @@ +{ + "snapToObjects": true, + "snapToGrid": true, + "cardLabelVisibility": "never" +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json index ea290642..35735bcd 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -95,6 +95,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 0.16445482949637327, + "scale": 0.13853090012467792, "close": true } \ No newline at end of file diff --git a/.obsidian/plugins/cron/data.json b/.obsidian/plugins/cron/data.json index 4ca11cff..c3174184 100644 --- a/.obsidian/plugins/cron/data.json +++ b/.obsidian/plugins/cron/data.json @@ -19,7 +19,7 @@ "601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d": { "locked": false, "lockedDeviceName": "iPhone", - "lastRun": "2023-04-19T07:03:01+02:00" + "lastRun": "2023-04-26T07:41:12+02:00" } } } \ No newline at end of file diff --git a/.obsidian/plugins/emoji-shortcodes/data.json b/.obsidian/plugins/emoji-shortcodes/data.json index bee22eb0..c01133c6 100644 --- a/.obsidian/plugins/emoji-shortcodes/data.json +++ b/.obsidian/plugins/emoji-shortcodes/data.json @@ -4,12 +4,14 @@ "historyPriority": true, "historyLimit": 100, "history": [ + ":tv:", ":plate_with_cutlery:", + ":mountain:", + ":european_castle:", + ":soccer:", ":horse_racing:", ":birthday:", ":fork_and_knife:", - ":soccer:", - ":tv:", ":stadium:", ":herb:", ":chicken:", diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json index daf5b97d..cc6b4cda 100644 --- a/.obsidian/plugins/obsidian-activity-history/data.json +++ b/.obsidian/plugins/obsidian-activity-history/data.json @@ -12,8 +12,8 @@ "checkpointList": [ { "path": "/", - "date": "2023-04-19", - "size": 14630889 + "date": "2023-04-26", + "size": 14797055 } ], "activityHistory": [ @@ -1879,6 +1879,34 @@ { "date": "2023-04-19", "value": 4418 + }, + { + "date": "2023-04-20", + "value": 1419 + }, + { + "date": "2023-04-21", + "value": 2040 + }, + { + "date": "2023-04-22", + "value": 28556 + }, + { + "date": "2023-04-23", + "value": 131397 + }, + { + "date": "2023-04-24", + "value": 1497 + }, + { + "date": "2023-04-25", + "value": 1377 + }, + { + "date": "2023-04-26", + "value": 0 } ] } diff --git a/.obsidian/plugins/obsidian-admonition/data.json b/.obsidian/plugins/obsidian-admonition/data.json index 8b09dce3..293f1e3e 100644 --- a/.obsidian/plugins/obsidian-admonition/data.json +++ b/.obsidian/plugins/obsidian-admonition/data.json @@ -106,7 +106,7 @@ }, "syntaxHighlight": false, "copyButton": true, - "version": "9.2.2", + "version": "9.2.3", "autoCollapse": false, "defaultCollapseType": "open", "injectColor": true, diff --git a/.obsidian/plugins/obsidian-admonition/main.js b/.obsidian/plugins/obsidian-admonition/main.js index dd8a06e1..e3c238c6 100644 --- a/.obsidian/plugins/obsidian-admonition/main.js +++ b/.obsidian/plugins/obsidian-admonition/main.js @@ -5,7 +5,7 @@ if you want to view the source, please visit the github repository of this plugi var v6=Object.create;var t2=Object.defineProperty;var z6=Object.getOwnPropertyDescriptor;var p6=Object.getOwnPropertyNames;var d6=Object.getPrototypeOf,u6=Object.prototype.hasOwnProperty;var x4=e=>t2(e,"__esModule",{value:!0});var M6=(e,c)=>{x4(e);for(var a in c)t2(e,a,{get:c[a],enumerable:!0})},C6=(e,c,a)=>{if(c&&typeof c=="object"||typeof c=="function")for(let i of p6(c))!u6.call(e,i)&&i!=="default"&&t2(e,i,{get:()=>c[i],enumerable:!(a=z6(c,i))||a.enumerable});return e},i1=e=>C6(x4(t2(e!=null?v6(d6(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);M6(exports,{default:()=>v4});var b=i1(require("obsidian"));var L4=i1(require("obsidian"));function H6(e,c){for(let a=0;a0&&o1(i.width)/e.offsetWidth||1,t=e.offsetHeight>0&&o1(i.height)/e.offsetHeight||1);var r=$(e)?w(e):window,o=r.visualViewport,l=!U1()&&a,f=(i.left+(l&&o?o.offsetLeft:0))/n,s=(i.top+(l&&o?o.offsetTop:0))/t,h=i.width/n,v=i.height/t;return{width:h,height:v,top:s,right:f+h,bottom:s+v,left:f,x:f,y:s}}function V1(e){var c=Y(e),a=e.offsetWidth,i=e.offsetHeight;return Math.abs(c.width-a)<=1&&(a=c.width),Math.abs(c.height-i)<=1&&(i=c.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:i}}function W1(e,c){var a=c.getRootNode&&c.getRootNode();if(e.contains(c))return!0;if(a&&P1(a)){var i=c;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function F(e){return w(e).getComputedStyle(e)}function w2(e){return["table","td","th"].indexOf(B(e))>=0}function Z(e){return(($(e)?e.ownerDocument:e.document)||window.document).documentElement}function r1(e){return B(e)==="html"?e:e.assignedSlot||e.parentNode||(P1(e)?e.host:null)||Z(e)}function D4(e){return!I(e)||F(e).position==="fixed"?null:e.offsetParent}function T6(e){var c=/firefox/i.test(D1()),a=/Trident/i.test(D1());if(a&&I(e)){var i=F(e);if(i.position==="fixed")return null}var n=r1(e);for(P1(n)&&(n=n.host);I(n)&&["html","body"].indexOf(B(n))<0;){var t=F(n);if(t.transform!=="none"||t.perspective!=="none"||t.contain==="paint"||["transform","perspective"].indexOf(t.willChange)!==-1||c&&t.willChange==="filter"||c&&t.filter&&t.filter!=="none")return n;n=n.parentNode}return null}function c1(e){for(var c=w(e),a=D4(e);a&&w2(a)&&F(a).position==="static";)a=D4(a);return a&&(B(a)==="html"||B(a)==="body"&&F(a).position==="static")?c:a||T6(e)||c}function x1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function L1(e,c,a){return X(e,g1(c,a))}function O4(e,c,a){var i=L1(e,c,a);return i>a?a:i}function G1(){return{top:0,right:0,bottom:0,left:0}}function _1(e){return Object.assign({},G1(),e)}function $1(e,c){return c.reduce(function(a,i){return a[i]=e,a},{})}var E6=function(c,a){return c=typeof c=="function"?c(Object.assign({},a.rects,{placement:a.placement})):c,_1(typeof c!="number"?c:$1(c,m1))};function P6(e){var c,a=e.state,i=e.name,n=e.options,t=a.elements.arrow,r=a.modifiersData.popperOffsets,o=R(a.placement),l=x1(o),f=[P,D].indexOf(o)>=0,s=f?"height":"width";if(!(!t||!r)){var h=E6(n.padding,a),v=V1(t),m=l==="y"?k:P,u=l==="y"?O:D,d=a.rects.reference[s]+a.rects.reference[l]-r[l]-a.rects.popper[s],p=r[l]-a.rects.reference[l],M=c1(t),g=M?l==="y"?M.clientHeight||0:M.clientWidth||0:0,V=d/2-p/2,H=h[m],x=g-v[s]-h[u],C=g/2-v[s]/2+V,A=L1(H,C,x),T=l;a.modifiersData[i]=(c={},c[T]=A,c.centerOffset=A-C,c)}}function D6(e){var c=e.state,a=e.options,i=a.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=c.elements.popper.querySelector(n),!n)||!W1(c.elements.popper,n)||(c.elements.arrow=n))}var I4={name:"arrow",enabled:!0,phase:"main",fn:P6,effect:D6,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function K(e){return e.split("-")[1]}var O6={top:"auto",right:"auto",bottom:"auto",left:"auto"};function I6(e){var c=e.x,a=e.y,i=window,n=i.devicePixelRatio||1;return{x:o1(c*n)/n||0,y:o1(a*n)/n||0}}function B4(e){var c,a=e.popper,i=e.popperRect,n=e.placement,t=e.variation,r=e.offsets,o=e.position,l=e.gpuAcceleration,f=e.adaptive,s=e.roundOffsets,h=e.isFixed,v=r.x,m=v===void 0?0:v,u=r.y,d=u===void 0?0:u,p=typeof s=="function"?s({x:m,y:d}):{x:m,y:d};m=p.x,d=p.y;var M=r.hasOwnProperty("x"),g=r.hasOwnProperty("y"),V=P,H=k,x=window;if(f){var C=c1(a),A="clientHeight",T="clientWidth";if(C===w(a)&&(C=Z(a),F(C).position!=="static"&&o==="absolute"&&(A="scrollHeight",T="scrollWidth")),C=C,n===k||(n===P||n===D)&&t===H1){H=O;var E=h&&C===x&&x.visualViewport?x.visualViewport.height:C[A];d-=E-i.height,d*=l?1:-1}if(n===P||(n===k||n===O)&&t===H1){V=D;var y=h&&C===x&&x.visualViewport?x.visualViewport.width:C[T];m-=y-i.width,m*=l?1:-1}}var S=Object.assign({position:o},f&&O6),W=s===!0?I6({x:m,y:d}):{x:m,y:d};if(m=W.x,d=W.y,l){var j;return Object.assign({},S,(j={},j[H]=g?"0":"",j[V]=M?"0":"",j.transform=(x.devicePixelRatio||1)<=1?"translate("+m+"px, "+d+"px)":"translate3d("+m+"px, "+d+"px, 0)",j))}return Object.assign({},S,(c={},c[H]=g?d+"px":"",c[V]=M?m+"px":"",c.transform="",c))}function B6(e){var c=e.state,a=e.options,i=a.gpuAcceleration,n=i===void 0?!0:i,t=a.adaptive,r=t===void 0?!0:t,o=a.roundOffsets,l=o===void 0?!0:o;if(!1)var f;var s={placement:R(c.placement),variation:K(c.placement),popper:c.elements.popper,popperRect:c.rects.popper,gpuAcceleration:n,isFixed:c.options.strategy==="fixed"};c.modifiersData.popperOffsets!=null&&(c.styles.popper=Object.assign({},c.styles.popper,B4(Object.assign({},s,{offsets:c.modifiersData.popperOffsets,position:c.options.strategy,adaptive:r,roundOffsets:l})))),c.modifiersData.arrow!=null&&(c.styles.arrow=Object.assign({},c.styles.arrow,B4(Object.assign({},s,{offsets:c.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),c.attributes.popper=Object.assign({},c.attributes.popper,{"data-popper-placement":c.placement})}var R4={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:B6,data:{}};var h2={passive:!0};function R6(e){var c=e.state,a=e.instance,i=e.options,n=i.scroll,t=n===void 0?!0:n,r=i.resize,o=r===void 0?!0:r,l=w(c.elements.popper),f=[].concat(c.scrollParents.reference,c.scrollParents.popper);return t&&f.forEach(function(s){s.addEventListener("scroll",a.update,h2)}),o&&l.addEventListener("resize",a.update,h2),function(){t&&f.forEach(function(s){s.removeEventListener("scroll",a.update,h2)}),o&&l.removeEventListener("resize",a.update,h2)}}var Z4={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:R6,data:{}};var Z6={left:"right",right:"left",bottom:"top",top:"bottom"};function O1(e){return e.replace(/left|right|bottom|top/g,function(c){return Z6[c]})}var j6={start:"end",end:"start"};function m2(e){return e.replace(/start|end/g,function(c){return j6[c]})}function b1(e){var c=w(e),a=c.pageXOffset,i=c.pageYOffset;return{scrollLeft:a,scrollTop:i}}function N1(e){return Y(Z(e)).left+b1(e).scrollLeft}function k2(e,c){var a=w(e),i=Z(e),n=a.visualViewport,t=i.clientWidth,r=i.clientHeight,o=0,l=0;if(n){t=n.width,r=n.height;var f=U1();(f||!f&&c==="fixed")&&(o=n.offsetLeft,l=n.offsetTop)}return{width:t,height:r,x:o+N1(e),y:l}}function T2(e){var c,a=Z(e),i=b1(e),n=(c=e.ownerDocument)==null?void 0:c.body,t=X(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=X(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-i.scrollLeft+N1(e),l=-i.scrollTop;return F(n||a).direction==="rtl"&&(o+=X(a.clientWidth,n?n.clientWidth:0)-t),{width:t,height:r,x:o,y:l}}function A1(e){var c=F(e),a=c.overflow,i=c.overflowX,n=c.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+i)}function v2(e){return["html","body","#document"].indexOf(B(e))>=0?e.ownerDocument.body:I(e)&&A1(e)?e:v2(r1(e))}function v1(e,c){var a;c===void 0&&(c=[]);var i=v2(e),n=i===((a=e.ownerDocument)==null?void 0:a.body),t=w(i),r=n?[t].concat(t.visualViewport||[],A1(i)?i:[]):i,o=c.concat(r);return n?o:o.concat(v1(r1(r)))}function I1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function F6(e,c){var a=Y(e,!1,c==="fixed");return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}function j4(e,c,a){return c===f2?I1(k2(e,a)):$(c)?F6(c,a):I1(T2(Z(e)))}function q6(e){var c=v1(r1(e)),a=["absolute","fixed"].indexOf(F(e).position)>=0,i=a&&I(e)?c1(e):e;return $(i)?c.filter(function(n){return $(n)&&W1(n,i)&&B(n)!=="body"}):[]}function E2(e,c,a,i){var n=c==="clippingParents"?q6(e):[].concat(c),t=[].concat(n,[a]),r=t[0],o=t.reduce(function(l,f){var s=j4(e,f,i);return l.top=X(s.top,l.top),l.right=g1(s.right,l.right),l.bottom=g1(s.bottom,l.bottom),l.left=X(s.left,l.left),l},j4(e,r,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Y1(e){var c=e.reference,a=e.element,i=e.placement,n=i?R(i):null,t=i?K(i):null,r=c.x+c.width/2-a.width/2,o=c.y+c.height/2-a.height/2,l;switch(n){case k:l={x:r,y:c.y-a.height};break;case O:l={x:r,y:c.y+c.height};break;case D:l={x:c.x+c.width,y:o};break;case P:l={x:c.x-a.width,y:o};break;default:l={x:c.x,y:c.y}}var f=n?x1(n):null;if(f!=null){var s=f==="y"?"height":"width";switch(t){case t1:l[f]=l[f]-(c[s]/2-a[s]/2);break;case H1:l[f]=l[f]+(c[s]/2-a[s]/2);break;default:}}return l}function a1(e,c){c===void 0&&(c={});var a=c,i=a.placement,n=i===void 0?e.placement:i,t=a.strategy,r=t===void 0?e.strategy:t,o=a.boundary,l=o===void 0?k4:o,f=a.rootBoundary,s=f===void 0?f2:f,h=a.elementContext,v=h===void 0?E1:h,m=a.altBoundary,u=m===void 0?!1:m,d=a.padding,p=d===void 0?0:d,M=_1(typeof p!="number"?p:$1(p,m1)),g=v===E1?T4:E1,V=e.rects.popper,H=e.elements[u?g:v],x=E2($(H)?H:H.contextElement||Z(e.elements.popper),l,s,r),C=Y(e.elements.reference),A=Y1({reference:C,element:V,strategy:"absolute",placement:n}),T=I1(Object.assign({},V,A)),E=v===E1?T:C,y={top:x.top-E.top+M.top,bottom:E.bottom-x.bottom+M.bottom,left:x.left-E.left+M.left,right:E.right-x.right+M.right},S=e.modifiersData.offset;if(v===E1&&S){var W=S[n];Object.keys(y).forEach(function(j){var p1=[D,O].indexOf(j)>=0?1:-1,d1=[k,O].indexOf(j)>=0?"y":"x";y[j]+=W[d1]*p1})}return y}function P2(e,c){c===void 0&&(c={});var a=c,i=a.placement,n=a.boundary,t=a.rootBoundary,r=a.padding,o=a.flipVariations,l=a.allowedAutoPlacements,f=l===void 0?s2:l,s=K(i),h=s?o?S2:S2.filter(function(u){return K(u)===s}):m1,v=h.filter(function(u){return f.indexOf(u)>=0});v.length===0&&(v=h);var m=v.reduce(function(u,d){return u[d]=a1(e,{placement:d,boundary:n,rootBoundary:t,padding:r})[R(d)],u},{});return Object.keys(m).sort(function(u,d){return m[u]-m[d]})}function U6(e){if(R(e)===l2)return[];var c=O1(e);return[m2(e),c,m2(c)]}function W6(e){var c=e.state,a=e.options,i=e.name;if(!c.modifiersData[i]._skip){for(var n=a.mainAxis,t=n===void 0?!0:n,r=a.altAxis,o=r===void 0?!0:r,l=a.fallbackPlacements,f=a.padding,s=a.boundary,h=a.rootBoundary,v=a.altBoundary,m=a.flipVariations,u=m===void 0?!0:m,d=a.allowedAutoPlacements,p=c.options.placement,M=R(p),g=M===p,V=l||(g||!u?[O1(p)]:U6(p)),H=[p].concat(V).reduce(function(T1,h1){return T1.concat(R(h1)===l2?P2(c,{placement:h1,boundary:s,rootBoundary:h,padding:f,flipVariations:u,allowedAutoPlacements:d}):h1)},[]),x=c.rects.reference,C=c.rects.popper,A=new Map,T=!0,E=H[0],y=0;y=0,d1=p1?"width":"height",G=a1(c,{placement:S,boundary:s,rootBoundary:h,altBoundary:v,padding:f}),Q=p1?j?D:P:j?O:k;x[d1]>C[d1]&&(Q=O1(Q));var c2=O1(Q),u1=[];if(t&&u1.push(G[W]<=0),o&&u1.push(G[Q]<=0,G[c2]<=0),u1.every(function(T1){return T1})){E=S,T=!1;break}A.set(S,u1)}if(T)for(var a2=u?3:1,b2=function(h1){var j1=H.find(function(i2){var M1=A.get(i2);if(M1)return M1.slice(0,h1).every(function(N2){return N2})});if(j1)return E=j1,"break"},Z1=a2;Z1>0;Z1--){var e2=b2(Z1);if(e2==="break")break}c.placement!==E&&(c.modifiersData[i]._skip=!0,c.placement=E,c.reset=!0)}}var F4={name:"flip",enabled:!0,phase:"main",fn:W6,requiresIfExists:["offset"],data:{_skip:!1}};function q4(e,c,a){return a===void 0&&(a={x:0,y:0}),{top:e.top-c.height-a.y,right:e.right-c.width+a.x,bottom:e.bottom-c.height+a.y,left:e.left-c.width-a.x}}function U4(e){return[k,D,O,P].some(function(c){return e[c]>=0})}function G6(e){var c=e.state,a=e.name,i=c.rects.reference,n=c.rects.popper,t=c.modifiersData.preventOverflow,r=a1(c,{elementContext:"reference"}),o=a1(c,{altBoundary:!0}),l=q4(r,i),f=q4(o,n,t),s=U4(l),h=U4(f);c.modifiersData[a]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:s,hasPopperEscaped:h},c.attributes.popper=Object.assign({},c.attributes.popper,{"data-popper-reference-hidden":s,"data-popper-escaped":h})}var W4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:G6};function _6(e,c,a){var i=R(e),n=[P,k].indexOf(i)>=0?-1:1,t=typeof a=="function"?a(Object.assign({},c,{placement:e})):a,r=t[0],o=t[1];return r=r||0,o=(o||0)*n,[P,D].indexOf(i)>=0?{x:o,y:r}:{x:r,y:o}}function $6(e){var c=e.state,a=e.options,i=e.name,n=a.offset,t=n===void 0?[0,0]:n,r=s2.reduce(function(s,h){return s[h]=_6(h,c.rects,t),s},{}),o=r[c.placement],l=o.x,f=o.y;c.modifiersData.popperOffsets!=null&&(c.modifiersData.popperOffsets.x+=l,c.modifiersData.popperOffsets.y+=f),c.modifiersData[i]=r}var G4={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:$6};function Y6(e){var c=e.state,a=e.name;c.modifiersData[a]=Y1({reference:c.rects.reference,element:c.rects.popper,strategy:"absolute",placement:c.placement})}var _4={name:"popperOffsets",enabled:!0,phase:"read",fn:Y6,data:{}};function D2(e){return e==="x"?"y":"x"}function K6(e){var c=e.state,a=e.options,i=e.name,n=a.mainAxis,t=n===void 0?!0:n,r=a.altAxis,o=r===void 0?!1:r,l=a.boundary,f=a.rootBoundary,s=a.altBoundary,h=a.padding,v=a.tether,m=v===void 0?!0:v,u=a.tetherOffset,d=u===void 0?0:u,p=a1(c,{boundary:l,rootBoundary:f,padding:h,altBoundary:s}),M=R(c.placement),g=K(c.placement),V=!g,H=x1(M),x=D2(H),C=c.modifiersData.popperOffsets,A=c.rects.reference,T=c.rects.popper,E=typeof d=="function"?d(Object.assign({},c.rects,{placement:c.placement})):d,y=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),S=c.modifiersData.offset?c.modifiersData.offset[c.placement]:null,W={x:0,y:0};if(!!C){if(t){var j,p1=H==="y"?k:P,d1=H==="y"?O:D,G=H==="y"?"height":"width",Q=C[H],c2=Q+p[p1],u1=Q-p[d1],a2=m?-T[G]/2:0,b2=g===t1?A[G]:T[G],Z1=g===t1?-T[G]:-A[G],e2=c.elements.arrow,T1=m&&e2?V1(e2):{width:0,height:0},h1=c.modifiersData["arrow#persistent"]?c.modifiersData["arrow#persistent"].padding:G1(),j1=h1[p1],i2=h1[d1],M1=L1(0,A[G],T1[G]),N2=V?A[G]/2-a2-M1-j1-y.mainAxis:b2-M1-j1-y.mainAxis,r6=V?-A[G]/2+a2+M1+i2+y.mainAxis:Z1+M1+i2+y.mainAxis,A2=c.elements.arrow&&c1(c.elements.arrow),l6=A2?H==="y"?A2.clientTop||0:A2.clientLeft||0:0,z4=(j=S==null?void 0:S[H])!=null?j:0,f6=Q+N2-z4-l6,s6=Q+r6-z4,p4=L1(m?g1(c2,f6):c2,Q,m?X(u1,s6):u1);C[H]=p4,W[H]=p4-Q}if(o){var d4,h6=H==="x"?k:P,m6=H==="x"?O:D,C1=C[x],n2=x==="y"?"height":"width",u4=C1+p[h6],M4=C1-p[m6],y2=[k,P].indexOf(M)!==-1,C4=(d4=S==null?void 0:S[x])!=null?d4:0,H4=y2?u4:C1-A[n2]-T[n2]-C4+y.altAxis,g4=y2?C1+A[n2]+T[n2]-C4-y.altAxis:M4,V4=m&&y2?O4(H4,C1,g4):L1(m?H4:u4,C1,m?g4:M4);C[x]=V4,W[x]=V4-C1}c.modifiersData[i]=W}}var $4={name:"preventOverflow",enabled:!0,phase:"main",fn:K6,requiresIfExists:["offset"]};function O2(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function I2(e){return e===w(e)||!I(e)?b1(e):O2(e)}function J6(e){var c=e.getBoundingClientRect(),a=o1(c.width)/e.offsetWidth||1,i=o1(c.height)/e.offsetHeight||1;return a!==1||i!==1}function B2(e,c,a){a===void 0&&(a=!1);var i=I(c),n=I(c)&&J6(c),t=Z(c),r=Y(e,n,a),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!a)&&((B(c)!=="body"||A1(t))&&(o=I2(c)),I(c)?(l=Y(c,!0),l.x+=c.clientLeft,l.y+=c.clientTop):t&&(l.x=N1(t))),{x:r.left+o.scrollLeft-l.x,y:r.top+o.scrollTop-l.y,width:r.width,height:r.height}}function Q6(e){var c=new Map,a=new Set,i=[];e.forEach(function(t){c.set(t.name,t)});function n(t){a.add(t.name);var r=[].concat(t.requires||[],t.requiresIfExists||[]);r.forEach(function(o){if(!a.has(o)){var l=c.get(o);l&&n(l)}}),i.push(t)}return e.forEach(function(t){a.has(t.name)||n(t)}),i}function R2(e){var c=Q6(e);return E4.reduce(function(a,i){return a.concat(c.filter(function(n){return n.phase===i}))},[])}function Z2(e){var c;return function(){return c||(c=new Promise(function(a){Promise.resolve().then(function(){c=void 0,a(e())})})),c}}function j2(e){var c=e.reduce(function(a,i){var n=a[i.name];return a[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,a},{});return Object.keys(c).map(function(a){return c[a]})}var Y4={placement:"bottom",modifiers:[],strategy:"absolute"};function K4(){for(var e=arguments.length,c=new Array(e),a=0;a(this.setSelectedItem(this.selectedItem-1,!0),!1)),i.register([],"ArrowDown",()=>(this.setSelectedItem(this.selectedItem+1,!0),!1)),i.register([],"Enter",n=>(this.useSelectedItem(n),!1)),i.register([],"Tab",n=>(this.useSelectedItem(n),!1))}chooseSuggestion(c){if(!this.items||!this.items.length)return;let a=this.items[this.selectedItem];a&&this.owner.selectSuggestion(a,c)}onSuggestionClick(c,a){if(c.preventDefault(),!this.suggestions||!this.suggestions.length)return;let i=this.suggestions.indexOf(a);this.setSelectedItem(i,!1),this.useSelectedItem(c)}onSuggestionMouseover(c,a){if(!this.suggestions||!this.suggestions.length)return;let i=this.suggestions.indexOf(a);this.setSelectedItem(i,!1)}empty(){this.containerEl.empty()}setSuggestions(c){this.containerEl.empty();let a=[];c.forEach(i=>{let n=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(i,n),a.push(n)}),this.items=c,this.suggestions=a,this.setSelectedItem(0,!1)}useSelectedItem(c){if(!this.items||!this.items.length)return;let a=this.items[this.selectedItem];a&&this.owner.selectSuggestion(a,c),q.Platform.isMobile&&this.chooseSuggestion(c)}wrap(c,a){return(c%a+a)%a}setSelectedItem(c,a){let i=this.wrap(c,this.suggestions.length),n=this.suggestions[this.selectedItem],t=this.suggestions[i];n&&n.removeClass("is-selected"),t&&t.addClass("is-selected"),this.selectedItem=i,a&&t.scrollIntoView(!1)}},q2=class extends q.FuzzySuggestModal{constructor(c,a,i){super(c);this.items=[];this.scope=new q.Scope;this.emptyStateText="No match found";this.limit=100;this.inputEl=a,this.items=i,this.suggestEl=createDiv("suggestion-container"),this.suggestEl.style.width=`${a.clientWidth}px`,this.contentEl=this.suggestEl.createDiv("suggestion"),this.suggester=new Q4(this,this.contentEl,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",n=>{n.preventDefault()})}empty(){this.suggester.empty()}onInputChanged(){let c=this.modifyInput(this.inputEl.value),a=this.getSuggestions(c);a.length>0?this.suggester.setSuggestions(a.slice(0,this.limit)):this.onNoSuggestion(),this.open()}modifyInput(c){return c}onNoSuggestion(){this.empty(),this.renderSuggestion(null,this.contentEl.createDiv("suggestion-item"))}open(){this.app.keymap.pushScope(this.scope),document.body.appendChild(this.suggestEl),this.popper=F2(this.inputEl,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"flip",options:{fallbackPlacements:["top"]}}]})}close(){this.app.keymap.popScope(this.scope),this.suggester.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}createPrompt(c){this.promptEl||(this.promptEl=this.suggestEl.createDiv("prompt-instructions"));let a=this.promptEl.createDiv("prompt-instruction");for(let i of c)a.appendChild(i)}},U2=class extends q2{constructor(c,a){super(c.app,a.inputEl,c.iconManager.iconDefinitions);this.plugin=c;this.icons=c.iconManager.iconDefinitions,this.text=a,this.createPrompts(),this.inputEl.addEventListener("input",this.getItem.bind(this))}createPrompts(){}getItem(){let c=this.inputEl.value,a=this.icons.find(i=>i.name===c.trim());a!=this.icon&&(this.icon=a,this.icons&&this.onInputChanged())}getItemText(c){return c.name}onChooseItem(c){this.text.setValue(c.name),this.icon=c}selectSuggestion({item:c}){this.text.setValue(c.name),this.icon=c,this.onClose(),this.close()}renderSuggestion(c,a){let{item:i,match:n}=c||{},t=a.createDiv({cls:"suggestion-content icon"});if(!i){t.setText(this.emptyStateText),t.parentElement.addClass("is-selected");return}let r=n.matches.map(l=>createSpan("suggestion-highlight"));for(let l=0;ls[0]===l);if(f){let s=r[n.matches.indexOf(f)];t.appendChild(s),s.appendText(i.name.substring(f[0],f[1])),l+=f[1]-f[0]-1;continue}t.appendText(i.name[l])}let o=createDiv("suggestion-flair admonition-suggester-icon");o.appendChild(this.plugin.iconManager.getIconNode(i)??createDiv()),t.prepend(o),t.createDiv({cls:"suggestion-note",text:this.plugin.iconManager.getIconModuleName(i)})}getItems(){return this.icons}},X4=class extends q2{constructor(c,a,i){super(c.app,a.inputEl,i);this.plugin=c;this.admonitions=[...i],this.text=a,this.createPrompts(),this.inputEl.addEventListener("input",this.getItem.bind(this))}createPrompts(){}getItem(){let c=this.inputEl.value,a=this.admonitions.find(i=>i.type===c.trim());a!=this.admonition&&(this.admonition=a,this.admonitions&&this.onInputChanged())}getItemText(c){return c.type}onChooseItem(c){this.text.setValue(c.type),this.admonition=c}selectSuggestion({item:c}){this.text.setValue(c.type),this.onClose(),this.close()}renderSuggestion(c,a){let{item:i,match:n}=c||{},t=a.createDiv({cls:"suggestion-content icon"});if(!i){t.setText(this.emptyStateText),t.parentElement.addClass("is-selected");return}let r=n.matches.map(l=>createSpan("suggestion-highlight"));for(let l=0;ls[0]===l);if(f){let s=r[n.matches.indexOf(f)];t.appendChild(s),s.appendText(i.type.substring(f[0],f[1])),l+=f[1]-f[0]-1;continue}t.appendText(i.type[l])}let o=createDiv("suggestion-flair admonition-suggester-icon");o.appendChild(this.plugin.iconManager.getIconNode(i.icon)??createDiv()).setAttribute("color",`rgb(${i.color})`),t.prepend(o)}getItems(){return this.admonitions}},z2=class extends q.Modal{constructor(c){super(c.app);this.plugin=c;this.collapse=this.plugin.data.autoCollapse?this.plugin.data.defaultCollapseType:"none";this.containerEl.addClass("insert-admonition-modal"),this.onOpen=()=>this.display(!0)}async display(c){let{contentEl:a}=this;a.empty(),new q.Setting(a).setName("Admonition Type").addText(o=>{o.setPlaceholder("Admonition Type").setValue(this.type);let l=new X4(this.plugin,o,this.plugin.admonitionArray),f=()=>{o.inputEl.value&&this.plugin.admonitions[o.inputEl.value]?(this.type=o.inputEl.value,this.title?.length||(this.title=this.type[0].toUpperCase()+this.type.slice(1).toLowerCase()),n.setValue(this.title)):(new q.Notice("No admonition type by that name exists."),o.inputEl.value=""),this.buildAdmonition()};o.inputEl.onblur=f,l.onClose=f,c&&(l.open(),o.inputEl.focus())});let n;new q.Setting(a).setName("Admonition Title").setDesc("Leave blank to render without a title.").addText(o=>{n=o,o.setValue(this.title),o.onChange(l=>{if(this.title=l,l.length==0?this.noTitle=!0:this.noTitle=!1,this.element){let f=this.plugin.admonitions[this.type],s=this.plugin.getAdmonitionElement(this.type,this.title,f.icon,f.injectColor??this.plugin.data.injectColor?f.color:null,this.collapse);s.createDiv({cls:"admonition-content",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla."}),this.element.replaceWith(s),this.element=s}})}),new q.Setting(a).setName("Make Collapsible").addDropdown(o=>{o.addOption("open","Open"),o.addOption("closed","Closed"),o.addOption("none","None"),o.setValue(this.collapse),o.onChange(l=>{this.collapse=l,this.buildAdmonition()})}),this.admonitionEl=this.contentEl.createDiv(),this.buildAdmonition(),new q.Setting(a).addButton(o=>o.setButtonText("Insert").setCta().onClick(()=>{this.insert=!0,this.close()})).addExtraButton(o=>{o.setIcon("cross").setTooltip("Cancel").onClick(()=>this.close()),o.extraSettingsEl.setAttr("tabindex",0),o.extraSettingsEl.onkeydown=l=>{l.key=="Enter"&&this.close()}})}buildAdmonition(){if(this.admonitionEl.empty(),this.type&&this.plugin.admonitions[this.type]){let c=this.plugin.admonitions[this.type];this.element=this.plugin.getAdmonitionElement(this.type,this.title,c.icon,c.injectColor??this.plugin.data.injectColor?c.color:null,this.collapse),this.element.createDiv({cls:"admonition-content",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla."}),this.admonitionEl.appendChild(this.element)}}};var c3='/*\nTHIS IS A GENERATED/BUNDLED FILE BY ESBUILD\nif you want to view the source, please visit the github repository of this plugin\n*/\n\nfunction T(n,e,i){let t=document.createElement(n);typeof e=="string"&&(e={cls:e});let o=e||{},l=o.cls,s=o.text,a=o.attr,r=o.title,d=o.value,c=o.type,g=i||o.parent,f=o.prepend,m=o.href;return l&&(Array.isArray(l)?t.className=l.join(" "):t.className=l),s&&(t.textContent=s),a&&Object.keys(a).forEach(p=>{let E=a[p];E!==null&&t.setAttribute(p,String(E))}),r&&(t.title=r),d&&(t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLOptionElement)&&(t.value=d),c&&t instanceof HTMLStyleElement&&t.setAttribute("type",c),m&&(t instanceof HTMLAnchorElement||t instanceof HTMLLinkElement)&&(t.href=m),g&&(f?g.insertBefore(t,g.firstChild):g.appendChild(t)),t}var h=function(n,e){return T("div",n,e)};Node.prototype.createDiv=function(n,e){return h(n,this)};Node.prototype.createEl=function(n,e,i){return T(n,e,this)};Element.prototype.addClass=function(...n){let e=[];for(let i=0;i{y(),b()};function w(){return new Promise((n,e)=>{let i=document.querySelector(".markdown-preview-sizer");if(i)n(i);else{let t=new MutationObserver(o=>{for(let l of o)if(l.type=="childList"&&l.addedNodes.length){for(let s of Array.from(l.addedNodes))if(s instanceof HTMLDivElement){if(s.hasClass("publish-renderer")){let a=s.querySelector(".markdown-preview-sizer");a&&(t.disconnect(),n(a))}s.hasClass("markdown-preview-sizer")&&(t.disconnect(),n(i))}}});t.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}})}async function b(){let n=await w();new MutationObserver(i=>{i.forEach(t=>{t.type=="childList"&&t.addedNodes.length&&t.addedNodes.forEach(o=>{if(o&&o instanceof HTMLDivElement&&!o.childElementCount){let l=new MutationObserver(s=>{for(let a of s)if(a.type=="childList"&&a.addedNodes.length)for(let r of Array.from(a.addedNodes))r instanceof HTMLPreElement&&(!M.has(r)&&Array.from(r.classList).some(d=>/language-ad-(\\w+)/.test(d))?(l.disconnect(),M.add(r),v(r)):(l.disconnect(),H(r)))});l.observe(o,{attributes:!1,childList:!0,characterData:!1,subtree:!1})}o&&o instanceof HTMLElement&&o.children.length&&o.firstElementChild instanceof HTMLPreElement&&H(o.firstElementChild)})})}).observe(n,{attributes:!1,childList:!0,subtree:!1})}function H(n){let e=new MutationObserver(i=>{i.forEach(t=>{t.target instanceof HTMLPreElement&&!M.has(t.target)&&t.type==="attributes"&&t.attributeName==="class"&&Array.from(t.target.classList).some(o=>/language-ad-(\\w+)/.test(o))&&(e.disconnect(),M.add(t.target),v(t.target))})});e.observe(n,{attributes:!0,childList:!1,characterData:!1,subtree:!1})}function v(n){let[,e]=n.classList.toString().match(/language-ad-(\\w+)/);if(!e||!(e in u.ADMONITION_ICON_MAP))return;let{title:i=e[0].toUpperCase()+e.slice(1).toLowerCase(),collapse:t,content:o,icon:l=u.ADMONITION_ICON_MAP[e].icon,color:s=u.ADMONITION_ICON_MAP[e].color}=N(e,n.innerText),a=L(e,i,l,s,t),d=a.createDiv("admonition-content-holder").createDiv("admonition-content");d.innerText=o,n.replaceWith(a)}function y(){let n=document.querySelectorAll("pre[class*=\'language-ad\']");if(!!n.length)for(let e of Array.from(n)){M.add(e);let[,i]=e.classList.toString().match(/language-ad-(\\w+)/);if(!i||!(i in u.ADMONITION_ICON_MAP))continue;let{title:t=i[0].toUpperCase()+i.slice(1).toLowerCase(),collapse:o,content:l,icon:s=u.ADMONITION_ICON_MAP[i].icon,color:a=u.ADMONITION_ICON_MAP[i].color}=N(i,e.innerText),r=L(i,t,s,a,o),c=r.createDiv("admonition-content-holder").createDiv("admonition-content");c.innerText=l,e.replaceWith(r)}}\n';var x3=i1(require("obsidian"));var a3={};var e3={};var i3={};var n3={};var W2={"Admonition Settings":"Admonition Settings","Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.":"Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.","Markdown Syntax Highlighting":"Markdown Syntax Highlighting","Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk.":"Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk."," Sync Links to Metadata Cache":" Sync Links to Metadata Cache","Allows admonitions to be created using ":"Allows admonitions to be created using "," or ":" or ",", instead of using a code block.":", instead of using a code block."," Enable Non-codeblock Admonitions":" Enable Non-codeblock Admonitions","Collapsible by Default":"Collapsible by Default","All admonitions will be collapsible by default. Use ":"All admonitions will be collapsible by default. Use "," to prevent.":" to prevent.","Default Collapse Type":"Default Collapse Type","Collapsible admonitions will be either opened or closed.":"Collapsible admonitions will be either opened or closed.","Add Copy Button":"Add Copy Button","Add a 'copy content' button to admonitions.":"Add a 'copy content' button to admonitions.","Add New":"Add New","Add a new Admonition type.":"Add a new Admonition type.","Add Additional":"Add Additional","Register Commands":"Register Commands","Unregister Commands":"Unregister Commands",Edit:"Edit",Delete:"Delete","Admonition Type":"Admonition Type","Admonition Title":"Admonition Title","This will be the default title for this admonition type.":"This will be the default title for this admonition type.","Admonition type cannot be empty.":"Admonition type cannot be empty.","Admonition type cannot include spaces.":"Admonition type cannot include spaces.","Types must be a valid CSS selector.":"Types must be a valid CSS selector.","Invalid icon name.":"Invalid icon name.","Icon cannot be empty.":"Icon cannot be empty.","Upload Image":"Upload Image","There was an error parsing the image.":"There was an error parsing the image.","Admonition Icon":"Admonition Icon",Color:"Color",Save:"Save","No Admonition Title by Default":"No Admonition Title by Default","The admonition will have no title unless ":"The admonition will have no title unless "," is explicitly provided.":" is explicitly provided.","Show Copy Button":"Show Copy Button","A copy button will be added to the admonition.":"A copy button will be added to the admonition.","Parse Titles as Markdown":"Parse Titles as Markdown","Admonition Titles will be rendered as markdown.":"Admonition Titles will be rendered as markdown."};var t3={};var o3={};var r3={};var l3={};var f3={};var s3={};var h3={};var m3={};var v3={};var z3={};var p3={};var d3={};var u3={};var M3={};var C3={};var H3={};var g3={"Admonition Settings":"Admonition \u8BBE\u7F6E","Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.":"\u5728 admonition \u4EE3\u7801\u5757\u4E2D\u4F7F\u7528 Obsidian \u7684 markdown \u8BED\u6CD5\u9AD8\u4EAE\u3002\u8BE5\u8BBE\u7F6E\u4E3A\u5B9E\u9A8C\u6027\u9009\u9879\uFF0C\u53EF\u80FD\u4F1A\u5F15\u53D1\u9519\u8BEF\u3002","Markdown Syntax Highlighting":"Markdown \u8BED\u6CD5\u9AD8\u4EAE","Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk.":"\u5C1D\u8BD5\u5C06\u5185\u90E8\u94FE\u63A5\u540C\u6B65\u81F3 metadata \u7F13\u5B58\uFF0C\u4EE5\u4FBF\u5728\u56FE\u5F62\u89C6\u56FE\u4E2D\u663E\u793A\u3002\u8FD9\u4E2A\u8BBE\u7F6E\u53EF\u80FD\u4F1A\u4EA7\u751F\u610F\u60F3\u4E0D\u5230\u7684\u540E\u679C\u3002\u4F7F\u7528\u65F6\u8BF7\u81EA\u884C\u627F\u62C5\u98CE\u9669\u3002"," Sync Links to Metadata Cache":" \u540C\u6B65\u94FE\u63A5\u81F3 metadata \u7F13\u5B58","Allows admonitions to be created using ":"\u5141\u8BB8 admonitions \u521B\u5EFA\u4F7F\u7528\uFF0C"," or ":" \u6216 ",", instead of using a code block.":"\uFF0C\u800C\u975E\u4F7F\u7528\u4EE3\u7801\u5757\u3002"," Enable Non-codeblock Admonitions":" \u5141\u8BB8\u975E\u4EE3\u7801\u5757\u7684 Admonitions","Collapsible by Default":"\u9ED8\u8BA4\u6298\u53E0","All admonitions will be collapsible by default. Use ":"\u6240\u6709\u7684 admonitions \u9ED8\u8BA4\u53EF\u6298\u53E0\u3002\u4F7F\u7528 "," to prevent.":" \u6765\u963B\u6B62\u3002","Default Collapse Type":"\u9ED8\u8BA4\u53EF\u6298\u53E0\u7C7B\u578B","Collapsible admonitions will be either opened or closed.":"\u53EF\u6298\u53E0\u7684 admonitions \u5C06\u662F\u6253\u5F00\u7684\u6216\u662F\u5173\u95ED\u7684\u3002","Add Copy Button":"\u6DFB\u52A0\u590D\u5236\u6309\u94AE","Add a 'copy content' button to admonitions.":"\u4E3A admonitions \u65B0\u589E\u4E00\u4E2A\u201C\u590D\u5236\u5185\u5BB9\u201D\u6309\u94AE\u3002","Add New":"\u65B0\u589E","Add a new Admonition type.":"\u6DFB\u52A0\u4E00\u4E2A\u65B0\u7684 Admonition \u7C7B\u578B\u3002","Add Additional":"\u989D\u5916\u6DFB\u52A0","Register Commands":"\u6CE8\u518C\u547D\u4EE4","Unregister Commands":"\u6CE8\u9500\u547D\u4EE4",Edit:"\u7F16\u8F91",Delete:"\u5220\u9664","Admonition Type":"Admonition \u7C7B\u578B","Admonition Title":"Admonition \u540D\u79F0","This will be the default title for this admonition type.":"\u8FD9\u5C06\u4F1A\u6210\u4E3A\u8BE5\u7C7B\u578B admonition \u7684\u9ED8\u8BA4\u540D\u79F0\u3002","Admonition type cannot be empty.":"Admonition \u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A\u3002","Admonition type cannot include spaces.":"Admonition \u7C7B\u578B\u4E0D\u80FD\u5305\u542B\u7A7A\u683C","Types must be a valid CSS selector.":"\u7C7B\u578B\u5FC5\u987B\u4E3A\u5408\u6CD5\u7684 CSS \u9009\u62E9\u5668\u3002","Invalid icon name.":"\u975E\u6CD5\u56FE\u6807\u540D\u79F0\u3002","Icon cannot be empty.":"\u56FE\u6807\u4E0D\u80FD\u4E3A\u7A7A\u3002","Upload Image":"\u4E0A\u4F20\u56FE\u50CF","There was an error parsing the image.":"\u4E0A\u4F20\u56FE\u50CF\u65F6\u51FA\u9519\u4E86\u3002","Admonition Icon":"Admonition \u56FE\u6807",Color:"\u989C\u8272",Save:"\u4FDD\u5B58","No Admonition Title by Default":"\u65E0\u9ED8\u8BA4 Admonition \u540D\u79F0","The admonition will have no title unless ":"\u8BE5 admonition \u5C06\u6CA1\u6709\u540D\u79F0\uFF0C\u9664\u975E "," is explicitly provided.":" \u662F\u660E\u786E\u89C4\u5B9A\u7684\u3002","Show Copy Button":"\u663E\u793A\u590D\u5236\u6309\u94AE","A copy button will be added to the admonition.":"\u4E00\u4E2A\u590D\u5236\u6309\u94AE\u5C06\u88AB\u6DFB\u52A0\u81F3\u8BE5 admonition ","Parse Titles as Markdown":"\u5C06\u540D\u79F0\u8F6C\u53D8\u4E3A Markdown","Admonition Titles will be rendered as markdown.":"Admonition \u540D\u79F0\u5C06\u4EE5 markdown \u5F62\u5F0F\u5448\u73B0\u3002"};var V3={};var a8={ar:a3,cs:e3,da:i3,de:n3,en:W2,"en-gb":t3,es:o3,fr:r3,hi:l3,id:f3,it:s3,ja:h3,ko:m3,nl:v3,nn:z3,pl:p3,pt:d3,"pt-br":u3,ro:M3,ru:C3,tr:H3,"zh-cn":g3,"zh-tw":V3},L3=a8[x3.moment.locale()];function L(e){return L3&&L3[e]||W2[e]}var K1=i1(require("obsidian"));async function b3(e,c,a={cta:"Yes",secondary:"No"}){return new Promise((i,n)=>{try{let t=new N3(e,c,a);t.onClose=()=>{i(t.confirmed)},t.open()}catch{n()}})}var N3=class extends K1.Modal{constructor(c,a,i){super(c);this.text=a;this.buttons=i;this.confirmed=!1}async display(){this.contentEl.empty(),this.contentEl.addClass("confirm-modal"),this.contentEl.createEl("p",{text:this.text});let c=this.contentEl.createDiv("fantasy-calendar-confirm-buttons");new K1.ButtonComponent(c).setButtonText(this.buttons.cta).setCta().onClick(()=>{this.confirmed=!0,this.close()}),new K1.ButtonComponent(c).setButtonText(this.buttons.secondary).onClick(()=>{this.close()})}onOpen(){this.display()}};var y1={octicons:"Octicons",rpg:"RPG Awesome"};var e8=(e=>c=>{try{e.querySelector(c)}catch{return!1}return!0})(document.createDocumentFragment()),e1=class{static validateImport(c,a){let i={success:!0,messages:[]},n=e1.validateType(a.type,c);if(n.success==!1)return n;let t=typeof a.icon=="string"?a.icon:typeof a.icon=="object"?a.icon?.name:null,r=e1.validateType(t,c);if(r.success==!1)return r;if(c.iconManager.getIconNode(a.icon)||i.messages.push("No installed icon found by the name "+t+". Perhaps you need to install a new icon pack?"),a.title&&typeof a.title!="string")return{success:!1,failed:"title",message:"Admonition titles can only be strings."};(!("color"in a)||!/(?:(?:2(?:[0-4]\d|5[0-5])|\d{1,2}|1\d\d)\s*,\s*){2}\s*(?:2(?:[0-4]\d|5[0-5])|\d{1,2}|1\d\d)/.test(a.color))&&(console.warn("No color provided for the import of "+a.type+". Adding a random color."),a.color=`${Math.floor(Math.random()*255)}, ${Math.floor(Math.random()*255)}, ${Math.floor(Math.random()*255)}`);let l=["command","injectColor","noTitle","copy"];for(let f of l)if(f in a&&typeof JSON.parse(JSON.stringify(a[f]))!="boolean")return{success:!1,failed:"booleans",message:`The "${f}" property must be a boolean if present.`};return i}static validate(c,a,i,n){let t=e1.validateType(a,c,n);return t.success==!1?t:e1.validateIcon(i,c)}static validateType(c,a,i){return c.length?c.includes(" ")?{success:!1,message:L("Admonition type cannot include spaces."),failed:"type"}:e8(c)?c!=i&&c in a.data.userAdmonitions?{success:!1,message:"That Admonition type already exists.",failed:"type"}:{success:!0}:{success:!1,message:L("Types must be a valid CSS selector."),failed:"type"}:{success:!1,message:L("Admonition type cannot be empty."),failed:"type"}}static validateIcon(c,a){return c.length?a.iconManager.getIconType(c)?{success:!0}:{success:!1,message:L("Invalid icon name."),failed:"icon"}:{success:!1,message:L("Icon cannot be empty."),failed:"icon"}}};var B1=i1(require("obsidian")),p2=class extends B1.Modal{constructor(c){super(app);this.plugin=c;this.admonitionDefinitions=Object.values(this.plugin.data.userAdmonitions);this.admonitionNames=Object.keys(this.plugin.data.userAdmonitions);this.selectedAdmonitions=[...this.admonitionNames];this.export=!1}onOpen(){this.titleEl.setText("Export Admonitions"),this.containerEl.addClasses(["admonition-settings","admonition-modal","admonition-export-modal"]),new B1.Setting(this.contentEl).addButton(a=>a.setButtonText("Export Selected").onClick(()=>{this.export=!0,this.close()}));let c;new B1.Setting(this.contentEl).addButton(a=>a.setButtonText("Select All").setCta().onClick(()=>{this.selectedAdmonitions=[...this.admonitionNames],this.generateToggles(c)})).addButton(a=>a.setButtonText("Deselect All").onClick(()=>{this.selectedAdmonitions=[],this.generateToggles(c)})),c=this.contentEl.createDiv("additional"),this.generateToggles(c)}generateToggles(c){c.empty();for(let a of this.admonitionNames)new B1.Setting(c).setName(a).addToggle(i=>{i.setValue(this.selectedAdmonitions.includes(a)).onChange(n=>{n?this.selectedAdmonitions.push(a):this.selectedAdmonitions.remove(a)})})}};var rk=(e=>c=>{try{e.querySelector(c)}catch{return!1}return!0})(document.createDocumentFragment()),d2=class extends z.PluginSettingTab{constructor(c,a){super(c,a);this.plugin=a;this.queue=[];this.converted=0}async display(){this.containerEl.empty(),this.containerEl.addClass("admonition-settings"),this.containerEl.createEl("h2",{text:L("Admonition Settings")});let c=this.containerEl.createDiv("admonitions-nested-settings");z.Platform.isMobile||new z.Setting(c).setName("Export Custom Types as CSS").setDesc("Export a CSS snippet for custom callout types.").addButton(i=>i.setIcon("download").onClick(()=>{let n=[`/* This snippet was auto-generated by the Admonitions plugin */ +`);return s!==void 0&&s!=="none"&&s!=="open"&&s!=="closed"&&(s="closed"),"title"in l||a.noTitle||(f=i),f&&f.trim()===""&&s!==void 0&&s!=="none"&&(f=i,new L4.Notice("An admonition must have a title if it is collapsible.")),{title:f,collapse:s,content:m,icon:h,color:v}}var N4='',o2="admonition-add-command",A4='',r2="admonition-remove-command",y4='',F1="admonition-warning",S4='',q1="admonition-spin",w4={note:{type:"note",color:"68, 138, 255",icon:{type:"font-awesome",name:"pencil-alt"},command:!1,noTitle:!1},seealso:{type:"note",color:"68, 138, 255",icon:{type:"font-awesome",name:"pencil-alt"},command:!1,noTitle:!1},abstract:{type:"abstract",color:"0, 176, 255",icon:{type:"font-awesome",name:"book"},command:!1,noTitle:!1},summary:{type:"abstract",color:"0, 176, 255",icon:{type:"font-awesome",name:"book"},command:!1,noTitle:!1},tldr:{type:"abstract",color:"0, 176, 255",icon:{type:"font-awesome",name:"book"},command:!1,noTitle:!1},info:{type:"info",color:"0, 184, 212",icon:{type:"font-awesome",name:"info-circle"},command:!1,noTitle:!1},todo:{type:"info",color:"0, 184, 212",icon:{type:"font-awesome",name:"info-circle"},command:!1,noTitle:!1},tip:{type:"tip",color:"0, 191, 165",icon:{type:"font-awesome",name:"fire"},command:!1,noTitle:!1},hint:{type:"tip",color:"0, 191, 165",icon:{type:"font-awesome",name:"fire"},command:!1,noTitle:!1},important:{type:"tip",color:"0, 191, 165",icon:{type:"font-awesome",name:"fire"},command:!1,noTitle:!1},success:{type:"success",color:"0, 200, 83",icon:{type:"font-awesome",name:"check-circle"},command:!1,noTitle:!1},check:{type:"success",color:"0, 200, 83",icon:{type:"font-awesome",name:"check-circle"},command:!1,noTitle:!1},done:{type:"success",color:"0, 200, 83",icon:{type:"font-awesome",name:"check-circle"},command:!1,noTitle:!1},question:{type:"question",color:"100, 221, 23",icon:{type:"font-awesome",name:"question-circle"},command:!1,noTitle:!1},help:{type:"question",color:"100, 221, 23",icon:{type:"font-awesome",name:"question-circle"},command:!1,noTitle:!1},faq:{type:"question",color:"100, 221, 23",icon:{type:"font-awesome",name:"question-circle"},command:!1,noTitle:!1},warning:{type:"warning",color:"255, 145, 0",icon:{type:"font-awesome",name:"exclamation-triangle"},command:!1,noTitle:!1},caution:{type:"warning",color:"255, 145, 0",icon:{type:"font-awesome",name:"exclamation-triangle"},command:!1,noTitle:!1},attention:{type:"warning",color:"255, 145, 0",icon:{type:"font-awesome",name:"exclamation-triangle"},command:!1,noTitle:!1},failure:{type:"failure",color:"255, 82, 82",icon:{type:"font-awesome",name:"times-circle"},command:!1,noTitle:!1},fail:{type:"failure",color:"255, 82, 82",icon:{type:"font-awesome",name:"times-circle"},command:!1,noTitle:!1},missing:{type:"failure",color:"255, 82, 82",icon:{type:"font-awesome",name:"times-circle"},command:!1,noTitle:!1},danger:{type:"danger",color:"255, 23, 68",icon:{type:"font-awesome",name:"bolt"},command:!1,noTitle:!1},error:{type:"danger",color:"255, 23, 68",icon:{type:"font-awesome",name:"bolt"},command:!1,noTitle:!1},bug:{type:"bug",color:"245, 0, 87",icon:{type:"font-awesome",name:"bug"},command:!1,noTitle:!1},example:{type:"example",color:"124, 77, 255",icon:{type:"font-awesome",name:"list-ol"},command:!1,noTitle:!1},quote:{type:"quote",color:"158, 158, 158",icon:{type:"font-awesome",name:"quote-right"},command:!1,noTitle:!1},cite:{type:"quote",color:"158, 158, 158",icon:{type:"font-awesome",name:"quote-right"},command:!1,noTitle:!1}};var z=i1(require("obsidian"));var q=i1(require("obsidian"));var k="top",O="bottom",D="right",P="left",l2="auto",m1=[k,O,D,P],t1="start",H1="end",k4="clippingParents",f2="viewport",E1="popper",T4="reference",S2=m1.reduce(function(e,c){return e.concat([c+"-"+t1,c+"-"+H1])},[]),s2=[].concat(m1,[l2]).reduce(function(e,c){return e.concat([c,c+"-"+t1,c+"-"+H1])},[]),g6="beforeRead",V6="read",x6="afterRead",L6="beforeMain",b6="main",N6="afterMain",A6="beforeWrite",y6="write",S6="afterWrite",E4=[g6,V6,x6,L6,b6,N6,A6,y6,S6];function B(e){return e?(e.nodeName||"").toLowerCase():null}function w(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var c=e.ownerDocument;return c&&c.defaultView||window}return e}function $(e){var c=w(e).Element;return e instanceof c||e instanceof Element}function I(e){var c=w(e).HTMLElement;return e instanceof c||e instanceof HTMLElement}function P1(e){if(typeof ShadowRoot=="undefined")return!1;var c=w(e).ShadowRoot;return e instanceof c||e instanceof ShadowRoot}function w6(e){var c=e.state;Object.keys(c.elements).forEach(function(a){var i=c.styles[a]||{},n=c.attributes[a]||{},t=c.elements[a];!I(t)||!B(t)||(Object.assign(t.style,i),Object.keys(n).forEach(function(r){var o=n[r];o===!1?t.removeAttribute(r):t.setAttribute(r,o===!0?"":o)}))})}function k6(e){var c=e.state,a={popper:{position:c.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(c.elements.popper.style,a.popper),c.styles=a,c.elements.arrow&&Object.assign(c.elements.arrow.style,a.arrow),function(){Object.keys(c.elements).forEach(function(i){var n=c.elements[i],t=c.attributes[i]||{},r=Object.keys(c.styles.hasOwnProperty(i)?c.styles[i]:a[i]),o=r.reduce(function(l,f){return l[f]="",l},{});!I(n)||!B(n)||(Object.assign(n.style,o),Object.keys(t).forEach(function(l){n.removeAttribute(l)}))})}}var P4={name:"applyStyles",enabled:!0,phase:"write",fn:w6,effect:k6,requires:["computeStyles"]};function R(e){return e.split("-")[0]}var X=Math.max,g1=Math.min,o1=Math.round;function D1(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(c){return c.brand+"/"+c.version}).join(" "):navigator.userAgent}function U1(){return!/^((?!chrome|android).)*safari/i.test(D1())}function Y(e,c,a){c===void 0&&(c=!1),a===void 0&&(a=!1);var i=e.getBoundingClientRect(),n=1,t=1;c&&I(e)&&(n=e.offsetWidth>0&&o1(i.width)/e.offsetWidth||1,t=e.offsetHeight>0&&o1(i.height)/e.offsetHeight||1);var r=$(e)?w(e):window,o=r.visualViewport,l=!U1()&&a,f=(i.left+(l&&o?o.offsetLeft:0))/n,s=(i.top+(l&&o?o.offsetTop:0))/t,h=i.width/n,v=i.height/t;return{width:h,height:v,top:s,right:f+h,bottom:s+v,left:f,x:f,y:s}}function V1(e){var c=Y(e),a=e.offsetWidth,i=e.offsetHeight;return Math.abs(c.width-a)<=1&&(a=c.width),Math.abs(c.height-i)<=1&&(i=c.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:i}}function W1(e,c){var a=c.getRootNode&&c.getRootNode();if(e.contains(c))return!0;if(a&&P1(a)){var i=c;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function F(e){return w(e).getComputedStyle(e)}function w2(e){return["table","td","th"].indexOf(B(e))>=0}function Z(e){return(($(e)?e.ownerDocument:e.document)||window.document).documentElement}function r1(e){return B(e)==="html"?e:e.assignedSlot||e.parentNode||(P1(e)?e.host:null)||Z(e)}function D4(e){return!I(e)||F(e).position==="fixed"?null:e.offsetParent}function T6(e){var c=/firefox/i.test(D1()),a=/Trident/i.test(D1());if(a&&I(e)){var i=F(e);if(i.position==="fixed")return null}var n=r1(e);for(P1(n)&&(n=n.host);I(n)&&["html","body"].indexOf(B(n))<0;){var t=F(n);if(t.transform!=="none"||t.perspective!=="none"||t.contain==="paint"||["transform","perspective"].indexOf(t.willChange)!==-1||c&&t.willChange==="filter"||c&&t.filter&&t.filter!=="none")return n;n=n.parentNode}return null}function c1(e){for(var c=w(e),a=D4(e);a&&w2(a)&&F(a).position==="static";)a=D4(a);return a&&(B(a)==="html"||B(a)==="body"&&F(a).position==="static")?c:a||T6(e)||c}function x1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function L1(e,c,a){return X(e,g1(c,a))}function O4(e,c,a){var i=L1(e,c,a);return i>a?a:i}function G1(){return{top:0,right:0,bottom:0,left:0}}function _1(e){return Object.assign({},G1(),e)}function $1(e,c){return c.reduce(function(a,i){return a[i]=e,a},{})}var E6=function(c,a){return c=typeof c=="function"?c(Object.assign({},a.rects,{placement:a.placement})):c,_1(typeof c!="number"?c:$1(c,m1))};function P6(e){var c,a=e.state,i=e.name,n=e.options,t=a.elements.arrow,r=a.modifiersData.popperOffsets,o=R(a.placement),l=x1(o),f=[P,D].indexOf(o)>=0,s=f?"height":"width";if(!(!t||!r)){var h=E6(n.padding,a),v=V1(t),m=l==="y"?k:P,u=l==="y"?O:D,d=a.rects.reference[s]+a.rects.reference[l]-r[l]-a.rects.popper[s],p=r[l]-a.rects.reference[l],M=c1(t),g=M?l==="y"?M.clientHeight||0:M.clientWidth||0:0,V=d/2-p/2,H=h[m],x=g-v[s]-h[u],C=g/2-v[s]/2+V,A=L1(H,C,x),T=l;a.modifiersData[i]=(c={},c[T]=A,c.centerOffset=A-C,c)}}function D6(e){var c=e.state,a=e.options,i=a.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=c.elements.popper.querySelector(n),!n)||!W1(c.elements.popper,n)||(c.elements.arrow=n))}var I4={name:"arrow",enabled:!0,phase:"main",fn:P6,effect:D6,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function K(e){return e.split("-")[1]}var O6={top:"auto",right:"auto",bottom:"auto",left:"auto"};function I6(e){var c=e.x,a=e.y,i=window,n=i.devicePixelRatio||1;return{x:o1(c*n)/n||0,y:o1(a*n)/n||0}}function B4(e){var c,a=e.popper,i=e.popperRect,n=e.placement,t=e.variation,r=e.offsets,o=e.position,l=e.gpuAcceleration,f=e.adaptive,s=e.roundOffsets,h=e.isFixed,v=r.x,m=v===void 0?0:v,u=r.y,d=u===void 0?0:u,p=typeof s=="function"?s({x:m,y:d}):{x:m,y:d};m=p.x,d=p.y;var M=r.hasOwnProperty("x"),g=r.hasOwnProperty("y"),V=P,H=k,x=window;if(f){var C=c1(a),A="clientHeight",T="clientWidth";if(C===w(a)&&(C=Z(a),F(C).position!=="static"&&o==="absolute"&&(A="scrollHeight",T="scrollWidth")),C=C,n===k||(n===P||n===D)&&t===H1){H=O;var E=h&&C===x&&x.visualViewport?x.visualViewport.height:C[A];d-=E-i.height,d*=l?1:-1}if(n===P||(n===k||n===O)&&t===H1){V=D;var y=h&&C===x&&x.visualViewport?x.visualViewport.width:C[T];m-=y-i.width,m*=l?1:-1}}var S=Object.assign({position:o},f&&O6),W=s===!0?I6({x:m,y:d}):{x:m,y:d};if(m=W.x,d=W.y,l){var j;return Object.assign({},S,(j={},j[H]=g?"0":"",j[V]=M?"0":"",j.transform=(x.devicePixelRatio||1)<=1?"translate("+m+"px, "+d+"px)":"translate3d("+m+"px, "+d+"px, 0)",j))}return Object.assign({},S,(c={},c[H]=g?d+"px":"",c[V]=M?m+"px":"",c.transform="",c))}function B6(e){var c=e.state,a=e.options,i=a.gpuAcceleration,n=i===void 0?!0:i,t=a.adaptive,r=t===void 0?!0:t,o=a.roundOffsets,l=o===void 0?!0:o;if(!1)var f;var s={placement:R(c.placement),variation:K(c.placement),popper:c.elements.popper,popperRect:c.rects.popper,gpuAcceleration:n,isFixed:c.options.strategy==="fixed"};c.modifiersData.popperOffsets!=null&&(c.styles.popper=Object.assign({},c.styles.popper,B4(Object.assign({},s,{offsets:c.modifiersData.popperOffsets,position:c.options.strategy,adaptive:r,roundOffsets:l})))),c.modifiersData.arrow!=null&&(c.styles.arrow=Object.assign({},c.styles.arrow,B4(Object.assign({},s,{offsets:c.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),c.attributes.popper=Object.assign({},c.attributes.popper,{"data-popper-placement":c.placement})}var R4={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:B6,data:{}};var h2={passive:!0};function R6(e){var c=e.state,a=e.instance,i=e.options,n=i.scroll,t=n===void 0?!0:n,r=i.resize,o=r===void 0?!0:r,l=w(c.elements.popper),f=[].concat(c.scrollParents.reference,c.scrollParents.popper);return t&&f.forEach(function(s){s.addEventListener("scroll",a.update,h2)}),o&&l.addEventListener("resize",a.update,h2),function(){t&&f.forEach(function(s){s.removeEventListener("scroll",a.update,h2)}),o&&l.removeEventListener("resize",a.update,h2)}}var Z4={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:R6,data:{}};var Z6={left:"right",right:"left",bottom:"top",top:"bottom"};function O1(e){return e.replace(/left|right|bottom|top/g,function(c){return Z6[c]})}var j6={start:"end",end:"start"};function m2(e){return e.replace(/start|end/g,function(c){return j6[c]})}function b1(e){var c=w(e),a=c.pageXOffset,i=c.pageYOffset;return{scrollLeft:a,scrollTop:i}}function N1(e){return Y(Z(e)).left+b1(e).scrollLeft}function k2(e,c){var a=w(e),i=Z(e),n=a.visualViewport,t=i.clientWidth,r=i.clientHeight,o=0,l=0;if(n){t=n.width,r=n.height;var f=U1();(f||!f&&c==="fixed")&&(o=n.offsetLeft,l=n.offsetTop)}return{width:t,height:r,x:o+N1(e),y:l}}function T2(e){var c,a=Z(e),i=b1(e),n=(c=e.ownerDocument)==null?void 0:c.body,t=X(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=X(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-i.scrollLeft+N1(e),l=-i.scrollTop;return F(n||a).direction==="rtl"&&(o+=X(a.clientWidth,n?n.clientWidth:0)-t),{width:t,height:r,x:o,y:l}}function A1(e){var c=F(e),a=c.overflow,i=c.overflowX,n=c.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+i)}function v2(e){return["html","body","#document"].indexOf(B(e))>=0?e.ownerDocument.body:I(e)&&A1(e)?e:v2(r1(e))}function v1(e,c){var a;c===void 0&&(c=[]);var i=v2(e),n=i===((a=e.ownerDocument)==null?void 0:a.body),t=w(i),r=n?[t].concat(t.visualViewport||[],A1(i)?i:[]):i,o=c.concat(r);return n?o:o.concat(v1(r1(r)))}function I1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function F6(e,c){var a=Y(e,!1,c==="fixed");return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}function j4(e,c,a){return c===f2?I1(k2(e,a)):$(c)?F6(c,a):I1(T2(Z(e)))}function q6(e){var c=v1(r1(e)),a=["absolute","fixed"].indexOf(F(e).position)>=0,i=a&&I(e)?c1(e):e;return $(i)?c.filter(function(n){return $(n)&&W1(n,i)&&B(n)!=="body"}):[]}function E2(e,c,a,i){var n=c==="clippingParents"?q6(e):[].concat(c),t=[].concat(n,[a]),r=t[0],o=t.reduce(function(l,f){var s=j4(e,f,i);return l.top=X(s.top,l.top),l.right=g1(s.right,l.right),l.bottom=g1(s.bottom,l.bottom),l.left=X(s.left,l.left),l},j4(e,r,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Y1(e){var c=e.reference,a=e.element,i=e.placement,n=i?R(i):null,t=i?K(i):null,r=c.x+c.width/2-a.width/2,o=c.y+c.height/2-a.height/2,l;switch(n){case k:l={x:r,y:c.y-a.height};break;case O:l={x:r,y:c.y+c.height};break;case D:l={x:c.x+c.width,y:o};break;case P:l={x:c.x-a.width,y:o};break;default:l={x:c.x,y:c.y}}var f=n?x1(n):null;if(f!=null){var s=f==="y"?"height":"width";switch(t){case t1:l[f]=l[f]-(c[s]/2-a[s]/2);break;case H1:l[f]=l[f]+(c[s]/2-a[s]/2);break;default:}}return l}function a1(e,c){c===void 0&&(c={});var a=c,i=a.placement,n=i===void 0?e.placement:i,t=a.strategy,r=t===void 0?e.strategy:t,o=a.boundary,l=o===void 0?k4:o,f=a.rootBoundary,s=f===void 0?f2:f,h=a.elementContext,v=h===void 0?E1:h,m=a.altBoundary,u=m===void 0?!1:m,d=a.padding,p=d===void 0?0:d,M=_1(typeof p!="number"?p:$1(p,m1)),g=v===E1?T4:E1,V=e.rects.popper,H=e.elements[u?g:v],x=E2($(H)?H:H.contextElement||Z(e.elements.popper),l,s,r),C=Y(e.elements.reference),A=Y1({reference:C,element:V,strategy:"absolute",placement:n}),T=I1(Object.assign({},V,A)),E=v===E1?T:C,y={top:x.top-E.top+M.top,bottom:E.bottom-x.bottom+M.bottom,left:x.left-E.left+M.left,right:E.right-x.right+M.right},S=e.modifiersData.offset;if(v===E1&&S){var W=S[n];Object.keys(y).forEach(function(j){var p1=[D,O].indexOf(j)>=0?1:-1,d1=[k,O].indexOf(j)>=0?"y":"x";y[j]+=W[d1]*p1})}return y}function P2(e,c){c===void 0&&(c={});var a=c,i=a.placement,n=a.boundary,t=a.rootBoundary,r=a.padding,o=a.flipVariations,l=a.allowedAutoPlacements,f=l===void 0?s2:l,s=K(i),h=s?o?S2:S2.filter(function(u){return K(u)===s}):m1,v=h.filter(function(u){return f.indexOf(u)>=0});v.length===0&&(v=h);var m=v.reduce(function(u,d){return u[d]=a1(e,{placement:d,boundary:n,rootBoundary:t,padding:r})[R(d)],u},{});return Object.keys(m).sort(function(u,d){return m[u]-m[d]})}function U6(e){if(R(e)===l2)return[];var c=O1(e);return[m2(e),c,m2(c)]}function W6(e){var c=e.state,a=e.options,i=e.name;if(!c.modifiersData[i]._skip){for(var n=a.mainAxis,t=n===void 0?!0:n,r=a.altAxis,o=r===void 0?!0:r,l=a.fallbackPlacements,f=a.padding,s=a.boundary,h=a.rootBoundary,v=a.altBoundary,m=a.flipVariations,u=m===void 0?!0:m,d=a.allowedAutoPlacements,p=c.options.placement,M=R(p),g=M===p,V=l||(g||!u?[O1(p)]:U6(p)),H=[p].concat(V).reduce(function(T1,h1){return T1.concat(R(h1)===l2?P2(c,{placement:h1,boundary:s,rootBoundary:h,padding:f,flipVariations:u,allowedAutoPlacements:d}):h1)},[]),x=c.rects.reference,C=c.rects.popper,A=new Map,T=!0,E=H[0],y=0;y=0,d1=p1?"width":"height",G=a1(c,{placement:S,boundary:s,rootBoundary:h,altBoundary:v,padding:f}),Q=p1?j?D:P:j?O:k;x[d1]>C[d1]&&(Q=O1(Q));var c2=O1(Q),u1=[];if(t&&u1.push(G[W]<=0),o&&u1.push(G[Q]<=0,G[c2]<=0),u1.every(function(T1){return T1})){E=S,T=!1;break}A.set(S,u1)}if(T)for(var a2=u?3:1,b2=function(h1){var j1=H.find(function(i2){var M1=A.get(i2);if(M1)return M1.slice(0,h1).every(function(N2){return N2})});if(j1)return E=j1,"break"},Z1=a2;Z1>0;Z1--){var e2=b2(Z1);if(e2==="break")break}c.placement!==E&&(c.modifiersData[i]._skip=!0,c.placement=E,c.reset=!0)}}var F4={name:"flip",enabled:!0,phase:"main",fn:W6,requiresIfExists:["offset"],data:{_skip:!1}};function q4(e,c,a){return a===void 0&&(a={x:0,y:0}),{top:e.top-c.height-a.y,right:e.right-c.width+a.x,bottom:e.bottom-c.height+a.y,left:e.left-c.width-a.x}}function U4(e){return[k,D,O,P].some(function(c){return e[c]>=0})}function G6(e){var c=e.state,a=e.name,i=c.rects.reference,n=c.rects.popper,t=c.modifiersData.preventOverflow,r=a1(c,{elementContext:"reference"}),o=a1(c,{altBoundary:!0}),l=q4(r,i),f=q4(o,n,t),s=U4(l),h=U4(f);c.modifiersData[a]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:s,hasPopperEscaped:h},c.attributes.popper=Object.assign({},c.attributes.popper,{"data-popper-reference-hidden":s,"data-popper-escaped":h})}var W4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:G6};function _6(e,c,a){var i=R(e),n=[P,k].indexOf(i)>=0?-1:1,t=typeof a=="function"?a(Object.assign({},c,{placement:e})):a,r=t[0],o=t[1];return r=r||0,o=(o||0)*n,[P,D].indexOf(i)>=0?{x:o,y:r}:{x:r,y:o}}function $6(e){var c=e.state,a=e.options,i=e.name,n=a.offset,t=n===void 0?[0,0]:n,r=s2.reduce(function(s,h){return s[h]=_6(h,c.rects,t),s},{}),o=r[c.placement],l=o.x,f=o.y;c.modifiersData.popperOffsets!=null&&(c.modifiersData.popperOffsets.x+=l,c.modifiersData.popperOffsets.y+=f),c.modifiersData[i]=r}var G4={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:$6};function Y6(e){var c=e.state,a=e.name;c.modifiersData[a]=Y1({reference:c.rects.reference,element:c.rects.popper,strategy:"absolute",placement:c.placement})}var _4={name:"popperOffsets",enabled:!0,phase:"read",fn:Y6,data:{}};function D2(e){return e==="x"?"y":"x"}function K6(e){var c=e.state,a=e.options,i=e.name,n=a.mainAxis,t=n===void 0?!0:n,r=a.altAxis,o=r===void 0?!1:r,l=a.boundary,f=a.rootBoundary,s=a.altBoundary,h=a.padding,v=a.tether,m=v===void 0?!0:v,u=a.tetherOffset,d=u===void 0?0:u,p=a1(c,{boundary:l,rootBoundary:f,padding:h,altBoundary:s}),M=R(c.placement),g=K(c.placement),V=!g,H=x1(M),x=D2(H),C=c.modifiersData.popperOffsets,A=c.rects.reference,T=c.rects.popper,E=typeof d=="function"?d(Object.assign({},c.rects,{placement:c.placement})):d,y=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),S=c.modifiersData.offset?c.modifiersData.offset[c.placement]:null,W={x:0,y:0};if(!!C){if(t){var j,p1=H==="y"?k:P,d1=H==="y"?O:D,G=H==="y"?"height":"width",Q=C[H],c2=Q+p[p1],u1=Q-p[d1],a2=m?-T[G]/2:0,b2=g===t1?A[G]:T[G],Z1=g===t1?-T[G]:-A[G],e2=c.elements.arrow,T1=m&&e2?V1(e2):{width:0,height:0},h1=c.modifiersData["arrow#persistent"]?c.modifiersData["arrow#persistent"].padding:G1(),j1=h1[p1],i2=h1[d1],M1=L1(0,A[G],T1[G]),N2=V?A[G]/2-a2-M1-j1-y.mainAxis:b2-M1-j1-y.mainAxis,r6=V?-A[G]/2+a2+M1+i2+y.mainAxis:Z1+M1+i2+y.mainAxis,A2=c.elements.arrow&&c1(c.elements.arrow),l6=A2?H==="y"?A2.clientTop||0:A2.clientLeft||0:0,z4=(j=S==null?void 0:S[H])!=null?j:0,f6=Q+N2-z4-l6,s6=Q+r6-z4,p4=L1(m?g1(c2,f6):c2,Q,m?X(u1,s6):u1);C[H]=p4,W[H]=p4-Q}if(o){var d4,h6=H==="x"?k:P,m6=H==="x"?O:D,C1=C[x],n2=x==="y"?"height":"width",u4=C1+p[h6],M4=C1-p[m6],y2=[k,P].indexOf(M)!==-1,C4=(d4=S==null?void 0:S[x])!=null?d4:0,H4=y2?u4:C1-A[n2]-T[n2]-C4+y.altAxis,g4=y2?C1+A[n2]+T[n2]-C4-y.altAxis:M4,V4=m&&y2?O4(H4,C1,g4):L1(m?H4:u4,C1,m?g4:M4);C[x]=V4,W[x]=V4-C1}c.modifiersData[i]=W}}var $4={name:"preventOverflow",enabled:!0,phase:"main",fn:K6,requiresIfExists:["offset"]};function O2(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function I2(e){return e===w(e)||!I(e)?b1(e):O2(e)}function J6(e){var c=e.getBoundingClientRect(),a=o1(c.width)/e.offsetWidth||1,i=o1(c.height)/e.offsetHeight||1;return a!==1||i!==1}function B2(e,c,a){a===void 0&&(a=!1);var i=I(c),n=I(c)&&J6(c),t=Z(c),r=Y(e,n,a),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!a)&&((B(c)!=="body"||A1(t))&&(o=I2(c)),I(c)?(l=Y(c,!0),l.x+=c.clientLeft,l.y+=c.clientTop):t&&(l.x=N1(t))),{x:r.left+o.scrollLeft-l.x,y:r.top+o.scrollTop-l.y,width:r.width,height:r.height}}function Q6(e){var c=new Map,a=new Set,i=[];e.forEach(function(t){c.set(t.name,t)});function n(t){a.add(t.name);var r=[].concat(t.requires||[],t.requiresIfExists||[]);r.forEach(function(o){if(!a.has(o)){var l=c.get(o);l&&n(l)}}),i.push(t)}return e.forEach(function(t){a.has(t.name)||n(t)}),i}function R2(e){var c=Q6(e);return E4.reduce(function(a,i){return a.concat(c.filter(function(n){return n.phase===i}))},[])}function Z2(e){var c;return function(){return c||(c=new Promise(function(a){Promise.resolve().then(function(){c=void 0,a(e())})})),c}}function j2(e){var c=e.reduce(function(a,i){var n=a[i.name];return a[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,a},{});return Object.keys(c).map(function(a){return c[a]})}var Y4={placement:"bottom",modifiers:[],strategy:"absolute"};function K4(){for(var e=arguments.length,c=new Array(e),a=0;a(this.setSelectedItem(this.selectedItem-1,!0),!1)),i.register([],"ArrowDown",()=>(this.setSelectedItem(this.selectedItem+1,!0),!1)),i.register([],"Enter",n=>(this.useSelectedItem(n),!1)),i.register([],"Tab",n=>(this.useSelectedItem(n),!1))}chooseSuggestion(c){if(!this.items||!this.items.length)return;let a=this.items[this.selectedItem];a&&this.owner.selectSuggestion(a,c)}onSuggestionClick(c,a){if(c.preventDefault(),!this.suggestions||!this.suggestions.length)return;let i=this.suggestions.indexOf(a);this.setSelectedItem(i,!1),this.useSelectedItem(c)}onSuggestionMouseover(c,a){if(!this.suggestions||!this.suggestions.length)return;let i=this.suggestions.indexOf(a);this.setSelectedItem(i,!1)}empty(){this.containerEl.empty()}setSuggestions(c){this.containerEl.empty();let a=[];c.forEach(i=>{let n=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(i,n),a.push(n)}),this.items=c,this.suggestions=a,this.setSelectedItem(0,!1)}useSelectedItem(c){if(!this.items||!this.items.length)return;let a=this.items[this.selectedItem];a&&this.owner.selectSuggestion(a,c),q.Platform.isMobile&&this.chooseSuggestion(c)}wrap(c,a){return(c%a+a)%a}setSelectedItem(c,a){let i=this.wrap(c,this.suggestions.length),n=this.suggestions[this.selectedItem],t=this.suggestions[i];n&&n.removeClass("is-selected"),t&&t.addClass("is-selected"),this.selectedItem=i,a&&t.scrollIntoView(!1)}},q2=class extends q.FuzzySuggestModal{constructor(c,a,i){super(c);this.items=[];this.scope=new q.Scope;this.emptyStateText="No match found";this.limit=100;this.inputEl=a,this.items=i,this.suggestEl=createDiv("suggestion-container"),this.suggestEl.style.width=`${a.clientWidth}px`,this.contentEl=this.suggestEl.createDiv("suggestion"),this.suggester=new Q4(this,this.contentEl,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",n=>{n.preventDefault()})}empty(){this.suggester.empty()}onInputChanged(){let c=this.modifyInput(this.inputEl.value),a=this.getSuggestions(c);a.length>0?this.suggester.setSuggestions(a.slice(0,this.limit)):this.onNoSuggestion(),this.open()}modifyInput(c){return c}onNoSuggestion(){this.empty(),this.renderSuggestion(null,this.contentEl.createDiv("suggestion-item"))}open(){this.app.keymap.pushScope(this.scope),document.body.appendChild(this.suggestEl),this.popper=F2(this.inputEl,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"flip",options:{fallbackPlacements:["top"]}}]})}close(){this.app.keymap.popScope(this.scope),this.suggester.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}createPrompt(c){this.promptEl||(this.promptEl=this.suggestEl.createDiv("prompt-instructions"));let a=this.promptEl.createDiv("prompt-instruction");for(let i of c)a.appendChild(i)}},U2=class extends q2{constructor(c,a){super(c.app,a.inputEl,c.iconManager.iconDefinitions);this.plugin=c;this.icons=c.iconManager.iconDefinitions,this.text=a,this.createPrompts(),this.inputEl.addEventListener("input",this.getItem.bind(this))}createPrompts(){}getItem(){let c=this.inputEl.value,a=this.icons.find(i=>i.name===c.trim());a!=this.icon&&(this.icon=a,this.icons&&this.onInputChanged())}getItemText(c){return c.name}onChooseItem(c){this.text.setValue(c.name),this.icon=c}selectSuggestion({item:c}){this.text.setValue(c.name),this.icon=c,this.onClose(),this.close()}renderSuggestion(c,a){let{item:i,match:n}=c||{},t=a.createDiv({cls:"suggestion-content icon"});if(!i){t.setText(this.emptyStateText),t.parentElement.addClass("is-selected");return}let r=n.matches.map(l=>createSpan("suggestion-highlight"));for(let l=0;ls[0]===l);if(f){let s=r[n.matches.indexOf(f)];t.appendChild(s),s.appendText(i.name.substring(f[0],f[1])),l+=f[1]-f[0]-1;continue}t.appendText(i.name[l])}let o=createDiv("suggestion-flair admonition-suggester-icon");o.appendChild(this.plugin.iconManager.getIconNode(i)??createDiv()),t.prepend(o),t.createDiv({cls:"suggestion-note",text:this.plugin.iconManager.getIconModuleName(i)})}getItems(){return this.icons}},X4=class extends q2{constructor(c,a,i){super(c.app,a.inputEl,i);this.plugin=c;this.admonitions=[...i],this.text=a,this.createPrompts(),this.inputEl.addEventListener("input",this.getItem.bind(this))}createPrompts(){}getItem(){let c=this.inputEl.value,a=this.admonitions.find(i=>i.type===c.trim());a!=this.admonition&&(this.admonition=a,this.admonitions&&this.onInputChanged())}getItemText(c){return c.type}onChooseItem(c){this.text.setValue(c.type),this.admonition=c}selectSuggestion({item:c}){this.text.setValue(c.type),this.onClose(),this.close()}renderSuggestion(c,a){let{item:i,match:n}=c||{},t=a.createDiv({cls:"suggestion-content icon"});if(!i){t.setText(this.emptyStateText),t.parentElement.addClass("is-selected");return}let r=n.matches.map(l=>createSpan("suggestion-highlight"));for(let l=0;ls[0]===l);if(f){let s=r[n.matches.indexOf(f)];t.appendChild(s),s.appendText(i.type.substring(f[0],f[1])),l+=f[1]-f[0]-1;continue}t.appendText(i.type[l])}let o=createDiv("suggestion-flair admonition-suggester-icon");o.appendChild(this.plugin.iconManager.getIconNode(i.icon)??createDiv()).setAttribute("color",`rgb(${i.color})`),t.prepend(o)}getItems(){return this.admonitions}},z2=class extends q.Modal{constructor(c){super(c.app);this.plugin=c;this.collapse=this.plugin.data.autoCollapse?this.plugin.data.defaultCollapseType:"none";this.containerEl.addClass("insert-admonition-modal"),this.onOpen=()=>this.display(!0)}async display(c){let{contentEl:a}=this;a.empty(),new q.Setting(a).setName("Admonition Type").addText(o=>{o.setPlaceholder("Admonition Type").setValue(this.type);let l=new X4(this.plugin,o,this.plugin.admonitionArray),f=()=>{o.inputEl.value&&this.plugin.admonitions[o.inputEl.value]?(this.type=o.inputEl.value,this.title=this.plugin.admonitions[this.type].title,this.title?.length||(this.title=this.type[0].toUpperCase()+this.type.slice(1).toLowerCase()),n.setValue(this.title)):(new q.Notice("No admonition type by that name exists."),o.inputEl.value=""),this.buildAdmonition()};o.inputEl.onblur=f,l.onClose=f,c&&(l.open(),o.inputEl.focus())});let n;new q.Setting(a).setName("Admonition Title").setDesc("Leave blank to render without a title.").addText(o=>{n=o,o.setValue(this.title),o.onChange(l=>{if(this.title=l,l.length==0?this.noTitle=!0:this.noTitle=!1,this.element){let f=this.plugin.admonitions[this.type],s=this.plugin.getAdmonitionElement(this.type,this.title,f.icon,f.injectColor??this.plugin.data.injectColor?f.color:null,this.collapse);s.createDiv({cls:"admonition-content",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla."}),this.element.replaceWith(s),this.element=s}})}),new q.Setting(a).setName("Make Collapsible").addDropdown(o=>{o.addOption("open","Open"),o.addOption("closed","Closed"),o.addOption("none","None"),o.setValue(this.collapse),o.onChange(l=>{this.collapse=l,this.buildAdmonition()})}),this.admonitionEl=this.contentEl.createDiv(),this.buildAdmonition(),new q.Setting(a).addButton(o=>o.setButtonText("Insert").setCta().onClick(()=>{this.insert=!0,this.close()})).addExtraButton(o=>{o.setIcon("cross").setTooltip("Cancel").onClick(()=>this.close()),o.extraSettingsEl.setAttr("tabindex",0),o.extraSettingsEl.onkeydown=l=>{l.key=="Enter"&&this.close()}})}buildAdmonition(){if(this.admonitionEl.empty(),this.type&&this.plugin.admonitions[this.type]){let c=this.plugin.admonitions[this.type];this.element=this.plugin.getAdmonitionElement(this.type,this.title,c.icon,c.injectColor??this.plugin.data.injectColor?c.color:null,this.collapse),this.element.createDiv({cls:"admonition-content",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla."}),this.admonitionEl.appendChild(this.element)}}};var c3='/*\nTHIS IS A GENERATED/BUNDLED FILE BY ESBUILD\nif you want to view the source, please visit the github repository of this plugin\n*/\n\nfunction T(n,e,i){let t=document.createElement(n);typeof e=="string"&&(e={cls:e});let o=e||{},l=o.cls,s=o.text,a=o.attr,r=o.title,d=o.value,c=o.type,g=i||o.parent,f=o.prepend,m=o.href;return l&&(Array.isArray(l)?t.className=l.join(" "):t.className=l),s&&(t.textContent=s),a&&Object.keys(a).forEach(p=>{let E=a[p];E!==null&&t.setAttribute(p,String(E))}),r&&(t.title=r),d&&(t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLOptionElement)&&(t.value=d),c&&t instanceof HTMLStyleElement&&t.setAttribute("type",c),m&&(t instanceof HTMLAnchorElement||t instanceof HTMLLinkElement)&&(t.href=m),g&&(f?g.insertBefore(t,g.firstChild):g.appendChild(t)),t}var h=function(n,e){return T("div",n,e)};Node.prototype.createDiv=function(n,e){return h(n,this)};Node.prototype.createEl=function(n,e,i){return T(n,e,this)};Element.prototype.addClass=function(...n){let e=[];for(let i=0;i{y(),b()};function w(){return new Promise((n,e)=>{let i=document.querySelector(".markdown-preview-sizer");if(i)n(i);else{let t=new MutationObserver(o=>{for(let l of o)if(l.type=="childList"&&l.addedNodes.length){for(let s of Array.from(l.addedNodes))if(s instanceof HTMLDivElement){if(s.hasClass("publish-renderer")){let a=s.querySelector(".markdown-preview-sizer");a&&(t.disconnect(),n(a))}s.hasClass("markdown-preview-sizer")&&(t.disconnect(),n(i))}}});t.observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}})}async function b(){let n=await w();new MutationObserver(i=>{i.forEach(t=>{t.type=="childList"&&t.addedNodes.length&&t.addedNodes.forEach(o=>{if(o&&o instanceof HTMLDivElement&&!o.childElementCount){let l=new MutationObserver(s=>{for(let a of s)if(a.type=="childList"&&a.addedNodes.length)for(let r of Array.from(a.addedNodes))r instanceof HTMLPreElement&&(!M.has(r)&&Array.from(r.classList).some(d=>/language-ad-(\\w+)/.test(d))?(l.disconnect(),M.add(r),v(r)):(l.disconnect(),H(r)))});l.observe(o,{attributes:!1,childList:!0,characterData:!1,subtree:!1})}o&&o instanceof HTMLElement&&o.children.length&&o.firstElementChild instanceof HTMLPreElement&&H(o.firstElementChild)})})}).observe(n,{attributes:!1,childList:!0,subtree:!1})}function H(n){let e=new MutationObserver(i=>{i.forEach(t=>{t.target instanceof HTMLPreElement&&!M.has(t.target)&&t.type==="attributes"&&t.attributeName==="class"&&Array.from(t.target.classList).some(o=>/language-ad-(\\w+)/.test(o))&&(e.disconnect(),M.add(t.target),v(t.target))})});e.observe(n,{attributes:!0,childList:!1,characterData:!1,subtree:!1})}function v(n){let[,e]=n.classList.toString().match(/language-ad-(\\w+)/);if(!e||!(e in u.ADMONITION_ICON_MAP))return;let{title:i=e[0].toUpperCase()+e.slice(1).toLowerCase(),collapse:t,content:o,icon:l=u.ADMONITION_ICON_MAP[e].icon,color:s=u.ADMONITION_ICON_MAP[e].color}=N(e,n.innerText),a=L(e,i,l,s,t),d=a.createDiv("admonition-content-holder").createDiv("admonition-content");d.innerText=o,n.replaceWith(a)}function y(){let n=document.querySelectorAll("pre[class*=\'language-ad\']");if(!!n.length)for(let e of Array.from(n)){M.add(e);let[,i]=e.classList.toString().match(/language-ad-(\\w+)/);if(!i||!(i in u.ADMONITION_ICON_MAP))continue;let{title:t=i[0].toUpperCase()+i.slice(1).toLowerCase(),collapse:o,content:l,icon:s=u.ADMONITION_ICON_MAP[i].icon,color:a=u.ADMONITION_ICON_MAP[i].color}=N(i,e.innerText),r=L(i,t,s,a,o),c=r.createDiv("admonition-content-holder").createDiv("admonition-content");c.innerText=l,e.replaceWith(r)}}\n';var x3=i1(require("obsidian"));var a3={};var e3={};var i3={};var n3={};var W2={"Admonition Settings":"Admonition Settings","Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.":"Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.","Markdown Syntax Highlighting":"Markdown Syntax Highlighting","Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk.":"Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk."," Sync Links to Metadata Cache":" Sync Links to Metadata Cache","Allows admonitions to be created using ":"Allows admonitions to be created using "," or ":" or ",", instead of using a code block.":", instead of using a code block."," Enable Non-codeblock Admonitions":" Enable Non-codeblock Admonitions","Collapsible by Default":"Collapsible by Default","All admonitions will be collapsible by default. Use ":"All admonitions will be collapsible by default. Use "," to prevent.":" to prevent.","Default Collapse Type":"Default Collapse Type","Collapsible admonitions will be either opened or closed.":"Collapsible admonitions will be either opened or closed.","Add Copy Button":"Add Copy Button","Add a 'copy content' button to admonitions.":"Add a 'copy content' button to admonitions.","Add New":"Add New","Add a new Admonition type.":"Add a new Admonition type.","Add Additional":"Add Additional","Register Commands":"Register Commands","Unregister Commands":"Unregister Commands",Edit:"Edit",Delete:"Delete","Admonition Type":"Admonition Type","Admonition Title":"Admonition Title","This will be the default title for this admonition type.":"This will be the default title for this admonition type.","Admonition type cannot be empty.":"Admonition type cannot be empty.","Admonition type cannot include spaces.":"Admonition type cannot include spaces.","Types must be a valid CSS selector.":"Types must be a valid CSS selector.","Invalid icon name.":"Invalid icon name.","Icon cannot be empty.":"Icon cannot be empty.","Upload Image":"Upload Image","There was an error parsing the image.":"There was an error parsing the image.","Admonition Icon":"Admonition Icon",Color:"Color",Save:"Save","No Admonition Title by Default":"No Admonition Title by Default","The admonition will have no title unless ":"The admonition will have no title unless "," is explicitly provided.":" is explicitly provided.","Show Copy Button":"Show Copy Button","A copy button will be added to the admonition.":"A copy button will be added to the admonition.","Parse Titles as Markdown":"Parse Titles as Markdown","Admonition Titles will be rendered as markdown.":"Admonition Titles will be rendered as markdown."};var t3={};var o3={};var r3={};var l3={};var f3={};var s3={};var h3={};var m3={};var v3={};var z3={};var p3={};var d3={};var u3={};var M3={};var C3={};var H3={};var g3={"Admonition Settings":"Admonition \u8BBE\u7F6E","Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.":"\u5728 admonition \u4EE3\u7801\u5757\u4E2D\u4F7F\u7528 Obsidian \u7684 markdown \u8BED\u6CD5\u9AD8\u4EAE\u3002\u8BE5\u8BBE\u7F6E\u4E3A\u5B9E\u9A8C\u6027\u9009\u9879\uFF0C\u53EF\u80FD\u4F1A\u5F15\u53D1\u9519\u8BEF\u3002","Markdown Syntax Highlighting":"Markdown \u8BED\u6CD5\u9AD8\u4EAE","Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk.":"\u5C1D\u8BD5\u5C06\u5185\u90E8\u94FE\u63A5\u540C\u6B65\u81F3 metadata \u7F13\u5B58\uFF0C\u4EE5\u4FBF\u5728\u56FE\u5F62\u89C6\u56FE\u4E2D\u663E\u793A\u3002\u8FD9\u4E2A\u8BBE\u7F6E\u53EF\u80FD\u4F1A\u4EA7\u751F\u610F\u60F3\u4E0D\u5230\u7684\u540E\u679C\u3002\u4F7F\u7528\u65F6\u8BF7\u81EA\u884C\u627F\u62C5\u98CE\u9669\u3002"," Sync Links to Metadata Cache":" \u540C\u6B65\u94FE\u63A5\u81F3 metadata \u7F13\u5B58","Allows admonitions to be created using ":"\u5141\u8BB8 admonitions \u521B\u5EFA\u4F7F\u7528\uFF0C"," or ":" \u6216 ",", instead of using a code block.":"\uFF0C\u800C\u975E\u4F7F\u7528\u4EE3\u7801\u5757\u3002"," Enable Non-codeblock Admonitions":" \u5141\u8BB8\u975E\u4EE3\u7801\u5757\u7684 Admonitions","Collapsible by Default":"\u9ED8\u8BA4\u6298\u53E0","All admonitions will be collapsible by default. Use ":"\u6240\u6709\u7684 admonitions \u9ED8\u8BA4\u53EF\u6298\u53E0\u3002\u4F7F\u7528 "," to prevent.":" \u6765\u963B\u6B62\u3002","Default Collapse Type":"\u9ED8\u8BA4\u53EF\u6298\u53E0\u7C7B\u578B","Collapsible admonitions will be either opened or closed.":"\u53EF\u6298\u53E0\u7684 admonitions \u5C06\u662F\u6253\u5F00\u7684\u6216\u662F\u5173\u95ED\u7684\u3002","Add Copy Button":"\u6DFB\u52A0\u590D\u5236\u6309\u94AE","Add a 'copy content' button to admonitions.":"\u4E3A admonitions \u65B0\u589E\u4E00\u4E2A\u201C\u590D\u5236\u5185\u5BB9\u201D\u6309\u94AE\u3002","Add New":"\u65B0\u589E","Add a new Admonition type.":"\u6DFB\u52A0\u4E00\u4E2A\u65B0\u7684 Admonition \u7C7B\u578B\u3002","Add Additional":"\u989D\u5916\u6DFB\u52A0","Register Commands":"\u6CE8\u518C\u547D\u4EE4","Unregister Commands":"\u6CE8\u9500\u547D\u4EE4",Edit:"\u7F16\u8F91",Delete:"\u5220\u9664","Admonition Type":"Admonition \u7C7B\u578B","Admonition Title":"Admonition \u540D\u79F0","This will be the default title for this admonition type.":"\u8FD9\u5C06\u4F1A\u6210\u4E3A\u8BE5\u7C7B\u578B admonition \u7684\u9ED8\u8BA4\u540D\u79F0\u3002","Admonition type cannot be empty.":"Admonition \u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A\u3002","Admonition type cannot include spaces.":"Admonition \u7C7B\u578B\u4E0D\u80FD\u5305\u542B\u7A7A\u683C","Types must be a valid CSS selector.":"\u7C7B\u578B\u5FC5\u987B\u4E3A\u5408\u6CD5\u7684 CSS \u9009\u62E9\u5668\u3002","Invalid icon name.":"\u975E\u6CD5\u56FE\u6807\u540D\u79F0\u3002","Icon cannot be empty.":"\u56FE\u6807\u4E0D\u80FD\u4E3A\u7A7A\u3002","Upload Image":"\u4E0A\u4F20\u56FE\u50CF","There was an error parsing the image.":"\u4E0A\u4F20\u56FE\u50CF\u65F6\u51FA\u9519\u4E86\u3002","Admonition Icon":"Admonition \u56FE\u6807",Color:"\u989C\u8272",Save:"\u4FDD\u5B58","No Admonition Title by Default":"\u65E0\u9ED8\u8BA4 Admonition \u540D\u79F0","The admonition will have no title unless ":"\u8BE5 admonition \u5C06\u6CA1\u6709\u540D\u79F0\uFF0C\u9664\u975E "," is explicitly provided.":" \u662F\u660E\u786E\u89C4\u5B9A\u7684\u3002","Show Copy Button":"\u663E\u793A\u590D\u5236\u6309\u94AE","A copy button will be added to the admonition.":"\u4E00\u4E2A\u590D\u5236\u6309\u94AE\u5C06\u88AB\u6DFB\u52A0\u81F3\u8BE5 admonition ","Parse Titles as Markdown":"\u5C06\u540D\u79F0\u8F6C\u53D8\u4E3A Markdown","Admonition Titles will be rendered as markdown.":"Admonition \u540D\u79F0\u5C06\u4EE5 markdown \u5F62\u5F0F\u5448\u73B0\u3002"};var V3={};var a8={ar:a3,cs:e3,da:i3,de:n3,en:W2,"en-gb":t3,es:o3,fr:r3,hi:l3,id:f3,it:s3,ja:h3,ko:m3,nl:v3,nn:z3,pl:p3,pt:d3,"pt-br":u3,ro:M3,ru:C3,tr:H3,"zh-cn":g3,"zh-tw":V3},L3=a8[x3.moment.locale()];function L(e){return L3&&L3[e]||W2[e]}var K1=i1(require("obsidian"));async function b3(e,c,a={cta:"Yes",secondary:"No"}){return new Promise((i,n)=>{try{let t=new N3(e,c,a);t.onClose=()=>{i(t.confirmed)},t.open()}catch{n()}})}var N3=class extends K1.Modal{constructor(c,a,i){super(c);this.text=a;this.buttons=i;this.confirmed=!1}async display(){this.contentEl.empty(),this.contentEl.addClass("confirm-modal"),this.contentEl.createEl("p",{text:this.text});let c=this.contentEl.createDiv("fantasy-calendar-confirm-buttons");new K1.ButtonComponent(c).setButtonText(this.buttons.cta).setCta().onClick(()=>{this.confirmed=!0,this.close()}),new K1.ButtonComponent(c).setButtonText(this.buttons.secondary).onClick(()=>{this.close()})}onOpen(){this.display()}};var y1={octicons:"Octicons",rpg:"RPG Awesome"};var e8=(e=>c=>{try{e.querySelector(c)}catch{return!1}return!0})(document.createDocumentFragment()),e1=class{static validateImport(c,a){let i={success:!0,messages:[]},n=e1.validateType(a.type,c);if(n.success==!1)return n;let t=typeof a.icon=="string"?a.icon:typeof a.icon=="object"?a.icon?.name:null,r=e1.validateType(t,c);if(r.success==!1)return r;if(c.iconManager.getIconNode(a.icon)||i.messages.push("No installed icon found by the name "+t+". Perhaps you need to install a new icon pack?"),a.title&&typeof a.title!="string")return{success:!1,failed:"title",message:"Admonition titles can only be strings."};(!("color"in a)||!/(?:(?:2(?:[0-4]\d|5[0-5])|\d{1,2}|1\d\d)\s*,\s*){2}\s*(?:2(?:[0-4]\d|5[0-5])|\d{1,2}|1\d\d)/.test(a.color))&&(console.warn("No color provided for the import of "+a.type+". Adding a random color."),a.color=`${Math.floor(Math.random()*255)}, ${Math.floor(Math.random()*255)}, ${Math.floor(Math.random()*255)}`);let l=["command","injectColor","noTitle","copy"];for(let f of l)if(f in a&&typeof JSON.parse(JSON.stringify(a[f]))!="boolean")return{success:!1,failed:"booleans",message:`The "${f}" property must be a boolean if present.`};return i}static validate(c,a,i,n){let t=e1.validateType(a,c,n);return t.success==!1?t:e1.validateIcon(i,c)}static validateType(c,a,i){return c.length?c.includes(" ")?{success:!1,message:L("Admonition type cannot include spaces."),failed:"type"}:e8(c)?c!=i&&c in a.data.userAdmonitions?{success:!1,message:"That Admonition type already exists.",failed:"type"}:{success:!0}:{success:!1,message:L("Types must be a valid CSS selector."),failed:"type"}:{success:!1,message:L("Admonition type cannot be empty."),failed:"type"}}static validateIcon(c,a){return c.length?a.iconManager.getIconType(c)?{success:!0}:{success:!1,message:L("Invalid icon name."),failed:"icon"}:{success:!1,message:L("Icon cannot be empty."),failed:"icon"}}};var B1=i1(require("obsidian")),p2=class extends B1.Modal{constructor(c){super(app);this.plugin=c;this.admonitionDefinitions=Object.values(this.plugin.data.userAdmonitions);this.admonitionNames=Object.keys(this.plugin.data.userAdmonitions);this.selectedAdmonitions=[...this.admonitionNames];this.export=!1}onOpen(){this.titleEl.setText("Export Admonitions"),this.containerEl.addClasses(["admonition-settings","admonition-modal","admonition-export-modal"]),new B1.Setting(this.contentEl).addButton(a=>a.setButtonText("Export Selected").onClick(()=>{this.export=!0,this.close()}));let c;new B1.Setting(this.contentEl).addButton(a=>a.setButtonText("Select All").setCta().onClick(()=>{this.selectedAdmonitions=[...this.admonitionNames],this.generateToggles(c)})).addButton(a=>a.setButtonText("Deselect All").onClick(()=>{this.selectedAdmonitions=[],this.generateToggles(c)})),c=this.contentEl.createDiv("additional"),this.generateToggles(c)}generateToggles(c){c.empty();for(let a of this.admonitionNames)new B1.Setting(c).setName(a).addToggle(i=>{i.setValue(this.selectedAdmonitions.includes(a)).onChange(n=>{n?this.selectedAdmonitions.push(a):this.selectedAdmonitions.remove(a)})})}};var rk=(e=>c=>{try{e.querySelector(c)}catch{return!1}return!0})(document.createDocumentFragment()),d2=class extends z.PluginSettingTab{constructor(c,a){super(c,a);this.plugin=a;this.queue=[];this.converted=0}async display(){this.containerEl.empty(),this.containerEl.addClass("admonition-settings"),this.containerEl.createEl("h2",{text:L("Admonition Settings")});let c=this.containerEl.createDiv("admonitions-nested-settings");z.Platform.isMobile||new z.Setting(c).setName("Export Custom Types as CSS").setDesc("Export a CSS snippet for custom callout types.").addButton(i=>i.setIcon("download").onClick(()=>{let n=[`/* This snippet was auto-generated by the Admonitions plugin */ `],t=new Blob([this.plugin.calloutManager.generateCssString()],{type:"text/css"});createEl("a",{attr:{download:"custom_callouts.css",href:URL.createObjectURL(t)}}).click()}).setDisabled(!Object.keys(this.plugin.data.userAdmonitions).length)),new z.Setting(c).setName("Export Custom Types as JSON").setDesc("Choose custom types to export as a JSON file that you can then share with other users.").addButton(i=>i.setButtonText("Download All").setCta().onClick(()=>{let n=Object.values(this.plugin.data.userAdmonitions);this.download(n)})).addButton(i=>i.setButtonText("Select & Download").onClick(()=>{let n=new p2(this.plugin);n.onClose=()=>{if(!n.export)return;let t=Object.values(this.plugin.data.userAdmonitions);this.download(t.filter(r=>n.selectedAdmonitions.includes(r.type)))},n.open()})),new z.Setting(c).setName("Use CSS Snippet for Custom Callouts").setDesc("Instead of managing it internally, Admonitions will maintain a CSS snippet to enable your custom types for callouts.").addToggle(i=>i.setValue(this.plugin.data.useSnippet).onChange(n=>{this.plugin.data.useSnippet=n,this.plugin.saveSettings(),this.plugin.calloutManager.setUseSnippet()})),new z.Setting(c).setName(L("Add New")).setDesc("Add a new Admonition type. All custom Admonitions will also be usable as callouts.").addButton(i=>i.setTooltip(L("Add Additional")).setButtonText("+").onClick(async()=>{let t=new l1(this.plugin);t.onClose=async()=>{if(t.saved){let r={type:t.type,color:t.color,icon:t.icon,command:!1,title:t.title,injectColor:t.injectColor,noTitle:t.noTitle,copy:t.copy};this.plugin.addAdmonition(r),this.plugin.calloutManager.addAdmonition(r),this.display()}},t.open()})),new z.Setting(c).setName("Import Admonition(s)").setDesc("Import admonitions from a JSON definition.").addButton(i=>{let n=createEl("input",{attr:{type:"file",name:"merge",accept:".json",multiple:!0,style:"display: none;"}});n.onchange=async()=>{let{files:t}=n;if(!!t.length){try{let r=[];for(let o of Array.from(t))r.push(JSON.parse(await o.text()));for(let o of r.flat()){if(typeof o!="object")continue;o.icon||(o.icon={name:"pencil-alt",type:"font-awesome"});let l=e1.validateImport(this.plugin,o);if(l.success==!1){new z.Notice(createFragment(f=>{f.createSpan({text:`There was an issue importing the ${o.type} admonition:`}),f.createEl("br"),f.createSpan({text:l.message})}));continue}l.messages?.length&&new z.Notice(createFragment(f=>{f.createSpan({text:`There was an issue importing the ${o.type} admonition:`});for(let s of l.messages)f.createEl("br"),f.createSpan({text:s})})),await this.plugin.addAdmonition(o)}this.display()}catch(r){new z.Notice(`There was an error while importing the admonition${t.length==1?"":"s"}.`),console.error(r)}n.value=null}},i.setButtonText("Choose Files"),i.buttonEl.appendChild(n),i.onClick(()=>n.click())}).addExtraButton(i=>i.setIcon("info").onClick(()=>{let n=new z.Modal(this.plugin.app);n.onOpen=()=>{n.contentEl.createSpan({text:"Import one or more admonition definitions as a JSON array. An admonition definition should look as follows at minimum:"}),n.contentEl.createEl("br");let t=new z.TextAreaComponent(n.contentEl.createDiv()).setDisabled(!0).setValue(JSON.stringify({type:"embed-affliction",color:"149, 214, 148",icon:{name:"head-side-cough",type:"font-awesome"}},null,4));t.inputEl.setAttribute("style",`height: ${t.inputEl.scrollHeight}px; resize: none;`),n.contentEl.createEl("br"),n.contentEl.createSpan({text:"See the plugin ReadMe for more information."})},n.open()})),this.additionalEl=c.createDiv("additional"),this.buildTypes(),this.buildAdmonitions(this.containerEl.createEl("details",{cls:"admonitions-nested-settings",attr:{...this.plugin.data.open.admonitions?{open:!0}:{}}})),this.buildIcons(this.containerEl.createEl("details",{cls:"admonitions-nested-settings",attr:{...this.plugin.data.open.icons?{open:!0}:{}}})),this.buildOtherSyntaxes(this.containerEl.createEl("details",{cls:"admonitions-nested-settings",attr:{...this.plugin.data.open.other?{open:!0}:{}}})),this.buildAdvanced(this.containerEl.createEl("details",{cls:"admonitions-nested-settings",attr:{...this.plugin.data.open.advanced?{open:!0}:{}}})),this.containerEl.createDiv("coffee").createEl("a",{href:"https://www.buymeacoffee.com/valentine195"}).createEl("img",{attr:{src:"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=\u2615&slug=valentine195&button_colour=e3e7ef&font_colour=262626&font_family=Inter&outline_colour=262626&coffee_colour=ff0000"}})}download(c){if(!c.length){new z.Notice("At least one admonition must be chosen to export.");return}let a=createEl("a"),i=new Blob([JSON.stringify(c)],{type:"json"}),n=URL.createObjectURL(i);a.href=n,a.download="admonitions.json",a.click(),URL.revokeObjectURL(n)}buildAdmonitions(c){c.empty(),c.ontoggle=()=>{this.plugin.data.open.admonitions=c.open,this.plugin.saveSettings()};let a=c.createEl("summary");new z.Setting(a).setHeading().setName("Admonitions & Callouts"),a.createDiv("collapser").createDiv("handle"),new z.Setting(c).setName("Add Drop Shadow").setDesc("A drop shadow will be added to admonitions.").addToggle(i=>{i.setValue(this.plugin.data.dropShadow).onChange(async n=>{this.plugin.data.dropShadow=n,this.display(),await this.plugin.saveSettings()})}),new z.Setting(c).setName(L("Collapsible by Default")).setDesc(createFragment(i=>{i.createSpan({text:"All admonitions & callouts will be collapsible by default. Use "}),i.createEl("code",{text:"collapse: none"}),i.createSpan({text:L(" to prevent.")})})).addToggle(i=>{i.setValue(this.plugin.data.autoCollapse).onChange(async n=>{this.plugin.data.autoCollapse=n,this.display(),await this.plugin.saveSettings()})}),this.plugin.data.autoCollapse&&new z.Setting(c).setName(L("Default Collapse Type")).setDesc("Collapsible admonitions & callouts will be either opened or closed.").addDropdown(i=>{i.addOption("open","open"),i.addOption("closed","closed"),i.setValue(this.plugin.data.defaultCollapseType),i.onChange(async n=>{this.plugin.data.defaultCollapseType=n,await this.plugin.saveSettings()})}),new z.Setting(c).setName(L("Add Copy Button")).setDesc("Add a 'copy content' button to admonitions & callouts.").addToggle(i=>{i.setValue(this.plugin.data.copyButton),i.onChange(async n=>{this.plugin.data.copyButton=n,n||document.querySelectorAll(".admonition-content-copy").forEach(t=>{t.detach()}),await this.plugin.saveSettings()})}),new z.Setting(c).setName(L("Parse Titles as Markdown")).setDesc(L("Admonition Titles will be rendered as markdown.")).addToggle(i=>{i.setValue(this.plugin.data.parseTitles),i.onChange(async n=>{this.plugin.data.parseTitles=n,await this.plugin.saveSettings()})}),new z.Setting(c).setName("Set Admonition Colors").setDesc("Disable this setting to turn off admonition coloring by default. Can be overridden in the admonition definition.").addToggle(i=>i.setValue(this.plugin.data.injectColor).setTooltip(`${this.plugin.data.injectColor?"Disable":"Enable"} Admonition Color`).onChange(async n=>{this.plugin.data.injectColor=n,await this.plugin.saveSettings(),await this.buildTypes()})),new z.Setting(c).setName("Hide Empty Admonitions").setDesc("Any admonition that does not have content inside it will be hidden.").addToggle(i=>i.setValue(this.plugin.data.hideEmpty).onChange(async n=>{this.plugin.data.hideEmpty=n,await this.plugin.saveSettings(),await this.buildTypes()}))}buildIcons(c){c.empty(),c.ontoggle=()=>{this.plugin.data.open.icons=c.open,this.plugin.saveSettings()};let a=c.createEl("summary");new z.Setting(a).setHeading().setName("Icon Packs"),a.createDiv("collapser").createDiv("handle"),new z.Setting(c).setName("Use Font Awesome Icons").setDesc("Font Awesome Free icons will be available in the item picker. Existing Admonitions defined using Font Awesome icons will continue to work.").addToggle(r=>{r.setValue(this.plugin.data.useFontAwesome).onChange(o=>{this.plugin.data.useFontAwesome=o,this.plugin.iconManager.setIconDefinitions(),this.plugin.saveSettings()})});let i,n=Object.entries(y1).filter(([r])=>!this.plugin.data.icons.includes(r));new z.Setting(c).setName("Load Additional Icons").setDesc("Load an additional icon pack. This requires an internet connection.").addDropdown(r=>{if(!n.length){r.setDisabled(!0);return}for(let[o,l]of n)r.addOption(o,l);r.onChange(o=>i=o),i=r.getValue()}).addExtraButton(r=>{r.setIcon("plus-with-circle").setTooltip("Load").onClick(async()=>{!i||!i.length||(await this.plugin.iconManager.downloadIcon(i),this.buildIcons(c))}),n.length||r.setDisabled(!0)});let t=c.createDiv("admonitions-nested-settings");new z.Setting(t);for(let r of this.plugin.data.icons)new z.Setting(t).setName(y1[r]).addExtraButton(o=>{o.setIcon("reset").setTooltip("Redownload").onClick(async()=>{await this.plugin.iconManager.removeIcon(r),await this.plugin.iconManager.downloadIcon(r),this.buildIcons(c)})}).addExtraButton(o=>{o.setIcon("trash").onClick(async()=>{Object.values(this.plugin.data.userAdmonitions).find(l=>l.icon.type==r)&&!await b3(this.plugin.app,"You have Admonitions using icons from this pack. Are you sure you want to remove it?")||(await this.plugin.iconManager.removeIcon(r),this.buildIcons(c))})})}buildOtherSyntaxes(c){c.empty(),c.ontoggle=()=>{this.plugin.data.open.other=c.open,this.plugin.saveSettings()};let a=c.createEl("summary");new z.Setting(a).setHeading().setName("Additional Syntaxes"),a.createDiv("collapser").createDiv("handle"),c.createEl("p",{text:"Obsidian 0.14 has introduced Callout boxes to its core functionality using the same syntax as the Microsoft Document callouts.",cls:"setting-item"}),c.createEl("p",{text:"This has rendered the Microsoft Document syntax for Admonitions obsolete, but Admonitions can still be used to create and manage your custom callout types.",cls:"setting-item"}),c.createEl("p",{text:"Your existing code block Admonitions will always work!",cls:"setting-item"}),this.plugin.data.msDocConverted||new z.Setting(c).setName("Convert MSDoc Admonitions to Callouts").setDesc(createFragment(i=>{let n=i.createDiv("admonition-convert");(0,z.setIcon)(n.createSpan(),F1),n.createSpan({text:"This "}),n.createEl("strong",{text:"will"}),n.createSpan({text:" modify notes. Use at your own risk and please make backups."}),i.createEl("p",{text:"With large vaults, this could take awhile!"})})).addButton(i=>i.setButtonText("Convert").setCta().onClick(()=>{this.queue=this.plugin.app.vault.getMarkdownFiles(),this.notice=new z.Notice(createFragment(n=>{let t=n.createDiv("admonition-convert");t.createSpan({text:"Converting MS-doc admonitions..."}),(0,z.setIcon)(t.createSpan("admonition-convert-icon"),q1)}),0),this.checkAndReplace()})),new z.Setting(c).setName("Convert Codeblock Admonitions to Callouts").setDesc(createFragment(i=>{let n=i.createDiv("admonition-convert");(0,z.setIcon)(n.createSpan(),F1),n.createSpan({text:"This "}),n.createEl("strong",{text:"will"}),n.createSpan({text:" modify notes. Use at your own risk and please make backups."}),i.createEl("p",{text:"With large vaults, this could take awhile!"})})).addButton(i=>i.setButtonText("Convert").setCta().onClick(()=>{this.queue=this.plugin.app.vault.getMarkdownFiles(),this.notice=new z.Notice(createFragment(n=>{let t=n.createDiv("admonition-convert");t.createSpan({text:"Converting Codeblock admonitions..."}),(0,z.setIcon)(t.createSpan("admonition-convert-icon"),q1)}),0),this.converted=0,this.checkAndReplaceCodeBlocks()}))}async checkAndReplace(){if(!this.queue.length){this.converted?this.notice.setMessage(`${this.converted} MS-doc Admonitions converted!`):this.notice.setMessage("No MS-doc Admonitions found to convert."),this.plugin.data.msDocConverted=!0,this.plugin.saveSettings().then(()=>this.display()),setTimeout(()=>{this.notice.hide(),this.notice=void 0},2e3);return}setTimeout(async()=>{let c=this.queue.shift(),a=await this.app.vault.read(c);/> \[!([^ :]+)(?::[ ]?(.+))\](x|\+|\-)?/.test(a)&&(this.converted++,await this.plugin.app.vault.modify(c,a.replace(/> \[!([^ :]+)(?::[ ]?(.+))\](x|\+|\-)?/g,"> [!$1]$3 $2"))),this.checkAndReplace()})}async checkAndReplaceCodeBlocks(){if(!this.queue.length){this.converted?this.notice.setMessage(`${this.converted} Codeblock Admonitions converted!`):this.notice.setMessage("No Codeblock Admonitions found to convert."),this.display(),setTimeout(()=>{this.notice.hide(),this.notice=void 0},2e3);return}setTimeout(async()=>{let c=this.queue.shift(),a=await this.app.vault.read(c);/^(`{3,})ad-(\w+)([\s\S]*?)?\n^\1/m.test(a)&&(a=this.replaceCodeBlockInPlace(a),this.app.vault.modify(c,a)),this.checkAndReplaceCodeBlocks()})}replaceCodeBlockInPlace(c){let a=c.match(/^(`{3,})ad-(\w+)([\s\S]*?)?\n^\1/gm)??[];for(let i of a){let[,n]=i.match(/^`{3,}ad-(\w+)/),t="",r="";if(!n)continue;let o=[],l=!0;for(let s of i.split(` `).slice(1,-1)){if(l){if(/^title:/.test(s)){t=s.match(/^title:(.*)/)?.[1].trim()??n[0].toUpperCase()+n.slice(1).toLowerCase();continue}if(/^collapse:/.test(s)){r=(s.match(/^collapse:\s?(.*)/)?.[1].trim()??"open")=="open"?"+":"-";continue}/^(title|collapse|color|icon):/.test(s)||(l=!1)}o.push(s)}let f=o.join(` @@ -470,10 +470,10 @@ var v6=Object.create;var t2=Object.defineProperty;var z6=Object.getOwnPropertyDe `];for(let a of Array.from(this.sheet.cssRules))c.push(a.cssText);return c.join(` -`)}addAdmonition(c){if(!c.icon)return;let a,i=c.injectColor??this.plugin.data.injectColor?`--callout-color: ${c.color};`:"";c.icon.type=="obsidian"?a=`.callout[data-callout="${c.type}"] { +`)}addAdmonition(c){if(!c.icon)return;let a,i=c.injectColor??this.plugin.data.injectColor?`--callout-color: ${c.color};`:"";c.icon.type=="obsidian"?a=`.callout[data-callout="${c.type.toLowerCase()}"] { ${i} --callout-icon: ${c.icon.name}; /* Icon name from the Obsidian Icon Set */ -}`:a=`.callout[data-callout="${c.type}"] { +}`:a=`.callout[data-callout="${c.type.toLowerCase()}"] { ${i} --callout-icon: '${(this.plugin.iconManager.getIconNode(c.icon)?.outerHTML??"").replace(/(width|height)=(\\?"|')\d+(\\?"|')/g,"")}'; }`,this.indexing.contains(c.type)&&this.sheet.deleteRule(this.indexing.indexOf(c.type)),this.indexing=[...this.indexing.filter(n=>n!=c.type),c.type],this.sheet.insertRule(a,this.sheet.cssRules.length),this.updateSnippet()}removeAdmonition(c){if(!this.indexing.contains(c.type))return;let a=this.indexing.indexOf(c.type);this.sheet.deleteRule(a),this.indexing.splice(a,1),this.updateSnippet()}get sheet(){return this.style.sheet}unload(){this.style.detach()}get snippetPath(){return this.plugin.app.customCss.getSnippetPath(this.plugin.data.snippetPath)}setUseSnippet(){this.plugin.data.useSnippet&&this.updateSnippet()}async updateSnippet(){!this.plugin.data.useSnippet||(await this.plugin.app.vault.adapter.exists(this.snippetPath)?await this.plugin.app.vault.adapter.write(this.snippetPath,this.generateCssString()):await this.plugin.app.vault.create(this.snippetPath,this.generateCssString()),this.plugin.app.customCss.setCssEnabledStatus(this.plugin.data.snippetPath,!0),this.plugin.app.customCss.readSnippets())}};var Zb={userAdmonitions:{},syntaxHighlight:!1,copyButton:!1,version:"",autoCollapse:!1,defaultCollapseType:"open",injectColor:!0,parseTitles:!0,dropShadow:!0,hideEmpty:!1,open:{admonitions:!0,icons:!0,other:!0,advanced:!1},icons:[],useFontAwesome:!0,rpgDownloadedOnce:!1,msDocConverted:!1,useSnippet:!1,snippetPath:`custom-admonitions.${[...Array(6).keys()].map(()=>(16*Math.random()|0).toString(16)).join("")}`},v4=class extends b.Plugin{constructor(){super(...arguments);this.postprocessors=new Map;this.iconManager=new f4(this)}get types(){return Object.keys(this.admonitions)}get admonitionArray(){return Object.keys(this.admonitions).map(c=>({...this.admonitions[c],type:c}))}async onload(){console.log("Obsidian Admonition loaded"),this.postprocessors=new Map,await this.loadSettings(),await this.iconManager.load(),this.app.workspace.onLayoutReady(async()=>{this.addChild(this.calloutManager=new L2(this)),this.registerEditorSuggest(new m4(this)),Object.keys(this.admonitions).forEach(c=>{this.registerType(c)}),this.addSettingTab(new d2(this.app,this)),(0,b.addIcon)(o2,N4),(0,b.addIcon)(r2,A4),(0,b.addIcon)(F1,y4),(0,b.addIcon)(q1,S4),this.addCommand({id:"collapse-admonitions",name:"Collapse Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(b.MarkdownView);let a=this.app.workspace.getActiveViewOfType(b.MarkdownView);if(!a||!(a instanceof b.MarkdownView))return;let i=a.contentEl.querySelectorAll("details[open].admonition-plugin");for(let n=0;n{if(c)return!!this.app.workspace.getActiveViewOfType(b.MarkdownView);let a=this.app.workspace.getActiveViewOfType(b.MarkdownView);if(!a||!(a instanceof b.MarkdownView))return;let i=a.contentEl.querySelectorAll("details:not([open]).admonition-plugin");for(let n=0;n{let i=new z2(this);i.onClose=()=>{if(!i.insert)return;let n="",t="";i.title.length&&i.title.toLowerCase()!=i.type.toLowerCase()&&(n=`title: ${i.title} diff --git a/.obsidian/plugins/obsidian-admonition/manifest.json b/.obsidian/plugins/obsidian-admonition/manifest.json index 0d91bf69..d81de71d 100644 --- a/.obsidian/plugins/obsidian-admonition/manifest.json +++ b/.obsidian/plugins/obsidian-admonition/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-admonition", "name": "Admonition", - "version": "9.2.2", + "version": "9.2.3", "minAppVersion": "1.1.0", "description": "Enhanced callouts for Obsidian.md", "author": "Jeremy Valentine", diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json index c4e69d83..d0cee27a 100644 --- a/.obsidian/plugins/obsidian-commits/data.json +++ b/.obsidian/plugins/obsidian-commits/data.json @@ -1400,7 +1400,7 @@ "links": 3 }, "02.03 Zürich/@@Zürich.md": { - "size": 2331, + "size": 3165, "tags": 3, "links": 6 }, @@ -1575,7 +1575,7 @@ "links": 1 }, "01.02 Home/Household.md": { - "size": 1906, + "size": 2150, "tags": 2, "links": 2 }, @@ -5952,7 +5952,7 @@ "00.01 Admin/Calendars/2022-08-07.md": { "size": 1108, "tags": 0, - "links": 4 + "links": 5 }, "00.01 Admin/Calendars/2022-06-04.md": { "size": 1167, @@ -6917,7 +6917,7 @@ "00.01 Admin/Calendars/2022-12-29.md": { "size": 1098, "tags": 0, - "links": 4 + "links": 5 }, "00.01 Admin/Calendars/2022-12-30.md": { "size": 1212, @@ -9182,12 +9182,12 @@ "00.01 Admin/Calendars/2023-04-10.md": { "size": 1412, "tags": 0, - "links": 6 + "links": 8 }, "00.03 News/Saving the Horses of Our Imagination.md": { "size": 35135, "tags": 3, - "links": 1 + "links": 2 }, "00.03 News/Gambler Who Beat Roulette Found Way to Win Beyond Red or Black.md": { "size": 41340, @@ -9217,7 +9217,7 @@ "00.03 News/The Case of the Fake Sherlock.md": { "size": 45216, "tags": 4, - "links": 1 + "links": 2 }, "01.07 Animals/@Sally.md": { "size": 1469, @@ -9262,22 +9262,22 @@ "00.01 Admin/Calendars/2023-04-16.md": { "size": 1412, "tags": 0, - "links": 5 + "links": 6 }, "00.03 News/Behind the Scenes of Barack Obama’s Reading Lists.md": { "size": 14917, "tags": 4, - "links": 1 + "links": 2 }, "00.03 News/“It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later.md": { "size": 16089, "tags": 4, - "links": 1 + "links": 2 }, "00.03 News/Inside Rupert Murdoch’s Succession Drama.md": { "size": 39792, - "tags": 5, - "links": 1 + "tags": 4, + "links": 2 }, "03.02 Travels/Cassai Beach House.md": { "size": 1559, @@ -9347,7 +9347,7 @@ "00.03 News/The Fox News Trial Starts Tomorrow. Fox Is Already Losing..md": { "size": 18473, "tags": 5, - "links": 1 + "links": 2 }, "01.07 Animals/2023-04-17 Health check.md": { "size": 821, @@ -9373,14 +9373,74 @@ "size": 843, "tags": 3, "links": 6 + }, + "00.01 Admin/Calendars/2023-04-20.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "00.01 Admin/Calendars/2023-04-21.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "00.01 Admin/Calendars/2023-04-22.md": { + "size": 1255, + "tags": 0, + "links": 4 + }, + "00.03 News/The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists.md": { + "size": 27623, + "tags": 4, + "links": 1 + }, + "00.01 Admin/Calendars/Events/2023-04-21 Angers SCO - PSG (1-2).md": { + "size": 247, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2023-04-23.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "00.03 News/My High-Flying Life as a Corporate Spy Who Lied His Way to the Top.md": { + "size": 42852, + "tags": 4, + "links": 2 + }, + "00.03 News/Dril Is Everyone. More Specifically, He’s a Guy Named Paul..md": { + "size": 34625, + "tags": 4, + "links": 2 + }, + "00.03 News/What Was Twitter, Anyway.md": { + "size": 50248, + "tags": 3, + "links": 2 + }, + "03.02 Travels/Cannavacciuolo Bistrot.md": { + "size": 1590, + "tags": 1, + "links": 1 + }, + "00.01 Admin/Calendars/2023-04-24.md": { + "size": 1255, + "tags": 0, + "links": 6 + }, + "00.01 Admin/Calendars/2023-04-25.md": { + "size": 1412, + "tags": 0, + "links": 5 } }, "commitTypes": { "/": { - "Refactor": 2823, - "Create": 1687, - "Link": 4073, - "Expand": 1633 + "Refactor": 2836, + "Create": 1700, + "Link": 4107, + "Expand": 1639 } }, "dailyCommits": { @@ -9392,39 +9452,45 @@ "4": 17, "5": 13, "6": 64, - "7": 643, - "8": 831, - "9": 704, - "10": 522, - "11": 410, + "7": 652, + "8": 840, + "9": 707, + "10": 526, + "11": 412, "12": 381, - "13": 444, - "14": 418, + "13": 445, + "14": 419, "15": 443, "16": 569, - "17": 567, - "18": 773, - "19": 505, + "17": 585, + "18": 775, + "19": 514, "20": 474, - "21": 495, - "22": 462, - "23": 1237 + "21": 501, + "22": 463, + "23": 1238 } }, "weeklyCommits": { "/": { - "Mon": 2317, - "Tue": 1296, + "Mon": 2323, + "Tue": 1307, "Wed": 1339, - "Thu": 864, - "Fri": 938, + "Thu": 869, + "Fri": 943, "Sat": 0, - "Sun": 3462 + "Sun": 3501 } }, "recentCommits": { "/": { "Expanded": [ + " Household ", + " Cannavacciuolo Bistrot ", + " @@Zürich ", + " @@Zürich ", + " 2023-04-21 Angers SCO - PSG (1-2) ", + " 2023-04-21 Angers SCO - PSG ", " 2023-04-17 Health check ", " 2023-04-19 First S&B ", " 2023-04-19 First S&B ", @@ -9469,15 +9535,22 @@ " Template Animal ", " 2023-04-08 OGC Nice - PSG ", " @Shopping list ", - " Configuring UFW ", - " Hosting Tasks ", - " Household ", - " Mallorca ", - " @@Travels ", - " Server Alias ", - " 2023-03-26 Mallorca " + " Configuring UFW " ], "Created": [ + " 2023-04-25 ", + " 2023-04-24 ", + " Untitled ", + " What Was Twitter, Anyway ", + " Dril Is Everyone. More Specifically, He’s a Guy Named Paul. ", + " My High-Flying Life as a Corporate Spy Who Lied His Way to the Top ", + " The Man Who Settled the Fox-Dominion Defamation Case From a Romanian Tour Bus ", + " 2023-04-23 ", + " The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists ", + " 2023-04-22 ", + " 2023-04-21 Angers SCO - PSG ", + " 2023-04-21 ", + " 2023-04-20 ", " Untitled ", " Untitled ", " 2023-04-19 ", @@ -9515,22 +9588,17 @@ " Untitled ", " 2023-04-11 ", " Rebel Without a Cause (1955) ", - " Clarence Thomas Secretly Accepted Luxury Trips From Major GOP Donor ", - " Gambler Who Beat Roulette Found Way to Win Beyond Red or Black ", - " Saving the Horses of Our Imagination ", - " 2023-04-10 ", - " Untitled ", - " 2023-04-09 ", - " Untitled ", - " Untitled ", - " 2023-04-08 OGC Nice - PSG ", - " 2023-04-08 ", - " 2023-04-07 ", - " The Guard (2011) ", - " 2023-04-06 ", - " 2023-04-05 " + " Clarence Thomas Secretly Accepted Luxury Trips From Major GOP Donor " ], "Renamed": [ + " Cannavacciuolo Bistrot ", + " Cannavacciuolo Bistrot ", + " Cannavacciuolo Bistro ", + " What Was Twitter, Anyway ", + " Dril Is Everyone. More Specifically, He’s a Guy Named Paul. ", + " My High-Flying Life as a Corporate Spy Who Lied His Way to the Top ", + " 2023-04-21 Angers SCO - PSG (1-2) ", + " The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists ", " 2023-04-19 First S&B ", " Juan Bautista Bossio ", " L'Aube ", @@ -9573,17 +9641,14 @@ " The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow ", " We want objective judges and doctors. Why not journalists too ", " Thank You for Smoking (2005) ", - " The Fran Lebowitz Reader ", - " Au Revoir Là-Haut ", - " How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution ", - " Gisele Bündchen on Tom Brady, FTX Blind Side, and Being a “Witch of Love” ", - " I Went on a Package Trip for Millennials Who Travel Alone. Help Me. ", - " Jaylen Brown Is Trying to Find a Balance ", - " Narro ", - " How an FBI agent stained an NCAA basketball corruption probe ", - " Last Stand of the Hot Dog King " + " The Fran Lebowitz Reader " ], "Tagged": [ + " Cannavacciuolo Bistrot ", + " Dril Is Everyone. More Specifically, He’s a Guy Named Paul. ", + " What Was Twitter, Anyway ", + " My High-Flying Life as a Corporate Spy Who Lied His Way to the Top ", + " The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists ", " 2023-04-19 First S&B ", " Juan Bautista Bossio ", " L'Aube ", @@ -9629,14 +9694,11 @@ " The Limits and Wonders of John Wick’s Last Fight ", " Last Stand of the Hot Dog King ", " Zaalouk ", - " Adam Sandler doesn’t need your respect. But he’s getting it anyway. ", - " How an FBI agent stained an NCAA basketball corruption probe - Los Angeles Times ", - " Leopards Are Living among People. And That Could Save the Species ", - " Why Joe Biden’s Honeymoon With Progressives Is Coming to an End ", - " Are Helicopter Parents Actually Lazy ", - " The Brilliant Inventor Who Made Two of History’s Biggest Mistakes " + " Adam Sandler doesn’t need your respect. But he’s getting it anyway. " ], "Refactored": [ + " 2023-04-24 ", + " 2023-04-22 ", " Mallorca ", " Mallorca ", " Household ", @@ -9685,11 +9747,10 @@ " NewBookmark ", " NewBookmark ", " @Short breaks ", - " Florence ", - " @Short breaks ", - " Masseria Moroseta " + " Florence " ], "Deleted": [ + " The Man Who Settled the Fox-Dominion Defamation Case From a Romanian Tour Bus ", " Bunkers ", " 2023-02-14 Bayern - PSG ", " Untitled ", @@ -9739,10 +9800,38 @@ " archive ", " delete ", " The Deacon and the Dog City Journal 1 ", - " Beware the Cool Mom ", - " 2022-12-15 Test " + " Beware the Cool Mom " ], "Linked": [ + " 2023-04-25 ", + " What Was Twitter, Anyway ", + " My High-Flying Life as a Corporate Spy Who Lied His Way to the Top ", + " “It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later ", + " Dril Is Everyone. More Specifically, He’s a Guy Named Paul. ", + " Inside Rupert Murdoch’s Succession Drama ", + " Behind the Scenes of Barack Obama’s Reading Lists ", + " 2023-04-25 ", + " 2023-04-24 ", + " 2023-04-24 ", + " 2023-04-24 ", + " Cannavacciuolo Bistrot ", + " 2022-08-07 ", + " 2022-12-29 ", + " 2023-04-10 ", + " 2023-04-16 ", + " 2023-04-23 ", + " Dril Is Everyone. More Specifically, He’s a Guy Named Paul. ", + " What Was Twitter, Anyway ", + " My High-Flying Life as a Corporate Spy Who Lied His Way to the Top ", + " 2023-04-23 ", + " 2023-04-22 ", + " The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists ", + " 2023-04-21 Angers SCO - PSG ", + " 2023-04-21 ", + " The Fox News Trial Starts Tomorrow. Fox Is Already Losing. ", + " The Case of the Fake Sherlock ", + " Saving the Horses of Our Imagination ", + " 2023-04-20 ", " 2023-04-19 First S&B ", " 2023-04-17 Health check ", " 2023-04-01 Purchase decision ", @@ -9764,38 +9853,11 @@ " 2023-04-17 ", " 2023-03-30 ", " 2023-04-01 ", - " 2023-03-28 ", - " 2023-03-29 ", - " Casa Manolo ", - " Cassai Gran Café and Restaurant ", - " Terra Origens ", - " Sal de Coco ", - " 2023-04-16 ", - " Tess de Mar ", - " Santina ", - " Bunkers ", - " Es Figueral ", - " Cassai Beach House ", - " Hirschen ", - " Inside Rupert Murdoch’s Succession Drama ", - " “It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later ", - " Behind the Scenes of Barack Obama’s Reading Lists ", - " Clarence Thomas Secretly Accepted Luxury Trips From Major GOP Donor ", - " The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow ", - " Gambler Who Beat Roulette Found Way to Win Beyond Red or Black ", - " The Big Coin Heist ", - " 2023-04-16 ", - " 2023-04-15 PSG - RC Lens ", - " 2023-04-15 ", - " 2023-04-15 ", - " 2023-04-14 ", - " 2023-04-13 ", - " 2023-04-09 ", - " @Sally ", - " 2023-04-12 Departure from Mallorca ", - " 2024-04-03 Vet check " + " 2023-03-28 " ], "Removed Tags from": [ + " What Was Twitter, Anyway ", + " Inside Rupert Murdoch’s Succession Drama ", " Francisco Podesta ", " ‘Incredibly intelligent, highly elusive’ US faces new threat from Canadian ‘super pig’ ", " The Promise of Pyer Moss ", @@ -9844,9 +9906,7 @@ " Imagine Scythia’s fierce warrior women, the real Amazons Aeon Essays ", " What happened to Starbucks How a progressive company lost its way ", " Riding London’s Unexpectedly Fantastic Elizabeth Line ", - " Cantinetta Antinori ", - " Under the Skin (2013) ", - " Weeds (2005–2012) " + " Cantinetta Antinori " ], "Removed Links from": [ " 2022-01-22 ", diff --git a/.obsidian/plugins/obsidian-dice-roller/main.js b/.obsidian/plugins/obsidian-dice-roller/main.js index 9eafe081..23310f36 100644 --- a/.obsidian/plugins/obsidian-dice-roller/main.js +++ b/.obsidian/plugins/obsidian-dice-roller/main.js @@ -3,22 +3,22 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ -var ko=Object.create;var M4=Object.defineProperty;var Uo=Object.getOwnPropertyDescriptor;var Oo=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var Wo=(n,e,t)=>e in n?M4(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ii=n=>M4(n,"__esModule",{value:!0});var C0=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),jo=(n,e)=>{Ii(n);for(var t in e)M4(n,t,{get:e[t],enumerable:!0})},Xo=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oo(e))!qo.call(n,i)&&i!=="default"&&M4(n,i,{get:()=>e[i],enumerable:!(t=Uo(e,i))||t.enumerable});return n},S2=n=>Xo(Ii(M4(n!=null?ko(Go(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var C=(n,e,t)=>(Wo(n,typeof e!="symbol"?e+"":e,t),t);var ki=C0(e6=>{"use strict";Object.defineProperty(e6,"__esModule",{value:!0});require("obsidian");var Zo=n=>{var e;return n?(e=n.plugins.plugins.dataview)===null||e===void 0?void 0:e.api:window.DataviewAPI},Yo=n=>n.plugins.enabledPlugins.has("dataview");e6.getAPI=Zo;e6.isPluginEnabled=Yo});var Ca=C0((c6,z4)=>{(function(n){var e=typeof c6=="object"&&c6,t=typeof z4=="object"&&z4&&z4.exports==e&&z4,i=typeof global=="object"&&global;(i.global===i||i.window===i)&&(n=i);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,r=/[\x01-\x7F]/g,s=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,o=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,c={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline",_:"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent",$:"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr",\u00AA:"ordf",\u00E1:"aacute",\u00C1:"Aacute",\u00E0:"agrave",\u00C0:"Agrave",\u0103:"abreve",\u0102:"Abreve",\u00E2:"acirc",\u00C2:"Acirc",\u00E5:"aring",\u00C5:"angst",\u00E4:"auml",\u00C4:"Auml",\u00E3:"atilde",\u00C3:"Atilde",\u0105:"aogon",\u0104:"Aogon",\u0101:"amacr",\u0100:"Amacr",\u00E6:"aelig",\u00C6:"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf",\u212C:"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf",\u212D:"Cfr","\u{1D49E}":"Cscr",\u2102:"Copf",\u0107:"cacute",\u0106:"Cacute",\u0109:"ccirc",\u0108:"Ccirc",\u010D:"ccaron",\u010C:"Ccaron",\u010B:"cdot",\u010A:"Cdot",\u00E7:"ccedil",\u00C7:"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf",\u010F:"dcaron",\u010E:"Dcaron",\u0111:"dstrok",\u0110:"Dstrok",\u00F0:"eth",\u00D0:"ETH","\u2147":"ee",\u212F:"escr","\u{1D522}":"efr","\u{1D556}":"eopf",\u2130:"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf",\u00E9:"eacute",\u00C9:"Eacute",\u00E8:"egrave",\u00C8:"Egrave",\u00EA:"ecirc",\u00CA:"Ecirc",\u011B:"ecaron",\u011A:"Ecaron",\u00EB:"euml",\u00CB:"Euml",\u0117:"edot",\u0116:"Edot",\u0119:"eogon",\u0118:"Eogon",\u0113:"emacr",\u0112:"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf",\u2131:"Fscr",\uFB00:"fflig",\uFB03:"ffilig",\uFB04:"ffllig",\uFB01:"filig",fj:"fjlig",\uFB02:"fllig",\u0192:"fnof",\u210A:"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr",\u01F5:"gacute",\u011F:"gbreve",\u011E:"Gbreve",\u011D:"gcirc",\u011C:"Gcirc",\u0121:"gdot",\u0120:"Gdot",\u0122:"Gcedil","\u{1D525}":"hfr",\u210E:"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf",\u210B:"Hscr",\u210C:"Hfr",\u210D:"Hopf",\u0125:"hcirc",\u0124:"Hcirc",\u210F:"hbar",\u0127:"hstrok",\u0126:"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf",\u2110:"Iscr",\u2111:"Im",\u00ED:"iacute",\u00CD:"Iacute",\u00EC:"igrave",\u00CC:"Igrave",\u00EE:"icirc",\u00CE:"Icirc",\u00EF:"iuml",\u00CF:"Iuml",\u0129:"itilde",\u0128:"Itilde",\u0130:"Idot",\u012F:"iogon",\u012E:"Iogon",\u012B:"imacr",\u012A:"Imacr",\u0133:"ijlig",\u0132:"IJlig",\u0131:"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf",\u0135:"jcirc",\u0134:"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr",\u0137:"kcedil",\u0136:"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr",\u2113:"ell","\u{1D55D}":"lopf",\u2112:"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf",\u013A:"lacute",\u0139:"Lacute",\u013E:"lcaron",\u013D:"Lcaron",\u013C:"lcedil",\u013B:"Lcedil",\u0142:"lstrok",\u0141:"Lstrok",\u0140:"lmidot",\u013F:"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf",\u2133:"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr",\u2115:"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr",\u0144:"nacute",\u0143:"Nacute",\u0148:"ncaron",\u0147:"Ncaron",\u00F1:"ntilde",\u00D1:"Ntilde",\u0146:"ncedil",\u0145:"Ncedil","\u2116":"numero",\u014B:"eng",\u014A:"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr",\u2134:"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf",\u00BA:"ordm",\u00F3:"oacute",\u00D3:"Oacute",\u00F2:"ograve",\u00D2:"Ograve",\u00F4:"ocirc",\u00D4:"Ocirc",\u00F6:"ouml",\u00D6:"Ouml",\u0151:"odblac",\u0150:"Odblac",\u00F5:"otilde",\u00D5:"Otilde",\u00F8:"oslash",\u00D8:"Oslash",\u014D:"omacr",\u014C:"Omacr",\u0153:"oelig",\u0152:"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf",\u2119:"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr",\u211A:"Qopf",\u0138:"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr",\u211B:"Rscr",\u211C:"Re",\u211D:"Ropf",\u0155:"racute",\u0154:"Racute",\u0159:"rcaron",\u0158:"Rcaron",\u0157:"rcedil",\u0156:"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS",\u015B:"sacute",\u015A:"Sacute",\u015D:"scirc",\u015C:"Scirc",\u0161:"scaron",\u0160:"Scaron",\u015F:"scedil",\u015E:"Scedil",\u00DF:"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf",\u0165:"tcaron",\u0164:"Tcaron",\u0163:"tcedil",\u0162:"Tcedil","\u2122":"trade",\u0167:"tstrok",\u0166:"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr",\u00FA:"uacute",\u00DA:"Uacute",\u00F9:"ugrave",\u00D9:"Ugrave",\u016D:"ubreve",\u016C:"Ubreve",\u00FB:"ucirc",\u00DB:"Ucirc",\u016F:"uring",\u016E:"Uring",\u00FC:"uuml",\u00DC:"Uuml",\u0171:"udblac",\u0170:"Udblac",\u0169:"utilde",\u0168:"Utilde",\u0173:"uogon",\u0172:"Uogon",\u016B:"umacr",\u016A:"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr",\u0175:"wcirc",\u0174:"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf",\u00FD:"yacute",\u00DD:"Yacute",\u0177:"ycirc",\u0176:"Ycirc",\u00FF:"yuml",\u0178:"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf",\u2128:"Zfr",\u2124:"Zopf","\u{1D4B5}":"Zscr",\u017A:"zacute",\u0179:"Zacute",\u017E:"zcaron",\u017D:"Zcaron",\u017C:"zdot",\u017B:"Zdot",\u01B5:"imped",\u00FE:"thorn",\u00DE:"THORN",\u0149:"napos",\u03B1:"alpha",\u0391:"Alpha",\u03B2:"beta",\u0392:"Beta",\u03B3:"gamma",\u0393:"Gamma",\u03B4:"delta",\u0394:"Delta",\u03B5:"epsi","\u03F5":"epsiv",\u0395:"Epsilon",\u03DD:"gammad",\u03DC:"Gammad",\u03B6:"zeta",\u0396:"Zeta",\u03B7:"eta",\u0397:"Eta",\u03B8:"theta",\u03D1:"thetav",\u0398:"Theta",\u03B9:"iota",\u0399:"Iota",\u03BA:"kappa",\u03F0:"kappav",\u039A:"Kappa",\u03BB:"lambda",\u039B:"Lambda",\u03BC:"mu",\u00B5:"micro",\u039C:"Mu",\u03BD:"nu",\u039D:"Nu",\u03BE:"xi",\u039E:"Xi",\u03BF:"omicron",\u039F:"Omicron",\u03C0:"pi",\u03D6:"piv",\u03A0:"Pi",\u03C1:"rho",\u03F1:"rhov",\u03A1:"Rho",\u03C3:"sigma",\u03A3:"Sigma",\u03C2:"sigmaf",\u03C4:"tau",\u03A4:"Tau",\u03C5:"upsi",\u03A5:"Upsilon",\u03D2:"Upsi",\u03C6:"phi",\u03D5:"phiv",\u03A6:"Phi",\u03C7:"chi",\u03A7:"Chi",\u03C8:"psi",\u03A8:"Psi",\u03C9:"omega",\u03A9:"ohm",\u0430:"acy",\u0410:"Acy",\u0431:"bcy",\u0411:"Bcy",\u0432:"vcy",\u0412:"Vcy",\u0433:"gcy",\u0413:"Gcy",\u0453:"gjcy",\u0403:"GJcy",\u0434:"dcy",\u0414:"Dcy",\u0452:"djcy",\u0402:"DJcy",\u0435:"iecy",\u0415:"IEcy",\u0451:"iocy",\u0401:"IOcy",\u0454:"jukcy",\u0404:"Jukcy",\u0436:"zhcy",\u0416:"ZHcy",\u0437:"zcy",\u0417:"Zcy",\u0455:"dscy",\u0405:"DScy",\u0438:"icy",\u0418:"Icy",\u0456:"iukcy",\u0406:"Iukcy",\u0457:"yicy",\u0407:"YIcy",\u0439:"jcy",\u0419:"Jcy",\u0458:"jsercy",\u0408:"Jsercy",\u043A:"kcy",\u041A:"Kcy",\u045C:"kjcy",\u040C:"KJcy",\u043B:"lcy",\u041B:"Lcy",\u0459:"ljcy",\u0409:"LJcy",\u043C:"mcy",\u041C:"Mcy",\u043D:"ncy",\u041D:"Ncy",\u045A:"njcy",\u040A:"NJcy",\u043E:"ocy",\u041E:"Ocy",\u043F:"pcy",\u041F:"Pcy",\u0440:"rcy",\u0420:"Rcy",\u0441:"scy",\u0421:"Scy",\u0442:"tcy",\u0422:"Tcy",\u045B:"tshcy",\u040B:"TSHcy",\u0443:"ucy",\u0423:"Ucy",\u045E:"ubrcy",\u040E:"Ubrcy",\u0444:"fcy",\u0424:"Fcy",\u0445:"khcy",\u0425:"KHcy",\u0446:"tscy",\u0426:"TScy",\u0447:"chcy",\u0427:"CHcy",\u045F:"dzcy",\u040F:"DZcy",\u0448:"shcy",\u0428:"SHcy",\u0449:"shchcy",\u0429:"SHCHcy",\u044A:"hardcy",\u042A:"HARDcy",\u044B:"ycy",\u042B:"Ycy",\u044C:"softcy",\u042C:"SOFTcy",\u044D:"ecy",\u042D:"Ecy",\u044E:"yucy",\u042E:"YUcy",\u044F:"yacy",\u042F:"YAcy",\u2135:"aleph",\u2136:"beth",\u2137:"gimel",\u2138:"daleth"},l=/["&'<>`]/g,u={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,h=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,v={aacute:"\xE1",Aacute:"\xC1",abreve:"\u0103",Abreve:"\u0102",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",acy:"\u0430",Acy:"\u0410",aelig:"\xE6",AElig:"\xC6",af:"\u2061",afr:"\u{1D51E}",Afr:"\u{1D504}",agrave:"\xE0",Agrave:"\xC0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",Alpha:"\u0391",amacr:"\u0101",Amacr:"\u0100",amalg:"\u2A3F",amp:"&",AMP:"&",and:"\u2227",And:"\u2A53",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",Aogon:"\u0104",aopf:"\u{1D552}",Aopf:"\u{1D538}",ap:"\u2248",apacir:"\u2A6F",ape:"\u224A",apE:"\u2A70",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",Aring:"\xC5",ascr:"\u{1D4B6}",Ascr:"\u{1D49C}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",Bcy:"\u0411",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",beta:"\u03B2",Beta:"\u0392",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",Bfr:"\u{1D505}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bNot:"\u2AED",bopf:"\u{1D553}",Bopf:"\u{1D539}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxhD:"\u2565",boxHd:"\u2564",boxHD:"\u2566",boxhu:"\u2534",boxhU:"\u2568",boxHu:"\u2567",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpe:"\u224F",bumpE:"\u2AAE",bumpeq:"\u224F",Bumpeq:"\u224E",cacute:"\u0107",Cacute:"\u0106",cap:"\u2229",Cap:"\u22D2",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",ccaron:"\u010D",Ccaron:"\u010C",ccedil:"\xE7",Ccedil:"\xC7",ccirc:"\u0109",Ccirc:"\u0108",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",Cdot:"\u010A",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",chcy:"\u0447",CHcy:"\u0427",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",Chi:"\u03A7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cire:"\u2257",cirE:"\u29C3",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",colone:"\u2254",Colone:"\u2A74",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",cscr:"\u{1D4B8}",Cscr:"\u{1D49E}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",Cup:"\u22D3",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",dArr:"\u21D3",Darr:"\u21A1",dash:"\u2010",dashv:"\u22A3",Dashv:"\u2AE4",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",Dcaron:"\u010E",dcy:"\u0434",Dcy:"\u0414",dd:"\u2146",DD:"\u2145",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",delta:"\u03B4",Delta:"\u0394",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",Dfr:"\u{1D507}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",DJcy:"\u0402",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",Dopf:"\u{1D53B}",dot:"\u02D9",Dot:"\xA8",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",downarrow:"\u2193",Downarrow:"\u21D3",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",Dscr:"\u{1D49F}",dscy:"\u0455",DScy:"\u0405",dsol:"\u29F6",dstrok:"\u0111",Dstrok:"\u0110",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",DZcy:"\u040F",dzigrarr:"\u27FF",eacute:"\xE9",Eacute:"\xC9",easter:"\u2A6E",ecaron:"\u011B",Ecaron:"\u011A",ecir:"\u2256",ecirc:"\xEA",Ecirc:"\xCA",ecolon:"\u2255",ecy:"\u044D",Ecy:"\u042D",eDDot:"\u2A77",edot:"\u0117",eDot:"\u2251",Edot:"\u0116",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",Efr:"\u{1D508}",eg:"\u2A9A",egrave:"\xE8",Egrave:"\xC8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",Emacr:"\u0112",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",eng:"\u014B",ENG:"\u014A",ensp:"\u2002",eogon:"\u0119",Eogon:"\u0118",eopf:"\u{1D556}",Eopf:"\u{1D53C}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",Epsilon:"\u0395",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",esim:"\u2242",Esim:"\u2A73",eta:"\u03B7",Eta:"\u0397",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",Fcy:"\u0424",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",Ffr:"\u{1D509}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",Fopf:"\u{1D53D}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",gamma:"\u03B3",Gamma:"\u0393",gammad:"\u03DD",Gammad:"\u03DC",gap:"\u2A86",gbreve:"\u011F",Gbreve:"\u011E",Gcedil:"\u0122",gcirc:"\u011D",Gcirc:"\u011C",gcy:"\u0433",Gcy:"\u0413",gdot:"\u0121",Gdot:"\u0120",ge:"\u2265",gE:"\u2267",gel:"\u22DB",gEl:"\u2A8C",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",Gfr:"\u{1D50A}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",GJcy:"\u0403",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",Gopf:"\u{1D53E}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",gscr:"\u210A",Gscr:"\u{1D4A2}",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",Gt:"\u226B",GT:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",HARDcy:"\u042A",harr:"\u2194",hArr:"\u21D4",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",hcirc:"\u0125",Hcirc:"\u0124",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",hstrok:"\u0127",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",Iacute:"\xCD",ic:"\u2063",icirc:"\xEE",Icirc:"\xCE",icy:"\u0438",Icy:"\u0418",Idot:"\u0130",iecy:"\u0435",IEcy:"\u0415",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",igrave:"\xEC",Igrave:"\xCC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",IJlig:"\u0132",Im:"\u2111",imacr:"\u012B",Imacr:"\u012A",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",Int:"\u222C",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",iocy:"\u0451",IOcy:"\u0401",iogon:"\u012F",Iogon:"\u012E",iopf:"\u{1D55A}",Iopf:"\u{1D540}",iota:"\u03B9",Iota:"\u0399",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",Itilde:"\u0128",iukcy:"\u0456",Iukcy:"\u0406",iuml:"\xEF",Iuml:"\xCF",jcirc:"\u0135",Jcirc:"\u0134",jcy:"\u0439",Jcy:"\u0419",jfr:"\u{1D527}",Jfr:"\u{1D50D}",jmath:"\u0237",jopf:"\u{1D55B}",Jopf:"\u{1D541}",jscr:"\u{1D4BF}",Jscr:"\u{1D4A5}",jsercy:"\u0458",Jsercy:"\u0408",jukcy:"\u0454",Jukcy:"\u0404",kappa:"\u03BA",Kappa:"\u039A",kappav:"\u03F0",kcedil:"\u0137",Kcedil:"\u0136",kcy:"\u043A",Kcy:"\u041A",kfr:"\u{1D528}",Kfr:"\u{1D50E}",kgreen:"\u0138",khcy:"\u0445",KHcy:"\u0425",kjcy:"\u045C",KJcy:"\u040C",kopf:"\u{1D55C}",Kopf:"\u{1D542}",kscr:"\u{1D4C0}",Kscr:"\u{1D4A6}",lAarr:"\u21DA",lacute:"\u013A",Lacute:"\u0139",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",Lambda:"\u039B",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larr:"\u2190",lArr:"\u21D0",Larr:"\u219E",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",lAtail:"\u291B",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",Lcaron:"\u013D",lcedil:"\u013C",Lcedil:"\u013B",lceil:"\u2308",lcub:"{",lcy:"\u043B",Lcy:"\u041B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",leftarrow:"\u2190",Leftarrow:"\u21D0",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",Leftrightarrow:"\u21D4",LeftRightArrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",leg:"\u22DA",lEg:"\u2A8B",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",Lfr:"\u{1D50F}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",LJcy:"\u0409",ll:"\u226A",Ll:"\u22D8",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",Lmidot:"\u013F",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",Longleftarrow:"\u27F8",LongLeftArrow:"\u27F5",longleftrightarrow:"\u27F7",Longleftrightarrow:"\u27FA",LongLeftRightArrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",Longrightarrow:"\u27F9",LongRightArrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",Lopf:"\u{1D543}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",Lstrok:"\u0141",lt:"<",Lt:"\u226A",LT:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",Map:"\u2905",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",Mcy:"\u041C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",mfr:"\u{1D52A}",Mfr:"\u{1D510}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",Mopf:"\u{1D544}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",mu:"\u03BC",Mu:"\u039C",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",nacute:"\u0144",Nacute:"\u0143",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",Ncaron:"\u0147",ncedil:"\u0146",Ncedil:"\u0145",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",Ncy:"\u041D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` -`,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},g={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},x={"0":"\uFFFD","128":"\u20AC","130":"\u201A","131":"\u0192","132":"\u201E","133":"\u2026","134":"\u2020","135":"\u2021","136":"\u02C6","137":"\u2030","138":"\u0160","139":"\u2039","140":"\u0152","142":"\u017D","145":"\u2018","146":"\u2019","147":"\u201C","148":"\u201D","149":"\u2022","150":"\u2013","151":"\u2014","152":"\u02DC","153":"\u2122","154":"\u0161","155":"\u203A","156":"\u0153","158":"\u017E","159":"\u0178"},p=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],d=String.fromCharCode,w={},b=w.hasOwnProperty,z=function(R,O){return b.call(R,O)},L=function(R,O){for(var Y=-1,G=R.length;++Y=55296&&R<=57343||R>1114111?(O&&M("character reference outside the permissible Unicode range"),"\uFFFD"):z(x,R)?(O&&M("disallowed character reference"),x[R]):(O&&L(p,R)&&M("disallowed character reference"),R>65535&&(R-=65536,Y+=d(R>>>10&1023|55296),R=56320|R&1023),Y+=d(R),Y)},I=function(R){return"&#x"+R.toString(16).toUpperCase()+";"},B=function(R){return"&#"+R+";"},M=function(R){throw Error("Parse error: "+R)},T=function(R,O){O=H(O,T.options);var Y=O.strict;Y&&h.test(R)&&M("forbidden code point");var G=O.encodeEverything,j=O.useNamedReferences,Z=O.allowUnsafeSymbols,e1=O.decimal?B:I,r1=function(P){return e1(P.charCodeAt(0))};return G?(R=R.replace(r,function(P){return j&&z(c,P)?"&"+c[P]+";":r1(P)}),j&&(R=R.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),j&&(R=R.replace(o,function(P){return"&"+c[P]+";"}))):j?(Z||(R=R.replace(l,function(P){return"&"+c[P]+";"})),R=R.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),R=R.replace(o,function(P){return"&"+c[P]+";"})):Z||(R=R.replace(l,r1)),R.replace(a,function(P){var b1=P.charCodeAt(0),h1=P.charCodeAt(1),g1=(b1-55296)*1024+h1-56320+65536;return e1(g1)}).replace(s,r1)};T.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var A=function(R,O){O=H(O,A.options);var Y=O.strict;return Y&&f.test(R)&&M("malformed character reference"),R.replace(m,function(G,j,Z,e1,r1,P,b1,h1,g1){var s1,H1,w1,z1,h2,Q1;return j?(h2=j,v[h2]):Z?(h2=Z,Q1=e1,Q1&&O.isAttributeValue?(Y&&Q1=="="&&M("`&` did not start a character reference"),G):(Y&&M("named character reference was not terminated by a semicolon"),g[h2]+(Q1||""))):r1?(w1=r1,H1=P,Y&&!H1&&M("character reference was not terminated by a semicolon"),s1=parseInt(w1,10),E(s1,Y)):b1?(z1=b1,H1=h1,Y&&!H1&&M("character reference was not terminated by a semicolon"),s1=parseInt(z1,16),E(s1,Y)):(Y&&M("named character reference was not terminated by a semicolon"),G)})};A.options={isAttributeValue:!1,strict:!1};var V=function(R){return R.replace(l,function(O){return u[O]})},N={version:"1.2.0",encode:T,decode:A,escape:V,unescape:A};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return N});else if(e&&!e.nodeType)if(t)t.exports=N;else for(var D in N)z(N,D)&&(e[D]=N[D]);else n.he=N})(c6)});var Eo=C0((_o,M0)=>{(function(n,e){typeof define=="function"&&define.amd?define([],e):typeof M0=="object"&&M0.exports?M0.exports=e():n.moo=e()})(_o,function(){"use strict";var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function i(E){return E&&e.call(E)==="[object RegExp]"}function a(E){return E&&typeof E=="object"&&!i(E)&&!Array.isArray(E)}function r(E){return E.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(E){var I=new RegExp("|"+E);return I.exec("").length-1}function o(E){return"("+E+")"}function c(E){if(!E.length)return"(?!)";var I=E.map(function(B){return"(?:"+B+")"}).join("|");return"(?:"+I+")"}function l(E){if(typeof E=="string")return"(?:"+r(E)+")";if(i(E)){if(E.ignoreCase)throw new Error("RegExp /i flag not allowed");if(E.global)throw new Error("RegExp /g flag is implied");if(E.sticky)throw new Error("RegExp /y flag is implied");if(E.multiline)throw new Error("RegExp /m flag is implied");return E.source}else throw new Error("Not a pattern: "+E)}function u(E){for(var I=Object.getOwnPropertyNames(E),B=[],M=0;M0)throw new Error("RegExp has capture groups: "+e1+` -Use (?: \u2026 ) instead`);if(!R.lineBreaks&&e1.test(` -`))throw new Error("Rule should declare lineBreaks: "+e1);N.push(o(Z))}}var P=B&&B.fallback,b1=t&&!P?"ym":"gm",h1=t||P?"":"|";A===!0&&(b1+="u");var g1=new RegExp(c(N)+h1,b1);return{regexp:g1,groups:V,fast:M,error:B||v}}function x(E){var I=g(m(E));return new b({start:I},"start")}function p(E,I,B){var M=E&&(E.push||E.next);if(M&&!B[M])throw new Error("Missing state '"+M+"' (in token '"+E.defaultType+"' of state '"+I+"')");if(E&&E.pop&&+E.pop!=1)throw new Error("pop must be 1 (in token '"+E.defaultType+"' of state '"+I+"')")}function d(E,I){var B=E.$all?m(E.$all):[];delete E.$all;var M=Object.getOwnPropertyNames(E);I||(I=M[0]);for(var T=Object.create(null),A=0;Ap6,default:()=>Bi});var Y1=S2(require("obsidian")),No=S2(ki());var Ui={prefix:"fas",iconName:"dice",icon:[640,512,[],"f522","M592 192H473.26c12.69 29.59 7.12 65.2-17 89.32L320 417.58V464c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48V240c0-26.51-21.49-48-48-48zM480 376c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm-46.37-186.7L258.7 14.37c-19.16-19.16-50.23-19.16-69.39 0L14.37 189.3c-19.16 19.16-19.16 50.23 0 69.39L189.3 433.63c19.16 19.16 50.23 19.16 69.39 0L433.63 258.7c19.16-19.17 19.16-50.24 0-69.4zM96 248c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"]};var Oi={prefix:"far",iconName:"copy",icon:[448,512,[],"f0c5","M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"]};function b4(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b4=function(e){return typeof e}:b4=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b4(n)}function $o(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Gi(n,e){for(var t=0;t-1;a--){var r=t[a],s=(r.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(i=r)}return z2.head.insertBefore(e,i),n}}var Mc="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function s6(){for(var n=12,e="";n-- >0;)e+=Mc[Math.random()*62|0];return e}function oa(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function bc(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(oa(n[t]),'" ')},"").trim()}function ca(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t],";")},"")}function la(n){return n.size!==Pt.size||n.x!==Pt.x||n.y!==Pt.y||n.rotate!==Pt.rotate||n.flipX||n.flipY}function ua(n){var e=n.transform,t=n.containerWidth,i=n.iconWidth,a={transform:"translate(".concat(t/2," 256)")},r="translate(".concat(e.x*32,", ").concat(e.y*32,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),o="rotate(".concat(e.rotate," 0 0)"),c={transform:"".concat(r," ").concat(s," ").concat(o)},l={transform:"translate(".concat(i/2*-1," -256)")};return{outer:a,inner:c,path:l}}var D0={x:0,y:0,width:"100%",height:"100%"};function ha(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function yc(n){return n.tag==="g"?n.children:[n]}function Cc(n){var e=n.children,t=n.attributes,i=n.main,a=n.mask,r=n.maskId,s=n.transform,o=i.width,c=i.icon,l=a.width,u=a.icon,f=ua({transform:s,containerWidth:l,iconWidth:o}),h={tag:"rect",attributes:B1({},D0,{fill:"white"})},m=c.children?{children:c.children.map(ha)}:{},v={tag:"g",attributes:B1({},f.inner),children:[ha(B1({tag:c.tag,attributes:B1({},c.attributes,f.path)},m))]},g={tag:"g",attributes:B1({},f.outer),children:[v]},x="mask-".concat(r||s6()),p="clip-".concat(r||s6()),d={tag:"mask",attributes:B1({},D0,{id:x,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,g]},w={tag:"defs",children:[{tag:"clipPath",attributes:{id:p},children:yc(u)},d]};return e.push(w,{tag:"rect",attributes:B1({fill:"currentColor","clip-path":"url(#".concat(p,")"),mask:"url(#".concat(x,")")},D0)}),{children:e,attributes:t}}function zc(n){var e=n.children,t=n.attributes,i=n.main,a=n.transform,r=n.styles,s=ca(r);if(s.length>0&&(t.style=s),la(a)){var o=ua({transform:a,containerWidth:i.width,iconWidth:i.width});e.push({tag:"g",attributes:B1({},o.outer),children:[{tag:"g",attributes:B1({},o.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:B1({},i.icon.attributes,o.path)}]}]})}else e.push(i.icon);return{children:e,attributes:t}}function Ac(n){var e=n.children,t=n.main,i=n.mask,a=n.attributes,r=n.styles,s=n.transform;if(la(s)&&t.found&&!i.found){var o=t.width,c=t.height,l={x:o/c/2,y:.5};a.style=ca(B1({},r,{"transform-origin":"".concat(l.x+s.x/16,"em ").concat(l.y+s.y/16,"em")}))}return[{tag:"svg",attributes:a,children:e}]}function wc(n){var e=n.prefix,t=n.iconName,i=n.children,a=n.attributes,r=n.symbol,s=r===!0?"".concat(e,"-").concat(N2.familyPrefix,"-").concat(t):r;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:B1({},a,{id:s}),children:i}]}]}function Sc(n){var e=n.icons,t=e.main,i=e.mask,a=n.prefix,r=n.iconName,s=n.transform,o=n.symbol,c=n.title,l=n.maskId,u=n.titleId,f=n.extra,h=n.watchable,m=h===void 0?!1:h,v=i.found?i:t,g=v.width,x=v.height,p=a==="fak",d=p?"":"fa-w-".concat(Math.ceil(g/x*16)),w=[N2.replacementClass,r?"".concat(N2.familyPrefix,"-").concat(r):"",d].filter(function(B){return f.classes.indexOf(B)===-1}).filter(function(B){return B!==""||!!B}).concat(f.classes).join(" "),b={children:[],attributes:B1({},f.attributes,{"data-prefix":a,"data-icon":r,class:w,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(g," ").concat(x)})},z=p&&!~f.classes.indexOf("fa-fw")?{width:"".concat(g/x*16*.0625,"em")}:{};m&&(b.attributes[rc]=""),c&&b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(u||s6())},children:[c]});var L=B1({},b,{prefix:a,iconName:r,main:t,mask:i,maskId:l,transform:s,symbol:o,styles:B1({},z,f.styles)}),H=i.found&&t.found?Cc(L):zc(L),E=H.children,I=H.attributes;return L.children=E,L.attributes=I,o?wc(L):Ac(L)}var fa=function(){},zh=N2.measurePerformance&&i6&&i6.mark&&i6.measure?i6:{mark:fa,measure:fa};var _c=function(e,t){return function(i,a,r,s){return e.call(t,i,a,r,s)}},T0=function(e,t,i,a){var r=Object.keys(e),s=r.length,o=a!==void 0?_c(t,a):t,c,l,u;for(i===void 0?(c=1,u=e[r[0]]):(c=0,u=i);c2&&arguments[2]!==void 0?arguments[2]:{},i=t.skipHooks,a=i===void 0?!1:i,r=Object.keys(e).reduce(function(s,o){var c=e[o],l=!!c.icon;return l?s[c.iconName]=c.icon:s[o]=c,s},{});typeof pe.hooks.addPack=="function"&&!a?pe.hooks.addPack(n,r):pe.styles[n]=B1({},pe.styles[n]||{},r),n==="fas"&&da("fa",e)}var pa=pe.styles,Ec=pe.shims,Lc={},Dc={},Tc={},ma=function(){var e=function(a){return T0(pa,function(r,s,o){return r[o]=T0(s,a,{}),r},{})};Lc=e(function(i,a,r){return a[3]&&(i[a[3]]=r),i}),Dc=e(function(i,a,r){var s=a[2];return i[r]=r,s.forEach(function(o){i[o]=r}),i});var t="far"in pa;Tc=T0(Ec,function(i,a){var r=a[0],s=a[1],o=a[2];return s==="far"&&!t&&(s="fas"),i[r]={prefix:s,iconName:o},i},{})};ma();var Ah=pe.styles;function va(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}function ga(n){var e=n.tag,t=n.attributes,i=t===void 0?{}:t,a=n.children,r=a===void 0?[]:a;return typeof n=="string"?oa(n):"<".concat(e," ").concat(bc(i),">").concat(r.map(ga).join(""),"")}function H0(n){this.name="MissingIcon",this.message=n||"Icon unavailable",this.stack=new Error().stack}H0.prototype=Object.create(Error.prototype);H0.prototype.constructor=H0;var o6={fill:"currentColor"},xa={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},wh={tag:"path",attributes:B1({},o6,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},V0=B1({},xa,{attributeName:"opacity"}),Sh={tag:"circle",attributes:B1({},o6,{cx:"256",cy:"364",r:"28"}),children:[{tag:"animate",attributes:B1({},xa,{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:B1({},V0,{values:"1;0;1;1;0;1;"})}]},_h={tag:"path",attributes:B1({},o6,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:[{tag:"animate",attributes:B1({},V0,{values:"1;0;0;0;0;1;"})}]},Eh={tag:"path",attributes:B1({},o6,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:B1({},V0,{values:"0;0;1;1;0;0;"})}]};var Lh=pe.styles;function Ma(n){var e=n[0],t=n[1],i=n.slice(4),a=qi(i,1),r=a[0],s=null;return Array.isArray(r)?s={tag:"g",attributes:{class:"".concat(N2.familyPrefix,"-").concat(gt.GROUP)},children:[{tag:"path",attributes:{class:"".concat(N2.familyPrefix,"-").concat(gt.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(N2.familyPrefix,"-").concat(gt.PRIMARY),fill:"currentColor",d:r[1]}}]}:s={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:e,height:t,icon:s}}var Dh=pe.styles;var Hc=`svg:not(:root).svg-inline--fa { +var Io=Object.create;var J4=Object.defineProperty;var ko=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var Pi=n=>J4(n,"__esModule",{value:!0});var y0=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),qo=(n,e)=>{Pi(n);for(var t in e)J4(n,t,{get:e[t],enumerable:!0})},Wo=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Uo(e))!Go.call(n,i)&&i!=="default"&&J4(n,i,{get:()=>e[i],enumerable:!(t=ko(e,i))||t.enumerable});return n},w2=n=>Wo(Pi(J4(n!=null?Io(Oo(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var Ii=y0(Q4=>{"use strict";Object.defineProperty(Q4,"__esModule",{value:!0});require("obsidian");var jo=n=>{var e;return n?(e=n.plugins.plugins.dataview)===null||e===void 0?void 0:e.api:window.DataviewAPI},Xo=n=>n.plugins.enabledPlugins.has("dataview");Q4.getAPI=jo;Q4.isPluginEnabled=Xo});var ya=y0((o6,y4)=>{(function(n){var e=typeof o6=="object"&&o6,t=typeof y4=="object"&&y4&&y4.exports==e&&y4,i=typeof global=="object"&&global;(i.global===i||i.window===i)&&(n=i);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,r=/[\x01-\x7F]/g,s=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,o=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,c={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline",_:"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent",$:"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr",\u00AA:"ordf",\u00E1:"aacute",\u00C1:"Aacute",\u00E0:"agrave",\u00C0:"Agrave",\u0103:"abreve",\u0102:"Abreve",\u00E2:"acirc",\u00C2:"Acirc",\u00E5:"aring",\u00C5:"angst",\u00E4:"auml",\u00C4:"Auml",\u00E3:"atilde",\u00C3:"Atilde",\u0105:"aogon",\u0104:"Aogon",\u0101:"amacr",\u0100:"Amacr",\u00E6:"aelig",\u00C6:"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf",\u212C:"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf",\u212D:"Cfr","\u{1D49E}":"Cscr",\u2102:"Copf",\u0107:"cacute",\u0106:"Cacute",\u0109:"ccirc",\u0108:"Ccirc",\u010D:"ccaron",\u010C:"Ccaron",\u010B:"cdot",\u010A:"Cdot",\u00E7:"ccedil",\u00C7:"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf",\u010F:"dcaron",\u010E:"Dcaron",\u0111:"dstrok",\u0110:"Dstrok",\u00F0:"eth",\u00D0:"ETH","\u2147":"ee",\u212F:"escr","\u{1D522}":"efr","\u{1D556}":"eopf",\u2130:"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf",\u00E9:"eacute",\u00C9:"Eacute",\u00E8:"egrave",\u00C8:"Egrave",\u00EA:"ecirc",\u00CA:"Ecirc",\u011B:"ecaron",\u011A:"Ecaron",\u00EB:"euml",\u00CB:"Euml",\u0117:"edot",\u0116:"Edot",\u0119:"eogon",\u0118:"Eogon",\u0113:"emacr",\u0112:"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf",\u2131:"Fscr",\uFB00:"fflig",\uFB03:"ffilig",\uFB04:"ffllig",\uFB01:"filig",fj:"fjlig",\uFB02:"fllig",\u0192:"fnof",\u210A:"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr",\u01F5:"gacute",\u011F:"gbreve",\u011E:"Gbreve",\u011D:"gcirc",\u011C:"Gcirc",\u0121:"gdot",\u0120:"Gdot",\u0122:"Gcedil","\u{1D525}":"hfr",\u210E:"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf",\u210B:"Hscr",\u210C:"Hfr",\u210D:"Hopf",\u0125:"hcirc",\u0124:"Hcirc",\u210F:"hbar",\u0127:"hstrok",\u0126:"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf",\u2110:"Iscr",\u2111:"Im",\u00ED:"iacute",\u00CD:"Iacute",\u00EC:"igrave",\u00CC:"Igrave",\u00EE:"icirc",\u00CE:"Icirc",\u00EF:"iuml",\u00CF:"Iuml",\u0129:"itilde",\u0128:"Itilde",\u0130:"Idot",\u012F:"iogon",\u012E:"Iogon",\u012B:"imacr",\u012A:"Imacr",\u0133:"ijlig",\u0132:"IJlig",\u0131:"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf",\u0135:"jcirc",\u0134:"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr",\u0137:"kcedil",\u0136:"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr",\u2113:"ell","\u{1D55D}":"lopf",\u2112:"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf",\u013A:"lacute",\u0139:"Lacute",\u013E:"lcaron",\u013D:"Lcaron",\u013C:"lcedil",\u013B:"Lcedil",\u0142:"lstrok",\u0141:"Lstrok",\u0140:"lmidot",\u013F:"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf",\u2133:"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr",\u2115:"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr",\u0144:"nacute",\u0143:"Nacute",\u0148:"ncaron",\u0147:"Ncaron",\u00F1:"ntilde",\u00D1:"Ntilde",\u0146:"ncedil",\u0145:"Ncedil","\u2116":"numero",\u014B:"eng",\u014A:"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr",\u2134:"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf",\u00BA:"ordm",\u00F3:"oacute",\u00D3:"Oacute",\u00F2:"ograve",\u00D2:"Ograve",\u00F4:"ocirc",\u00D4:"Ocirc",\u00F6:"ouml",\u00D6:"Ouml",\u0151:"odblac",\u0150:"Odblac",\u00F5:"otilde",\u00D5:"Otilde",\u00F8:"oslash",\u00D8:"Oslash",\u014D:"omacr",\u014C:"Omacr",\u0153:"oelig",\u0152:"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf",\u2119:"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr",\u211A:"Qopf",\u0138:"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr",\u211B:"Rscr",\u211C:"Re",\u211D:"Ropf",\u0155:"racute",\u0154:"Racute",\u0159:"rcaron",\u0158:"Rcaron",\u0157:"rcedil",\u0156:"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS",\u015B:"sacute",\u015A:"Sacute",\u015D:"scirc",\u015C:"Scirc",\u0161:"scaron",\u0160:"Scaron",\u015F:"scedil",\u015E:"Scedil",\u00DF:"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf",\u0165:"tcaron",\u0164:"Tcaron",\u0163:"tcedil",\u0162:"Tcedil","\u2122":"trade",\u0167:"tstrok",\u0166:"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr",\u00FA:"uacute",\u00DA:"Uacute",\u00F9:"ugrave",\u00D9:"Ugrave",\u016D:"ubreve",\u016C:"Ubreve",\u00FB:"ucirc",\u00DB:"Ucirc",\u016F:"uring",\u016E:"Uring",\u00FC:"uuml",\u00DC:"Uuml",\u0171:"udblac",\u0170:"Udblac",\u0169:"utilde",\u0168:"Utilde",\u0173:"uogon",\u0172:"Uogon",\u016B:"umacr",\u016A:"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr",\u0175:"wcirc",\u0174:"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf",\u00FD:"yacute",\u00DD:"Yacute",\u0177:"ycirc",\u0176:"Ycirc",\u00FF:"yuml",\u0178:"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf",\u2128:"Zfr",\u2124:"Zopf","\u{1D4B5}":"Zscr",\u017A:"zacute",\u0179:"Zacute",\u017E:"zcaron",\u017D:"Zcaron",\u017C:"zdot",\u017B:"Zdot",\u01B5:"imped",\u00FE:"thorn",\u00DE:"THORN",\u0149:"napos",\u03B1:"alpha",\u0391:"Alpha",\u03B2:"beta",\u0392:"Beta",\u03B3:"gamma",\u0393:"Gamma",\u03B4:"delta",\u0394:"Delta",\u03B5:"epsi","\u03F5":"epsiv",\u0395:"Epsilon",\u03DD:"gammad",\u03DC:"Gammad",\u03B6:"zeta",\u0396:"Zeta",\u03B7:"eta",\u0397:"Eta",\u03B8:"theta",\u03D1:"thetav",\u0398:"Theta",\u03B9:"iota",\u0399:"Iota",\u03BA:"kappa",\u03F0:"kappav",\u039A:"Kappa",\u03BB:"lambda",\u039B:"Lambda",\u03BC:"mu",\u00B5:"micro",\u039C:"Mu",\u03BD:"nu",\u039D:"Nu",\u03BE:"xi",\u039E:"Xi",\u03BF:"omicron",\u039F:"Omicron",\u03C0:"pi",\u03D6:"piv",\u03A0:"Pi",\u03C1:"rho",\u03F1:"rhov",\u03A1:"Rho",\u03C3:"sigma",\u03A3:"Sigma",\u03C2:"sigmaf",\u03C4:"tau",\u03A4:"Tau",\u03C5:"upsi",\u03A5:"Upsilon",\u03D2:"Upsi",\u03C6:"phi",\u03D5:"phiv",\u03A6:"Phi",\u03C7:"chi",\u03A7:"Chi",\u03C8:"psi",\u03A8:"Psi",\u03C9:"omega",\u03A9:"ohm",\u0430:"acy",\u0410:"Acy",\u0431:"bcy",\u0411:"Bcy",\u0432:"vcy",\u0412:"Vcy",\u0433:"gcy",\u0413:"Gcy",\u0453:"gjcy",\u0403:"GJcy",\u0434:"dcy",\u0414:"Dcy",\u0452:"djcy",\u0402:"DJcy",\u0435:"iecy",\u0415:"IEcy",\u0451:"iocy",\u0401:"IOcy",\u0454:"jukcy",\u0404:"Jukcy",\u0436:"zhcy",\u0416:"ZHcy",\u0437:"zcy",\u0417:"Zcy",\u0455:"dscy",\u0405:"DScy",\u0438:"icy",\u0418:"Icy",\u0456:"iukcy",\u0406:"Iukcy",\u0457:"yicy",\u0407:"YIcy",\u0439:"jcy",\u0419:"Jcy",\u0458:"jsercy",\u0408:"Jsercy",\u043A:"kcy",\u041A:"Kcy",\u045C:"kjcy",\u040C:"KJcy",\u043B:"lcy",\u041B:"Lcy",\u0459:"ljcy",\u0409:"LJcy",\u043C:"mcy",\u041C:"Mcy",\u043D:"ncy",\u041D:"Ncy",\u045A:"njcy",\u040A:"NJcy",\u043E:"ocy",\u041E:"Ocy",\u043F:"pcy",\u041F:"Pcy",\u0440:"rcy",\u0420:"Rcy",\u0441:"scy",\u0421:"Scy",\u0442:"tcy",\u0422:"Tcy",\u045B:"tshcy",\u040B:"TSHcy",\u0443:"ucy",\u0423:"Ucy",\u045E:"ubrcy",\u040E:"Ubrcy",\u0444:"fcy",\u0424:"Fcy",\u0445:"khcy",\u0425:"KHcy",\u0446:"tscy",\u0426:"TScy",\u0447:"chcy",\u0427:"CHcy",\u045F:"dzcy",\u040F:"DZcy",\u0448:"shcy",\u0428:"SHcy",\u0449:"shchcy",\u0429:"SHCHcy",\u044A:"hardcy",\u042A:"HARDcy",\u044B:"ycy",\u042B:"Ycy",\u044C:"softcy",\u042C:"SOFTcy",\u044D:"ecy",\u042D:"Ecy",\u044E:"yucy",\u042E:"YUcy",\u044F:"yacy",\u042F:"YAcy",\u2135:"aleph",\u2136:"beth",\u2137:"gimel",\u2138:"daleth"},l=/["&'<>`]/g,u={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,h=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,v={aacute:"\xE1",Aacute:"\xC1",abreve:"\u0103",Abreve:"\u0102",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",acy:"\u0430",Acy:"\u0410",aelig:"\xE6",AElig:"\xC6",af:"\u2061",afr:"\u{1D51E}",Afr:"\u{1D504}",agrave:"\xE0",Agrave:"\xC0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",Alpha:"\u0391",amacr:"\u0101",Amacr:"\u0100",amalg:"\u2A3F",amp:"&",AMP:"&",and:"\u2227",And:"\u2A53",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",Aogon:"\u0104",aopf:"\u{1D552}",Aopf:"\u{1D538}",ap:"\u2248",apacir:"\u2A6F",ape:"\u224A",apE:"\u2A70",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",Aring:"\xC5",ascr:"\u{1D4B6}",Ascr:"\u{1D49C}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",Bcy:"\u0411",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",beta:"\u03B2",Beta:"\u0392",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",Bfr:"\u{1D505}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bNot:"\u2AED",bopf:"\u{1D553}",Bopf:"\u{1D539}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxhD:"\u2565",boxHd:"\u2564",boxHD:"\u2566",boxhu:"\u2534",boxhU:"\u2568",boxHu:"\u2567",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpe:"\u224F",bumpE:"\u2AAE",bumpeq:"\u224F",Bumpeq:"\u224E",cacute:"\u0107",Cacute:"\u0106",cap:"\u2229",Cap:"\u22D2",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",ccaron:"\u010D",Ccaron:"\u010C",ccedil:"\xE7",Ccedil:"\xC7",ccirc:"\u0109",Ccirc:"\u0108",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",Cdot:"\u010A",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",chcy:"\u0447",CHcy:"\u0427",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",Chi:"\u03A7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cire:"\u2257",cirE:"\u29C3",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",colone:"\u2254",Colone:"\u2A74",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",cscr:"\u{1D4B8}",Cscr:"\u{1D49E}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",Cup:"\u22D3",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",dArr:"\u21D3",Darr:"\u21A1",dash:"\u2010",dashv:"\u22A3",Dashv:"\u2AE4",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",Dcaron:"\u010E",dcy:"\u0434",Dcy:"\u0414",dd:"\u2146",DD:"\u2145",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",delta:"\u03B4",Delta:"\u0394",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",Dfr:"\u{1D507}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",DJcy:"\u0402",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",Dopf:"\u{1D53B}",dot:"\u02D9",Dot:"\xA8",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",downarrow:"\u2193",Downarrow:"\u21D3",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",Dscr:"\u{1D49F}",dscy:"\u0455",DScy:"\u0405",dsol:"\u29F6",dstrok:"\u0111",Dstrok:"\u0110",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",DZcy:"\u040F",dzigrarr:"\u27FF",eacute:"\xE9",Eacute:"\xC9",easter:"\u2A6E",ecaron:"\u011B",Ecaron:"\u011A",ecir:"\u2256",ecirc:"\xEA",Ecirc:"\xCA",ecolon:"\u2255",ecy:"\u044D",Ecy:"\u042D",eDDot:"\u2A77",edot:"\u0117",eDot:"\u2251",Edot:"\u0116",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",Efr:"\u{1D508}",eg:"\u2A9A",egrave:"\xE8",Egrave:"\xC8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",Emacr:"\u0112",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",eng:"\u014B",ENG:"\u014A",ensp:"\u2002",eogon:"\u0119",Eogon:"\u0118",eopf:"\u{1D556}",Eopf:"\u{1D53C}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",Epsilon:"\u0395",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",esim:"\u2242",Esim:"\u2A73",eta:"\u03B7",Eta:"\u0397",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",Fcy:"\u0424",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",Ffr:"\u{1D509}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",Fopf:"\u{1D53D}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",gamma:"\u03B3",Gamma:"\u0393",gammad:"\u03DD",Gammad:"\u03DC",gap:"\u2A86",gbreve:"\u011F",Gbreve:"\u011E",Gcedil:"\u0122",gcirc:"\u011D",Gcirc:"\u011C",gcy:"\u0433",Gcy:"\u0413",gdot:"\u0121",Gdot:"\u0120",ge:"\u2265",gE:"\u2267",gel:"\u22DB",gEl:"\u2A8C",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",Gfr:"\u{1D50A}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",GJcy:"\u0403",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",Gopf:"\u{1D53E}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",gscr:"\u210A",Gscr:"\u{1D4A2}",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",Gt:"\u226B",GT:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",HARDcy:"\u042A",harr:"\u2194",hArr:"\u21D4",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",hcirc:"\u0125",Hcirc:"\u0124",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",hstrok:"\u0127",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",Iacute:"\xCD",ic:"\u2063",icirc:"\xEE",Icirc:"\xCE",icy:"\u0438",Icy:"\u0418",Idot:"\u0130",iecy:"\u0435",IEcy:"\u0415",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",igrave:"\xEC",Igrave:"\xCC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",IJlig:"\u0132",Im:"\u2111",imacr:"\u012B",Imacr:"\u012A",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",Int:"\u222C",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",iocy:"\u0451",IOcy:"\u0401",iogon:"\u012F",Iogon:"\u012E",iopf:"\u{1D55A}",Iopf:"\u{1D540}",iota:"\u03B9",Iota:"\u0399",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",Itilde:"\u0128",iukcy:"\u0456",Iukcy:"\u0406",iuml:"\xEF",Iuml:"\xCF",jcirc:"\u0135",Jcirc:"\u0134",jcy:"\u0439",Jcy:"\u0419",jfr:"\u{1D527}",Jfr:"\u{1D50D}",jmath:"\u0237",jopf:"\u{1D55B}",Jopf:"\u{1D541}",jscr:"\u{1D4BF}",Jscr:"\u{1D4A5}",jsercy:"\u0458",Jsercy:"\u0408",jukcy:"\u0454",Jukcy:"\u0404",kappa:"\u03BA",Kappa:"\u039A",kappav:"\u03F0",kcedil:"\u0137",Kcedil:"\u0136",kcy:"\u043A",Kcy:"\u041A",kfr:"\u{1D528}",Kfr:"\u{1D50E}",kgreen:"\u0138",khcy:"\u0445",KHcy:"\u0425",kjcy:"\u045C",KJcy:"\u040C",kopf:"\u{1D55C}",Kopf:"\u{1D542}",kscr:"\u{1D4C0}",Kscr:"\u{1D4A6}",lAarr:"\u21DA",lacute:"\u013A",Lacute:"\u0139",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",Lambda:"\u039B",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larr:"\u2190",lArr:"\u21D0",Larr:"\u219E",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",lAtail:"\u291B",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",Lcaron:"\u013D",lcedil:"\u013C",Lcedil:"\u013B",lceil:"\u2308",lcub:"{",lcy:"\u043B",Lcy:"\u041B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",leftarrow:"\u2190",Leftarrow:"\u21D0",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",Leftrightarrow:"\u21D4",LeftRightArrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",leg:"\u22DA",lEg:"\u2A8B",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",Lfr:"\u{1D50F}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",LJcy:"\u0409",ll:"\u226A",Ll:"\u22D8",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",Lmidot:"\u013F",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",Longleftarrow:"\u27F8",LongLeftArrow:"\u27F5",longleftrightarrow:"\u27F7",Longleftrightarrow:"\u27FA",LongLeftRightArrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",Longrightarrow:"\u27F9",LongRightArrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",Lopf:"\u{1D543}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",Lstrok:"\u0141",lt:"<",Lt:"\u226A",LT:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",Map:"\u2905",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",Mcy:"\u041C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",mfr:"\u{1D52A}",Mfr:"\u{1D510}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",Mopf:"\u{1D544}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",mu:"\u03BC",Mu:"\u039C",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",nacute:"\u0144",Nacute:"\u0143",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",Ncaron:"\u0147",ncedil:"\u0146",Ncedil:"\u0145",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",Ncy:"\u041D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},g={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},x={"0":"\uFFFD","128":"\u20AC","130":"\u201A","131":"\u0192","132":"\u201E","133":"\u2026","134":"\u2020","135":"\u2021","136":"\u02C6","137":"\u2030","138":"\u0160","139":"\u2039","140":"\u0152","142":"\u017D","145":"\u2018","146":"\u2019","147":"\u201C","148":"\u201D","149":"\u2022","150":"\u2013","151":"\u2014","152":"\u02DC","153":"\u2122","154":"\u0161","155":"\u203A","156":"\u0153","158":"\u017E","159":"\u0178"},p=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],d=String.fromCharCode,A={},b=A.hasOwnProperty,C=function(N,U){return b.call(N,U)},E=function(N,U){for(var Z=-1,O=N.length;++Z=55296&&N<=57343||N>1114111?(U&&M("character reference outside the permissible Unicode range"),"\uFFFD"):C(x,N)?(U&&M("disallowed character reference"),x[N]):(U&&E(p,N)&&M("disallowed character reference"),N>65535&&(N-=65536,Z+=d(N>>>10&1023|55296),N=56320|N&1023),Z+=d(N),Z)},P=function(N){return"&#x"+N.toString(16).toUpperCase()+";"},F=function(N){return"&#"+N+";"},M=function(N){throw Error("Parse error: "+N)},D=function(N,U){U=T(U,D.options);var Z=U.strict;Z&&h.test(N)&&M("forbidden code point");var O=U.encodeEverything,W=U.useNamedReferences,X=U.allowUnsafeSymbols,Q=U.decimal?F:P,a1=function(B){return Q(B.charCodeAt(0))};return O?(N=N.replace(r,function(B){return W&&C(c,B)?"&"+c[B]+";":a1(B)}),W&&(N=N.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),W&&(N=N.replace(o,function(B){return"&"+c[B]+";"}))):W?(X||(N=N.replace(l,function(B){return"&"+c[B]+";"})),N=N.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),N=N.replace(o,function(B){return"&"+c[B]+";"})):X||(N=N.replace(l,a1)),N.replace(a,function(B){var M1=B.charCodeAt(0),u1=B.charCodeAt(1),v1=(M1-55296)*1024+u1-56320+65536;return Q(v1)}).replace(s,a1)};D.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var z=function(N,U){U=T(U,z.options);var Z=U.strict;return Z&&f.test(N)&&M("malformed character reference"),N.replace(m,function(O,W,X,Q,a1,B,M1,u1,v1){var n1,T1,A1,C1,u2,J1;return W?(u2=W,v[u2]):X?(u2=X,J1=Q,J1&&U.isAttributeValue?(Z&&J1=="="&&M("`&` did not start a character reference"),O):(Z&&M("named character reference was not terminated by a semicolon"),g[u2]+(J1||""))):a1?(A1=a1,T1=B,Z&&!T1&&M("character reference was not terminated by a semicolon"),n1=parseInt(A1,10),_(n1,Z)):M1?(C1=M1,T1=u1,Z&&!T1&&M("character reference was not terminated by a semicolon"),n1=parseInt(C1,16),_(n1,Z)):(Z&&M("named character reference was not terminated by a semicolon"),O)})};z.options={isAttributeValue:!1,strict:!1};var H=function(N){return N.replace(l,function(U){return u[U]})},V={version:"1.2.0",encode:D,decode:z,escape:H,unescape:z};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return V});else if(e&&!e.nodeType)if(t)t.exports=V;else for(var L in V)C(V,L)&&(e[L]=V[L]);else n.he=V})(o6)});var _o=y0((So,x0)=>{(function(n,e){typeof define=="function"&&define.amd?define([],e):typeof x0=="object"&&x0.exports?x0.exports=e():n.moo=e()})(So,function(){"use strict";var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function i(_){return _&&e.call(_)==="[object RegExp]"}function a(_){return _&&typeof _=="object"&&!i(_)&&!Array.isArray(_)}function r(_){return _.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(_){var P=new RegExp("|"+_);return P.exec("").length-1}function o(_){return"("+_+")"}function c(_){if(!_.length)return"(?!)";var P=_.map(function(F){return"(?:"+F+")"}).join("|");return"(?:"+P+")"}function l(_){if(typeof _=="string")return"(?:"+r(_)+")";if(i(_)){if(_.ignoreCase)throw new Error("RegExp /i flag not allowed");if(_.global)throw new Error("RegExp /g flag is implied");if(_.sticky)throw new Error("RegExp /y flag is implied");if(_.multiline)throw new Error("RegExp /m flag is implied");return _.source}else throw new Error("Not a pattern: "+_)}function u(_){for(var P=Object.getOwnPropertyNames(_),F=[],M=0;M0)throw new Error("RegExp has capture groups: "+Q+` +Use (?: \u2026 ) instead`);if(!N.lineBreaks&&Q.test(` +`))throw new Error("Rule should declare lineBreaks: "+Q);V.push(o(X))}}var B=F&&F.fallback,M1=t&&!B?"ym":"gm",u1=t||B?"":"|";z===!0&&(M1+="u");var v1=new RegExp(c(V)+u1,M1);return{regexp:v1,groups:H,fast:M,error:F||v}}function x(_){var P=g(m(_));return new b({start:P},"start")}function p(_,P,F){var M=_&&(_.push||_.next);if(M&&!F[M])throw new Error("Missing state '"+M+"' (in token '"+_.defaultType+"' of state '"+P+"')");if(_&&_.pop&&+_.pop!=1)throw new Error("pop must be 1 (in token '"+_.defaultType+"' of state '"+P+"')")}function d(_,P){var F=_.$all?m(_.$all):[];delete _.$all;var M=Object.getOwnPropertyNames(_);P||(P=M[0]);for(var D=Object.create(null),z=0;zd6,default:()=>Fi});var Z1=w2(require("obsidian")),Vo=w2(Ii());var ki={prefix:"fas",iconName:"dice",icon:[640,512,[],"f522","M592 192H473.26c12.69 29.59 7.12 65.2-17 89.32L320 417.58V464c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48V240c0-26.51-21.49-48-48-48zM480 376c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm-46.37-186.7L258.7 14.37c-19.16-19.16-50.23-19.16-69.39 0L14.37 189.3c-19.16 19.16-19.16 50.23 0 69.39L189.3 433.63c19.16 19.16 50.23 19.16 69.39 0L433.63 258.7c19.16-19.17 19.16-50.24 0-69.4zM96 248c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"]};var Ui={prefix:"far",iconName:"copy",icon:[448,512,[],"f0c5","M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"]};function x4(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?x4=function(e){return typeof e}:x4=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x4(n)}function Zo(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Oi(n,e){for(var t=0;t-1;a--){var r=t[a],s=(r.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(i=r)}return C2.head.insertBefore(e,i),n}}var gc="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function n6(){for(var n=12,e="";n-- >0;)e+=gc[Math.random()*62|0];return e}function sa(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function xc(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(sa(n[t]),'" ')},"").trim()}function oa(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t],";")},"")}function ca(n){return n.size!==Bt.size||n.x!==Bt.x||n.y!==Bt.y||n.rotate!==Bt.rotate||n.flipX||n.flipY}function la(n){var e=n.transform,t=n.containerWidth,i=n.iconWidth,a={transform:"translate(".concat(t/2," 256)")},r="translate(".concat(e.x*32,", ").concat(e.y*32,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),o="rotate(".concat(e.rotate," 0 0)"),c={transform:"".concat(r," ").concat(s," ").concat(o)},l={transform:"translate(".concat(i/2*-1," -256)")};return{outer:a,inner:c,path:l}}var L0={x:0,y:0,width:"100%",height:"100%"};function ua(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function Mc(n){return n.tag==="g"?n.children:[n]}function bc(n){var e=n.children,t=n.attributes,i=n.main,a=n.mask,r=n.maskId,s=n.transform,o=i.width,c=i.icon,l=a.width,u=a.icon,f=la({transform:s,containerWidth:l,iconWidth:o}),h={tag:"rect",attributes:F1({},L0,{fill:"white"})},m=c.children?{children:c.children.map(ua)}:{},v={tag:"g",attributes:F1({},f.inner),children:[ua(F1({tag:c.tag,attributes:F1({},c.attributes,f.path)},m))]},g={tag:"g",attributes:F1({},f.outer),children:[v]},x="mask-".concat(r||n6()),p="clip-".concat(r||n6()),d={tag:"mask",attributes:F1({},L0,{id:x,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,g]},A={tag:"defs",children:[{tag:"clipPath",attributes:{id:p},children:Mc(u)},d]};return e.push(A,{tag:"rect",attributes:F1({fill:"currentColor","clip-path":"url(#".concat(p,")"),mask:"url(#".concat(x,")")},L0)}),{children:e,attributes:t}}function yc(n){var e=n.children,t=n.attributes,i=n.main,a=n.transform,r=n.styles,s=oa(r);if(s.length>0&&(t.style=s),ca(a)){var o=la({transform:a,containerWidth:i.width,iconWidth:i.width});e.push({tag:"g",attributes:F1({},o.outer),children:[{tag:"g",attributes:F1({},o.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:F1({},i.icon.attributes,o.path)}]}]})}else e.push(i.icon);return{children:e,attributes:t}}function Cc(n){var e=n.children,t=n.main,i=n.mask,a=n.attributes,r=n.styles,s=n.transform;if(ca(s)&&t.found&&!i.found){var o=t.width,c=t.height,l={x:o/c/2,y:.5};a.style=oa(F1({},r,{"transform-origin":"".concat(l.x+s.x/16,"em ").concat(l.y+s.y/16,"em")}))}return[{tag:"svg",attributes:a,children:e}]}function zc(n){var e=n.prefix,t=n.iconName,i=n.children,a=n.attributes,r=n.symbol,s=r===!0?"".concat(e,"-").concat(V2.familyPrefix,"-").concat(t):r;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:F1({},a,{id:s}),children:i}]}]}function Ac(n){var e=n.icons,t=e.main,i=e.mask,a=n.prefix,r=n.iconName,s=n.transform,o=n.symbol,c=n.title,l=n.maskId,u=n.titleId,f=n.extra,h=n.watchable,m=h===void 0?!1:h,v=i.found?i:t,g=v.width,x=v.height,p=a==="fak",d=p?"":"fa-w-".concat(Math.ceil(g/x*16)),A=[V2.replacementClass,r?"".concat(V2.familyPrefix,"-").concat(r):"",d].filter(function(F){return f.classes.indexOf(F)===-1}).filter(function(F){return F!==""||!!F}).concat(f.classes).join(" "),b={children:[],attributes:F1({},f.attributes,{"data-prefix":a,"data-icon":r,class:A,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(g," ").concat(x)})},C=p&&!~f.classes.indexOf("fa-fw")?{width:"".concat(g/x*16*.0625,"em")}:{};m&&(b.attributes[ic]=""),c&&b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(u||n6())},children:[c]});var E=F1({},b,{prefix:a,iconName:r,main:t,mask:i,maskId:l,transform:s,symbol:o,styles:F1({},C,f.styles)}),T=i.found&&t.found?bc(E):yc(E),_=T.children,P=T.attributes;return E.children=_,E.attributes=P,o?zc(E):Cc(E)}var ha=function(){},yh=V2.measurePerformance&&t6&&t6.mark&&t6.measure?t6:{mark:ha,measure:ha};var wc=function(e,t){return function(i,a,r,s){return e.call(t,i,a,r,s)}},D0=function(e,t,i,a){var r=Object.keys(e),s=r.length,o=a!==void 0?wc(t,a):t,c,l,u;for(i===void 0?(c=1,u=e[r[0]]):(c=0,u=i);c2&&arguments[2]!==void 0?arguments[2]:{},i=t.skipHooks,a=i===void 0?!1:i,r=Object.keys(e).reduce(function(s,o){var c=e[o],l=!!c.icon;return l?s[c.iconName]=c.icon:s[o]=c,s},{});typeof de.hooks.addPack=="function"&&!a?de.hooks.addPack(n,r):de.styles[n]=F1({},de.styles[n]||{},r),n==="fas"&&fa("fa",e)}var da=de.styles,Sc=de.shims,_c={},Ec={},Lc={},pa=function(){var e=function(a){return D0(da,function(r,s,o){return r[o]=D0(s,a,{}),r},{})};_c=e(function(i,a,r){return a[3]&&(i[a[3]]=r),i}),Ec=e(function(i,a,r){var s=a[2];return i[r]=r,s.forEach(function(o){i[o]=r}),i});var t="far"in da;Lc=D0(Sc,function(i,a){var r=a[0],s=a[1],o=a[2];return s==="far"&&!t&&(s="fas"),i[r]={prefix:s,iconName:o},i},{})};pa();var Ch=de.styles;function ma(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}function va(n){var e=n.tag,t=n.attributes,i=t===void 0?{}:t,a=n.children,r=a===void 0?[]:a;return typeof n=="string"?sa(n):"<".concat(e," ").concat(xc(i),">").concat(r.map(va).join(""),"")}function T0(n){this.name="MissingIcon",this.message=n||"Icon unavailable",this.stack=new Error().stack}T0.prototype=Object.create(Error.prototype);T0.prototype.constructor=T0;var s6={fill:"currentColor"},ga={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},zh={tag:"path",attributes:F1({},s6,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},H0=F1({},ga,{attributeName:"opacity"}),Ah={tag:"circle",attributes:F1({},s6,{cx:"256",cy:"364",r:"28"}),children:[{tag:"animate",attributes:F1({},ga,{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:F1({},H0,{values:"1;0;1;1;0;1;"})}]},wh={tag:"path",attributes:F1({},s6,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:[{tag:"animate",attributes:F1({},H0,{values:"1;0;0;0;0;1;"})}]},Sh={tag:"path",attributes:F1({},s6,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:F1({},H0,{values:"0;0;1;1;0;0;"})}]};var _h=de.styles;function xa(n){var e=n[0],t=n[1],i=n.slice(4),a=Gi(i,1),r=a[0],s=null;return Array.isArray(r)?s={tag:"g",attributes:{class:"".concat(V2.familyPrefix,"-").concat(vt.GROUP)},children:[{tag:"path",attributes:{class:"".concat(V2.familyPrefix,"-").concat(vt.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(V2.familyPrefix,"-").concat(vt.PRIMARY),fill:"currentColor",d:r[1]}}]}:s={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:e,height:t,icon:s}}var Eh=de.styles;var Dc=`svg:not(:root).svg-inline--fa { overflow: visible; } @@ -469,92 +469,92 @@ Use (?: \u2026 ) instead`);if(!R.lineBreaks&&e1.test(` .fad.fa-inverse { color: #fff; -}`;function Vc(){var n=$i,e=Ki,t=N2.familyPrefix,i=N2.replacementClass,a=Hc;if(t!==n||i!==e){var r=new RegExp("\\.".concat(n,"\\-"),"g"),s=new RegExp("\\--".concat(n,"\\-"),"g"),o=new RegExp("\\.".concat(e),"g");a=a.replace(r,".".concat(t,"-")).replace(s,"--".concat(t,"-")).replace(o,".".concat(i))}return a}var Nc=function(){function n(){$o(this,n),this.definitions={}}return Ko(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,a=new Array(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:ba(e||{}),a=t.mask;return a&&(a=(a||{}).icon?a:ba(a||{})),n(i,B1({},t,{mask:a}))}}var Pc=new Nc;var ya=!1;var N0=Bc(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,i=t===void 0?Pt:t,a=e.symbol,r=a===void 0?!1:a,s=e.mask,o=s===void 0?null:s,c=e.maskId,l=c===void 0?null:c,u=e.title,f=u===void 0?null:u,h=e.titleId,m=h===void 0?null:h,v=e.classes,g=v===void 0?[]:v,x=e.attributes,p=x===void 0?{}:x,d=e.styles,w=d===void 0?{}:d;if(!!n){var b=n.prefix,z=n.iconName,L=n.icon;return Fc(B1({type:"icon"},n),function(){return Rc(),N2.autoA11y&&(f?p["aria-labelledby"]="".concat(N2.replacementClass,"-title-").concat(m||s6()):(p["aria-hidden"]="true",p.focusable="false")),Sc({icons:{main:Ma(L),mask:o?Ma(o.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:z,transform:B1({},Pt,i),symbol:r,title:f,maskId:l,titleId:m,extra:{attributes:p,styles:w,classes:g}})})}});function R0(n,e){let t=Object.keys(e).map(i=>Ic(n,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}function Ic(n,e,t){let i=n[e],a=n.hasOwnProperty(e),r=t(i);return i&&Object.setPrototypeOf(r,i),Object.setPrototypeOf(s,r),n[e]=s,o;function s(...c){return r===i&&n[e]===s&&o(),r.apply(this,c)}function o(){n[e]===s&&(a?n[e]=i:delete n[e]),r!==i&&(r=i,Object.setPrototypeOf(s,i||Function))}}var Ro=S2(Ca());var F0=/(?:(?\d+)[Dd])?#(?[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,za=/(?.*)?(?:\[.*\]\(|\[\[)(?.+?)#?\^(?.+?)(?:\]\]|\))(?:\|(?
.+))?/,B0=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+)(?:\]\]|\))\|?(?.+)?/;var $2="dice-roller-icon",Qe="dice-roller-copy";var Mt=S2(require("obsidian"));var me=(a=>(a.None="None",a.Normal="Normal",a.Up="Up",a.Down="Down",a))(me||{}),x2=(i=>(i.None="None",i.Average="Average",i.Roll="Roll",i))(x2||{});function Aa(n,e,t){[...n].slice(e).reverse().forEach(([a,r])=>{n.set(a+1,r)}),n.set(e,t)}var It=S2(require("obsidian"));var P0=class extends It.Events{constructor(e,t="",i=e.data.showDice){super();this.plugin=e;this.original=t;C(this,"rolls");C(this,"result");C(this,"loaded",!1);C(this,"containerEl",createSpan({cls:"dice-roller",attr:{"aria-label-position":"top","data-dice":this.original}}));C(this,"resultEl",this.containerEl.createSpan("dice-roller-result"));C(this,"iconEl");i?(this.iconEl=this.containerEl.createSpan({cls:"dice-roller-button"}),(0,It.setIcon)(this.iconEl,$2),this.iconEl.onclick=this.onClick.bind(this)):this.containerEl.addClass("no-icon"),this.containerEl.onclick=this.onClick.bind(this)}setTooltip(){this.plugin.data.displayResultsInline||this.containerEl.setAttrs({"aria-label":this.tooltip})}getRandomBetween(e,t){let i=new Uint32Array(1);crypto.getRandomValues(i);let a=i[0]/(4294967295+1);return Math.floor(a*(t-e+1))+e}async render(){this.setTooltip(),await this.build()}async onClick(e){e.stopPropagation(),e.stopImmediatePropagation(),window.getSelection()?.isCollapsed&&await this.roll()}},l6=class extends P0{constructor(e,t,i,a=e.data.showDice){super(e,t,a);this.plugin=e;this.original=t;this.lexemes=i;this.showDice=a;C(this,"save",!1)}get inlineText(){return`${this.tooltip.split(` -`).join(" -> ")} -> `}},xt=class extends l6{},A4=class extends xt{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;C(this,"path");C(this,"file");C(this,"cache");C(this,"options");C(this,"results");C(this,"init");C(this,"watch",!0);this.getPath(),this.init=this.getFile()}async getFile(){if(this.file=this.plugin.app.metadataCache.getFirstLinkpathDest(this.path,this.source),!this.file||!(this.file instanceof It.TFile))throw new Error("Could not load file.");await this.load()}},I0=class extends P0{constructor(e,t,i){super(e,"");this.options=t;this.rolls=i;C(this,"result");C(this,"results")}get tooltip(){return`${this.options.toString()} +}`;function Tc(){var n=Yi,e=$i,t=V2.familyPrefix,i=V2.replacementClass,a=Dc;if(t!==n||i!==e){var r=new RegExp("\\.".concat(n,"\\-"),"g"),s=new RegExp("\\--".concat(n,"\\-"),"g"),o=new RegExp("\\.".concat(e),"g");a=a.replace(r,".".concat(t,"-")).replace(s,"--".concat(t,"-")).replace(o,".".concat(i))}return a}var Hc=function(){function n(){Zo(this,n),this.definitions={}}return Yo(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,a=new Array(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:Ma(e||{}),a=t.mask;return a&&(a=(a||{}).icon?a:Ma(a||{})),n(i,F1({},t,{mask:a}))}}var Fc=new Hc;var ba=!1;var V0=Rc(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,i=t===void 0?Bt:t,a=e.symbol,r=a===void 0?!1:a,s=e.mask,o=s===void 0?null:s,c=e.maskId,l=c===void 0?null:c,u=e.title,f=u===void 0?null:u,h=e.titleId,m=h===void 0?null:h,v=e.classes,g=v===void 0?[]:v,x=e.attributes,p=x===void 0?{}:x,d=e.styles,A=d===void 0?{}:d;if(!!n){var b=n.prefix,C=n.iconName,E=n.icon;return Nc(F1({type:"icon"},n),function(){return Vc(),V2.autoA11y&&(f?p["aria-labelledby"]="".concat(V2.replacementClass,"-title-").concat(m||n6()):(p["aria-hidden"]="true",p.focusable="false")),Ac({icons:{main:xa(E),mask:o?xa(o.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:C,transform:F1({},Bt,i),symbol:r,title:f,maskId:l,titleId:m,extra:{attributes:p,styles:A,classes:g}})})}});function N0(n,e){let t=Object.keys(e).map(i=>Bc(n,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}function Bc(n,e,t){let i=n[e],a=n.hasOwnProperty(e),r=t(i);return i&&Object.setPrototypeOf(r,i),Object.setPrototypeOf(s,r),n[e]=s,o;function s(...c){return r===i&&n[e]===s&&o(),r.apply(this,c)}function o(){n[e]===s&&(a?n[e]=i:delete n[e]),r!==i&&(r=i,Object.setPrototypeOf(s,i||Function))}}var No=w2(ya());var R0=/(?:(?\d+)[Dd])?#(?[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,Ca=/(?.*)?(?:\[.*\]\(|\[\[)(?.+?)#?\^(?.+?)(?:\]\]|\))(?:\|(?
.+))?/,F0=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+)(?:\]\]|\))\|?(?.+)?/;var Y2="dice-roller-icon",Je="dice-roller-copy";var xt=w2(require("obsidian"));var pe=(a=>(a.None="None",a.Normal="Normal",a.Up="Up",a.Down="Down",a))(pe||{}),g2=(i=>(i.None="None",i.Average="Average",i.Roll="Roll",i))(g2||{});function za(n,e,t){[...n].slice(e).reverse().forEach(([a,r])=>{n.set(a+1,r)}),n.set(e,t)}var Pt=w2(require("obsidian"));var B0=class extends Pt.Events{constructor(e,t="",i=e.data.showDice){super();this.plugin=e;this.original=t;this.loaded=!1;this.containerEl=createSpan({cls:"dice-roller",attr:{"aria-label-position":"top","data-dice":this.original}});this.resultEl=this.containerEl.createSpan("dice-roller-result");i?(this.iconEl=this.containerEl.createSpan({cls:"dice-roller-button"}),(0,Pt.setIcon)(this.iconEl,Y2),this.iconEl.onclick=this.onClick.bind(this)):this.containerEl.addClass("no-icon"),this.containerEl.onclick=this.onClick.bind(this)}setTooltip(){this.plugin.data.displayResultsInline||this.containerEl.setAttrs({"aria-label":this.tooltip})}getRandomBetween(e,t){let i=new Uint32Array(1);crypto.getRandomValues(i);let a=i[0]/(4294967295+1);return Math.floor(a*(t-e+1))+e}async render(){this.setTooltip(),await this.build()}async onClick(e){e.stopPropagation(),e.stopImmediatePropagation(),window.getSelection()?.isCollapsed&&await this.roll()}},c6=class extends B0{constructor(e,t,i,a=e.data.showDice){super(e,t,a);this.plugin=e;this.original=t;this.lexemes=i;this.showDice=a;this.save=!1}get inlineText(){return`${this.tooltip.split(` +`).join(" -> ")} -> `}},gt=class extends c6{},C4=class extends gt{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;this.watch=!0;this.getPath(),this.init=this.getFile()}async getFile(){if(this.file=this.plugin.app.metadataCache.getFirstLinkpathDest(this.path,this.source),!this.file||!(this.file instanceof Pt.TFile))throw new Error("Could not load file.");await this.load()}},P0=class extends B0{constructor(e,t,i){super(e,"");this.options=t;this.rolls=i}get tooltip(){return`${this.options.toString()} -${this.results.toString()}`}async roll(){let e=[...this.options];return this.results=[...Array(this.rolls)].map(()=>{let t=e[this.getRandomBetween(0,e.length-1)];return e.splice(e.indexOf(t),1),t}).filter(t=>t),this.render(),this.trigger("new-result"),this.result=this.results[0],this.results[0]}async build(){this.resultEl.empty(),this.resultEl.setText(this.results.toString())}};var U2=class{constructor(e,t={value:e,conditions:[],type:"dice"}){this.lexeme=t;C(this,"dice");C(this,"modifiers",new Map);C(this,"rolls");C(this,"faces");C(this,"results");C(this,"resultArray");C(this,"modifiersAllowed",!0);C(this,"static",!1);C(this,"conditions",[]);C(this,"multiplier");C(this,"fudge",!1);if(!/(\-?\d+)[dD]?(\d+|%|\[\d+,\s?\d+\])?/.test(e))throw new Error("Non parseable dice string passed to DiceRoll.");this.dice=e.split(" ").join(""),/^-?\d+(?:\.\d+)?$/.test(this.dice)&&(this.static=!0,this.modifiersAllowed=!1);let[,i,a=null,r=1]=this.dice.match(/(\-?\d+)[dD]\[?(?:(-?\d+)\s?,)?\s?(-?\d+|%|F)\]?/)||[,1,null,1];i=Number(i),this.multiplier=i<0?-1:1;let s=isNaN(Number(a))?null:Number(a),o;this.rolls=Math.abs(Number(i))||1,r==="%"?o=100:r==="F"?(o=1,s=-1,this.fudge=!0):o=Number(r),Number(o)<0&&!s&&(s=-1),Number(o)t?i:0).reduce((t,i)=>t+i,0)}get display(){return this.static?`${this.result}`:`[${[...this.results].map(([,{modifiers:e,display:t}])=>`${t}${[...e].join("")}`).join(", ")}]`}get modifierText(){if(!this.modifiers.size)return"";let e=[...this.conditions].map(({value:i})=>i).join(""),t=[...this.modifiers].map(([i,{conditionals:a,value:r}])=>{let s=a.map(o=>o.value);return`${r}${s.join("")}`}).join("");return`${e}${t}`}keepLow(e=1){if(!this.modifiersAllowed){new Mt.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>t[1].value-i[1].value).slice(e-this.results.size).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}keepHigh(e=1){if(!this.modifiersAllowed){new Mt.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>i[1].value-t[1].value).slice(e).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}reroll(e,t){if(!this.modifiersAllowed){new Mt.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.min,value:""});let i=0,a=[...this.results].filter(([,{value:r}])=>this.checkCondition(r,t));for(;ithis.checkCondition(r,t)).length>0;)i++,a.map(([,r])=>{r.modifiers.add("r"),r.value=this.getValue()});a.forEach(([r,s])=>{this.results.set(r,s)})}explodeAndCombine(e,t){if(!this.modifiersAllowed){new Mt.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.max,value:""}),[...this.results].filter(([,{value:a}])=>this.checkCondition(a,t)).forEach(([a,r])=>{let s=this.getValue(),o=0;for(r.modifiers.add("!"),r.value+=s,r.display=`${r.value}`,this.results.set(a,r);othis.checkCondition(r,t)),a=0;i.forEach(([r,s])=>{let o=s.value,c=0;for(;cthis.getValue())}getValue(){return this.multiplier*this.getRandomBetween(this.faces.min,this.faces.max)}setResults(e){this.results=new Map([...e].map((t,i)=>[i,{usable:!0,value:t,display:`${t}`,modifiers:new Set}])),this.updateResultArray()}applyModifiers(){for(let[e,t]of this.modifiers)this.applyModifier(e,t)}roll(){let e=this._roll();return this.setResults(e),this.applyModifiers(),this.conditions?.length&&this.applyConditions(),e}applyConditions(){for(let[e,t]of this.results){let i=this.conditions.find(({operator:r})=>r==="-="||r==="=-");if(i&&t.value===i.comparer){t.value=-1,t.modifiers.add("-");continue}this.checkCondition(t.value,this.conditions)?(t.modifiers.add("*"),t.value=1):t.usable=!1}}updateResultArray(){this.resultArray=[...this.results.values()].map(e=>e.value)}applyModifier(e,t){switch(e){case"sort":{let i;t.value=="sa"?i=[...this.results.values()].sort((a,r)=>a.value-r.value):i=[...this.results.values()].sort((a,r)=>r.value-a.value),this.results=new Map([...this.results.keys()].map(a=>[a,i[a]])),this.updateResultArray();break}case"kh":{this.keepHigh(t.data);break}case"kl":{this.keepLow(t.data);break}case"!":{this.explode(t.data,t.conditionals);break}case"!!":{this.explodeAndCombine(t.data,t.conditionals);break}case"r":{this.reroll(t.data,t.conditionals);break}case"u":{this.makeUnique();break}case"condition":}}makeUnique(){let e=[...this.results.values()];if(this.faces.max-this.faces.min+1i.value)).size==this.results.size)return;let t=0;for(;new Set(e.map(i=>i.value)).size!=this.results.size&&t<100;){for(let i of e){let a=e.find(r=>r.value==i.value&&r!=i);a&&(a.value=this.getValue(),a.display=`${a.value}`,a.modifiers.add("u"))}e=[...this.results.values()],t++}}checkCondition(e,t){return!t||!t.length?e:t.some(({operator:i,comparer:a})=>{if(Number.isNaN(e)||Number.isNaN(a))return!1;let r=!1;switch(i){case"=":r=e===a;break;case"!=":case"=!":r=e!==a;break;case"<":r=e":r=e>a;break;case">=":r=e>=a;break}return r})}allowAverage(){return!0}average(){return(this.faces.min+this.faces.max)/2}getRandomBetween(e,t){return Math.floor(Math.random()*(t-e+1))+e}},kt=class extends U2{constructor(e,t){super("3d6",t);this.dice=e;this.lexeme=t}get doubles(){return new Set([...this.results].map(([,{usable:e,value:t}])=>e?t:0)).size<3}get result(){return this.static?Number(this.dice):[...this.results].map(([,{usable:t,value:i}])=>t?i:0).reduce((t,i)=>t+i,0)}get display(){let e=[];for(let t of this.results){if(t[0]==0&&this.doubles){e.push(`${t[1].value}S`);continue}e.push(`${t[1].value}`)}return`[${e.join(", ")}]`}allowAverage(){return!1}},wa=class extends U2{constructor(e,t){super(e,t);this.dice=e;this.lexeme=t;C(this,"stack",[]);let i=`${this.faces.max}`.split("");for(let a=0;aNumber(e.map(t=>t.result).join(""))).reduce((e,t)=>e+t)}get display(){return this.stack.map(e=>e.map(t=>t.result).join(",")).join("|")}roll(){return!this.stack||!this.stack.length?super.roll():(this.stack.forEach(e=>e.map(t=>t.roll())),[...this.stack.map(e=>e.map(t=>t.result)).flat()])}allowAverage(){return!1}},_2=class extends xt{constructor(e,t,i,a=e.data.showDice,r,s,o=e.data.displayFormulaAfter){super(e,t,i,a);this.plugin=e;this.original=t;this.lexemes=i;C(this,"result");C(this,"fixedText");C(this,"displayFixedText",!1);C(this,"expectedValue");C(this,"stunted","");C(this,"_tooltip");C(this,"shouldRender",!1);C(this,"showFormula",!1);C(this,"operators",{"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"^":(e,t)=>Math.pow(e,t)});C(this,"stack",[]);C(this,"stackCopy",[]);C(this,"dice",[]);C(this,"hasRunOnce",!1);o&&this.containerEl.createSpan({cls:"dice-roller-formula",text:`(${t})`}),this.fixedText=r,this.expectedValue=s,this.displayFixedText=this.fixedText!=="",this.loaded=!0,this.trigger("loaded")}get replacer(){return`${this.result}`}get resultText(){let e=[],t=0;return this.dice.forEach(i=>{let a=this.original.slice(t);e.push(a.slice(0,a.indexOf(i.lexeme.text)),i.display),t+=a.indexOf(i.lexeme.text)+i.lexeme.text.length+i.modifierText.length}),e.push(this.original.slice(t)),e.join("")}get tooltip(){return this._tooltip?this._tooltip:this.expectedValue===x2.Roll||this.shouldRender?this.displayFixedText?`${this.original} +${this.results.toString()}`}async roll(){let e=[...this.options];return this.results=[...Array(this.rolls)].map(()=>{let t=e[this.getRandomBetween(0,e.length-1)];return e.splice(e.indexOf(t),1),t}).filter(t=>t),this.render(),this.trigger("new-result"),this.result=this.results[0],this.results[0]}async build(){this.resultEl.empty(),this.resultEl.setText(this.results.toString())}};var k2=class{constructor(e,t={value:e,conditions:[],type:"dice"}){this.lexeme=t;this.modifiers=new Map;this.modifiersAllowed=!0;this.static=!1;this.conditions=[];this.fudge=!1;if(!/(\-?\d+)[dD]?(\d+|%|\[\d+,\s?\d+\])?/.test(e))throw new Error("Non parseable dice string passed to DiceRoll.");this.dice=e.split(" ").join(""),/^-?\d+(?:\.\d+)?$/.test(this.dice)&&(this.static=!0,this.modifiersAllowed=!1);let[,i,a=null,r=1]=this.dice.match(/(\-?\d+)[dD]\[?(?:(-?\d+)\s?,)?\s?(-?\d+|%|F)\]?/)||[,1,null,1];i=Number(i),this.multiplier=i<0?-1:1;let s=isNaN(Number(a))?null:Number(a),o;this.rolls=Math.abs(Number(i))||1,r==="%"?o=100:r==="F"?(o=1,s=-1,this.fudge=!0):o=Number(r),Number(o)<0&&!s&&(s=-1),Number(o)t?i:0).reduce((t,i)=>t+i,0)}get display(){return this.static?`${this.result}`:`[${[...this.results].map(([,{modifiers:e,display:t}])=>`${t}${[...e].join("")}`).join(", ")}]`}get modifierText(){if(!this.modifiers.size)return"";let e=[...this.conditions].map(({value:i})=>i).join(""),t=[...this.modifiers].map(([i,{conditionals:a,value:r}])=>{let s=a.map(o=>o.value);return`${r}${s.join("")}`}).join("");return`${e}${t}`}keepLow(e=1){if(!this.modifiersAllowed){new xt.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>t[1].value-i[1].value).slice(e-this.results.size).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}keepHigh(e=1){if(!this.modifiersAllowed){new xt.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>i[1].value-t[1].value).slice(e).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}reroll(e,t){if(!this.modifiersAllowed){new xt.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.min,value:""});let i=0,a=[...this.results].filter(([,{value:r}])=>this.checkCondition(r,t));for(;ithis.checkCondition(r,t)).length>0;)i++,a.map(([,r])=>{r.modifiers.add("r"),r.value=this.getValue()});a.forEach(([r,s])=>{this.results.set(r,s)})}explodeAndCombine(e,t){if(!this.modifiersAllowed){new xt.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.max,value:""}),[...this.results].filter(([,{value:a}])=>this.checkCondition(a,t)).forEach(([a,r])=>{let s=this.getValue(),o=0;for(r.modifiers.add("!"),r.value+=s,r.display=`${r.value}`,this.results.set(a,r);othis.checkCondition(r,t)),a=0;i.forEach(([r,s])=>{let o=s.value,c=0;for(;cthis.getValue())}getValue(){return this.multiplier*this.getRandomBetween(this.faces.min,this.faces.max)}setResults(e){this.results=new Map([...e].map((t,i)=>[i,{usable:!0,value:t,display:`${t}`,modifiers:new Set}])),this.updateResultArray()}applyModifiers(){for(let[e,t]of this.modifiers)this.applyModifier(e,t)}roll(){let e=this._roll();return this.setResults(e),this.applyModifiers(),this.conditions?.length&&this.applyConditions(),e}applyConditions(){for(let[e,t]of this.results){let i=this.conditions.find(({operator:r})=>r==="-="||r==="=-");if(i&&t.value===i.comparer){t.value=-1,t.modifiers.add("-");continue}this.checkCondition(t.value,this.conditions)?(t.modifiers.add("*"),t.value=1):t.usable=!1}}updateResultArray(){this.resultArray=[...this.results.values()].map(e=>e.value)}applyModifier(e,t){switch(e){case"sort":{let i;t.value=="sa"?i=[...this.results.values()].sort((a,r)=>a.value-r.value):i=[...this.results.values()].sort((a,r)=>r.value-a.value),this.results=new Map([...this.results.keys()].map(a=>[a,i[a]])),this.updateResultArray();break}case"kh":{this.keepHigh(t.data);break}case"kl":{this.keepLow(t.data);break}case"!":{this.explode(t.data,t.conditionals);break}case"!!":{this.explodeAndCombine(t.data,t.conditionals);break}case"r":{this.reroll(t.data,t.conditionals);break}case"u":{this.makeUnique();break}case"condition":}}makeUnique(){let e=[...this.results.values()];if(this.faces.max-this.faces.min+1i.value)).size==this.results.size)return;let t=0;for(;new Set(e.map(i=>i.value)).size!=this.results.size&&t<100;){for(let i of e){let a=e.find(r=>r.value==i.value&&r!=i);a&&(a.value=this.getValue(),a.display=`${a.value}`,a.modifiers.add("u"))}e=[...this.results.values()],t++}}checkCondition(e,t){return!t||!t.length?e:t.some(({operator:i,comparer:a})=>{if(Number.isNaN(e)||Number.isNaN(a))return!1;let r=!1;switch(i){case"=":r=e===a;break;case"!=":case"=!":r=e!==a;break;case"<":r=e":r=e>a;break;case">=":r=e>=a;break}return r})}allowAverage(){return!0}average(){return(this.faces.min+this.faces.max)/2}getRandomBetween(e,t){return Math.floor(Math.random()*(t-e+1))+e}},It=class extends k2{constructor(e,t){super("3d6",t);this.dice=e;this.lexeme=t}get doubles(){return new Set([...this.results].map(([,{usable:e,value:t}])=>e?t:0)).size<3}get result(){return this.static?Number(this.dice):[...this.results].map(([,{usable:t,value:i}])=>t?i:0).reduce((t,i)=>t+i,0)}get display(){let e=[];for(let t of this.results){if(t[0]==0&&this.doubles){e.push(`${t[1].value}S`);continue}e.push(`${t[1].value}`)}return`[${e.join(", ")}]`}allowAverage(){return!1}},Aa=class extends k2{constructor(e,t){super(e,t);this.dice=e;this.lexeme=t;this.stack=[];let i=`${this.faces.max}`.split("");for(let a=0;aNumber(e.map(t=>t.result).join(""))).reduce((e,t)=>e+t)}get display(){return this.stack.map(e=>e.map(t=>t.result).join(",")).join("|")}roll(){return!this.stack||!this.stack.length?super.roll():(this.stack.forEach(e=>e.map(t=>t.roll())),[...this.stack.map(e=>e.map(t=>t.result)).flat()])}allowAverage(){return!1}},S2=class extends gt{constructor(e,t,i,a=e.data.showDice,r,s,o=e.data.displayFormulaAfter){super(e,t,i,a);this.plugin=e;this.original=t;this.lexemes=i;this.displayFixedText=!1;this.stunted="";this.shouldRender=!1;this.showFormula=!1;this.operators={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"^":(e,t)=>Math.pow(e,t)};this.stack=[];this.stackCopy=[];this.dice=[];this.hasRunOnce=!1;o&&this.containerEl.createSpan({cls:"dice-roller-formula",text:`(${t})`}),this.fixedText=r,this.expectedValue=s,this.displayFixedText=this.fixedText!=="",this.loaded=!0,this.trigger("loaded")}get replacer(){return`${this.result}`}get resultText(){let e=[],t=0;return this.dice.forEach(i=>{let a=this.original.slice(t);e.push(a.slice(0,a.indexOf(i.lexeme.text)),i.display),t+=a.indexOf(i.lexeme.text)+i.lexeme.text.length+i.modifierText.length}),e.push(this.original.slice(t)),e.join("")}get tooltip(){return this._tooltip?this._tooltip:this.expectedValue===g2.Roll||this.shouldRender?this.displayFixedText?`${this.original} ${this.result} = ${this.resultText}`:`${this.original} -${this.resultText}`:this.expectedValue===x2.Average?this.displayFixedText?`${this.original} +${this.resultText}`:this.expectedValue===g2.Average?this.displayFixedText?`${this.original} ${this.result} = average: ${this.resultText}`:`${this.original} average: ${this.resultText}`:`${this.original} -empty`}allowAverage(){let e=t=>t.allowAverage();return this.dynamic.every(e)}async build(){if(this.expectedValue===x2.Average&&!this.shouldRender){if(this.allowAverage())for(let a of this.dynamic){let r=a.average();var e=Array(a.rolls).fill(r);a.setResults(e)}else this.expectedValue=x2.Roll;this.result=Math.floor(this.result),this.setTooltip()}let t=this.result;switch(this.plugin.data.round){case me.None:{t=Math.trunc(t*100)/100;break}case me.Normal:{t=Math.round(t);break}case me.Up:{t=Math.ceil(t);break}case me.Down:{t=Math.floor(t);break}}let i;this.expectedValue===x2.None&&!this.shouldRender?(this.showDice?i=[""]:i=["\xA0"],this.showFormula&&i.unshift(this.original+" -> ")):(i=[`${t}`],this.showFormula&&i.unshift(this.inlineText)),this.expectedValue=x2.Roll,this.displayFixedText?this.resultEl.setText(this.fixedText):this.resultEl.setText(i.join("")+this.stunted)}async onClick(e){e.stopPropagation(),e.stopImmediatePropagation(),e.getModifierState("Alt")?this.expectedValue=x2.Average:e.getModifierState("Control")&&(this.expectedValue=x2.None),e.getModifierState("Shift")?(await this.plugin.renderRoll(this),this.render(),this.trigger("new-result"),this.hasRunOnce=!0):window.getSelection()?.isCollapsed&&await this.roll()}get dynamic(){return this.dice.filter(e=>!e.static)}get static(){return this.dice.filter(e=>e.static)}get isStatic(){return this.dice.every(e=>e.static)}rollSync(){this.stunted="",this.parseLexemes();let e=this.stack.pop();return e.roll(),e instanceof kt&&e.doubles&&(this.stunted=` - ${e.results.get(0).value} Stunt Points`),this.result=e.result,this._tooltip=null,this.render(),this.trigger("new-result"),this.hasRunOnce=!0,this.result}async roll(e){if(this.stunted="",this.stackCopy=[],this.parseLexemes(),e||this.shouldRender&&this.hasRunOnce)await this.plugin.renderRoll(this),new Mt.Notice(`${this.tooltip} +empty`}allowAverage(){let e=t=>t.allowAverage();return this.dynamic.every(e)}async build(){if(this.expectedValue===g2.Average&&!this.shouldRender){if(this.allowAverage())for(let a of this.dynamic){let r=a.average();var e=Array(a.rolls).fill(r);a.setResults(e)}else this.expectedValue=g2.Roll;this.result=Math.floor(this.result),this.setTooltip()}let t=this.result;switch(this.plugin.data.round){case pe.None:{t=Math.trunc(t*100)/100;break}case pe.Normal:{t=Math.round(t);break}case pe.Up:{t=Math.ceil(t);break}case pe.Down:{t=Math.floor(t);break}}let i;this.expectedValue===g2.None&&!this.shouldRender?(this.showDice?i=[""]:i=["\xA0"],this.showFormula&&i.unshift(this.original+" -> ")):(i=[`${t}`],this.showFormula&&i.unshift(this.inlineText)),this.expectedValue=g2.Roll,this.displayFixedText?this.resultEl.setText(this.fixedText):this.resultEl.setText(i.join("")+this.stunted)}async onClick(e){e.stopPropagation(),e.stopImmediatePropagation(),e.getModifierState("Alt")?this.expectedValue=g2.Average:e.getModifierState("Control")&&(this.expectedValue=g2.None),e.getModifierState("Shift")?(await this.plugin.renderRoll(this),this.render(),this.trigger("new-result"),this.hasRunOnce=!0):window.getSelection()?.isCollapsed&&await this.roll()}get dynamic(){return this.dice.filter(e=>!e.static)}get static(){return this.dice.filter(e=>e.static)}get isStatic(){return this.dice.every(e=>e.static)}rollSync(){this.stunted="",this.parseLexemes();let e=this.stack.pop();return e.roll(),e instanceof It&&e.doubles&&(this.stunted=` - ${e.results.get(0).value} Stunt Points`),this.result=e.result,this._tooltip=null,this.render(),this.trigger("new-result"),this.hasRunOnce=!0,this.result}async roll(e){if(this.stunted="",this.stackCopy=[],this.parseLexemes(),e||this.shouldRender&&this.hasRunOnce)await this.plugin.renderRoll(this),new xt.Notice(`${this.tooltip} -Result: ${this.result}`);else{let t=this.stack.pop();t.roll(),t instanceof kt&&t.doubles&&(this.stunted=` - ${t.results.get(0).value} Stunt Points`),this.result=t.result,this._tooltip=null}return this.render(),this.trigger("new-result"),this.hasRunOnce=!0,this.result}parseLexemes(){let e=0;for(let t of this.lexemes)switch(t.type){case"+":case"-":case"*":case"/":case"^":case"math":let i=this.stack.pop(),a=this.stack.pop();if(!a){t.value==="-"&&(i=new U2(`-${i.dice}`,i.lexeme)),this.stackCopy.push(t.value),this.stack.push(i);continue}i.roll(),i instanceof kt&&i.doubles&&(this.stunted=` - ${i.results.get(0).value} Stunt Points`),a.roll(),a instanceof kt&&a.doubles&&(this.stunted=` - ${a.results.get(0).value} Stunt Points`);let r=this.operators[t.value](a.result,i.result);this.stackCopy.push(t.value),this.stack.push(new U2(`${r}`,t));break;case"u":{let s=this.dice[e-1],o=t.value?Number(t.value):1;s.modifiers.set("u",{data:o,conditionals:[],value:t.text});break}case"kh":{let s=this.dice[e-1],o=t.value?Number(t.value):1;s.modifiers.set("kh",{data:o,conditionals:[],value:t.text});break}case"dl":{let s=this.dice[e-1],o=t.value?Number(t.value):1;o=s.results.size-o,s.modifiers.set("kh",{data:o,conditionals:[],value:t.text});break}case"kl":{let s=this.dice[e-1],o=t.value?Number(t.value):1;s.modifiers.set("kl",{data:o,conditionals:[],value:t.text});break}case"dh":{let s=this.dice[e-1],o=t.value?Number(t.value):1;o=s.results.size-o,s.modifiers.set("kl",{data:o,conditionals:[],value:t.text});break}case"!":{let s=this.dice[e-1],o=Number(t.value)||1;s.modifiers.set("!",{data:o,conditionals:t.conditions??[],value:t.text});break}case"!!":{let s=this.dice[e-1],o=Number(t.value)||1;s.modifiers.set("!!",{data:o,conditionals:t.conditions??[],value:t.text});break}case"r":{let s=this.dice[e-1],o=Number(t.value)||1;s.modifiers.set("r",{data:o,conditionals:t.conditions??[],value:t.text});break}case"sort":{let s=this.dice[e-1],o=Number(t.value);s.modifiers.set("sort",{data:o,conditionals:t.conditions??[],value:t.value});break}case"dice":{if(t.parenedDice&&/^d/.test(t.value)&&this.stack.length){let s=this.stack.pop();t.value=`${s.result}${t.value}`,this.dice[e]=new U2(t.value,t)}this.dice[e]||(this.dice[e]=new U2(t.value,t)),this.stack.push(this.dice[e]),this.stackCopy.push(this.dice[e]),e++;break}case"stunt":{this.dice[e]||(this.dice[e]=new kt(t.value,t)),this.stack.push(this.dice[e]),this.stackCopy.push(this.dice[e]),e++;break}case"%":{this.dice[e]||(this.dice[e]=new wa(t.value,t)),this.stack.push(this.dice[e]),this.stackCopy.push(this.dice[e]),e++;break}}}recalculate(){let e=[],t=0;if(!this.stackCopy.length)return this.roll();for(let i of this.stackCopy)if(typeof i=="string"){let a=e.pop(),r=e.pop();if(!r){i==="-"&&(a=new U2(`-${a.result}`,a.lexeme)),e.push(a);continue}let s=this.operators[i](r.result,a.result);e.push(new U2(`${s}`))}else e.push(i),i instanceof U2&&this.stackCopy.indexOf(i)!=this.stackCopy.length-1&&i.applyModifiers();e.length&&e[0]instanceof U2&&(e[0].applyModifiers(),t+=e[0].result),this.result=t,this.render()}toResult(){return{type:"dice",result:this.result,tooltip:this.tooltip}}async applyResult(e){e.type==="dice"&&(e.result&&(this.result=e.result),e.tooltip&&(this._tooltip=e.tooltip),await this.render())}setResult(e){}};var M2=S2(require("obsidian"));function kc(n){let e="",t="abcdefghijklmnopqrstuvwxyz0123456789",i=t.length;for(let a=0;a{o.stopPropagation(),navigator.clipboard.writeText(this.transformResultsToString()).then(async()=>{new M2.Notice("Result copied to clipboard.")})}),(0,M2.setIcon)(this.copy,Qe)}getEmbedClass(){return this.plugin.data.displayAsEmbed?"markdown-embed":""}},w4=class extends k0{constructor(e,t,i,a,r=!0,s=e.data.showDice){super(e,t,i,a,s);this.plugin=e;this.original=t;this.lexeme=i;this.inline=r;C(this,"result");C(this,"results");C(this,"types");C(this,"content");C(this,"copy");C(this,"levels")}get replacer(){let e=this.getBlockId(this.result);return e?`![[${this.path}#^${e}]]`:""}get tooltip(){return`${this.original} -${this.path}`}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.plugin.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!this.plugin.data.displayResultsInline){let i="type"in e?e.type:"List Item";t.setAttrs({"aria-label":`${this.file.basename}: ${i}`})}if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(M2.MarkdownRenderer.renderMarkdown(this.displayFromCache(e),t.createDiv(),this.source,null),this.plugin.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",a=>{a.stopPropagation(),navigator.clipboard.writeText(this.displayFromCache(e).trim()).then(async()=>{new M2.Notice("Result copied to clipboard.")})}),(0,M2.setIcon)(i,Qe)}}}async load(){await this.getOptions()}displayFromCache(...e){let t=[];for(let i of e)t.push(this.content.slice(i.position.start.offset,i.position.end.offset));return t.join(` +Result: ${this.result}`);else{let t=this.stack.pop();t.roll(),t instanceof It&&t.doubles&&(this.stunted=` - ${t.results.get(0).value} Stunt Points`),this.result=t.result,this._tooltip=null}return this.render(),this.trigger("new-result"),this.hasRunOnce=!0,this.result}parseLexemes(){let e=0;for(let t of this.lexemes)switch(t.type){case"+":case"-":case"*":case"/":case"^":case"math":let i=this.stack.pop(),a=this.stack.pop();if(!a){t.value==="-"&&(i=new k2(`-${i.dice}`,i.lexeme)),this.stackCopy.push(t.value),this.stack.push(i);continue}i.roll(),i instanceof It&&i.doubles&&(this.stunted=` - ${i.results.get(0).value} Stunt Points`),a.roll(),a instanceof It&&a.doubles&&(this.stunted=` - ${a.results.get(0).value} Stunt Points`);let r=this.operators[t.value](a.result,i.result);this.stackCopy.push(t.value),this.stack.push(new k2(`${r}`,t));break;case"u":{let s=this.dice[e-1],o=t.value?Number(t.value):1;s.modifiers.set("u",{data:o,conditionals:[],value:t.text});break}case"kh":{let s=this.dice[e-1],o=t.value?Number(t.value):1;s.modifiers.set("kh",{data:o,conditionals:[],value:t.text});break}case"dl":{let s=this.dice[e-1],o=t.value?Number(t.value):1;o=s.results.size-o,s.modifiers.set("kh",{data:o,conditionals:[],value:t.text});break}case"kl":{let s=this.dice[e-1],o=t.value?Number(t.value):1;s.modifiers.set("kl",{data:o,conditionals:[],value:t.text});break}case"dh":{let s=this.dice[e-1],o=t.value?Number(t.value):1;o=s.results.size-o,s.modifiers.set("kl",{data:o,conditionals:[],value:t.text});break}case"!":{let s=this.dice[e-1],o=Number(t.value)||1;s.modifiers.set("!",{data:o,conditionals:t.conditions??[],value:t.text});break}case"!!":{let s=this.dice[e-1],o=Number(t.value)||1;s.modifiers.set("!!",{data:o,conditionals:t.conditions??[],value:t.text});break}case"r":{let s=this.dice[e-1],o=Number(t.value)||1;s.modifiers.set("r",{data:o,conditionals:t.conditions??[],value:t.text});break}case"sort":{let s=this.dice[e-1],o=Number(t.value);s.modifiers.set("sort",{data:o,conditionals:t.conditions??[],value:t.value});break}case"dice":{if(t.parenedDice&&/^d/.test(t.value)&&this.stack.length){let s=this.stack.pop();t.value=`${s.result}${t.value}`,this.dice[e]=new k2(t.value,t)}this.dice[e]||(this.dice[e]=new k2(t.value,t)),this.stack.push(this.dice[e]),this.stackCopy.push(this.dice[e]),e++;break}case"stunt":{this.dice[e]||(this.dice[e]=new It(t.value,t)),this.stack.push(this.dice[e]),this.stackCopy.push(this.dice[e]),e++;break}case"%":{this.dice[e]||(this.dice[e]=new Aa(t.value,t)),this.stack.push(this.dice[e]),this.stackCopy.push(this.dice[e]),e++;break}}}recalculate(){let e=[],t=0;if(!this.stackCopy.length)return this.roll();for(let i of this.stackCopy)if(typeof i=="string"){let a=e.pop(),r=e.pop();if(!r){i==="-"&&(a=new k2(`-${a.result}`,a.lexeme)),e.push(a);continue}let s=this.operators[i](r.result,a.result);e.push(new k2(`${s}`))}else e.push(i),i instanceof k2&&this.stackCopy.indexOf(i)!=this.stackCopy.length-1&&i.applyModifiers();e.length&&e[0]instanceof k2&&(e[0].applyModifiers(),t+=e[0].result),this.result=t,this.render()}toResult(){return{type:"dice",result:this.result,tooltip:this.tooltip}}async applyResult(e){e.type==="dice"&&(e.result&&(this.result=e.result),e.tooltip&&(this._tooltip=e.tooltip),await this.render())}setResult(e){}};var x2=w2(require("obsidian"));function Pc(n){let e="",t="abcdefghijklmnopqrstuvwxyz0123456789",i=t.length;for(let a=0;a{o.stopPropagation(),navigator.clipboard.writeText(this.transformResultsToString()).then(async()=>{new x2.Notice("Result copied to clipboard.")})}),(0,x2.setIcon)(this.copy,Je)}getEmbedClass(){return this.plugin.data.displayAsEmbed?"markdown-embed":""}},z4=class extends I0{constructor(e,t,i,a,r=!0,s=e.data.showDice){super(e,t,i,a,s);this.plugin=e;this.original=t;this.lexeme=i;this.inline=r}get replacer(){let e=this.getBlockId(this.result);return e?`![[${this.path}#^${e}]]`:""}get tooltip(){return`${this.original} +${this.path}`}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.plugin.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!this.plugin.data.displayResultsInline){let i="type"in e?e.type:"List Item";t.setAttrs({"aria-label":`${this.file.basename}: ${i}`})}if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(x2.MarkdownRenderer.renderMarkdown(this.displayFromCache(e),t.createDiv(),this.source,null),this.plugin.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",a=>{a.stopPropagation(),navigator.clipboard.writeText(this.displayFromCache(e).trim()).then(async()=>{new x2.Notice("Result copied to clipboard.")})}),(0,x2.setIcon)(i,Je)}}}async load(){await this.getOptions()}displayFromCache(...e){let t=[];for(let i of e)t.push(this.content.slice(i.position.start.offset,i.position.end.offset));return t.join(` -`)}transformResultsToString(){return this.displayFromCache(...this.results)}getBlockId(e){let t=this.cache.blocks??{},i=Object.entries(t).find(([a,r])=>Sa(r.position,e.position));if(!i){let a=`${Uc(4)}`,r=`${this.content.slice(0,this.result.position.end.offset+1)}^${a}${this.content.slice(this.result.position.end.offset)}`;return this.watch=!1,this.plugin.app.vault.modify(this.file,r),a}return i[0]}getPath(){let{groups:e}=this.lexeme.value.match(B0),{roll:t=1,link:i,types:a}=e;if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.types=a?.split(","),this.levels=a?.split(",").map(r=>/heading\-\d+/.test(r)?r.split("-").pop():null).filter(r=>r),this.types=a?.split(",").map(r=>/heading\-\d+/.test(r)?r.split("-").shift():r)}async getOptions(){if(this.cache=this.plugin.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.sections)throw new Error("Could not read file cache.");this.content=await this.plugin.app.vault.cachedRead(this.file),this.options=this.cache.sections.filter(({type:e,position:t})=>this.types?e=="heading"&&this.types.includes(e)&&this.levels.length?(this.cache.headings??[]).filter(({level:a})=>this.levels.includes(`${a}`)).some(({position:a})=>Sa(a,t)):this.types.includes(e):!["yaml","thematicBreak"].includes(e)),this.types&&this.types.includes("listItem")&&this.options.push(...this.cache.listItems),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])}})}toResult(){return{type:"section",result:this.results}}async applyResult(e){e.type==="section"&&(e.result&&(this.results=e.result),await this.render())}},u6=class extends xt{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;C(this,"tag");C(this,"collapse");C(this,"types");C(this,"results");C(this,"random");C(this,"chosen");C(this,"loaded",!1);C(this,"result");if(!this.plugin.canUseDataview)throw new M2.Notice("A tag can only be rolled with the Dataview plugin enabled."),new Error("A tag can only be rolled with the Dataview plugin enabled.");e.data.displayAsEmbed&&this.containerEl.addClasses(["has-embed","markdown-embed"]);let{roll:s=1,tag:o,collapse:c,types:l}=i.value.match(F0).groups;this.collapse=c==="-"?!0:c==="+"?!1:!this.plugin.data.returnAllTags,this.tag=`#${o}`,this.rolls=Number(s),this.types=l,this.getFiles()}get replacer(){return this.result.replacer}get typeText(){return this.types?.length?`|${this.types}`:""}async getFiles(){if(!this.plugin.dataviewAPI){new M2.Notice("Dice Roller: Dataview must be installed and enabled to use tag rollers.");return}await this.plugin.dataviewReady();let e=await this.plugin.dataviewAPI.query(`list from ${this.tag}`);if(!e.successful)throw new Error(`No files found with that tag. Is the tag correct? +`)}transformResultsToString(){return this.displayFromCache(...this.results)}getBlockId(e){let t=this.cache.blocks??{},i=Object.entries(t).find(([a,r])=>wa(r.position,e.position));if(!i){let a=`${Ic(4)}`,r=`${this.content.slice(0,this.result.position.end.offset+1)}^${a}${this.content.slice(this.result.position.end.offset)}`;return this.watch=!1,this.plugin.app.vault.modify(this.file,r),a}return i[0]}getPath(){let{groups:e}=this.lexeme.value.match(F0)??{},{roll:t=1,link:i,types:a}=e??{};if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.types=a?.split(","),this.levels=a?.split(",").map(r=>/heading\-\d+/.test(r)?r.split("-").pop():null).filter(r=>r),this.types=a?.split(",").map(r=>/heading\-\d+/.test(r)?r.split("-").shift():r)}async getOptions(){if(this.cache=this.plugin.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.sections)throw new Error("Could not read file cache.");this.content=await this.plugin.app.vault.cachedRead(this.file),this.options=this.cache.sections.filter(({type:e,position:t})=>this.types?e=="heading"&&this.types.includes(e)&&this.levels.length?(this.cache.headings??[]).filter(({level:a})=>this.levels.includes(`${a}`)).some(({position:a})=>wa(a,t)):this.types.includes(e):!["yaml","thematicBreak"].includes(e)),this.types&&this.types.includes("listItem")&&this.options.push(...this.cache.listItems),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])}})}toResult(){return{type:"section",result:this.results}}async applyResult(e){e.type==="section"&&(e.result&&(this.results=e.result),await this.render())}},l6=class extends gt{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;this.loaded=!1;if(!this.plugin.canUseDataview)throw new x2.Notice("A tag can only be rolled with the Dataview plugin enabled."),new Error("A tag can only be rolled with the Dataview plugin enabled.");e.data.displayAsEmbed&&this.containerEl.addClasses(["has-embed","markdown-embed"]);let{roll:s=1,tag:o,collapse:c,types:l}=i.value.match(R0).groups;this.collapse=c==="-"?!0:c==="+"?!1:!this.plugin.data.returnAllTags,this.tag=`#${o}`,this.rolls=Number(s),this.types=l,this.getFiles()}get replacer(){return this.result.replacer}get typeText(){return this.types?.length?`|${this.types}`:""}async getFiles(){if(!this.plugin.dataviewAPI){new x2.Notice("Dice Roller: Dataview must be installed and enabled to use tag rollers.");return}await this.plugin.dataviewReady();let e=await this.plugin.dataviewAPI.query(`list from ${this.tag}`);if(!e.successful)throw new Error(`No files found with that tag. Is the tag correct? `+this.tag);let t=new Set(e.value.values.reduce((a,r)=>(r.type=="file"&&a.push(r.path),a),[]));if(t&&t.delete(this.source),!t||!t.size)throw new Error(`No files found with that tag. Is the tag correct? -`+this.tag);let i=Array.from(t).map(a=>`${this.rolls}d[[${a}]]${this.typeText}`);this.results=i.map(a=>new w4(this.plugin,a,{...this.lexeme,value:a,type:"section"},this.source,!1)),this.loaded=!0,this.trigger("loaded")}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.resultEl.createSpan({text:this.inlineText}),this.collapse){this.chosen=this.random??this.getRandomBetween(0,this.results.length-1);let e=this.results[this.chosen];this.random=null;let t=this.resultEl.createDiv();t.createEl("h5",{cls:"dice-file-name",text:e.file.basename}),t.appendChild(e.containerEl)}else for(let e of this.results){let t=this.resultEl.createDiv();t.createEl("h5",{cls:"dice-file-name",text:e.file.basename}),t.appendChild(e.containerEl)}}async roll(){return new Promise((e,t)=>{this.loaded?(this.results.forEach(async i=>await i.roll()),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.result)):this.on("loaded",()=>{this.results.forEach(async i=>await i.roll()),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.result)})})}get tooltip(){return this.original}toResult(){return{type:"tag",random:this.chosen,result:Object.fromEntries(this.results.map(e=>[e.path,e.toResult()]))}}async applyResult(e){if(e.type==="tag"){if(e.result)for(let t in e.result){let i=this.results.find(a=>a.path===t);!i||i.applyResult(e.result[t])}e.random&&(this.random=e.random),await this.render()}}},h6=class extends xt{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;C(this,"tag");C(this,"links");C(this,"result");let{roll:s=1,tag:o}=i.value.match(F0).groups;this.tag=`#${o}`,this.rolls=(s&&!isNaN(Number(s))&&Number(s))??1,this.getFiles()}get replacer(){return`[[${this.result.basename}]]`}get tooltip(){return`${this.original} -${this.result.basename}`}async roll(){return new Promise((e,t)=>{this.loaded?(this.result=this.links[this.getRandomBetween(0,this.links.length-1)],this.render(),this.trigger("new-result"),e(this.result)):this.on("loaded",()=>{this.result=this.links[this.getRandomBetween(0,this.links.length-1)],this.render(),this.trigger("new-result"),e(this.result)})})}async build(){this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.resultEl.createSpan({text:this.inlineText});let e=this.resultEl.createEl("a",{cls:"internal-link",text:this.result.basename});e.onclick=async t=>{t.stopPropagation(),this.plugin.app.workspace.openLinkText(this.result.path,this.plugin.app.workspace.getActiveFile()?.path,t.getModifierState("Control"))},e.onmouseenter=async t=>{this.plugin.app.workspace.trigger("link-hover",this,e,this.result.path,this.plugin.app.workspace.getActiveFile()?.path)}}async getFiles(){if(!this.plugin.dataviewAPI){new M2.Notice("Dice Roller: Dataview must be installed and enabled to use tag rollers.");return}await this.plugin.dataviewReady();let e=await this.plugin.dataviewAPI.query(`list from ${this.tag}`);if(!e.successful)throw new Error(`No files found with that tag. Is the tag correct? +`+this.tag);let i=Array.from(t).map(a=>`${this.rolls}d[[${a}]]${this.typeText}`);this.results=i.map(a=>new z4(this.plugin,a,{...this.lexeme,value:a,type:"section"},this.source,!1)),this.loaded=!0,this.trigger("loaded")}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.resultEl.createSpan({text:this.inlineText}),this.collapse){this.chosen=this.random??this.getRandomBetween(0,this.results.length-1);let e=this.results[this.chosen];this.random=null;let t=this.resultEl.createDiv();t.createEl("h5",{cls:"dice-file-name",text:e.file.basename}),t.appendChild(e.containerEl)}else for(let e of this.results){let t=this.resultEl.createDiv();t.createEl("h5",{cls:"dice-file-name",text:e.file.basename}),t.appendChild(e.containerEl)}}async roll(){return new Promise((e,t)=>{this.loaded?(this.results.forEach(async i=>await i.roll()),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.result)):this.on("loaded",()=>{this.results.forEach(async i=>await i.roll()),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.result)})})}get tooltip(){return this.original}toResult(){return{type:"tag",random:this.chosen,result:Object.fromEntries(this.results.map(e=>[e.path,e.toResult()]))}}async applyResult(e){if(e.type==="tag"){if(e.result)for(let t in e.result){let i=this.results.find(a=>a.path===t);!i||i.applyResult(e.result[t])}e.random&&(this.random=e.random),await this.render()}}},u6=class extends gt{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;let{roll:s=1,tag:o}=i.value.match(R0)?.groups??{};this.tag=`#${o}`,this.rolls=(s&&!isNaN(Number(s))&&Number(s))??1,this.getFiles()}get replacer(){return`[[${this.result.basename}]]`}get tooltip(){return`${this.original} +${this.result.basename}`}async roll(){return new Promise((e,t)=>{this.loaded?(this.result=this.links[this.getRandomBetween(0,this.links.length-1)],this.render(),this.trigger("new-result"),e(this.result)):this.on("loaded",()=>{this.result=this.links[this.getRandomBetween(0,this.links.length-1)],this.render(),this.trigger("new-result"),e(this.result)})})}async build(){this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.resultEl.createSpan({text:this.inlineText});let e=this.resultEl.createEl("a",{cls:"internal-link",text:this.result.basename});e.onclick=async t=>{t.stopPropagation(),this.plugin.app.workspace.openLinkText(this.result.path,this.plugin.app.workspace.getActiveFile()?.path,t.getModifierState("Control"))},e.onmouseenter=async t=>{this.plugin.app.workspace.trigger("link-hover",this,e,this.result.path,this.plugin.app.workspace.getActiveFile()?.path)}}async getFiles(){if(!this.plugin.dataviewAPI){new x2.Notice("Dice Roller: Dataview must be installed and enabled to use tag rollers.");return}await this.plugin.dataviewReady();let e=await this.plugin.dataviewAPI.query(`list from ${this.tag}`);if(!e.successful)throw new Error(`No files found with that tag. Is the tag correct? `+this.tag);let t=new Set(e.value.values.reduce((i,a)=>(a.type=="file"&&i.push(a.path),i),[]));if(t&&t.delete(this.source),!t||!t.size)throw new Error(`No files found with that tag. Is the tag correct? -`+this.tag);this.links=Array.from(t).map(i=>this.plugin.app.metadataCache.getFirstLinkpathDest(i,this.source)),this.loaded=!0,this.trigger("loaded")}toResult(){return{type:"link",result:this.result.path}}async applyResult(e){if(e.type==="link"){if(e.result){let t=this.plugin.app.vault.getAbstractFileByPath(e.result);t&&t instanceof M2.TFile&&(this.result=t)}await this.render()}}},f6=class extends k0{constructor(e,t,i,a,r=!0,s=e.data.showDice){super(e,t,i,a,s);this.plugin=e;this.original=t;this.lexeme=i;C(this,"result");C(this,"results");C(this,"types");C(this,"content")}get replacer(){return this.result}get tooltip(){return`${this.original} -${this.path}`}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.plugin.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(M2.MarkdownRenderer.renderMarkdown(e,t.createDiv(),this.source,null),this.plugin.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",a=>{a.stopPropagation(),navigator.clipboard.writeText(e).then(async()=>{new M2.Notice("Result copied to clipboard.")})}),(0,M2.setIcon)(i,Qe)}}}transformResultsToString(){return this.results.join(` +`+this.tag);this.links=Array.from(t).map(i=>this.plugin.app.metadataCache.getFirstLinkpathDest(i,this.source)),this.loaded=!0,this.trigger("loaded")}toResult(){return{type:"link",result:this.result.path}}async applyResult(e){if(e.type==="link"){if(e.result){let t=this.plugin.app.vault.getAbstractFileByPath(e.result);t&&t instanceof x2.TFile&&(this.result=t)}await this.render()}}},h6=class extends I0{constructor(e,t,i,a,r=!0,s=e.data.showDice){super(e,t,i,a,s);this.plugin=e;this.original=t;this.lexeme=i}get replacer(){return this.result}get tooltip(){return`${this.original} +${this.path}`}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.plugin.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(x2.MarkdownRenderer.renderMarkdown(e,t.createDiv(),this.source,null),this.plugin.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",a=>{a.stopPropagation(),navigator.clipboard.writeText(e).then(async()=>{new x2.Notice("Result copied to clipboard.")})}),(0,x2.setIcon)(i,Je)}}}transformResultsToString(){return this.results.join(` -`)}async load(){await this.getOptions()}getPath(){let{groups:e}=this.lexeme.value.match(B0),{roll:t=1,link:i,types:a}=e;if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=i.replace(/(\[|\])/g,""),this.types=a?.split(",")}async getOptions(){if(this.content=await this.plugin.app.vault.cachedRead(this.file),!this.content)throw new Error("Could not read file cache.");this.options=this.content.trim().split(` -`).map(e=>e.trim()).filter(e=>e&&e.length),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])}})}toResult(){return{type:"section",result:this.results}}async applyResult(e){e.type==="section"&&(e.result&&(this.results=e.result),await this.render())}},Sa=(n,e)=>n.start.col==e.start.col&&n.start.line==e.start.line&&n.start.offset==e.start.offset;var bt=S2(require("obsidian"));var _a=class{constructor(){C(this,"result","");C(this,"combinedTooltip","")}},Ut=class extends A4{constructor(){super(...arguments);C(this,"content");C(this,"position");C(this,"block");C(this,"header");C(this,"rollsFormula");C(this,"isLookup");C(this,"lookupRoller");C(this,"lookupRanges");C(this,"combinedTooltip","");C(this,"prettyTooltip","");C(this,"result")}getPath(){let{groups:e}=this.lexeme.value.match(za),{diceRoll:t="1",link:i,block:a,header:r}=e;if(!i||!a)throw new Error("Could not parse link.");let s=t.match(/(\d*?)[Dd]$/);if(s){let[,o="1"]=s;this.rollsFormula=o}else this.rollsFormula=t;this.rolls=1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.block=a.replace(/(\^|#)/g,"").trim().toLowerCase(),this.header=r}get tooltip(){return this.prettyTooltip}get replacer(){return this.result}async build(){this.resultEl.empty();let e=[this.result];this.plugin.data.displayResultsInline&&e.unshift(this.inlineText);let t=createSpan();await bt.MarkdownRenderer.renderMarkdown(e.join(""),t,this.source,null);let i=this.resultEl.createSpan("embedded-table-result");t.childElementCount==1&&t.firstElementChild instanceof HTMLParagraphElement?i.append(...Array.from(t.firstElementChild.childNodes)):i.append(...Array.from(t.childNodes))}prettify(e){let t=/(.*?)(\(|\)|;|\|\|)(.*)/,i=" ",a=0,r="",s=e,o;for(;o=s.match(t);){let[,c,l,u]=o;r+=c,l==")"?(a--,r+=` +`)}async load(){await this.getOptions()}getPath(){let{groups:e}=this.lexeme.value.match(F0)??{},{roll:t=1,link:i,types:a}=e??{};if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=i.replace(/(\[|\])/g,""),this.types=a?.split(",")}async getOptions(){if(this.content=await this.plugin.app.vault.cachedRead(this.file),!this.content)throw new Error("Could not read file cache.");this.options=this.content.trim().split(` +`).map(e=>e.trim()).filter(e=>e&&e.length),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])}})}toResult(){return{type:"section",result:this.results}}async applyResult(e){e.type==="section"&&(e.result&&(this.results=e.result),await this.render())}},wa=(n,e)=>n.start.col==e.start.col&&n.start.line==e.start.line&&n.start.offset==e.start.offset;var Mt=w2(require("obsidian"));var Sa=class{constructor(){this.result="";this.combinedTooltip=""}},kt=class extends C4{constructor(){super(...arguments);this.combinedTooltip="";this.prettyTooltip=""}getPath(){let{groups:e}=this.lexeme.value.match(Ca)??{},{diceRoll:t="1",link:i,block:a,header:r}=e??{};if(!i||!a)throw new Error("Could not parse link.");let s=t.match(/(\d*?)[Dd]$/);if(s){let[,o="1"]=s;this.rollsFormula=o}else this.rollsFormula=t;this.rolls=1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.block=a.replace(/(\^|#)/g,"").trim().toLowerCase(),this.header=r}get tooltip(){return this.prettyTooltip}get replacer(){return this.result}async build(){this.resultEl.empty();let e=[this.result];this.plugin.data.displayResultsInline&&e.unshift(this.inlineText);let t=createSpan();await Mt.MarkdownRenderer.renderMarkdown(e.join(""),t,this.source,null);let i=this.resultEl.createSpan("embedded-table-result");t.childElementCount==1&&t.firstElementChild instanceof HTMLParagraphElement?i.append(...Array.from(t.firstElementChild.childNodes)):i.append(...Array.from(t.childNodes))}prettify(e){let t=/(.*?)(\(|\)|;|\|\|)(.*)/,i=" ",a=0,r="",s=e,o;for(;o=s.match(t);){let[,c,l,u]=o;r+=c,l==")"?(a--,r+=` `,r+=i.repeat(a),r+=")"):(l=="("?(a++,r+="("):l==";"?r+=",":l=="||"&&(r+="|"),r+=` -`,r+=i.repeat(a)),s=u}return r+=s,r}async getSubResult(e){let t=new _a;typeof e=="number"?t.result=e.toString():t.result=e;let i=[];if(typeof e=="string"){let a=/(?:\`dice:)(.*?)(?:\`)/g,r=e.matchAll(a);for(let s of r){let o=s[1].trim(),c=await this.plugin.getRoller(o,this.source);await c.roll();let l=await this.getSubResult(c.result),u;if(l.result instanceof bt.TFile?u=l.result.basename:u=l.result,t.result=t.result.replace(s[0],u),c instanceof Ut)i.push(c.combinedTooltip);else{let[f,h]=c.tooltip.split(` -`);i.push(f+" --> "+h)}}}return t.combinedTooltip=i.join(";"),t}async getResult(){let e=[],t=[],i=this.original;if(this.rollsFormula)try{let a=await this.plugin.getRoller(this.rollsFormula,this.source);if(!(a instanceof _2))return this.prettyTooltip="TableRoller only supports dice rolls to select multiple elements.",new bt.Notice(this.prettyTooltip),"ERROR";let r=a;await r.roll(),this.rolls=r.result,r.isStatic||(i=i.replace(this.rollsFormula,`${this.rollsFormula.trim()} --> ${r.resultText} > `))}catch{return this.prettyTooltip=`TableRoller: '${this.rollsFormula}' is not a valid dice roll.`,new bt.Notice(this.prettyTooltip),"ERROR"}for(let a=0;au[1]===void 0&&c===u[0]||c>=u[0]&&u[1]>=c);l&&(r=this.lookupRoller.original.trim()+" --> "+`${this.lookupRoller.resultText}${this.header?" | "+this.header:""}`.trim(),o=l[1])}else{let c=[...this.options],l=this.getRandomBetween(0,c.length-1);r=c.length+" rows --> [row "+(l+1)+"]",o=c[l]}s=await this.getSubResult(o),e.push(s.result),s.combinedTooltip&&(r+=" > ("+s.combinedTooltip+")"),t.push(r)}return t.length==0?this.combinedTooltip=i:t.length==1?this.combinedTooltip=i+" "+t.join(""):this.combinedTooltip=i+" ==> ("+t.join(" ||")+")",this.prettyTooltip=this.prettify(this.combinedTooltip),e.join("||")}async roll(){return new Promise(async e=>{this.loaded?(this.result=await this.getResult(),this.render(),this.trigger("new-result"),e(this.result)):this.on("loaded",async()=>{this.result=await this.getResult(),this.render(),this.trigger("new-result"),e(this.result)})})}async load(){await this.getOptions()}async getOptions(){if(this.cache=this.plugin.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.blocks||!(this.block in this.cache.blocks))throw new Error(`Could not read file cache. Does the block reference exist? +`,r+=i.repeat(a)),s=u}return r+=s,r}async getSubResult(e){let t=new Sa;typeof e=="number"?t.result=e.toString():t.result=e;let i=[];if(typeof e=="string"){let a=/(?:\`dice:)(.*?)(?:\`)/g,r=e.matchAll(a);for(let s of r){let o=s[1].trim(),c=await this.plugin.getRoller(o,this.source);await c.roll();let l=await this.getSubResult(c.result),u;if(l.result instanceof Mt.TFile?u=l.result.basename:u=l.result,t.result=t.result.replace(s[0],u),c instanceof kt)i.push(c.combinedTooltip);else{let[f,h]=c.tooltip.split(` +`);i.push(f+" --> "+h)}}}return t.combinedTooltip=i.join(";"),t}async getResult(){let e=[],t=[],i=this.original;if(this.rollsFormula)try{let a=await this.plugin.getRoller(this.rollsFormula,this.source);if(!(a instanceof S2))return this.prettyTooltip="TableRoller only supports dice rolls to select multiple elements.",new Mt.Notice(this.prettyTooltip),"ERROR";let r=a;await r.roll(),this.rolls=r.result,r.isStatic||(i=i.replace(this.rollsFormula,`${this.rollsFormula.trim()} --> ${r.resultText} > `))}catch{return this.prettyTooltip=`TableRoller: '${this.rollsFormula}' is not a valid dice roll.`,new Mt.Notice(this.prettyTooltip),"ERROR"}for(let a=0;au[1]===void 0&&c===u[0]||c>=u[0]&&u[1]>=c);l&&(r=this.lookupRoller.original.trim()+" --> "+`${this.lookupRoller.resultText}${this.header?" | "+this.header:""}`.trim(),o=l[1])}else{let c=[...this.options],l=this.getRandomBetween(0,c.length-1);r=c.length+" rows --> [row "+(l+1)+"]",o=c[l]}s=await this.getSubResult(o),e.push(s.result),s.combinedTooltip&&(r+=" > ("+s.combinedTooltip+")"),t.push(r)}return t.length==0?this.combinedTooltip=i:t.length==1?this.combinedTooltip=i+" "+t.join(""):this.combinedTooltip=i+" ==> ("+t.join(" ||")+")",this.prettyTooltip=this.prettify(this.combinedTooltip),e.join("||")}async roll(){return new Promise(async e=>{this.loaded?(this.result=await this.getResult(),this.render(),this.trigger("new-result"),e(this.result)):this.on("loaded",async()=>{this.result=await this.getResult(),this.render(),this.trigger("new-result"),e(this.result)})})}async load(){await this.getOptions()}async getOptions(){if(this.cache=this.plugin.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.blocks||!(this.block in this.cache.blocks))throw new Error(`Could not read file cache. Does the block reference exist? -${this.path} > ${this.block}`);let e=this.cache.sections?.find(t=>t.position==this.cache.blocks[this.block].position);if(this.position=this.cache.blocks[this.block].position,this.content=(await this.plugin.app.vault.cachedRead(this.file))?.slice(this.position.start.offset,this.position.end.offset),e&&e.type==="list")this.options=this.content.split(` -`);else{let t=Gc(this.content);if(t.columns.size===2&&/dice:\s*([\s\S]+)\s*?/.test(Array.from(t.columns.keys())[0])){let i=await this.plugin.getRoller(Array.from(t.columns.keys())[0].split(":").pop(),this.source);i instanceof _2&&(this.lookupRoller=i,this.lookupRanges=t.rows.map(a=>{let[r,s]=a.replace(/\\\|/g,"{ESCAPED_PIPE}").split("|").map(l=>l.replace(/{ESCAPED_PIPE}/g,"\\|")).map(l=>l.trim()),[,o,c]=r.match(/(\d+)(?:[^\d]+?(\d+))?/)??[];if(!(!o&&!c))return[[Number(o),c?Number(c):void 0],s]}),this.isLookup=!0)}if(this.header==="xy"&&!t.columns.has("xy")){this.options=[];for(let i of Array.from(t.columns.values()).slice(1))this.options.push(...i)}else if(this.header&&t.columns.has(this.header))this.options=t.columns.get(this.header);else{if(this.header)throw new Error(`Header ${this.header} was not found in table ${this.path} > ${this.block}.`);this.options=t.rows}}this.loaded=!0,this.trigger("loaded")}toResult(){return{type:"table",result:this.result}}async applyResult(e){e.type==="table"&&(e.result&&(this.result=e.result),await this.render())}},Oc=/^\|?([\s\S]+?)\|?$/,Ea=/\|/g;function Gc(n){let e=n.split(` -`),i=e.map(s=>(s.trim().match(Oc)??[,s.trim()])[1])[0].replace("\\|","{ESCAPED_PIPE}").split(Ea),a=[],r=[];for(let s in i){let o=i[s];o.trim().length||(o=s),r.push([o.trim(),[]])}for(let s of e.slice(2)){let o=s.trim().replace(/\\\|/g,"{ESCAPED_PIPE}").split(Ea).map(c=>c.replace(/{ESCAPED_PIPE}/g,"\\|")).map(c=>c.trim()).filter(c=>c.length);a.push(o.join(" | "));for(let c in o){let l=o[c].trim();!l.length||!r[c]||r[c][1].push(l)}}return{columns:new Map(r),rows:a}}var _1=S2(require("obsidian"));var d6=class extends _1.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t;this.plugin=t}async display(){let{containerEl:e}=this;e.empty(),e.addClass("dice-roller-settings"),e.createEl("h2",{text:"Dice Roller Settings"}),this.buildGenerics(e.createDiv()),this.buildDisplay(e.createDiv()),this.buildDice(e.createDiv()),this.buildTables(e.createDiv()),this.buildSections(e.createDiv()),this.buildTags(e.createDiv()),this.buildView(e.createDiv()),this.buildRender(e.createDiv()),this.buildFormulaSettings(e.createDiv("dice-roller-setting-additional-container")),e.createDiv("coffee").createEl("a",{href:"https://www.buymeacoffee.com/valentine195"}).createEl("img",{attr:{src:"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=\u2615&slug=valentine195&button_colour=e3e7ef&font_colour=262626&font_family=Inter&outline_colour=262626&coffee_colour=ff0000"}})}buildGenerics(e){e.empty(),new _1.Setting(e).setName("Globally Save Results").setDesc(createFragment(t=>{t.createSpan({text:"Dice results will be saved by default. This can be overridden using "}),t.createEl("code",{text:"dice-: formula"}),t.createEl("p",{text:"Please note that the plugin will attempt to save the result but may not be able to."})})).addToggle(t=>{t.setValue(this.plugin.data.persistResults),t.onChange(async i=>{this.plugin.data.persistResults=i,await this.plugin.saveSettings()})})}buildDisplay(e){e.empty(),new _1.Setting(e).setHeading().setName("Dice Display"),new _1.Setting(e).setName("Display Formula With Results").setDesc("Both the formula and the results will both be displayed in preview mode.").addToggle(t=>{t.setValue(this.plugin.data.displayResultsInline),t.onChange(async i=>{this.plugin.data.displayResultsInline=i,await this.plugin.saveSettings()})}),new _1.Setting(e).setName("Display Dice Button With Results").setDesc("A dice button will appear next to results.").addToggle(t=>{t.setValue(this.plugin.data.showDice),t.onChange(async i=>{this.plugin.data.showDice=i,await this.plugin.saveSettings()})}),new _1.Setting(e).setName("Add Formula When Using Modify Dice").setDesc(createFragment(t=>{t.createSpan({text:"Both the formula and the results will both be added to the note when using "}),t.createEl("code",{text:"dice-mod"}),t.createSpan({text:"."})})).addToggle(t=>{t.setValue(this.plugin.data.displayFormulaForMod),t.onChange(async i=>{this.plugin.data.displayFormulaForMod=i,await this.plugin.saveSettings()})}),new _1.Setting(e).setName("Display Formula in Parentheses After").setDesc(createFragment(t=>{t.createSpan({text:"For example, "}),t.createEl("code",{text:"`dice: 1d6`"}),t.createSpan({text:" will become "});let i=t.createSpan("dice-roller");i.createSpan({cls:"dice-roller-result",text:"3"}),(0,_1.setIcon)(i.createSpan("dice-roller-button"),$2),t.createSpan({text:" (1d6). This only affects Dice Rollers."})})).addToggle(t=>{t.setValue(this.plugin.data.displayFormulaAfter),t.onChange(async i=>{this.plugin.data.displayFormulaAfter=i,await this.plugin.saveSettings()})})}buildDice(e){e.empty(),new _1.Setting(e).setHeading().setName("Dice Rollers"),new _1.Setting(e).setName("Default Face").setDesc("Use this as the number of faces when it is omitted.").addText(t=>{t.setValue(`${this.plugin.data.defaultFace}`),t.inputEl.onblur=async()=>{isNaN(Number(t.inputEl.value))&&new _1.Notice("The default face must be a number."),this.plugin.data.defaultFace=Number(t.inputEl.value),await this.plugin.saveSettings()}}),new _1.Setting(e).setName("Round Results").setDesc("Determine the rounding behavior for dice results.").addDropdown(t=>{t.addOptions(me).setValue(this.plugin.data.round).onChange(i=>{this.plugin.data.round=i,this.plugin.saveSettings()})}),new _1.Setting(e).setName("Always Render Dice").setDesc(createFragment(t=>{t.createSpan({text:"Dice rolled in notes will always be rendered. Use the "}),t.createEl("code",{text:"|norender"}),t.createSpan({text:" flag to prevent it."})})).addToggle(t=>{t.setValue(this.plugin.data.renderAllDice).onChange(i=>{this.plugin.data.renderAllDice=i,this.plugin.saveSettings()})})}buildTables(e){e.empty(),new _1.Setting(e).setHeading().setName("Table Rollers"),new _1.Setting(e).setName("Display Lookup Table Roll").setDesc("Lookup table rolls will display the rolled number along with the result.").addToggle(t=>{t.setValue(this.plugin.data.displayLookupRoll),t.onChange(async i=>{this.plugin.data.displayLookupRoll=i,await this.plugin.saveSettings()})})}buildSections(e){e.empty(),new _1.Setting(e).setHeading().setName("Section Rollers"),new _1.Setting(e).setName("Add Copy Button to Section Results").setDesc("Randomly rolled sections will have a copy-content button to easy add result to clipboard.").addToggle(t=>{t.setValue(this.plugin.data.copyContentButton),t.onChange(async i=>{this.plugin.data.copyContentButton=i,await this.plugin.saveSettings()})}),new _1.Setting(e).setName("Display As Embeds").setDesc("Sections returned from Section & Tag Rollers will display as embedded fields.").addToggle(t=>{t.setValue(this.plugin.data.displayAsEmbed),t.onChange(async i=>{this.plugin.data.displayAsEmbed=i,await this.plugin.saveSettings()})})}buildTags(e){e.empty(),new _1.Setting(e).setHeading().setName("Tag Rollers"),new _1.Setting(e).setName("Roll All Files for Tags").setDesc("Return a result for each file when rolling tags.").addToggle(t=>{t.setValue(this.plugin.data.returnAllTags),t.onChange(async i=>{this.plugin.data.returnAllTags=i,await this.plugin.saveSettings()})}),new _1.Setting(e).setName("Always Return Links for Tags").setDesc("Enables random link rolling with the link parameter. Override by specifying a section type.").addToggle(t=>{t.setValue(this.plugin.data.rollLinksForTags),t.onChange(async i=>{this.plugin.data.rollLinksForTags=i,await this.plugin.saveSettings()})})}buildView(e){e.empty(),new _1.Setting(e).setHeading().setName("Dice View"),new _1.Setting(e).setName("Open Dice View on Startup").setDesc("The dice view can always be opened using the command from the command palette.").addToggle(t=>{t.setValue(this.plugin.data.showLeafOnStartup),t.onChange(async i=>{this.plugin.data.showLeafOnStartup=i,await this.plugin.saveSettings()})})}buildRender(e){e.empty(),new _1.Setting(e).setHeading().setName("Graphical Dice"),new _1.Setting(e).setName("Display graphics for Dice View Rolls").setDesc("Dice rolls from dice view will be displayed on screen.").addToggle(a=>{a.setValue(this.plugin.data.renderer),a.onChange(async r=>{this.plugin.data.renderer=r,await this.plugin.saveSettings()})}),new _1.Setting(e).setName("Display Time for Dice Graphics").setDesc("Rendered dice will stay on screen for this number of milliseconds. Leave blank to require a click to clear dice.").addText(a=>{a.inputEl.setAttr("type","number"),a.inputEl.onblur=r=>{Number(a.getValue())<0&&(new _1.Notice("Render time cannot be less than 0."),a.setValue("0"))},a.setValue(`${this.plugin.data.renderTime}`),a.onChange(async r=>{r&&Number(r)<0||isNaN(Number(r))||(this.plugin.data.renderTime=Number(r),await this.plugin.saveSettings())})}).addExtraButton(a=>{a.setIcon("reset").setTooltip("Reset to Default").onClick(async()=>{this.plugin.data.renderTime=p6.renderTime,await this.plugin.saveSettings(),this.buildRender(e)})}),new _1.Setting(e).setName("Dice Base Color").setDesc("Rendered dice will be this color.").controlEl.createEl("input",{type:"color",value:this.plugin.data.diceColor},a=>{a.value=this.plugin.data.diceColor,a.onchange=async({target:r})=>{let s=r.value;this.plugin.data.diceColor=s,await this.plugin.saveSettings(),this.plugin.app.workspace.trigger("dice-roller:update-colors")}}),new _1.Setting(e).setName("Dice Text Color").setDesc("Rendered dice will use this color for their numbers.").controlEl.createEl("input",{type:"color",value:this.plugin.data.textColor},a=>{a.value=this.plugin.data.textColor,a.onchange=async({target:r})=>{let s=r.value;!s||(this.plugin.data.textColor=s,await this.plugin.saveSettings(),this.plugin.app.workspace.trigger("dice-roller:update-colors"))}})}buildFormulaSettings(e){e.empty(),new _1.Setting(e).setHeading().setName("Saved Formulas");let t=e.createDiv();new _1.Setting(t).setName("Add Formula").setDesc("Add a new formula shortcut.").addButton(r=>r.setTooltip("Add Formula").setButtonText("+").onClick(async()=>{let o=await this.buildFormulaForm(t);o&&(this.plugin.data.formulas[o.alias]=o.formula,this.buildFormulaSettings(e),await this.plugin.saveSettings())}));let i=e.createDiv("additional"),a=this.plugin.data.formulas;for(let[r,s]of Object.entries(a)){let o=new _1.Setting(i).setName(r);o.controlEl.createSpan({text:s}),o.addExtraButton(c=>c.setIcon("pencil").setTooltip("Edit").onClick(async()=>{let l=await this.buildFormulaForm(t,{alias:r,formula:s});l&&(delete this.plugin.data.formulas[r],this.plugin.data.formulas[l.alias]=l.formula,this.buildFormulaSettings(e),await this.plugin.saveSettings())})).addExtraButton(c=>c.setIcon("trash").setTooltip("Delete").onClick(async()=>{delete this.plugin.data.formulas[r],await this.plugin.saveSettings(),this.buildFormulaSettings(e)}))}Object.values(a).length||i.createSpan({text:"Create a formula to see it here!",cls:"no-formulas"})}async buildFormulaForm(e,t={alias:null,formula:null}){return new Promise(i=>{let a=e.createDiv("add-new-formula"),r=a.createDiv("formula-data");new _1.Setting(r).setName("Alias").addText(o=>{o.setValue(t.alias).onChange(c=>t.alias=c)}),new _1.Setting(r).setName("Formula").addText(o=>{o.setValue(t.formula).onChange(c=>t.formula=c)});let s=a.createDiv("formula-buttons");new _1.Setting(s).addButton(o=>o.setCta().setButtonText("Save").onClick(async()=>{a.detach(),i(t)})).addExtraButton(o=>o.setIcon("cross").setTooltip("Cancel").onClick(()=>{a.detach(),i(null)}))})}};var D1=S2(require("obsidian"));var yt="DICE_ROLLER_VIEW",qc='',Wc='',jc='',Xc='',Zc='',Yc='',$c='';(0,D1.addIcon)("d4",qc);(0,D1.addIcon)("d6",Wc);(0,D1.addIcon)("d8",jc);(0,D1.addIcon)("d10",Xc);(0,D1.addIcon)("d12",Zc);(0,D1.addIcon)("d20",Yc);(0,D1.addIcon)("d100",$c);(0,D1.addIcon)("dice-roller-save",'');(0,D1.addIcon)("dice-roller-plus",'');(0,D1.addIcon)("dice-roller-minus",'');var et=class extends D1.ItemView{constructor(e,t){super(t);this.plugin=e;this.leaf=t;C(this,"noResultsEl");C(this,"rollButton");C(this,"saveButton");C(this,"stack");C(this,"gridEl");C(this,"formulaEl");C(this,"dice",et.DICE());C(this,"custom","");C(this,"adv",!1);C(this,"dis",!1);C(this,"add",0);C(this,"formulaComponent");C(this,"resultEl");C(this,"formulaDice");this.contentEl.addClass("dice-roller-view"),this.registerEvent(this.plugin.app.workspace.on("dice-roller:update-colors",()=>{this.renderer.factory.updateColors()}))}static DICE(){return{d4:0,d6:0,d8:0,d10:0,d12:0,d20:0,d100:0}}get customFormulas(){return this.plugin.data.customFormulas}get renderer(){return this.plugin.renderer}async onOpen(){this.display()}async display(){this.contentEl.empty(),this.gridEl=this.contentEl.createDiv("dice-roller-grid"),this.formulaEl=this.contentEl.createDiv("dice-roller-formula");let e=this.contentEl.createDiv("dice-roller-results-container"),t=e.createDiv("dice-roller-results-header");t.createEl("h4",{text:"Results"}),new D1.ExtraButtonComponent(t.createDiv("clear-all")).setIcon("trash").setTooltip("Clear All").onClick(()=>{this.resultEl.empty(),this.resultEl.append(this.noResultsEl)}),this.resultEl=e.createDiv("dice-roller-results"),this.noResultsEl=this.resultEl.createSpan({text:"No results yet! Roll some dice to get started :)"}),this.buildButtons(),this.buildFormula()}buildButtons(){this.gridEl.empty();let e=this.gridEl.createDiv("dice-buttons");for(let o in this.dice){let c=new D1.ExtraButtonComponent(e.createDiv("dice-button")).setIcon(o);c.extraSettingsEl.onclick=async l=>{let u=l.getModifierState("Shift")?-1:1;this.dice[o]+=u,this.setFormula();let f=await this.plugin.getRoller(this.formulaComponent.inputEl.value,"view");f instanceof _2&&(this.stack=f)}}let t=this.gridEl.createDiv("advantage-disadvantage"),i=new D1.ButtonComponent(t).setButtonText("ADV").onClick(()=>{this.adv=!this.adv,this.dis=!1,this.adv?(i.setCta(),a.removeCta()):i.removeCta(),this.setFormula()}),a=new D1.ButtonComponent(t).setButtonText("DIS").onClick(()=>{this.dis=!this.dis,this.dis?(a.setCta(),i.removeCta()):a.removeCta(),this.adv=!1,this.setFormula()}),r=this.gridEl.createDiv("dice-context").createDiv("add-subtract");new D1.ExtraButtonComponent(r).setIcon("dice-roller-minus").onClick(()=>{this.add-=1,s.setValue(`${this.add}`),this.setFormula()});let s=new D1.TextComponent(r).setValue(`${this.add?this.add:""}`).onChange(o=>{isNaN(Number(o))||(this.add=Number(o)),this.setFormula()});if(new D1.ExtraButtonComponent(r).setIcon("dice-roller-plus").onClick(()=>{this.add+=1,s.setValue(`${this.add}`),this.setFormula()}),this.customFormulas.length){let o=this.gridEl.createDiv("dice-roller-results-container");o.createDiv("dice-roller-results-header").createEl("h4",{text:"Saved Formulas"});for(let l of this.customFormulas){let u=o.createDiv("dice-custom-formula-container"),f=u.createDiv("dice-custom-formula");new D1.ExtraButtonComponent(f).setIcon($2).setTooltip("Roll").onClick(()=>this.roll(l)),f.createSpan({text:l}),new D1.ExtraButtonComponent(u).setIcon("trash").setTooltip("Remove").onClick(()=>{this.plugin.data.customFormulas=this.plugin.data.customFormulas.filter(h=>h!=l),this.plugin.saveSettings(),this.buildButtons()})}}}async roll(e=this.formulaComponent.inputEl.value){if(!e)return;this.rollButton.setDisabled(!0);let t=await this.plugin.getRoller(e,"view");if(!(t instanceof _2)){new D1.Notice("The Dice View only supports dice rolls.");return}if(t.iconEl.detach(),t.containerEl.onclick=null,await t.roll(),!t.dice.length){new D1.Notice("Invalid formula.");return}try{this.plugin.data.renderer&&(this.addChild(this.renderer),this.renderer.setDice(t),await this.renderer.start(),t.recalculate())}catch(i){new D1.Notice("There was an error rendering the roll."),console.error(i)}this.rollButton.setDisabled(!1),this.addResult(t),this.dice=et.DICE(),this.add=null,this.adv=!1,this.dis=!1,this.buildButtons(),this.setFormula()}buildFormula(){this.formulaEl.empty(),this.formulaComponent=new D1.TextAreaComponent(this.formulaEl).setPlaceholder("Dice Formula"),this.formulaComponent.onChange((0,D1.debounce)(async t=>{},500,!0));let e=this.formulaEl.createDiv("action-buttons");this.saveButton=new D1.ButtonComponent(e).setIcon("plus-with-circle").setCta().setTooltip("Save Formula").onClick(()=>this.save()),this.saveButton.buttonEl.addClass("dice-roller-roll"),this.rollButton=new D1.ButtonComponent(e).setIcon($2).setCta().setTooltip("Roll").onClick(()=>this.roll()),this.rollButton.buttonEl.addClass("dice-roller-roll")}save(){!this.formulaComponent.inputEl.value||(this.plugin.data.customFormulas.push(this.formulaComponent.inputEl.value),this.buildButtons(),this.plugin.saveSettings())}addResult(e){this.noResultsEl&&this.noResultsEl.detach();let t=createDiv("view-result");t.createSpan({text:e.original}),t.createEl("strong",{attr:{"aria-label":e.resultText}}).appendChild(e.containerEl);let i=t.createDiv("result-context");i.createEl("em",{text:new Date().toLocaleString()}),new D1.ExtraButtonComponent(i).setIcon("trash").onClick(()=>{t.detach(),this.resultEl.children.length===0&&this.resultEl.prepend(this.noResultsEl)}),new D1.ExtraButtonComponent(i).setIcon(Qe).setTooltip("Copy Result").onClick(async()=>{await navigator.clipboard.writeText(`${e.result}`)}).extraSettingsEl.addClass("dice-content-copy"),new D1.ExtraButtonComponent(i).setIcon($2).setTooltip("Roll Again").onClick(()=>this.roll(e.original)).extraSettingsEl.addClass("dice-result-reroll"),this.resultEl.prepend(t)}get formulaString(){let e=[],t=Object.entries(this.dice).filter(([a,r])=>r!=0);if(!t.length)return"";t.sort((a,r)=>Number(r[0].slice(1))-Number(a[0].slice(1)));let i=t.shift();return e.push(`${i[1]}${i[0]}`),this.adv?e.push("kh"):this.dis&&e.push("dh"),t.length&&e.push(...t.map(([a,r])=>`${r>0?"+":"-"}${Math.abs(r)}${a}`)),this.add&&this.add!=0&&(e.push(this.add>0?"+":"-"),e.push(Math.abs(this.add))),e.join("")}setFormula(){this.formulaComponent.setValue(this.formulaString)}getDisplayText(){return"Dice Roller"}getViewType(){return yt}getIcon(){return $2}async onClose(){await super.onClose(),this.renderer.unload()}};var $4=S2(require("obsidian"));var E2=class{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){let e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){let e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){let t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new y){let t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new y){let i=this.elements,a=e.x,r=e.y,s=e.z;return t.x=i[0]*a+i[1]*r+i[2]*s,t.y=i[3]*a+i[4]*r+i[5]*s,t.z=i[6]*a+i[7]*r+i[8]*s,t}smult(e){for(let t=0;t0){let r=1/a;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return a}unit(e=new y){let t=this.x,i=this.y,a=this.z,r=Math.sqrt(t*t+i*i+a*a);return r>0?(r=1/r,e.x=t*r,e.y=i*r,e.z=a*r):(e.x=1,e.y=0,e.z=0),e}length(){let e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){let t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z;return Math.sqrt((r-t)*(r-t)+(s-i)*(s-i)+(o-a)*(o-a))}distanceSquared(e){let t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z;return(r-t)*(r-t)+(s-i)*(s-i)+(o-a)*(o-a)}scale(e,t=new y){let i=this.x,a=this.y,r=this.z;return t.x=e*i,t.y=e*a,t.z=e*r,t}vmul(e,t=new y){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new y){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e=new y){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){let i=this.length();if(i>0){let a=Jc,r=1/i;a.set(this.x*r,this.y*r,this.z*r);let s=Qc;Math.abs(a.x)<.9?(s.set(1,0,0),a.cross(s,e)):(s.set(0,1,0),a.cross(s,e)),a.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){let a=this.x,r=this.y,s=this.z;i.x=a+(e.x-a)*t,i.y=r+(e.y-r)*t,i.z=s+(e.z-s)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(La),La.almostEquals(e,t)}clone(){return new y(this.x,this.y,this.z)}};y.ZERO=void 0;y.UNIT_X=void 0;y.UNIT_Y=void 0;y.UNIT_Z=void 0;y.ZERO=new y(0,0,0);y.UNIT_X=new y(1,0,0);y.UNIT_Y=new y(0,1,0);y.UNIT_Z=new y(0,0,1);var Jc=new y,Qc=new y,La=new y,L2=class{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new y,this.upperBound=new y,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,a){let r=this.lowerBound,s=this.upperBound,o=i;r.copy(e[0]),o&&o.vmult(r,r),s.copy(r);for(let c=1;cs.x&&(s.x=l.x),l.xs.y&&(s.y=l.y),l.ys.z&&(s.z=l.z),l.z=r.x&&t.y<=a.y&&i.y>=r.y&&t.z<=a.z&&i.z>=r.z}getCorners(e,t,i,a,r,s,o,c){let l=this.lowerBound,u=this.upperBound;e.copy(l),t.set(u.x,l.y,l.z),i.set(u.x,u.y,l.z),a.set(l.x,u.y,u.z),r.set(u.x,l.y,u.z),s.set(l.x,u.y,l.z),o.set(l.x,l.y,u.z),c.copy(u)}toLocalFrame(e,t){let i=Ta,a=i[0],r=i[1],s=i[2],o=i[3],c=i[4],l=i[5],u=i[6],f=i[7];this.getCorners(a,r,s,o,c,l,u,f);for(let h=0;h!==8;h++){let m=i[h];e.pointToLocal(m,m)}return t.setFromPoints(i)}toWorldFrame(e,t){let i=Ta,a=i[0],r=i[1],s=i[2],o=i[3],c=i[4],l=i[5],u=i[6],f=i[7];this.getCorners(a,r,s,o,c,l,u,f);for(let h=0;h!==8;h++){let m=i[h];e.pointToWorld(m,m)}return t.setFromPoints(i)}overlapsRay(e){let{direction:t,from:i}=e,a=1/t.x,r=1/t.y,s=1/t.z,o=(this.lowerBound.x-i.x)*a,c=(this.upperBound.x-i.x)*a,l=(this.lowerBound.y-i.y)*r,u=(this.upperBound.y-i.y)*r,f=(this.lowerBound.z-i.z)*s,h=(this.upperBound.z-i.z)*s,m=Math.max(Math.max(Math.min(o,c),Math.min(l,u)),Math.min(f,h)),v=Math.min(Math.min(Math.max(o,c),Math.max(l,u)),Math.max(f,h));return!(v<0||m>v)}},Da=new y,Ta=[new y,new y,new y,new y,new y,new y,new y,new y],U0=class{constructor(){this.matrix=void 0,this.matrix=[]}get(e,t){let{index:i}=e,{index:a}=t;if(a>i){let r=a;a=i,i=r}return this.matrix[(i*(i+1)>>1)+a-1]}set(e,t,i){let{index:a}=e,{index:r}=t;if(r>a){let s=r;r=a,a=s}this.matrix[(a*(a+1)>>1)+r-1]=i?1:0}reset(){for(let e=0,t=this.matrix.length;e!==t;e++)this.matrix[e]=0}setNumObjects(e){this.matrix.length=e*(e-1)>>1}},O0=class{constructor(){this._listeners=void 0}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;return i[e]===void 0&&(i[e]=[]),i[e].includes(t)||i[e].push(t),this}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return!!(i[e]!==void 0&&i[e].includes(t))}hasAnyEventListener(e){return this._listeners===void 0?!1:this._listeners[e]!==void 0}removeEventListener(e,t){if(this._listeners===void 0)return this;let i=this._listeners;if(i[e]===void 0)return this;let a=i[e].indexOf(t);return a!==-1&&i[e].splice(a,1),this}dispatchEvent(e){if(this._listeners===void 0)return this;let i=this._listeners[e.type];if(i!==void 0){e.target=this;for(let a=0,r=i.length;a.499&&(i=2*Math.atan2(s,l),a=Math.PI/2,r=0),u<-.499&&(i=-2*Math.atan2(s,l),a=-Math.PI/2,r=0),i===void 0){let f=s*s,h=o*o,m=c*c;i=Math.atan2(2*o*l-2*s*c,1-2*h-2*m),a=Math.asin(2*u),r=Math.atan2(2*s*l-2*o*c,1-2*f-2*m)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=a,e.x=r}setFromEuler(e,t,i,a="XYZ"){let r=Math.cos(e/2),s=Math.cos(t/2),o=Math.cos(i/2),c=Math.sin(e/2),l=Math.sin(t/2),u=Math.sin(i/2);return a==="XYZ"?(this.x=c*s*o+r*l*u,this.y=r*l*o-c*s*u,this.z=r*s*u+c*l*o,this.w=r*s*o-c*l*u):a==="YXZ"?(this.x=c*s*o+r*l*u,this.y=r*l*o-c*s*u,this.z=r*s*u-c*l*o,this.w=r*s*o+c*l*u):a==="ZXY"?(this.x=c*s*o-r*l*u,this.y=r*l*o+c*s*u,this.z=r*s*u+c*l*o,this.w=r*s*o-c*l*u):a==="ZYX"?(this.x=c*s*o-r*l*u,this.y=r*l*o+c*s*u,this.z=r*s*u-c*l*o,this.w=r*s*o+c*l*u):a==="YZX"?(this.x=c*s*o+r*l*u,this.y=r*l*o+c*s*u,this.z=r*s*u-c*l*o,this.w=r*s*o-c*l*u):a==="XZY"&&(this.x=c*s*o-r*l*u,this.y=r*l*o-c*s*u,this.z=r*s*u+c*l*o,this.w=r*s*o+c*l*u),this}clone(){return new G1(this.x,this.y,this.z,this.w)}slerp(e,t,i=new G1){let a=this.x,r=this.y,s=this.z,o=this.w,c=e.x,l=e.y,u=e.z,f=e.w,h,m,v,g,x;return m=a*c+r*l+s*u+o*f,m<0&&(m=-m,c=-c,l=-l,u=-u,f=-f),1-m>1e-6?(h=Math.acos(m),v=Math.sin(h),g=Math.sin((1-t)*h)/v,x=Math.sin(t*h)/v):(g=1-t,x=t),i.x=g*a+x*c,i.y=g*r+x*l,i.z=g*s+x*u,i.w=g*o+x*f,i}integrate(e,t,i,a=new G1){let r=e.x*i.x,s=e.y*i.y,o=e.z*i.z,c=this.x,l=this.y,u=this.z,f=this.w,h=t*.5;return a.x+=h*(r*f+s*u-o*l),a.y+=h*(s*f+o*c-r*u),a.z+=h*(o*f+r*l-s*c),a.w+=h*(-r*c-s*l-o*u),a}},e7=new y,t7=new y,i7={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},l1=class{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=l1.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(e,t){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(e,t,i,a){throw"calculateWorldAABB() not implemented for shape type "+this.type}};l1.idCounter=0;l1.types=i7;var R1=class{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new y,this.quaternion=new G1,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return R1.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return R1.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new y){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,a=new y){return i.vsub(e,a),t.conjugate(Ha),Ha.vmult(a,a),a}static pointToWorldFrame(e,t,i,a=new y){return t.vmult(i,a),a.vadd(e,a),a}static vectorToWorldFrame(e,t,i=new y){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,a=new y){return t.w*=-1,t.vmult(i,a),t.w*=-1,a}},Ha=new G1,tt=class extends l1{constructor(e={}){let{vertices:t=[],faces:i=[],normals:a=[],axes:r,boundingSphereRadius:s}=e;super({type:l1.types.CONVEXPOLYHEDRON});this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=a,this.faceNormals.length===0&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){let e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;let a=new y;for(let r=0;r!==e.length;r++){let s=e[r],o=s.length;for(let c=0;c!==o;c++){let l=(c+1)%o;t[s[c]].vsub(t[s[l]],a),a.normalize();let u=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(a)||i[f].almostEquals(a)){u=!0;break}u||i.push(a.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;eh&&(h=g,f=v)}let m=[];for(let v=0;v=0&&this.clipFaceAgainstHull(s,e,t,m,o,c,l)}findSeparatingAxis(e,t,i,a,r,s,o,c){let l=new y,u=new y,f=new y,h=new y,m=new y,v=new y,g=Number.MAX_VALUE,x=this;if(x.uniqueAxes)for(let p=0;p!==x.uniqueAxes.length;p++){i.vmult(x.uniqueAxes[p],l);let d=x.testSepAxis(l,e,t,i,a,r);if(d===!1)return!1;d0&&s.negate(s),!0}testSepAxis(e,t,i,a,r,s){let o=this;tt.project(o,e,i,a,G0),tt.project(t,e,r,s,q0);let c=G0[0],l=G0[1],u=q0[0],f=q0[1];if(c0?1/t:0,this.material=e.material||null,this.linearDamping=typeof e.linearDamping=="number"?e.linearDamping:.01,this.type=t<=0?a1.STATIC:a1.DYNAMIC,typeof e.type==typeof a1.STATIC&&(this.type=e.type),this.allowSleep=typeof e.allowSleep!="undefined"?e.allowSleep:!0,this.sleepState=a1.AWAKE,this.sleepSpeedLimit=typeof e.sleepSpeedLimit!="undefined"?e.sleepSpeedLimit:.1,this.sleepTimeLimit=typeof e.sleepTimeLimit!="undefined"?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new y,this.quaternion=new G1,this.initQuaternion=new G1,this.previousQuaternion=new G1,this.interpolatedQuaternion=new G1,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new y,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new y,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new y,this.invInertia=new y,this.invInertiaWorld=new E2,this.invMassSolve=0,this.invInertiaSolve=new y,this.invInertiaWorldSolve=new E2,this.fixedRotation=typeof e.fixedRotation!="undefined"?e.fixedRotation:!1,this.angularDamping=typeof e.angularDamping!="undefined"?e.angularDamping:.01,this.linearFactor=new y(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new y(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new L2,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new y,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){let e=this.sleepState;this.sleepState=a1.AWAKE,this.wakeUpAfterNarrowphase=!1,e===a1.SLEEPING&&this.dispatchEvent(a1.wakeupEvent)}sleep(){this.sleepState=a1.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){let t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),a=this.sleepSpeedLimit**2;t===a1.AWAKE&&ia?this.wakeUp():t===a1.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(a1.sleepEvent))}}updateSolveMassProperties(){this.sleepState===a1.SLEEPING||this.type===a1.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new y){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new y){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new y){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new y){return this.quaternion.vmult(e,t),t}addShape(e,t,i){let a=new y,r=new G1;return t&&a.copy(t),i&&r.copy(i),this.shapes.push(e),this.shapeOffsets.push(a),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){let t=this.shapes.indexOf(e);return t===-1?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){let e=this.shapes,t=this.shapeOffsets,i=e.length,a=0;for(let r=0;r!==i;r++){let s=e[r];s.updateBoundingSphereRadius();let o=t[r].length(),c=s.boundingSphereRadius;o+c>a&&(a=o+c)}this.boundingRadius=a}updateAABB(){let e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,a=e.length,r=n7,s=s7,o=this.quaternion,c=this.aabb,l=o7;for(let u=0;u!==a;u++){let f=e[u];o.vmult(t[u],r),r.vadd(this.position,r),o.mult(i[u],s),f.calculateWorldAABB(r,s,l.lowerBound,l.upperBound),u===0?c.copy(l):c.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){let t=this.invInertia;if(!(t.x===t.y&&t.y===t.z&&!e)){let i=c7,a=l7;i.setRotationFromQuaternion(this.quaternion),i.transpose(a),i.scale(t,i),i.mmult(a,this.invInertiaWorld)}}applyForce(e,t=new y){if(this.type!==a1.DYNAMIC)return;this.sleepState===a1.SLEEPING&&this.wakeUp();let i=u7;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new y){if(this.type!==a1.DYNAMIC)return;let i=h7,a=f7;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,a),this.applyForce(i,a)}applyTorque(e){this.type===a1.DYNAMIC&&(this.sleepState===a1.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new y){if(this.type!==a1.DYNAMIC)return;this.sleepState===a1.SLEEPING&&this.wakeUp();let i=t,a=d7;a.copy(e),a.scale(this.invMass,a),this.velocity.vadd(a,this.velocity);let r=p7;i.cross(e,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(e,t=new y){if(this.type!==a1.DYNAMIC)return;let i=m7,a=v7;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,a),this.applyImpulse(i,a)}updateMassProperties(){let e=g7;this.invMass=this.mass>0?1/this.mass:0;let t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),m6.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){let i=new y;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),!(this.type===a1.DYNAMIC||this.type===a1.KINEMATIC)||this.sleepState===a1.SLEEPING)return;let a=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,c=this.torque,l=this.quaternion,u=this.invMass,f=this.invInertiaWorld,h=this.linearFactor,m=u*e;a.x+=o.x*m*h.x,a.y+=o.y*m*h.y,a.z+=o.z*m*h.z;let v=f.elements,g=this.angularFactor,x=c.x*g.x,p=c.y*g.y,d=c.z*g.z;r.x+=e*(v[0]*x+v[1]*p+v[2]*d),r.y+=e*(v[3]*x+v[4]*p+v[5]*d),r.z+=e*(v[6]*x+v[7]*p+v[8]*d),s.x+=a.x*e,s.y+=a.y*e,s.z+=a.z*e,l.integrate(this.angularVelocity,e,this.angularFactor,l),t&&(i?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}};a1.idCounter=0;a1.COLLIDE_EVENT_NAME="collide";a1.DYNAMIC=W0.DYNAMIC;a1.STATIC=W0.STATIC;a1.KINEMATIC=W0.KINEMATIC;a1.AWAKE=j0.AWAKE;a1.SLEEPY=j0.SLEEPY;a1.SLEEPING=j0.SLEEPING;a1.wakeupEvent={type:"wakeup"};a1.sleepyEvent={type:"sleepy"};a1.sleepEvent={type:"sleep"};var n7=new y,s7=new G1,o7=new L2,c7=new E2,l7=new E2,u7=new y,h7=new y,f7=new y,d7=new y,p7=new y,m7=new y,v7=new y,g7=new y,Va=class{constructor(){this.world=void 0,this.useBoundingBoxes=void 0,this.dirty=void 0,this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(e,t,i){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(e,t){return!((e.collisionFilterGroup&t.collisionFilterMask)==0||(t.collisionFilterGroup&e.collisionFilterMask)==0||((e.type&a1.STATIC)!=0||e.sleepState===a1.SLEEPING)&&((t.type&a1.STATIC)!=0||t.sleepState===a1.SLEEPING))}intersectionTest(e,t,i,a){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,t,i,a):this.doBoundingSphereBroadphase(e,t,i,a)}doBoundingSphereBroadphase(e,t,i,a){let r=x7;t.position.vsub(e.position,r);let s=(e.boundingRadius+t.boundingRadius)**2;r.lengthSquared()i.lengthSquared()}aabbQuery(e,t,i){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},x7=new y,M7={keys:[]},b7=[],y7=[];var zf=new y,v6=class extends Va{constructor(){super()}collisionPairs(e,t,i){let a=e.bodies,r=a.length,s,o;for(let c=0;c!==r;c++)for(let l=0;l!==c;l++)s=a[c],o=a[l],!!this.needBroadphaseCollision(s,o)&&this.intersectionTest(s,o,t,i)}aabbQuery(e,t,i=[]){for(let a=0;a{}}intersectWorld(e,t){return this.mode=t.mode||e2.ANY,this.result=t.result||new g6,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask!="undefined"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup!="undefined"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse!="undefined"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Ua),Z0.length=0,e.broadphase.aabbQuery(e,Ua,Z0),this.intersectBodies(Z0),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());let i=this.checkCollisionResponse;if(i&&!e.collisionResponse||(this.collisionFilterGroup&e.collisionFilterMask)==0||(e.collisionFilterGroup&this.collisionFilterMask)==0)return;let a=C7,r=z7;for(let s=0,o=e.shapes.length;se.boundingSphereRadius)return;let o=this[e.type];o&&o.call(this,e,t,i,a,e)}_intersectBox(e,t,i,a,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,a,r)}_intersectPlane(e,t,i,a,r){let s=this.from,o=this.to,c=this.direction,l=new y(0,0,1);t.vmult(l,l);let u=new y;s.vsub(i,u);let f=u.dot(l);o.vsub(i,u);let h=u.dot(l);if(f*h>0||s.distanceTo(o)=0&&g<=1&&(s.lerp(o,g,m),m.vsub(i,v),v.normalize(),this.reportIntersection(v,m,r,a,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(s.lerp(o,x,m),m.vsub(i,v),v.normalize(),this.reportIntersection(v,m,r,a,-1))}}_intersectConvex(e,t,i,a,r,s){let o=E7,c=Ga,l=s&&s.faceList||null,u=e.faces,f=e.vertices,h=e.faceNormals,m=this.direction,v=this.from,g=this.to,x=v.distanceTo(g),p=l?l.length:u.length,d=this.result;for(let w=0;!d.shouldStop&&wx||this.reportIntersection(o,D2,r,a,b)}}}}_intersectTrimesh(e,t,i,a,r,s){let o=L7,c=R7,l=F7,u=Ga,f=D7,h=T7,m=H7,v=N7,g=V7,x=e.indices;e.vertices;let p=this.from,d=this.to,w=this.direction;l.position.copy(i),l.quaternion.copy(t),R1.vectorToLocalFrame(i,t,w,f),R1.pointToLocalFrame(i,t,p,h),R1.pointToLocalFrame(i,t,d,m),m.x*=e.scale.x,m.y*=e.scale.y,m.z*=e.scale.z,h.x*=e.scale.x,h.y*=e.scale.y,h.z*=e.scale.z,m.vsub(h,f),f.normalize();let b=h.distanceSquared(m);e.tree.rayQuery(this,l,c);for(let z=0,L=c.length;!this.result.shouldStop&&z!==L;z++){let H=c[z];e.getNormal(H,o),e.getVertex(x[H*3],K2),K2.vsub(h,u);let E=f.dot(o),I=o.dot(u)/E;if(I<0)continue;f.scale(I,D2),D2.vadd(h,D2),e.getVertex(x[H*3+1],ge),e.getVertex(x[H*3+2],xe);let B=D2.distanceSquared(h);!(e2.pointInTriangle(D2,ge,K2,xe)||e2.pointInTriangle(D2,K2,ge,xe))||B>b||(R1.vectorToWorldFrame(t,o,g),R1.pointToWorldFrame(i,t,D2,v),this.reportIntersection(g,v,r,a,H))}c.length=0}reportIntersection(e,t,i,a,r){let s=this.from,o=this.to,c=s.distanceTo(t),l=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(l.hitFaceIndex=typeof r!="undefined"?r:-1,this.mode){case e2.ALL:this.hasHit=!0,l.set(s,o,e,t,i,a,c),l.hasHit=!0,this.callback(l);break;case e2.CLOSEST:(c=0&&(f=r*l-s*o)>=0&&u+fH.maxForce&&(m=H.maxForce-x),w[L]+=m,v+=m>0?m:-m,H.addToWlambda(m)}if(v*ve;)t.pop();for(;t.length=0&&u.restitution>=0&&(o.restitution=l.restitution*u.restitution),o.si=r||i,o.sj=s||a,o}createFrictionEquationsFromContact(e,t){let i=e.bi,a=e.bj,r=e.si,s=e.sj,o=this.world,c=this.currentContactMaterial,l=c.friction,u=r.material||i.material,f=s.material||a.material;if(u&&f&&u.friction>=0&&f.friction>=0&&(l=u.friction*f.friction),l>0){let h=l*o.gravity.length(),m=i.invMass+a.invMass;m>0&&(m=1/m);let v=this.frictionEquationPool,g=v.length?v.pop():new J0(i,a,h*m),x=v.length?v.pop():new J0(i,a,h*m);return g.bi=x.bi=i,g.bj=x.bj=a,g.minForce=x.minForce=-h*m,g.maxForce=x.maxForce=h*m,g.ri.copy(e.ri),g.rj.copy(e.rj),x.ri.copy(e.ri),x.rj.copy(e.rj),e.ni.tangents(g.t,x.t),g.setSpookParams(c.frictionEquationStiffness,c.frictionEquationRelaxation,o.dt),x.setSpookParams(c.frictionEquationStiffness,c.frictionEquationRelaxation,o.dt),g.enabled=x.enabled=e.enabled,t.push(g,x),!0}return!1}createFrictionFromAverage(e){let t=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(t,this.frictionResult)||e===1)return;let i=this.frictionResult[this.frictionResult.length-2],a=this.frictionResult[this.frictionResult.length-1];zt.setZero(),Gt.setZero(),qt.setZero();let r=t.bi;t.bj;for(let o=0;o!==e;o++)t=this.result[this.result.length-1-o],t.bi!==r?(zt.vadd(t.ni,zt),Gt.vadd(t.ri,Gt),qt.vadd(t.rj,qt)):(zt.vsub(t.ni,zt),Gt.vadd(t.rj,Gt),qt.vadd(t.ri,qt));let s=1/e;Gt.scale(s,i.ri),qt.scale(s,i.rj),a.ri.copy(i.ri),a.rj.copy(i.rj),zt.normalize(),zt.tangents(i.t,a.t)}getContacts(e,t,i,a,r,s,o){this.contactPointPool=r,this.frictionEquationPool=o,this.result=a,this.frictionResult=s;let c=el,l=tl,u=J7,f=Q7;for(let h=0,m=e.length;h!==m;h++){let v=e[h],g=t[h],x=null;v.material&&g.material&&(x=i.getContactMaterial(v.material,g.material)||null);let p=v.type&a1.KINEMATIC&&g.type&a1.STATIC||v.type&a1.STATIC&&g.type&a1.KINEMATIC||v.type&a1.KINEMATIC&&g.type&a1.KINEMATIC;for(let d=0;dw.boundingSphereRadius+z.boundingSphereRadius)continue;let L=null;w.material&&z.material&&(L=i.getContactMaterial(w.material,z.material)||null),this.currentContactMaterial=L||x||i.defaultContactMaterial;let H=w.type|z.type,E=this[H];if(E){let I=!1;w.type0){let j=wl,Z=Sl;j.copy(m[(D+1)%3]),Z.copy(m[(D+2)%3]);let e1=j.length(),r1=Z.length();j.normalize(),Z.normalize();let P=z6.dot(j),b1=z6.dot(Z);if(P-e1&&b1-r1){let h1=Math.abs(G-Y-v);if((H===null||h1e.boundingSphereRadius+t.boundingSphereRadius)&&e.findSeparatingAxis(t,i,r,a,s,v,h,m)){let g=[],x=Xl;e.clipAgainstHull(i,r,t,a,s,v,-100,100,g);let p=0;for(let d=0;d!==g.length;d++){if(f)return!0;let w=this.createContactEquation(o,c,e,t,l,u),b=w.ri,z=w.rj;v.negate(w.ni),g[d].normal.negate(x),x.scale(g[d].depth,x),g[d].point.vadd(x,b),z.copy(g[d].point),b.vsub(i,b),z.vsub(a,z),b.vadd(i,b),b.vsub(o.position,b),z.vadd(a,z),z.vsub(c.position,z),this.result.push(w),p++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(w,this.frictionResult)}this.enableFrictionReduction&&p&&this.createFrictionFromAverage(p)}}sphereConvex(e,t,i,a,r,s,o,c,l,u,f){let h=this.v3pool;i.vsub(a,Hl);let m=t.faceNormals,v=t.faces,g=t.vertices,x=e.radius,p=!1;for(let d=0;d!==g.length;d++){let w=g[d],b=Fl;s.vmult(w,b),a.vadd(b,b);let z=Rl;if(b.vsub(i,z),z.lengthSquared()0){let T=[];for(let A=0,V=z.length;A!==V;A++){let N=h.get();s.vmult(g[z[A]],N),a.vadd(N,N),T.push(N)}if(zl(T,L,i)){if(f)return!0;p=!0;let A=this.createContactEquation(o,c,e,t,l,u);L.scale(-x,A.ri),L.negate(A.ni);let V=h.get();L.scale(-B,V);let N=h.get();L.scale(-x,N),i.vsub(a,A.rj),A.rj.vadd(N,A.rj),A.rj.vadd(V,A.rj),A.rj.vadd(a,A.rj),A.rj.vsub(c.position,A.rj),A.ri.vadd(i,A.ri),A.ri.vsub(o.position,A.ri),h.release(V),h.release(N),this.result.push(A),this.createFrictionEquationsFromContact(A,this.frictionResult);for(let D=0,R=T.length;D!==R;D++)h.release(T[D]);return}else for(let A=0;A!==z.length;A++){let V=h.get(),N=h.get();s.vmult(g[z[(A+1)%z.length]],V),s.vmult(g[z[(A+2)%z.length]],N),a.vadd(V,V),a.vadd(N,N);let D=Vl;N.vsub(V,D);let R=Nl;D.unit(R);let O=h.get(),Y=h.get();i.vsub(V,Y);let G=Y.dot(R);R.scale(G,O),O.vadd(V,O);let j=h.get();if(O.vsub(i,j),G>0&&G*Gh.length||w>h[0].length)return;p<0&&(p=0),d<0&&(d=0),w<0&&(w=0),b<0&&(b=0),p>=h.length&&(p=h.length-1),d>=h.length&&(d=h.length-1),b>=h[0].length&&(b=h[0].length-1),w>=h[0].length&&(w=h[0].length-1);let z=[];t.getRectMinMax(p,w,d,b,z);let L=z[0],H=z[1];if(x.z-m>H||x.z+m2)return}}boxHeightfield(e,t,i,a,r,s,o,c,l,u,f){return e.convexPolyhedronRepresentation.material=e.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,this.convexHeightfield(e.convexPolyhedronRepresentation,t,i,a,r,s,o,c,e,t,f)}convexHeightfield(e,t,i,a,r,s,o,c,l,u,f){let h=t.data,m=t.elementSize,v=e.boundingSphereRadius,g=i9,x=a9,p=t9;R1.pointToLocalFrame(a,s,i,p);let d=Math.floor((p.x-v)/m)-1,w=Math.ceil((p.x+v)/m)+1,b=Math.floor((p.y-v)/m)-1,z=Math.ceil((p.y+v)/m)+1;if(w<0||z<0||d>h.length||b>h[0].length)return;d<0&&(d=0),w<0&&(w=0),b<0&&(b=0),z<0&&(z=0),d>=h.length&&(d=h.length-1),w>=h.length&&(w=h.length-1),z>=h[0].length&&(z=h[0].length-1),b>=h[0].length&&(b=h[0].length-1);let L=[];t.getRectMinMax(d,b,w,z,L);let H=L[0],E=L[1];if(!(p.z-v>E||p.z+v0&&N<0&&(x.vsub(h,p),g.copy(v),g.normalize(),D=p.dot(g),g.scale(D,p),p.vadd(h,p),p.distanceTo(x)0&&i===!0||u<=0&&i===!1){i===null&&(i=u>0);continue}else return!1}return!0}var z6=new y,Al=new y,wl=new y,Sl=new y,_l=[new y,new y,new y,new y,new y,new y],El=new y,Ll=new y,Dl=new y,Tl=new y,Hl=new y,Vl=new y,Nl=new y,Rl=new y,Fl=new y,Bl=new y,Pl=new y,Il=new y,kl=new y,Ul=new y,Ol=new y,Gl=new y,ql=new y,Wl=new y,jl=new y,Xl=new y,Zl=new y,Yl=new y,$l=new y,Kl=new y,Sr=new G1,Jl=new y,Ql=new y,_r=new y,e9=new y,t9=new y,i9=new y,a9=[0],r9=new y,n9=new y,Q0=class{constructor(){this.current=void 0,this.previous=void 0,this.current=[],this.previous=[]}getKey(e,t){if(ta[r];)r++;if(i!==a[r]){for(let s=a.length-1;s>=r;s--)a[s+1]=a[s];a[r]=i}}tick(){let e=this.current;this.current=this.previous,this.previous=e,this.current.length=0}getDiff(e,t){let i=this.current,a=this.previous,r=i.length,s=a.length,o=0;for(let c=0;ca[o];)o++;l=u===a[o],l||Er(e,u)}o=0;for(let c=0;ci[o];)o++;l=i[o]===u,l||Er(t,u)}}};function Er(n,e){n.push((e&4294901760)>>16,e&65535)}var Lr=class{constructor(){this.data={keys:[]}}get(e,t){if(e>t){let i=t;t=e,e=i}return this.data[e+"-"+t]}set(e,t,i){if(e>t){let r=t;t=e,e=r}let a=e+"-"+t;this.get(e,t)||this.data.keys.push(a),this.data[a]=i}reset(){let e=this.data,t=e.keys;for(;t.length>0;){let i=t.pop();delete e[i]}}},e3=class extends O0{constructor(e={}){super();this.dt=void 0,this.allowSleep=void 0,this.contacts=void 0,this.frictionEquations=void 0,this.quatNormalizeSkip=void 0,this.quatNormalizeFast=void 0,this.time=void 0,this.stepnumber=void 0,this.default_dt=void 0,this.nextId=void 0,this.gravity=void 0,this.broadphase=void 0,this.bodies=void 0,this.hasActiveBodies=void 0,this.solver=void 0,this.constraints=void 0,this.narrowphase=void 0,this.collisionMatrix=void 0,this.collisionMatrixPrevious=void 0,this.bodyOverlapKeeper=void 0,this.shapeOverlapKeeper=void 0,this.materials=void 0,this.contactmaterials=void 0,this.contactMaterialTable=void 0,this.defaultMaterial=void 0,this.defaultContactMaterial=void 0,this.doProfiling=void 0,this.profile=void 0,this.accumulator=void 0,this.subsystems=void 0,this.addBodyEvent=void 0,this.removeBodyEvent=void 0,this.idToBodyMap=void 0,this.dt=-1,this.allowSleep=!!e.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=e.quatNormalizeSkip!==void 0?e.quatNormalizeSkip:0,this.quatNormalizeFast=e.quatNormalizeFast!==void 0?e.quatNormalizeFast:!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new y,e.gravity&&this.gravity.copy(e.gravity),this.broadphase=e.broadphase!==void 0?e.broadphase:new v6,this.bodies=[],this.hasActiveBodies=!1,this.solver=e.solver!==void 0?e.solver:new $a,this.constraints=[],this.narrowphase=new Ar(this),this.collisionMatrix=new U0,this.collisionMatrixPrevious=new U0,this.bodyOverlapKeeper=new Q0,this.shapeOverlapKeeper=new Q0,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new Lr,this.defaultMaterial=new Ve("default"),this.defaultContactMaterial=new He(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(e,t){return this.contactMaterialTable.get(e.id,t.id)}numObjects(){return this.bodies.length}collisionMatrixTick(){let e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(e){this.constraints.push(e)}removeConstraint(e){let t=this.constraints.indexOf(e);t!==-1&&this.constraints.splice(t,1)}rayTest(e,t,i){i instanceof g6?this.raycastClosest(e,t,{skipBackfaces:!0},i):this.raycastAll(e,t,{skipBackfaces:!0},i)}raycastAll(e,t,i={},a){return i.mode=e2.ALL,i.from=e,i.to=t,i.callback=a,t3.intersectWorld(this,i)}raycastAny(e,t,i={},a){return i.mode=e2.ANY,i.from=e,i.to=t,i.result=a,t3.intersectWorld(this,i)}raycastClosest(e,t,i={},a){return i.mode=e2.CLOSEST,i.from=e,i.to=t,i.result=a,t3.intersectWorld(this,i)}addBody(e){this.bodies.includes(e)||(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof a1&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.idToBodyMap[e.id]=e,this.dispatchEvent(this.addBodyEvent))}removeBody(e){e.world=null;let t=this.bodies.length-1,i=this.bodies,a=i.indexOf(e);if(a!==-1){i.splice(a,1);for(let r=0;r!==i.length;r++)i[r].index=r;this.collisionMatrix.setNumObjects(t),this.removeBodyEvent.body=e,delete this.idToBodyMap[e.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(e){return this.idToBodyMap[e]}getShapeById(e){let t=this.bodies;for(let i=0;i=e&&re*1e3)););this.accumulator=this.accumulator%e;let s=this.accumulator/e;for(let o=0;o!==this.bodies.length;o++){let c=this.bodies[o];c.previousPosition.lerp(c.position,s,c.interpolatedPosition),c.previousQuaternion.slerp(c.quaternion,s,c.interpolatedQuaternion),c.previousQuaternion.normalize()}this.time+=t}}internalStep(e){this.dt=e;let t=this.contacts,i=u9,a=h9,r=this.numObjects(),s=this.bodies,o=this.solver,c=this.gravity,l=this.doProfiling,u=this.profile,f=a1.DYNAMIC,h=-1/0,m=this.constraints,v=l9;c.length();let g=c.x,x=c.y,p=c.z,d=0;for(l&&(h=o2.now()),d=0;d!==r;d++){let A=s[d];if(A.type===f){let V=A.force,N=A.mass;V.x+=N*g,V.y+=N*x,V.z+=N*p}}for(let A=0,V=this.subsystems.length;A!==V;A++)this.subsystems[A].update();l&&(h=o2.now()),i.length=0,a.length=0,this.broadphase.collisionPairs(this,i,a),l&&(u.broadphase=o2.now()-h);let w=m.length;for(d=0;d!==w;d++){let A=m[d];if(!A.collideConnected)for(let V=i.length-1;V>=0;V-=1)(A.bodyA===i[V]&&A.bodyB===a[V]||A.bodyB===i[V]&&A.bodyA===a[V])&&(i.splice(V,1),a.splice(V,1))}this.collisionMatrixTick(),l&&(h=o2.now());let b=c9,z=t.length;for(d=0;d!==z;d++)b.push(t[d]);t.length=0;let L=this.frictionEquations.length;for(d=0;d!==L;d++)v.push(this.frictionEquations[d]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(i,a,this,t,b,this.frictionEquations,v),l&&(u.narrowphase=o2.now()-h),l&&(h=o2.now()),d=0;d=0&&D.material.friction>=0&&N.material.friction*D.material.friction,N.material.restitution>=0&&D.material.restitution>=0&&(V.restitution=N.material.restitution*D.material.restitution)),o.addEquation(V),N.allowSleep&&N.type===a1.DYNAMIC&&N.sleepState===a1.SLEEPING&&D.sleepState===a1.AWAKE&&D.type!==a1.STATIC){let G=D.velocity.lengthSquared()+D.angularVelocity.lengthSquared(),j=D.sleepSpeedLimit**2;G>=j*2&&(N.wakeUpAfterNarrowphase=!0)}if(D.allowSleep&&D.type===a1.DYNAMIC&&D.sleepState===a1.SLEEPING&&N.sleepState===a1.AWAKE&&N.type!==a1.STATIC){let G=N.velocity.lengthSquared()+N.angularVelocity.lengthSquared(),j=N.sleepSpeedLimit**2;G>=j*2&&(D.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(N,D,!0),this.collisionMatrixPrevious.get(N,D)||(_4.body=D,_4.contact=V,N.dispatchEvent(_4),_4.body=N,D.dispatchEvent(_4)),this.bodyOverlapKeeper.set(N.id,D.id),this.shapeOverlapKeeper.set(R.id,O.id)}for(this.emitContactEvents(),l&&(u.makeContactConstraints=o2.now()-h,h=o2.now()),d=0;d!==r;d++){let A=s[d];A.wakeUpAfterNarrowphase&&(A.wakeUp(),A.wakeUpAfterNarrowphase=!1)}for(w=m.length,d=0;d!==w;d++){let A=m[d];A.update();for(let V=0,N=A.equations.length;V!==N;V++){let D=A.equations[V];o.addEquation(D)}}o.solve(e,this),l&&(u.solve=o2.now()-h),o.removeAllEquations();let E=Math.pow;for(d=0;d!==r;d++){let A=s[d];if(A.type&f){let V=E(1-A.linearDamping,e),N=A.velocity;N.scale(V,N);let D=A.angularVelocity;if(D){let R=E(1-A.angularDamping,e);D.scale(R,D)}}}for(this.dispatchEvent(o9),d=0;d!==r;d++){let A=s[d];A.preStep&&A.preStep.call(A)}l&&(h=o2.now());let B=this.stepnumber%(this.quatNormalizeSkip+1)==0,M=this.quatNormalizeFast;for(d=0;d!==r;d++)s[d].integrate(e,B,M);for(this.clearForces(),this.broadphase.dirty=!0,l&&(u.integrate=o2.now()-h),this.stepnumber+=1,this.dispatchEvent(s9),d=0;d!==r;d++){let A=s[d],V=A.postStep;V&&V.call(A)}let T=!0;if(this.allowSleep)for(T=!1,d=0;d!==r;d++){let A=s[d];A.sleepTick(this.time),A.sleepState!==a1.SLEEPING&&(T=!0)}this.hasActiveBodies=T}emitContactEvents(){let e=this.hasAnyEventListener("beginContact"),t=this.hasAnyEventListener("endContact");if((e||t)&&this.bodyOverlapKeeper.getDiff(Re,Fe),e){for(let r=0,s=Re.length;rDate.now()-n}var s9={type:"postStep"},o9={type:"preStep"},_4={type:a1.COLLIDE_EVENT_NAME,body:null,contact:null},c9=[],l9=[],u9=[],h9=[],Re=[],Fe=[],E4={type:"beginContact",bodyA:null,bodyB:null},L4={type:"endContact",bodyA:null,bodyB:null},Be={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Pe={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null};var W1=class{constructor(e=0,t=0,i=0,a=1){this.x=e,this.y=t,this.z=i,this.w=a}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,a){return this.x=e,this.y=t,this.z=i,this.w=a,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,a=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*a+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*a+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*a+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*a+s[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,a,r,s=.01,o=.1,c=e.elements,l=c[0],u=c[4],f=c[8],h=c[1],m=c[5],v=c[9],g=c[2],x=c[6],p=c[10];if(Math.abs(u-h)b&&w>z?wz?b>8&255]+f2[n>>16&255]+f2[n>>24&255]+"-"+f2[e&255]+f2[e>>8&255]+"-"+f2[e>>16&15|64]+f2[e>>24&255]+"-"+f2[t&63|128]+f2[t>>8&255]+"-"+f2[t>>16&255]+f2[t>>24&255]+f2[i&255]+f2[i>>8&255]+f2[i>>16&255]+f2[i>>24&255]).toUpperCase()}function T2(n,e,t){return Math.max(e,Math.min(t,n))}function Dr(n,e){return(n%e+e)%e}function w6(n,e,t){return(1-t)*n+t*e}function i3(n){return(n&n-1)==0&&n!==0}function Tr(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}var be=class{constructor(e=0,t=0,i=0,a=1){this._x=e,this._y=t,this._z=i,this._w=a}static slerp(e,t,i,a){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,a)}static slerpFlat(e,t,i,a,r,s,o){let c=i[a+0],l=i[a+1],u=i[a+2],f=i[a+3],h=r[s+0],m=r[s+1],v=r[s+2],g=r[s+3];if(o===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=f;return}if(o===1){e[t+0]=h,e[t+1]=m,e[t+2]=v,e[t+3]=g;return}if(f!==g||c!==h||l!==m||u!==v){let x=1-o,p=c*h+l*m+u*v+f*g,d=p>=0?1:-1,w=1-p*p;if(w>Number.EPSILON){let z=Math.sqrt(w),L=Math.atan2(z,p*d);x=Math.sin(x*L)/z,o=Math.sin(o*L)/z}let b=o*d;if(c=c*x+h*b,l=l*x+m*b,u=u*x+v*b,f=f*x+g*b,x===1-o){let z=1/Math.sqrt(c*c+l*l+u*u+f*f);c*=z,l*=z,u*=z,f*=z}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,a,r,s){let o=i[a],c=i[a+1],l=i[a+2],u=i[a+3],f=r[s],h=r[s+1],m=r[s+2],v=r[s+3];return e[t]=o*v+u*f+c*m-l*h,e[t+1]=c*v+u*h+l*f-o*m,e[t+2]=l*v+u*m+o*h-c*f,e[t+3]=u*v-o*f-c*h-l*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,a){return this._x=e,this._y=t,this._z=i,this._w=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let i=e._x,a=e._y,r=e._z,s=e._order,o=Math.cos,c=Math.sin,l=o(i/2),u=o(a/2),f=o(r/2),h=c(i/2),m=c(a/2),v=c(r/2);switch(s){case"XYZ":this._x=h*u*f+l*m*v,this._y=l*m*f-h*u*v,this._z=l*u*v+h*m*f,this._w=l*u*f-h*m*v;break;case"YXZ":this._x=h*u*f+l*m*v,this._y=l*m*f-h*u*v,this._z=l*u*v-h*m*f,this._w=l*u*f+h*m*v;break;case"ZXY":this._x=h*u*f-l*m*v,this._y=l*m*f+h*u*v,this._z=l*u*v+h*m*f,this._w=l*u*f-h*m*v;break;case"ZYX":this._x=h*u*f-l*m*v,this._y=l*m*f+h*u*v,this._z=l*u*v-h*m*f,this._w=l*u*f+h*m*v;break;case"YZX":this._x=h*u*f+l*m*v,this._y=l*m*f+h*u*v,this._z=l*u*v-h*m*f,this._w=l*u*f-h*m*v;break;case"XZY":this._x=h*u*f-l*m*v,this._y=l*m*f-h*u*v,this._z=l*u*v+h*m*f,this._w=l*u*f+h*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],a=t[4],r=t[8],s=t[1],o=t[5],c=t[9],l=t[2],u=t[6],f=t[10],h=i+o+f;if(h>0){let m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(u-c)*m,this._y=(r-l)*m,this._z=(s-a)*m}else if(i>o&&i>f){let m=2*Math.sqrt(1+i-o-f);this._w=(u-c)/m,this._x=.25*m,this._y=(a+s)/m,this._z=(r+l)/m}else if(o>f){let m=2*Math.sqrt(1+o-i-f);this._w=(r-l)/m,this._x=(a+s)/m,this._y=.25*m,this._z=(c+u)/m}else{let m=2*Math.sqrt(1+f-i-o);this._w=(s-a)/m,this._x=(r+l)/m,this._y=(c+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(T2(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let a=Math.min(1,t/i);return this.slerp(e,a),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,a=e._y,r=e._z,s=e._w,o=t._x,c=t._y,l=t._z,u=t._w;return this._x=i*u+s*o+a*l-r*c,this._y=a*u+s*c+r*o-i*l,this._z=r*u+s*l+i*c-a*o,this._w=s*u-i*o-a*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,a=this._y,r=this._z,s=this._w,o=s*e._w+i*e._x+a*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=a,this._z=r,this;let c=1-o*o;if(c<=Number.EPSILON){let m=1-t;return this._w=m*s+t*this._w,this._x=m*i+t*this._x,this._y=m*a+t*this._y,this._z=m*r+t*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(c),u=Math.atan2(l,o),f=Math.sin((1-t)*u)/l,h=Math.sin(t*u)/l;return this._w=s*f+this._w*h,this._x=i*f+this._x*h,this._y=a*f+this._y*h,this._z=r*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),a=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(a),i*Math.sin(r),i*Math.cos(r),t*Math.sin(a))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};be.prototype.isQuaternion=!0;var U=class{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Hr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Hr.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*a,this.y=r[1]*t+r[4]*i+r[7]*a,this.z=r[2]*t+r[5]*i+r[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,a=this.z,r=e.elements,s=1/(r[3]*t+r[7]*i+r[11]*a+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*a+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*a+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*a+r[14])*s,this}applyQuaternion(e){let t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z,c=e.w,l=c*t+s*a-o*i,u=c*i+o*t-r*a,f=c*a+r*i-s*t,h=-r*t-s*i-o*a;return this.x=l*c+h*-r+u*-o-f*-s,this.y=u*c+h*-s+f*-r-l*-o,this.z=f*c+h*-o+l*-s-u*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*a,this.y=r[1]*t+r[5]*i+r[9]*a,this.z=r[2]*t+r[6]*i+r[10]*a,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,a=e.y,r=e.z,s=t.x,o=t.y,c=t.z;return this.x=a*c-r*o,this.y=r*s-i*c,this.z=i*o-a*s,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return a3.copy(this).projectOnVector(e),this.sub(a3)}reflect(e){return this.sub(a3.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(T2(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return t*t+i*i+a*a}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let a=Math.sin(t)*e;return this.x=a*Math.sin(i),this.y=Math.cos(t)*e,this.z=a*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=a,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};U.prototype.isVector3=!0;var a3=new U,Hr=new be;var A1=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6],this.y=a[1]*t+a[4]*i+a[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),a=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*i-s*a+e.x,this.y=r*a+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};A1.prototype.isVector2=!0;var Vr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},J2={h:0,s:0,l:0},S6={h:0,s:0,l:0};function r3(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function At(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function n3(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}var M1=class{constructor(e,t,i){return t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=Dr(e,1),t=T2(t,0,1),i=T2(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,r=2*i-a;this.r=r3(r,a,e+1/3),this.g=r3(r,a,e),this.b=r3(r,a,e-1/3)}return this}setStyle(e){function t(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let a,r=i[1],s=i[2];switch(r){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,t(a[4]),this;if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,t(a[4]),this;break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){let o=parseFloat(a[1])/360,c=parseInt(a[2],10)/100,l=parseInt(a[3],10)/100;return t(a[4]),this.setHSL(o,c,l)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=i[1],r=a.length;if(r===3)return this.r=parseInt(a.charAt(0)+a.charAt(0),16)/255,this.g=parseInt(a.charAt(1)+a.charAt(1),16)/255,this.b=parseInt(a.charAt(2)+a.charAt(2),16)/255,this;if(r===6)return this.r=parseInt(a.charAt(0)+a.charAt(1),16)/255,this.g=parseInt(a.charAt(2)+a.charAt(3),16)/255,this.b=parseInt(a.charAt(4)+a.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=Vr[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=At(e.r),this.g=At(e.g),this.b=At(e.b),this}copyLinearToSRGB(e){return this.r=n3(e.r),this.g=n3(e.g),this.b=n3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,i=this.g,a=this.b,r=Math.max(t,i,a),s=Math.min(t,i,a),o,c,l=(s+r)/2;if(s===r)o=0,c=0;else{let u=r-s;switch(c=l<=.5?u/(r+s):u/(2-r-s),r){case t:o=(i-a)/u+(ir&&(r=u),f>s&&(s=f),h>o&&(o=h)}return this.min.set(t,i,a),this.max.set(r,s,o),this}setFromBufferAttribute(e){let t=1/0,i=1/0,a=1/0,r=-1/0,s=-1/0,o=-1/0;for(let c=0,l=e.count;cr&&(r=u),f>s&&(s=f),h>o&&(o=h)}return this.min.set(t,i,a),this.max.set(r,s,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,_t),_t.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(k4),P6.subVectors(this.max,k4),Xt.subVectors(e.a,k4),Zt.subVectors(e.b,k4),Yt.subVectors(e.c,k4),ot.subVectors(Zt,Xt),ct.subVectors(Yt,Zt),Et.subVectors(Xt,Yt);let t=[0,-ot.z,ot.y,0,-ct.z,ct.y,0,-Et.z,Et.y,ot.z,0,-ot.x,ct.z,0,-ct.x,Et.z,0,-Et.x,-ot.y,ot.x,0,-ct.y,ct.x,0,-Et.y,Et.x,0];return!I3(t,Xt,Zt,Yt,P6)||(t=[1,0,0,0,1,0,0,0,1],!I3(t,Xt,Zt,Yt,P6))?!1:(I6.crossVectors(ot,ct),t=[I6.x,I6.y,I6.z],I3(t,Xt,Zt,Yt,P6))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return _t.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(_t).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(qe[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),qe[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),qe[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),qe[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),qe[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),qe[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),qe[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),qe[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(qe),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Ge.prototype.isBox3=!0;var qe=[new U,new U,new U,new U,new U,new U,new U,new U],_t=new U,P3=new Ge,Xt=new U,Zt=new U,Yt=new U,ot=new U,ct=new U,Et=new U,k4=new U,P6=new U,I6=new U,Lt=new U;function I3(n,e,t,i,a){for(let r=0,s=n.length-3;r<=s;r+=3){Lt.fromArray(n,r);let o=a.x*Math.abs(Lt.x)+a.y*Math.abs(Lt.y)+a.z*Math.abs(Lt.z),c=e.dot(Lt),l=t.dot(Lt),u=i.dot(Lt);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>o)return!1}return!0}var B2=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let a=this._listeners[e];if(a!==void 0){let r=a.indexOf(t);r!==-1&&a.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let a=i.slice(0);for(let r=0,s=a.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){k3.subVectors(e,this.center);let t=k3.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.add(k3.multiplyScalar(a/i)),this.radius+=a}return this}union(e){return this.center.equals(e.center)===!0?k6.set(0,0,1).multiplyScalar(e.radius):k6.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(D8.copy(e.center).add(k6)),this.expandByPoint(D8.copy(e.center).sub(k6)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};var U1=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,a,r,s,o,c,l,u,f,h,m,v,g,x){let p=this.elements;return p[0]=e,p[4]=t,p[8]=i,p[12]=a,p[1]=r,p[5]=s,p[9]=o,p[13]=c,p[2]=l,p[6]=u,p[10]=f,p[14]=h,p[3]=m,p[7]=v,p[11]=g,p[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new U1().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,a=1/$t.setFromMatrixColumn(e,0).length(),r=1/$t.setFromMatrixColumn(e,1).length(),s=1/$t.setFromMatrixColumn(e,2).length();return t[0]=i[0]*a,t[1]=i[1]*a,t[2]=i[2]*a,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,i=e.x,a=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),c=Math.cos(a),l=Math.sin(a),u=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){let h=s*u,m=s*f,v=o*u,g=o*f;t[0]=c*u,t[4]=-c*f,t[8]=l,t[1]=m+v*l,t[5]=h-g*l,t[9]=-o*c,t[2]=g-h*l,t[6]=v+m*l,t[10]=s*c}else if(e.order==="YXZ"){let h=c*u,m=c*f,v=l*u,g=l*f;t[0]=h+g*o,t[4]=v*o-m,t[8]=s*l,t[1]=s*f,t[5]=s*u,t[9]=-o,t[2]=m*o-v,t[6]=g+h*o,t[10]=s*c}else if(e.order==="ZXY"){let h=c*u,m=c*f,v=l*u,g=l*f;t[0]=h-g*o,t[4]=-s*f,t[8]=v+m*o,t[1]=m+v*o,t[5]=s*u,t[9]=g-h*o,t[2]=-s*l,t[6]=o,t[10]=s*c}else if(e.order==="ZYX"){let h=s*u,m=s*f,v=o*u,g=o*f;t[0]=c*u,t[4]=v*l-m,t[8]=h*l+g,t[1]=c*f,t[5]=g*l+h,t[9]=m*l-v,t[2]=-l,t[6]=o*c,t[10]=s*c}else if(e.order==="YZX"){let h=s*c,m=s*l,v=o*c,g=o*l;t[0]=c*u,t[4]=g-h*f,t[8]=v*f+m,t[1]=f,t[5]=s*u,t[9]=-o*u,t[2]=-l*u,t[6]=m*f+v,t[10]=h-g*f}else if(e.order==="XZY"){let h=s*c,m=s*l,v=o*c,g=o*l;t[0]=c*u,t[4]=-f,t[8]=l*u,t[1]=h*f+g,t[5]=s*u,t[9]=m*f-v,t[2]=v*f-m,t[6]=o*u,t[10]=g*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(d9,e,p9)}lookAt(e,t,i){let a=this.elements;return P2.subVectors(e,t),P2.lengthSq()===0&&(P2.z=1),P2.normalize(),lt.crossVectors(i,P2),lt.lengthSq()===0&&(Math.abs(i.z)===1?P2.x+=1e-4:P2.z+=1e-4,P2.normalize(),lt.crossVectors(i,P2)),lt.normalize(),U6.crossVectors(P2,lt),a[0]=lt.x,a[4]=U6.x,a[8]=P2.x,a[1]=lt.y,a[5]=U6.y,a[9]=P2.y,a[2]=lt.z,a[6]=U6.z,a[10]=P2.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[4],c=i[8],l=i[12],u=i[1],f=i[5],h=i[9],m=i[13],v=i[2],g=i[6],x=i[10],p=i[14],d=i[3],w=i[7],b=i[11],z=i[15],L=a[0],H=a[4],E=a[8],I=a[12],B=a[1],M=a[5],T=a[9],A=a[13],V=a[2],N=a[6],D=a[10],R=a[14],O=a[3],Y=a[7],G=a[11],j=a[15];return r[0]=s*L+o*B+c*V+l*O,r[4]=s*H+o*M+c*N+l*Y,r[8]=s*E+o*T+c*D+l*G,r[12]=s*I+o*A+c*R+l*j,r[1]=u*L+f*B+h*V+m*O,r[5]=u*H+f*M+h*N+m*Y,r[9]=u*E+f*T+h*D+m*G,r[13]=u*I+f*A+h*R+m*j,r[2]=v*L+g*B+x*V+p*O,r[6]=v*H+g*M+x*N+p*Y,r[10]=v*E+g*T+x*D+p*G,r[14]=v*I+g*A+x*R+p*j,r[3]=d*L+w*B+b*V+z*O,r[7]=d*H+w*M+b*N+z*Y,r[11]=d*E+w*T+b*D+z*G,r[15]=d*I+w*A+b*R+z*j,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],a=e[8],r=e[12],s=e[1],o=e[5],c=e[9],l=e[13],u=e[2],f=e[6],h=e[10],m=e[14],v=e[3],g=e[7],x=e[11],p=e[15];return v*(+r*c*f-a*l*f-r*o*h+i*l*h+a*o*m-i*c*m)+g*(+t*c*m-t*l*h+r*s*h-a*s*m+a*l*u-r*c*u)+x*(+t*l*f-t*o*m-r*s*f+i*s*m+r*o*u-i*l*u)+p*(-a*o*u-t*c*f+t*o*h+a*s*f-i*s*h+i*c*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=t,a[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],m=e[11],v=e[12],g=e[13],x=e[14],p=e[15],d=f*x*l-g*h*l+g*c*m-o*x*m-f*c*p+o*h*p,w=v*h*l-u*x*l-v*c*m+s*x*m+u*c*p-s*h*p,b=u*g*l-v*f*l+v*o*m-s*g*m-u*o*p+s*f*p,z=v*f*c-u*g*c-v*o*h+s*g*h+u*o*x-s*f*x,L=t*d+i*w+a*b+r*z;if(L===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let H=1/L;return e[0]=d*H,e[1]=(g*h*r-f*x*r-g*a*m+i*x*m+f*a*p-i*h*p)*H,e[2]=(o*x*r-g*c*r+g*a*l-i*x*l-o*a*p+i*c*p)*H,e[3]=(f*c*r-o*h*r-f*a*l+i*h*l+o*a*m-i*c*m)*H,e[4]=w*H,e[5]=(u*x*r-v*h*r+v*a*m-t*x*m-u*a*p+t*h*p)*H,e[6]=(v*c*r-s*x*r-v*a*l+t*x*l+s*a*p-t*c*p)*H,e[7]=(s*h*r-u*c*r+u*a*l-t*h*l-s*a*m+t*c*m)*H,e[8]=b*H,e[9]=(v*f*r-u*g*r-v*i*m+t*g*m+u*i*p-t*f*p)*H,e[10]=(s*g*r-v*o*r+v*i*l-t*g*l-s*i*p+t*o*p)*H,e[11]=(u*o*r-s*f*r-u*i*l+t*f*l+s*i*m-t*o*m)*H,e[12]=z*H,e[13]=(u*g*a-v*f*a+v*i*h-t*g*h-u*i*x+t*f*x)*H,e[14]=(v*o*a-s*g*a-v*i*c+t*g*c+s*i*x-t*o*x)*H,e[15]=(s*f*a-u*o*a+u*i*c-t*f*c-s*i*h+t*o*h)*H,this}scale(e){let t=this.elements,i=e.x,a=e.y,r=e.z;return t[0]*=i,t[4]*=a,t[8]*=r,t[1]*=i,t[5]*=a,t[9]*=r,t[2]*=i,t[6]*=a,t[10]*=r,t[3]*=i,t[7]*=a,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,a))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),a=Math.sin(t),r=1-i,s=e.x,o=e.y,c=e.z,l=r*s,u=r*o;return this.set(l*s+i,l*o-a*c,l*c+a*o,0,l*o+a*c,u*o+i,u*c-a*s,0,l*c-a*o,u*c+a*s,r*c*c+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,a,r,s){return this.set(1,i,r,0,e,1,s,0,t,a,1,0,0,0,0,1),this}compose(e,t,i){let a=this.elements,r=t._x,s=t._y,o=t._z,c=t._w,l=r+r,u=s+s,f=o+o,h=r*l,m=r*u,v=r*f,g=s*u,x=s*f,p=o*f,d=c*l,w=c*u,b=c*f,z=i.x,L=i.y,H=i.z;return a[0]=(1-(g+p))*z,a[1]=(m+b)*z,a[2]=(v-w)*z,a[3]=0,a[4]=(m-b)*L,a[5]=(1-(h+p))*L,a[6]=(x+d)*L,a[7]=0,a[8]=(v+w)*H,a[9]=(x-d)*H,a[10]=(1-(h+g))*H,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,t,i){let a=this.elements,r=$t.set(a[0],a[1],a[2]).length(),s=$t.set(a[4],a[5],a[6]).length(),o=$t.set(a[8],a[9],a[10]).length();this.determinant()<0&&(r=-r),e.x=a[12],e.y=a[13],e.z=a[14],ie.copy(this);let l=1/r,u=1/s,f=1/o;return ie.elements[0]*=l,ie.elements[1]*=l,ie.elements[2]*=l,ie.elements[4]*=u,ie.elements[5]*=u,ie.elements[6]*=u,ie.elements[8]*=f,ie.elements[9]*=f,ie.elements[10]*=f,t.setFromRotationMatrix(ie),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,a,r,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let o=this.elements,c=2*r/(t-e),l=2*r/(i-a),u=(t+e)/(t-e),f=(i+a)/(i-a),h=-(s+r)/(s-r),m=-2*s*r/(s-r);return o[0]=c,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=f,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=m,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,i,a,r,s){let o=this.elements,c=1/(t-e),l=1/(i-a),u=1/(s-r),f=(t+e)*c,h=(i+a)*l,m=(s+r)*u;return o[0]=2*c,o[4]=0,o[8]=0,o[12]=-f,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-m,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let a=0;a<16;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};U1.prototype.isMatrix4=!0;var $t=new U,ie=new U1,d9=new U(0,0,0),p9=new U(1,1,1),lt=new U,U6=new U,P2=new U;var T8=new U1,H8=new be,ut=class{constructor(e=0,t=0,i=0,a=ut.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=a}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,a=this._order){return this._x=e,this._y=t,this._z=i,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let a=e.elements,r=a[0],s=a[4],o=a[8],c=a[1],l=a[5],u=a[9],f=a[2],h=a[6],m=a[10];switch(t){case"XYZ":this._y=Math.asin(T2(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-T2(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(T2(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-T2(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(T2(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-T2(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return T8.makeRotationFromQuaternion(e),this.setFromRotationMatrix(T8,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return H8.setFromEuler(this),this.setFromQuaternion(H8,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new U(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};ut.prototype.isEuler=!0;ut.DefaultOrder="XYZ";ut.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var U4=class{constructor(){this.mask=1|0}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,a,r,s,o,c,l){let u=this.elements;return u[0]=e,u[1]=a,u[2]=o,u[3]=t,u[4]=r,u[5]=c,u[6]=i,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[3],c=i[6],l=i[1],u=i[4],f=i[7],h=i[2],m=i[5],v=i[8],g=a[0],x=a[3],p=a[6],d=a[1],w=a[4],b=a[7],z=a[2],L=a[5],H=a[8];return r[0]=s*g+o*d+c*z,r[3]=s*x+o*w+c*L,r[6]=s*p+o*b+c*H,r[1]=l*g+u*d+f*z,r[4]=l*x+u*w+f*L,r[7]=l*p+u*b+f*H,r[2]=h*g+m*d+v*z,r[5]=h*x+m*w+v*L,r[8]=h*p+m*b+v*H,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],l=e[7],u=e[8];return t*s*u-t*o*l-i*r*u+i*o*c+a*r*l-a*s*c}invert(){let e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],l=e[7],u=e[8],f=u*s-o*l,h=o*c-u*r,m=l*r-s*c,v=t*f+i*h+a*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/v;return e[0]=f*g,e[1]=(a*l-u*i)*g,e[2]=(o*i-a*s)*g,e[3]=h*g,e[4]=(u*t-a*c)*g,e[5]=(a*r-o*t)*g,e[6]=m*g,e[7]=(i*c-l*t)*g,e[8]=(s*t-i*r)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,a,r,s,o){let c=Math.cos(r),l=Math.sin(r);return this.set(i*c,i*l,-i*(c*s+l*o)+s+e,-a*l,a*c,-a*(-l*s+c*o)+o+t,0,0,1),this}scale(e,t){let i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),a=this.elements,r=a[0],s=a[3],o=a[6],c=a[1],l=a[4],u=a[7];return a[0]=t*r+i*c,a[3]=t*s+i*l,a[6]=t*o+i*u,a[1]=-i*r+t*c,a[4]=-i*s+t*l,a[7]=-i*o+t*u,this}translate(e,t){let i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){let t=this.elements,i=e.elements;for(let a=0;a<9;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};s2.prototype.isMatrix3=!0;var m9=0,V8=new U,Kt=new be,je=new U1,O6=new U,O4=new U,v9=new U,g9=new be,N8=new U(1,0,0),R8=new U(0,1,0),F8=new U(0,0,1),x9={type:"added"},B8={type:"removed"},X1=class extends B2{constructor(){super();Object.defineProperty(this,"id",{value:m9++}),this.uuid=Ie(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=X1.DefaultUp.clone();let e=new U,t=new ut,i=new be,a=new U(1,1,1);function r(){i.setFromEuler(t,!1)}function s(){t.setFromQuaternion(i,void 0,!1)}t._onChange(r),i._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new U1},normalMatrix:{value:new s2}}),this.matrix=new U1,this.matrixWorld=new U1,this.matrixAutoUpdate=X1.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new U4,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Kt.setFromAxisAngle(e,t),this.quaternion.multiply(Kt),this}rotateOnWorldAxis(e,t){return Kt.setFromAxisAngle(e,t),this.quaternion.premultiply(Kt),this}rotateX(e){return this.rotateOnAxis(N8,e)}rotateY(e){return this.rotateOnAxis(R8,e)}rotateZ(e){return this.rotateOnAxis(F8,e)}translateOnAxis(e,t){return V8.copy(e).applyQuaternion(this.quaternion),this.position.add(V8.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(N8,e)}translateY(e){return this.translateOnAxis(R8,e)}translateZ(e){return this.translateOnAxis(F8,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(je.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?O6.copy(e):O6.set(e,t,i);let a=this.parent;this.updateWorldMatrix(!0,!1),O4.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?je.lookAt(O4,O6,this.up):je.lookAt(O6,O4,this.up),this.quaternion.setFromRotationMatrix(je),a&&(je.extractRotation(a.matrixWorld),Kt.setFromRotationMatrix(je),this.quaternion.premultiply(Kt.invert()))}add(e){if(arguments.length>1){for(let t=0;t1){for(let i=0;i0){a.children=[];for(let o=0;o0){a.animations=[];for(let o=0;o0&&(i.geometries=o),c.length>0&&(i.materials=c),l.length>0&&(i.textures=l),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),m.length>0&&(i.animations=m)}return i.object=a,i;function s(o){let c=[];for(let l in o){let u=o[l];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i=0;--e)if(n[e]>65535)return!0;return!1}function Dt(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}var M9=0,q2=new U1,U3=new X1,Jt=new U,I2=new Ge,G4=new Ge,l2=new U,y2=class extends B2{constructor(){super();Object.defineProperty(this,"id",{value:M9++}),this.uuid=Ie(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(G6(e)?I4:P4)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(i!==void 0){let r=new s2().getNormalMatrix(e);i.applyNormalMatrix(r),i.needsUpdate=!0}let a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(e),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return q2.makeRotationFromQuaternion(e),this.applyMatrix4(q2),this}rotateX(e){return q2.makeRotationX(e),this.applyMatrix4(q2),this}rotateY(e){return q2.makeRotationY(e),this.applyMatrix4(q2),this}rotateZ(e){return q2.makeRotationZ(e),this.applyMatrix4(q2),this}translate(e,t,i){return q2.makeTranslation(e,t,i),this.applyMatrix4(q2),this}scale(e,t,i){return q2.makeScale(e,t,i),this.applyMatrix4(q2),this}lookAt(e){return U3.lookAt(e),U3.updateMatrix(),this.applyMatrix4(U3.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Jt).negate(),this.translate(Jt.x,Jt.y,Jt.z),this}setFromPoints(e){let t=[];for(let i=0,a=e.length;i0&&(e.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let c in i){let l=i[c];e.data.attributes[c]=l.toJSON(e.data)}let a={},r=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],u=[];for(let f=0,h=l.length;f0&&(a[c]=u,r=!0)}r&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let a=e.attributes;for(let l in a){let u=a[l];this.setAttribute(l,u.clone(t))}let r=e.morphAttributes;for(let l in r){let u=[],f=r[l];for(let h=0,m=f.length;h0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===Br;continue}let a=this[t];if(a===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==St&&(i.blending=this.blending),this.side!==ke&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.alphaWrite=this.alphaWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData);function a(r){let s=[];for(let o in r){let c=r[o];delete c.metadata,s.push(c)}return s}if(t){let r=a(e.textures),s=a(e.images);r.length>0&&(i.textures=r),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let a=t.length;i=new Array(a);for(let r=0;r!==a;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.alphaWrite=e.alphaWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};H2.prototype.isMaterial=!0;var q4=class extends H2{constructor(e){super();this.type="MeshPhongMaterial",this.color=new M1(16777215),this.specular=new M1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new M1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=R6,this.normalScale=new A1(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Wt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}};q4.prototype.isMeshPhongMaterial=!0;var Xe=new U,O3=new U,q6=new U,ht=new U,G3=new U,W6=new U,q3=new U,W3=class{constructor(e=new U,t=new U(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Xe)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Xe.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Xe.copy(this.direction).multiplyScalar(t).add(this.origin),Xe.distanceToSquared(e))}distanceSqToSegment(e,t,i,a){O3.copy(e).add(t).multiplyScalar(.5),q6.copy(t).sub(e).normalize(),ht.copy(this.origin).sub(O3);let r=e.distanceTo(t)*.5,s=-this.direction.dot(q6),o=ht.dot(this.direction),c=-ht.dot(q6),l=ht.lengthSq(),u=Math.abs(1-s*s),f,h,m,v;if(u>0)if(f=s*c-o,h=s*o-c,v=r*u,f>=0)if(h>=-v)if(h<=v){let g=1/u;f*=g,h*=g,m=f*(f+s*h+2*o)+h*(s*f+h+2*c)+l}else h=r,f=Math.max(0,-(s*h+o)),m=-f*f+h*(h+2*c)+l;else h=-r,f=Math.max(0,-(s*h+o)),m=-f*f+h*(h+2*c)+l;else h<=-v?(f=Math.max(0,-(-s*r+o)),h=f>0?-r:Math.min(Math.max(-r,-c),r),m=-f*f+h*(h+2*c)+l):h<=v?(f=0,h=Math.min(Math.max(-r,-c),r),m=h*(h+2*c)+l):(f=Math.max(0,-(s*r+o)),h=f>0?r:Math.min(Math.max(-r,-c),r),m=-f*f+h*(h+2*c)+l);else h=s>0?-r:r,f=Math.max(0,-(s*h+o)),m=-f*f+h*(h+2*c)+l;return i&&i.copy(this.direction).multiplyScalar(f).add(this.origin),a&&a.copy(q6).multiplyScalar(h).add(O3),m}intersectSphere(e,t){Xe.subVectors(e.center,this.origin);let i=Xe.dot(this.direction),a=Xe.dot(Xe)-i*i,r=e.radius*e.radius;if(a>r)return null;let s=Math.sqrt(r-a),o=i-s,c=i+s;return o<0&&c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,a,r,s,o,c,l=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,a=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,a=(e.min.x-h.x)*l),u>=0?(r=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),i>s||r>a||((r>i||i!==i)&&(i=r),(s=0?(o=(e.min.z-h.z)*f,c=(e.max.z-h.z)*f):(o=(e.max.z-h.z)*f,c=(e.min.z-h.z)*f),i>c||o>a)||((o>i||i!==i)&&(i=o),(c=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,Xe)!==null}intersectTriangle(e,t,i,a,r){G3.subVectors(t,e),W6.subVectors(i,e),q3.crossVectors(G3,W6);let s=this.direction.dot(q3),o;if(s>0){if(a)return null;o=1}else if(s<0)o=-1,s=-s;else return null;ht.subVectors(this.origin,e);let c=o*this.direction.dot(W6.crossVectors(ht,W6));if(c<0)return null;let l=o*this.direction.dot(G3.cross(ht));if(l<0||c+l>s)return null;let u=-o*ht.dot(q3);return u<0?null:this.at(u/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};var ae=new U,Ze=new U,j3=new U,Ye=new U,Qt=new U,e4=new U,P8=new U,X3=new U,Z3=new U,Y3=new U,re=class{constructor(e=new U,t=new U,i=new U){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,a){a.subVectors(i,t),ae.subVectors(e,t),a.cross(ae);let r=a.lengthSq();return r>0?a.multiplyScalar(1/Math.sqrt(r)):a.set(0,0,0)}static getBarycoord(e,t,i,a,r){ae.subVectors(a,t),Ze.subVectors(i,t),j3.subVectors(e,t);let s=ae.dot(ae),o=ae.dot(Ze),c=ae.dot(j3),l=Ze.dot(Ze),u=Ze.dot(j3),f=s*l-o*o;if(f===0)return r.set(-2,-1,-1);let h=1/f,m=(l*c-o*u)*h,v=(s*u-o*c)*h;return r.set(1-m-v,v,m)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,Ye),Ye.x>=0&&Ye.y>=0&&Ye.x+Ye.y<=1}static getUV(e,t,i,a,r,s,o,c){return this.getBarycoord(e,t,i,a,Ye),c.set(0,0),c.addScaledVector(r,Ye.x),c.addScaledVector(s,Ye.y),c.addScaledVector(o,Ye.z),c}static isFrontFacing(e,t,i,a){return ae.subVectors(i,t),Ze.subVectors(e,t),ae.cross(Ze).dot(a)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,a){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,t,i,a){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ae.subVectors(this.c,this.b),Ze.subVectors(this.a,this.b),ae.cross(Ze).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return re.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return re.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,a,r){return re.getUV(e,this.a,this.b,this.c,t,i,a,r)}containsPoint(e){return re.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return re.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,a=this.b,r=this.c,s,o;Qt.subVectors(a,i),e4.subVectors(r,i),X3.subVectors(e,i);let c=Qt.dot(X3),l=e4.dot(X3);if(c<=0&&l<=0)return t.copy(i);Z3.subVectors(e,a);let u=Qt.dot(Z3),f=e4.dot(Z3);if(u>=0&&f<=u)return t.copy(a);let h=c*f-u*l;if(h<=0&&c>=0&&u<=0)return s=c/(c-u),t.copy(i).addScaledVector(Qt,s);Y3.subVectors(e,r);let m=Qt.dot(Y3),v=e4.dot(Y3);if(v>=0&&m<=v)return t.copy(r);let g=m*l-c*v;if(g<=0&&l>=0&&v<=0)return o=l/(l-v),t.copy(i).addScaledVector(e4,o);let x=u*v-m*f;if(x<=0&&f-u>=0&&m-v>=0)return P8.subVectors(r,a),o=(f-u)/(f-u+(m-v)),t.copy(a).addScaledVector(P8,o);let p=1/(x+g+h);return s=g*p,o=h*p,t.copy(i).addScaledVector(Qt,s).addScaledVector(e4,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};var t4=class extends H2{constructor(e){super();this.type="MeshBasicMaterial",this.color=new M1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Wt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};t4.prototype.isMeshBasicMaterial=!0;var I8=new U1,i4=new W3,$3=new We,ft=new U,dt=new U,pt=new U,K3=new U,J3=new U,Q3=new U,j6=new U,X6=new U,Z6=new U,Y6=new A1,$6=new A1,K6=new A1,ei=new U,J6=new U,u2=class extends X1{constructor(e=new y2,t=new t4){super();this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;r0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let i=this.geometry,a=this.material,r=this.matrixWorld;if(a===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),$3.copy(i.boundingSphere),$3.applyMatrix4(r),e.ray.intersectsSphere($3)===!1)||(I8.copy(r).invert(),i4.copy(e.ray).applyMatrix4(I8),i.boundingBox!==null&&i4.intersectsBox(i.boundingBox)===!1))return;let s;if(i.isBufferGeometry){let o=i.index,c=i.attributes.position,l=i.morphAttributes.position,u=i.morphTargetsRelative,f=i.attributes.uv,h=i.attributes.uv2,m=i.groups,v=i.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=m.length;gt.far?null:{distance:l,point:J6.clone(),object:n}}function Q6(n,e,t,i,a,r,s,o,c,l,u,f){ft.fromBufferAttribute(a,l),dt.fromBufferAttribute(a,u),pt.fromBufferAttribute(a,f);let h=n.morphTargetInfluences;if(r&&h){j6.set(0,0,0),X6.set(0,0,0),Z6.set(0,0,0);for(let v=0,g=r.length;v2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){let t=Dt("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let a=i.getImageData(0,0,e.width,e.height),r=a.data;for(let s=0;s1)switch(this.wrapS){case R4:e.x=e.x-Math.floor(e.x);break;case c2:e.x=e.x<0?0:1;break;case F4:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case R4:e.y=e.y-Math.floor(e.y);break;case c2:e.y=e.y<0?0:1;break;case F4:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};J1.DEFAULT_IMAGE=void 0;J1.DEFAULT_MAPPING=f3;J1.prototype.isTexture=!0;function ti(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?W4.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var k8={specular:1515554,color:15790320,shininess:60,flatShading:!0},W2={diceColor:"#202020",textColor:"#ffffff"},ne=class{constructor(e,t,i={diceColor:"#202020",textColor:"#aaaaaa"}){this.w=e;this.h=t;this.options=i;C(this,"body");C(this,"chamferGeometry");C(this,"geometry");C(this,"scale",50);C(this,"shape");C(this,"labels",[" ","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]);C(this,"shapeData");C(this,"fontFace","Arial");C(this,"textureSize");this.options={...W2,...i}}setColor({diceColor:e,textColor:t}){e&&(this.options.diceColor=e),t&&(this.options.textColor=t)}get radius(){return this.scale*this.scaleFactor}get diceColor(){return this.options.diceColor}get textColor(){return this.options.textColor}get buffer(){return this.geometry.geometry}create(){this.textureSize=this.calculateTextureSize(this.scale/2+this.scale*this.margin)*2;let e=this.getGeometry(),t=this.getMaterials();return this.geometry=new u2(e,t),this.geometry.receiveShadow=!0,this.geometry.castShadow=!0,this.body.position.set(0+this.radius*2*Math.random(),0+this.radius*2*Math.random(),0+this.radius*4),this.body.velocity.x=500*Math.random()*2-1,this.body.velocity.y=500*Math.random()*2-1,this.body.angularVelocity.x=100*Math.random(),this.body.angularVelocity.y=100*Math.random(),this}getGeometry(){let e=new Array(this.vertices.length);for(let i=0;i=0&&u=0&&l!==c+1?o.unshift([r,l],[s,u]):o.push([r,l],[s,u]),c=l)}o.length===4&&i.push([i[o[0][0]][o[0][1]],i[o[1][0]][o[1][1]],i[o[3][0]][o[3][1]],i[o[2][0]][o[2][1]],-1])}for(let r=0;r=0&&u<4){--u==-1&&(u=3);let f=i[l][u];if(s.indexOf(f)>=0){o.push(f);break}}}--c}o.push(-1),i.push(o)}return{vectors:t,faces:i}}makeGeometry(e,t){let i=new y2;for(let f=0;f1&&(o=o/l.length,s.font=`${o}pt '${this.fontFace}'`,c=s.measureText("M").width*1.2,a-=c*l.length/2);for(let f=0,h=l.length;f ${this.block}`);let e=this.cache.sections?.find(a=>a.position==this.cache.blocks[this.block].position),t=this.cache.blocks[this.block].position,i=await this.plugin.app.vault.cachedRead(this.file);if(this.content=i.slice(t.start.offset,t.end.offset),e&&e.type==="list")this.options=this.content.split(` +`);else{let a=Uc(this.content);if(a.columns.size===2&&/dice:\s*([\s\S]+)\s*?/.test(Array.from(a.columns.keys())[0])){let r=await this.plugin.getRoller(Array.from(a.columns.keys())[0].split(":").pop(),this.source);r instanceof S2&&(this.lookupRoller=r,this.lookupRanges=a.rows.map(s=>{let[o,c]=s.replace(/\\\|/g,"{ESCAPED_PIPE}").split("|").map(f=>f.replace(/{ESCAPED_PIPE}/g,"\\|")).map(f=>f.trim()),[,l,u]=o.match(/(\d+)(?:[^\d]+?(\d+))?/)??[];if(!(!l&&!u))return[[Number(l),u?Number(u):void 0],c]}),this.isLookup=!0)}if(this.header==="xy"&&!a.columns.has("xy")){this.options=[];for(let r of Array.from(a.columns.values()).slice(1))this.options.push(...r)}else if(this.header&&a.columns.has(this.header))this.options=a.columns.get(this.header);else{if(this.header)throw new Error(`Header ${this.header} was not found in table ${this.path} > ${this.block}.`);this.options=a.rows}}this.loaded=!0,this.trigger("loaded")}toResult(){return{type:"table",result:this.result}}async applyResult(e){e.type==="table"&&(e.result&&(this.result=e.result),await this.render())}},kc=/^\|?([\s\S]+?)\|?$/,_a=/\|/g;function Uc(n){let e=n.split(` +`),i=e.map(s=>(s.trim().match(kc)??[,s.trim()])[1])[0].replace("\\|","{ESCAPED_PIPE}").split(_a),a=[],r=[];for(let s in i){let o=i[s];o.trim().length||(o=s),r.push([o.trim(),[]])}for(let s of e.slice(2)){let o=s.trim().replace(/\\\|/g,"{ESCAPED_PIPE}").split(_a).map(c=>c.replace(/{ESCAPED_PIPE}/g,"\\|")).map(c=>c.trim()).filter(c=>c.length);a.push(o.join(" | "));for(let c in o){let l=o[c].trim();!l.length||!r[c]||r[c][1].push(l)}}return{columns:new Map(r),rows:a}}var S1=w2(require("obsidian"));var f6=class extends S1.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t;this.plugin=t}async display(){let{containerEl:e}=this;e.empty(),e.addClass("dice-roller-settings"),e.createEl("h2",{text:"Dice Roller Settings"}),this.buildGenerics(e.createDiv()),this.buildDisplay(e.createDiv()),this.buildDice(e.createDiv()),this.buildTables(e.createDiv()),this.buildSections(e.createDiv()),this.buildTags(e.createDiv()),this.buildView(e.createDiv()),this.buildRender(e.createDiv()),this.buildFormulaSettings(e.createDiv("dice-roller-setting-additional-container")),e.createDiv("coffee").createEl("a",{href:"https://www.buymeacoffee.com/valentine195"}).createEl("img",{attr:{src:"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=\u2615&slug=valentine195&button_colour=e3e7ef&font_colour=262626&font_family=Inter&outline_colour=262626&coffee_colour=ff0000"}})}buildGenerics(e){e.empty(),new S1.Setting(e).setName("Globally Save Results").setDesc(createFragment(t=>{t.createSpan({text:"Dice results will be saved by default. This can be overridden using "}),t.createEl("code",{text:"dice-: formula"}),t.createEl("p",{text:"Please note that the plugin will attempt to save the result but may not be able to."})})).addToggle(t=>{t.setValue(this.plugin.data.persistResults),t.onChange(async i=>{this.plugin.data.persistResults=i,await this.plugin.saveSettings()})})}buildDisplay(e){e.empty(),new S1.Setting(e).setHeading().setName("Dice Display"),new S1.Setting(e).setName("Display Formula With Results").setDesc("Both the formula and the results will both be displayed in preview mode.").addToggle(t=>{t.setValue(this.plugin.data.displayResultsInline),t.onChange(async i=>{this.plugin.data.displayResultsInline=i,await this.plugin.saveSettings()})}),new S1.Setting(e).setName("Display Dice Button With Results").setDesc("A dice button will appear next to results.").addToggle(t=>{t.setValue(this.plugin.data.showDice),t.onChange(async i=>{this.plugin.data.showDice=i,await this.plugin.saveSettings()})}),new S1.Setting(e).setName("Add Formula When Using Modify Dice").setDesc(createFragment(t=>{t.createSpan({text:"Both the formula and the results will both be added to the note when using "}),t.createEl("code",{text:"dice-mod"}),t.createSpan({text:"."})})).addToggle(t=>{t.setValue(this.plugin.data.displayFormulaForMod),t.onChange(async i=>{this.plugin.data.displayFormulaForMod=i,await this.plugin.saveSettings()})}),new S1.Setting(e).setName("Display Formula in Parentheses After").setDesc(createFragment(t=>{t.createSpan({text:"For example, "}),t.createEl("code",{text:"`dice: 1d6`"}),t.createSpan({text:" will become "});let i=t.createSpan("dice-roller");i.createSpan({cls:"dice-roller-result",text:"3"}),(0,S1.setIcon)(i.createSpan("dice-roller-button"),Y2),t.createSpan({text:" (1d6). This only affects Dice Rollers."})})).addToggle(t=>{t.setValue(this.plugin.data.displayFormulaAfter),t.onChange(async i=>{this.plugin.data.displayFormulaAfter=i,await this.plugin.saveSettings()})})}buildDice(e){e.empty(),new S1.Setting(e).setHeading().setName("Dice Rollers"),new S1.Setting(e).setName("Default Face").setDesc("Use this as the number of faces when it is omitted.").addText(t=>{t.setValue(`${this.plugin.data.defaultFace}`),t.inputEl.onblur=async()=>{isNaN(Number(t.inputEl.value))&&new S1.Notice("The default face must be a number."),this.plugin.data.defaultFace=Number(t.inputEl.value),await this.plugin.saveSettings()}}),new S1.Setting(e).setName("Round Results").setDesc("Determine the rounding behavior for dice results.").addDropdown(t=>{t.addOptions(pe).setValue(this.plugin.data.round).onChange(i=>{this.plugin.data.round=i,this.plugin.saveSettings()})}),new S1.Setting(e).setName("Always Render Dice").setDesc(createFragment(t=>{t.createSpan({text:"Dice rolled in notes will always be rendered. Use the "}),t.createEl("code",{text:"|norender"}),t.createSpan({text:" flag to prevent it."})})).addToggle(t=>{t.setValue(this.plugin.data.renderAllDice).onChange(i=>{this.plugin.data.renderAllDice=i,this.plugin.saveSettings()})})}buildTables(e){e.empty(),new S1.Setting(e).setHeading().setName("Table Rollers"),new S1.Setting(e).setName("Display Lookup Table Roll").setDesc("Lookup table rolls will display the rolled number along with the result.").addToggle(t=>{t.setValue(this.plugin.data.displayLookupRoll),t.onChange(async i=>{this.plugin.data.displayLookupRoll=i,await this.plugin.saveSettings()})})}buildSections(e){e.empty(),new S1.Setting(e).setHeading().setName("Section Rollers"),new S1.Setting(e).setName("Add Copy Button to Section Results").setDesc("Randomly rolled sections will have a copy-content button to easy add result to clipboard.").addToggle(t=>{t.setValue(this.plugin.data.copyContentButton),t.onChange(async i=>{this.plugin.data.copyContentButton=i,await this.plugin.saveSettings()})}),new S1.Setting(e).setName("Display As Embeds").setDesc("Sections returned from Section & Tag Rollers will display as embedded fields.").addToggle(t=>{t.setValue(this.plugin.data.displayAsEmbed),t.onChange(async i=>{this.plugin.data.displayAsEmbed=i,await this.plugin.saveSettings()})})}buildTags(e){e.empty(),new S1.Setting(e).setHeading().setName("Tag Rollers"),new S1.Setting(e).setName("Roll All Files for Tags").setDesc("Return a result for each file when rolling tags.").addToggle(t=>{t.setValue(this.plugin.data.returnAllTags),t.onChange(async i=>{this.plugin.data.returnAllTags=i,await this.plugin.saveSettings()})}),new S1.Setting(e).setName("Always Return Links for Tags").setDesc("Enables random link rolling with the link parameter. Override by specifying a section type.").addToggle(t=>{t.setValue(this.plugin.data.rollLinksForTags),t.onChange(async i=>{this.plugin.data.rollLinksForTags=i,await this.plugin.saveSettings()})})}buildView(e){e.empty(),new S1.Setting(e).setHeading().setName("Dice View"),new S1.Setting(e).setName("Open Dice View on Startup").setDesc("The dice view can always be opened using the command from the command palette.").addToggle(t=>{t.setValue(this.plugin.data.showLeafOnStartup),t.onChange(async i=>{this.plugin.data.showLeafOnStartup=i,await this.plugin.saveSettings()})})}buildRender(e){e.empty(),new S1.Setting(e).setHeading().setName("Graphical Dice"),new S1.Setting(e).setName("Display graphics for Dice View Rolls").setDesc("Dice rolls from dice view will be displayed on screen.").addToggle(a=>{a.setValue(this.plugin.data.renderer),a.onChange(async r=>{this.plugin.data.renderer=r,await this.plugin.saveSettings()})}),new S1.Setting(e).setName("Display Time for Dice Graphics").setDesc("Rendered dice will stay on screen for this number of milliseconds. Leave blank to require a click to clear dice.").addText(a=>{a.inputEl.setAttr("type","number"),a.inputEl.onblur=r=>{Number(a.getValue())<0&&(new S1.Notice("Render time cannot be less than 0."),a.setValue("0"))},a.setValue(`${this.plugin.data.renderTime}`),a.onChange(async r=>{r&&Number(r)<0||isNaN(Number(r))||(this.plugin.data.renderTime=Number(r),await this.plugin.saveSettings())})}).addExtraButton(a=>{a.setIcon("reset").setTooltip("Reset to Default").onClick(async()=>{this.plugin.data.renderTime=d6.renderTime,await this.plugin.saveSettings(),this.buildRender(e)})}),new S1.Setting(e).setName("Dice Base Color").setDesc("Rendered dice will be this color.").controlEl.createEl("input",{type:"color",value:this.plugin.data.diceColor},a=>{a.value=this.plugin.data.diceColor,a.onchange=async({target:r})=>{let s=r.value;this.plugin.data.diceColor=s,await this.plugin.saveSettings(),this.plugin.app.workspace.trigger("dice-roller:update-colors")}}),new S1.Setting(e).setName("Dice Text Color").setDesc("Rendered dice will use this color for their numbers.").controlEl.createEl("input",{type:"color",value:this.plugin.data.textColor},a=>{a.value=this.plugin.data.textColor,a.onchange=async({target:r})=>{let s=r.value;!s||(this.plugin.data.textColor=s,await this.plugin.saveSettings(),this.plugin.app.workspace.trigger("dice-roller:update-colors"))}})}buildFormulaSettings(e){e.empty(),new S1.Setting(e).setHeading().setName("Saved Formulas");let t=e.createDiv();new S1.Setting(t).setName("Add Formula").setDesc("Add a new formula shortcut.").addButton(r=>r.setTooltip("Add Formula").setButtonText("+").onClick(async()=>{let o=await this.buildFormulaForm(t);o&&(this.plugin.data.formulas[o.alias]=o.formula,this.buildFormulaSettings(e),await this.plugin.saveSettings())}));let i=e.createDiv("additional"),a=this.plugin.data.formulas;for(let[r,s]of Object.entries(a)){let o=new S1.Setting(i).setName(r);o.controlEl.createSpan({text:s}),o.addExtraButton(c=>c.setIcon("pencil").setTooltip("Edit").onClick(async()=>{let l=await this.buildFormulaForm(t,{alias:r,formula:s});l&&(delete this.plugin.data.formulas[r],this.plugin.data.formulas[l.alias]=l.formula,this.buildFormulaSettings(e),await this.plugin.saveSettings())})).addExtraButton(c=>c.setIcon("trash").setTooltip("Delete").onClick(async()=>{delete this.plugin.data.formulas[r],await this.plugin.saveSettings(),this.buildFormulaSettings(e)}))}Object.values(a).length||i.createSpan({text:"Create a formula to see it here!",cls:"no-formulas"})}async buildFormulaForm(e,t={alias:null,formula:null}){return new Promise(i=>{let a=e.createDiv("add-new-formula"),r=a.createDiv("formula-data");new S1.Setting(r).setName("Alias").addText(o=>{o.setValue(t.alias).onChange(c=>t.alias=c)}),new S1.Setting(r).setName("Formula").addText(o=>{o.setValue(t.formula).onChange(c=>t.formula=c)});let s=a.createDiv("formula-buttons");new S1.Setting(s).addButton(o=>o.setCta().setButtonText("Save").onClick(async()=>{a.detach(),i(t)})).addExtraButton(o=>o.setIcon("cross").setTooltip("Cancel").onClick(()=>{a.detach(),i(null)}))})}};var L1=w2(require("obsidian"));var bt="DICE_ROLLER_VIEW",Oc='',Gc='',qc='',Wc='',jc='',Xc='',Zc='';(0,L1.addIcon)("d4",Oc);(0,L1.addIcon)("d6",Gc);(0,L1.addIcon)("d8",qc);(0,L1.addIcon)("d10",Wc);(0,L1.addIcon)("d12",jc);(0,L1.addIcon)("d20",Xc);(0,L1.addIcon)("d100",Zc);(0,L1.addIcon)("dice-roller-save",'');(0,L1.addIcon)("dice-roller-plus",'');(0,L1.addIcon)("dice-roller-minus",'');var Qe=class extends L1.ItemView{constructor(e,t){super(t);this.plugin=e;this.leaf=t;this.dice=Qe.DICE();this.custom="";this.adv=!1;this.dis=!1;this.add=0;this.contentEl.addClass("dice-roller-view"),this.registerEvent(this.plugin.app.workspace.on("dice-roller:update-colors",()=>{this.renderer.factory.updateColors()}))}static DICE(){return{d4:0,d6:0,d8:0,d10:0,d12:0,d20:0,d100:0}}get customFormulas(){return this.plugin.data.customFormulas}get renderer(){return this.plugin.renderer}async onOpen(){this.display()}async display(){this.contentEl.empty(),this.gridEl=this.contentEl.createDiv("dice-roller-grid"),this.formulaEl=this.contentEl.createDiv("dice-roller-formula");let e=this.contentEl.createDiv("dice-roller-results-container"),t=e.createDiv("dice-roller-results-header");t.createEl("h4",{text:"Results"}),new L1.ExtraButtonComponent(t.createDiv("clear-all")).setIcon("trash").setTooltip("Clear All").onClick(()=>{this.resultEl.empty(),this.resultEl.append(this.noResultsEl)}),this.resultEl=e.createDiv("dice-roller-results"),this.noResultsEl=this.resultEl.createSpan({text:"No results yet! Roll some dice to get started :)"}),this.buildButtons(),this.buildFormula()}buildButtons(){this.gridEl.empty();let e=this.gridEl.createDiv("dice-buttons");for(let o in this.dice){let c=new L1.ExtraButtonComponent(e.createDiv("dice-button")).setIcon(o);c.extraSettingsEl.onclick=async l=>{let u=l.getModifierState("Shift")?-1:1;this.dice[o]+=u,this.setFormula();let f=await this.plugin.getRoller(this.formulaComponent.inputEl.value,"view");f instanceof S2&&(this.stack=f)}}let t=this.gridEl.createDiv("advantage-disadvantage"),i=new L1.ButtonComponent(t).setButtonText("ADV").onClick(()=>{this.adv=!this.adv,this.dis=!1,this.adv?(i.setCta(),a.removeCta()):i.removeCta(),this.setFormula()}),a=new L1.ButtonComponent(t).setButtonText("DIS").onClick(()=>{this.dis=!this.dis,this.dis?(a.setCta(),i.removeCta()):a.removeCta(),this.adv=!1,this.setFormula()}),r=this.gridEl.createDiv("dice-context").createDiv("add-subtract");new L1.ExtraButtonComponent(r).setIcon("dice-roller-minus").onClick(()=>{this.add-=1,s.setValue(`${this.add}`),this.setFormula()});let s=new L1.TextComponent(r).setValue(`${this.add?this.add:""}`).onChange(o=>{isNaN(Number(o))||(this.add=Number(o)),this.setFormula()});if(new L1.ExtraButtonComponent(r).setIcon("dice-roller-plus").onClick(()=>{this.add+=1,s.setValue(`${this.add}`),this.setFormula()}),this.customFormulas.length){let o=this.gridEl.createDiv("dice-roller-results-container");o.createDiv("dice-roller-results-header").createEl("h4",{text:"Saved Formulas"});for(let l of this.customFormulas){let u=o.createDiv("dice-custom-formula-container"),f=u.createDiv("dice-custom-formula");new L1.ExtraButtonComponent(f).setIcon(Y2).setTooltip("Roll").onClick(()=>this.roll(l)),f.createSpan({text:l}),new L1.ExtraButtonComponent(u).setIcon("trash").setTooltip("Remove").onClick(()=>{this.plugin.data.customFormulas=this.plugin.data.customFormulas.filter(h=>h!=l),this.plugin.saveSettings(),this.buildButtons()})}}}async roll(e=this.formulaComponent.inputEl.value){if(!e)return;this.rollButton.setDisabled(!0);let t=await this.plugin.getRoller(e,"view");if(!(t instanceof S2)){new L1.Notice("The Dice View only supports dice rolls.");return}if(t.iconEl.detach(),t.containerEl.onclick=null,await t.roll(),!t.dice.length){new L1.Notice("Invalid formula.");return}try{this.plugin.data.renderer&&(this.addChild(this.renderer),this.renderer.setDice(t),await this.renderer.start(),t.recalculate())}catch(i){new L1.Notice("There was an error rendering the roll."),console.error(i)}this.rollButton.setDisabled(!1),this.addResult(t),this.dice=Qe.DICE(),this.add=null,this.adv=!1,this.dis=!1,this.buildButtons(),this.setFormula()}buildFormula(){this.formulaEl.empty(),this.formulaComponent=new L1.TextAreaComponent(this.formulaEl).setPlaceholder("Dice Formula"),this.formulaComponent.onChange((0,L1.debounce)(async t=>{},500,!0));let e=this.formulaEl.createDiv("action-buttons");this.saveButton=new L1.ButtonComponent(e).setIcon("plus-with-circle").setCta().setTooltip("Save Formula").onClick(()=>this.save()),this.saveButton.buttonEl.addClass("dice-roller-roll"),this.rollButton=new L1.ButtonComponent(e).setIcon(Y2).setCta().setTooltip("Roll").onClick(()=>this.roll()),this.rollButton.buttonEl.addClass("dice-roller-roll")}save(){!this.formulaComponent.inputEl.value||(this.plugin.data.customFormulas.push(this.formulaComponent.inputEl.value),this.buildButtons(),this.plugin.saveSettings())}addResult(e){this.noResultsEl&&this.noResultsEl.detach();let t=createDiv("view-result");t.createSpan({text:e.original}),t.createEl("strong",{attr:{"aria-label":e.resultText}}).appendChild(e.containerEl);let i=t.createDiv("result-context");i.createEl("em",{text:new Date().toLocaleString()}),new L1.ExtraButtonComponent(i).setIcon("trash").onClick(()=>{t.detach(),this.resultEl.children.length===0&&this.resultEl.prepend(this.noResultsEl)}),new L1.ExtraButtonComponent(i).setIcon(Je).setTooltip("Copy Result").onClick(async()=>{await navigator.clipboard.writeText(`${e.result}`)}).extraSettingsEl.addClass("dice-content-copy"),new L1.ExtraButtonComponent(i).setIcon(Y2).setTooltip("Roll Again").onClick(()=>this.roll(e.original)).extraSettingsEl.addClass("dice-result-reroll"),this.resultEl.prepend(t)}get formulaString(){let e=[],t=Object.entries(this.dice).filter(([a,r])=>r!=0);if(!t.length)return"";t.sort((a,r)=>Number(r[0].slice(1))-Number(a[0].slice(1)));let i=t.shift();return e.push(`${i[1]}${i[0]}`),this.adv?e.push("kh"):this.dis&&e.push("dh"),t.length&&e.push(...t.map(([a,r])=>`${r>0?"+":"-"}${Math.abs(r)}${a}`)),this.add&&this.add!=0&&(e.push(this.add>0?"+":"-"),e.push(Math.abs(this.add))),e.join("")}setFormula(){this.formulaComponent.setValue(this.formulaString)}getDisplayText(){return"Dice Roller"}getViewType(){return bt}getIcon(){return Y2}async onClose(){await super.onClose(),this.renderer.unload()}};var Z4=w2(require("obsidian"));var _2=class{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){let e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){let e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){let t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new y){let t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new y){let i=this.elements,a=e.x,r=e.y,s=e.z;return t.x=i[0]*a+i[1]*r+i[2]*s,t.y=i[3]*a+i[4]*r+i[5]*s,t.z=i[6]*a+i[7]*r+i[8]*s,t}smult(e){for(let t=0;t0){let r=1/a;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return a}unit(e=new y){let t=this.x,i=this.y,a=this.z,r=Math.sqrt(t*t+i*i+a*a);return r>0?(r=1/r,e.x=t*r,e.y=i*r,e.z=a*r):(e.x=1,e.y=0,e.z=0),e}length(){let e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){let t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z;return Math.sqrt((r-t)*(r-t)+(s-i)*(s-i)+(o-a)*(o-a))}distanceSquared(e){let t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z;return(r-t)*(r-t)+(s-i)*(s-i)+(o-a)*(o-a)}scale(e,t=new y){let i=this.x,a=this.y,r=this.z;return t.x=e*i,t.y=e*a,t.z=e*r,t}vmul(e,t=new y){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new y){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e=new y){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){let i=this.length();if(i>0){let a=$c,r=1/i;a.set(this.x*r,this.y*r,this.z*r);let s=Kc;Math.abs(a.x)<.9?(s.set(1,0,0),a.cross(s,e)):(s.set(0,1,0),a.cross(s,e)),a.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){let a=this.x,r=this.y,s=this.z;i.x=a+(e.x-a)*t,i.y=r+(e.y-r)*t,i.z=s+(e.z-s)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Ea),Ea.almostEquals(e,t)}clone(){return new y(this.x,this.y,this.z)}};y.ZERO=void 0;y.UNIT_X=void 0;y.UNIT_Y=void 0;y.UNIT_Z=void 0;y.ZERO=new y(0,0,0);y.UNIT_X=new y(1,0,0);y.UNIT_Y=new y(0,1,0);y.UNIT_Z=new y(0,0,1);var $c=new y,Kc=new y,Ea=new y,E2=class{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new y,this.upperBound=new y,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,a){let r=this.lowerBound,s=this.upperBound,o=i;r.copy(e[0]),o&&o.vmult(r,r),s.copy(r);for(let c=1;cs.x&&(s.x=l.x),l.xs.y&&(s.y=l.y),l.ys.z&&(s.z=l.z),l.z=r.x&&t.y<=a.y&&i.y>=r.y&&t.z<=a.z&&i.z>=r.z}getCorners(e,t,i,a,r,s,o,c){let l=this.lowerBound,u=this.upperBound;e.copy(l),t.set(u.x,l.y,l.z),i.set(u.x,u.y,l.z),a.set(l.x,u.y,u.z),r.set(u.x,l.y,u.z),s.set(l.x,u.y,l.z),o.set(l.x,l.y,u.z),c.copy(u)}toLocalFrame(e,t){let i=Da,a=i[0],r=i[1],s=i[2],o=i[3],c=i[4],l=i[5],u=i[6],f=i[7];this.getCorners(a,r,s,o,c,l,u,f);for(let h=0;h!==8;h++){let m=i[h];e.pointToLocal(m,m)}return t.setFromPoints(i)}toWorldFrame(e,t){let i=Da,a=i[0],r=i[1],s=i[2],o=i[3],c=i[4],l=i[5],u=i[6],f=i[7];this.getCorners(a,r,s,o,c,l,u,f);for(let h=0;h!==8;h++){let m=i[h];e.pointToWorld(m,m)}return t.setFromPoints(i)}overlapsRay(e){let{direction:t,from:i}=e,a=1/t.x,r=1/t.y,s=1/t.z,o=(this.lowerBound.x-i.x)*a,c=(this.upperBound.x-i.x)*a,l=(this.lowerBound.y-i.y)*r,u=(this.upperBound.y-i.y)*r,f=(this.lowerBound.z-i.z)*s,h=(this.upperBound.z-i.z)*s,m=Math.max(Math.max(Math.min(o,c),Math.min(l,u)),Math.min(f,h)),v=Math.min(Math.min(Math.max(o,c),Math.max(l,u)),Math.max(f,h));return!(v<0||m>v)}},La=new y,Da=[new y,new y,new y,new y,new y,new y,new y,new y],k0=class{constructor(){this.matrix=void 0,this.matrix=[]}get(e,t){let{index:i}=e,{index:a}=t;if(a>i){let r=a;a=i,i=r}return this.matrix[(i*(i+1)>>1)+a-1]}set(e,t,i){let{index:a}=e,{index:r}=t;if(r>a){let s=r;r=a,a=s}this.matrix[(a*(a+1)>>1)+r-1]=i?1:0}reset(){for(let e=0,t=this.matrix.length;e!==t;e++)this.matrix[e]=0}setNumObjects(e){this.matrix.length=e*(e-1)>>1}},U0=class{constructor(){this._listeners=void 0}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;return i[e]===void 0&&(i[e]=[]),i[e].includes(t)||i[e].push(t),this}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return!!(i[e]!==void 0&&i[e].includes(t))}hasAnyEventListener(e){return this._listeners===void 0?!1:this._listeners[e]!==void 0}removeEventListener(e,t){if(this._listeners===void 0)return this;let i=this._listeners;if(i[e]===void 0)return this;let a=i[e].indexOf(t);return a!==-1&&i[e].splice(a,1),this}dispatchEvent(e){if(this._listeners===void 0)return this;let i=this._listeners[e.type];if(i!==void 0){e.target=this;for(let a=0,r=i.length;a.499&&(i=2*Math.atan2(s,l),a=Math.PI/2,r=0),u<-.499&&(i=-2*Math.atan2(s,l),a=-Math.PI/2,r=0),i===void 0){let f=s*s,h=o*o,m=c*c;i=Math.atan2(2*o*l-2*s*c,1-2*h-2*m),a=Math.asin(2*u),r=Math.atan2(2*s*l-2*o*c,1-2*f-2*m)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=a,e.x=r}setFromEuler(e,t,i,a="XYZ"){let r=Math.cos(e/2),s=Math.cos(t/2),o=Math.cos(i/2),c=Math.sin(e/2),l=Math.sin(t/2),u=Math.sin(i/2);return a==="XYZ"?(this.x=c*s*o+r*l*u,this.y=r*l*o-c*s*u,this.z=r*s*u+c*l*o,this.w=r*s*o-c*l*u):a==="YXZ"?(this.x=c*s*o+r*l*u,this.y=r*l*o-c*s*u,this.z=r*s*u-c*l*o,this.w=r*s*o+c*l*u):a==="ZXY"?(this.x=c*s*o-r*l*u,this.y=r*l*o+c*s*u,this.z=r*s*u+c*l*o,this.w=r*s*o-c*l*u):a==="ZYX"?(this.x=c*s*o-r*l*u,this.y=r*l*o+c*s*u,this.z=r*s*u-c*l*o,this.w=r*s*o+c*l*u):a==="YZX"?(this.x=c*s*o+r*l*u,this.y=r*l*o+c*s*u,this.z=r*s*u-c*l*o,this.w=r*s*o-c*l*u):a==="XZY"&&(this.x=c*s*o-r*l*u,this.y=r*l*o-c*s*u,this.z=r*s*u+c*l*o,this.w=r*s*o+c*l*u),this}clone(){return new O1(this.x,this.y,this.z,this.w)}slerp(e,t,i=new O1){let a=this.x,r=this.y,s=this.z,o=this.w,c=e.x,l=e.y,u=e.z,f=e.w,h,m,v,g,x;return m=a*c+r*l+s*u+o*f,m<0&&(m=-m,c=-c,l=-l,u=-u,f=-f),1-m>1e-6?(h=Math.acos(m),v=Math.sin(h),g=Math.sin((1-t)*h)/v,x=Math.sin(t*h)/v):(g=1-t,x=t),i.x=g*a+x*c,i.y=g*r+x*l,i.z=g*s+x*u,i.w=g*o+x*f,i}integrate(e,t,i,a=new O1){let r=e.x*i.x,s=e.y*i.y,o=e.z*i.z,c=this.x,l=this.y,u=this.z,f=this.w,h=t*.5;return a.x+=h*(r*f+s*u-o*l),a.y+=h*(s*f+o*c-r*u),a.z+=h*(o*f+r*l-s*c),a.w+=h*(-r*c-s*l-o*u),a}},Jc=new y,Qc=new y,e7={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},c1=class{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=c1.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(e,t){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(e,t,i,a){throw"calculateWorldAABB() not implemented for shape type "+this.type}};c1.idCounter=0;c1.types=e7;var N1=class{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new y,this.quaternion=new O1,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return N1.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return N1.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new y){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,a=new y){return i.vsub(e,a),t.conjugate(Ta),Ta.vmult(a,a),a}static pointToWorldFrame(e,t,i,a=new y){return t.vmult(i,a),a.vadd(e,a),a}static vectorToWorldFrame(e,t,i=new y){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,a=new y){return t.w*=-1,t.vmult(i,a),t.w*=-1,a}},Ta=new O1,et=class extends c1{constructor(e={}){let{vertices:t=[],faces:i=[],normals:a=[],axes:r,boundingSphereRadius:s}=e;super({type:c1.types.CONVEXPOLYHEDRON});this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=a,this.faceNormals.length===0&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){let e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;let a=new y;for(let r=0;r!==e.length;r++){let s=e[r],o=s.length;for(let c=0;c!==o;c++){let l=(c+1)%o;t[s[c]].vsub(t[s[l]],a),a.normalize();let u=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(a)||i[f].almostEquals(a)){u=!0;break}u||i.push(a.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;eh&&(h=g,f=v)}let m=[];for(let v=0;v=0&&this.clipFaceAgainstHull(s,e,t,m,o,c,l)}findSeparatingAxis(e,t,i,a,r,s,o,c){let l=new y,u=new y,f=new y,h=new y,m=new y,v=new y,g=Number.MAX_VALUE,x=this;if(x.uniqueAxes)for(let p=0;p!==x.uniqueAxes.length;p++){i.vmult(x.uniqueAxes[p],l);let d=x.testSepAxis(l,e,t,i,a,r);if(d===!1)return!1;d0&&s.negate(s),!0}testSepAxis(e,t,i,a,r,s){let o=this;et.project(o,e,i,a,O0),et.project(t,e,r,s,G0);let c=O0[0],l=O0[1],u=G0[0],f=G0[1];if(c0?1/t:0,this.material=e.material||null,this.linearDamping=typeof e.linearDamping=="number"?e.linearDamping:.01,this.type=t<=0?i1.STATIC:i1.DYNAMIC,typeof e.type==typeof i1.STATIC&&(this.type=e.type),this.allowSleep=typeof e.allowSleep!="undefined"?e.allowSleep:!0,this.sleepState=i1.AWAKE,this.sleepSpeedLimit=typeof e.sleepSpeedLimit!="undefined"?e.sleepSpeedLimit:.1,this.sleepTimeLimit=typeof e.sleepTimeLimit!="undefined"?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new y,this.quaternion=new O1,this.initQuaternion=new O1,this.previousQuaternion=new O1,this.interpolatedQuaternion=new O1,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new y,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new y,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new y,this.invInertia=new y,this.invInertiaWorld=new _2,this.invMassSolve=0,this.invInertiaSolve=new y,this.invInertiaWorldSolve=new _2,this.fixedRotation=typeof e.fixedRotation!="undefined"?e.fixedRotation:!1,this.angularDamping=typeof e.angularDamping!="undefined"?e.angularDamping:.01,this.linearFactor=new y(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new y(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new E2,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new y,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){let e=this.sleepState;this.sleepState=i1.AWAKE,this.wakeUpAfterNarrowphase=!1,e===i1.SLEEPING&&this.dispatchEvent(i1.wakeupEvent)}sleep(){this.sleepState=i1.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){let t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),a=this.sleepSpeedLimit**2;t===i1.AWAKE&&ia?this.wakeUp():t===i1.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(i1.sleepEvent))}}updateSolveMassProperties(){this.sleepState===i1.SLEEPING||this.type===i1.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new y){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new y){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new y){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new y){return this.quaternion.vmult(e,t),t}addShape(e,t,i){let a=new y,r=new O1;return t&&a.copy(t),i&&r.copy(i),this.shapes.push(e),this.shapeOffsets.push(a),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){let t=this.shapes.indexOf(e);return t===-1?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){let e=this.shapes,t=this.shapeOffsets,i=e.length,a=0;for(let r=0;r!==i;r++){let s=e[r];s.updateBoundingSphereRadius();let o=t[r].length(),c=s.boundingSphereRadius;o+c>a&&(a=o+c)}this.boundingRadius=a}updateAABB(){let e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,a=e.length,r=a7,s=r7,o=this.quaternion,c=this.aabb,l=n7;for(let u=0;u!==a;u++){let f=e[u];o.vmult(t[u],r),r.vadd(this.position,r),o.mult(i[u],s),f.calculateWorldAABB(r,s,l.lowerBound,l.upperBound),u===0?c.copy(l):c.extend(l)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){let t=this.invInertia;if(!(t.x===t.y&&t.y===t.z&&!e)){let i=s7,a=o7;i.setRotationFromQuaternion(this.quaternion),i.transpose(a),i.scale(t,i),i.mmult(a,this.invInertiaWorld)}}applyForce(e,t=new y){if(this.type!==i1.DYNAMIC)return;this.sleepState===i1.SLEEPING&&this.wakeUp();let i=c7;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new y){if(this.type!==i1.DYNAMIC)return;let i=l7,a=u7;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,a),this.applyForce(i,a)}applyTorque(e){this.type===i1.DYNAMIC&&(this.sleepState===i1.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new y){if(this.type!==i1.DYNAMIC)return;this.sleepState===i1.SLEEPING&&this.wakeUp();let i=t,a=h7;a.copy(e),a.scale(this.invMass,a),this.velocity.vadd(a,this.velocity);let r=f7;i.cross(e,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(e,t=new y){if(this.type!==i1.DYNAMIC)return;let i=d7,a=p7;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,a),this.applyImpulse(i,a)}updateMassProperties(){let e=m7;this.invMass=this.mass>0?1/this.mass:0;let t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),p6.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){let i=new y;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),!(this.type===i1.DYNAMIC||this.type===i1.KINEMATIC)||this.sleepState===i1.SLEEPING)return;let a=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,c=this.torque,l=this.quaternion,u=this.invMass,f=this.invInertiaWorld,h=this.linearFactor,m=u*e;a.x+=o.x*m*h.x,a.y+=o.y*m*h.y,a.z+=o.z*m*h.z;let v=f.elements,g=this.angularFactor,x=c.x*g.x,p=c.y*g.y,d=c.z*g.z;r.x+=e*(v[0]*x+v[1]*p+v[2]*d),r.y+=e*(v[3]*x+v[4]*p+v[5]*d),r.z+=e*(v[6]*x+v[7]*p+v[8]*d),s.x+=a.x*e,s.y+=a.y*e,s.z+=a.z*e,l.integrate(this.angularVelocity,e,this.angularFactor,l),t&&(i?l.normalizeFast():l.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}};i1.idCounter=0;i1.COLLIDE_EVENT_NAME="collide";i1.DYNAMIC=q0.DYNAMIC;i1.STATIC=q0.STATIC;i1.KINEMATIC=q0.KINEMATIC;i1.AWAKE=W0.AWAKE;i1.SLEEPY=W0.SLEEPY;i1.SLEEPING=W0.SLEEPING;i1.wakeupEvent={type:"wakeup"};i1.sleepyEvent={type:"sleepy"};i1.sleepEvent={type:"sleep"};var a7=new y,r7=new O1,n7=new E2,s7=new _2,o7=new _2,c7=new y,l7=new y,u7=new y,h7=new y,f7=new y,d7=new y,p7=new y,m7=new y,Ha=class{constructor(){this.world=void 0,this.useBoundingBoxes=void 0,this.dirty=void 0,this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(e,t,i){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(e,t){return!((e.collisionFilterGroup&t.collisionFilterMask)==0||(t.collisionFilterGroup&e.collisionFilterMask)==0||((e.type&i1.STATIC)!=0||e.sleepState===i1.SLEEPING)&&((t.type&i1.STATIC)!=0||t.sleepState===i1.SLEEPING))}intersectionTest(e,t,i,a){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,t,i,a):this.doBoundingSphereBroadphase(e,t,i,a)}doBoundingSphereBroadphase(e,t,i,a){let r=v7;t.position.vsub(e.position,r);let s=(e.boundingRadius+t.boundingRadius)**2;r.lengthSquared()i.lengthSquared()}aabbQuery(e,t,i){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},v7=new y,g7={keys:[]},x7=[],M7=[];var yf=new y,m6=class extends Ha{constructor(){super()}collisionPairs(e,t,i){let a=e.bodies,r=a.length,s,o;for(let c=0;c!==r;c++)for(let l=0;l!==c;l++)s=a[c],o=a[l],!!this.needBroadphaseCollision(s,o)&&this.intersectionTest(s,o,t,i)}aabbQuery(e,t,i=[]){for(let a=0;a{}}intersectWorld(e,t){return this.mode=t.mode||Q1.ANY,this.result=t.result||new v6,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask!="undefined"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup!="undefined"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse!="undefined"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(ka),X0.length=0,e.broadphase.aabbQuery(e,ka,X0),this.intersectBodies(X0),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());let i=this.checkCollisionResponse;if(i&&!e.collisionResponse||(this.collisionFilterGroup&e.collisionFilterMask)==0||(e.collisionFilterGroup&this.collisionFilterMask)==0)return;let a=b7,r=y7;for(let s=0,o=e.shapes.length;se.boundingSphereRadius)return;let o=this[e.type];o&&o.call(this,e,t,i,a,e)}_intersectBox(e,t,i,a,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,a,r)}_intersectPlane(e,t,i,a,r){let s=this.from,o=this.to,c=this.direction,l=new y(0,0,1);t.vmult(l,l);let u=new y;s.vsub(i,u);let f=u.dot(l);o.vsub(i,u);let h=u.dot(l);if(f*h>0||s.distanceTo(o)=0&&g<=1&&(s.lerp(o,g,m),m.vsub(i,v),v.normalize(),this.reportIntersection(v,m,r,a,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(s.lerp(o,x,m),m.vsub(i,v),v.normalize(),this.reportIntersection(v,m,r,a,-1))}}_intersectConvex(e,t,i,a,r,s){let o=S7,c=Oa,l=s&&s.faceList||null,u=e.faces,f=e.vertices,h=e.faceNormals,m=this.direction,v=this.from,g=this.to,x=v.distanceTo(g),p=l?l.length:u.length,d=this.result;for(let A=0;!d.shouldStop&&Ax||this.reportIntersection(o,L2,r,a,b)}}}}_intersectTrimesh(e,t,i,a,r,s){let o=_7,c=V7,l=N7,u=Oa,f=E7,h=L7,m=D7,v=H7,g=T7,x=e.indices;e.vertices;let p=this.from,d=this.to,A=this.direction;l.position.copy(i),l.quaternion.copy(t),N1.vectorToLocalFrame(i,t,A,f),N1.pointToLocalFrame(i,t,p,h),N1.pointToLocalFrame(i,t,d,m),m.x*=e.scale.x,m.y*=e.scale.y,m.z*=e.scale.z,h.x*=e.scale.x,h.y*=e.scale.y,h.z*=e.scale.z,m.vsub(h,f),f.normalize();let b=h.distanceSquared(m);e.tree.rayQuery(this,l,c);for(let C=0,E=c.length;!this.result.shouldStop&&C!==E;C++){let T=c[C];e.getNormal(T,o),e.getVertex(x[T*3],$2),$2.vsub(h,u);let _=f.dot(o),P=o.dot(u)/_;if(P<0)continue;f.scale(P,L2),L2.vadd(h,L2),e.getVertex(x[T*3+1],ve),e.getVertex(x[T*3+2],ge);let F=L2.distanceSquared(h);!(Q1.pointInTriangle(L2,ve,$2,ge)||Q1.pointInTriangle(L2,$2,ve,ge))||F>b||(N1.vectorToWorldFrame(t,o,g),N1.pointToWorldFrame(i,t,L2,v),this.reportIntersection(g,v,r,a,T))}c.length=0}reportIntersection(e,t,i,a,r){let s=this.from,o=this.to,c=s.distanceTo(t),l=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(l.hitFaceIndex=typeof r!="undefined"?r:-1,this.mode){case Q1.ALL:this.hasHit=!0,l.set(s,o,e,t,i,a,c),l.hasHit=!0,this.callback(l);break;case Q1.CLOSEST:(c=0&&(f=r*l-s*o)>=0&&u+fT.maxForce&&(m=T.maxForce-x),A[E]+=m,v+=m>0?m:-m,T.addToWlambda(m)}if(v*ve;)t.pop();for(;t.length=0&&u.restitution>=0&&(o.restitution=l.restitution*u.restitution),o.si=r||i,o.sj=s||a,o}createFrictionEquationsFromContact(e,t){let i=e.bi,a=e.bj,r=e.si,s=e.sj,o=this.world,c=this.currentContactMaterial,l=c.friction,u=r.material||i.material,f=s.material||a.material;if(u&&f&&u.friction>=0&&f.friction>=0&&(l=u.friction*f.friction),l>0){let h=l*o.gravity.length(),m=i.invMass+a.invMass;m>0&&(m=1/m);let v=this.frictionEquationPool,g=v.length?v.pop():new K0(i,a,h*m),x=v.length?v.pop():new K0(i,a,h*m);return g.bi=x.bi=i,g.bj=x.bj=a,g.minForce=x.minForce=-h*m,g.maxForce=x.maxForce=h*m,g.ri.copy(e.ri),g.rj.copy(e.rj),x.ri.copy(e.ri),x.rj.copy(e.rj),e.ni.tangents(g.t,x.t),g.setSpookParams(c.frictionEquationStiffness,c.frictionEquationRelaxation,o.dt),x.setSpookParams(c.frictionEquationStiffness,c.frictionEquationRelaxation,o.dt),g.enabled=x.enabled=e.enabled,t.push(g,x),!0}return!1}createFrictionFromAverage(e){let t=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(t,this.frictionResult)||e===1)return;let i=this.frictionResult[this.frictionResult.length-2],a=this.frictionResult[this.frictionResult.length-1];Ct.setZero(),Ot.setZero(),Gt.setZero();let r=t.bi;t.bj;for(let o=0;o!==e;o++)t=this.result[this.result.length-1-o],t.bi!==r?(Ct.vadd(t.ni,Ct),Ot.vadd(t.ri,Ot),Gt.vadd(t.rj,Gt)):(Ct.vsub(t.ni,Ct),Ot.vadd(t.rj,Ot),Gt.vadd(t.ri,Gt));let s=1/e;Ot.scale(s,i.ri),Gt.scale(s,i.rj),a.ri.copy(i.ri),a.rj.copy(i.rj),Ct.normalize(),Ct.tangents(i.t,a.t)}getContacts(e,t,i,a,r,s,o){this.contactPointPool=r,this.frictionEquationPool=o,this.result=a,this.frictionResult=s;let c=J7,l=Q7,u=$7,f=K7;for(let h=0,m=e.length;h!==m;h++){let v=e[h],g=t[h],x=null;v.material&&g.material&&(x=i.getContactMaterial(v.material,g.material)||null);let p=v.type&i1.KINEMATIC&&g.type&i1.STATIC||v.type&i1.STATIC&&g.type&i1.KINEMATIC||v.type&i1.KINEMATIC&&g.type&i1.KINEMATIC;for(let d=0;dA.boundingSphereRadius+C.boundingSphereRadius)continue;let E=null;A.material&&C.material&&(E=i.getContactMaterial(A.material,C.material)||null),this.currentContactMaterial=E||x||i.defaultContactMaterial;let T=A.type|C.type,_=this[T];if(_){let P=!1;A.type0){let W=zl,X=Al;W.copy(m[(L+1)%3]),X.copy(m[(L+2)%3]);let Q=W.length(),a1=X.length();W.normalize(),X.normalize();let B=C6.dot(W),M1=C6.dot(X);if(B-Q&&M1-a1){let u1=Math.abs(O-Z-v);if((T===null||u1e.boundingSphereRadius+t.boundingSphereRadius)&&e.findSeparatingAxis(t,i,r,a,s,v,h,m)){let g=[],x=Wl;e.clipAgainstHull(i,r,t,a,s,v,-100,100,g);let p=0;for(let d=0;d!==g.length;d++){if(f)return!0;let A=this.createContactEquation(o,c,e,t,l,u),b=A.ri,C=A.rj;v.negate(A.ni),g[d].normal.negate(x),x.scale(g[d].depth,x),g[d].point.vadd(x,b),C.copy(g[d].point),b.vsub(i,b),C.vsub(a,C),b.vadd(i,b),b.vsub(o.position,b),C.vadd(a,C),C.vsub(c.position,C),this.result.push(A),p++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(A,this.frictionResult)}this.enableFrictionReduction&&p&&this.createFrictionFromAverage(p)}}sphereConvex(e,t,i,a,r,s,o,c,l,u,f){let h=this.v3pool;i.vsub(a,Dl);let m=t.faceNormals,v=t.faces,g=t.vertices,x=e.radius,p=!1;for(let d=0;d!==g.length;d++){let A=g[d],b=Nl;s.vmult(A,b),a.vadd(b,b);let C=Vl;if(b.vsub(i,C),C.lengthSquared()0){let D=[];for(let z=0,H=C.length;z!==H;z++){let V=h.get();s.vmult(g[C[z]],V),a.vadd(V,V),D.push(V)}if(yl(D,E,i)){if(f)return!0;p=!0;let z=this.createContactEquation(o,c,e,t,l,u);E.scale(-x,z.ri),E.negate(z.ni);let H=h.get();E.scale(-F,H);let V=h.get();E.scale(-x,V),i.vsub(a,z.rj),z.rj.vadd(V,z.rj),z.rj.vadd(H,z.rj),z.rj.vadd(a,z.rj),z.rj.vsub(c.position,z.rj),z.ri.vadd(i,z.ri),z.ri.vsub(o.position,z.ri),h.release(H),h.release(V),this.result.push(z),this.createFrictionEquationsFromContact(z,this.frictionResult);for(let L=0,N=D.length;L!==N;L++)h.release(D[L]);return}else for(let z=0;z!==C.length;z++){let H=h.get(),V=h.get();s.vmult(g[C[(z+1)%C.length]],H),s.vmult(g[C[(z+2)%C.length]],V),a.vadd(H,H),a.vadd(V,V);let L=Tl;V.vsub(H,L);let N=Hl;L.unit(N);let U=h.get(),Z=h.get();i.vsub(H,Z);let O=Z.dot(N);N.scale(O,U),U.vadd(H,U);let W=h.get();if(U.vsub(i,W),O>0&&O*Oh.length||A>h[0].length)return;p<0&&(p=0),d<0&&(d=0),A<0&&(A=0),b<0&&(b=0),p>=h.length&&(p=h.length-1),d>=h.length&&(d=h.length-1),b>=h[0].length&&(b=h[0].length-1),A>=h[0].length&&(A=h[0].length-1);let C=[];t.getRectMinMax(p,A,d,b,C);let E=C[0],T=C[1];if(x.z-m>T||x.z+m2)return}}boxHeightfield(e,t,i,a,r,s,o,c,l,u,f){return e.convexPolyhedronRepresentation.material=e.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,this.convexHeightfield(e.convexPolyhedronRepresentation,t,i,a,r,s,o,c,e,t,f)}convexHeightfield(e,t,i,a,r,s,o,c,l,u,f){let h=t.data,m=t.elementSize,v=e.boundingSphereRadius,g=e9,x=t9,p=Ql;N1.pointToLocalFrame(a,s,i,p);let d=Math.floor((p.x-v)/m)-1,A=Math.ceil((p.x+v)/m)+1,b=Math.floor((p.y-v)/m)-1,C=Math.ceil((p.y+v)/m)+1;if(A<0||C<0||d>h.length||b>h[0].length)return;d<0&&(d=0),A<0&&(A=0),b<0&&(b=0),C<0&&(C=0),d>=h.length&&(d=h.length-1),A>=h.length&&(A=h.length-1),C>=h[0].length&&(C=h[0].length-1),b>=h[0].length&&(b=h[0].length-1);let E=[];t.getRectMinMax(d,b,A,C,E);let T=E[0],_=E[1];if(!(p.z-v>_||p.z+v0&&V<0&&(x.vsub(h,p),g.copy(v),g.normalize(),L=p.dot(g),g.scale(L,p),p.vadd(h,p),p.distanceTo(x)0&&i===!0||u<=0&&i===!1){i===null&&(i=u>0);continue}else return!1}return!0}var C6=new y,Cl=new y,zl=new y,Al=new y,wl=[new y,new y,new y,new y,new y,new y],Sl=new y,_l=new y,El=new y,Ll=new y,Dl=new y,Tl=new y,Hl=new y,Vl=new y,Nl=new y,Rl=new y,Fl=new y,Bl=new y,Pl=new y,Il=new y,kl=new y,Ul=new y,Ol=new y,Gl=new y,ql=new y,Wl=new y,jl=new y,Xl=new y,Zl=new y,Yl=new y,wr=new O1,$l=new y,Kl=new y,Sr=new y,Jl=new y,Ql=new y,e9=new y,t9=[0],i9=new y,a9=new y,J0=class{constructor(){this.current=void 0,this.previous=void 0,this.current=[],this.previous=[]}getKey(e,t){if(ta[r];)r++;if(i!==a[r]){for(let s=a.length-1;s>=r;s--)a[s+1]=a[s];a[r]=i}}tick(){let e=this.current;this.current=this.previous,this.previous=e,this.current.length=0}getDiff(e,t){let i=this.current,a=this.previous,r=i.length,s=a.length,o=0;for(let c=0;ca[o];)o++;l=u===a[o],l||_r(e,u)}o=0;for(let c=0;ci[o];)o++;l=i[o]===u,l||_r(t,u)}}};function _r(n,e){n.push((e&4294901760)>>16,e&65535)}var Er=class{constructor(){this.data={keys:[]}}get(e,t){if(e>t){let i=t;t=e,e=i}return this.data[e+"-"+t]}set(e,t,i){if(e>t){let r=t;t=e,e=r}let a=e+"-"+t;this.get(e,t)||this.data.keys.push(a),this.data[a]=i}reset(){let e=this.data,t=e.keys;for(;t.length>0;){let i=t.pop();delete e[i]}}},Q0=class extends U0{constructor(e={}){super();this.dt=void 0,this.allowSleep=void 0,this.contacts=void 0,this.frictionEquations=void 0,this.quatNormalizeSkip=void 0,this.quatNormalizeFast=void 0,this.time=void 0,this.stepnumber=void 0,this.default_dt=void 0,this.nextId=void 0,this.gravity=void 0,this.broadphase=void 0,this.bodies=void 0,this.hasActiveBodies=void 0,this.solver=void 0,this.constraints=void 0,this.narrowphase=void 0,this.collisionMatrix=void 0,this.collisionMatrixPrevious=void 0,this.bodyOverlapKeeper=void 0,this.shapeOverlapKeeper=void 0,this.materials=void 0,this.contactmaterials=void 0,this.contactMaterialTable=void 0,this.defaultMaterial=void 0,this.defaultContactMaterial=void 0,this.doProfiling=void 0,this.profile=void 0,this.accumulator=void 0,this.subsystems=void 0,this.addBodyEvent=void 0,this.removeBodyEvent=void 0,this.idToBodyMap=void 0,this.dt=-1,this.allowSleep=!!e.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=e.quatNormalizeSkip!==void 0?e.quatNormalizeSkip:0,this.quatNormalizeFast=e.quatNormalizeFast!==void 0?e.quatNormalizeFast:!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new y,e.gravity&&this.gravity.copy(e.gravity),this.broadphase=e.broadphase!==void 0?e.broadphase:new m6,this.bodies=[],this.hasActiveBodies=!1,this.solver=e.solver!==void 0?e.solver:new Ya,this.constraints=[],this.narrowphase=new zr(this),this.collisionMatrix=new k0,this.collisionMatrixPrevious=new k0,this.bodyOverlapKeeper=new J0,this.shapeOverlapKeeper=new J0,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new Er,this.defaultMaterial=new He("default"),this.defaultContactMaterial=new Te(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(e,t){return this.contactMaterialTable.get(e.id,t.id)}numObjects(){return this.bodies.length}collisionMatrixTick(){let e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(e){this.constraints.push(e)}removeConstraint(e){let t=this.constraints.indexOf(e);t!==-1&&this.constraints.splice(t,1)}rayTest(e,t,i){i instanceof v6?this.raycastClosest(e,t,{skipBackfaces:!0},i):this.raycastAll(e,t,{skipBackfaces:!0},i)}raycastAll(e,t,i={},a){return i.mode=Q1.ALL,i.from=e,i.to=t,i.callback=a,e3.intersectWorld(this,i)}raycastAny(e,t,i={},a){return i.mode=Q1.ANY,i.from=e,i.to=t,i.result=a,e3.intersectWorld(this,i)}raycastClosest(e,t,i={},a){return i.mode=Q1.CLOSEST,i.from=e,i.to=t,i.result=a,e3.intersectWorld(this,i)}addBody(e){this.bodies.includes(e)||(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof i1&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.idToBodyMap[e.id]=e,this.dispatchEvent(this.addBodyEvent))}removeBody(e){e.world=null;let t=this.bodies.length-1,i=this.bodies,a=i.indexOf(e);if(a!==-1){i.splice(a,1);for(let r=0;r!==i.length;r++)i[r].index=r;this.collisionMatrix.setNumObjects(t),this.removeBodyEvent.body=e,delete this.idToBodyMap[e.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(e){return this.idToBodyMap[e]}getShapeById(e){let t=this.bodies;for(let i=0;i=e&&re*1e3)););this.accumulator=this.accumulator%e;let s=this.accumulator/e;for(let o=0;o!==this.bodies.length;o++){let c=this.bodies[o];c.previousPosition.lerp(c.position,s,c.interpolatedPosition),c.previousQuaternion.slerp(c.quaternion,s,c.interpolatedQuaternion),c.previousQuaternion.normalize()}this.time+=t}}internalStep(e){this.dt=e;let t=this.contacts,i=c9,a=l9,r=this.numObjects(),s=this.bodies,o=this.solver,c=this.gravity,l=this.doProfiling,u=this.profile,f=i1.DYNAMIC,h=-1/0,m=this.constraints,v=o9;c.length();let g=c.x,x=c.y,p=c.z,d=0;for(l&&(h=s2.now()),d=0;d!==r;d++){let z=s[d];if(z.type===f){let H=z.force,V=z.mass;H.x+=V*g,H.y+=V*x,H.z+=V*p}}for(let z=0,H=this.subsystems.length;z!==H;z++)this.subsystems[z].update();l&&(h=s2.now()),i.length=0,a.length=0,this.broadphase.collisionPairs(this,i,a),l&&(u.broadphase=s2.now()-h);let A=m.length;for(d=0;d!==A;d++){let z=m[d];if(!z.collideConnected)for(let H=i.length-1;H>=0;H-=1)(z.bodyA===i[H]&&z.bodyB===a[H]||z.bodyB===i[H]&&z.bodyA===a[H])&&(i.splice(H,1),a.splice(H,1))}this.collisionMatrixTick(),l&&(h=s2.now());let b=s9,C=t.length;for(d=0;d!==C;d++)b.push(t[d]);t.length=0;let E=this.frictionEquations.length;for(d=0;d!==E;d++)v.push(this.frictionEquations[d]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(i,a,this,t,b,this.frictionEquations,v),l&&(u.narrowphase=s2.now()-h),l&&(h=s2.now()),d=0;d=0&&L.material.friction>=0&&V.material.friction*L.material.friction,V.material.restitution>=0&&L.material.restitution>=0&&(H.restitution=V.material.restitution*L.material.restitution)),o.addEquation(H),V.allowSleep&&V.type===i1.DYNAMIC&&V.sleepState===i1.SLEEPING&&L.sleepState===i1.AWAKE&&L.type!==i1.STATIC){let O=L.velocity.lengthSquared()+L.angularVelocity.lengthSquared(),W=L.sleepSpeedLimit**2;O>=W*2&&(V.wakeUpAfterNarrowphase=!0)}if(L.allowSleep&&L.type===i1.DYNAMIC&&L.sleepState===i1.SLEEPING&&V.sleepState===i1.AWAKE&&V.type!==i1.STATIC){let O=V.velocity.lengthSquared()+V.angularVelocity.lengthSquared(),W=V.sleepSpeedLimit**2;O>=W*2&&(L.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(V,L,!0),this.collisionMatrixPrevious.get(V,L)||(w4.body=L,w4.contact=H,V.dispatchEvent(w4),w4.body=V,L.dispatchEvent(w4)),this.bodyOverlapKeeper.set(V.id,L.id),this.shapeOverlapKeeper.set(N.id,U.id)}for(this.emitContactEvents(),l&&(u.makeContactConstraints=s2.now()-h,h=s2.now()),d=0;d!==r;d++){let z=s[d];z.wakeUpAfterNarrowphase&&(z.wakeUp(),z.wakeUpAfterNarrowphase=!1)}for(A=m.length,d=0;d!==A;d++){let z=m[d];z.update();for(let H=0,V=z.equations.length;H!==V;H++){let L=z.equations[H];o.addEquation(L)}}o.solve(e,this),l&&(u.solve=s2.now()-h),o.removeAllEquations();let _=Math.pow;for(d=0;d!==r;d++){let z=s[d];if(z.type&f){let H=_(1-z.linearDamping,e),V=z.velocity;V.scale(H,V);let L=z.angularVelocity;if(L){let N=_(1-z.angularDamping,e);L.scale(N,L)}}}for(this.dispatchEvent(n9),d=0;d!==r;d++){let z=s[d];z.preStep&&z.preStep.call(z)}l&&(h=s2.now());let F=this.stepnumber%(this.quatNormalizeSkip+1)==0,M=this.quatNormalizeFast;for(d=0;d!==r;d++)s[d].integrate(e,F,M);for(this.clearForces(),this.broadphase.dirty=!0,l&&(u.integrate=s2.now()-h),this.stepnumber+=1,this.dispatchEvent(r9),d=0;d!==r;d++){let z=s[d],H=z.postStep;H&&H.call(z)}let D=!0;if(this.allowSleep)for(D=!1,d=0;d!==r;d++){let z=s[d];z.sleepTick(this.time),z.sleepState!==i1.SLEEPING&&(D=!0)}this.hasActiveBodies=D}emitContactEvents(){let e=this.hasAnyEventListener("beginContact"),t=this.hasAnyEventListener("endContact");if((e||t)&&this.bodyOverlapKeeper.getDiff(Ne,Re),e){for(let r=0,s=Ne.length;rDate.now()-n}var r9={type:"postStep"},n9={type:"preStep"},w4={type:i1.COLLIDE_EVENT_NAME,body:null,contact:null},s9=[],o9=[],c9=[],l9=[],Ne=[],Re=[],S4={type:"beginContact",bodyA:null,bodyB:null},_4={type:"endContact",bodyA:null,bodyB:null},Fe={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Be={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null};var q1=class{constructor(e=0,t=0,i=0,a=1){this.x=e,this.y=t,this.z=i,this.w=a}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,a){return this.x=e,this.y=t,this.z=i,this.w=a,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,a=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*a+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*a+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*a+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*a+s[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,a,r,s=.01,o=.1,c=e.elements,l=c[0],u=c[4],f=c[8],h=c[1],m=c[5],v=c[9],g=c[2],x=c[6],p=c[10];if(Math.abs(u-h)b&&A>C?AC?b>8&255]+h2[n>>16&255]+h2[n>>24&255]+"-"+h2[e&255]+h2[e>>8&255]+"-"+h2[e>>16&15|64]+h2[e>>24&255]+"-"+h2[t&63|128]+h2[t>>8&255]+"-"+h2[t>>16&255]+h2[t>>24&255]+h2[i&255]+h2[i>>8&255]+h2[i>>16&255]+h2[i>>24&255]).toUpperCase()}function D2(n,e,t){return Math.max(e,Math.min(t,n))}function Lr(n,e){return(n%e+e)%e}function A6(n,e,t){return(1-t)*n+t*e}function t3(n){return(n&n-1)==0&&n!==0}function Dr(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}var Me=class{constructor(e=0,t=0,i=0,a=1){this._x=e,this._y=t,this._z=i,this._w=a}static slerp(e,t,i,a){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,a)}static slerpFlat(e,t,i,a,r,s,o){let c=i[a+0],l=i[a+1],u=i[a+2],f=i[a+3],h=r[s+0],m=r[s+1],v=r[s+2],g=r[s+3];if(o===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=f;return}if(o===1){e[t+0]=h,e[t+1]=m,e[t+2]=v,e[t+3]=g;return}if(f!==g||c!==h||l!==m||u!==v){let x=1-o,p=c*h+l*m+u*v+f*g,d=p>=0?1:-1,A=1-p*p;if(A>Number.EPSILON){let C=Math.sqrt(A),E=Math.atan2(C,p*d);x=Math.sin(x*E)/C,o=Math.sin(o*E)/C}let b=o*d;if(c=c*x+h*b,l=l*x+m*b,u=u*x+v*b,f=f*x+g*b,x===1-o){let C=1/Math.sqrt(c*c+l*l+u*u+f*f);c*=C,l*=C,u*=C,f*=C}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,a,r,s){let o=i[a],c=i[a+1],l=i[a+2],u=i[a+3],f=r[s],h=r[s+1],m=r[s+2],v=r[s+3];return e[t]=o*v+u*f+c*m-l*h,e[t+1]=c*v+u*h+l*f-o*m,e[t+2]=l*v+u*m+o*h-c*f,e[t+3]=u*v-o*f-c*h-l*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,a){return this._x=e,this._y=t,this._z=i,this._w=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let i=e._x,a=e._y,r=e._z,s=e._order,o=Math.cos,c=Math.sin,l=o(i/2),u=o(a/2),f=o(r/2),h=c(i/2),m=c(a/2),v=c(r/2);switch(s){case"XYZ":this._x=h*u*f+l*m*v,this._y=l*m*f-h*u*v,this._z=l*u*v+h*m*f,this._w=l*u*f-h*m*v;break;case"YXZ":this._x=h*u*f+l*m*v,this._y=l*m*f-h*u*v,this._z=l*u*v-h*m*f,this._w=l*u*f+h*m*v;break;case"ZXY":this._x=h*u*f-l*m*v,this._y=l*m*f+h*u*v,this._z=l*u*v+h*m*f,this._w=l*u*f-h*m*v;break;case"ZYX":this._x=h*u*f-l*m*v,this._y=l*m*f+h*u*v,this._z=l*u*v-h*m*f,this._w=l*u*f+h*m*v;break;case"YZX":this._x=h*u*f+l*m*v,this._y=l*m*f+h*u*v,this._z=l*u*v-h*m*f,this._w=l*u*f-h*m*v;break;case"XZY":this._x=h*u*f-l*m*v,this._y=l*m*f-h*u*v,this._z=l*u*v+h*m*f,this._w=l*u*f+h*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],a=t[4],r=t[8],s=t[1],o=t[5],c=t[9],l=t[2],u=t[6],f=t[10],h=i+o+f;if(h>0){let m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(u-c)*m,this._y=(r-l)*m,this._z=(s-a)*m}else if(i>o&&i>f){let m=2*Math.sqrt(1+i-o-f);this._w=(u-c)/m,this._x=.25*m,this._y=(a+s)/m,this._z=(r+l)/m}else if(o>f){let m=2*Math.sqrt(1+o-i-f);this._w=(r-l)/m,this._x=(a+s)/m,this._y=.25*m,this._z=(c+u)/m}else{let m=2*Math.sqrt(1+f-i-o);this._w=(s-a)/m,this._x=(r+l)/m,this._y=(c+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(D2(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let a=Math.min(1,t/i);return this.slerp(e,a),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,a=e._y,r=e._z,s=e._w,o=t._x,c=t._y,l=t._z,u=t._w;return this._x=i*u+s*o+a*l-r*c,this._y=a*u+s*c+r*o-i*l,this._z=r*u+s*l+i*c-a*o,this._w=s*u-i*o-a*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,a=this._y,r=this._z,s=this._w,o=s*e._w+i*e._x+a*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=a,this._z=r,this;let c=1-o*o;if(c<=Number.EPSILON){let m=1-t;return this._w=m*s+t*this._w,this._x=m*i+t*this._x,this._y=m*a+t*this._y,this._z=m*r+t*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(c),u=Math.atan2(l,o),f=Math.sin((1-t)*u)/l,h=Math.sin(t*u)/l;return this._w=s*f+this._w*h,this._x=i*f+this._x*h,this._y=a*f+this._y*h,this._z=r*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),a=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(a),i*Math.sin(r),i*Math.cos(r),t*Math.sin(a))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Me.prototype.isQuaternion=!0;var k=class{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Tr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Tr.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*a,this.y=r[1]*t+r[4]*i+r[7]*a,this.z=r[2]*t+r[5]*i+r[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,a=this.z,r=e.elements,s=1/(r[3]*t+r[7]*i+r[11]*a+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*a+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*a+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*a+r[14])*s,this}applyQuaternion(e){let t=this.x,i=this.y,a=this.z,r=e.x,s=e.y,o=e.z,c=e.w,l=c*t+s*a-o*i,u=c*i+o*t-r*a,f=c*a+r*i-s*t,h=-r*t-s*i-o*a;return this.x=l*c+h*-r+u*-o-f*-s,this.y=u*c+h*-s+f*-r-l*-o,this.z=f*c+h*-o+l*-s-u*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,a=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*a,this.y=r[1]*t+r[5]*i+r[9]*a,this.z=r[2]*t+r[6]*i+r[10]*a,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,a=e.y,r=e.z,s=t.x,o=t.y,c=t.z;return this.x=a*c-r*o,this.y=r*s-i*c,this.z=i*o-a*s,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return i3.copy(this).projectOnVector(e),this.sub(i3)}reflect(e){return this.sub(i3.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(D2(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return t*t+i*i+a*a}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let a=Math.sin(t)*e;return this.x=a*Math.sin(i),this.y=Math.cos(t)*e,this.z=a*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=a,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};k.prototype.isVector3=!0;var i3=new k,Tr=new Me;var z1=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6],this.y=a[1]*t+a[4]*i+a[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),a=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*i-s*a+e.x,this.y=r*a+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};z1.prototype.isVector2=!0;var Hr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},K2={h:0,s:0,l:0},w6={h:0,s:0,l:0};function a3(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function zt(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function r3(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}var x1=class{constructor(e,t,i){return t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=Lr(e,1),t=D2(t,0,1),i=D2(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,r=2*i-a;this.r=a3(r,a,e+1/3),this.g=a3(r,a,e),this.b=a3(r,a,e-1/3)}return this}setStyle(e){function t(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let a,r=i[1],s=i[2];switch(r){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,t(a[4]),this;if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,t(a[4]),this;break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){let o=parseFloat(a[1])/360,c=parseInt(a[2],10)/100,l=parseInt(a[3],10)/100;return t(a[4]),this.setHSL(o,c,l)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=i[1],r=a.length;if(r===3)return this.r=parseInt(a.charAt(0)+a.charAt(0),16)/255,this.g=parseInt(a.charAt(1)+a.charAt(1),16)/255,this.b=parseInt(a.charAt(2)+a.charAt(2),16)/255,this;if(r===6)return this.r=parseInt(a.charAt(0)+a.charAt(1),16)/255,this.g=parseInt(a.charAt(2)+a.charAt(3),16)/255,this.b=parseInt(a.charAt(4)+a.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=Hr[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zt(e.r),this.g=zt(e.g),this.b=zt(e.b),this}copyLinearToSRGB(e){return this.r=r3(e.r),this.g=r3(e.g),this.b=r3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,i=this.g,a=this.b,r=Math.max(t,i,a),s=Math.min(t,i,a),o,c,l=(s+r)/2;if(s===r)o=0,c=0;else{let u=r-s;switch(c=l<=.5?u/(r+s):u/(2-r-s),r){case t:o=(i-a)/u+(ir&&(r=u),f>s&&(s=f),h>o&&(o=h)}return this.min.set(t,i,a),this.max.set(r,s,o),this}setFromBufferAttribute(e){let t=1/0,i=1/0,a=1/0,r=-1/0,s=-1/0,o=-1/0;for(let c=0,l=e.count;cr&&(r=u),f>s&&(s=f),h>o&&(o=h)}return this.min.set(t,i,a),this.max.set(r,s,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,St),St.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(P4),B6.subVectors(this.max,P4),jt.subVectors(e.a,P4),Xt.subVectors(e.b,P4),Zt.subVectors(e.c,P4),st.subVectors(Xt,jt),ot.subVectors(Zt,Xt),_t.subVectors(jt,Zt);let t=[0,-st.z,st.y,0,-ot.z,ot.y,0,-_t.z,_t.y,st.z,0,-st.x,ot.z,0,-ot.x,_t.z,0,-_t.x,-st.y,st.x,0,-ot.y,ot.x,0,-_t.y,_t.x,0];return!P3(t,jt,Xt,Zt,B6)||(t=[1,0,0,0,1,0,0,0,1],!P3(t,jt,Xt,Zt,B6))?!1:(P6.crossVectors(st,ot),t=[P6.x,P6.y,P6.z],P3(t,jt,Xt,Zt,B6))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return St.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(St).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ge[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ge[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ge[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ge[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ge[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ge[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ge[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ge[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ge),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Oe.prototype.isBox3=!0;var Ge=[new k,new k,new k,new k,new k,new k,new k,new k],St=new k,B3=new Oe,jt=new k,Xt=new k,Zt=new k,st=new k,ot=new k,_t=new k,P4=new k,B6=new k,P6=new k,Et=new k;function P3(n,e,t,i,a){for(let r=0,s=n.length-3;r<=s;r+=3){Et.fromArray(n,r);let o=a.x*Math.abs(Et.x)+a.y*Math.abs(Et.y)+a.z*Math.abs(Et.z),c=e.dot(Et),l=t.dot(Et),u=i.dot(Et);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>o)return!1}return!0}var F2=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let a=this._listeners[e];if(a!==void 0){let r=a.indexOf(t);r!==-1&&a.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let a=i.slice(0);for(let r=0,s=a.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){I3.subVectors(e,this.center);let t=I3.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.add(I3.multiplyScalar(a/i)),this.radius+=a}return this}union(e){return this.center.equals(e.center)===!0?I6.set(0,0,1).multiplyScalar(e.radius):I6.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(L8.copy(e.center).add(I6)),this.expandByPoint(L8.copy(e.center).sub(I6)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};var k1=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,a,r,s,o,c,l,u,f,h,m,v,g,x){let p=this.elements;return p[0]=e,p[4]=t,p[8]=i,p[12]=a,p[1]=r,p[5]=s,p[9]=o,p[13]=c,p[2]=l,p[6]=u,p[10]=f,p[14]=h,p[3]=m,p[7]=v,p[11]=g,p[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new k1().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,a=1/Yt.setFromMatrixColumn(e,0).length(),r=1/Yt.setFromMatrixColumn(e,1).length(),s=1/Yt.setFromMatrixColumn(e,2).length();return t[0]=i[0]*a,t[1]=i[1]*a,t[2]=i[2]*a,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,i=e.x,a=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),c=Math.cos(a),l=Math.sin(a),u=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){let h=s*u,m=s*f,v=o*u,g=o*f;t[0]=c*u,t[4]=-c*f,t[8]=l,t[1]=m+v*l,t[5]=h-g*l,t[9]=-o*c,t[2]=g-h*l,t[6]=v+m*l,t[10]=s*c}else if(e.order==="YXZ"){let h=c*u,m=c*f,v=l*u,g=l*f;t[0]=h+g*o,t[4]=v*o-m,t[8]=s*l,t[1]=s*f,t[5]=s*u,t[9]=-o,t[2]=m*o-v,t[6]=g+h*o,t[10]=s*c}else if(e.order==="ZXY"){let h=c*u,m=c*f,v=l*u,g=l*f;t[0]=h-g*o,t[4]=-s*f,t[8]=v+m*o,t[1]=m+v*o,t[5]=s*u,t[9]=g-h*o,t[2]=-s*l,t[6]=o,t[10]=s*c}else if(e.order==="ZYX"){let h=s*u,m=s*f,v=o*u,g=o*f;t[0]=c*u,t[4]=v*l-m,t[8]=h*l+g,t[1]=c*f,t[5]=g*l+h,t[9]=m*l-v,t[2]=-l,t[6]=o*c,t[10]=s*c}else if(e.order==="YZX"){let h=s*c,m=s*l,v=o*c,g=o*l;t[0]=c*u,t[4]=g-h*f,t[8]=v*f+m,t[1]=f,t[5]=s*u,t[9]=-o*u,t[2]=-l*u,t[6]=m*f+v,t[10]=h-g*f}else if(e.order==="XZY"){let h=s*c,m=s*l,v=o*c,g=o*l;t[0]=c*u,t[4]=-f,t[8]=l*u,t[1]=h*f+g,t[5]=s*u,t[9]=m*f-v,t[2]=v*f-m,t[6]=o*u,t[10]=g*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(h9,e,f9)}lookAt(e,t,i){let a=this.elements;return B2.subVectors(e,t),B2.lengthSq()===0&&(B2.z=1),B2.normalize(),ct.crossVectors(i,B2),ct.lengthSq()===0&&(Math.abs(i.z)===1?B2.x+=1e-4:B2.z+=1e-4,B2.normalize(),ct.crossVectors(i,B2)),ct.normalize(),k6.crossVectors(B2,ct),a[0]=ct.x,a[4]=k6.x,a[8]=B2.x,a[1]=ct.y,a[5]=k6.y,a[9]=B2.y,a[2]=ct.z,a[6]=k6.z,a[10]=B2.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[4],c=i[8],l=i[12],u=i[1],f=i[5],h=i[9],m=i[13],v=i[2],g=i[6],x=i[10],p=i[14],d=i[3],A=i[7],b=i[11],C=i[15],E=a[0],T=a[4],_=a[8],P=a[12],F=a[1],M=a[5],D=a[9],z=a[13],H=a[2],V=a[6],L=a[10],N=a[14],U=a[3],Z=a[7],O=a[11],W=a[15];return r[0]=s*E+o*F+c*H+l*U,r[4]=s*T+o*M+c*V+l*Z,r[8]=s*_+o*D+c*L+l*O,r[12]=s*P+o*z+c*N+l*W,r[1]=u*E+f*F+h*H+m*U,r[5]=u*T+f*M+h*V+m*Z,r[9]=u*_+f*D+h*L+m*O,r[13]=u*P+f*z+h*N+m*W,r[2]=v*E+g*F+x*H+p*U,r[6]=v*T+g*M+x*V+p*Z,r[10]=v*_+g*D+x*L+p*O,r[14]=v*P+g*z+x*N+p*W,r[3]=d*E+A*F+b*H+C*U,r[7]=d*T+A*M+b*V+C*Z,r[11]=d*_+A*D+b*L+C*O,r[15]=d*P+A*z+b*N+C*W,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],a=e[8],r=e[12],s=e[1],o=e[5],c=e[9],l=e[13],u=e[2],f=e[6],h=e[10],m=e[14],v=e[3],g=e[7],x=e[11],p=e[15];return v*(+r*c*f-a*l*f-r*o*h+i*l*h+a*o*m-i*c*m)+g*(+t*c*m-t*l*h+r*s*h-a*s*m+a*l*u-r*c*u)+x*(+t*l*f-t*o*m-r*s*f+i*s*m+r*o*u-i*l*u)+p*(-a*o*u-t*c*f+t*o*h+a*s*f-i*s*h+i*c*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=t,a[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],m=e[11],v=e[12],g=e[13],x=e[14],p=e[15],d=f*x*l-g*h*l+g*c*m-o*x*m-f*c*p+o*h*p,A=v*h*l-u*x*l-v*c*m+s*x*m+u*c*p-s*h*p,b=u*g*l-v*f*l+v*o*m-s*g*m-u*o*p+s*f*p,C=v*f*c-u*g*c-v*o*h+s*g*h+u*o*x-s*f*x,E=t*d+i*A+a*b+r*C;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let T=1/E;return e[0]=d*T,e[1]=(g*h*r-f*x*r-g*a*m+i*x*m+f*a*p-i*h*p)*T,e[2]=(o*x*r-g*c*r+g*a*l-i*x*l-o*a*p+i*c*p)*T,e[3]=(f*c*r-o*h*r-f*a*l+i*h*l+o*a*m-i*c*m)*T,e[4]=A*T,e[5]=(u*x*r-v*h*r+v*a*m-t*x*m-u*a*p+t*h*p)*T,e[6]=(v*c*r-s*x*r-v*a*l+t*x*l+s*a*p-t*c*p)*T,e[7]=(s*h*r-u*c*r+u*a*l-t*h*l-s*a*m+t*c*m)*T,e[8]=b*T,e[9]=(v*f*r-u*g*r-v*i*m+t*g*m+u*i*p-t*f*p)*T,e[10]=(s*g*r-v*o*r+v*i*l-t*g*l-s*i*p+t*o*p)*T,e[11]=(u*o*r-s*f*r-u*i*l+t*f*l+s*i*m-t*o*m)*T,e[12]=C*T,e[13]=(u*g*a-v*f*a+v*i*h-t*g*h-u*i*x+t*f*x)*T,e[14]=(v*o*a-s*g*a-v*i*c+t*g*c+s*i*x-t*o*x)*T,e[15]=(s*f*a-u*o*a+u*i*c-t*f*c-s*i*h+t*o*h)*T,this}scale(e){let t=this.elements,i=e.x,a=e.y,r=e.z;return t[0]*=i,t[4]*=a,t[8]*=r,t[1]*=i,t[5]*=a,t[9]*=r,t[2]*=i,t[6]*=a,t[10]*=r,t[3]*=i,t[7]*=a,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,a))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),a=Math.sin(t),r=1-i,s=e.x,o=e.y,c=e.z,l=r*s,u=r*o;return this.set(l*s+i,l*o-a*c,l*c+a*o,0,l*o+a*c,u*o+i,u*c-a*s,0,l*c-a*o,u*c+a*s,r*c*c+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,a,r,s){return this.set(1,i,r,0,e,1,s,0,t,a,1,0,0,0,0,1),this}compose(e,t,i){let a=this.elements,r=t._x,s=t._y,o=t._z,c=t._w,l=r+r,u=s+s,f=o+o,h=r*l,m=r*u,v=r*f,g=s*u,x=s*f,p=o*f,d=c*l,A=c*u,b=c*f,C=i.x,E=i.y,T=i.z;return a[0]=(1-(g+p))*C,a[1]=(m+b)*C,a[2]=(v-A)*C,a[3]=0,a[4]=(m-b)*E,a[5]=(1-(h+p))*E,a[6]=(x+d)*E,a[7]=0,a[8]=(v+A)*T,a[9]=(x-d)*T,a[10]=(1-(h+g))*T,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,t,i){let a=this.elements,r=Yt.set(a[0],a[1],a[2]).length(),s=Yt.set(a[4],a[5],a[6]).length(),o=Yt.set(a[8],a[9],a[10]).length();this.determinant()<0&&(r=-r),e.x=a[12],e.y=a[13],e.z=a[14],te.copy(this);let l=1/r,u=1/s,f=1/o;return te.elements[0]*=l,te.elements[1]*=l,te.elements[2]*=l,te.elements[4]*=u,te.elements[5]*=u,te.elements[6]*=u,te.elements[8]*=f,te.elements[9]*=f,te.elements[10]*=f,t.setFromRotationMatrix(te),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,a,r,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let o=this.elements,c=2*r/(t-e),l=2*r/(i-a),u=(t+e)/(t-e),f=(i+a)/(i-a),h=-(s+r)/(s-r),m=-2*s*r/(s-r);return o[0]=c,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=f,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=m,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,i,a,r,s){let o=this.elements,c=1/(t-e),l=1/(i-a),u=1/(s-r),f=(t+e)*c,h=(i+a)*l,m=(s+r)*u;return o[0]=2*c,o[4]=0,o[8]=0,o[12]=-f,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-m,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let a=0;a<16;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};k1.prototype.isMatrix4=!0;var Yt=new k,te=new k1,h9=new k(0,0,0),f9=new k(1,1,1),ct=new k,k6=new k,B2=new k;var D8=new k1,T8=new Me,lt=class{constructor(e=0,t=0,i=0,a=lt.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=a}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,a=this._order){return this._x=e,this._y=t,this._z=i,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let a=e.elements,r=a[0],s=a[4],o=a[8],c=a[1],l=a[5],u=a[9],f=a[2],h=a[6],m=a[10];switch(t){case"XYZ":this._y=Math.asin(D2(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-D2(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(D2(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-D2(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(D2(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-D2(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return D8.makeRotationFromQuaternion(e),this.setFromRotationMatrix(D8,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return T8.setFromEuler(this),this.setFromQuaternion(T8,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new k(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};lt.prototype.isEuler=!0;lt.DefaultOrder="XYZ";lt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var I4=class{constructor(){this.mask=1|0}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,a,r,s,o,c,l){let u=this.elements;return u[0]=e,u[1]=a,u[2]=o,u[3]=t,u[4]=r,u[5]=c,u[6]=i,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,a=t.elements,r=this.elements,s=i[0],o=i[3],c=i[6],l=i[1],u=i[4],f=i[7],h=i[2],m=i[5],v=i[8],g=a[0],x=a[3],p=a[6],d=a[1],A=a[4],b=a[7],C=a[2],E=a[5],T=a[8];return r[0]=s*g+o*d+c*C,r[3]=s*x+o*A+c*E,r[6]=s*p+o*b+c*T,r[1]=l*g+u*d+f*C,r[4]=l*x+u*A+f*E,r[7]=l*p+u*b+f*T,r[2]=h*g+m*d+v*C,r[5]=h*x+m*A+v*E,r[8]=h*p+m*b+v*T,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],l=e[7],u=e[8];return t*s*u-t*o*l-i*r*u+i*o*c+a*r*l-a*s*c}invert(){let e=this.elements,t=e[0],i=e[1],a=e[2],r=e[3],s=e[4],o=e[5],c=e[6],l=e[7],u=e[8],f=u*s-o*l,h=o*c-u*r,m=l*r-s*c,v=t*f+i*h+a*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/v;return e[0]=f*g,e[1]=(a*l-u*i)*g,e[2]=(o*i-a*s)*g,e[3]=h*g,e[4]=(u*t-a*c)*g,e[5]=(a*r-o*t)*g,e[6]=m*g,e[7]=(i*c-l*t)*g,e[8]=(s*t-i*r)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,a,r,s,o){let c=Math.cos(r),l=Math.sin(r);return this.set(i*c,i*l,-i*(c*s+l*o)+s+e,-a*l,a*c,-a*(-l*s+c*o)+o+t,0,0,1),this}scale(e,t){let i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),a=this.elements,r=a[0],s=a[3],o=a[6],c=a[1],l=a[4],u=a[7];return a[0]=t*r+i*c,a[3]=t*s+i*l,a[6]=t*o+i*u,a[1]=-i*r+t*c,a[4]=-i*s+t*l,a[7]=-i*o+t*u,this}translate(e,t){let i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){let t=this.elements,i=e.elements;for(let a=0;a<9;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};n2.prototype.isMatrix3=!0;var d9=0,H8=new k,$t=new Me,We=new k1,U6=new k,k4=new k,p9=new k,m9=new Me,V8=new k(1,0,0),N8=new k(0,1,0),R8=new k(0,0,1),v9={type:"added"},F8={type:"removed"},j1=class extends F2{constructor(){super();Object.defineProperty(this,"id",{value:d9++}),this.uuid=Pe(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=j1.DefaultUp.clone();let e=new k,t=new lt,i=new Me,a=new k(1,1,1);function r(){i.setFromEuler(t,!1)}function s(){t.setFromQuaternion(i,void 0,!1)}t._onChange(r),i._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new k1},normalMatrix:{value:new n2}}),this.matrix=new k1,this.matrixWorld=new k1,this.matrixAutoUpdate=j1.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new I4,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return $t.setFromAxisAngle(e,t),this.quaternion.multiply($t),this}rotateOnWorldAxis(e,t){return $t.setFromAxisAngle(e,t),this.quaternion.premultiply($t),this}rotateX(e){return this.rotateOnAxis(V8,e)}rotateY(e){return this.rotateOnAxis(N8,e)}rotateZ(e){return this.rotateOnAxis(R8,e)}translateOnAxis(e,t){return H8.copy(e).applyQuaternion(this.quaternion),this.position.add(H8.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(V8,e)}translateY(e){return this.translateOnAxis(N8,e)}translateZ(e){return this.translateOnAxis(R8,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(We.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?U6.copy(e):U6.set(e,t,i);let a=this.parent;this.updateWorldMatrix(!0,!1),k4.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?We.lookAt(k4,U6,this.up):We.lookAt(U6,k4,this.up),this.quaternion.setFromRotationMatrix(We),a&&(We.extractRotation(a.matrixWorld),$t.setFromRotationMatrix(We),this.quaternion.premultiply($t.invert()))}add(e){if(arguments.length>1){for(let t=0;t1){for(let i=0;i0){a.children=[];for(let o=0;o0){a.animations=[];for(let o=0;o0&&(i.geometries=o),c.length>0&&(i.materials=c),l.length>0&&(i.textures=l),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),m.length>0&&(i.animations=m)}return i.object=a,i;function s(o){let c=[];for(let l in o){let u=o[l];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i=0;--e)if(n[e]>65535)return!0;return!1}function Lt(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}var g9=0,G2=new k1,k3=new j1,Kt=new k,P2=new Oe,U4=new Oe,c2=new k,b2=class extends F2{constructor(){super();Object.defineProperty(this,"id",{value:g9++}),this.uuid=Pe(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(O6(e)?B4:F4)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(i!==void 0){let r=new n2().getNormalMatrix(e);i.applyNormalMatrix(r),i.needsUpdate=!0}let a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(e),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return G2.makeRotationFromQuaternion(e),this.applyMatrix4(G2),this}rotateX(e){return G2.makeRotationX(e),this.applyMatrix4(G2),this}rotateY(e){return G2.makeRotationY(e),this.applyMatrix4(G2),this}rotateZ(e){return G2.makeRotationZ(e),this.applyMatrix4(G2),this}translate(e,t,i){return G2.makeTranslation(e,t,i),this.applyMatrix4(G2),this}scale(e,t,i){return G2.makeScale(e,t,i),this.applyMatrix4(G2),this}lookAt(e){return k3.lookAt(e),k3.updateMatrix(),this.applyMatrix4(k3.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Kt).negate(),this.translate(Kt.x,Kt.y,Kt.z),this}setFromPoints(e){let t=[];for(let i=0,a=e.length;i0&&(e.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let c in i){let l=i[c];e.data.attributes[c]=l.toJSON(e.data)}let a={},r=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],u=[];for(let f=0,h=l.length;f0&&(a[c]=u,r=!0)}r&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let a=e.attributes;for(let l in a){let u=a[l];this.setAttribute(l,u.clone(t))}let r=e.morphAttributes;for(let l in r){let u=[],f=r[l];for(let h=0,m=f.length;h0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===Fr;continue}let a=this[t];if(a===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==wt&&(i.blending=this.blending),this.side!==Ie&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.alphaWrite=this.alphaWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData);function a(r){let s=[];for(let o in r){let c=r[o];delete c.metadata,s.push(c)}return s}if(t){let r=a(e.textures),s=a(e.images);r.length>0&&(i.textures=r),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let a=t.length;i=new Array(a);for(let r=0;r!==a;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.alphaWrite=e.alphaWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};T2.prototype.isMaterial=!0;var O4=class extends T2{constructor(e){super();this.type="MeshPhongMaterial",this.color=new x1(16777215),this.specular=new x1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new x1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=N6,this.normalScale=new z1(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=qt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}};O4.prototype.isMeshPhongMaterial=!0;var je=new k,U3=new k,G6=new k,ut=new k,O3=new k,q6=new k,G3=new k,q3=class{constructor(e=new k,t=new k(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,je)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=je.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(je.copy(this.direction).multiplyScalar(t).add(this.origin),je.distanceToSquared(e))}distanceSqToSegment(e,t,i,a){U3.copy(e).add(t).multiplyScalar(.5),G6.copy(t).sub(e).normalize(),ut.copy(this.origin).sub(U3);let r=e.distanceTo(t)*.5,s=-this.direction.dot(G6),o=ut.dot(this.direction),c=-ut.dot(G6),l=ut.lengthSq(),u=Math.abs(1-s*s),f,h,m,v;if(u>0)if(f=s*c-o,h=s*o-c,v=r*u,f>=0)if(h>=-v)if(h<=v){let g=1/u;f*=g,h*=g,m=f*(f+s*h+2*o)+h*(s*f+h+2*c)+l}else h=r,f=Math.max(0,-(s*h+o)),m=-f*f+h*(h+2*c)+l;else h=-r,f=Math.max(0,-(s*h+o)),m=-f*f+h*(h+2*c)+l;else h<=-v?(f=Math.max(0,-(-s*r+o)),h=f>0?-r:Math.min(Math.max(-r,-c),r),m=-f*f+h*(h+2*c)+l):h<=v?(f=0,h=Math.min(Math.max(-r,-c),r),m=h*(h+2*c)+l):(f=Math.max(0,-(s*r+o)),h=f>0?r:Math.min(Math.max(-r,-c),r),m=-f*f+h*(h+2*c)+l);else h=s>0?-r:r,f=Math.max(0,-(s*h+o)),m=-f*f+h*(h+2*c)+l;return i&&i.copy(this.direction).multiplyScalar(f).add(this.origin),a&&a.copy(G6).multiplyScalar(h).add(U3),m}intersectSphere(e,t){je.subVectors(e.center,this.origin);let i=je.dot(this.direction),a=je.dot(je)-i*i,r=e.radius*e.radius;if(a>r)return null;let s=Math.sqrt(r-a),o=i-s,c=i+s;return o<0&&c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,a,r,s,o,c,l=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,a=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,a=(e.min.x-h.x)*l),u>=0?(r=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),i>s||r>a||((r>i||i!==i)&&(i=r),(s=0?(o=(e.min.z-h.z)*f,c=(e.max.z-h.z)*f):(o=(e.max.z-h.z)*f,c=(e.min.z-h.z)*f),i>c||o>a)||((o>i||i!==i)&&(i=o),(c=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,je)!==null}intersectTriangle(e,t,i,a,r){O3.subVectors(t,e),q6.subVectors(i,e),G3.crossVectors(O3,q6);let s=this.direction.dot(G3),o;if(s>0){if(a)return null;o=1}else if(s<0)o=-1,s=-s;else return null;ut.subVectors(this.origin,e);let c=o*this.direction.dot(q6.crossVectors(ut,q6));if(c<0)return null;let l=o*this.direction.dot(O3.cross(ut));if(l<0||c+l>s)return null;let u=-o*ut.dot(G3);return u<0?null:this.at(u/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};var ie=new k,Xe=new k,W3=new k,Ze=new k,Jt=new k,Qt=new k,B8=new k,j3=new k,X3=new k,Z3=new k,ae=class{constructor(e=new k,t=new k,i=new k){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,a){a.subVectors(i,t),ie.subVectors(e,t),a.cross(ie);let r=a.lengthSq();return r>0?a.multiplyScalar(1/Math.sqrt(r)):a.set(0,0,0)}static getBarycoord(e,t,i,a,r){ie.subVectors(a,t),Xe.subVectors(i,t),W3.subVectors(e,t);let s=ie.dot(ie),o=ie.dot(Xe),c=ie.dot(W3),l=Xe.dot(Xe),u=Xe.dot(W3),f=s*l-o*o;if(f===0)return r.set(-2,-1,-1);let h=1/f,m=(l*c-o*u)*h,v=(s*u-o*c)*h;return r.set(1-m-v,v,m)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,Ze),Ze.x>=0&&Ze.y>=0&&Ze.x+Ze.y<=1}static getUV(e,t,i,a,r,s,o,c){return this.getBarycoord(e,t,i,a,Ze),c.set(0,0),c.addScaledVector(r,Ze.x),c.addScaledVector(s,Ze.y),c.addScaledVector(o,Ze.z),c}static isFrontFacing(e,t,i,a){return ie.subVectors(i,t),Xe.subVectors(e,t),ie.cross(Xe).dot(a)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,a){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,t,i,a){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ie.subVectors(this.c,this.b),Xe.subVectors(this.a,this.b),ie.cross(Xe).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ae.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ae.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,a,r){return ae.getUV(e,this.a,this.b,this.c,t,i,a,r)}containsPoint(e){return ae.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ae.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,a=this.b,r=this.c,s,o;Jt.subVectors(a,i),Qt.subVectors(r,i),j3.subVectors(e,i);let c=Jt.dot(j3),l=Qt.dot(j3);if(c<=0&&l<=0)return t.copy(i);X3.subVectors(e,a);let u=Jt.dot(X3),f=Qt.dot(X3);if(u>=0&&f<=u)return t.copy(a);let h=c*f-u*l;if(h<=0&&c>=0&&u<=0)return s=c/(c-u),t.copy(i).addScaledVector(Jt,s);Z3.subVectors(e,r);let m=Jt.dot(Z3),v=Qt.dot(Z3);if(v>=0&&m<=v)return t.copy(r);let g=m*l-c*v;if(g<=0&&l>=0&&v<=0)return o=l/(l-v),t.copy(i).addScaledVector(Qt,o);let x=u*v-m*f;if(x<=0&&f-u>=0&&m-v>=0)return B8.subVectors(r,a),o=(f-u)/(f-u+(m-v)),t.copy(a).addScaledVector(B8,o);let p=1/(x+g+h);return s=g*p,o=h*p,t.copy(i).addScaledVector(Jt,s).addScaledVector(Qt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};var e4=class extends T2{constructor(e){super();this.type="MeshBasicMaterial",this.color=new x1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=qt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};e4.prototype.isMeshBasicMaterial=!0;var P8=new k1,t4=new q3,Y3=new qe,ht=new k,ft=new k,dt=new k,$3=new k,K3=new k,J3=new k,W6=new k,j6=new k,X6=new k,Z6=new z1,Y6=new z1,$6=new z1,Q3=new k,K6=new k,l2=class extends j1{constructor(e=new b2,t=new e4){super();this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,s=a.length;r0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let i=this.geometry,a=this.material,r=this.matrixWorld;if(a===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),Y3.copy(i.boundingSphere),Y3.applyMatrix4(r),e.ray.intersectsSphere(Y3)===!1)||(P8.copy(r).invert(),t4.copy(e.ray).applyMatrix4(P8),i.boundingBox!==null&&t4.intersectsBox(i.boundingBox)===!1))return;let s;if(i.isBufferGeometry){let o=i.index,c=i.attributes.position,l=i.morphAttributes.position,u=i.morphTargetsRelative,f=i.attributes.uv,h=i.attributes.uv2,m=i.groups,v=i.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,x=m.length;gt.far?null:{distance:l,point:K6.clone(),object:n}}function J6(n,e,t,i,a,r,s,o,c,l,u,f){ht.fromBufferAttribute(a,l),ft.fromBufferAttribute(a,u),dt.fromBufferAttribute(a,f);let h=n.morphTargetInfluences;if(r&&h){W6.set(0,0,0),j6.set(0,0,0),X6.set(0,0,0);for(let v=0,g=r.length;v2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){let t=Lt("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let a=i.getImageData(0,0,e.width,e.height),r=a.data;for(let s=0;s1)switch(this.wrapS){case V4:e.x=e.x-Math.floor(e.x);break;case o2:e.x=e.x<0?0:1;break;case N4:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case V4:e.y=e.y-Math.floor(e.y);break;case o2:e.y=e.y<0?0:1;break;case N4:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};K1.DEFAULT_IMAGE=void 0;K1.DEFAULT_MAPPING=h3;K1.prototype.isTexture=!0;function ei(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?G4.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var I8={specular:1515554,color:15790320,shininess:60,flatShading:!0},q2={diceColor:"#202020",textColor:"#ffffff"},re=class{constructor(e,t,i={diceColor:"#202020",textColor:"#aaaaaa"}){this.w=e;this.h=t;this.options=i;this.scale=50;this.labels=[" ","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];this.fontFace="Arial";this.options={...q2,...i}}setColor({diceColor:e,textColor:t}){e&&(this.options.diceColor=e),t&&(this.options.textColor=t)}get radius(){return this.scale*this.scaleFactor}get diceColor(){return this.options.diceColor}get textColor(){return this.options.textColor}get buffer(){return this.geometry.geometry}create(){this.textureSize=this.calculateTextureSize(this.scale/2+this.scale*this.margin)*2;let e=this.getGeometry(),t=this.getMaterials();return this.geometry=new l2(e,t),this.geometry.receiveShadow=!0,this.geometry.castShadow=!0,this.body.position.set(0+this.radius*2*Math.random(),0+this.radius*2*Math.random(),0+this.radius*4),this.body.velocity.x=500*Math.random()*2-1,this.body.velocity.y=500*Math.random()*2-1,this.body.angularVelocity.x=100*Math.random(),this.body.angularVelocity.y=100*Math.random(),this}getGeometry(){let e=new Array(this.vertices.length);for(let i=0;i=0&&u=0&&l!==c+1?o.unshift([r,l],[s,u]):o.push([r,l],[s,u]),c=l)}o.length===4&&i.push([i[o[0][0]][o[0][1]],i[o[1][0]][o[1][1]],i[o[3][0]][o[3][1]],i[o[2][0]][o[2][1]],-1])}for(let r=0;r=0&&u<4){--u==-1&&(u=3);let f=i[l][u];if(s.indexOf(f)>=0){o.push(f);break}}}--c}o.push(-1),i.push(o)}return{vectors:t,faces:i}}makeGeometry(e,t){let i=new b2;for(let f=0;f1&&(o=o/l.length,s.font=`${o}pt '${this.fontFace}'`,c=s.measureText("M").width*1.2,a-=c*l.length/2);for(let f=0,h=l.length;f0?-1:1)*.9,y:this.h*(r.y>0?-1:1)*.9,z:Math.random()*200+200},o=Math.abs(r.x/r.y);o>1?s.y/=o:s.x*=o;let c=this.makeRandomVector(a),l={x:c.x*i,y:c.y*i,z:-10},u={x:-(Math.random()*r.y*5+this.inertia*r.y),y:Math.random()*r.x*5+this.inertia*r.x,z:0},f={x:Math.random(),y:Math.random(),z:Math.random(),w:Math.random()};return{pos:s,velocity:l,angular:u,axis:f}}makeRandomVector(e){let t=Math.random()*Math.PI/5-Math.PI/5/2,i={x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)};return i.x==0&&(i.x=.01),i.y==0&&(i.y=.01),i}get buffer(){return this.geometry.geometry}get result(){return this.getUpsideValue()}getUpsideValue(){let e=new U(0,0,this.sides==4?-1:1),t,i=Math.PI*2,a=this.buffer.getAttribute("normal").array;for(let s=0,o=this.buffer.groups.length;sthis.sides;)s-=this.sides;for(;s<1;)s+=this.sides;t.groups[a].materialIndex=s+1}}this.updateMaterialsForValue(e-i),this.geometry.geometry=t}resetBody(){this.body.vlambda=new y,this.body.position=new y,this.body.previousPosition=new y,this.body.initPosition=new y,this.body.velocity=new y,this.body.initVelocity=new y,this.body.force=new y,this.body.torque=new y,this.body.quaternion=new G1,this.body.initQuaternion=new G1,this.body.angularVelocity=new y,this.body.initAngularVelocity=new y,this.body.interpolatedPosition=new y,this.body.interpolatedQuaternion=new G1,this.body.inertia=new y,this.body.invInertia=new y,this.body.invInertiaWorld=new E2,this.body.invInertiaSolve=new y,this.body.invInertiaWorldSolve=new E2,this.body.wlambda=new y,this.body.updateMassProperties()}updateMaterialsForValue(e){}set(){this.geometry.position.set(this.body.position.x,this.body.position.y,this.body.position.z),this.geometry.quaternion.set(this.body.quaternion.x,this.body.quaternion.y,this.body.quaternion.z,this.body.quaternion.w)}create(){this.body.position.set(this.vector.pos.x,this.vector.pos.y,this.vector.pos.z),this.body.quaternion.setFromAxisAngle(new y(this.vector.axis.x,this.vector.axis.y,this.vector.axis.z),this.vector.axis.w*Math.PI*2),this.body.angularVelocity.set(this.vector.angular.x,this.vector.angular.y,this.vector.angular.z),this.body.velocity.set(this.vector.velocity.x,this.vector.velocity.y,this.vector.velocity.z),this.body.linearDamping=.1,this.body.angularDamping=.1}},Mi=class extends Tt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;C(this,"sides",20);C(this,"inertia",6);a&&(this.vector=this.generateVector(a)),this.create()}},bi=class extends Tt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;C(this,"sides",12);C(this,"inertia",8);a&&(this.vector=this.generateVector(a)),this.create()}},Ht=class extends Tt{constructor(e,t,i,a,r=!1){super(e,t,i);this.w=e;this.h=t;this.data=i;this.isPercentile=r;C(this,"sides",10);C(this,"inertia",9);a&&(this.vector=this.generateVector(a)),this.create()}},yi=class extends Tt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;C(this,"sides",8);C(this,"inertia",10);a&&(this.vector=this.generateVector(a)),this.create()}},Ci=class extends Tt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;C(this,"sides",6);C(this,"inertia",13);a&&(this.vector=this.generateVector(a)),this.create()}},zi=class extends Tt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;C(this,"sides",4);C(this,"inertia",5);a&&(this.vector=this.generateVector(a)),this.create()}};var Ai=new U,A9=new U,w9=new s2,se=class{constructor(e=new U(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,a){return this.normal.set(e,t,i),this.constant=a,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let a=Ai.subVectors(i,t).cross(A9.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(a,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(Ai),a=this.normal.dot(i);if(a===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/a;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||w9.getNormalMatrix(e),a=this.coplanarPoint(Ai).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};se.prototype.isPlane=!0;var r4=new We,t0=new U,Vt=class{constructor(e=new se,t=new se,i=new se,a=new se,r=new se,s=new se){this.planes=[e,t,i,a,r,s]}set(e,t,i,a,r,s){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(a),o[4].copy(r),o[5].copy(s),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,a=i[0],r=i[1],s=i[2],o=i[3],c=i[4],l=i[5],u=i[6],f=i[7],h=i[8],m=i[9],v=i[10],g=i[11],x=i[12],p=i[13],d=i[14],w=i[15];return t[0].setComponents(o-a,f-c,g-h,w-x).normalize(),t[1].setComponents(o+a,f+c,g+h,w+x).normalize(),t[2].setComponents(o+r,f+l,g+m,w+p).normalize(),t[3].setComponents(o-r,f-l,g-m,w-p).normalize(),t[4].setComponents(o-s,f-u,g-v,w-d).normalize(),t[5].setComponents(o+s,f+u,g+v,w+d).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),r4.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(r4)}intersectsSprite(e){return r4.center.set(0,0,0),r4.radius=.7071067811865476,r4.applyMatrix4(e.matrixWorld),this.intersectsSphere(r4)}intersectsSphere(e){let t=this.planes,i=e.center,a=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,t0.y=a.normal.y>0?e.max.y:e.min.y,t0.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(t0)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function i0(){let n=null,e=!1,t=null,i=null;function a(r,s){t(r,s),i=n.requestAnimationFrame(a)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(a),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function U8(n,e){let t=e.isWebGL2,i=new WeakMap;function a(l,u){let f=l.array,h=l.usage,m=n.createBuffer();n.bindBuffer(u,m),n.bufferData(u,f,h),l.onUploadCallback();let v=n.FLOAT;return f instanceof Float32Array?v=n.FLOAT:f instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):f instanceof Uint16Array?l.isFloat16BufferAttribute?t?v=n.HALF_FLOAT:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):v=n.UNSIGNED_SHORT:f instanceof Int16Array?v=n.SHORT:f instanceof Uint32Array?v=n.UNSIGNED_INT:f instanceof Int32Array?v=n.INT:f instanceof Int8Array?v=n.BYTE:(f instanceof Uint8Array||f instanceof Uint8ClampedArray)&&(v=n.UNSIGNED_BYTE),{buffer:m,type:v,bytesPerElement:f.BYTES_PER_ELEMENT,version:l.version}}function r(l,u,f){let h=u.array,m=u.updateRange;n.bindBuffer(f,l),m.count===-1?n.bufferSubData(f,0,h):(t?n.bufferSubData(f,m.offset*h.BYTES_PER_ELEMENT,h,m.offset,m.count):n.bufferSubData(f,m.offset*h.BYTES_PER_ELEMENT,h.subarray(m.offset,m.offset+m.count)),m.count=-1)}function s(l){return l.isInterleavedBufferAttribute&&(l=l.data),i.get(l)}function o(l){l.isInterleavedBufferAttribute&&(l=l.data);let u=i.get(l);u&&(n.deleteBuffer(u.buffer),i.delete(l))}function c(l,u){if(l.isGLBufferAttribute){let h=i.get(l);(!h||h.version0?1:-1,u.push(Y.x,Y.y,Y.z),f.push(Z/H),f.push(1-G/E),R+=1}}for(let G=0;G0?-1:1)*.9,y:this.h*(r.y>0?-1:1)*.9,z:Math.random()*200+200},o=Math.abs(r.x/r.y);o>1?s.y/=o:s.x*=o;let c=this.makeRandomVector(a),l={x:c.x*i,y:c.y*i,z:-10},u={x:-(Math.random()*r.y*5+this.inertia*r.y),y:Math.random()*r.x*5+this.inertia*r.x,z:0},f={x:Math.random(),y:Math.random(),z:Math.random(),w:Math.random()};return{pos:s,velocity:l,angular:u,axis:f}}makeRandomVector(e){let t=Math.random()*Math.PI/5-Math.PI/5/2,i={x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)};return i.x==0&&(i.x=.01),i.y==0&&(i.y=.01),i}get buffer(){return this.geometry.geometry}get result(){return this.getUpsideValue()}getUpsideValue(){let e=new k(0,0,this.sides==4?-1:1),t,i=Math.PI*2,a=this.buffer.getAttribute("normal").array;for(let s=0,o=this.buffer.groups.length;sthis.sides;)s-=this.sides;for(;s<1;)s+=this.sides;t.groups[a].materialIndex=s+1}}this.updateMaterialsForValue(e-i),this.geometry.geometry=t}resetBody(){this.body.vlambda=new y,this.body.position=new y,this.body.previousPosition=new y,this.body.initPosition=new y,this.body.velocity=new y,this.body.initVelocity=new y,this.body.force=new y,this.body.torque=new y,this.body.quaternion=new O1,this.body.initQuaternion=new O1,this.body.angularVelocity=new y,this.body.initAngularVelocity=new y,this.body.interpolatedPosition=new y,this.body.interpolatedQuaternion=new O1,this.body.inertia=new y,this.body.invInertia=new y,this.body.invInertiaWorld=new _2,this.body.invInertiaSolve=new y,this.body.invInertiaWorldSolve=new _2,this.body.wlambda=new y,this.body.updateMassProperties()}updateMaterialsForValue(e){}set(){this.geometry.position.set(this.body.position.x,this.body.position.y,this.body.position.z),this.geometry.quaternion.set(this.body.quaternion.x,this.body.quaternion.y,this.body.quaternion.z,this.body.quaternion.w)}create(){this.body.position.set(this.vector.pos.x,this.vector.pos.y,this.vector.pos.z),this.body.quaternion.setFromAxisAngle(new y(this.vector.axis.x,this.vector.axis.y,this.vector.axis.z),this.vector.axis.w*Math.PI*2),this.body.angularVelocity.set(this.vector.angular.x,this.vector.angular.y,this.vector.angular.z),this.body.velocity.set(this.vector.velocity.x,this.vector.velocity.y,this.vector.velocity.z),this.body.linearDamping=.1,this.body.angularDamping=.1}},xi=class extends Dt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;this.sides=20;this.inertia=6;a&&(this.vector=this.generateVector(a)),this.create()}},Mi=class extends Dt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;this.sides=12;this.inertia=8;a&&(this.vector=this.generateVector(a)),this.create()}},Tt=class extends Dt{constructor(e,t,i,a,r=!1){super(e,t,i);this.w=e;this.h=t;this.data=i;this.isPercentile=r;this.sides=10;this.inertia=9;a&&(this.vector=this.generateVector(a)),this.create()}},bi=class extends Dt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;this.sides=8;this.inertia=10;a&&(this.vector=this.generateVector(a)),this.create()}},yi=class extends Dt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;this.sides=6;this.inertia=13;a&&(this.vector=this.generateVector(a)),this.create()}},Ci=class extends Dt{constructor(e,t,i,a){super(e,t,i);this.w=e;this.h=t;this.data=i;this.sides=4;this.inertia=5;a&&(this.vector=this.generateVector(a)),this.create()}};var zi=new k,C9=new k,z9=new n2,ne=class{constructor(e=new k(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,a){return this.normal.set(e,t,i),this.constant=a,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let a=zi.subVectors(i,t).cross(C9.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(a,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(zi),a=this.normal.dot(i);if(a===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/a;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||z9.getNormalMatrix(e),a=this.coplanarPoint(zi).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ne.prototype.isPlane=!0;var a4=new qe,e0=new k,Ht=class{constructor(e=new ne,t=new ne,i=new ne,a=new ne,r=new ne,s=new ne){this.planes=[e,t,i,a,r,s]}set(e,t,i,a,r,s){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(a),o[4].copy(r),o[5].copy(s),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,a=i[0],r=i[1],s=i[2],o=i[3],c=i[4],l=i[5],u=i[6],f=i[7],h=i[8],m=i[9],v=i[10],g=i[11],x=i[12],p=i[13],d=i[14],A=i[15];return t[0].setComponents(o-a,f-c,g-h,A-x).normalize(),t[1].setComponents(o+a,f+c,g+h,A+x).normalize(),t[2].setComponents(o+r,f+l,g+m,A+p).normalize(),t[3].setComponents(o-r,f-l,g-m,A-p).normalize(),t[4].setComponents(o-s,f-u,g-v,A-d).normalize(),t[5].setComponents(o+s,f+u,g+v,A+d).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),a4.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(a4)}intersectsSprite(e){return a4.center.set(0,0,0),a4.radius=.7071067811865476,a4.applyMatrix4(e.matrixWorld),this.intersectsSphere(a4)}intersectsSphere(e){let t=this.planes,i=e.center,a=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,e0.y=a.normal.y>0?e.max.y:e.min.y,e0.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(e0)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function t0(){let n=null,e=!1,t=null,i=null;function a(r,s){t(r,s),i=n.requestAnimationFrame(a)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(a),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function k8(n,e){let t=e.isWebGL2,i=new WeakMap;function a(l,u){let f=l.array,h=l.usage,m=n.createBuffer();n.bindBuffer(u,m),n.bufferData(u,f,h),l.onUploadCallback();let v=n.FLOAT;return f instanceof Float32Array?v=n.FLOAT:f instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):f instanceof Uint16Array?l.isFloat16BufferAttribute?t?v=n.HALF_FLOAT:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):v=n.UNSIGNED_SHORT:f instanceof Int16Array?v=n.SHORT:f instanceof Uint32Array?v=n.UNSIGNED_INT:f instanceof Int32Array?v=n.INT:f instanceof Int8Array?v=n.BYTE:(f instanceof Uint8Array||f instanceof Uint8ClampedArray)&&(v=n.UNSIGNED_BYTE),{buffer:m,type:v,bytesPerElement:f.BYTES_PER_ELEMENT,version:l.version}}function r(l,u,f){let h=u.array,m=u.updateRange;n.bindBuffer(f,l),m.count===-1?n.bufferSubData(f,0,h):(t?n.bufferSubData(f,m.offset*h.BYTES_PER_ELEMENT,h,m.offset,m.count):n.bufferSubData(f,m.offset*h.BYTES_PER_ELEMENT,h.subarray(m.offset,m.offset+m.count)),m.count=-1)}function s(l){return l.isInterleavedBufferAttribute&&(l=l.data),i.get(l)}function o(l){l.isInterleavedBufferAttribute&&(l=l.data);let u=i.get(l);u&&(n.deleteBuffer(u.buffer),i.delete(l))}function c(l,u){if(l.isGLBufferAttribute){let h=i.get(l);(!h||h.version0?1:-1,u.push(Z.x,Z.y,Z.z),f.push(X/T),f.push(1-O/_),N+=1}}for(let O=0;O<_;O++)for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};oe.prototype.isShaderMaterial=!0;var W8=` +`;var se=class extends T2{constructor(e){super();this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=O8,this.fragmentShader=G8,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=$e(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let a in this.uniforms){let s=this.uniforms[a].value;s&&s.isTexture?t.uniforms[a]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?t.uniforms[a]={type:"c",value:s.getHex()}:s&&s.isVector2?t.uniforms[a]={type:"v2",value:s.toArray()}:s&&s.isVector3?t.uniforms[a]={type:"v3",value:s.toArray()}:s&&s.isVector4?t.uniforms[a]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?t.uniforms[a]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?t.uniforms[a]={type:"m4",value:s.toArray()}:t.uniforms[a]={value:s}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};se.prototype.isShaderMaterial=!0;var q8=` #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vUv ).g; #endif -`;var j8=` +`;var W8=` #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif -`;var X8=` +`;var j8=` #ifdef USE_ALPHATEST if ( diffuseColor.a < alphaTest ) discard; #endif -`;var Z8=` +`;var X8=` #ifdef USE_ALPHATEST uniform float alphaTest; #endif -`;var Y8=` +`;var Z8=` #ifdef USE_AOMAP // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture @@ -571,16 +571,16 @@ void main() { #endif #endif -`;var $8=` +`;var Y8=` #ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; #endif -`;var K8=` +`;var $8=` vec3 transformed = vec3( position ); -`;var J8=` +`;var K8=` vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT @@ -588,7 +588,7 @@ vec3 objectNormal = vec3( normal ); vec3 objectTangent = vec3( tangent.xyz ); #endif -`;var Q8=` +`;var J8=` vec3 BRDF_Lambert( const in vec3 diffuseColor ) { @@ -845,7 +845,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no } #endif -`;var en=` +`;var Q8=` #ifdef USE_BUMPMAP uniform sampler2D bumpMap; @@ -888,7 +888,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no } #endif -`;var tn=` +`;var en=` #if NUM_CLIPPING_PLANES > 0 vec4 plane; @@ -920,7 +920,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #endif #endif -`;var an=` +`;var tn=` #if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; @@ -928,19 +928,19 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif -`;var rn=` +`;var an=` #if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif -`;var nn=` +`;var rn=` #if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif -`;var sn=` +`;var nn=` #if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; @@ -950,7 +950,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no diffuseColor.rgb *= vColor; #endif -`;var on=` +`;var sn=` #if defined( USE_COLOR_ALPHA ) varying vec4 vColor; @@ -960,7 +960,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no varying vec3 vColor; #endif -`;var cn=` +`;var on=` #if defined( USE_COLOR_ALPHA ) varying vec4 vColor; @@ -970,7 +970,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no varying vec3 vColor; #endif -`;var ln=` +`;var cn=` #if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); @@ -992,7 +992,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no vColor.xyz *= instanceColor.xyz; #endif -`;var un=` +`;var ln=` #define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 @@ -1107,7 +1107,7 @@ vec2 equirectUv( in vec3 dir ) { return vec2( u, v ); } -`;var hn=` +`;var un=` #ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_maxMipLevel 8.0 @@ -1298,7 +1298,7 @@ vec2 equirectUv( in vec3 dir ) { } #endif -`;var fn=` +`;var hn=` vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING @@ -1333,7 +1333,7 @@ transformedNormal = normalMatrix * transformedNormal; #endif #endif -`;var dn=` +`;var fn=` #ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; @@ -1341,13 +1341,13 @@ transformedNormal = normalMatrix * transformedNormal; uniform float displacementBias; #endif -`;var pn=` +`;var dn=` #ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif -`;var mn=` +`;var pn=` #ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); @@ -1355,15 +1355,15 @@ transformedNormal = normalMatrix * transformedNormal; totalEmissiveRadiance *= emissiveColor.rgb; #endif -`;var vn=` +`;var mn=` #ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif -`;var gn=` +`;var vn=` gl_FragColor = linearToOutputTexel( gl_FragColor ); -`;var xn=` +`;var gn=` vec4 LinearToLinear( in vec4 value ) { return value; @@ -1373,7 +1373,7 @@ vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } -`;var Mn=` +`;var xn=` #ifdef USE_ENVMAP #ifdef ENV_WORLDPOS @@ -1438,7 +1438,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var bn=` +`;var Mn=` #ifdef USE_ENVMAP uniform float envMapIntensity; @@ -1451,7 +1451,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var yn=` +`;var bn=` #ifdef USE_ENVMAP uniform float reflectivity; @@ -1471,7 +1471,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var Cn=` +`;var yn=` #ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) @@ -1492,7 +1492,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var zn=` +`;var Cn=` #ifdef USE_ENVMAP #ifdef ENV_WORLDPOS @@ -1528,19 +1528,19 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var An=` +`;var zn=` #ifdef USE_FOG vFogDepth = - mvPosition.z; #endif -`;var wn=` +`;var An=` #ifdef USE_FOG varying float vFogDepth; #endif -`;var Sn=` +`;var wn=` #ifdef USE_FOG #ifdef FOG_EXP2 @@ -1556,7 +1556,7 @@ vec4 LinearTosRGB( in vec4 value ) { gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif -`;var _n=` +`;var Sn=` #ifdef USE_FOG uniform vec3 fogColor; @@ -1574,7 +1574,7 @@ vec4 LinearTosRGB( in vec4 value ) { #endif #endif -`;var En=` +`;var _n=` #ifdef USE_GRADIENTMAP @@ -1599,7 +1599,7 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { #endif } -`;var Ln=` +`;var En=` #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); @@ -1614,14 +1614,14 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { reflectedLight.indirectDiffuse += lightMapIrradiance; #endif -`;var Dn=` +`;var Ln=` #ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif -`;var Tn=` +`;var Dn=` vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; @@ -1742,7 +1742,7 @@ vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal ); #pragma unroll_loop_end #endif -`;var Hn=` +`;var Tn=` uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; @@ -1964,7 +1964,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi } #endif -`;var Vn=` +`;var Hn=` #if defined( USE_ENVMAP ) #ifdef ENVMAP_MODE_REFRACTION @@ -2025,10 +2025,10 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi } #endif -`;var Nn=` +`;var Vn=` ToonMaterial material; material.diffuseColor = diffuseColor.rgb; -`;var Rn=` +`;var Nn=` varying vec3 vViewPosition; struct ToonMaterial { @@ -2055,13 +2055,13 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContex #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon #define Material_LightProbeLOD( material ) (0) -`;var Fn=` +`;var Rn=` BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength; -`;var Bn=` +`;var Fn=` varying vec3 vViewPosition; struct BlinnPhongMaterial { @@ -2094,7 +2094,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0) -`;var Pn=` +`;var Bn=` PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); @@ -2188,7 +2188,7 @@ material.roughness = min( material.roughness, 1.0 ); #endif #endif -`;var In=` +`;var Pn=` struct PhysicalMaterial { vec3 diffuseColor; @@ -2401,7 +2401,7 @@ float computeSpecularOcclusion( const in float dotNV, const in float ambientOccl return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); } -`;var kn=` +`;var In=` /** * This is a template that can be used to light a material, it uses pluggable * RenderEquations (RE)for specific lighting scenarios. @@ -2552,7 +2552,7 @@ IncidentLight directLight; vec3 clearcoatRadiance = vec3( 0.0 ); #endif -`;var Un=` +`;var kn=` #if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP @@ -2589,7 +2589,7 @@ IncidentLight directLight; #endif #endif -`;var On=` +`;var Un=` #if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); @@ -2601,7 +2601,7 @@ IncidentLight directLight; RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif -`;var Gn=` +`;var On=` #if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) // Doing a strict comparison with == 1.0 can cause noise artifacts @@ -2609,7 +2609,7 @@ IncidentLight directLight; gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif -`;var qn=` +`;var Gn=` #if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; @@ -2617,7 +2617,7 @@ IncidentLight directLight; varying float vIsPerspective; #endif -`;var Wn=` +`;var qn=` #ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT @@ -2632,7 +2632,7 @@ IncidentLight directLight; #endif #endif -`;var jn=` +`;var Wn=` #ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT @@ -2653,7 +2653,7 @@ IncidentLight directLight; #endif #endif -`;var Xn=` +`;var jn=` #ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vUv ); @@ -2669,13 +2669,13 @@ IncidentLight directLight; diffuseColor *= sampledDiffuseColor; #endif -`;var Zn=` +`;var Xn=` #ifdef USE_MAP uniform sampler2D map; #endif -`;var Yn=` +`;var Zn=` #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; @@ -2693,7 +2693,7 @@ IncidentLight directLight; diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif -`;var $n=` +`;var Yn=` #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; @@ -2711,7 +2711,7 @@ IncidentLight directLight; uniform sampler2D alphaMap; #endif -`;var Kn=` +`;var $n=` float metalnessFactor = metalness; #ifdef USE_METALNESSMAP @@ -2722,13 +2722,13 @@ float metalnessFactor = metalness; metalnessFactor *= texelMetalness.b; #endif -`;var Jn=` +`;var Kn=` #ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif -`;var Qn=` +`;var Jn=` #ifdef USE_MORPHNORMALS // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value: @@ -2754,7 +2754,7 @@ float metalnessFactor = metalness; #endif #endif -`;var es=` +`;var Qn=` #ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; @@ -2791,7 +2791,7 @@ float metalnessFactor = metalness; #endif #endif -`;var ts=` +`;var es=` #ifdef USE_MORPHTARGETS // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value: @@ -2834,7 +2834,7 @@ float metalnessFactor = metalness; #endif #endif -`;var is=` +`;var ts=` float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED @@ -2881,7 +2881,7 @@ float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; vec3 geometryNormal = normal; -`;var as=` +`;var is=` #ifdef OBJECTSPACE_NORMALMAP @@ -2921,7 +2921,7 @@ vec3 geometryNormal = normal; normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif -`;var rs=` +`;var as=` #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2934,7 +2934,7 @@ vec3 geometryNormal = normal; #endif #endif -`;var ns=` +`;var rs=` #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2947,7 +2947,7 @@ vec3 geometryNormal = normal; #endif #endif -`;var ss=` +`;var ns=` #ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED vNormal = normalize( transformedNormal ); @@ -2960,7 +2960,7 @@ vec3 geometryNormal = normal; #endif #endif -`;var os=` +`;var ss=` #ifdef USE_NORMALMAP uniform sampler2D normalMap; @@ -3004,13 +3004,13 @@ vec3 geometryNormal = normal; } #endif -`;var cs=` +`;var os=` #ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif -`;var ls=` +`;var cs=` #ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; @@ -3027,7 +3027,7 @@ vec3 geometryNormal = normal; #endif #endif -`;var us=` +`;var ls=` #ifdef USE_CLEARCOATMAP @@ -3047,7 +3047,7 @@ vec3 geometryNormal = normal; uniform vec2 clearcoatNormalScale; #endif -`;var hs=` +`;var us=` #ifdef OPAQUE diffuseColor.a = 1.0; #endif @@ -3058,7 +3058,7 @@ diffuseColor.a *= transmissionAlpha + 0.1; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a ); -`;var fs=` +`;var hs=` vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } @@ -3111,14 +3111,14 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } -`;var ds=` +`;var fs=` #ifdef PREMULTIPLIED_ALPHA // Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation. gl_FragColor.rgb *= gl_FragColor.a; #endif -`;var ps=` +`;var ds=` vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING @@ -3130,13 +3130,13 @@ vec4 mvPosition = vec4( transformed, 1.0 ); mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition; -`;var ms=` +`;var ps=` #ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif -`;var vs=` +`;var ms=` #ifdef DITHERING // based on https://www.shadertoy.com/view/MslGR8 @@ -3155,7 +3155,7 @@ gl_Position = projectionMatrix * mvPosition; } #endif -`;var gs=` +`;var vs=` float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP @@ -3166,13 +3166,13 @@ float roughnessFactor = roughness; roughnessFactor *= texelRoughness.g; #endif -`;var xs=` +`;var gs=` #ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif -`;var Ms=` +`;var xs=` #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -3481,7 +3481,7 @@ float roughnessFactor = roughness; } #endif -`;var bs=` +`;var Ms=` #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -3543,7 +3543,7 @@ float roughnessFactor = roughness; */ #endif -`;var ys=` +`;var bs=` #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 @@ -3602,7 +3602,7 @@ float roughnessFactor = roughness; */ #endif -`;var Cs=` +`;var ys=` float getShadowMask() { float shadow = 1.0; @@ -3667,7 +3667,7 @@ float getShadowMask() { return shadow; } -`;var zs=` +`;var Cs=` #ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); @@ -3676,7 +3676,7 @@ float getShadowMask() { mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif -`;var As=` +`;var zs=` #ifdef USE_SKINNING uniform mat4 bindMatrix; @@ -3723,7 +3723,7 @@ float getShadowMask() { #endif #endif -`;var ws=` +`;var As=` #ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); @@ -3737,7 +3737,7 @@ float getShadowMask() { transformed = ( bindMatrixInverse * skinned ).xyz; #endif -`;var Ss=` +`;var ws=` #ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); @@ -3756,7 +3756,7 @@ float getShadowMask() { #endif #endif -`;var _s=` +`;var Ss=` float specularStrength; #ifdef USE_SPECULARMAP @@ -3769,19 +3769,19 @@ float specularStrength; specularStrength = 1.0; #endif -`;var Es=` +`;var _s=` #ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif -`;var Ls=` +`;var Es=` #if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif -`;var Ds=` +`;var Ls=` #ifndef saturate // may have defined saturate() already #define saturate( a ) clamp( a, 0.0, 1.0 ) @@ -3857,7 +3857,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { } vec3 CustomToneMapping( vec3 color ) { return color; } -`;var Ts=` +`;var Ds=` #ifdef USE_TRANSMISSION float transmissionAlpha = 1.0; @@ -3888,7 +3888,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor ); transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor ); #endif -`;var Hs=` +`;var Ts=` #ifdef USE_TRANSMISSION // Transmission code is based on glTF-Sampler-Viewer @@ -4003,13 +4003,13 @@ vec3 CustomToneMapping( vec3 color ) { return color; } } #endif -`;var Vs=` +`;var Hs=` #if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif -`;var Ns=` +`;var Vs=` #ifdef USE_UV #ifdef UVS_VERTEX_ONLY @@ -4025,19 +4025,19 @@ vec3 CustomToneMapping( vec3 color ) { return color; } uniform mat3 uvTransform; #endif -`;var Rs=` +`;var Ns=` #ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif -`;var Fs=` +`;var Rs=` #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif -`;var Bs=` +`;var Fs=` #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; @@ -4046,13 +4046,13 @@ vec3 CustomToneMapping( vec3 color ) { return color; } uniform mat3 uv2Transform; #endif -`;var Ps=` +`;var Bs=` #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif -`;var Is=` +`;var Ps=` #if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) vec4 worldPosition = vec4( transformed, 1.0 ); @@ -4066,7 +4066,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; } worldPosition = modelMatrix * worldPosition; #endif -`;var ks=` +`;var Is=` varying vec2 vUv; uniform mat3 uvTransform; @@ -4077,7 +4077,7 @@ void main() { gl_Position = vec4( position.xy, 1.0, 1.0 ); } -`,Us=` +`,ks=` uniform sampler2D t2D; varying vec2 vUv; @@ -4090,7 +4090,7 @@ void main() { #include } -`;var Os=` +`;var Us=` varying vec3 vWorldDirection; #include @@ -4105,7 +4105,7 @@ void main() { gl_Position.z = gl_Position.w; // set z to camera.far } -`,Gs=` +`,Os=` #include uniform float opacity; @@ -4125,7 +4125,7 @@ void main() { #include } -`;var qs=` +`;var Gs=` #include #include #include @@ -4164,7 +4164,7 @@ void main() { vHighPrecisionZW = gl_Position.zw; } -`,Ws=` +`,qs=` #if DEPTH_PACKING == 3200 uniform float opacity; @@ -4214,7 +4214,7 @@ void main() { #endif } -`;var js=` +`;var Ws=` #define DISTANCE varying vec3 vWorldPosition; @@ -4251,7 +4251,7 @@ void main() { vWorldPosition = worldPosition.xyz; } -`,Xs=` +`,js=` #define DISTANCE uniform vec3 referencePosition; @@ -4284,7 +4284,7 @@ void main () { gl_FragColor = packDepthToRGBA( dist ); } -`;var Zs=` +`;var Xs=` varying vec3 vWorldDirection; #include @@ -4297,7 +4297,7 @@ void main() { #include } -`,Ys=` +`,Zs=` uniform sampler2D tEquirect; varying vec3 vWorldDirection; @@ -4316,7 +4316,7 @@ void main() { #include } -`;var $s=` +`;var Ys=` uniform float scale; attribute float lineDistance; @@ -4342,7 +4342,7 @@ void main() { #include } -`,Ks=` +`,$s=` uniform vec3 diffuse; uniform float opacity; @@ -4382,7 +4382,7 @@ void main() { #include } -`;var Js=` +`;var Ks=` #include #include #include @@ -4422,7 +4422,7 @@ void main() { #include } -`,Qs=` +`,Js=` uniform vec3 diffuse; uniform float opacity; @@ -4494,7 +4494,7 @@ void main() { #include } -`;var e5=` +`;var Qs=` #define LAMBERT varying vec3 vLightFront; @@ -4544,7 +4544,7 @@ void main() { #include #include } -`,t5=` +`,e5=` uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -4641,7 +4641,7 @@ void main() { #include #include } -`;var i5=` +`;var t5=` #define MATCAP varying vec3 vViewPosition; @@ -4682,7 +4682,7 @@ void main() { vViewPosition = - mvPosition.xyz; } -`,a5=` +`,i5=` #define MATCAP uniform vec3 diffuse; @@ -4744,7 +4744,7 @@ void main() { #include } -`;var r5=` +`;var a5=` #define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) @@ -4788,7 +4788,7 @@ void main() { #endif } -`,n5=` +`,r5=` #define NORMAL uniform float opacity; @@ -4817,7 +4817,7 @@ void main() { gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); } -`;var s5=` +`;var n5=` #define PHONG varying vec3 vViewPosition; @@ -4865,7 +4865,7 @@ void main() { #include } -`,o5=` +`,s5=` #define PHONG uniform vec3 diffuse; @@ -4939,7 +4939,7 @@ void main() { #include } -`;var c5=` +`;var o5=` #define STANDARD varying vec3 vViewPosition; @@ -4996,7 +4996,7 @@ void main() { #endif } -`,l5=` +`,c5=` #define STANDARD #ifdef PHYSICAL @@ -5142,7 +5142,7 @@ void main() { #include } -`;var u5=` +`;var l5=` #define TOON varying vec3 vViewPosition; @@ -5188,7 +5188,7 @@ void main() { #include } -`,h5=` +`,u5=` #define TOON uniform vec3 diffuse; @@ -5255,7 +5255,7 @@ void main() { #include } -`;var f5=` +`;var h5=` uniform float size; uniform float scale; @@ -5289,7 +5289,7 @@ void main() { #include } -`,d5=` +`,f5=` uniform vec3 diffuse; uniform float opacity; @@ -5322,7 +5322,7 @@ void main() { #include } -`;var p5=` +`;var d5=` #include #include #include @@ -5347,7 +5347,7 @@ void main() { #include } -`,m5=` +`,p5=` uniform vec3 color; uniform float opacity; @@ -5368,7 +5368,7 @@ void main() { #include } -`;var v5=` +`;var m5=` uniform float rotation; uniform vec2 center; @@ -5411,7 +5411,7 @@ void main() { #include } -`,g5=` +`,v5=` uniform vec3 diffuse; uniform float opacity; @@ -5444,7 +5444,7 @@ void main() { #include } -`;var E1={alphamap_fragment:W8,alphamap_pars_fragment:j8,alphatest_fragment:X8,alphatest_pars_fragment:Z8,aomap_fragment:Y8,aomap_pars_fragment:$8,begin_vertex:K8,beginnormal_vertex:J8,bsdfs:Q8,bumpmap_pars_fragment:en,clipping_planes_fragment:tn,clipping_planes_pars_fragment:an,clipping_planes_pars_vertex:rn,clipping_planes_vertex:nn,color_fragment:sn,color_pars_fragment:on,color_pars_vertex:cn,color_vertex:ln,common:un,cube_uv_reflection_fragment:hn,defaultnormal_vertex:fn,displacementmap_pars_vertex:dn,displacementmap_vertex:pn,emissivemap_fragment:mn,emissivemap_pars_fragment:vn,encodings_fragment:gn,encodings_pars_fragment:xn,envmap_fragment:Mn,envmap_common_pars_fragment:bn,envmap_pars_fragment:yn,envmap_pars_vertex:Cn,envmap_physical_pars_fragment:Vn,envmap_vertex:zn,fog_vertex:An,fog_pars_vertex:wn,fog_fragment:Sn,fog_pars_fragment:_n,gradientmap_pars_fragment:En,lightmap_fragment:Ln,lightmap_pars_fragment:Dn,lights_lambert_vertex:Tn,lights_pars_begin:Hn,lights_toon_fragment:Nn,lights_toon_pars_fragment:Rn,lights_phong_fragment:Fn,lights_phong_pars_fragment:Bn,lights_physical_fragment:Pn,lights_physical_pars_fragment:In,lights_fragment_begin:kn,lights_fragment_maps:Un,lights_fragment_end:On,logdepthbuf_fragment:Gn,logdepthbuf_pars_fragment:qn,logdepthbuf_pars_vertex:Wn,logdepthbuf_vertex:jn,map_fragment:Xn,map_pars_fragment:Zn,map_particle_fragment:Yn,map_particle_pars_fragment:$n,metalnessmap_fragment:Kn,metalnessmap_pars_fragment:Jn,morphnormal_vertex:Qn,morphtarget_pars_vertex:es,morphtarget_vertex:ts,normal_fragment_begin:is,normal_fragment_maps:as,normal_pars_fragment:rs,normal_pars_vertex:ns,normal_vertex:ss,normalmap_pars_fragment:os,clearcoat_normal_fragment_begin:cs,clearcoat_normal_fragment_maps:ls,clearcoat_pars_fragment:us,output_fragment:hs,packing:fs,premultiplied_alpha_fragment:ds,project_vertex:ps,dithering_fragment:ms,dithering_pars_fragment:vs,roughnessmap_fragment:gs,roughnessmap_pars_fragment:xs,shadowmap_pars_fragment:Ms,shadowmap_pars_vertex:bs,shadowmap_vertex:ys,shadowmask_pars_fragment:Cs,skinbase_vertex:zs,skinning_pars_vertex:As,skinning_vertex:ws,skinnormal_vertex:Ss,specularmap_fragment:_s,specularmap_pars_fragment:Es,tonemapping_fragment:Ls,tonemapping_pars_fragment:Ds,transmission_fragment:Ts,transmission_pars_fragment:Hs,uv_pars_fragment:Vs,uv_pars_vertex:Ns,uv_vertex:Rs,uv2_pars_fragment:Fs,uv2_pars_vertex:Bs,uv2_vertex:Ps,worldpos_vertex:Is,background_vert:ks,background_frag:Us,cube_vert:Os,cube_frag:Gs,depth_vert:qs,depth_frag:Ws,distanceRGBA_vert:js,distanceRGBA_frag:Xs,equirect_vert:Zs,equirect_frag:Ys,linedashed_vert:$s,linedashed_frag:Ks,meshbasic_vert:Js,meshbasic_frag:Qs,meshlambert_vert:e5,meshlambert_frag:t5,meshmatcap_vert:i5,meshmatcap_frag:a5,meshnormal_vert:r5,meshnormal_frag:n5,meshphong_vert:s5,meshphong_frag:o5,meshphysical_vert:c5,meshphysical_frag:l5,meshtoon_vert:u5,meshtoon_frag:h5,points_vert:f5,points_frag:d5,shadow_vert:p5,shadow_frag:m5,sprite_vert:v5,sprite_frag:g5};var t1={common:{diffuse:{value:new M1(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new s2},uv2Transform:{value:new s2},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new A1(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new M1(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new M1(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new s2}},sprite:{diffuse:{value:new M1(16777215)},opacity:{value:1},center:{value:new A1(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new s2}}};var j2={basic:{uniforms:d2([t1.common,t1.specularmap,t1.envmap,t1.aomap,t1.lightmap,t1.fog]),vertexShader:E1.meshbasic_vert,fragmentShader:E1.meshbasic_frag},lambert:{uniforms:d2([t1.common,t1.specularmap,t1.envmap,t1.aomap,t1.lightmap,t1.emissivemap,t1.fog,t1.lights,{emissive:{value:new M1(0)}}]),vertexShader:E1.meshlambert_vert,fragmentShader:E1.meshlambert_frag},phong:{uniforms:d2([t1.common,t1.specularmap,t1.envmap,t1.aomap,t1.lightmap,t1.emissivemap,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.fog,t1.lights,{emissive:{value:new M1(0)},specular:{value:new M1(1118481)},shininess:{value:30}}]),vertexShader:E1.meshphong_vert,fragmentShader:E1.meshphong_frag},standard:{uniforms:d2([t1.common,t1.envmap,t1.aomap,t1.lightmap,t1.emissivemap,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.roughnessmap,t1.metalnessmap,t1.fog,t1.lights,{emissive:{value:new M1(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:E1.meshphysical_vert,fragmentShader:E1.meshphysical_frag},toon:{uniforms:d2([t1.common,t1.aomap,t1.lightmap,t1.emissivemap,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.gradientmap,t1.fog,t1.lights,{emissive:{value:new M1(0)}}]),vertexShader:E1.meshtoon_vert,fragmentShader:E1.meshtoon_frag},matcap:{uniforms:d2([t1.common,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.fog,{matcap:{value:null}}]),vertexShader:E1.meshmatcap_vert,fragmentShader:E1.meshmatcap_frag},points:{uniforms:d2([t1.points,t1.fog]),vertexShader:E1.points_vert,fragmentShader:E1.points_frag},dashed:{uniforms:d2([t1.common,t1.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:E1.linedashed_vert,fragmentShader:E1.linedashed_frag},depth:{uniforms:d2([t1.common,t1.displacementmap]),vertexShader:E1.depth_vert,fragmentShader:E1.depth_frag},normal:{uniforms:d2([t1.common,t1.bumpmap,t1.normalmap,t1.displacementmap,{opacity:{value:1}}]),vertexShader:E1.meshnormal_vert,fragmentShader:E1.meshnormal_frag},sprite:{uniforms:d2([t1.sprite,t1.fog]),vertexShader:E1.sprite_vert,fragmentShader:E1.sprite_frag},background:{uniforms:{uvTransform:{value:new s2},t2D:{value:null}},vertexShader:E1.background_vert,fragmentShader:E1.background_frag},cube:{uniforms:d2([t1.envmap,{opacity:{value:1}}]),vertexShader:E1.cube_vert,fragmentShader:E1.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:E1.equirect_vert,fragmentShader:E1.equirect_frag},distanceRGBA:{uniforms:d2([t1.common,t1.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:E1.distanceRGBA_vert,fragmentShader:E1.distanceRGBA_frag},shadow:{uniforms:d2([t1.lights,t1.fog,{color:{value:new M1(0)},opacity:{value:1}}]),vertexShader:E1.shadow_vert,fragmentShader:E1.shadow_frag}};j2.physical={uniforms:d2([j2.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new A1(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new M1(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new A1},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new M1(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new M1(1,1,1)},specularColorMap:{value:null}}]),vertexShader:E1.meshphysical_vert,fragmentShader:E1.meshphysical_frag};function x5(n,e,t,i,a,r){let s=new M1(0),o=a===!0?0:1,c,l,u=null,f=0,h=null;function m(g,x){let p=!1,d=x.isScene===!0?x.background:null;d&&d.isTexture&&(d=e.get(d));let w=n.xr,b=w.getSession&&w.getSession();b&&b.environmentBlendMode==="additive"&&(d=null),d===null?v(s,o):d&&d.isColor&&(v(d,1),p=!0),(n.autoClear||p)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),d&&(d.isCubeTexture||d.mapping===nt)?(l===void 0&&(l=new u2(new $e(1,1,1),new oe({name:"BackgroundCubeMaterial",uniforms:Ke(j2.cube.uniforms),vertexShader:j2.cube.vertexShader,fragmentShader:j2.cube.fragmentShader,side:I1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(z,L,H){this.matrixWorld.copyPosition(H.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),l.material.uniforms.envMap.value=d,l.material.uniforms.flipEnvMap.value=d.isCubeTexture&&d.isRenderTargetTexture===!1?-1:1,(u!==d||f!==d.version||h!==n.toneMapping)&&(l.material.needsUpdate=!0,u=d,f=d.version,h=n.toneMapping),g.unshift(l,l.geometry,l.material,0,0,null)):d&&d.isTexture&&(c===void 0&&(c=new u2(new Nt(2,2),new oe({name:"BackgroundMaterial",uniforms:Ke(j2.background.uniforms),vertexShader:j2.background.vertexShader,fragmentShader:j2.background.fragmentShader,side:ke,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=d,d.matrixAutoUpdate===!0&&d.updateMatrix(),c.material.uniforms.uvTransform.value.copy(d.matrix),(u!==d||f!==d.version||h!==n.toneMapping)&&(c.material.needsUpdate=!0,u=d,f=d.version,h=n.toneMapping),g.unshift(c,c.geometry,c.material,0,0,null))}function v(g,x){t.buffers.color.setClear(g.r,g.g,g.b,x,r)}return{getClearColor:function(){return s},setClearColor:function(g,x=1){s.set(g),o=x,v(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(g){o=g,v(s,o)},render:m}}function M5(n,e,t,i){let a=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),s=i.isWebGL2||r!==null,o={},c=g(null),l=c;function u(A,V,N,D,R){let O=!1;if(s){let Y=v(D,N,V);l!==Y&&(l=Y,h(l.object)),O=x(D,R),O&&p(D,R)}else{let Y=V.wireframe===!0;(l.geometry!==D.id||l.program!==N.id||l.wireframe!==Y)&&(l.geometry=D.id,l.program=N.id,l.wireframe=Y,O=!0)}A.isInstancedMesh===!0&&(O=!0),R!==null&&t.update(R,n.ELEMENT_ARRAY_BUFFER),O&&(H(A,V,N,D),R!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(R).buffer))}function f(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function h(A){return i.isWebGL2?n.bindVertexArray(A):r.bindVertexArrayOES(A)}function m(A){return i.isWebGL2?n.deleteVertexArray(A):r.deleteVertexArrayOES(A)}function v(A,V,N){let D=N.wireframe===!0,R=o[A.id];R===void 0&&(R={},o[A.id]=R);let O=R[V.id];O===void 0&&(O={},R[V.id]=O);let Y=O[D];return Y===void 0&&(Y=g(f()),O[D]=Y),Y}function g(A){let V=[],N=[],D=[];for(let R=0;R=0){let Z=R[G];if(Z===void 0&&(G==="instanceMatrix"&&A.instanceMatrix&&(Z=A.instanceMatrix),G==="instanceColor"&&A.instanceColor&&(Z=A.instanceColor)),Z!==void 0){let e1=Z.normalized,r1=Z.itemSize,P=t.get(Z);if(P===void 0)continue;let b1=P.buffer,h1=P.type,g1=P.bytesPerElement;if(Z.isInterleavedBufferAttribute){let s1=Z.data,H1=s1.stride,w1=Z.offset;if(s1&&s1.isInstancedInterleavedBuffer){for(let z1=0;z10&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";H="mediump"}return H==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=typeof WebGL2RenderingContext!="undefined"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&n instanceof WebGL2ComputeRenderingContext,o=t.precision!==void 0?t.precision:"highp",c=r(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);let l=s||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,f=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),p=n.getParameter(n.MAX_VARYING_VECTORS),d=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),w=h>0,b=s||e.has("OES_texture_float"),z=w&&b,L=s?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:a,getMaxPrecision:r,precision:o,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:h,maxTextureSize:m,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:x,maxVaryings:p,maxFragmentUniforms:d,vertexTextures:w,floatFragmentTextures:b,floatVertexTextures:z,maxSamples:L}}function C5(n){let e=this,t=null,i=0,a=!1,r=!1,s=new se,o=new s2,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h,m){let v=f.length!==0||h||i!==0||a;return a=h,t=u(f,m,0),i=f.length,v},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1,l()},this.setState=function(f,h,m){let v=f.clippingPlanes,g=f.clipIntersection,x=f.clipShadows,p=n.get(f);if(!a||v===null||v.length===0||r&&!x)r?u(null):l();else{let d=r?0:i,w=d*4,b=p.clippingState||null;c.value=b,b=u(v,h,w,m);for(let z=0;z!==w;++z)b[z]=t[z];p.clippingState=b,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=d}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,m,v){let g=f!==null?f.length:0,x=null;if(g!==0){if(x=c.value,v!==!0||x===null){let p=m+g*4,d=h.matrixWorldInverse;o.getNormalMatrix(d),(x===null||x.length=0){let X=N[O];if(X===void 0&&(O==="instanceMatrix"&&z.instanceMatrix&&(X=z.instanceMatrix),O==="instanceColor"&&z.instanceColor&&(X=z.instanceColor)),X!==void 0){let Q=X.normalized,a1=X.itemSize,B=t.get(X);if(B===void 0)continue;let M1=B.buffer,u1=B.type,v1=B.bytesPerElement;if(X.isInterleavedBufferAttribute){let n1=X.data,T1=n1.stride,A1=X.offset;if(n1&&n1.isInstancedInterleavedBuffer){for(let C1=0;C10&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=typeof WebGL2RenderingContext!="undefined"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&n instanceof WebGL2ComputeRenderingContext,o=t.precision!==void 0?t.precision:"highp",c=r(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);let l=s||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,f=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),p=n.getParameter(n.MAX_VARYING_VECTORS),d=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),A=h>0,b=s||e.has("OES_texture_float"),C=A&&b,E=s?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:a,getMaxPrecision:r,precision:o,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:h,maxTextureSize:m,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:x,maxVaryings:p,maxFragmentUniforms:d,vertexTextures:A,floatFragmentTextures:b,floatVertexTextures:C,maxSamples:E}}function y5(n){let e=this,t=null,i=0,a=!1,r=!1,s=new ne,o=new n2,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h,m){let v=f.length!==0||h||i!==0||a;return a=h,t=u(f,m,0),i=f.length,v},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1,l()},this.setState=function(f,h,m){let v=f.clippingPlanes,g=f.clipIntersection,x=f.clipShadows,p=n.get(f);if(!a||v===null||v.length===0||r&&!x)r?u(null):l();else{let d=r?0:i,A=d*4,b=p.clippingState||null;c.value=b,b=u(v,h,A,m);for(let C=0;C!==A;++C)b[C]=t[C];p.clippingState=b,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=d}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,m,v){let g=f!==null?f.length:0,x=null;if(g!==0){if(x=c.value,v!==!0||x===null){let p=m+g*4,d=h.matrixWorldInverse;o.getNormalMatrix(d),(x===null||x.length0){let l=new a0(c.height/2);return l.fromEquirectangularTexture(n,s),e.set(s,l),s.addEventListener("dispose",a),t(l.texture,s.mapping)}else return null}}return s}function a(s){let o=s.target;o.removeEventListener("dispose",a);let c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}var r0=class extends n4{constructor(e=-1,t=1,i=1,a=-1,r=.1,s=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=a,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,a,r,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,a=(this.top+this.bottom)/2,r=i-e,s=i+e,o=a+t,c=a-t;if(this.view!==null&&this.view.enabled){let l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,s=r+l*this.view.width,o-=u*this.view.offsetY,c=o-u*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,c,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};r0.prototype.isOrthographicCamera=!0;var l4=class extends oe{constructor(e){super(e);this.type="RawShaderMaterial"}};l4.prototype.isRawShaderMaterial=!0;var u4=4,mt=8,we=Math.pow(2,mt),A5=[.125,.215,.35,.446,.526,.582],w5=mt-u4+1+A5.length,h4=20,Si=new r0,{_lodPlanes:j4,_sizeLods:S5,_sigmas:n0}=O9(),_5=new M1,_i=null,Rt=(1+Math.sqrt(5))/2,f4=1/Rt,E5=[new U(1,1,1),new U(-1,1,1),new U(1,1,-1),new U(-1,1,-1),new U(0,Rt,f4),new U(0,Rt,-f4),new U(f4,0,Rt),new U(-f4,0,Rt),new U(Rt,f4,0),new U(-Rt,f4,0)],s0=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=G9(h4),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,a=100){_i=this._renderer.getRenderTarget();let r=this._allocateTargets();return this._sceneToCubeUV(e,i,a,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=T5(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=D5(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?we:0,we,we),u.setRenderTarget(a),g&&u.render(v,o),u.render(e,o)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=h,u.autoClear=f,e.background=x}_textureToCubeUV(e,t){let i=this._renderer,a=e.mapping===ye||e.mapping===Ue;a?(this._cubemapShader===null&&(this._cubemapShader=T5()),this._cubemapShader.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectShader===null&&(this._equirectShader=D5());let r=a?this._cubemapShader:this._equirectShader,s=new u2(j4[0],r),o=r.uniforms;o.envMap.value=e,a||o.texelSize.value.set(1/e.image.width,1/e.image.height),o0(t,0,0,3*we,2*we),i.setRenderTarget(t),i.render(s,Si)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let a=1;ah4&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${h4}`);let p=[],d=0;for(let L=0;Lmt-u4?a-mt+u4:0);o0(t,b,z,3*w,2*w),c.setRenderTarget(t),c.render(f,Si)}};function O9(){let n=[],e=[],t=[],i=mt;for(let a=0;amt-u4?s=A5[a-mt+u4-1]:a===0&&(s=0),t.push(s);let o=1/(r-1),c=-o/2,l=1+o/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],f=6,h=6,m=3,v=2,g=1,x=new Float32Array(m*h*f),p=new Float32Array(v*h*f),d=new Float32Array(g*h*f);for(let b=0;b2?0:-1,H=[z,L,0,z+2/3,L,0,z+2/3,L+1,0,z,L,0,z+2/3,L+1,0,z,L+1,0];x.set(H,m*h*b),p.set(u,v*h*b);let E=[b,b,b,b,b,b];d.set(E,g*h*b)}let w=new y2;w.setAttribute("position",new b2(x,m)),w.setAttribute("uv",new b2(p,v)),w.setAttribute("faceIndex",new b2(d,g)),n.push(w),i>u4&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function L5(n){let e=new p2(3*we,3*we,n);return e.texture.mapping=nt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function o0(n,e,t,i,a){n.viewport.set(e,t,i,a),n.scissor.set(e,t,i,a)}function G9(n){let e=new Float32Array(n),t=new U(0,1,0);return new l4({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t}},vertexShader:Ei(),fragmentShader:` + `},a=new Ye(5,5,5),r=new se({name:"CubemapFromEquirect",uniforms:$e(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:P1,blending:U2});r.uniforms.tEquirect.value=t;let s=new l2(a,r),o=t.minFilter;return t.minFilter===nt&&(t.minFilter=t2),new Ai(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,i,a){let r=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,i,a);e.setRenderTarget(r)}};i0.prototype.isWebGLCubeRenderTarget=!0;function C5(n){let e=new WeakMap;function t(s,o){return o===D4?s.mapping=be:o===T4&&(s.mapping=ke),s}function i(s){if(s&&s.isTexture&&s.isRenderTargetTexture===!1){let o=s.mapping;if(o===D4||o===T4)if(e.has(s)){let c=e.get(s).texture;return t(c,s.mapping)}else{let c=s.image;if(c&&c.height>0){let l=new i0(c.height/2);return l.fromEquirectangularTexture(n,s),e.set(s,l),s.addEventListener("dispose",a),t(l.texture,s.mapping)}else return null}}return s}function a(s){let o=s.target;o.removeEventListener("dispose",a);let c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}var a0=class extends r4{constructor(e=-1,t=1,i=1,a=-1,r=.1,s=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=a,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,a,r,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,a=(this.top+this.bottom)/2,r=i-e,s=i+e,o=a+t,c=a-t;if(this.view!==null&&this.view.enabled){let l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,s=r+l*this.view.width,o-=u*this.view.offsetY,c=o-u*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,c,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};a0.prototype.isOrthographicCamera=!0;var c4=class extends se{constructor(e){super(e);this.type="RawShaderMaterial"}};c4.prototype.isRawShaderMaterial=!0;var l4=4,pt=8,Ae=Math.pow(2,pt),z5=[.125,.215,.35,.446,.526,.582],A5=pt-l4+1+z5.length,u4=20,wi=new a0,{_lodPlanes:q4,_sizeLods:w5,_sigmas:r0}=k9(),S5=new x1,Si=null,Nt=(1+Math.sqrt(5))/2,h4=1/Nt,_5=[new k(1,1,1),new k(-1,1,1),new k(1,1,-1),new k(-1,1,-1),new k(0,Nt,h4),new k(0,Nt,-h4),new k(h4,0,Nt),new k(-h4,0,Nt),new k(Nt,h4,0),new k(-Nt,h4,0)],n0=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=U9(u4),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,a=100){Si=this._renderer.getRenderTarget();let r=this._allocateTargets();return this._sceneToCubeUV(e,i,a,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=D5(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=L5(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?Ae:0,Ae,Ae),u.setRenderTarget(a),g&&u.render(v,o),u.render(e,o)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=h,u.autoClear=f,e.background=x}_textureToCubeUV(e,t){let i=this._renderer,a=e.mapping===be||e.mapping===ke;a?(this._cubemapShader===null&&(this._cubemapShader=D5()),this._cubemapShader.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectShader===null&&(this._equirectShader=L5());let r=a?this._cubemapShader:this._equirectShader,s=new l2(q4[0],r),o=r.uniforms;o.envMap.value=e,a||o.texelSize.value.set(1/e.image.width,1/e.image.height),s0(t,0,0,3*Ae,2*Ae),i.setRenderTarget(t),i.render(s,wi)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let a=1;au4&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${u4}`);let p=[],d=0;for(let E=0;Ept-l4?a-pt+l4:0);s0(t,b,C,3*A,2*A),c.setRenderTarget(t),c.render(f,wi)}};function k9(){let n=[],e=[],t=[],i=pt;for(let a=0;apt-l4?s=z5[a-pt+l4-1]:a===0&&(s=0),t.push(s);let o=1/(r-1),c=-o/2,l=1+o/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],f=6,h=6,m=3,v=2,g=1,x=new Float32Array(m*h*f),p=new Float32Array(v*h*f),d=new Float32Array(g*h*f);for(let b=0;b2?0:-1,T=[C,E,0,C+2/3,E,0,C+2/3,E+1,0,C,E,0,C+2/3,E+1,0,C,E+1,0];x.set(T,m*h*b),p.set(u,v*h*b);let _=[b,b,b,b,b,b];d.set(_,g*h*b)}let A=new b2;A.setAttribute("position",new M2(x,m)),A.setAttribute("uv",new M2(p,v)),A.setAttribute("faceIndex",new M2(d,g)),n.push(A),i>l4&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function E5(n){let e=new d2(3*Ae,3*Ae,n);return e.texture.mapping=rt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function s0(n,e,t,i,a){n.viewport.set(e,t,i,a),n.scissor.set(e,t,i,a)}function U9(n){let e=new Float32Array(n),t=new k(0,1,0);return new c4({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t}},vertexShader:_i(),fragmentShader:` precision mediump float; precision mediump int; @@ -5539,7 +5539,7 @@ void main() { } } - `,blending:O2,depthTest:!1,depthWrite:!1})}function D5(){let n=new A1(1,1);return new l4({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:n}},vertexShader:Ei(),fragmentShader:` + `,blending:U2,depthTest:!1,depthWrite:!1})}function L5(){let n=new z1(1,1);return new c4({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:n}},vertexShader:_i(),fragmentShader:` precision mediump float; precision mediump int; @@ -5573,7 +5573,7 @@ void main() { gl_FragColor.rgb = mix( tm, bm, f.y ); } - `,blending:O2,depthTest:!1,depthWrite:!1})}function T5(){return new l4({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ei(),fragmentShader:` + `,blending:U2,depthTest:!1,depthWrite:!1})}function D5(){return new c4({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_i(),fragmentShader:` precision mediump float; precision mediump int; @@ -5589,7 +5589,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:O2,depthTest:!1,depthWrite:!1})}function Ei(){return` + `,blending:U2,depthTest:!1,depthWrite:!1})}function _i(){return` precision mediump float; precision mediump int; @@ -5646,43 +5646,43 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function H5(n){let e=new WeakMap,t=null;function i(o){if(o&&o.isTexture){let c=o.mapping,l=c===H4||c===V4,u=c===ye||c===Ue;if(l||u)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let f=e.get(o);return t===null&&(t=new s0(n)),f=l?t.fromEquirectangular(o,f):t.fromCubemap(o,f),e.set(o,f),f.texture}else{if(e.has(o))return e.get(o).texture;{let f=o.image;if(l&&f&&f.height>0||u&&f&&a(f)){t===null&&(t=new s0(n));let h=l?t.fromEquirectangular(o):t.fromCubemap(o);return e.set(o,h),o.addEventListener("dispose",r),h.texture}else return null}}}return o}function a(o){let c=0,l=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(H/e.maxTextureSize),H=e.maxTextureSize);let I=new Float32Array(H*E*4*v),B=new d4(I,H,E,v);B.format=j1,B.type=ee,B.needsUpdate=!0;let M=L*4;for(let A=0;A0)return n;let a=e*t,r=q5[a];if(r===void 0&&(r=new Float32Array(a),q5[a]=r),e!==0){i.toArray(r,0);for(let s=1,o=0;s!==e;++s)o+=t,n[s].toArray(r,o)}return r}function w2(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||u&&f&&a(f)){t===null&&(t=new n0(n));let h=l?t.fromEquirectangular(o):t.fromCubemap(o);return e.set(o,h),o.addEventListener("dispose",r),h.texture}else return null}}}return o}function a(o){let c=0,l=6;for(let u=0;ue.maxTextureSize&&(_=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let P=new Float32Array(T*_*4*v),F=new f4(P,T,_,v);F.format=W1,F.type=Q2,F.needsUpdate=!0;let M=E*4;for(let z=0;z0)return n;let a=e*t,r=G5[a];if(r===void 0&&(r=new Float32Array(a),G5[a]=r),e!==0){i.toArray(r,0);for(let s=1,o=0;s!==e;++s)o+=t,n[s].toArray(r,o)}return r}function A2(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t/gm;function Ti(n){return n.replace(Ou,Gu)}function Gu(n,e){let t=E1[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Ti(t)}var qu=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Wu=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function to(n){return n.replace(Wu,io).replace(qu,ju)}function ju(n,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),io(n,e,t,i)}function io(n,e,t,i){let a="";for(let r=parseInt(e);r/gm;function Di(n){return n.replace(ku,Uu)}function Uu(n,e){let t=_1[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Di(t)}var Ou=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Gu=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function eo(n){return n.replace(Gu,to).replace(Ou,qu)}function qu(n,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),to(n,e,t,i)}function to(n,e,t,i){let a="";for(let r=parseInt(e);r0&&(g+=` -`),x=[h,m].filter(X4).join(` +`),x=[h,m].filter(W4).join(` `),x.length>0&&(x+=` -`)):(g=[ao(t),"#define SHADER_NAME "+t.shaderName,m,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(X4).join(` -`),x=[h,ao(t),"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==G2?"#define TONE_MAPPING":"",t.toneMapping!==G2?E1.tonemapping_pars_fragment:"",t.toneMapping!==G2?Pu("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.alphaWrite?"":"#define OPAQUE",E1.encodings_pars_fragment,Bu("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(X4).join(` -`)),s=Ti(s),s=Q5(s,t),s=eo(s,t),o=Ti(o),o=Q5(o,t),o=eo(o,t),s=to(s),o=to(o),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(p=`#version 300 es +`)):(g=[io(t),"#define SHADER_NAME "+t.shaderName,m,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(W4).join(` +`),x=[h,io(t),"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==O2?"#define TONE_MAPPING":"",t.toneMapping!==O2?_1.tonemapping_pars_fragment:"",t.toneMapping!==O2?Fu("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.alphaWrite?"":"#define OPAQUE",_1.encodings_pars_fragment,Ru("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(W4).join(` +`)),s=Di(s),s=J5(s,t),s=Q5(s,t),o=Di(o),o=J5(o,t),o=Q5(o,t),s=eo(s),o=eo(o),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(p=`#version 300 es `,g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+g,x=["#define varying in",t.glslVersion===B3?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===B3?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+g,x=["#define varying in",t.glslVersion===F3?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===F3?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+x);let d=p+g+s,w=p+x+o,b=Di(a,a.VERTEX_SHADER,d),z=Di(a,a.FRAGMENT_SHADER,w);if(a.attachShader(v,b),a.attachShader(v,z),t.index0AttributeName!==void 0?a.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),n.debug.checkShaderErrors){let E=a.getProgramInfoLog(v).trim(),I=a.getShaderInfoLog(b).trim(),B=a.getShaderInfoLog(z).trim(),M=!0,T=!0;if(a.getProgramParameter(v,a.LINK_STATUS)===!1){M=!1;let A=J5(a,b,"vertex"),V=J5(a,z,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(v,a.VALIDATE_STATUS)+` +`+x);let d=p+g+s,A=p+x+o,b=Li(a,a.VERTEX_SHADER,d),C=Li(a,a.FRAGMENT_SHADER,A);if(a.attachShader(v,b),a.attachShader(v,C),t.index0AttributeName!==void 0?a.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),n.debug.checkShaderErrors){let _=a.getProgramInfoLog(v).trim(),P=a.getShaderInfoLog(b).trim(),F=a.getShaderInfoLog(C).trim(),M=!0,D=!0;if(a.getProgramParameter(v,a.LINK_STATUS)===!1){M=!1;let z=K5(a,b,"vertex"),H=K5(a,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(v,a.VALIDATE_STATUS)+` -Program Info Log: `+E+` -`+A+` -`+V)}else E!==""?console.warn("THREE.WebGLProgram: Program Info Log:",E):(I===""||B==="")&&(T=!1);T&&(this.diagnostics={runnable:M,programLog:E,vertexShader:{log:I,prefix:g},fragmentShader:{log:B,prefix:x}})}a.deleteShader(b),a.deleteShader(z);let L;this.getUniforms=function(){return L===void 0&&(L=new Se(a,v)),L};let H;return this.getAttributes=function(){return H===void 0&&(H=Uu(a,v)),H},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(v),this.program=void 0},this.name=t.shaderName,this.id=Nu++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=b,this.fragmentShader=z,this}var Ku=0,Hi=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(a)===!1&&(s.add(a),a.usedTimes++),s.has(r)===!1&&(s.add(r),r.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache;return t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){let t=this.shaderCache;if(t.has(e)===!1){let i=new no;t.set(e,i)}return t.get(e)}},no=class{constructor(){this.id=Ku++,this.usedTimes=0}};function so(n,e,t,i,a,r,s){let o=new U4,c=new Hi,l=[],u=a.isWebGL2,f=a.logarithmicDepthBuffer,h=a.floatVertexTextures,m=a.maxVertexUniforms,v=a.vertexTextures,g=a.precision,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function p(M){let A=M.skeleton.bones;if(h)return 1024;{let N=Math.floor((m-20)/4),D=Math.min(N,A.length);return D0,h1=M.clearcoat>0;return{isWebGL2:u,shaderID:Y,shaderName:M.type,vertexShader:j,fragmentShader:Z,defines:M.defines,customVertexShaderID:e1,customFragmentShaderID:r1,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:g,instancing:N.isInstancedMesh===!0,instancingColor:N.isInstancedMesh===!0&&N.instanceColor!==null,supportsVertexTextures:v,outputEncoding:P===null?n.outputEncoding:P.isXRRenderTarget===!0?P.texture.encoding:F2,map:!!M.map,matcap:!!M.matcap,envMap:!!O,envMapMode:O&&O.mapping,envMapCubeUV:!!O&&(O.mapping===nt||O.mapping===N4),lightMap:!!M.lightMap,aoMap:!!M.aoMap,emissiveMap:!!M.emissiveMap,bumpMap:!!M.bumpMap,normalMap:!!M.normalMap,objectSpaceNormalMap:M.normalMapType===_8,tangentSpaceNormalMap:M.normalMapType===R6,decodeVideoTexture:!!M.map&&M.map.isVideoTexture===!0&&M.map.encoding===k1,clearcoat:h1,clearcoatMap:h1&&!!M.clearcoatMap,clearcoatRoughnessMap:h1&&!!M.clearcoatRoughnessMap,clearcoatNormalMap:h1&&!!M.clearcoatNormalMap,displacementMap:!!M.displacementMap,roughnessMap:!!M.roughnessMap,metalnessMap:!!M.metalnessMap,specularMap:!!M.specularMap,specularIntensityMap:!!M.specularIntensityMap,specularColorMap:!!M.specularColorMap,alphaMap:!!M.alphaMap,alphaTest:b1,alphaWrite:M.alphaWrite||M.transparent,gradientMap:!!M.gradientMap,sheen:M.sheen>0,sheenColorMap:!!M.sheenColorMap,sheenRoughnessMap:!!M.sheenRoughnessMap,transmission:M.transmission>0,transmissionMap:!!M.transmissionMap,thicknessMap:!!M.thicknessMap,combine:M.combine,vertexTangents:!!M.normalMap&&!!N.geometry&&!!N.geometry.attributes.tangent,vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!N.geometry&&!!N.geometry.attributes.color&&N.geometry.attributes.color.itemSize===4,vertexUvs:!!M.map||!!M.bumpMap||!!M.normalMap||!!M.specularMap||!!M.alphaMap||!!M.emissiveMap||!!M.roughnessMap||!!M.metalnessMap||!!M.clearcoatMap||!!M.clearcoatRoughnessMap||!!M.clearcoatNormalMap||!!M.displacementMap||!!M.transmissionMap||!!M.thicknessMap||!!M.specularIntensityMap||!!M.specularColorMap||!!M.sheenColorMap||!!M.sheenRoughnessMap,uvsVertexOnly:!(!!M.map||!!M.bumpMap||!!M.normalMap||!!M.specularMap||!!M.alphaMap||!!M.emissiveMap||!!M.roughnessMap||!!M.metalnessMap||!!M.clearcoatNormalMap||M.transmission>0||!!M.transmissionMap||!!M.thicknessMap||!!M.specularIntensityMap||!!M.specularColorMap||M.sheen>0||!!M.sheenColorMap||!!M.sheenRoughnessMap)&&!!M.displacementMap,fog:!!D,useFog:M.fog,fogExp2:D&&D.isFogExp2,flatShading:!!M.flatShading,sizeAttenuation:M.sizeAttenuation,logarithmicDepthBuffer:f,skinning:N.isSkinnedMesh===!0&&G>0,maxBones:G,useVertexTexture:h,morphTargets:!!N.geometry&&!!N.geometry.morphAttributes.position,morphNormals:!!N.geometry&&!!N.geometry.morphAttributes.normal,morphTargetsCount:!!N.geometry&&!!N.geometry.morphAttributes.position?N.geometry.morphAttributes.position.length:0,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:M.dithering,shadowMapEnabled:n.shadowMap.enabled&&A.length>0,shadowMapType:n.shadowMap.type,toneMapping:M.toneMapped?n.toneMapping:G2,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Q2,flipSided:M.side===I1,depthPacking:M.depthPacking!==void 0?M.depthPacking:!1,index0AttributeName:M.index0AttributeName,extensionDerivatives:M.extensions&&M.extensions.derivatives,extensionFragDepth:M.extensions&&M.extensions.fragDepth,extensionDrawBuffers:M.extensions&&M.extensions.drawBuffers,extensionShaderTextureLOD:M.extensions&&M.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:M.customProgramCacheKey()}}function w(M){let T=[];if(M.shaderID?T.push(M.shaderID):(T.push(M.customVertexShaderID),T.push(M.customFragmentShaderID)),M.defines!==void 0)for(let A in M.defines)T.push(A),T.push(M.defines[A]);return M.isRawShaderMaterial===!1&&(b(T,M),z(T,M),T.push(n.outputEncoding)),T.push(M.customProgramCacheKey),T.join()}function b(M,T){M.push(T.precision),M.push(T.outputEncoding),M.push(T.envMapMode),M.push(T.combine),M.push(T.vertexUvs),M.push(T.fogExp2),M.push(T.sizeAttenuation),M.push(T.maxBones),M.push(T.morphTargetsCount),M.push(T.numDirLights),M.push(T.numPointLights),M.push(T.numSpotLights),M.push(T.numHemiLights),M.push(T.numRectAreaLights),M.push(T.numDirLightShadows),M.push(T.numPointLightShadows),M.push(T.numSpotLightShadows),M.push(T.shadowMapType),M.push(T.toneMapping),M.push(T.numClippingPlanes),M.push(T.numClipIntersection),M.push(T.alphaWrite)}function z(M,T){o.disableAll(),T.isWebGL2&&o.enable(0),T.supportsVertexTextures&&o.enable(1),T.instancing&&o.enable(2),T.instancingColor&&o.enable(3),T.map&&o.enable(4),T.matcap&&o.enable(5),T.envMap&&o.enable(6),T.envMapCubeUV&&o.enable(7),T.lightMap&&o.enable(8),T.aoMap&&o.enable(9),T.emissiveMap&&o.enable(10),T.bumpMap&&o.enable(11),T.normalMap&&o.enable(12),T.objectSpaceNormalMap&&o.enable(13),T.tangentSpaceNormalMap&&o.enable(14),T.clearcoat&&o.enable(15),T.clearcoatMap&&o.enable(16),T.clearcoatRoughnessMap&&o.enable(17),T.clearcoatNormalMap&&o.enable(18),T.displacementMap&&o.enable(19),T.specularMap&&o.enable(20),T.roughnessMap&&o.enable(21),T.metalnessMap&&o.enable(22),T.gradientMap&&o.enable(23),T.alphaMap&&o.enable(24),T.alphaTest&&o.enable(25),T.vertexColors&&o.enable(26),T.vertexAlphas&&o.enable(27),T.vertexUvs&&o.enable(28),T.vertexTangents&&o.enable(29),T.uvsVertexOnly&&o.enable(30),T.fog&&o.enable(31),M.push(o.mask),o.disableAll(),T.useFog&&o.enable(0),T.flatShading&&o.enable(1),T.logarithmicDepthBuffer&&o.enable(2),T.skinning&&o.enable(3),T.useVertexTexture&&o.enable(4),T.morphTargets&&o.enable(5),T.morphNormals&&o.enable(6),T.premultipliedAlpha&&o.enable(7),T.shadowMapEnabled&&o.enable(8),T.physicallyCorrectLights&&o.enable(9),T.doubleSided&&o.enable(10),T.flipSided&&o.enable(11),T.depthPacking&&o.enable(12),T.dithering&&o.enable(13),T.specularIntensityMap&&o.enable(14),T.specularColorMap&&o.enable(15),T.transmission&&o.enable(16),T.transmissionMap&&o.enable(17),T.thicknessMap&&o.enable(18),T.sheen&&o.enable(19),T.sheenColorMap&&o.enable(20),T.sheenRoughnessMap&&o.enable(21),T.decodeVideoTexture&&o.enable(22),M.push(o.mask)}function L(M){let T=x[M.type],A;if(T){let V=j2[T];A=O8.clone(V.uniforms)}else A=M.uniforms;return A}function H(M,T){let A;for(let V=0,N=l.length;V0?i.push(p):m.transparent===!0?a.push(p):t.push(p)}function c(f,h,m,v,g,x){let p=s(f,h,m,v,g,x);m.transmission>0?i.unshift(p):m.transparent===!0?a.unshift(p):t.unshift(p)}function l(f,h){t.length>1&&t.sort(f||Ju),i.length>1&&i.sort(h||co),a.length>1&&a.sort(h||co)}function u(){for(let f=e,h=n.length;f=n.get(i).length?(r=new lo,n.get(i).push(r)):r=n.get(i)[a],r}function t(){n=new WeakMap}return{get:e,dispose:t}}function Qu(){let n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new U,color:new M1};break;case"SpotLight":t={position:new U,direction:new U,color:new M1,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new U,color:new M1,distance:0,decay:0};break;case"HemisphereLight":t={direction:new U,skyColor:new M1,groundColor:new M1};break;case"RectAreaLight":t={color:new M1,position:new U,halfWidth:new U,halfHeight:new U};break}return n[e.id]=t,t}}}function eh(){let n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new A1};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new A1};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new A1,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}var th=0;function ih(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function ho(n,e){let t=new Qu,i=eh(),a={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)a.probe.push(new U);let r=new U,s=new U1,o=new U1;function c(u,f){let h=0,m=0,v=0;for(let I=0;I<9;I++)a.probe[I].set(0,0,0);let g=0,x=0,p=0,d=0,w=0,b=0,z=0,L=0;u.sort(ih);let H=f!==!0?Math.PI:1;for(let I=0,B=u.length;I0&&(e.isWebGL2?(a.rectAreaLTC1=t1.LTC_FLOAT_1,a.rectAreaLTC2=t1.LTC_FLOAT_2):n.has("OES_texture_float_linear")===!0?(a.rectAreaLTC1=t1.LTC_FLOAT_1,a.rectAreaLTC2=t1.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(a.rectAreaLTC1=t1.LTC_HALF_1,a.rectAreaLTC2=t1.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),a.ambient[0]=h,a.ambient[1]=m,a.ambient[2]=v;let E=a.hash;(E.directionalLength!==g||E.pointLength!==x||E.spotLength!==p||E.rectAreaLength!==d||E.hemiLength!==w||E.numDirectionalShadows!==b||E.numPointShadows!==z||E.numSpotShadows!==L)&&(a.directional.length=g,a.spot.length=p,a.rectArea.length=d,a.point.length=x,a.hemi.length=w,a.directionalShadow.length=b,a.directionalShadowMap.length=b,a.pointShadow.length=z,a.pointShadowMap.length=z,a.spotShadow.length=L,a.spotShadowMap.length=L,a.directionalShadowMatrix.length=b,a.pointShadowMatrix.length=z,a.spotShadowMatrix.length=L,E.directionalLength=g,E.pointLength=x,E.spotLength=p,E.rectAreaLength=d,E.hemiLength=w,E.numDirectionalShadows=b,E.numPointShadows=z,E.numSpotShadows=L,a.version=th++)}function l(u,f){let h=0,m=0,v=0,g=0,x=0,p=f.matrixWorldInverse;for(let d=0,w=u.length;d=t.get(r).length?(o=new fo(n,e),t.get(r).push(o)):o=t.get(r)[s],o}function a(){t=new WeakMap}return{get:i,dispose:a}}var u0=class extends H2{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=w8,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};u0.prototype.isMeshDepthMaterial=!0;var h0=class extends H2{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new U,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};h0.prototype.isMeshDistanceMaterial=!0;var mo=` +Program Info Log: `+_+` +`+z+` +`+H)}else _!==""?console.warn("THREE.WebGLProgram: Program Info Log:",_):(P===""||F==="")&&(D=!1);D&&(this.diagnostics={runnable:M,programLog:_,vertexShader:{log:P,prefix:g},fragmentShader:{log:F,prefix:x}})}a.deleteShader(b),a.deleteShader(C);let E;this.getUniforms=function(){return E===void 0&&(E=new we(a,v)),E};let T;return this.getAttributes=function(){return T===void 0&&(T=Iu(a,v)),T},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(v),this.program=void 0},this.name=t.shaderName,this.id=Hu++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=b,this.fragmentShader=C,this}var Yu=0,Ti=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(a)===!1&&(s.add(a),a.usedTimes++),s.has(r)===!1&&(s.add(r),r.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache;return t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){let t=this.shaderCache;if(t.has(e)===!1){let i=new ro;t.set(e,i)}return t.get(e)}},ro=class{constructor(){this.id=Yu++,this.usedTimes=0}};function no(n,e,t,i,a,r,s){let o=new I4,c=new Ti,l=[],u=a.isWebGL2,f=a.logarithmicDepthBuffer,h=a.floatVertexTextures,m=a.maxVertexUniforms,v=a.vertexTextures,g=a.precision,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function p(M){let z=M.skeleton.bones;if(h)return 1024;{let V=Math.floor((m-20)/4),L=Math.min(V,z.length);return L0,u1=M.clearcoat>0;return{isWebGL2:u,shaderID:Z,shaderName:M.type,vertexShader:W,fragmentShader:X,defines:M.defines,customVertexShaderID:Q,customFragmentShaderID:a1,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:g,instancing:V.isInstancedMesh===!0,instancingColor:V.isInstancedMesh===!0&&V.instanceColor!==null,supportsVertexTextures:v,outputEncoding:B===null?n.outputEncoding:B.isXRRenderTarget===!0?B.texture.encoding:R2,map:!!M.map,matcap:!!M.matcap,envMap:!!U,envMapMode:U&&U.mapping,envMapCubeUV:!!U&&(U.mapping===rt||U.mapping===H4),lightMap:!!M.lightMap,aoMap:!!M.aoMap,emissiveMap:!!M.emissiveMap,bumpMap:!!M.bumpMap,normalMap:!!M.normalMap,objectSpaceNormalMap:M.normalMapType===S8,tangentSpaceNormalMap:M.normalMapType===N6,decodeVideoTexture:!!M.map&&M.map.isVideoTexture===!0&&M.map.encoding===I1,clearcoat:u1,clearcoatMap:u1&&!!M.clearcoatMap,clearcoatRoughnessMap:u1&&!!M.clearcoatRoughnessMap,clearcoatNormalMap:u1&&!!M.clearcoatNormalMap,displacementMap:!!M.displacementMap,roughnessMap:!!M.roughnessMap,metalnessMap:!!M.metalnessMap,specularMap:!!M.specularMap,specularIntensityMap:!!M.specularIntensityMap,specularColorMap:!!M.specularColorMap,alphaMap:!!M.alphaMap,alphaTest:M1,alphaWrite:M.alphaWrite||M.transparent,gradientMap:!!M.gradientMap,sheen:M.sheen>0,sheenColorMap:!!M.sheenColorMap,sheenRoughnessMap:!!M.sheenRoughnessMap,transmission:M.transmission>0,transmissionMap:!!M.transmissionMap,thicknessMap:!!M.thicknessMap,combine:M.combine,vertexTangents:!!M.normalMap&&!!V.geometry&&!!V.geometry.attributes.tangent,vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!V.geometry&&!!V.geometry.attributes.color&&V.geometry.attributes.color.itemSize===4,vertexUvs:!!M.map||!!M.bumpMap||!!M.normalMap||!!M.specularMap||!!M.alphaMap||!!M.emissiveMap||!!M.roughnessMap||!!M.metalnessMap||!!M.clearcoatMap||!!M.clearcoatRoughnessMap||!!M.clearcoatNormalMap||!!M.displacementMap||!!M.transmissionMap||!!M.thicknessMap||!!M.specularIntensityMap||!!M.specularColorMap||!!M.sheenColorMap||!!M.sheenRoughnessMap,uvsVertexOnly:!(!!M.map||!!M.bumpMap||!!M.normalMap||!!M.specularMap||!!M.alphaMap||!!M.emissiveMap||!!M.roughnessMap||!!M.metalnessMap||!!M.clearcoatNormalMap||M.transmission>0||!!M.transmissionMap||!!M.thicknessMap||!!M.specularIntensityMap||!!M.specularColorMap||M.sheen>0||!!M.sheenColorMap||!!M.sheenRoughnessMap)&&!!M.displacementMap,fog:!!L,useFog:M.fog,fogExp2:L&&L.isFogExp2,flatShading:!!M.flatShading,sizeAttenuation:M.sizeAttenuation,logarithmicDepthBuffer:f,skinning:V.isSkinnedMesh===!0&&O>0,maxBones:O,useVertexTexture:h,morphTargets:!!V.geometry&&!!V.geometry.morphAttributes.position,morphNormals:!!V.geometry&&!!V.geometry.morphAttributes.normal,morphTargetsCount:!!V.geometry&&!!V.geometry.morphAttributes.position?V.geometry.morphAttributes.position.length:0,numDirLights:D.directional.length,numPointLights:D.point.length,numSpotLights:D.spot.length,numRectAreaLights:D.rectArea.length,numHemiLights:D.hemi.length,numDirLightShadows:D.directionalShadowMap.length,numPointLightShadows:D.pointShadowMap.length,numSpotLightShadows:D.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:M.dithering,shadowMapEnabled:n.shadowMap.enabled&&z.length>0,shadowMapType:n.shadowMap.type,toneMapping:M.toneMapped?n.toneMapping:O2,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===J2,flipSided:M.side===P1,depthPacking:M.depthPacking!==void 0?M.depthPacking:!1,index0AttributeName:M.index0AttributeName,extensionDerivatives:M.extensions&&M.extensions.derivatives,extensionFragDepth:M.extensions&&M.extensions.fragDepth,extensionDrawBuffers:M.extensions&&M.extensions.drawBuffers,extensionShaderTextureLOD:M.extensions&&M.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:M.customProgramCacheKey()}}function A(M){let D=[];if(M.shaderID?D.push(M.shaderID):(D.push(M.customVertexShaderID),D.push(M.customFragmentShaderID)),M.defines!==void 0)for(let z in M.defines)D.push(z),D.push(M.defines[z]);return M.isRawShaderMaterial===!1&&(b(D,M),C(D,M),D.push(n.outputEncoding)),D.push(M.customProgramCacheKey),D.join()}function b(M,D){M.push(D.precision),M.push(D.outputEncoding),M.push(D.envMapMode),M.push(D.combine),M.push(D.vertexUvs),M.push(D.fogExp2),M.push(D.sizeAttenuation),M.push(D.maxBones),M.push(D.morphTargetsCount),M.push(D.numDirLights),M.push(D.numPointLights),M.push(D.numSpotLights),M.push(D.numHemiLights),M.push(D.numRectAreaLights),M.push(D.numDirLightShadows),M.push(D.numPointLightShadows),M.push(D.numSpotLightShadows),M.push(D.shadowMapType),M.push(D.toneMapping),M.push(D.numClippingPlanes),M.push(D.numClipIntersection),M.push(D.alphaWrite)}function C(M,D){o.disableAll(),D.isWebGL2&&o.enable(0),D.supportsVertexTextures&&o.enable(1),D.instancing&&o.enable(2),D.instancingColor&&o.enable(3),D.map&&o.enable(4),D.matcap&&o.enable(5),D.envMap&&o.enable(6),D.envMapCubeUV&&o.enable(7),D.lightMap&&o.enable(8),D.aoMap&&o.enable(9),D.emissiveMap&&o.enable(10),D.bumpMap&&o.enable(11),D.normalMap&&o.enable(12),D.objectSpaceNormalMap&&o.enable(13),D.tangentSpaceNormalMap&&o.enable(14),D.clearcoat&&o.enable(15),D.clearcoatMap&&o.enable(16),D.clearcoatRoughnessMap&&o.enable(17),D.clearcoatNormalMap&&o.enable(18),D.displacementMap&&o.enable(19),D.specularMap&&o.enable(20),D.roughnessMap&&o.enable(21),D.metalnessMap&&o.enable(22),D.gradientMap&&o.enable(23),D.alphaMap&&o.enable(24),D.alphaTest&&o.enable(25),D.vertexColors&&o.enable(26),D.vertexAlphas&&o.enable(27),D.vertexUvs&&o.enable(28),D.vertexTangents&&o.enable(29),D.uvsVertexOnly&&o.enable(30),D.fog&&o.enable(31),M.push(o.mask),o.disableAll(),D.useFog&&o.enable(0),D.flatShading&&o.enable(1),D.logarithmicDepthBuffer&&o.enable(2),D.skinning&&o.enable(3),D.useVertexTexture&&o.enable(4),D.morphTargets&&o.enable(5),D.morphNormals&&o.enable(6),D.premultipliedAlpha&&o.enable(7),D.shadowMapEnabled&&o.enable(8),D.physicallyCorrectLights&&o.enable(9),D.doubleSided&&o.enable(10),D.flipSided&&o.enable(11),D.depthPacking&&o.enable(12),D.dithering&&o.enable(13),D.specularIntensityMap&&o.enable(14),D.specularColorMap&&o.enable(15),D.transmission&&o.enable(16),D.transmissionMap&&o.enable(17),D.thicknessMap&&o.enable(18),D.sheen&&o.enable(19),D.sheenColorMap&&o.enable(20),D.sheenRoughnessMap&&o.enable(21),D.decodeVideoTexture&&o.enable(22),M.push(o.mask)}function E(M){let D=x[M.type],z;if(D){let H=W2[D];z=U8.clone(H.uniforms)}else z=M.uniforms;return z}function T(M,D){let z;for(let H=0,V=l.length;H0?i.push(p):m.transparent===!0?a.push(p):t.push(p)}function c(f,h,m,v,g,x){let p=s(f,h,m,v,g,x);m.transmission>0?i.unshift(p):m.transparent===!0?a.unshift(p):t.unshift(p)}function l(f,h){t.length>1&&t.sort(f||$u),i.length>1&&i.sort(h||oo),a.length>1&&a.sort(h||oo)}function u(){for(let f=e,h=n.length;f=n.get(i).length?(r=new co,n.get(i).push(r)):r=n.get(i)[a],r}function t(){n=new WeakMap}return{get:e,dispose:t}}function Ku(){let n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new k,color:new x1};break;case"SpotLight":t={position:new k,direction:new k,color:new x1,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new k,color:new x1,distance:0,decay:0};break;case"HemisphereLight":t={direction:new k,skyColor:new x1,groundColor:new x1};break;case"RectAreaLight":t={color:new x1,position:new k,halfWidth:new k,halfHeight:new k};break}return n[e.id]=t,t}}}function Ju(){let n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new z1};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new z1};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new z1,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}var Qu=0;function eh(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function uo(n,e){let t=new Ku,i=Ju(),a={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)a.probe.push(new k);let r=new k,s=new k1,o=new k1;function c(u,f){let h=0,m=0,v=0;for(let P=0;P<9;P++)a.probe[P].set(0,0,0);let g=0,x=0,p=0,d=0,A=0,b=0,C=0,E=0;u.sort(eh);let T=f!==!0?Math.PI:1;for(let P=0,F=u.length;P0&&(e.isWebGL2?(a.rectAreaLTC1=e1.LTC_FLOAT_1,a.rectAreaLTC2=e1.LTC_FLOAT_2):n.has("OES_texture_float_linear")===!0?(a.rectAreaLTC1=e1.LTC_FLOAT_1,a.rectAreaLTC2=e1.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(a.rectAreaLTC1=e1.LTC_HALF_1,a.rectAreaLTC2=e1.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),a.ambient[0]=h,a.ambient[1]=m,a.ambient[2]=v;let _=a.hash;(_.directionalLength!==g||_.pointLength!==x||_.spotLength!==p||_.rectAreaLength!==d||_.hemiLength!==A||_.numDirectionalShadows!==b||_.numPointShadows!==C||_.numSpotShadows!==E)&&(a.directional.length=g,a.spot.length=p,a.rectArea.length=d,a.point.length=x,a.hemi.length=A,a.directionalShadow.length=b,a.directionalShadowMap.length=b,a.pointShadow.length=C,a.pointShadowMap.length=C,a.spotShadow.length=E,a.spotShadowMap.length=E,a.directionalShadowMatrix.length=b,a.pointShadowMatrix.length=C,a.spotShadowMatrix.length=E,_.directionalLength=g,_.pointLength=x,_.spotLength=p,_.rectAreaLength=d,_.hemiLength=A,_.numDirectionalShadows=b,_.numPointShadows=C,_.numSpotShadows=E,a.version=Qu++)}function l(u,f){let h=0,m=0,v=0,g=0,x=0,p=f.matrixWorldInverse;for(let d=0,A=u.length;d=t.get(r).length?(o=new ho(n,e),t.get(r).push(o)):o=t.get(r)[s],o}function a(){t=new WeakMap}return{get:i,dispose:a}}var l0=class extends T2{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=A8,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};l0.prototype.isMeshDepthMaterial=!0;var u0=class extends T2{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new k,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};u0.prototype.isMeshDistanceMaterial=!0;var po=` void main() { gl_Position = vec4( position, 1.0 ); } -`,vo=` +`,mo=` uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; @@ -5729,13 +5729,13 @@ void main() { gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); } -`;function go(n,e,t){let i=new Vt,a=new A1,r=new A1,s=new W1,o=new u0({depthPacking:S8}),c=new h0,l={},u=t.maxTextureSize,f={0:I1,1:ke,2:Q2},h=new oe({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new A1},radius:{value:4}},vertexShader:mo,fragmentShader:vo}),m=h.clone();m.defines.HORIZONTAL_PASS=1;let v=new y2;v.setAttribute("position",new b2(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new u2(v,h),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_6,this.render=function(b,z,L){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||b.length===0)return;let H=n.getRenderTarget(),E=n.getActiveCubeFace(),I=n.getActiveMipmapLevel(),B=n.state;B.setBlending(O2),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);for(let M=0,T=b.length;Mu||a.y>u)&&(a.x>u&&(r.x=Math.floor(u/N.x),a.x=r.x*N.x,V.mapSize.x=r.x),a.y>u&&(r.y=Math.floor(u/N.y),a.y=r.y*N.y,V.mapSize.y=r.y)),V.map===null&&!V.isPointLightShadow&&this.type===wt){let R={minFilter:i2,magFilter:i2,format:j1};V.map=new p2(a.x,a.y,R),V.map.texture.name=A.name+".shadowMap",V.mapPass=new p2(a.x,a.y,R),V.camera.updateProjectionMatrix()}if(V.map===null){let R={minFilter:t2,magFilter:t2,format:j1};V.map=new p2(a.x,a.y,R),V.map.texture.name=A.name+".shadowMap",V.camera.updateProjectionMatrix()}n.setRenderTarget(V.map),n.clear();let D=V.getViewportCount();for(let R=0;R0){let A=M.uuid,V=L.uuid,N=l[A];N===void 0&&(N={},l[A]=N);let D=N[V];D===void 0&&(D=M.clone(),N[V]=D),M=D}return M.visible=L.visible,M.wireframe=L.wireframe,B===wt?M.side=L.shadowSide!==null?L.shadowSide:L.side:M.side=L.shadowSide!==null?L.shadowSide:f[L.side],M.alphaMap=L.alphaMap,M.alphaTest=L.alphaTest,M.clipShadows=L.clipShadows,M.clippingPlanes=L.clippingPlanes,M.clipIntersection=L.clipIntersection,M.displacementMap=L.displacementMap,M.displacementScale=L.displacementScale,M.displacementBias=L.displacementBias,M.wireframeLinewidth=L.wireframeLinewidth,M.linewidth=L.linewidth,H.isPointLight===!0&&M.isMeshDistanceMaterial===!0&&(M.referencePosition.setFromMatrixPosition(H.matrixWorld),M.nearDistance=E,M.farDistance=I),M}function w(b,z,L,H,E){if(b.visible===!1)return;if(b.layers.test(z.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&E===wt)&&(!b.frustumCulled||i.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,b.matrixWorld);let M=e.update(b),T=b.material;if(Array.isArray(T)){let A=M.groups;for(let V=0,N=A.length;V=1):D.indexOf("OpenGL ES")!==-1&&(N=parseFloat(/^OpenGL ES (\d)/.exec(D)[1]),V=N>=2);let R=null,O={},Y=n.getParameter(n.SCISSOR_BOX),G=n.getParameter(n.VIEWPORT),j=new W1().fromArray(Y),Z=new W1().fromArray(G);function e1(k,u1,c1){let v1=new Uint8Array(4),K=n.createTexture();n.bindTexture(k,K),n.texParameteri(k,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(k,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let m1=0;m1i1||F.height>i1)&&(f1=i1/Math.max(F.width,F.height)),f1<1||S===!0)if(typeof HTMLImageElement!="undefined"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&F instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&F instanceof ImageBitmap){let $=S?Tr:Math.floor,p1=$(f1*F.width),d1=$(f1*F.height);g===void 0&&(g=p(p1,d1));let o1=Q?p(p1,d1):g;return o1.width=p1,o1.height=d1,o1.getContext("2d").drawImage(F,0,0,p1,d1),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+F.width+"x"+F.height+") to ("+p1+"x"+d1+")."),o1}else return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+F.width+"x"+F.height+")."),F;return F}function w(F){return i3(F.width)&&i3(F.height)}function b(F){return o?!1:F.wrapS!==c2||F.wrapT!==c2||F.minFilter!==t2&&F.minFilter!==i2}function z(F,S){return F.generateMipmaps&&S&&F.minFilter!==t2&&F.minFilter!==i2}function L(F){n.generateMipmap(F)}function H(F,S,Q,i1,f1=!1){if(o===!1)return S;if(F!==null){if(n[F]!==void 0)return n[F];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+F+"'")}let $=S;return S===n.RED&&(Q===n.FLOAT&&($=n.R32F),Q===n.HALF_FLOAT&&($=n.R16F),Q===n.UNSIGNED_BYTE&&($=n.R8)),S===n.RG&&(Q===n.FLOAT&&($=n.RG32F),Q===n.HALF_FLOAT&&($=n.RG16F),Q===n.UNSIGNED_BYTE&&($=n.RG8)),S===n.RGBA&&(Q===n.FLOAT&&($=n.RGBA32F),Q===n.HALF_FLOAT&&($=n.RGBA16F),Q===n.UNSIGNED_BYTE&&($=i1===k1&&f1===!1?n.SRGB8_ALPHA8:n.RGBA8),Q===n.UNSIGNED_SHORT_4_4_4_4&&($=n.RGBA4),Q===n.UNSIGNED_SHORT_5_5_5_1&&($=n.RGB5_A1)),($===n.R16F||$===n.R32F||$===n.RG16F||$===n.RG32F||$===n.RGBA16F||$===n.RGBA32F)&&e.get("EXT_color_buffer_float"),$}function E(F,S,Q){return z(F,Q)===!0||F.isFramebufferTexture&&F.minFilter!==t2&&F.minFilter!==i2?Math.log2(Math.max(S.width,S.height))+1:F.mipmaps!==void 0&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?S.mipmaps.length:1}function I(F){return F===t2||F===d3||F===p3?n.NEAREST:n.LINEAR}function B(F){let S=F.target;S.removeEventListener("dispose",B),T(S),S.isVideoTexture&&v.delete(S),s.memory.textures--}function M(F){let S=F.target;S.removeEventListener("dispose",M),A(S)}function T(F){let S=i.get(F);S.__webglInit!==void 0&&(n.deleteTexture(S.__webglTexture),i.remove(F))}function A(F){let S=F.texture,Q=i.get(F),i1=i.get(S);if(!!F){if(i1.__webglTexture!==void 0&&(n.deleteTexture(i1.__webglTexture),s.memory.textures--),F.depthTexture&&F.depthTexture.dispose(),F.isWebGLCubeRenderTarget)for(let f1=0;f1<6;f1++)n.deleteFramebuffer(Q.__webglFramebuffer[f1]),Q.__webglDepthbuffer&&n.deleteRenderbuffer(Q.__webglDepthbuffer[f1]);else n.deleteFramebuffer(Q.__webglFramebuffer),Q.__webglDepthbuffer&&n.deleteRenderbuffer(Q.__webglDepthbuffer),Q.__webglMultisampledFramebuffer&&n.deleteFramebuffer(Q.__webglMultisampledFramebuffer),Q.__webglColorRenderbuffer&&n.deleteRenderbuffer(Q.__webglColorRenderbuffer),Q.__webglDepthRenderbuffer&&n.deleteRenderbuffer(Q.__webglDepthRenderbuffer);if(F.isWebGLMultipleRenderTargets)for(let f1=0,$=S.length;f1<$;f1++){let p1=i.get(S[f1]);p1.__webglTexture&&(n.deleteTexture(p1.__webglTexture),s.memory.textures--),i.remove(S[f1])}i.remove(S),i.remove(F)}}let V=0;function N(){V=0}function D(){let F=V;return F>=c&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+c),V+=1,F}function R(F,S){let Q=i.get(F);if(F.isVideoTexture&&X2(F),F.version>0&&Q.__version!==F.version){let i1=F.image;if(i1===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(i1.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{P(Q,F,S);return}}t.activeTexture(n.TEXTURE0+S),t.bindTexture(n.TEXTURE_2D,Q.__webglTexture)}function O(F,S){let Q=i.get(F);if(F.version>0&&Q.__version!==F.version){P(Q,F,S);return}t.activeTexture(n.TEXTURE0+S),t.bindTexture(n.TEXTURE_2D_ARRAY,Q.__webglTexture)}function Y(F,S){let Q=i.get(F);if(F.version>0&&Q.__version!==F.version){P(Q,F,S);return}t.activeTexture(n.TEXTURE0+S),t.bindTexture(n.TEXTURE_3D,Q.__webglTexture)}function G(F,S){let Q=i.get(F);if(F.version>0&&Q.__version!==F.version){b1(Q,F,S);return}t.activeTexture(n.TEXTURE0+S),t.bindTexture(n.TEXTURE_CUBE_MAP,Q.__webglTexture)}let j={[R4]:n.REPEAT,[c2]:n.CLAMP_TO_EDGE,[F4]:n.MIRRORED_REPEAT},Z={[t2]:n.NEAREST,[d3]:n.NEAREST_MIPMAP_NEAREST,[p3]:n.NEAREST_MIPMAP_LINEAR,[i2]:n.LINEAR,[u8]:n.LINEAR_MIPMAP_NEAREST,[st]:n.LINEAR_MIPMAP_LINEAR};function e1(F,S,Q){if(Q?(n.texParameteri(F,n.TEXTURE_WRAP_S,j[S.wrapS]),n.texParameteri(F,n.TEXTURE_WRAP_T,j[S.wrapT]),(F===n.TEXTURE_3D||F===n.TEXTURE_2D_ARRAY)&&n.texParameteri(F,n.TEXTURE_WRAP_R,j[S.wrapR]),n.texParameteri(F,n.TEXTURE_MAG_FILTER,Z[S.magFilter]),n.texParameteri(F,n.TEXTURE_MIN_FILTER,Z[S.minFilter])):(n.texParameteri(F,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(F,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(F===n.TEXTURE_3D||F===n.TEXTURE_2D_ARRAY)&&n.texParameteri(F,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(S.wrapS!==c2||S.wrapT!==c2)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(F,n.TEXTURE_MAG_FILTER,I(S.magFilter)),n.texParameteri(F,n.TEXTURE_MIN_FILTER,I(S.minFilter)),S.minFilter!==t2&&S.minFilter!==i2&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let i1=e.get("EXT_texture_filter_anisotropic");if(S.type===ee&&e.has("OES_texture_float_linear")===!1||o===!1&&S.type===Ce&&e.has("OES_texture_half_float_linear")===!1)return;(S.anisotropy>1||i.get(S).__currentAnisotropy)&&(n.texParameterf(F,i1.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(S.anisotropy,a.getMaxAnisotropy())),i.get(S).__currentAnisotropy=S.anisotropy)}}function r1(F,S){F.__webglInit===void 0&&(F.__webglInit=!0,S.addEventListener("dispose",B),F.__webglTexture=n.createTexture(),s.memory.textures++)}function P(F,S,Q){let i1=n.TEXTURE_2D;S.isDataTexture2DArray&&(i1=n.TEXTURE_2D_ARRAY),S.isDataTexture3D&&(i1=n.TEXTURE_3D),r1(F,S),t.activeTexture(n.TEXTURE0+Q),t.bindTexture(i1,F.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,S.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,S.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);let f1=b(S)&&w(S.image)===!1,$=d(S.image,f1,!1,u);$=m2(S,$);let p1=w($)||o,d1=r.convert(S.format,S.encoding),o1=r.convert(S.type),n1=H(S.internalFormat,d1,o1,S.encoding,S.isVideoTexture);e1(i1,S,p1);let y1,k=S.mipmaps,u1=o&&S.isVideoTexture!==!0,c1=F.__version===void 0,v1=E(S,$,p1);if(S.isDepthTexture)n1=n.DEPTH_COMPONENT,o?S.type===ee?n1=n.DEPTH_COMPONENT32F:S.type===jt?n1=n.DEPTH_COMPONENT24:S.type===ze?n1=n.DEPTH24_STENCIL8:n1=n.DEPTH_COMPONENT16:S.type===ee&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),S.format===te&&n1===n.DEPTH_COMPONENT&&S.type!==Oe&&S.type!==jt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),S.type=Oe,o1=r.convert(S.type)),S.format===Ae&&n1===n.DEPTH_COMPONENT&&(n1=n.DEPTH_STENCIL,S.type!==ze&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),S.type=ze,o1=r.convert(S.type))),u1&&c1?t.texStorage2D(n.TEXTURE_2D,1,n1,$.width,$.height):t.texImage2D(n.TEXTURE_2D,0,n1,$.width,$.height,0,d1,o1,null);else if(S.isDataTexture)if(k.length>0&&p1){u1&&c1&&t.texStorage2D(n.TEXTURE_2D,v1,n1,k[0].width,k[0].height);for(let K=0,m1=k.length;K0&&p1){u1&&c1&&t.texStorage2D(n.TEXTURE_2D,v1,n1,k[0].width,k[0].height);for(let K=0,m1=k.length;K0&&c1++,t.texStorage2D(n.TEXTURE_CUBE_MAP,c1,y1,$[0].width,$[0].height));for(let K=0;K<6;K++)if(f1){k?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,0,0,$[K].width,$[K].height,o1,n1,$[K].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+K,0,y1,$[K].width,$[K].height,0,o1,n1,$[K].data);for(let m1=0;m1m+v?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&h<=m-v&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));return o!==null&&(o.visible=a!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=s!==null),this}};var Y4=class extends J1{constructor(e,t,i,a,r,s,o,c,l,u){if(u=u!==void 0?u:te,u!==te&&u!==Ae)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===te&&(i=Oe),i===void 0&&u===Ae&&(i=ze);super(null,a,r,s,o,c,u,i,l);this.image={width:e,height:t},this.magFilter=o!==void 0?o:t2,this.minFilter=c!==void 0?c:t2,this.flipY=!1,this.generateMipmaps=!1}};Y4.prototype.isDepthTexture=!0;var Vi=class extends B2{constructor(e,t){super();let i=this,a=null,r=1,s=null,o="local-floor",c=e.extensions.has("WEBGL_multisampled_render_to_texture"),l=null,u=null,f=null,h=null,m=!1,v=null,g=t.getContextAttributes(),x=null,p=null,d=[],w=new Map,b=new a2;b.layers.enable(1),b.viewport=new W1;let z=new a2;z.layers.enable(2),z.viewport=new W1;let L=[b,z],H=new f0;H.layers.enable(1),H.layers.enable(2);let E=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let j=d[G];return j===void 0&&(j=new Z4,d[G]=j),j.getTargetRaySpace()},this.getControllerGrip=function(G){let j=d[G];return j===void 0&&(j=new Z4,d[G]=j),j.getGripSpace()},this.getHand=function(G){let j=d[G];return j===void 0&&(j=new Z4,d[G]=j),j.getHandSpace()};function B(G){let j=w.get(G.inputSource);j&&j.dispatchEvent({type:G.type,data:G.inputSource})}function M(){w.forEach(function(G,j){G.disconnect(j)}),w.clear(),E=null,I=null,e.setRenderTarget(x),h=null,f=null,u=null,a=null,p=null,Y.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){r=G,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){o=G,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return f!==null?f:h},this.getBinding=function(){return u},this.getFrame=function(){return v},this.getSession=function(){return a},this.setSession=async function(G){if(a=G,a!==null){if(x=e.getRenderTarget(),a.addEventListener("select",B),a.addEventListener("selectstart",B),a.addEventListener("selectend",B),a.addEventListener("squeeze",B),a.addEventListener("squeezestart",B),a.addEventListener("squeezeend",B),a.addEventListener("end",M),a.addEventListener("inputsourceschange",T),g.xrCompatible!==!0&&await t.makeXRCompatible(),a.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let j={antialias:a.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(a,t,j),a.updateRenderState({baseLayer:h}),p=new p2(h.framebufferWidth,h.framebufferHeight,{format:j1,type:R2,encoding:e.outputEncoding})}else{m=g.antialias;let j=null,Z=null,e1=null;g.depth&&(e1=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,j=g.stencil?Ae:te,Z=g.stencil?ze:Oe);let r1={colorFormat:e.outputEncoding===k1?t.SRGB8_ALPHA8:t.RGBA8,depthFormat:e1,scaleFactor:r};u=new XRWebGLBinding(a,t),f=u.createProjectionLayer(r1),a.updateRenderState({layers:[f]}),m?p=new p4(f.textureWidth,f.textureHeight,{format:j1,type:R2,depthTexture:new Y4(f.textureWidth,f.textureHeight,Z,void 0,void 0,void 0,void 0,void 0,void 0,j),stencilBuffer:g.stencil,ignoreDepth:f.ignoreDepthValues,useRenderToTexture:c,encoding:e.outputEncoding}):p=new p2(f.textureWidth,f.textureHeight,{format:j1,type:R2,depthTexture:new Y4(f.textureWidth,f.textureHeight,Z,void 0,void 0,void 0,void 0,void 0,void 0,j),stencilBuffer:g.stencil,ignoreDepth:f.ignoreDepthValues,encoding:e.outputEncoding})}p.isXRRenderTarget=!0,this.setFoveation(1),s=await a.requestReferenceSpace(o),Y.setContext(a),Y.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function T(G){let j=a.inputSources;for(let Z=0;Z0&&(p.alphaTest.value=d.alphaTest);let w=n.get(d).envMap;w&&(p.envMap.value=w,p.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=d.reflectivity,p.ior.value=d.ior,p.refractionRatio.value=d.refractionRatio),d.lightMap&&(p.lightMap.value=d.lightMap,p.lightMapIntensity.value=d.lightMapIntensity),d.aoMap&&(p.aoMap.value=d.aoMap,p.aoMapIntensity.value=d.aoMapIntensity);let b;d.map?b=d.map:d.specularMap?b=d.specularMap:d.displacementMap?b=d.displacementMap:d.normalMap?b=d.normalMap:d.bumpMap?b=d.bumpMap:d.roughnessMap?b=d.roughnessMap:d.metalnessMap?b=d.metalnessMap:d.alphaMap?b=d.alphaMap:d.emissiveMap?b=d.emissiveMap:d.clearcoatMap?b=d.clearcoatMap:d.clearcoatNormalMap?b=d.clearcoatNormalMap:d.clearcoatRoughnessMap?b=d.clearcoatRoughnessMap:d.specularIntensityMap?b=d.specularIntensityMap:d.specularColorMap?b=d.specularColorMap:d.transmissionMap?b=d.transmissionMap:d.thicknessMap?b=d.thicknessMap:d.sheenColorMap?b=d.sheenColorMap:d.sheenRoughnessMap&&(b=d.sheenRoughnessMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix));let z;d.aoMap?z=d.aoMap:d.lightMap&&(z=d.lightMap),z!==void 0&&(z.isWebGLRenderTarget&&(z=z.texture),z.matrixAutoUpdate===!0&&z.updateMatrix(),p.uv2Transform.value.copy(z.matrix))}function a(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity}function r(p,d){p.dashSize.value=d.dashSize,p.totalSize.value=d.dashSize+d.gapSize,p.scale.value=d.scale}function s(p,d,w,b){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.size.value=d.size*w,p.scale.value=b*.5,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let z;d.map?z=d.map:d.alphaMap&&(z=d.alphaMap),z!==void 0&&(z.matrixAutoUpdate===!0&&z.updateMatrix(),p.uvTransform.value.copy(z.matrix))}function o(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.rotation.value=d.rotation,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let w;d.map?w=d.map:d.alphaMap&&(w=d.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uvTransform.value.copy(w.matrix))}function c(p,d){d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap)}function l(p,d){p.specular.value.copy(d.specular),p.shininess.value=Math.max(d.shininess,1e-4),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===I1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===I1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function u(p,d){d.gradientMap&&(p.gradientMap.value=d.gradientMap),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===I1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===I1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function f(p,d){p.roughness.value=d.roughness,p.metalness.value=d.metalness,d.roughnessMap&&(p.roughnessMap.value=d.roughnessMap),d.metalnessMap&&(p.metalnessMap.value=d.metalnessMap),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===I1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===I1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias),n.get(d).envMap&&(p.envMapIntensity.value=d.envMapIntensity)}function h(p,d,w){f(p,d),p.ior.value=d.ior,d.sheen>0&&(p.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),p.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(p.sheenColorMap.value=d.sheenColorMap),d.sheenRoughnessMap&&(p.sheenRoughnessMap.value=d.sheenRoughnessMap)),d.clearcoat>0&&(p.clearcoat.value=d.clearcoat,p.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(p.clearcoatMap.value=d.clearcoatMap),d.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap),d.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),p.clearcoatNormalMap.value=d.clearcoatNormalMap,d.side===I1&&p.clearcoatNormalScale.value.negate())),d.transmission>0&&(p.transmission.value=d.transmission,p.transmissionSamplerMap.value=w.texture,p.transmissionSamplerSize.value.set(w.width,w.height),d.transmissionMap&&(p.transmissionMap.value=d.transmissionMap),p.thickness.value=d.thickness,d.thicknessMap&&(p.thicknessMap.value=d.thicknessMap),p.attenuationDistance.value=d.attenuationDistance,p.attenuationColor.value.copy(d.attenuationColor)),p.specularIntensity.value=d.specularIntensity,p.specularColor.value.copy(d.specularColor),d.specularIntensityMap&&(p.specularIntensityMap.value=d.specularIntensityMap),d.specularColorMap&&(p.specularColorMap.value=d.specularColorMap)}function m(p,d){d.matcap&&(p.matcap.value=d.matcap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===I1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===I1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function v(p,d){d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function g(p,d){d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias),p.referencePosition.value.copy(d.referencePosition),p.nearDistance.value=d.nearDistance,p.farDistance.value=d.farDistance}function x(p,d){d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===I1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===I1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function nh(){let n=Dt("canvas");return n.style.display="block",n}function Ni(n={}){let e=n.canvas!==void 0?n.canvas:nh(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,a=n.depth!==void 0?n.depth:!0,r=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,c=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,l=n.powerPreference!==void 0?n.powerPreference:"default",u=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1,f=null,h=null,m=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=F2,this.physicallyCorrectLights=!1,this.toneMapping=G2,this.toneMappingExposure=1;let g=this,x=!1,p=0,d=0,w=null,b=-1,z=null,L=new W1,H=new W1,E=null,I=e.width,B=e.height,M=1,T=null,A=null,V=new W1(0,0,I,B),N=new W1(0,0,I,B),D=!1,R=new Vt,O=!1,Y=!1,G=null,j=new U1,Z=new U,e1={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function r1(){return w===null?M:1}let P=t;function b1(_,q){for(let X=0;X<_.length;X++){let W=_[X],J=e.getContext(W,q);if(J!==null)return J}return null}try{let _={alpha:!0,depth:a,stencil:r,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Nr}`),e.addEventListener("webglcontextlost",y1,!1),e.addEventListener("webglcontextrestored",k,!1),P===null){let q=["webgl2","webgl","experimental-webgl"];if(g.isWebGL1Renderer===!0&&q.shift(),P=b1(q,_),P===null)throw b1(q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}P.getShaderPrecisionFormat===void 0&&(P.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(_){throw console.error("THREE.WebGLRenderer: "+_.message),_}let h1,g1,s1,H1,w1,z1,h2,Q1,r2,X2,m2,v2,Z2,ce,le,F,S,Q,i1,f1,$,p1,d1;function o1(){h1=new V5(P),g1=new y5(P,h1,n),h1.init(g1),p1=new bo(P,h1,g1),s1=new xo(P,h1,g1),H1=new F5(P),w1=new oo,z1=new Mo(P,h1,s1,w1,g1,p1,H1),h2=new z5(g),Q1=new H5(g),r2=new U8(P,g1),d1=new M5(P,h1,r2,g1),X2=new N5(P,r2,H1,d1),m2=new I5(P,X2,r2,H1),i1=new P5(P,g1,z1),F=new C5(w1),v2=new so(g,h2,Q1,h1,g1,d1,F),Z2=new yo(w1),ce=new uo,le=new po(h1,g1),Q=new x5(g,h2,s1,m2,i,o),S=new go(g,m2,g1),f1=new b5(P,h1,H1,g1),$=new R5(P,h1,H1,g1),H1.programs=v2.programs,g.capabilities=g1,g.extensions=h1,g.properties=w1,g.renderLists=ce,g.shadowMap=S,g.state=s1,g.info=H1}o1();let n1=new Vi(g,P);this.xr=n1,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){let _=h1.get("WEBGL_lose_context");_&&_.loseContext()},this.forceContextRestore=function(){let _=h1.get("WEBGL_lose_context");_&&_.restoreContext()},this.getPixelRatio=function(){return M},this.setPixelRatio=function(_){_!==void 0&&(M=_,this.setSize(I,B,!1))},this.getSize=function(_){return _.set(I,B)},this.setSize=function(_,q,X){if(n1.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}I=_,B=q,e.width=Math.floor(_*M),e.height=Math.floor(q*M),X!==!1&&(e.style.width=_+"px",e.style.height=q+"px"),this.setViewport(0,0,_,q)},this.getDrawingBufferSize=function(_){return _.set(I*M,B*M).floor()},this.setDrawingBufferSize=function(_,q,X){I=_,B=q,M=X,e.width=Math.floor(_*X),e.height=Math.floor(q*X),this.setViewport(0,0,_,q)},this.getCurrentViewport=function(_){return _.copy(L)},this.getViewport=function(_){return _.copy(V)},this.setViewport=function(_,q,X,W){_.isVector4?V.set(_.x,_.y,_.z,_.w):V.set(_,q,X,W),s1.viewport(L.copy(V).multiplyScalar(M).floor())},this.getScissor=function(_){return _.copy(N)},this.setScissor=function(_,q,X,W){_.isVector4?N.set(_.x,_.y,_.z,_.w):N.set(_,q,X,W),s1.scissor(H.copy(N).multiplyScalar(M).floor())},this.getScissorTest=function(){return D},this.setScissorTest=function(_){s1.setScissorTest(D=_)},this.setOpaqueSort=function(_){T=_},this.setTransparentSort=function(_){A=_},this.getClearColor=function(_){return _.copy(Q.getClearColor())},this.setClearColor=function(){Q.setClearColor.apply(Q,arguments)},this.getClearAlpha=function(){return Q.getClearAlpha()},this.setClearAlpha=function(){Q.setClearAlpha.apply(Q,arguments)},this.clear=function(_,q,X){let W=0;(_===void 0||_)&&(W|=P.COLOR_BUFFER_BIT),(q===void 0||q)&&(W|=P.DEPTH_BUFFER_BIT),(X===void 0||X)&&(W|=P.STENCIL_BUFFER_BIT),P.clear(W)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",y1,!1),e.removeEventListener("webglcontextrestored",k,!1),ce.dispose(),le.dispose(),w1.dispose(),h2.dispose(),Q1.dispose(),m2.dispose(),d1.dispose(),v2.dispose(),n1.dispose(),n1.removeEventListener("sessionstart",T1),n1.removeEventListener("sessionend",Z1),G&&(G.dispose(),G=null),V2.stop()};function y1(_){_.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function k(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let _=H1.autoReset,q=S.enabled,X=S.autoUpdate,W=S.needsUpdate,J=S.type;o1(),H1.autoReset=_,S.enabled=q,S.autoUpdate=X,S.needsUpdate=W,S.type=J}function u1(_){let q=_.target;q.removeEventListener("dispose",u1),c1(q)}function c1(_){v1(_),w1.remove(_)}function v1(_){let q=w1.get(_).programs;q!==void 0&&(q.forEach(function(X){v2.releaseProgram(X)}),_.isShaderMaterial&&v2.releaseShaderCache(_))}this.renderBufferDirect=function(_,q,X,W,J,x1){q===null&&(q=e1);let C1=J.isMesh&&J.matrixWorld.determinant()<0,L1=Bo(_,q,X,W,J);s1.setMaterial(W,C1);let S1=X.index,P1=X.attributes.position;if(S1===null){if(P1===void 0||P1.count===0)return}else if(S1.count===0)return;let V1=1;W.wireframe===!0&&(S1=X2.getWireframeAttribute(X),V1=2),d1.setup(J,W,L1,X,S1);let N1,K1=f1;S1!==null&&(N1=r2.get(S1),K1=$,K1.setIndex(N1));let vt=S1!==null?S1.count:P1.count,Bt=X.drawRange.start*V1,F1=X.drawRange.count*V1,he=x1!==null?x1.start*V1:0,n2=x1!==null?x1.count*V1:1/0,fe=Math.max(Bt,he),Q4=Math.min(vt,Bt+F1,he+n2)-1,de=Math.max(0,Q4-fe+1);if(de!==0){if(J.isMesh)W.wireframe===!0?(s1.setLineWidth(W.wireframeLinewidth*r1()),K1.setMode(P.LINES)):K1.setMode(P.TRIANGLES);else if(J.isLine){let Le=W.linewidth;Le===void 0&&(Le=1),s1.setLineWidth(Le*r1()),J.isLineSegments?K1.setMode(P.LINES):J.isLineLoop?K1.setMode(P.LINE_LOOP):K1.setMode(P.LINE_STRIP)}else J.isPoints?K1.setMode(P.POINTS):J.isSprite&&K1.setMode(P.TRIANGLES);if(J.isInstancedMesh)K1.renderInstances(fe,de,J.count);else if(X.isInstancedBufferGeometry){let Le=Math.min(X.instanceCount,X._maxInstanceCount);K1.renderInstances(fe,de,Le)}else K1.render(fe,de)}},this.compile=function(_,q){h=le.get(_),h.init(),v.push(h),_.traverseVisible(function(X){X.isLight&&X.layers.test(q.layers)&&(h.pushLight(X),X.castShadow&&h.pushShadow(X))}),h.setupLights(g.physicallyCorrectLights),_.traverse(function(X){let W=X.material;if(W)if(Array.isArray(W))for(let J=0;J0?h=v[v.length-1]:h=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function $1(_,q,X,W){if(_.visible===!1)return;if(_.layers.test(q.layers)){if(_.isGroup)X=_.renderOrder;else if(_.isLOD)_.autoUpdate===!0&&_.update(q);else if(_.isLight)h.pushLight(_),_.castShadow&&h.pushShadow(_);else if(_.isSprite){if(!_.frustumCulled||R.intersectsSprite(_)){W&&Z.setFromMatrixPosition(_.matrixWorld).applyMatrix4(j);let C1=m2.update(_),L1=_.material;L1.visible&&f.push(_,C1,L1,X,Z.z,null)}}else if((_.isMesh||_.isLine||_.isPoints)&&(_.isSkinnedMesh&&_.skeleton.frame!==H1.render.frame&&(_.skeleton.update(),_.skeleton.frame=H1.render.frame),!_.frustumCulled||R.intersectsObject(_))){W&&Z.setFromMatrixPosition(_.matrixWorld).applyMatrix4(j);let C1=m2.update(_),L1=_.material;if(Array.isArray(L1)){let S1=C1.groups;for(let P1=0,V1=S1.length;P10&&Ee(J,q,X),W&&s1.viewport(L.copy(W)),J.length>0&&J4(J,q,X),x1.length>0&&J4(x1,q,X),C1.length>0&&J4(C1,q,X)}function Ee(_,q,X){if(G===null){let C1=s===!0&&g1.isWebGL2===!0?p4:p2;G=new C1(1024,1024,{generateMipmaps:!0,type:p1.convert(Ce)!==null?Ce:R2,minFilter:st,magFilter:t2,wrapS:c2,wrapT:c2,useRenderToTexture:h1.has("WEBGL_multisampled_render_to_texture")})}let W=g.getRenderTarget();g.setRenderTarget(G),g.clear();let J=g.toneMapping;g.toneMapping=G2,J4(_,q,X),g.toneMapping=J,z1.updateMultisampleRenderTarget(G),z1.updateRenderTargetMipmap(G),g.setRenderTarget(W)}function J4(_,q,X){let W=q.isScene===!0?q.overrideMaterial:null;for(let J=0,x1=_.length;J=0&&q<=_.width-W&&X>=0&&X<=_.height-J&&P.readPixels(q,X,W,J,p1.convert(P1),p1.convert(V1),x1):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let S1=w!==null?w1.get(w).__webglFramebuffer:null;s1.bindFramebuffer(P.FRAMEBUFFER,S1)}}},this.copyFramebufferToTexture=function(_,q,X=0){if(q.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let W=Math.pow(2,-X),J=Math.floor(q.image.width*W),x1=Math.floor(q.image.height*W);z1.setTexture2D(q,0),P.copyTexSubImage2D(P.TEXTURE_2D,X,0,0,_.x,_.y,J,x1),s1.unbindTexture()},this.copyTextureToTexture=function(_,q,X,W=0){let J=q.image.width,x1=q.image.height,C1=p1.convert(X.format),L1=p1.convert(X.type);z1.setTexture2D(X,0),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,X.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,X.unpackAlignment),q.isDataTexture?P.texSubImage2D(P.TEXTURE_2D,W,_.x,_.y,J,x1,C1,L1,q.image.data):q.isCompressedTexture?P.compressedTexSubImage2D(P.TEXTURE_2D,W,_.x,_.y,q.mipmaps[0].width,q.mipmaps[0].height,C1,q.mipmaps[0].data):P.texSubImage2D(P.TEXTURE_2D,W,_.x,_.y,C1,L1,q.image),W===0&&X.generateMipmaps&&P.generateMipmap(P.TEXTURE_2D),s1.unbindTexture()},this.copyTextureToTexture3D=function(_,q,X,W,J=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let x1=_.max.x-_.min.x+1,C1=_.max.y-_.min.y+1,L1=_.max.z-_.min.z+1,S1=p1.convert(W.format),P1=p1.convert(W.type),V1;if(W.isDataTexture3D)z1.setTexture3D(W,0),V1=P.TEXTURE_3D;else if(W.isDataTexture2DArray)z1.setTexture2DArray(W,0),V1=P.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,W.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,W.unpackAlignment);let N1=P.getParameter(P.UNPACK_ROW_LENGTH),K1=P.getParameter(P.UNPACK_IMAGE_HEIGHT),vt=P.getParameter(P.UNPACK_SKIP_PIXELS),Bt=P.getParameter(P.UNPACK_SKIP_ROWS),F1=P.getParameter(P.UNPACK_SKIP_IMAGES),he=X.isCompressedTexture?X.mipmaps[0]:X.image;P.pixelStorei(P.UNPACK_ROW_LENGTH,he.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,he.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,_.min.x),P.pixelStorei(P.UNPACK_SKIP_ROWS,_.min.y),P.pixelStorei(P.UNPACK_SKIP_IMAGES,_.min.z),X.isDataTexture||X.isDataTexture3D?P.texSubImage3D(V1,J,q.x,q.y,q.z,x1,C1,L1,S1,P1,he.data):X.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),P.compressedTexSubImage3D(V1,J,q.x,q.y,q.z,x1,C1,L1,S1,he.data)):P.texSubImage3D(V1,J,q.x,q.y,q.z,x1,C1,L1,S1,P1,he),P.pixelStorei(P.UNPACK_ROW_LENGTH,N1),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,K1),P.pixelStorei(P.UNPACK_SKIP_PIXELS,vt),P.pixelStorei(P.UNPACK_SKIP_ROWS,Bt),P.pixelStorei(P.UNPACK_SKIP_IMAGES,F1),J===0&&W.generateMipmaps&&P.generateMipmap(V1),s1.unbindTexture()},this.initTexture=function(_){z1.setTexture2D(_,0),s1.unbindTexture()},this.resetState=function(){p=0,d=0,w=null,s1.reset(),d1.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ni.prototype.isWebGLRenderer=!0;var d0=class extends X1{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};d0.prototype.isScene=!0;var v4=class extends X1{constructor(e,t=1){super();this.type="Light",this.color=new M1(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}};v4.prototype.isLight=!0;var p0=class extends v4{constructor(e,t){super(e,t);this.type="AmbientLight"}};p0.prototype.isAmbientLight=!0;var Co=new U1,zo=new U,Ao=new U,Ri=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new A1(512,512),this.map=null,this.mapPass=null,this.matrix=new U1,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Vt,this._frameExtents=new A1(1,1),this._viewportCount=1,this._viewports=[new W1(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;zo.setFromMatrixPosition(e.matrixWorld),t.position.copy(zo),Ao.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ao),t.updateMatrixWorld(),Co.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Co),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}};var m0=class extends Ri{constructor(){super(new a2(50,1,.5,500));this.focus=1}updateMatrices(e){let t=this.camera,i=D4*2*e.angle*this.focus,a=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||a!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=a,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}};m0.prototype.isSpotLightShadow=!0;var v0=class extends v4{constructor(e,t,i=0,a=Math.PI/3,r=0,s=1){super(e,t);this.type="SpotLight",this.position.copy(X1.DefaultUp),this.updateMatrix(),this.target=new X1,this.distance=i,this.angle=a,this.penumbra=r,this.decay=s,this.shadow=new m0}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};v0.prototype.isSpotLight=!0;var g0=class extends H2{constructor(e){super();this.type="ShadowMaterial",this.color=new M1(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}};g0.prototype.isShadowMaterial=!0;var x0=class extends $4.Component{constructor(e){super();this.plugin=e;C(this,"event",new $4.Events);C(this,"renderer");C(this,"scene");C(this,"world");C(this,"camera");C(this,"container",createDiv("renderer-container"));C(this,"current");C(this,"directionalLight");C(this,"ambientLight");C(this,"animation");C(this,"light");C(this,"shadows",!0);C(this,"desk");C(this,"iterations",0);C(this,"frame_rate",1/60);C(this,"stack");C(this,"animating",!1);C(this,"factory",new So(this.WIDTH,this.HEIGHT,this.plugin));C(this,"colors",{ambient:16777215,spotlight:16777215});C(this,"display",{currentWidth:null,currentHeight:null,containerWidth:null,containerHeight:null,aspect:null,scale:null});C(this,"cameraHeight",{max:null,close:null,medium:null,far:null});C(this,"extraFrames",x0.DEFAULT_EXTRA_FRAMES);this.renderer=new Ni({alpha:!0,antialias:!0})}get WIDTH(){return this.container.clientWidth/2}get HEIGHT(){return this.container.clientHeight/2}get ASPECT(){return this.WIDTH/this.HEIGHT}get scale(){return(this.WIDTH*this.WIDTH+this.HEIGHT*this.HEIGHT)/13}get canvasEl(){return this.renderer?this.renderer.domElement:null}setDice(e){this.animating&&(this.unload(),this.load()),this.stack=e,this.current=this.factory.getDice(this.stack,{x:(Math.random()*2-1)*this.WIDTH,y:-(Math.random()*2-1)*this.HEIGHT}),this.scene.add(...[...this.current.values()].flat().map(t=>t.geometry)),this.world.add(...[...this.current.values()].flat())}onload(){this.addChild(this.factory),this.container.empty(),this.container.style.opacity="1",document.body.appendChild(this.container),this.renderer.shadowMap.enabled=this.shadows,this.renderer.shadowMap.type=E6,this.container.appendChild(this.renderer.domElement),this.renderer.setClearColor(0,0),this.scene=new d0,this.initScene(),this.registerDomEvent(window,"resize",()=>{this.initScene()}),this.initWorld()}async start(){return new Promise(async(e,t)=>{this.current.size||t(),this.event.on("throw-finished",i=>{e(i)}),this.event.on("error",i=>{t(i)}),this.animating=!0,this.extraFrames=x0.DEFAULT_EXTRA_FRAMES,this.render()})}enableShadows(){this.shadows=!0,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}disableShadows(){this.shadows=!1,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}get mw(){return Math.max(this.WIDTH,this.HEIGHT)}setDimensions(e){this.display.currentWidth=this.container.clientWidth/2,this.display.currentHeight=this.container.clientHeight/2,e?(this.display.containerWidth=e.w,this.display.containerHeight=e.h):(this.display.containerWidth=this.display.currentWidth,this.display.containerHeight=this.display.currentHeight),this.display.aspect=Math.min(this.display.currentWidth/this.display.containerWidth,this.display.currentHeight/this.display.containerHeight),this.display.scale=Math.sqrt(this.display.containerWidth*this.display.containerWidth+this.display.containerHeight*this.display.containerHeight)/13,this.renderer.setSize(this.display.currentWidth*2,this.display.currentHeight*2),this.cameraHeight.max=this.display.currentHeight/this.display.aspect/Math.tan(10*Math.PI/180),this.factory.width=this.display.currentWidth,this.factory.height=this.display.currentHeight,this.cameraHeight.medium=this.cameraHeight.max/1.5,this.cameraHeight.far=this.cameraHeight.max,this.cameraHeight.close=this.cameraHeight.max/2}initCamera(){this.camera&&this.scene.remove(this.camera),this.camera=new a2(20,this.display.currentWidth/this.display.currentHeight,1,this.cameraHeight.max*1.3),this.camera.position.z=this.cameraHeight.far,this.camera.lookAt(new U(0,0,0))}initLighting(){let e=Math.max(this.display.containerWidth,this.display.containerHeight);this.light&&this.scene.remove(this.light),this.ambientLight&&this.scene.remove(this.ambientLight),this.light=new v0(this.colors.spotlight,.25),this.light.position.set(-e/2,e/2,e*3),this.light.target.position.set(0,0,0),this.light.distance=e*5,this.light.angle=Math.PI/4,this.light.castShadow=this.shadows,this.light.shadow.camera.near=e/10,this.light.shadow.camera.far=e*5,this.light.shadow.camera.fov=50,this.light.shadow.bias=.001,this.light.shadow.mapSize.width=1024,this.light.shadow.mapSize.height=1024,this.scene.add(this.light),this.ambientLight=new p0(16777215,.9),this.scene.add(this.ambientLight)}initDesk(){this.desk&&this.scene.remove(this.desk);let e=new g0;e.opacity=.5,this.desk=new u2(new Nt(this.display.containerWidth*6,this.display.containerHeight*6,1,1),e),this.desk.receiveShadow=this.shadows,this.scene.add(this.desk)}initScene(){this.setDimensions(),this.initCamera(),this.initLighting(),this.initDesk(),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)}initWorld(){this.world=new wo(this.WIDTH,this.HEIGHT),this.iterations=0}getResultsForRoller(e){let t=this.current.get(e),i=t.filter(s=>s instanceof Ht&&s.isPercentile),a=[];for(let s=0;s!(s instanceof Ht&&s.isPercentile)).map(s=>s.getUpsideValue()).filter(s=>s),...a.map(([s,o])=>{let c=s.getUpsideValue();if(!o)return c;let l=o.getUpsideValue();return c===10&&l==10?100:(l==10&&(l=0),c==10&&(c=0),c*10+l)}).filter(s=>s)]}returnResult(){for(let e of this.stack.dynamic){if(!this.current.has(e))continue;let t=this.getResultsForRoller(e);!t||e.setResults(t)}this.event.trigger("throw-finished",this.stack)}unrender(e=this){e.container.style.opacity="0",e.registerInterval(window.setTimeout(()=>{e.animating=!1,e.unload()},1e3))}render(){if(this.throwFinished())if(this.extraFrames>10)this.extraFrames--;else{try{for(let[e,t]of this.current)if(!(!e.modifiers.size||!this.getResultsForRoller(e))&&e.modifiers.has("r")){let a=t.filter(r=>(e.conditions.length||e.conditions.push({operator:"=",comparer:e.faces.min,value:""}),e.checkCondition(r.result,e.conditions)&&r.rerolled{r.rerolled++;let s={x:(Math.random()*2-1)*this.WIDTH,y:-(Math.random()*2-1)*this.HEIGHT};r.vector=r.generateVector(s),r.create(),r.set(),r.stopped=!1}),this.animation=requestAnimationFrame(()=>this.render());return}}if(this.returnResult(),this.plugin.data.renderTime)this.registerInterval(window.setTimeout(()=>this.unrender(),this.plugin.data.renderTime));else{let t=function(){e.unrender(e),document.body.removeEventListener("click",t)},e=this;this.registerDomEvent(document.body,"click",t)}}catch(e){this.event.trigger("error",e)}return}this.animation=requestAnimationFrame(()=>this.render()),this.world.step(this.frame_rate),this.iterations++,this.current.forEach(e=>{e.map(t=>t.set())}),this.renderer.render(this.scene,this.camera)}dispose(...e){e.forEach(t=>{"dispose"in t&&t.dispose(),t.children&&this.dispose(...t.children)})}detach(){}onunload(){cancelAnimationFrame(this.animation),this.container.detach(),this.container.empty(),this.renderer.domElement.detach(),this.renderer.dispose(),this.factory.dispose(),this.ambientLight.dispose(),this.light.dispose(),this.scene.children.forEach(e=>this.dispose(e)),this.scene.remove(this.scene,...this.scene.children,...[...this.current.values()].flat().map(e=>e.geometry)),this.current.forEach(e=>{e.forEach(t=>{[...Array.isArray(t.geometry.material)?t.geometry.material:[t.geometry.material]].forEach(a=>a&&a.dispose()),this.world.world.removeBody(t.body)})}),this.current=new Map}onThrowFinished(){}throwFinished(){let e=!0,t=4;if(this.iterations<10/this.frame_rate)for(let i of this.current.values())for(let a of i){if(a.stopped===!0)continue;let r=a.body.angularVelocity,s=a.body.velocity;if(Math.abs(r.x)3){a.stopped=!0;continue}}else a.stopped=this.iterations;e=!1}else a.stopped=void 0,e=!1}return e}},K4=x0;C(K4,"DEFAULT_EXTRA_FRAMES",30);var wo=class{constructor(e,t){this.WIDTH=e;this.HEIGHT=t;C(this,"lastCallTime");C(this,"world",new e3({gravity:new y(0,0,-9.82*400)}));C(this,"ground",this.getPlane());C(this,"diceMaterial",new Ve);C(this,"deskMaterial",new Ve);C(this,"barrierMaterial",new Ve);this.world.broadphase=new v6,this.world.allowSleep=!0,this.ground.position.set(0,0,0),this.world.addBody(this.ground),this.buildWalls()}add(...e){e.forEach(t=>{this.world.addBody(t.body)})}step(e=1/60){let t=performance.now()/1e3;if(!this.lastCallTime)this.world.step(e);else{let i=t-this.lastCallTime;this.world.step(e,i)}this.lastCallTime=t}buildWalls(){this.world.addContactMaterial(new He(this.deskMaterial,this.diceMaterial,{friction:.01,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new He(this.barrierMaterial,this.diceMaterial,{friction:.01,restitution:1,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new He(this.diceMaterial,this.diceMaterial,{friction:.1,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addBody(new a1({allowSleep:!1,mass:0,shape:new at,material:this.deskMaterial}));let e=new a1({allowSleep:!1,mass:0,shape:new at,material:this.barrierMaterial});e.quaternion.setFromAxisAngle(new y(1,0,0),Math.PI/2),e.position.set(0,this.HEIGHT*.93,0),this.world.addBody(e),e=new a1({allowSleep:!1,mass:0,shape:new at,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new y(1,0,0),-Math.PI/2),e.position.set(0,-this.HEIGHT*.93,0),this.world.addBody(e),e=new a1({allowSleep:!1,mass:0,shape:new at,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new y(0,1,0),-Math.PI/2),e.position.set(this.WIDTH*.93,0,0),this.world.addBody(e),e=new a1({allowSleep:!1,mass:0,shape:new at,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new y(0,1,0),Math.PI/2),e.position.set(-this.WIDTH*.93,0,0),this.world.addBody(e)}getPlane(){return new a1({type:a1.STATIC,shape:new at})}},So=class extends $4.Component{constructor(e,t,i){super();this.width=e;this.height=t;this.plugin=i;C(this,"dice",{});this.buildDice()}get colors(){return{diceColor:this.plugin.data.diceColor,textColor:this.plugin.data.textColor}}updateColors(){this.dispose(),this.buildDice()}onunload(){this.dispose()}disposeChildren(...e){e.forEach(t=>{"dispose"in t&&t.dispose(),t.children&&this.disposeChildren(...t.children)})}dispose(){for(let e of Object.values(this.dice))this.disposeChildren(e.geometry.children)}getDiceForRoller(e,t){let i=[];switch(e.faces.max){case 4:{i.push(...new Array(e.rolls).fill(0).map(a=>new zi(this.width,this.height,this.clone("d4"),t)));break}case 1:case 6:{i.push(...new Array(e.rolls).fill(0).map(a=>new Ci(this.width,this.height,e.fudge?this.clone("fudge"):this.clone("d6"),t)));break}case 8:{i.push(...new Array(e.rolls).fill(0).map(a=>new yi(this.width,this.height,this.clone("d8"),t)));break}case 10:{i.push(...new Array(e.rolls).fill(0).map(a=>new Ht(this.width,this.height,this.clone("d10"),t)));break}case 12:{i.push(...new Array(e.rolls).fill(0).map(a=>new bi(this.width,this.height,this.clone("d12"),t)));break}case 20:{i.push(...new Array(e.rolls).fill(0).map(a=>new Mi(this.width,this.height,this.clone("d20"),t)));break}case 100:{i.push(...new Array(e.rolls).fill(0).map(a=>[new Ht(this.width,this.height,this.clone("d100"),t,!0),new Ht(this.width,this.height,this.clone("d10"),t,!0)]).flat());break}}return i}getDice(e,t){let i=new Map;for(let a of e.dynamic){let r=this.getDiceForRoller(a,t);r.length&&i.set(a,r)}return i}clone(e){if(!(e in this.dice))throw new Error("That dice type does not exist!");return this.dice[e].clone()}buildDice(){this.dice.d100=new ni(this.width,this.height,this.colors).create(),this.dice.d20=new ii(this.width,this.height,this.colors).create(),this.dice.d12=new ai(this.width,this.height,this.colors).create(),this.dice.d10=new ri(this.width,this.height,this.colors).create(),this.dice.d8=new si(this.width,this.height,this.colors).create(),this.dice.d6=new oi(this.width,this.height,this.colors).create(),this.dice.d4=new li(this.width,this.height,this.colors).create(),this.dice.fudge=new ci(this.width,this.height,this.colors).create(),this.dice.boost=new gi(this.width,this.height,this.colors).create(),this.dice.ability=new pi(this.width,this.height,this.colors).create(),this.dice.difficulty=new mi(this.width,this.height,this.colors).create(),this.dice.challenge=new fi(this.width,this.height,this.colors).create(),this.dice.proficiency=new hi(this.width,this.height,this.colors).create(),this.dice.setback=new xi(this.width,this.height,this.colors).create()}};var Lo=S2(Eo());var Fi=class{constructor(e){C(this,"table");this.table=e}parse(e){let t=e.length,i=this.table,a=[],r=[],s=0;for(;sf||u===f&&l.associativity==="right")break;a.push(r.shift())}r.unshift(o)}else a.push(o)}}for(;r.length;){let o=r.shift();if(o.value!=="(")a.push(o);else throw new Error("Mismatched parentheses.")}return a}};var sh=/(?:\d+[Dd])?#(?:[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?:[+-]))?(?:\|(?:[^+-]+))?/u,oh=/(?:\d+[Dd])?#(?:[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?:[+-]))?\|link/u,ch=/(?:.*)?(?:\[.*\]\(|\[\[)(?:.+?)#?\^(?:.+?)(?:\)|\]\])\|?(?:.+)?/u,lh=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|?(?:.+)?/u,uh=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|line/u,hh=/[\(\^\+\-\*\/\)]/u,fh=/(?:\d+|\b)[Dd](?:\[?(?:-?\d+[ \t]?,)?[ \t]?(?:-?\d+|%|F)\]?|\b)/u,dh=/(?:=|=!|<|>|<=|>=|=<|=>|-=|=-)\d+/u,b0=class{constructor(e){this.plugin=e;C(this,"lexer",Lo.compile({WS:[{match:/[ \t]+/u},{match:/[{}]+/u}],table:ch,line:uh,section:lh,link:oh,tag:sh,condition:dh,kl:{match:/kl\d*/u,value:this.clampInfinite},kh:[{match:/kh\d*/u,value:this.clampInfinite},{match:/k\d*/u,value:this.clampInfinite}],dh:{match:/dh\d*/u,value:this.clampInfinite},dl:[{match:/dl\d*/u,value:this.clampInfinite}],"!!":{match:/!!(?:i|\d+)?/u,value:this.clampInfinite},"!":{match:/!(?:i|\d+)?/u,value:this.clampInfinite},r:{match:/r(?:i|\d+)?/u,value:this.clampInfinite},u:/u/u,stunt:/1[Dd]S/u,"%":/\d+[Dd]\d+%/u,dice:[{match:fh,value:e=>{let{roll:t=this.plugin.data.defaultRoll,faces:i=this.plugin.data.defaultFace}=e.match(/(?\d+)?[Dd](?\[?(?:-?\d+[ \t]?,)?[ \t]?(?:-?\d+|%|F)\]?)?/).groups;return`${t}d${i}`}},{match:/\d+/u},{match:/\b[A-Za-z][A-Za-z0-9_]+\b/u,value:e=>this.plugin.inline.has(e)?`${this.plugin.inline.get(e)}`:e}],sort:[{match:/s(?:a|d)*/u,value:e=>e=="s"||e=="sa"?"sa":"sd"}],math:hh}));C(this,"parser");let t={precedence:3,associativity:"right"},i={precedence:2,associativity:"left"},a={precedence:1,associativity:"left"};this.parser=new Fi({"+":a,"-":a,"*":i,"/":i,"^":t})}clampInfinite(e){return/i$/.test(e)?"100":e.replace(/^\D+/g,"")}parse(e){let t=Array.from(this.lexer.reset(e));return this.lexer.reset(),this.parser.parse(this.transform(t))}transform(e){e=e.filter(i=>i.type!="WS");let t=[];for(let i of e)if(i.type=="condition"&&t.length>0){let a=t[t.length-1];a.conditions||(a.conditions=[]);let[r,s,o]=i.value.match(/(?=|=!|<|>|<=|>=|=<|=>|\-=|=\-)(?\d+)/)??[];a.conditions.push({operator:s,comparer:Number(o),value:i.value})}else t.push(i);return t}getTypeFromLexemes(e){return e.some(({type:t})=>t==="table")?"table":e.some(({type:t})=>t==="section")?"section":e.some(({type:t})=>t==="tag")?"tag":e.some(({type:t})=>t==="link")?"link":e.some(({type:t})=>t==="line")?"line":"dice"}};var _e=S2(require("@codemirror/view")),Do=S2(require("@codemirror/language")),g4=S2(require("obsidian"));function ph(n,e,t){for(let i of n.ranges)if(i.from<=t&&i.to>=e)return!0;return!1}function To(n,e){let t=app.workspace.getActiveFile();if(!t)return;let i=[],a=n.state.selection,r=new RegExp(".*?_?inline-code_?.*");for(let{from:s,to:o}of n.visibleRanges)(0,Do.syntaxTree)(n.state).iterate({from:s,to:o,enter:({node:c})=>{let l=c.type;if(l.name.includes("formatting")||!r.test(l.name))return;let u=c.from,f=c.to;if(ph(a,u,f+1))return;let h=n.state.doc.sliceString(u,f).trim();if(/^dice-mod:\s*([\s\S]+)\s*?/.test(h)){let[,x]=h.match(/dice-mod:\s*([\s\S]+)\s*?/),p=app.workspace.getActiveFile(),d=e.getRollerSync(x,p.path);d.roll().then(w=>{let b=e.data.displayFormulaForMod?`${d.inlineText} **${d.replacer}**`:`${d.replacer}`,z={from:u-1,to:f+1,insert:b},L=n.state.update({changes:z});n.dispatch(L)});return}if(!/^dice(?:\+|\-)?:\s*([\s\S]+)\s*?/.test(h))return;let[,m]=h.match(/^dice(?:\+|\-)?:\s*([\s\S]+)\s*?/),v=e.getRollerSync(m,t.path),g=new Ho(h,v,n,e,t);e.addToFileMap(t,v),i.push(_e.Decoration.replace({widget:g,inclusive:!1,block:!1}).range(u-1,f+1))}});return _e.Decoration.set(i,!0)}var Ho=class extends _e.WidgetType{constructor(e,t,i,a,r){super();this.rawQuery=e;this.roller=t;this.view=i;this.plugin=a;this.file=r}eq(e){return e.rawQuery===this.rawQuery?!0:(this.plugin.fileMap.get(this.file)?.remove(e.roller),!1)}toDOM(e){return this.roller.roll(),this.roller.containerEl}ignoreEvent(e){if(e.type==="mousedown"){let t=this.view.posAtCoords({x:e.x,y:e.y});if(e.shiftKey){if(t){let{editor:i}=this.view.state.field(g4.editorEditorField).state.field(g4.editorViewField);i.setCursor(i.offsetToPos(t))}return!1}}return!0}};function Vo(n){return _e.ViewPlugin.fromClass(class{constructor(e){C(this,"decorations");this.decorations=To(e,n)??_e.Decoration.none}update(e){if(!e.state.field(g4.editorLivePreviewField)){this.decorations=_e.Decoration.none;return}(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=To(e.view,n)??_e.Decoration.none)}},{decorations:e=>e.decorations})}var Je=class{constructor(e){this.plugin=e;C(this,"sources",new Map)}get renderer(){return this.plugin.renderer}registerSource(e,t){this.sources.set(e,t)}getRollerSync(e,t){let i=this.sources.get(t)??Je.RollerOptions(this.plugin);return this.plugin.getRollerSync(e,t,i)}async getRoller(e,t){let i=this.sources.get(t)??Je.RollerOptions(this.plugin);return this.plugin.getRoller(e,t,i)}static RollerOptions(e){return{showDice:e.data.showDice,shouldRender:e.data.renderAllDice,showFormula:e.data.displayResultsInline,showParens:e.data.displayFormulaAfter,expectedValue:x2.Roll,text:null}}};String.prototype.matchAll=String.prototype.matchAll||function*(e){let t=e.global?e.flags:e.flags+"g",i=new RegExp(e,t),a;for(;a=i.exec(this);)yield a};var p6={returnAllTags:!0,rollLinksForTags:!1,copyContentButton:!0,customFormulas:[],displayFormulaForMod:!0,displayResultsInline:!1,displayFormulaAfter:!1,displayLookupRoll:!0,formulas:{},persistResults:!1,results:{},defaultRoll:1,defaultFace:100,renderer:!1,renderAllDice:!1,renderTime:2e3,diceColor:"#202020",textColor:"#ffffff",showLeafOnStartup:!0,showDice:!0,displayAsEmbed:!0,round:me.None},Bi=class extends Y1.Plugin{constructor(){super(...arguments);C(this,"api",new Je(this));C(this,"data");C(this,"fileMap",new Map);C(this,"inline",new Map);C(this,"operators",{"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"^":(e,t)=>Math.pow(e,t)});C(this,"parser",new b0(this));C(this,"persistingFiles",new Set);C(this,"renderer")}async onload(){console.log("DiceRoller plugin loaded"),this.data=Object.assign({},p6,await this.loadData()),this.renderer=new K4(this),this.addSettingTab(new d6(this.app,this)),this.registerView(yt,i=>new et(this,i)),this.app.workspace.onLayoutReady(()=>this.addDiceView(!0)),this.registerEvent(this.app.workspace.on("dice-roller:update-colors",()=>{this.renderer.factory.updateColors()})),this.registerEvent(this.app.workspace.on("dice-roller:render-dice",async i=>{let a=await this.getRoller(i,"external");if(!(a instanceof _2)){new Y1.Notice("The Dice View only supports dice rolls.");return}if(await a.roll(),!a.dice.length){new Y1.Notice("Invalid formula.");return}try{this.renderRoll(a)}catch(r){new Y1.Notice("There was an error rendering the roll."),console.error(r)}this.app.workspace.trigger("dice-roller:rendered-result",a.result)})),this.addCommand({id:"open-view",name:"Open Dice View",callback:()=>{this.view?this.app.workspace.revealLeaf(this.view.leaf):this.addDiceView()}}),this.addCommand({id:"reroll",name:"Re-roll Dice",checkCallback:i=>{let a=this.app.workspace.getActiveViewOfType(Y1.MarkdownView);if(a&&(a.getMode()==="preview"||a.editor.cm.state.field(Y1.editorLivePreviewField))&&this.fileMap.has(a.file))return i||this.fileMap.get(a.file).forEach(s=>{s instanceof l6&&s.roll()}),!0}});let e=N0(Ui).html[0];(0,Y1.addIcon)($2,e);let t=N0(Oi).html[0];(0,Y1.addIcon)(Qe,t),this.registerMarkdownPostProcessor(this.postprocessor.bind(this)),this.registerEditorExtension([Vo(this)]),this.app.workspace.onLayoutReady(async()=>{await this.registerDataviewInlineFields()}),this.app.workspace.trigger("dice-roller:loaded")}addToFileMap(e,t){this.fileMap.has(e)||this.fileMap.set(e,[]),this.fileMap.set(e,[...this.fileMap.get(e),t])}async postprocessor(e,t){let i=e.querySelectorAll("code");if(!i.length)return;let a=t.sourcePath,r=t.getSectionInfo(e),s=t.getSectionInfo(e)?.lineStart,o=this.app.vault.getAbstractFileByPath(t.sourcePath);if((!o||!(o instanceof Y1.TFile))&&a!="STATBLOCK_RENDERER")return;let c={},l,u=!1,f=[];for(let h=0;h{p.on("new-result",async()=>{let b=l.slice(r.lineStart,r.lineEnd+1),z=p.replacer;if(!z){new Y1.Notice("Dice Roller: There was an issue modifying the file.");return}let L=x?`${p.inlineText} ${z}`:`${z}`;b=b.join(` -`).replace(`\`${v}\``,L.replace(/([\*\[\]])/g,"\\$1")).split(` -`),l.splice(r.lineStart,r.lineEnd-r.lineStart+1,...b),d()})})),await p.roll();continue}catch(v){console.error(v)}if(!!/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/.test(m.innerText))try{let[,v]=m.innerText.match(/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/),g=await this.getRoller(v,t.sourcePath),x=this.data.results?.[a]?.[s]?.[h]??null;(this.data.persistResults&&!/dice\-/.test(m.innerText)||/dice\+/.test(m.innerText))&&(this.persistingFiles.add(t.sourcePath),c[h]=g,g.save=!0);let p=this.data.renderAllDice;v.includes("|render")&&(p=!0),v.includes("|norender")&&(p=!1);let d=async()=>{await g.roll(),g.save&&x&&await g.applyResult(x),g instanceof _2&&(g.shouldRender=p),m.replaceWith(g.containerEl)};if(g.loaded?await d():g.on("loaded",async()=>{await d()}),!o||!(o instanceof Y1.TFile))continue;this.addToFileMap(o,g);let w=this.app.workspace.getActiveViewOfType(Y1.MarkdownView);if(w&&this.fileMap.has(o)&&this.fileMap.get(o).length===1){let b=this,z=R0(w,{onUnloadFile:function(L){return async function(H){return H==o&&(b.fileMap.delete(o),z()),await L.call(this,H)}}});w.register(z),w.register(()=>this.fileMap.delete(o))}}catch(v){console.error(v),new Y1.Notice(`There was an error parsing the dice string: ${m.innerText}. +`;function vo(n,e,t){let i=new Ht,a=new z1,r=new z1,s=new q1,o=new l0({depthPacking:w8}),c=new u0,l={},u=t.maxTextureSize,f={0:P1,1:Ie,2:J2},h=new se({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new z1},radius:{value:4}},vertexShader:po,fragmentShader:mo}),m=h.clone();m.defines.HORIZONTAL_PASS=1;let v=new b2;v.setAttribute("position",new M2(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new l2(v,h),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=S6,this.render=function(b,C,E){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||b.length===0)return;let T=n.getRenderTarget(),_=n.getActiveCubeFace(),P=n.getActiveMipmapLevel(),F=n.state;F.setBlending(U2),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);for(let M=0,D=b.length;Mu||a.y>u)&&(a.x>u&&(r.x=Math.floor(u/V.x),a.x=r.x*V.x,H.mapSize.x=r.x),a.y>u&&(r.y=Math.floor(u/V.y),a.y=r.y*V.y,H.mapSize.y=r.y)),H.map===null&&!H.isPointLightShadow&&this.type===At){let N={minFilter:t2,magFilter:t2,format:W1};H.map=new d2(a.x,a.y,N),H.map.texture.name=z.name+".shadowMap",H.mapPass=new d2(a.x,a.y,N),H.camera.updateProjectionMatrix()}if(H.map===null){let N={minFilter:e2,magFilter:e2,format:W1};H.map=new d2(a.x,a.y,N),H.map.texture.name=z.name+".shadowMap",H.camera.updateProjectionMatrix()}n.setRenderTarget(H.map),n.clear();let L=H.getViewportCount();for(let N=0;N0){let z=M.uuid,H=E.uuid,V=l[z];V===void 0&&(V={},l[z]=V);let L=V[H];L===void 0&&(L=M.clone(),V[H]=L),M=L}return M.visible=E.visible,M.wireframe=E.wireframe,F===At?M.side=E.shadowSide!==null?E.shadowSide:E.side:M.side=E.shadowSide!==null?E.shadowSide:f[E.side],M.alphaMap=E.alphaMap,M.alphaTest=E.alphaTest,M.clipShadows=E.clipShadows,M.clippingPlanes=E.clippingPlanes,M.clipIntersection=E.clipIntersection,M.displacementMap=E.displacementMap,M.displacementScale=E.displacementScale,M.displacementBias=E.displacementBias,M.wireframeLinewidth=E.wireframeLinewidth,M.linewidth=E.linewidth,T.isPointLight===!0&&M.isMeshDistanceMaterial===!0&&(M.referencePosition.setFromMatrixPosition(T.matrixWorld),M.nearDistance=_,M.farDistance=P),M}function A(b,C,E,T,_){if(b.visible===!1)return;if(b.layers.test(C.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&_===At)&&(!b.frustumCulled||i.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,b.matrixWorld);let M=e.update(b),D=b.material;if(Array.isArray(D)){let z=M.groups;for(let H=0,V=z.length;H=1):L.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),H=V>=2);let N=null,U={},Z=n.getParameter(n.SCISSOR_BOX),O=n.getParameter(n.VIEWPORT),W=new q1().fromArray(Z),X=new q1().fromArray(O);function Q(I,l1,o1){let m1=new Uint8Array(4),$=n.createTexture();n.bindTexture(I,$),n.texParameteri(I,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(I,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let p1=0;p1t1||R.height>t1)&&(h1=t1/Math.max(R.width,R.height)),h1<1||w===!0)if(typeof HTMLImageElement!="undefined"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&R instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&R instanceof ImageBitmap){let Y=w?Dr:Math.floor,d1=Y(h1*R.width),f1=Y(h1*R.height);g===void 0&&(g=p(d1,f1));let s1=J?p(d1,f1):g;return s1.width=d1,s1.height=f1,s1.getContext("2d").drawImage(R,0,0,d1,f1),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+R.width+"x"+R.height+") to ("+d1+"x"+f1+")."),s1}else return"data"in R&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+R.width+"x"+R.height+")."),R;return R}function A(R){return t3(R.width)&&t3(R.height)}function b(R){return o?!1:R.wrapS!==o2||R.wrapT!==o2||R.minFilter!==e2&&R.minFilter!==t2}function C(R,w){return R.generateMipmaps&&w&&R.minFilter!==e2&&R.minFilter!==t2}function E(R){n.generateMipmap(R)}function T(R,w,J,t1,h1=!1){if(o===!1)return w;if(R!==null){if(n[R]!==void 0)return n[R];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let Y=w;return w===n.RED&&(J===n.FLOAT&&(Y=n.R32F),J===n.HALF_FLOAT&&(Y=n.R16F),J===n.UNSIGNED_BYTE&&(Y=n.R8)),w===n.RG&&(J===n.FLOAT&&(Y=n.RG32F),J===n.HALF_FLOAT&&(Y=n.RG16F),J===n.UNSIGNED_BYTE&&(Y=n.RG8)),w===n.RGBA&&(J===n.FLOAT&&(Y=n.RGBA32F),J===n.HALF_FLOAT&&(Y=n.RGBA16F),J===n.UNSIGNED_BYTE&&(Y=t1===I1&&h1===!1?n.SRGB8_ALPHA8:n.RGBA8),J===n.UNSIGNED_SHORT_4_4_4_4&&(Y=n.RGBA4),J===n.UNSIGNED_SHORT_5_5_5_1&&(Y=n.RGB5_A1)),(Y===n.R16F||Y===n.R32F||Y===n.RG16F||Y===n.RG32F||Y===n.RGBA16F||Y===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Y}function _(R,w,J){return C(R,J)===!0||R.isFramebufferTexture&&R.minFilter!==e2&&R.minFilter!==t2?Math.log2(Math.max(w.width,w.height))+1:R.mipmaps!==void 0&&R.mipmaps.length>0?R.mipmaps.length:R.isCompressedTexture&&Array.isArray(R.image)?w.mipmaps.length:1}function P(R){return R===e2||R===f3||R===d3?n.NEAREST:n.LINEAR}function F(R){let w=R.target;w.removeEventListener("dispose",F),D(w),w.isVideoTexture&&v.delete(w),s.memory.textures--}function M(R){let w=R.target;w.removeEventListener("dispose",M),z(w)}function D(R){let w=i.get(R);w.__webglInit!==void 0&&(n.deleteTexture(w.__webglTexture),i.remove(R))}function z(R){let w=R.texture,J=i.get(R),t1=i.get(w);if(!!R){if(t1.__webglTexture!==void 0&&(n.deleteTexture(t1.__webglTexture),s.memory.textures--),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLCubeRenderTarget)for(let h1=0;h1<6;h1++)n.deleteFramebuffer(J.__webglFramebuffer[h1]),J.__webglDepthbuffer&&n.deleteRenderbuffer(J.__webglDepthbuffer[h1]);else n.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&n.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&n.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer&&n.deleteRenderbuffer(J.__webglColorRenderbuffer),J.__webglDepthRenderbuffer&&n.deleteRenderbuffer(J.__webglDepthRenderbuffer);if(R.isWebGLMultipleRenderTargets)for(let h1=0,Y=w.length;h1=c&&console.warn("THREE.WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+c),H+=1,R}function N(R,w){let J=i.get(R);if(R.isVideoTexture&&j2(R),R.version>0&&J.__version!==R.version){let t1=R.image;if(t1===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(t1.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{B(J,R,w);return}}t.activeTexture(n.TEXTURE0+w),t.bindTexture(n.TEXTURE_2D,J.__webglTexture)}function U(R,w){let J=i.get(R);if(R.version>0&&J.__version!==R.version){B(J,R,w);return}t.activeTexture(n.TEXTURE0+w),t.bindTexture(n.TEXTURE_2D_ARRAY,J.__webglTexture)}function Z(R,w){let J=i.get(R);if(R.version>0&&J.__version!==R.version){B(J,R,w);return}t.activeTexture(n.TEXTURE0+w),t.bindTexture(n.TEXTURE_3D,J.__webglTexture)}function O(R,w){let J=i.get(R);if(R.version>0&&J.__version!==R.version){M1(J,R,w);return}t.activeTexture(n.TEXTURE0+w),t.bindTexture(n.TEXTURE_CUBE_MAP,J.__webglTexture)}let W={[V4]:n.REPEAT,[o2]:n.CLAMP_TO_EDGE,[N4]:n.MIRRORED_REPEAT},X={[e2]:n.NEAREST,[f3]:n.NEAREST_MIPMAP_NEAREST,[d3]:n.NEAREST_MIPMAP_LINEAR,[t2]:n.LINEAR,[l8]:n.LINEAR_MIPMAP_NEAREST,[nt]:n.LINEAR_MIPMAP_LINEAR};function Q(R,w,J){if(J?(n.texParameteri(R,n.TEXTURE_WRAP_S,W[w.wrapS]),n.texParameteri(R,n.TEXTURE_WRAP_T,W[w.wrapT]),(R===n.TEXTURE_3D||R===n.TEXTURE_2D_ARRAY)&&n.texParameteri(R,n.TEXTURE_WRAP_R,W[w.wrapR]),n.texParameteri(R,n.TEXTURE_MAG_FILTER,X[w.magFilter]),n.texParameteri(R,n.TEXTURE_MIN_FILTER,X[w.minFilter])):(n.texParameteri(R,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(R,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(R===n.TEXTURE_3D||R===n.TEXTURE_2D_ARRAY)&&n.texParameteri(R,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(w.wrapS!==o2||w.wrapT!==o2)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(R,n.TEXTURE_MAG_FILTER,P(w.magFilter)),n.texParameteri(R,n.TEXTURE_MIN_FILTER,P(w.minFilter)),w.minFilter!==e2&&w.minFilter!==t2&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let t1=e.get("EXT_texture_filter_anisotropic");if(w.type===Q2&&e.has("OES_texture_float_linear")===!1||o===!1&&w.type===ye&&e.has("OES_texture_half_float_linear")===!1)return;(w.anisotropy>1||i.get(w).__currentAnisotropy)&&(n.texParameterf(R,t1.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,a.getMaxAnisotropy())),i.get(w).__currentAnisotropy=w.anisotropy)}}function a1(R,w){R.__webglInit===void 0&&(R.__webglInit=!0,w.addEventListener("dispose",F),R.__webglTexture=n.createTexture(),s.memory.textures++)}function B(R,w,J){let t1=n.TEXTURE_2D;w.isDataTexture2DArray&&(t1=n.TEXTURE_2D_ARRAY),w.isDataTexture3D&&(t1=n.TEXTURE_3D),a1(R,w),t.activeTexture(n.TEXTURE0+J),t.bindTexture(t1,R.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,w.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,w.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);let h1=b(w)&&A(w.image)===!1,Y=d(w.image,h1,!1,u);Y=p2(w,Y);let d1=A(Y)||o,f1=r.convert(w.format,w.encoding),s1=r.convert(w.type),r1=T(w.internalFormat,f1,s1,w.encoding,w.isVideoTexture);Q(t1,w,d1);let b1,I=w.mipmaps,l1=o&&w.isVideoTexture!==!0,o1=R.__version===void 0,m1=_(w,Y,d1);if(w.isDepthTexture)r1=n.DEPTH_COMPONENT,o?w.type===Q2?r1=n.DEPTH_COMPONENT32F:w.type===Wt?r1=n.DEPTH_COMPONENT24:w.type===Ce?r1=n.DEPTH24_STENCIL8:r1=n.DEPTH_COMPONENT16:w.type===Q2&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===ee&&r1===n.DEPTH_COMPONENT&&w.type!==Ue&&w.type!==Wt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=Ue,s1=r.convert(w.type)),w.format===ze&&r1===n.DEPTH_COMPONENT&&(r1=n.DEPTH_STENCIL,w.type!==Ce&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=Ce,s1=r.convert(w.type))),l1&&o1?t.texStorage2D(n.TEXTURE_2D,1,r1,Y.width,Y.height):t.texImage2D(n.TEXTURE_2D,0,r1,Y.width,Y.height,0,f1,s1,null);else if(w.isDataTexture)if(I.length>0&&d1){l1&&o1&&t.texStorage2D(n.TEXTURE_2D,m1,r1,I[0].width,I[0].height);for(let $=0,p1=I.length;$0&&d1){l1&&o1&&t.texStorage2D(n.TEXTURE_2D,m1,r1,I[0].width,I[0].height);for(let $=0,p1=I.length;$0&&o1++,t.texStorage2D(n.TEXTURE_CUBE_MAP,o1,b1,Y[0].width,Y[0].height));for(let $=0;$<6;$++)if(h1){I?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+$,0,0,0,Y[$].width,Y[$].height,s1,r1,Y[$].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+$,0,b1,Y[$].width,Y[$].height,0,s1,r1,Y[$].data);for(let p1=0;p1m+v?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&h<=m-v&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));return o!==null&&(o.visible=a!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=s!==null),this}};var X4=class extends K1{constructor(e,t,i,a,r,s,o,c,l,u){if(u=u!==void 0?u:ee,u!==ee&&u!==ze)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===ee&&(i=Ue),i===void 0&&u===ze&&(i=Ce);super(null,a,r,s,o,c,u,i,l);this.image={width:e,height:t},this.magFilter=o!==void 0?o:e2,this.minFilter=c!==void 0?c:e2,this.flipY=!1,this.generateMipmaps=!1}};X4.prototype.isDepthTexture=!0;var Hi=class extends F2{constructor(e,t){super();let i=this,a=null,r=1,s=null,o="local-floor",c=e.extensions.has("WEBGL_multisampled_render_to_texture"),l=null,u=null,f=null,h=null,m=!1,v=null,g=t.getContextAttributes(),x=null,p=null,d=[],A=new Map,b=new i2;b.layers.enable(1),b.viewport=new q1;let C=new i2;C.layers.enable(2),C.viewport=new q1;let E=[b,C],T=new h0;T.layers.enable(1),T.layers.enable(2);let _=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(O){let W=d[O];return W===void 0&&(W=new j4,d[O]=W),W.getTargetRaySpace()},this.getControllerGrip=function(O){let W=d[O];return W===void 0&&(W=new j4,d[O]=W),W.getGripSpace()},this.getHand=function(O){let W=d[O];return W===void 0&&(W=new j4,d[O]=W),W.getHandSpace()};function F(O){let W=A.get(O.inputSource);W&&W.dispatchEvent({type:O.type,data:O.inputSource})}function M(){A.forEach(function(O,W){O.disconnect(W)}),A.clear(),_=null,P=null,e.setRenderTarget(x),h=null,f=null,u=null,a=null,p=null,Z.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(O){r=O,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(O){o=O,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return f!==null?f:h},this.getBinding=function(){return u},this.getFrame=function(){return v},this.getSession=function(){return a},this.setSession=async function(O){if(a=O,a!==null){if(x=e.getRenderTarget(),a.addEventListener("select",F),a.addEventListener("selectstart",F),a.addEventListener("selectend",F),a.addEventListener("squeeze",F),a.addEventListener("squeezestart",F),a.addEventListener("squeezeend",F),a.addEventListener("end",M),a.addEventListener("inputsourceschange",D),g.xrCompatible!==!0&&await t.makeXRCompatible(),a.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let W={antialias:a.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(a,t,W),a.updateRenderState({baseLayer:h}),p=new d2(h.framebufferWidth,h.framebufferHeight,{format:W1,type:N2,encoding:e.outputEncoding})}else{m=g.antialias;let W=null,X=null,Q=null;g.depth&&(Q=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,W=g.stencil?ze:ee,X=g.stencil?Ce:Ue);let a1={colorFormat:e.outputEncoding===I1?t.SRGB8_ALPHA8:t.RGBA8,depthFormat:Q,scaleFactor:r};u=new XRWebGLBinding(a,t),f=u.createProjectionLayer(a1),a.updateRenderState({layers:[f]}),m?p=new d4(f.textureWidth,f.textureHeight,{format:W1,type:N2,depthTexture:new X4(f.textureWidth,f.textureHeight,X,void 0,void 0,void 0,void 0,void 0,void 0,W),stencilBuffer:g.stencil,ignoreDepth:f.ignoreDepthValues,useRenderToTexture:c,encoding:e.outputEncoding}):p=new d2(f.textureWidth,f.textureHeight,{format:W1,type:N2,depthTexture:new X4(f.textureWidth,f.textureHeight,X,void 0,void 0,void 0,void 0,void 0,void 0,W),stencilBuffer:g.stencil,ignoreDepth:f.ignoreDepthValues,encoding:e.outputEncoding})}p.isXRRenderTarget=!0,this.setFoveation(1),s=await a.requestReferenceSpace(o),Z.setContext(a),Z.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function D(O){let W=a.inputSources;for(let X=0;X0&&(p.alphaTest.value=d.alphaTest);let A=n.get(d).envMap;A&&(p.envMap.value=A,p.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=d.reflectivity,p.ior.value=d.ior,p.refractionRatio.value=d.refractionRatio),d.lightMap&&(p.lightMap.value=d.lightMap,p.lightMapIntensity.value=d.lightMapIntensity),d.aoMap&&(p.aoMap.value=d.aoMap,p.aoMapIntensity.value=d.aoMapIntensity);let b;d.map?b=d.map:d.specularMap?b=d.specularMap:d.displacementMap?b=d.displacementMap:d.normalMap?b=d.normalMap:d.bumpMap?b=d.bumpMap:d.roughnessMap?b=d.roughnessMap:d.metalnessMap?b=d.metalnessMap:d.alphaMap?b=d.alphaMap:d.emissiveMap?b=d.emissiveMap:d.clearcoatMap?b=d.clearcoatMap:d.clearcoatNormalMap?b=d.clearcoatNormalMap:d.clearcoatRoughnessMap?b=d.clearcoatRoughnessMap:d.specularIntensityMap?b=d.specularIntensityMap:d.specularColorMap?b=d.specularColorMap:d.transmissionMap?b=d.transmissionMap:d.thicknessMap?b=d.thicknessMap:d.sheenColorMap?b=d.sheenColorMap:d.sheenRoughnessMap&&(b=d.sheenRoughnessMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix));let C;d.aoMap?C=d.aoMap:d.lightMap&&(C=d.lightMap),C!==void 0&&(C.isWebGLRenderTarget&&(C=C.texture),C.matrixAutoUpdate===!0&&C.updateMatrix(),p.uv2Transform.value.copy(C.matrix))}function a(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity}function r(p,d){p.dashSize.value=d.dashSize,p.totalSize.value=d.dashSize+d.gapSize,p.scale.value=d.scale}function s(p,d,A,b){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.size.value=d.size*A,p.scale.value=b*.5,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let C;d.map?C=d.map:d.alphaMap&&(C=d.alphaMap),C!==void 0&&(C.matrixAutoUpdate===!0&&C.updateMatrix(),p.uvTransform.value.copy(C.matrix))}function o(p,d){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.rotation.value=d.rotation,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let A;d.map?A=d.map:d.alphaMap&&(A=d.alphaMap),A!==void 0&&(A.matrixAutoUpdate===!0&&A.updateMatrix(),p.uvTransform.value.copy(A.matrix))}function c(p,d){d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap)}function l(p,d){p.specular.value.copy(d.specular),p.shininess.value=Math.max(d.shininess,1e-4),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===P1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===P1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function u(p,d){d.gradientMap&&(p.gradientMap.value=d.gradientMap),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===P1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===P1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function f(p,d){p.roughness.value=d.roughness,p.metalness.value=d.metalness,d.roughnessMap&&(p.roughnessMap.value=d.roughnessMap),d.metalnessMap&&(p.metalnessMap.value=d.metalnessMap),d.emissiveMap&&(p.emissiveMap.value=d.emissiveMap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===P1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===P1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias),n.get(d).envMap&&(p.envMapIntensity.value=d.envMapIntensity)}function h(p,d,A){f(p,d),p.ior.value=d.ior,d.sheen>0&&(p.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),p.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(p.sheenColorMap.value=d.sheenColorMap),d.sheenRoughnessMap&&(p.sheenRoughnessMap.value=d.sheenRoughnessMap)),d.clearcoat>0&&(p.clearcoat.value=d.clearcoat,p.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(p.clearcoatMap.value=d.clearcoatMap),d.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap),d.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),p.clearcoatNormalMap.value=d.clearcoatNormalMap,d.side===P1&&p.clearcoatNormalScale.value.negate())),d.transmission>0&&(p.transmission.value=d.transmission,p.transmissionSamplerMap.value=A.texture,p.transmissionSamplerSize.value.set(A.width,A.height),d.transmissionMap&&(p.transmissionMap.value=d.transmissionMap),p.thickness.value=d.thickness,d.thicknessMap&&(p.thicknessMap.value=d.thicknessMap),p.attenuationDistance.value=d.attenuationDistance,p.attenuationColor.value.copy(d.attenuationColor)),p.specularIntensity.value=d.specularIntensity,p.specularColor.value.copy(d.specularColor),d.specularIntensityMap&&(p.specularIntensityMap.value=d.specularIntensityMap),d.specularColorMap&&(p.specularColorMap.value=d.specularColorMap)}function m(p,d){d.matcap&&(p.matcap.value=d.matcap),d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===P1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===P1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function v(p,d){d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}function g(p,d){d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias),p.referencePosition.value.copy(d.referencePosition),p.nearDistance.value=d.nearDistance,p.farDistance.value=d.farDistance}function x(p,d){d.bumpMap&&(p.bumpMap.value=d.bumpMap,p.bumpScale.value=d.bumpScale,d.side===P1&&(p.bumpScale.value*=-1)),d.normalMap&&(p.normalMap.value=d.normalMap,p.normalScale.value.copy(d.normalScale),d.side===P1&&p.normalScale.value.negate()),d.displacementMap&&(p.displacementMap.value=d.displacementMap,p.displacementScale.value=d.displacementScale,p.displacementBias.value=d.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function ah(){let n=Lt("canvas");return n.style.display="block",n}function Vi(n={}){let e=n.canvas!==void 0?n.canvas:ah(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,a=n.depth!==void 0?n.depth:!0,r=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,c=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,l=n.powerPreference!==void 0?n.powerPreference:"default",u=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1,f=null,h=null,m=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=R2,this.physicallyCorrectLights=!1,this.toneMapping=O2,this.toneMappingExposure=1;let g=this,x=!1,p=0,d=0,A=null,b=-1,C=null,E=new q1,T=new q1,_=null,P=e.width,F=e.height,M=1,D=null,z=null,H=new q1(0,0,P,F),V=new q1(0,0,P,F),L=!1,N=new Ht,U=!1,Z=!1,O=null,W=new k1,X=new k,Q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function a1(){return A===null?M:1}let B=t;function M1(S,G){for(let j=0;j0?h=v[v.length-1]:h=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function Y1(S,G,j,q){if(S.visible===!1)return;if(S.layers.test(G.layers)){if(S.isGroup)j=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(G);else if(S.isLight)h.pushLight(S),S.castShadow&&h.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||N.intersectsSprite(S)){q&&X.setFromMatrixPosition(S.matrixWorld).applyMatrix4(W);let y1=p2.update(S),E1=S.material;E1.visible&&f.push(S,y1,E1,j,X.z,null)}}else if((S.isMesh||S.isLine||S.isPoints)&&(S.isSkinnedMesh&&S.skeleton.frame!==T1.render.frame&&(S.skeleton.update(),S.skeleton.frame=T1.render.frame),!S.frustumCulled||N.intersectsObject(S))){q&&X.setFromMatrixPosition(S.matrixWorld).applyMatrix4(W);let y1=p2.update(S),E1=S.material;if(Array.isArray(E1)){let w1=y1.groups;for(let B1=0,H1=w1.length;B10&&_e(K,G,j),q&&n1.viewport(E.copy(q)),K.length>0&&$4(K,G,j),g1.length>0&&$4(g1,G,j),y1.length>0&&$4(y1,G,j)}function _e(S,G,j){if(O===null){let y1=s===!0&&v1.isWebGL2===!0?d4:d2;O=new y1(1024,1024,{generateMipmaps:!0,type:d1.convert(ye)!==null?ye:N2,minFilter:nt,magFilter:e2,wrapS:o2,wrapT:o2,useRenderToTexture:u1.has("WEBGL_multisampled_render_to_texture")})}let q=g.getRenderTarget();g.setRenderTarget(O),g.clear();let K=g.toneMapping;g.toneMapping=O2,$4(S,G,j),g.toneMapping=K,C1.updateMultisampleRenderTarget(O),C1.updateRenderTargetMipmap(O),g.setRenderTarget(q)}function $4(S,G,j){let q=G.isScene===!0?G.overrideMaterial:null;for(let K=0,g1=S.length;K=0&&G<=S.width-q&&j>=0&&j<=S.height-K&&B.readPixels(G,j,q,K,d1.convert(B1),d1.convert(H1),g1):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let w1=A!==null?A1.get(A).__webglFramebuffer:null;n1.bindFramebuffer(B.FRAMEBUFFER,w1)}}},this.copyFramebufferToTexture=function(S,G,j=0){if(G.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let q=Math.pow(2,-j),K=Math.floor(G.image.width*q),g1=Math.floor(G.image.height*q);C1.setTexture2D(G,0),B.copyTexSubImage2D(B.TEXTURE_2D,j,0,0,S.x,S.y,K,g1),n1.unbindTexture()},this.copyTextureToTexture=function(S,G,j,q=0){let K=G.image.width,g1=G.image.height,y1=d1.convert(j.format),E1=d1.convert(j.type);C1.setTexture2D(j,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,j.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,j.unpackAlignment),G.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,q,S.x,S.y,K,g1,y1,E1,G.image.data):G.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,q,S.x,S.y,G.mipmaps[0].width,G.mipmaps[0].height,y1,G.mipmaps[0].data):B.texSubImage2D(B.TEXTURE_2D,q,S.x,S.y,y1,E1,G.image),q===0&&j.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),n1.unbindTexture()},this.copyTextureToTexture3D=function(S,G,j,q,K=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let g1=S.max.x-S.min.x+1,y1=S.max.y-S.min.y+1,E1=S.max.z-S.min.z+1,w1=d1.convert(q.format),B1=d1.convert(q.type),H1;if(q.isDataTexture3D)C1.setTexture3D(q,0),H1=B.TEXTURE_3D;else if(q.isDataTexture2DArray)C1.setTexture2DArray(q,0),H1=B.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,q.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,q.unpackAlignment);let V1=B.getParameter(B.UNPACK_ROW_LENGTH),$1=B.getParameter(B.UNPACK_IMAGE_HEIGHT),mt=B.getParameter(B.UNPACK_SKIP_PIXELS),Ft=B.getParameter(B.UNPACK_SKIP_ROWS),R1=B.getParameter(B.UNPACK_SKIP_IMAGES),ue=j.isCompressedTexture?j.mipmaps[0]:j.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,ue.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ue.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,S.min.x),B.pixelStorei(B.UNPACK_SKIP_ROWS,S.min.y),B.pixelStorei(B.UNPACK_SKIP_IMAGES,S.min.z),j.isDataTexture||j.isDataTexture3D?B.texSubImage3D(H1,K,G.x,G.y,G.z,g1,y1,E1,w1,B1,ue.data):j.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),B.compressedTexSubImage3D(H1,K,G.x,G.y,G.z,g1,y1,E1,w1,ue.data)):B.texSubImage3D(H1,K,G.x,G.y,G.z,g1,y1,E1,w1,B1,ue),B.pixelStorei(B.UNPACK_ROW_LENGTH,V1),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,$1),B.pixelStorei(B.UNPACK_SKIP_PIXELS,mt),B.pixelStorei(B.UNPACK_SKIP_ROWS,Ft),B.pixelStorei(B.UNPACK_SKIP_IMAGES,R1),K===0&&q.generateMipmaps&&B.generateMipmap(H1),n1.unbindTexture()},this.initTexture=function(S){C1.setTexture2D(S,0),n1.unbindTexture()},this.resetState=function(){p=0,d=0,A=null,n1.reset(),f1.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Vi.prototype.isWebGLRenderer=!0;var f0=class extends j1{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};f0.prototype.isScene=!0;var m4=class extends j1{constructor(e,t=1){super();this.type="Light",this.color=new x1(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}};m4.prototype.isLight=!0;var d0=class extends m4{constructor(e,t){super(e,t);this.type="AmbientLight"}};d0.prototype.isAmbientLight=!0;var yo=new k1,Co=new k,zo=new k,Ni=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new z1(512,512),this.map=null,this.mapPass=null,this.matrix=new k1,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ht,this._frameExtents=new z1(1,1),this._viewportCount=1,this._viewports=[new q1(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Co.setFromMatrixPosition(e.matrixWorld),t.position.copy(Co),zo.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(zo),t.updateMatrixWorld(),yo.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(yo),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}};var p0=class extends Ni{constructor(){super(new i2(50,1,.5,500));this.focus=1}updateMatrices(e){let t=this.camera,i=E4*2*e.angle*this.focus,a=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||a!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=a,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}};p0.prototype.isSpotLightShadow=!0;var m0=class extends m4{constructor(e,t,i=0,a=Math.PI/3,r=0,s=1){super(e,t);this.type="SpotLight",this.position.copy(j1.DefaultUp),this.updateMatrix(),this.target=new j1,this.distance=i,this.angle=a,this.penumbra=r,this.decay=s,this.shadow=new p0}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};m0.prototype.isSpotLight=!0;var v0=class extends T2{constructor(e){super();this.type="ShadowMaterial",this.color=new x1(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}};v0.prototype.isShadowMaterial=!0;var g0=class extends Z4.Component{constructor(e){super();this.plugin=e;this.event=new Z4.Events;this.container=createDiv("renderer-container");this.shadows=!0;this.iterations=0;this.frame_rate=1/60;this.animating=!1;this.factory=new wo(this.WIDTH,this.HEIGHT,this.plugin);this.colors={ambient:16777215,spotlight:16777215};this.display={currentWidth:null,currentHeight:null,containerWidth:null,containerHeight:null,aspect:null,scale:null};this.cameraHeight={max:null,close:null,medium:null,far:null};this.extraFrames=g0.DEFAULT_EXTRA_FRAMES;this.renderer=new Vi({alpha:!0,antialias:!0})}get WIDTH(){return this.container.clientWidth/2}get HEIGHT(){return this.container.clientHeight/2}get ASPECT(){return this.WIDTH/this.HEIGHT}get scale(){return(this.WIDTH*this.WIDTH+this.HEIGHT*this.HEIGHT)/13}get canvasEl(){return this.renderer?this.renderer.domElement:null}setDice(e){this.animating&&(this.unload(),this.load()),this.stack=e,this.current=this.factory.getDice(this.stack,{x:(Math.random()*2-1)*this.WIDTH,y:-(Math.random()*2-1)*this.HEIGHT}),this.scene.add(...[...this.current.values()].flat().map(t=>t.geometry)),this.world.add(...[...this.current.values()].flat())}onload(){this.addChild(this.factory),this.container.empty(),this.container.style.opacity="1",document.body.appendChild(this.container),this.renderer.shadowMap.enabled=this.shadows,this.renderer.shadowMap.type=_6,this.container.appendChild(this.renderer.domElement),this.renderer.setClearColor(0,0),this.scene=new f0,this.initScene(),this.registerDomEvent(window,"resize",()=>{this.initScene()}),this.initWorld()}async start(){return new Promise(async(e,t)=>{this.current.size||t(),this.event.on("throw-finished",i=>{e(i)}),this.event.on("error",i=>{t(i)}),this.animating=!0,this.extraFrames=g0.DEFAULT_EXTRA_FRAMES,this.render()})}enableShadows(){this.shadows=!0,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}disableShadows(){this.shadows=!1,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}get mw(){return Math.max(this.WIDTH,this.HEIGHT)}setDimensions(e){this.display.currentWidth=this.container.clientWidth/2,this.display.currentHeight=this.container.clientHeight/2,e?(this.display.containerWidth=e.w,this.display.containerHeight=e.h):(this.display.containerWidth=this.display.currentWidth,this.display.containerHeight=this.display.currentHeight),this.display.aspect=Math.min(this.display.currentWidth/this.display.containerWidth,this.display.currentHeight/this.display.containerHeight),this.display.scale=Math.sqrt(this.display.containerWidth*this.display.containerWidth+this.display.containerHeight*this.display.containerHeight)/13,this.renderer.setSize(this.display.currentWidth*2,this.display.currentHeight*2),this.cameraHeight.max=this.display.currentHeight/this.display.aspect/Math.tan(10*Math.PI/180),this.factory.width=this.display.currentWidth,this.factory.height=this.display.currentHeight,this.cameraHeight.medium=this.cameraHeight.max/1.5,this.cameraHeight.far=this.cameraHeight.max,this.cameraHeight.close=this.cameraHeight.max/2}initCamera(){this.camera&&this.scene.remove(this.camera),this.camera=new i2(20,this.display.currentWidth/this.display.currentHeight,1,this.cameraHeight.max*1.3),this.camera.position.z=this.cameraHeight.far,this.camera.lookAt(new k(0,0,0))}initLighting(){let e=Math.max(this.display.containerWidth,this.display.containerHeight);this.light&&this.scene.remove(this.light),this.ambientLight&&this.scene.remove(this.ambientLight),this.light=new m0(this.colors.spotlight,.25),this.light.position.set(-e/2,e/2,e*3),this.light.target.position.set(0,0,0),this.light.distance=e*5,this.light.angle=Math.PI/4,this.light.castShadow=this.shadows,this.light.shadow.camera.near=e/10,this.light.shadow.camera.far=e*5,this.light.shadow.camera.fov=50,this.light.shadow.bias=.001,this.light.shadow.mapSize.width=1024,this.light.shadow.mapSize.height=1024,this.scene.add(this.light),this.ambientLight=new d0(16777215,.9),this.scene.add(this.ambientLight)}initDesk(){this.desk&&this.scene.remove(this.desk);let e=new v0;e.opacity=.5,this.desk=new l2(new Vt(this.display.containerWidth*6,this.display.containerHeight*6,1,1),e),this.desk.receiveShadow=this.shadows,this.scene.add(this.desk)}initScene(){this.setDimensions(),this.initCamera(),this.initLighting(),this.initDesk(),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)}initWorld(){this.world=new Ao(this.WIDTH,this.HEIGHT),this.iterations=0}getResultsForRoller(e){let t=this.current.get(e),i=t.filter(s=>s instanceof Tt&&s.isPercentile),a=[];for(let s=0;s!(s instanceof Tt&&s.isPercentile)).map(s=>s.getUpsideValue()).filter(s=>s),...a.map(([s,o])=>{let c=s.getUpsideValue();if(!o)return c;let l=o.getUpsideValue();return c===10&&l==10?100:(l==10&&(l=0),c==10&&(c=0),c*10+l)}).filter(s=>s)]}returnResult(){for(let e of this.stack.dynamic){if(!this.current.has(e))continue;let t=this.getResultsForRoller(e);!t||e.setResults(t)}this.event.trigger("throw-finished",this.stack)}unrender(e=this){e.container.style.opacity="0",e.registerInterval(window.setTimeout(()=>{e.animating=!1,e.unload()},1e3))}render(){if(this.throwFinished())if(this.extraFrames>10)this.extraFrames--;else{try{for(let[e,t]of this.current)if(!(!e.modifiers.size||!this.getResultsForRoller(e))&&e.modifiers.has("r")){let a=t.filter(r=>(e.conditions.length||e.conditions.push({operator:"=",comparer:e.faces.min,value:""}),e.checkCondition(r.result,e.conditions)&&r.rerolled{r.rerolled++;let s={x:(Math.random()*2-1)*this.WIDTH,y:-(Math.random()*2-1)*this.HEIGHT};r.vector=r.generateVector(s),r.create(),r.set(),r.stopped=!1}),this.animation=requestAnimationFrame(()=>this.render());return}}if(this.returnResult(),this.plugin.data.renderTime)this.registerInterval(window.setTimeout(()=>this.unrender(),this.plugin.data.renderTime));else{let t=function(){e.unrender(e),document.body.removeEventListener("click",t)},e=this;this.registerDomEvent(document.body,"click",t)}}catch(e){this.event.trigger("error",e)}return}this.animation=requestAnimationFrame(()=>this.render()),this.world.step(this.frame_rate),this.iterations++,this.current.forEach(e=>{e.map(t=>t.set())}),this.renderer.render(this.scene,this.camera)}dispose(...e){e.forEach(t=>{"dispose"in t&&t.dispose(),t.children&&this.dispose(...t.children)})}detach(){}onunload(){cancelAnimationFrame(this.animation),this.container.detach(),this.container.empty(),this.renderer.domElement.detach(),this.renderer.dispose(),this.factory.dispose(),this.ambientLight.dispose(),this.light.dispose(),this.scene.children.forEach(e=>this.dispose(e)),this.scene.remove(this.scene,...this.scene.children,...[...this.current.values()].flat().map(e=>e.geometry)),this.current.forEach(e=>{e.forEach(t=>{[...Array.isArray(t.geometry.material)?t.geometry.material:[t.geometry.material]].forEach(a=>a&&a.dispose()),this.world.world.removeBody(t.body)})}),this.current=new Map}onThrowFinished(){}throwFinished(){let e=!0,t=4;if(this.iterations<10/this.frame_rate)for(let i of this.current.values())for(let a of i){if(a.stopped===!0)continue;let r=a.body.angularVelocity,s=a.body.velocity;if(Math.abs(r.x)3){a.stopped=!0;continue}}else a.stopped=this.iterations;e=!1}else a.stopped=void 0,e=!1}return e}},Y4=g0;Y4.DEFAULT_EXTRA_FRAMES=30;var Ao=class{constructor(e,t){this.WIDTH=e;this.HEIGHT=t;this.world=new Q0({gravity:new y(0,0,-9.82*400)});this.ground=this.getPlane();this.diceMaterial=new He;this.deskMaterial=new He;this.barrierMaterial=new He;this.world.broadphase=new m6,this.world.allowSleep=!0,this.ground.position.set(0,0,0),this.world.addBody(this.ground),this.buildWalls()}add(...e){e.forEach(t=>{this.world.addBody(t.body)})}step(e=1/60){let t=performance.now()/1e3;if(!this.lastCallTime)this.world.step(e);else{let i=t-this.lastCallTime;this.world.step(e,i)}this.lastCallTime=t}buildWalls(){this.world.addContactMaterial(new Te(this.deskMaterial,this.diceMaterial,{friction:.01,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new Te(this.barrierMaterial,this.diceMaterial,{friction:.01,restitution:1,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new Te(this.diceMaterial,this.diceMaterial,{friction:.1,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addBody(new i1({allowSleep:!1,mass:0,shape:new it,material:this.deskMaterial}));let e=new i1({allowSleep:!1,mass:0,shape:new it,material:this.barrierMaterial});e.quaternion.setFromAxisAngle(new y(1,0,0),Math.PI/2),e.position.set(0,this.HEIGHT*.93,0),this.world.addBody(e),e=new i1({allowSleep:!1,mass:0,shape:new it,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new y(1,0,0),-Math.PI/2),e.position.set(0,-this.HEIGHT*.93,0),this.world.addBody(e),e=new i1({allowSleep:!1,mass:0,shape:new it,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new y(0,1,0),-Math.PI/2),e.position.set(this.WIDTH*.93,0,0),this.world.addBody(e),e=new i1({allowSleep:!1,mass:0,shape:new it,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new y(0,1,0),Math.PI/2),e.position.set(-this.WIDTH*.93,0,0),this.world.addBody(e)}getPlane(){return new i1({type:i1.STATIC,shape:new it})}},wo=class extends Z4.Component{constructor(e,t,i){super();this.width=e;this.height=t;this.plugin=i;this.dice={};this.buildDice()}get colors(){return{diceColor:this.plugin.data.diceColor,textColor:this.plugin.data.textColor}}updateColors(){this.dispose(),this.buildDice()}onunload(){this.dispose()}disposeChildren(...e){e.forEach(t=>{"dispose"in t&&t.dispose(),t.children&&this.disposeChildren(...t.children)})}dispose(){for(let e of Object.values(this.dice))this.disposeChildren(e.geometry.children)}getDiceForRoller(e,t){let i=[];switch(e.faces.max){case 4:{i.push(...new Array(e.rolls).fill(0).map(a=>new Ci(this.width,this.height,this.clone("d4"),t)));break}case 1:case 6:{i.push(...new Array(e.rolls).fill(0).map(a=>new yi(this.width,this.height,e.fudge?this.clone("fudge"):this.clone("d6"),t)));break}case 8:{i.push(...new Array(e.rolls).fill(0).map(a=>new bi(this.width,this.height,this.clone("d8"),t)));break}case 10:{i.push(...new Array(e.rolls).fill(0).map(a=>new Tt(this.width,this.height,this.clone("d10"),t)));break}case 12:{i.push(...new Array(e.rolls).fill(0).map(a=>new Mi(this.width,this.height,this.clone("d12"),t)));break}case 20:{i.push(...new Array(e.rolls).fill(0).map(a=>new xi(this.width,this.height,this.clone("d20"),t)));break}case 100:{i.push(...new Array(e.rolls).fill(0).map(a=>[new Tt(this.width,this.height,this.clone("d100"),t,!0),new Tt(this.width,this.height,this.clone("d10"),t,!0)]).flat());break}}return i}getDice(e,t){let i=new Map;for(let a of e.dynamic){let r=this.getDiceForRoller(a,t);r.length&&i.set(a,r)}return i}clone(e){if(!(e in this.dice))throw new Error("That dice type does not exist!");return this.dice[e].clone()}buildDice(){this.dice.d100=new ri(this.width,this.height,this.colors).create(),this.dice.d20=new ti(this.width,this.height,this.colors).create(),this.dice.d12=new ii(this.width,this.height,this.colors).create(),this.dice.d10=new ai(this.width,this.height,this.colors).create(),this.dice.d8=new ni(this.width,this.height,this.colors).create(),this.dice.d6=new si(this.width,this.height,this.colors).create(),this.dice.d4=new ci(this.width,this.height,this.colors).create(),this.dice.fudge=new oi(this.width,this.height,this.colors).create(),this.dice.boost=new vi(this.width,this.height,this.colors).create(),this.dice.ability=new di(this.width,this.height,this.colors).create(),this.dice.difficulty=new pi(this.width,this.height,this.colors).create(),this.dice.challenge=new hi(this.width,this.height,this.colors).create(),this.dice.proficiency=new ui(this.width,this.height,this.colors).create(),this.dice.setback=new gi(this.width,this.height,this.colors).create()}};var Eo=w2(_o());var Ri=class{constructor(e){this.table=e}parse(e){let t=e.length,i=this.table,a=[],r=[],s=0;for(;sf||u===f&&l.associativity==="right")break;a.push(r.shift())}r.unshift(o)}else a.push(o)}}for(;r.length;){let o=r.shift();if(o.value!=="(")a.push(o);else throw new Error("Mismatched parentheses.")}return a}};var rh=/(?:\d+[Dd])?#(?:[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?:[+-]))?(?:\|(?:[^+-]+))?/u,nh=/(?:\d+[Dd])?#(?:[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?:[+-]))?\|link/u,sh=/(?:.*)?(?:\[.*\]\(|\[\[)(?:.+?)#?\^(?:.+?)(?:\)|\]\])\|?(?:.+)?/u,oh=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|?(?:.+)?/u,ch=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|line/u,lh=/[\(\^\+\-\*\/\)]/u,uh=/(?:\d+|\b)[Dd](?:\[?(?:-?\d+[ \t]?,)?[ \t]?(?:-?\d+|%|F)\]?|\b)/u,hh=/(?:=|=!|<|>|<=|>=|=<|=>|-=|=-)\d+/u,M0=class{constructor(e){this.plugin=e;this.lexer=Eo.compile({WS:[{match:/[ \t]+/u},{match:/[{}]+/u}],table:sh,line:ch,section:oh,link:nh,tag:rh,condition:hh,kl:{match:/kl\d*/u,value:this.clampInfinite},kh:[{match:/kh\d*/u,value:this.clampInfinite},{match:/k\d*/u,value:this.clampInfinite}],dh:{match:/dh\d*/u,value:this.clampInfinite},dl:[{match:/dl\d*/u,value:this.clampInfinite}],"!!":{match:/!!(?:i|\d+)?/u,value:this.clampInfinite},"!":{match:/!(?:i|\d+)?/u,value:this.clampInfinite},r:{match:/r(?:i|\d+)?/u,value:this.clampInfinite},u:/u/u,stunt:/1[Dd]S/u,"%":/\d+[Dd]\d+%/u,dice:[{match:uh,value:e=>{let{roll:t=this.plugin.data.defaultRoll,faces:i=this.plugin.data.defaultFace}=e.match(/(?\d+)?[Dd](?\[?(?:-?\d+[ \t]?,)?[ \t]?(?:-?\d+|%|F)\]?)?/).groups;return`${t}d${i}`}},{match:/\d+/u},{match:/\b[A-Za-z][A-Za-z0-9_]+\b/u,value:e=>this.plugin.inline.has(e)?`${this.plugin.inline.get(e)}`:e}],sort:[{match:/s(?:a|d)*/u,value:e=>e=="s"||e=="sa"?"sa":"sd"}],math:lh});let t={precedence:3,associativity:"right"},i={precedence:2,associativity:"left"},a={precedence:1,associativity:"left"};this.parser=new Ri({"+":a,"-":a,"*":i,"/":i,"^":t})}clampInfinite(e){return/i$/.test(e)?"100":e.replace(/^\D+/g,"")}parse(e){let t=Array.from(this.lexer.reset(e));return this.lexer.reset(),this.parser.parse(this.transform(t))}transform(e){e=e.filter(i=>i.type!="WS");let t=[];for(let i of e)if(i.type=="condition"&&t.length>0){let a=t[t.length-1];a.conditions||(a.conditions=[]);let[r,s,o]=i.value.match(/(?=|=!|<|>|<=|>=|=<|=>|\-=|=\-)(?\d+)/)??[];a.conditions.push({operator:s,comparer:Number(o),value:i.value})}else t.push(i);return t}getTypeFromLexemes(e){return e.some(({type:t})=>t==="table")?"table":e.some(({type:t})=>t==="section")?"section":e.some(({type:t})=>t==="tag")?"tag":e.some(({type:t})=>t==="link")?"link":e.some(({type:t})=>t==="line")?"line":"dice"}};var Se=w2(require("@codemirror/view")),Lo=w2(require("@codemirror/language")),v4=w2(require("obsidian"));function fh(n,e,t){for(let i of n.ranges)if(i.from<=t&&i.to>=e)return!0;return!1}function Do(n,e){let t=app.workspace.getActiveFile();if(!t)return;let i=[],a=n.state.selection,r=new RegExp(".*?_?inline-code_?.*");for(let{from:s,to:o}of n.visibleRanges)(0,Lo.syntaxTree)(n.state).iterate({from:s,to:o,enter:({node:c})=>{let l=c.type;if(l.name.includes("formatting")||!r.test(l.name))return;let u=c.from,f=c.to;if(fh(a,u,f+1))return;let h=n.state.doc.sliceString(u,f).trim();if(/^dice-mod:\s*([\s\S]+)\s*?/.test(h)){let[,x]=h.match(/dice-mod:\s*([\s\S]+)\s*?/),p=app.workspace.getActiveFile(),d=e.getRollerSync(x,p.path);d.roll().then(A=>{let b=e.data.displayFormulaForMod?`${d.inlineText} **${d.replacer}**`:`${d.replacer}`,C={from:u-1,to:f+1,insert:b},E=n.state.update({changes:C});n.dispatch(E)});return}if(!/^dice(?:\+|\-)?:\s*([\s\S]+)\s*?/.test(h))return;let[,m]=h.match(/^dice(?:\+|\-)?:\s*([\s\S]+)\s*?/),v=e.getRollerSync(m,t.path),g=new To(h,v,n,e,t);e.addToFileMap(t,v),i.push(Se.Decoration.replace({widget:g,inclusive:!1,block:!1}).range(u-1,f+1))}});return Se.Decoration.set(i,!0)}var To=class extends Se.WidgetType{constructor(e,t,i,a,r){super();this.rawQuery=e;this.roller=t;this.view=i;this.plugin=a;this.file=r}eq(e){return e.rawQuery===this.rawQuery?!0:(this.plugin.fileMap.get(this.file)?.remove(e.roller),!1)}toDOM(e){return this.roller.roll(),this.roller.containerEl}ignoreEvent(e){if(e.type==="mousedown"){let t=this.view.posAtCoords({x:e.x,y:e.y});if(e.shiftKey){if(t){let{editor:i}=this.view.state.field(v4.editorEditorField).state.field(v4.editorViewField);i.setCursor(i.offsetToPos(t))}return!1}}return!0}};function Ho(n){return Se.ViewPlugin.fromClass(class{constructor(e){this.decorations=Do(e,n)??Se.Decoration.none}update(e){if(!e.state.field(v4.editorLivePreviewField)){this.decorations=Se.Decoration.none;return}(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=Do(e.view,n)??Se.Decoration.none)}},{decorations:e=>e.decorations})}var Ke=class{constructor(e){this.plugin=e;this.sources=new Map}get renderer(){return this.plugin.renderer}registerSource(e,t){this.sources.set(e,t)}getRollerSync(e,t){let i=this.sources.get(t)??Ke.RollerOptions(this.plugin);return this.plugin.getRollerSync(e,t,i)}async getRoller(e,t){let i=this.sources.get(t)??Ke.RollerOptions(this.plugin);return this.plugin.getRoller(e,t,i)}static RollerOptions(e){return{showDice:e.data.showDice,shouldRender:e.data.renderAllDice,showFormula:e.data.displayResultsInline,showParens:e.data.displayFormulaAfter,expectedValue:g2.Roll,text:null}}};String.prototype.matchAll=String.prototype.matchAll||function*(e){let t=e.global?e.flags:e.flags+"g",i=new RegExp(e,t),a;for(;a=i.exec(this);)yield a};var d6={returnAllTags:!0,rollLinksForTags:!1,copyContentButton:!0,customFormulas:[],displayFormulaForMod:!0,displayResultsInline:!1,displayFormulaAfter:!1,displayLookupRoll:!0,formulas:{},persistResults:!1,results:{},defaultRoll:1,defaultFace:100,renderer:!1,renderAllDice:!1,renderTime:2e3,diceColor:"#202020",textColor:"#ffffff",showLeafOnStartup:!0,showDice:!0,displayAsEmbed:!0,round:pe.None},Fi=class extends Z1.Plugin{constructor(){super(...arguments);this.api=new Ke(this);this.fileMap=new Map;this.inline=new Map;this.operators={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"^":(e,t)=>Math.pow(e,t)};this.parser=new M0(this);this.persistingFiles=new Set}async onload(){console.log("DiceRoller plugin loaded"),this.data=Object.assign({},d6,await this.loadData()),this.renderer=new Y4(this),this.addSettingTab(new f6(this.app,this)),this.registerView(bt,i=>new Qe(this,i)),this.app.workspace.onLayoutReady(()=>this.addDiceView(!0)),this.registerEvent(this.app.workspace.on("dice-roller:update-colors",()=>{this.renderer.factory.updateColors()})),this.registerEvent(this.app.workspace.on("dice-roller:render-dice",async i=>{let a=await this.getRoller(i,"external");if(!(a instanceof S2)){new Z1.Notice("The Dice View only supports dice rolls.");return}if(await a.roll(),!a.dice.length){new Z1.Notice("Invalid formula.");return}try{this.renderRoll(a)}catch(r){new Z1.Notice("There was an error rendering the roll."),console.error(r)}this.app.workspace.trigger("dice-roller:rendered-result",a.result)})),this.addCommand({id:"open-view",name:"Open Dice View",callback:()=>{this.view?this.app.workspace.revealLeaf(this.view.leaf):this.addDiceView()}}),this.addCommand({id:"reroll",name:"Re-roll Dice",checkCallback:i=>{let a=this.app.workspace.getActiveViewOfType(Z1.MarkdownView);if(a&&(a.getMode()==="preview"||a.editor.cm.state.field(Z1.editorLivePreviewField))&&this.fileMap.has(a.file))return i||this.fileMap.get(a.file).forEach(s=>{s instanceof c6&&s.roll()}),!0}});let e=V0(ki).html[0];(0,Z1.addIcon)(Y2,e);let t=V0(Ui).html[0];(0,Z1.addIcon)(Je,t),this.registerMarkdownPostProcessor(this.postprocessor.bind(this)),this.registerEditorExtension([Ho(this)]),this.app.workspace.onLayoutReady(async()=>{await this.registerDataviewInlineFields()}),this.app.workspace.trigger("dice-roller:loaded")}addToFileMap(e,t){this.fileMap.has(e)||this.fileMap.set(e,[]),this.fileMap.set(e,[...this.fileMap.get(e),t])}async postprocessor(e,t){let i=e.querySelectorAll("code");if(!i.length)return;let a=t.sourcePath,r=t.getSectionInfo(e),s=t.getSectionInfo(e)?.lineStart,o=this.app.vault.getAbstractFileByPath(t.sourcePath);if((!o||!(o instanceof Z1.TFile))&&a!="STATBLOCK_RENDERER")return;let c={},l,u=!1,f=[];for(let h=0;h{p.on("new-result",async()=>{let b=l.slice(r.lineStart,r.lineEnd+1),C=p.replacer;if(!C){new Z1.Notice("Dice Roller: There was an issue modifying the file.");return}let E=x?`${p.inlineText} ${C}`:`${C}`;b=b.join(` +`).replace(`\`${v}\``,E.replace(/([\*\[\]])/g,"\\$1")).split(` +`),l.splice(r.lineStart,r.lineEnd-r.lineStart+1,...b),d()})})),await p.roll();continue}catch(v){console.error(v)}if(!!/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/.test(m.innerText))try{let[,v]=m.innerText.match(/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/),g=await this.getRoller(v,t.sourcePath),x=this.data.results?.[a]?.[s]?.[h]??null;(this.data.persistResults&&!/dice\-/.test(m.innerText)||/dice\+/.test(m.innerText))&&(this.persistingFiles.add(t.sourcePath),c[h]=g,g.save=!0);let p=this.data.renderAllDice;v.includes("|render")&&(p=!0),v.includes("|norender")&&(p=!1);let d=async()=>{await g.roll(),g.save&&x&&await g.applyResult(x),g instanceof S2&&(g.shouldRender=p),m.replaceWith(g.containerEl)};if(g.loaded?await d():g.on("loaded",async()=>{await d()}),!o||!(o instanceof Z1.TFile))continue;this.addToFileMap(o,g);let A=this.app.workspace.getActiveViewOfType(Z1.MarkdownView);if(A&&this.fileMap.has(o)&&this.fileMap.get(o).length===1){let b=this,C=N0(A,{onUnloadFile:function(E){return async function(T){return T==o&&(b.fileMap.delete(o),C()),await E.call(this,T)}}});A.register(C),A.register(()=>this.fileMap.delete(o))}}catch(v){console.error(v),new Z1.Notice(`There was an error parsing the dice string: ${m.innerText}. -${v}`,5e3);continue}}if(!(!o||!(o instanceof Y1.TFile))&&(u&&f.length&&(await Promise.all(f),await this.app.vault.modify(o,l.join(` -`))),a in this.data.results&&(this.data.results[a][s]={}),Object.entries(c).length)){let h=this.app.workspace.getActiveViewOfType(Y1.MarkdownView);if(h){let m=this,v=R0(h,{onUnloadFile:function(g){return async function(x){if(x=o){m.persistingFiles.has(a)&&(m.persistingFiles.delete(a),m.data.results[a]={});for(let p in c){let d=c[p],w=t.getSectionInfo(e)?.lineStart;if(w==null)continue;let b={[w]:{...m.data.results[a]?.[w]??{},[p]:d.toResult()}};m.data.results[a]={...m.data.results[a]??{},...b},await m.saveSettings()}}return v(),await g.call(this,x)}}});h.register(v),h.register(async()=>{this.persistingFiles.has(a)&&(this.persistingFiles.delete(a),this.data.results[a]={});for(let g in c){let x=c[g],p=t.getSectionInfo(e)?.lineStart;if(p==null)continue;let d={[p]:{...this.data.results[a]?.[p]??{},[g]:x.toResult()}};this.data.results[a]={...this.data.results[a]??{},...d},await this.saveSettings()}})}}}get canUseDataview(){return this.app.plugins.getPlugin("dataview")!=null}get dataview(){return this.app.plugins.getPlugin("dataview")}get dataviewAPI(){return(0,No.getAPI)()}async dataviewReady(){return new Promise(e=>{this.canUseDataview||e(!1),this.dataview.api&&e(!0),this.registerEvent(this.app.metadataCache.on("dataview:api-ready",()=>{e(!0)}))})}get view(){let e=this.app.workspace.getLeavesOfType(yt),t=e.length?e[0]:null;if(t&&t.view&&t.view instanceof et)return t.view}async getArrayRoller(e,t=1){let i=new I0(this,e,t);return await i.roll(),i}async addDiceView(e=!1){e&&!this.data.showLeafOnStartup||this.app.workspace.getLeavesOfType(yt).length||await this.app.workspace.getRightLeaf(!1).setViewState({type:yt})}async registerDataviewInlineFields(){if(!this.canUseDataview)return;await this.dataviewReady(),this.dataview.index.pages.forEach(({fields:t})=>{for(let[i,a]of t)typeof a!="number"||Number.isNaN(a)||a==null||this.inline.set(i,a)}),this.registerEvent(this.app.metadataCache.on("dataview:metadata-change",(t,i)=>{if(t==="update"){let a=this.dataview.api.page(i.path);if(!a)return;for(let r in a){let s=a[r];typeof s!="number"||Number.isNaN(s)||s==null||this.inline.set(r,s)}}}))}async renderRoll(e){if(!(e instanceof _2)||!e?.dice?.length){new Y1.Notice(`This dice roll can't be rendered: ${e.original}`);return}this.addChild(this.renderer),this.renderer.setDice(e),await this.renderer.start(),e.recalculate()}async parseDice(e,t){let i=await this.getRoller(e,t);return{result:await i.roll(),roller:i}}parseDiceSync(e,t){let i=this.getRollerSync(e,t);if(i instanceof _2)return{result:i.result,roller:i}}clearEmpties(e){for(var t in e)!e[t]||typeof e[t]!="object"||(this.clearEmpties(e[t]),Object.keys(e[t]).length===0&&delete e[t])}async saveSettings(){this.clearEmpties(this.data.results),await this.saveData(this.data)}get dataview_regex(){let e=Array.from(this.inline.keys());return e.length?new RegExp(`(${e.join("|")})`,"g"):null}getParametersForRoller(e,t){e=e.replace(/\\\|/g,"|");let i=t?.showDice??!0,a=t?.shouldRender??this.data.renderAllDice,r=t?.showFormula??this.data.displayResultsInline,s=t?.showParens??this.data.displayFormulaAfter,o=t?.expectedValue??x2.Roll,c=t?.text??"",l=/\|text\((.*)\)/;if(e.includes("|nodice")&&(i=!1),e.includes("|render")&&(a=!0),e.includes("|norender")&&(a=!1),e.includes("|form")&&(r=!0),e.includes("|noform")&&(r=!1),e.includes("|avg")&&(o=x2.Average),e.includes("|none")&&(o=x2.None),e.includes("|text(")){let[,u]=e.match(l)??[null,""];c=u}return e.includes("|paren")&&(s=!0),e.includes("|noparen")&&(s=!1),e=(0,Ro.decode)(e.replace("|nodice","").replace("|render","").replace("|norender","").replace("|noform","").replace("|form","").replace("|noparen","").replace("|paren","").replace("|avg","").replace("|none","").replace(l,"")),e in this.data.formulas&&(e=this.data.formulas[e]),{content:e,showDice:i,showParens:s,showFormula:r,expectedValue:o,shouldRender:a,text:c}}async getRoller(e,t="",i=Je.RollerOptions(this)){let{content:a,showDice:r,showParens:s,showFormula:o,expectedValue:c,shouldRender:l,text:u}=this.getParametersForRoller(e,i),f=this.parse(a);switch(this.getTypeFromLexemes(f)){case"dice":{let m=new _2(this,a,f,r,u,c,s);return m.showFormula=o,m.shouldRender=l,m}case"table":{let m=new Ut(this,a,f[0],t,r);return await m.init,m}case"section":return new w4(this,a,f[0],t,r);case"tag":{if(!this.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new u6(this,a,f[0],t,r)}case"link":return new h6(this,a,f[0],t,r);case"line":return new f6(this,a,f[0],t,r)}}getRollerSync(e,t,i=Je.RollerOptions(this)){let{content:a,showDice:r,showParens:s,showFormula:o,expectedValue:c,shouldRender:l,text:u}=this.getParametersForRoller(e,i),f=this.parse(a);switch(this.getTypeFromLexemes(f)){case"dice":{let m=new _2(this,a,f,r,u,c,s);return m.shouldRender=l,m.showFormula=o,m}case"table":{let m=new Ut(this,a,f[0],t,r);return m.init,m}case"section":return new w4(this,a,f[0],t,r);case"tag":{if(!this.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new u6(this,a,f[0],t,r)}case"link":return new h6(this,a,f[0],t,r);case"line":return new f6(this,a,f[0],t,r)}}getTypeFromLexemes(e){return e.some(({type:t})=>t==="table")?"table":e.some(({type:t})=>t==="section")?"section":e.some(({type:t})=>t==="tag")?"tag":e.some(({type:t})=>t==="link")?"link":e.some(({type:t})=>t==="line")?"line":"dice"}onunload(){console.log("DiceRoller unloaded"),this.app.workspace.getLeavesOfType(yt).forEach(e=>e.detach()),"__THREE__"in window&&delete window.__THREE__,this.renderer.unload(),this.app.workspace.trigger("dice-roller:unload")}parse(e){return this.parser.parse(e)}}; +${v}`,5e3);continue}}if(!(!o||!(o instanceof Z1.TFile))&&(u&&f.length&&(await Promise.all(f),await this.app.vault.modify(o,l.join(` +`))),a in this.data.results&&(this.data.results[a][s]={}),Object.entries(c).length)){let h=this.app.workspace.getActiveViewOfType(Z1.MarkdownView);if(h){let m=this,v=N0(h,{onUnloadFile:function(g){return async function(x){if(x=o){m.persistingFiles.has(a)&&(m.persistingFiles.delete(a),m.data.results[a]={});for(let p in c){let d=c[p],A=t.getSectionInfo(e)?.lineStart;if(A==null)continue;let b={[A]:{...m.data.results[a]?.[A]??{},[p]:d.toResult()}};m.data.results[a]={...m.data.results[a]??{},...b},await m.saveSettings()}}return v(),await g.call(this,x)}}});h.register(v),h.register(async()=>{this.persistingFiles.has(a)&&(this.persistingFiles.delete(a),this.data.results[a]={});for(let g in c){let x=c[g],p=t.getSectionInfo(e)?.lineStart;if(p==null)continue;let d={[p]:{...this.data.results[a]?.[p]??{},[g]:x.toResult()}};this.data.results[a]={...this.data.results[a]??{},...d},await this.saveSettings()}})}}}get canUseDataview(){return this.app.plugins.getPlugin("dataview")!=null}get dataview(){return this.app.plugins.getPlugin("dataview")}get dataviewAPI(){return(0,Vo.getAPI)()}async dataviewReady(){return new Promise(e=>{this.canUseDataview||e(!1),this.dataview.api&&e(!0),this.registerEvent(this.app.metadataCache.on("dataview:api-ready",()=>{e(!0)}))})}get view(){let e=this.app.workspace.getLeavesOfType(bt),t=e.length?e[0]:null;if(t&&t.view&&t.view instanceof Qe)return t.view}async getArrayRoller(e,t=1){let i=new P0(this,e,t);return await i.roll(),i}async addDiceView(e=!1){e&&!this.data.showLeafOnStartup||this.app.workspace.getLeavesOfType(bt).length||await this.app.workspace.getRightLeaf(!1).setViewState({type:bt})}async registerDataviewInlineFields(){if(!this.canUseDataview)return;await this.dataviewReady(),this.dataview.index.pages.forEach(({fields:t})=>{for(let[i,a]of t)typeof a!="number"||Number.isNaN(a)||a==null||this.inline.set(i,a)}),this.registerEvent(this.app.metadataCache.on("dataview:metadata-change",(t,i)=>{if(t==="update"){let a=this.dataview.api.page(i.path);if(!a)return;for(let r in a){let s=a[r];typeof s!="number"||Number.isNaN(s)||s==null||this.inline.set(r,s)}}}))}async renderRoll(e){if(!(e instanceof S2)||!e?.dice?.length){new Z1.Notice(`This dice roll can't be rendered: ${e.original}`);return}this.addChild(this.renderer),this.renderer.setDice(e),await this.renderer.start(),e.recalculate()}async parseDice(e,t){let i=await this.getRoller(e,t);return{result:await i.roll(),roller:i}}parseDiceSync(e,t){let i=this.getRollerSync(e,t);if(i instanceof S2)return{result:i.result,roller:i}}clearEmpties(e){for(var t in e)!e[t]||typeof e[t]!="object"||(this.clearEmpties(e[t]),Object.keys(e[t]).length===0&&delete e[t])}async saveSettings(){this.clearEmpties(this.data.results),await this.saveData(this.data)}get dataview_regex(){let e=Array.from(this.inline.keys());return e.length?new RegExp(`(${e.join("|")})`,"g"):null}getParametersForRoller(e,t){e=e.replace(/\\\|/g,"|");let i=t?.showDice??!0,a=t?.shouldRender??this.data.renderAllDice,r=t?.showFormula??this.data.displayResultsInline,s=t?.showParens??this.data.displayFormulaAfter,o=t?.expectedValue??g2.Roll,c=t?.text??"",l=/\|text\((.*)\)/;if(e.includes("|nodice")&&(i=!1),e.includes("|render")&&(a=!0),e.includes("|norender")&&(a=!1),e.includes("|form")&&(r=!0),e.includes("|noform")&&(r=!1),e.includes("|avg")&&(o=g2.Average),e.includes("|none")&&(o=g2.None),e.includes("|text(")){let[,u]=e.match(l)??[null,""];c=u}return e.includes("|paren")&&(s=!0),e.includes("|noparen")&&(s=!1),e=(0,No.decode)(e.replace("|nodice","").replace("|render","").replace("|norender","").replace("|noform","").replace("|form","").replace("|noparen","").replace("|paren","").replace("|avg","").replace("|none","").replace(l,"")),e in this.data.formulas&&(e=this.data.formulas[e]),{content:e,showDice:i,showParens:s,showFormula:r,expectedValue:o,shouldRender:a,text:c}}async getRoller(e,t="",i=Ke.RollerOptions(this)){let{content:a,showDice:r,showParens:s,showFormula:o,expectedValue:c,shouldRender:l,text:u}=this.getParametersForRoller(e,i),f=this.parse(a);switch(this.getTypeFromLexemes(f)){case"dice":{let m=new S2(this,a,f,r,u,c,s);return m.showFormula=o,m.shouldRender=l,m}case"table":{let m=new kt(this,a,f[0],t,r);return await m.init,m}case"section":return new z4(this,a,f[0],t,r);case"tag":{if(!this.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new l6(this,a,f[0],t,r)}case"link":return new u6(this,a,f[0],t,r);case"line":return new h6(this,a,f[0],t,r)}}getRollerSync(e,t,i=Ke.RollerOptions(this)){let{content:a,showDice:r,showParens:s,showFormula:o,expectedValue:c,shouldRender:l,text:u}=this.getParametersForRoller(e,i),f=this.parse(a);switch(this.getTypeFromLexemes(f)){case"dice":{let m=new S2(this,a,f,r,u,c,s);return m.shouldRender=l,m.showFormula=o,m}case"table":{let m=new kt(this,a,f[0],t,r);return m.init,m}case"section":return new z4(this,a,f[0],t,r);case"tag":{if(!this.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new l6(this,a,f[0],t,r)}case"link":return new u6(this,a,f[0],t,r);case"line":return new h6(this,a,f[0],t,r)}}getTypeFromLexemes(e){return e.some(({type:t})=>t==="table")?"table":e.some(({type:t})=>t==="section")?"section":e.some(({type:t})=>t==="tag")?"tag":e.some(({type:t})=>t==="link")?"link":e.some(({type:t})=>t==="line")?"line":"dice"}onunload(){console.log("DiceRoller unloaded"),this.app.workspace.getLeavesOfType(bt).forEach(e=>e.detach()),"__THREE__"in window&&delete window.__THREE__,this.renderer.unload(),this.app.workspace.trigger("dice-roller:unload")}parse(e){return this.parser.parse(e)}}; /*! * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) diff --git a/.obsidian/plugins/obsidian-dice-roller/manifest.json b/.obsidian/plugins/obsidian-dice-roller/manifest.json index 670c7333..b829a538 100644 --- a/.obsidian/plugins/obsidian-dice-roller/manifest.json +++ b/.obsidian/plugins/obsidian-dice-roller/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-dice-roller", "name": "Dice Roller", - "version": "8.13.8", + "version": "8.14.2", "minAppVersion": "0.12.15", "description": "Inline dice rolling for Obsidian.md", "author": "Jeremy Valentine", diff --git a/.obsidian/plugins/obsidian-reminder-plugin/data.json b/.obsidian/plugins/obsidian-reminder-plugin/data.json index f9652a24..dd2423e6 100644 --- a/.obsidian/plugins/obsidian-reminder-plugin/data.json +++ b/.obsidian/plugins/obsidian-reminder-plugin/data.json @@ -234,7 +234,7 @@ "01.03 Family/Quentin de Villeneuve.md": [ { "title": ":birthday: **[[Quentin de Villeneuve|Quentin BV]]** %%done_del%%", - "time": "2023-04-21", + "time": "2024-04-21", "rowNumber": 105 } ], @@ -304,14 +304,14 @@ "01.03 Family/Achille Bédier.md": [ { "title": ":birthday: **[[Achille Bédier|Achille]]**", - "time": "2023-04-20", + "time": "2024-04-20", "rowNumber": 105 } ], "01.03 Family/Isaure Bédier.md": [ { "title": ":birthday: **[[Isaure Bédier|Isaure]]** %%done_del%%", - "time": "2023-04-21", + "time": "2024-04-21", "rowNumber": 105 } ], @@ -351,35 +351,30 @@ } ], "01.02 Home/Household.md": [ - { - "title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%", - "time": "2023-04-24", - "rowNumber": 85 - }, - { - "title": "♻ [[Household]]: *Paper* recycling collection %%done_del%%", - "time": "2023-04-25", - "rowNumber": 75 - }, - { - "title": "🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%%", - "time": "2023-04-29", - "rowNumber": 84 - }, { "title": ":bed: [[Household]] Change bedsheets %%done_del%%", "time": "2023-04-29", - "rowNumber": 86 + "rowNumber": 87 }, { "title": "🛎️ :house: [[Household]]: Pay rent %%done_del%%", "time": "2023-04-30", - "rowNumber": 83 + "rowNumber": 84 + }, + { + "title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%", + "time": "2023-05-01", + "rowNumber": 85 }, { "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", "time": "2023-05-02", - "rowNumber": 76 + "rowNumber": 77 + }, + { + "title": "♻ [[Household]]: *Paper* recycling collection %%done_del%%", + "time": "2023-05-09", + "rowNumber": 75 }, { "title": ":couch_and_lamp: [[Household]]: Replace the sofa", @@ -389,12 +384,12 @@ { "title": ":blue_car: [[Household]]: Change to Winter tyres %%done_del%%", "time": "2023-10-15", - "rowNumber": 93 + "rowNumber": 94 }, { "title": ":blue_car: [[Household]]: Change to Summer tyres %%done_del%%", "time": "2024-04-15", - "rowNumber": 92 + "rowNumber": 93 } ], "01.03 Family/Pia Bousquié.md": [ @@ -477,13 +472,13 @@ "05.02 Networks/Configuring UFW.md": [ { "title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%%", - "time": "2023-04-22", + "time": "2023-04-29", "rowNumber": 239 }, { "title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%%", - "time": "2023-04-22", - "rowNumber": 251 + "time": "2023-04-29", + "rowNumber": 252 } ], "01.03 Family/Amélie Solanet.md": [ @@ -553,32 +548,32 @@ { "title": "💍 [[@@MRCK|Meggi-mo]]: Start looking for a ring", "time": "2023-06-30", - "rowNumber": 265 + "rowNumber": 267 }, { "title": ":birthday: **[[@@MRCK|Meggi-mo]]‘s Mama** (1952) %%done_del%%", "time": "2024-01-10", - "rowNumber": 296 + "rowNumber": 298 }, { "title": ":birthday: **[[@@MRCK|Meggi-mo]]'s Papa** (1962) %%done_del%%", "time": "2024-02-02", - "rowNumber": 295 + "rowNumber": 297 }, { "title": "👑 [[@@MRCK|Meggi-mo]] **Valentine’s Day** %%done_del%%", "time": "2024-02-14", - "rowNumber": 299 + "rowNumber": 301 }, { "title": ":birthday: **[[@@MRCK|Meggi-mo]]** %%done_del%%", "time": "2024-02-28", - "rowNumber": 293 + "rowNumber": 295 }, { "title": "☘️ [[@@MRCK|Meggi-mo]] **Saint Patrick's Day** %%done_del%%", "time": "2024-03-17", - "rowNumber": 297 + "rowNumber": 299 } ], "00.08 Bookmarks/Bookmarks - Travels & Sport.md": [ diff --git a/.obsidian/plugins/obsidian-tasks-plugin/main.js b/.obsidian/plugins/obsidian-tasks-plugin/main.js index 7d92da7f..7b9af1f6 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/main.js +++ b/.obsidian/plugins/obsidian-tasks-plugin/main.js @@ -122,17 +122,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";var bD=Object.create;var $i=Object.defineProperty,vD=Object.defineProperties,wD=Object.getOwnPropertyDescriptor,DD=Object.getOwnPropertyDescriptors,kD=Object.getOwnPropertyNames,Xp=Object.getOwnPropertySymbols,ED=Object.getPrototypeOf,Jp=Object.prototype.hasOwnProperty,SD=Object.prototype.propertyIsEnumerable;var Qp=(r,e,t)=>e in r?$i(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ae=(r,e)=>{for(var t in e||(e={}))Jp.call(e,t)&&Qp(r,t,e[t]);if(Xp)for(var t of Xp(e))SD.call(e,t)&&Qp(r,t,e[t]);return r},er=(r,e)=>vD(r,DD(e));var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),OD=(r,e)=>{for(var t in e)$i(r,t,{get:e[t],enumerable:!0})},em=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of kD(e))!Jp.call(r,s)&&s!==t&&$i(r,s,{get:()=>e[s],enumerable:!(n=wD(e,s))||n.enumerable});return r};var In=(r,e,t)=>(t=r!=null?bD(ED(r)):{},em(e||!r||!r.__esModule?$i(t,"default",{value:r,enumerable:!0}):t,r)),MD=r=>em($i({},"__esModule",{value:!0}),r);var J=(r,e,t)=>new Promise((n,s)=>{var a=c=>{try{l(t.next(c))}catch(h){s(h)}},o=c=>{try{l(t.throw(c))}catch(h){s(h)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);l((t=t.apply(r,e)).next())});var Ie=O(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.matchAnyPattern=Fn.extractTerms=Fn.repeatedTimeunitPattern=void 0;function AD(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Fn.repeatedTimeunitPattern=AD;function tm(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Fn.extractTerms=tm;function ND(r){return`(?:${tm(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Fn.matchAnyPattern=ND});var Re=O((Nl,Cl)=>{(function(r,e){typeof Nl=="object"&&typeof Cl!="undefined"?Cl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Nl,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",s="second",a="minute",o="hour",l="day",c="week",h="month",m="quarter",g="year",T="date",S="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},$=function(V,q,P){var Q=String(V);return!Q||Q.length>=q?V:""+Array(q+1-Q.length).join(P)+V},B={s:$,z:function(V){var q=-V.utcOffset(),P=Math.abs(q),Q=Math.floor(P/60),Y=P%60;return(q<=0?"+":"-")+$(Q,2,"0")+":"+$(Y,2,"0")},m:function V(q,P){if(q.date(){"use strict";var CD=Ln&&Ln.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.findYearClosestToRef=Ln.findMostLikelyADYear=void 0;var ID=CD(Re());function FD(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Ln.findMostLikelyADYear=FD;function LD(r,e,t){let n=ID.default(r),s=n;s=s.month(t-1),s=s.date(e),s=s.year(n.year());let a=s.add(1,"y"),o=s.add(-1,"y");return Math.abs(a.diff(n)){"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.parseTimeUnits=ye.TIME_UNITS_PATTERN=ye.parseYear=ye.YEAR_PATTERN=ye.parseOrdinalNumberPattern=ye.ORDINAL_NUMBER_PATTERN=ye.parseNumberPattern=ye.NUMBER_PATTERN=ye.TIME_UNIT_DICTIONARY=ye.ORDINAL_WORD_DICTIONARY=ye.INTEGER_WORD_DICTIONARY=ye.MONTH_DICTIONARY=ye.FULL_MONTH_NAME_DICTIONARY=ye.WEEKDAY_DICTIONARY=void 0;var Ro=Ie(),YD=Rt();ye.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};ye.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};ye.MONTH_DICTIONARY=Object.assign(Object.assign({},ye.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});ye.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};ye.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};ye.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};ye.NUMBER_PATTERN=`(?:${Ro.matchAnyPattern(ye.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function nm(r){let e=r.toLowerCase();return ye.INTEGER_WORD_DICTIONARY[e]!==void 0?ye.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}ye.parseNumberPattern=nm;ye.ORDINAL_NUMBER_PATTERN=`(?:${Ro.matchAnyPattern(ye.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function UD(r){let e=r.toLowerCase();return ye.ORDINAL_WORD_DICTIONARY[e]!==void 0?ye.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ye.parseOrdinalNumberPattern=UD;ye.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function WD(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return YD.findMostLikelyADYear(e)}ye.parseYear=WD;var sm=`(${ye.NUMBER_PATTERN})\\s{0,3}(${Ro.matchAnyPattern(ye.TIME_UNIT_DICTIONARY)})`,rm=new RegExp(sm,"i");ye.TIME_UNITS_PATTERN=Ro.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",sm);function qD(r){let e={},t=r,n=rm.exec(t);for(;n;)jD(e,n),t=t.substring(n[0].length).trim(),n=rm.exec(t);return e}ye.parseTimeUnits=qD;function jD(r,e){let t=nm(e[1]),n=ye.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var im=O((Il,Fl)=>{(function(r,e){typeof Il=="object"&&typeof Fl!="undefined"?Fl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Il,function(){"use strict";var r="month",e="quarter";return function(t,n){var s=n.prototype;s.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var a=s.add;s.add=function(l,c){return l=Number(l),this.$utils().p(c)===e?this.add(3*l,r):a.bind(this)(l,c)};var o=s.startOf;s.startOf=function(l,c){var h=this.$utils(),m=!!h.u(c)||c;if(h.p(l)===e){var g=this.quarter()-1;return m?this.month(3*g).startOf(r).startOf("day"):this.month(3*g+2).endOf(r).endOf("day")}return o.bind(this)(l,c)}}})});var mr=O(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.implySimilarTime=Wr.assignSimilarTime=Wr.assignSimilarDate=Wr.assignTheNextDay=void 0;var am=pt();function $D(r,e){e=e.add(1,"day"),om(r,e),um(r,e)}Wr.assignTheNextDay=$D;function om(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Wr.assignSimilarDate=om;function GD(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",am.Meridiem.AM):r.assign("meridiem",am.Meridiem.PM)}Wr.assignSimilarTime=GD;function um(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Wr.implySimilarTime=um});var lm=O(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.toTimezoneOffset=us.TIMEZONE_ABBR_MAP=void 0;us.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function BD(r){var e;return r==null?null:typeof r=="number"?r:(e=us.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}us.toTimezoneOffset=BD});var tt=O(qr=>{"use strict";var cm=qr&&qr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qr,"__esModule",{value:!0});qr.ParsingResult=qr.ParsingComponents=qr.ReferenceWithTimezone=void 0;var HD=cm(im()),xo=cm(Re()),Ll=mr(),zD=lm();xo.default.extend(HD.default);var Yl=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=zD.toTimezoneOffset(e.timezone))}};qr.ReferenceWithTimezone=Yl;var ls=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let s in t)this.knownValues[s]=t[s];let n=xo.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new ls(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return xo.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let s=-e.getTimezoneOffset(),a=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:s;return s-a}static createRelativeFromReference(e,t){let n=xo.default(e.instant);for(let a in t)n=n.add(t[a],a);let s=new ls(e);return t.hour||t.minute||t.second?(Ll.assignSimilarTime(s,n),Ll.assignSimilarDate(s,n),e.timezoneOffset!==null&&s.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Ll.implySimilarTime(s,n),e.timezoneOffset!==null&&s.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(s.assign("day",n.date()),s.assign("month",n.month()+1),s.assign("year",n.year())):(t.week&&s.imply("weekday",n.day()),s.imply("day",n.date()),t.month?(s.assign("month",n.month()+1),s.assign("year",n.year())):(s.imply("month",n.month()+1),t.year?s.assign("year",n.year()):s.imply("year",n.year())))),s}};qr.ParsingComponents=ls;var Gi=class{constructor(e,t,n,s,a){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=s||new ls(e),this.end=a}clone(){let e=new Gi(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};qr.ParsingResult=Gi});var Z=O(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.AbstractParserWithWordBoundaryChecking=void 0;var Ul=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let s=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+s.length,t[0]=t[0].substring(s.length);for(let a=2;a{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var ql=xt(),VD=tt(),KD=Z(),ZD=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${ql.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),XD=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${ql.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Wl=class extends KD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?XD:ZD}innerExtract(e,t){let n=ql.parseTimeUnits(t[1]);return VD.ParsingComponents.createRelativeFromReference(e.reference,n)}};jl.default=Wl});var gm=O(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var QD=Rt(),mm=xt(),ym=xt(),Ao=xt(),JD=Ie(),ek=Z(),tk=new RegExp(`(?:on\\s{0,3})?(${Ao.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${Ao.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${JD.matchAnyPattern(mm.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${ym.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),fm=1,hm=2,rk=3,pm=4,$l=class extends ek.AbstractParserWithWordBoundaryChecking{innerPattern(){return tk}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=mm.MONTH_DICTIONARY[t[rk].toLowerCase()],a=Ao.parseOrdinalNumberPattern(t[fm]);if(a>31)return t.index=t.index+t[fm].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[pm]){let o=ym.parseYear(t[pm]);n.start.assign("year",o)}else{let o=QD.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[hm]){let o=Ao.parseOrdinalNumberPattern(t[hm]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Gl.default=$l});var wm=O(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var nk=Rt(),bm=xt(),No=xt(),vm=xt(),sk=Ie(),ik=Z(),ak=new RegExp(`(${sk.matchAnyPattern(bm.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${No.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${No.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${vm.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),ok=1,uk=2,_m=3,Tm=4,Bl=class extends ik.AbstractParserWithWordBoundaryChecking{innerPattern(){return ak}innerExtract(e,t){let n=bm.MONTH_DICTIONARY[t[ok].toLowerCase()],s=No.parseOrdinalNumberPattern(t[uk]);if(s>31)return null;let a=e.createParsingComponents({day:s,month:n});if(t[Tm]){let c=vm.parseYear(t[Tm]);a.assign("year",c)}else{let c=nk.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[_m])return a;let o=No.parseOrdinalNumberPattern(t[_m]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};Hl.default=Bl});var Em=O(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});var zl=xt(),lk=Rt(),ck=Ie(),km=xt(),dk=Z(),fk=new RegExp(`((?:in)\\s*)?(${ck.matchAnyPattern(zl.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${km.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),hk=1,pk=2,Dm=3,Vl=class extends dk.AbstractParserWithWordBoundaryChecking{innerPattern(){return fk}innerExtract(e,t){let n=t[pk].toLowerCase();if(t[0].length<=3&&!zl.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index+(t[hk]||"").length,t.index+t[0].length);s.start.imply("day",1);let a=zl.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[Dm]){let o=km.parseYear(t[Dm]);s.start.assign("year",o)}else{let o=lk.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};Kl.default=Vl});var Mm=O(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var Om=xt(),mk=Ie(),yk=Z(),gk=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${mk.matchAnyPattern(Om.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),_k=1,Tk=2,Sm=3,bk=4,Zl=class extends yk.AbstractParserWithWordBoundaryChecking{innerPattern(){return gk}innerExtract(e,t){let n=t[Sm]?parseInt(t[Sm]):Om.MONTH_DICTIONARY[t[Tk].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[_k]);return{day:parseInt(t[bk]),month:n,year:s}}};Xl.default=Zl});var Rm=O(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var vk=Z(),wk=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Dk=1,kk=2,Ql=class extends vk.AbstractParserWithWordBoundaryChecking{innerPattern(){return wk}innerExtract(e,t){let n=parseInt(t[kk]),s=parseInt(t[Dk]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};Jl.default=Ql});var cs=O(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.AbstractTimeExpressionParser=void 0;var Gt=pt();function Ek(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function Sk(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var xm=2,Bs=3,Co=4,Io=5,Bi=6,ec=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let s=t.index+t[1].length,a=t[0].substring(t[1].length),o=e.createParsingResult(s,a,n);t.index+=t[0].length;let l=e.text.substring(t.index),h=this.getFollowingTimePatternThroughCache().exec(l);return a.match(/^\d{3,4}/)&&h&&h[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!h||h[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(o):(o.end=this.extractFollowingTimeComponents(e,h,o),o.end&&(o.text+=h[0]),this.checkAndReturnWithFollowingPattern(o))}extractPrimaryTimeComponents(e,t,n=!1){let s=e.createParsingComponents(),a=0,o=null,l=parseInt(t[xm]);if(l>100){if(this.strictMode||t[Bs]!=null)return null;a=l%100,l=Math.floor(l/100)}if(l>24)return null;if(t[Bs]!=null){if(t[Bs].length==1&&!t[Bi])return null;a=parseInt(t[Bs])}if(a>=60)return null;if(l>12&&(o=Gt.Meridiem.PM),t[Bi]!=null){if(l>12)return null;let c=t[Bi][0].toLowerCase();c=="a"&&(o=Gt.Meridiem.AM,l==12&&(l=0)),c=="p"&&(o=Gt.Meridiem.PM,l!=12&&(l+=12))}if(s.assign("hour",l),s.assign("minute",a),o!==null?s.assign("meridiem",o):l<12?s.imply("meridiem",Gt.Meridiem.AM):s.imply("meridiem",Gt.Meridiem.PM),t[Io]!=null){let c=parseInt(t[Io].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[Co]!=null){let c=parseInt(t[Co]);if(c>=60)return null;s.assign("second",c)}return s}extractFollowingTimeComponents(e,t,n){let s=e.createParsingComponents();if(t[Io]!=null){let c=parseInt(t[Io].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[Co]!=null){let c=parseInt(t[Co]);if(c>=60)return null;s.assign("second",c)}let a=parseInt(t[xm]),o=0,l=-1;if(t[Bs]!=null?o=parseInt(t[Bs]):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(l=Gt.Meridiem.PM),t[Bi]!=null){if(a>12)return null;let c=t[Bi][0].toLowerCase();c=="a"&&(l=Gt.Meridiem.AM,a==12&&(a=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),c=="p"&&(l=Gt.Meridiem.PM,a!=12&&(a+=12)),n.start.isCertain("meridiem")||(l==Gt.Meridiem.AM?(n.start.imply("meridiem",Gt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Gt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return s.assign("hour",a),s.assign("minute",o),l>=0?s.assign("meridiem",l):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>a?s.imply("meridiem",Gt.Meridiem.AM):a<=12&&(s.assign("hour",a+12),s.assign("meridiem",Gt.Meridiem.PM)):a>12?s.imply("meridiem",Gt.Meridiem.PM):a<=12&&s.imply("meridiem",Gt.Meridiem.AM),s.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;let a=parseInt(s),o=parseInt(n);if(a>24||o>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=Ek(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=Sk(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};Fo.AbstractTimeExpressionParser=ec});var Pm=O(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var Lo=pt(),Ok=cs(),tc=class extends Ok.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Lo.Meridiem.PM)):s<6&&n.assign("meridiem",Lo.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",Lo.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",Lo.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};rc.default=tc});var yr=O(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.addImpliedTimeUnits=Hs.reverseTimeUnits=void 0;function Mk(r){let e={};for(let t in r)e[t]=-r[t];return e}Hs.reverseTimeUnits=Mk;function Rk(r,e){let t=r.clone(),n=r.dayjs();for(let s in e)n=n.add(e[s],s);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}Hs.addImpliedTimeUnits=Rk});var Am=O(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var sc=xt(),xk=tt(),Pk=Z(),Ak=yr(),Nk=new RegExp(`(${sc.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),Ck=new RegExp(`(${sc.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),nc=class extends Pk.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?Ck:Nk}innerExtract(e,t){let n=sc.parseTimeUnits(t[1]),s=Ak.reverseTimeUnits(n);return xk.ParsingComponents.createRelativeFromReference(e.reference,s)}};ic.default=nc});var Nm=O(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var oc=xt(),Ik=tt(),Fk=Z(),Lk=new RegExp(`(${oc.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),Yk=new RegExp("("+oc.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),Uk=1,ac=class extends Fk.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?Yk:Lk}innerExtract(e,t){let n=oc.parseTimeUnits(t[Uk]);return Ik.ParsingComponents.createRelativeFromReference(e.reference,n)}};uc.default=ac});var Vs=O(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.MergingRefiner=zs.Filter=void 0;var lc=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};zs.Filter=lc;var cc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0],a=null;for(let o=1;o{console.log(`${this.constructor.name} merged ${c} and ${h} into ${m}`)}),s=m}}return s!=null&&n.push(s),n}};zs.MergingRefiner=cc});var jr=O(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});var Wk=Vs(),dc=class extends Wk.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(a=>{t.start.isCertain(a)||t.start.assign(a,n.start.get(a))}),t.start.getCertainComponents().forEach(a=>{n.start.isCertain(a)||n.start.assign(a,t.start.get(a))})),t.start.date().getTime()>n.start.date().getTime()){let a=t.start.dayjs(),o=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&a.add(-7,"days").isBefore(o)?(a=a.add(-7,"days"),t.start.imply("day",a.date()),t.start.imply("month",a.month()+1),t.start.imply("year",a.year())):n.start.isOnlyWeekdayComponent()&&o.add(7,"days").isAfter(a)?(o=o.add(7,"days"),n.start.imply("day",o.date()),n.start.imply("month",o.month()+1),n.start.imply("year",o.year())):[n,t]=[t,n]}let s=t.clone();return s.start=t.start,s.end=n.start,s.index=Math.min(t.index,n.index),t.index{"use strict";var qk=Hi&&Hi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hi,"__esModule",{value:!0});var jk=qk(jr()),hc=class extends jk.default{patternBetween(){return/^\s*(to|-)\s*$/i}};Hi.default=hc});var Im=O(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.mergeDateTimeComponent=Ks.mergeDateTimeResult=void 0;var $k=pt();function Gk(r,e){let t=r.clone(),n=r.start,s=e.start;if(t.start=pc(n,s),r.end!=null||e.end!=null){let a=r.end==null?r.start:r.end,o=e.end==null?e.start:e.end,l=pc(a,o);r.end==null&&l.date().getTime(){"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var Bk=Vs(),Fm=Im(),mc=class extends Bk.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let s=t.start.isOnlyDate()?Fm.mergeDateTimeResult(t,n):Fm.mergeDateTimeResult(n,t);return s.index=t.index,s.text=t.text+e+n.text,s}};yc.default=mc});var Lm=O(zi=>{"use strict";var Hk=zi&&zi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zi,"__esModule",{value:!0});var zk=Hk(ln()),gc=class extends zk.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};zi.default=gc});var Ym=O(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});var Vk=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),Kk={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},_c=class{constructor(e){this.timezone=Object.assign(Object.assign({},Kk),e)}refine(e,t){var n;let s=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(a=>{var o,l;let c=e.text.substring(a.index+a.text.length),h=Vk.exec(c);if(!h)return;let m=h[1].toUpperCase(),g=(l=(o=s[m])!==null&&o!==void 0?o:this.timezone[m])!==null&&l!==void 0?l:null;if(g===null)return;e.debug(()=>{console.log(`Extracting timezone: '${m}' into: ${g} for: ${a.start}`)});let T=a.start.get("timezoneOffset");T!==null&&g!=T&&(a.start.isCertain("timezoneOffset")||m!=h[1])||a.start.isOnlyDate()&&m!=h[1]||(a.text+=h[0],a.start.isCertain("timezoneOffset")||a.start.assign("timezoneOffset",g),a.end!=null&&!a.end.isCertain("timezoneOffset")&&a.end.assign("timezoneOffset",g))}),t}};Tc.default=_c});var Yo=O(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var Zk=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),Xk=1,Qk=2,Jk=3,bc=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let s=e.text.substring(n.index+n.text.length),a=Zk.exec(s);if(!a)return;e.debug(()=>{console.log(`Extracting timezone: '${a[0]}' into : ${n}`)});let o=parseInt(a[Qk]),l=parseInt(a[Jk]||"0"),c=o*60+l;c>14*60||(a[Xk]==="-"&&(c=-c),n.end!=null&&n.end.assign("timezoneOffset",c),n.start.assign("timezoneOffset",c),n.text+=a[0])}),t}};vc.default=bc});var Um=O(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var wc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0];for(let a=1;as.text.length&&(s=o):(n.push(s),s=o)}return s!=null&&n.push(s),n}};Dc.default=wc});var Wm=O(Vi=>{"use strict";var eE=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0});var tE=eE(Re()),kc=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let s=tE.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&s.isAfter(n.start.dayjs()))for(let a=0;a<3&&s.isAfter(n.start.dayjs());a++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&s.isAfter(n.start.dayjs())&&(s.day()>=n.start.get("weekday")?s=s.day(n.start.get("weekday")+7):s=s.day(n.start.get("weekday")),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(s.day()>n.end.get("weekday")?s=s.day(n.end.get("weekday")+7):s=s.day(n.end.get("weekday")),n.end.imply("day",s.date()),n.end.imply("month",s.month()+1),n.end.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};Vi.default=kc});var qm=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var rE=Vs(),Ec=class extends rE.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};Sc.default=Ec});var Rc=O(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});var nE=Z(),sE=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),iE=1,aE=2,oE=3,jm=4,uE=5,$m=6,Gm=7,Bm=8,Hm=9,Oc=class extends nE.AbstractParserWithWordBoundaryChecking{innerPattern(){return sE}innerExtract(e,t){let n={};if(n.year=parseInt(t[iE]),n.month=parseInt(t[aE]),n.day=parseInt(t[oE]),t[jm]!=null)if(n.hour=parseInt(t[jm]),n.minute=parseInt(t[uE]),t[$m]!=null&&(n.second=parseInt(t[$m])),t[Gm]!=null&&(n.millisecond=parseInt(t[Gm])),t[Bm]==null)n.timezoneOffset=0;else{let s=parseInt(t[Bm]),a=0;t[Hm]!=null&&(a=parseInt(t[Hm]));let o=s*60;o<0?o-=a:o+=a,n.timezoneOffset=o}return n}};Mc.default=Oc});var zm=O(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});var lE=Vs(),xc=class extends lE.MergingRefiner{mergeResults(e,t,n){let s=n.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Pc.default=xc});var cn=O(Zs=>{"use strict";var ds=Zs&&Zs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.includeCommonConfiguration=void 0;var cE=ds(Ym()),dE=ds(Yo()),Vm=ds(Um()),fE=ds(Wm()),hE=ds(qm()),pE=ds(Rc()),mE=ds(zm());function yE(r,e=!1){return r.parsers.unshift(new pE.default),r.refiners.unshift(new mE.default),r.refiners.unshift(new cE.default),r.refiners.unshift(new dE.default),r.refiners.unshift(new Vm.default),r.refiners.push(new Vm.default),r.refiners.push(new fE.default),r.refiners.push(new hE.default(e)),r}Zs.includeCommonConfiguration=yE});var fn=O(Ne=>{"use strict";var gE=Ne&&Ne.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.noon=Ne.morning=Ne.midnight=Ne.yesterdayEvening=Ne.evening=Ne.lastNight=Ne.tonight=Ne.theDayAfter=Ne.tomorrow=Ne.theDayBefore=Ne.yesterday=Ne.today=Ne.now=void 0;var $r=tt(),Xs=gE(Re()),dn=mr(),Ki=pt();function _E(r){let e=Xs.default(r.instant),t=new $r.ParsingComponents(r,{});return dn.assignSimilarDate(t,e),dn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Ne.now=_E;function TE(r){let e=Xs.default(r.instant),t=new $r.ParsingComponents(r,{});return dn.assignSimilarDate(t,e),dn.implySimilarTime(t,e),t}Ne.today=TE;function bE(r){return Km(r,1)}Ne.yesterday=bE;function Km(r,e){return Ac(r,-e)}Ne.theDayBefore=Km;function vE(r){return Ac(r,1)}Ne.tomorrow=vE;function Ac(r,e){let t=Xs.default(r.instant),n=new $r.ParsingComponents(r,{});return t=t.add(e,"day"),dn.assignSimilarDate(n,t),dn.implySimilarTime(n,t),n}Ne.theDayAfter=Ac;function wE(r,e=22){let t=Xs.default(r.instant),n=new $r.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",Ki.Meridiem.PM),dn.assignSimilarDate(n,t),n}Ne.tonight=wE;function DE(r,e=0){let t=Xs.default(r.instant),n=new $r.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),dn.assignSimilarDate(n,t),n.imply("hour",e),n}Ne.lastNight=DE;function kE(r,e=20){let t=new $r.ParsingComponents(r,{});return t.imply("meridiem",Ki.Meridiem.PM),t.imply("hour",e),t}Ne.evening=kE;function EE(r,e=20){let t=Xs.default(r.instant),n=new $r.ParsingComponents(r,{});return t=t.add(-1,"day"),dn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",Ki.Meridiem.PM),n}Ne.yesterdayEvening=EE;function SE(r){let e=new $r.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Ne.midnight=SE;function OE(r,e=6){let t=new $r.ParsingComponents(r,{});return t.imply("meridiem",Ki.Meridiem.AM),t.imply("hour",e),t}Ne.morning=OE;function ME(r){let e=new $r.ParsingComponents(r,{});return e.imply("meridiem",Ki.Meridiem.AM),e.imply("hour",12),e}Ne.noon=ME});var Zm=O(Rr=>{"use strict";var RE=Rr&&Rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),xE=Rr&&Rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),PE=Rr&&Rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&RE(e,r,t);return xE(e,r),e},AE=Rr&&Rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rr,"__esModule",{value:!0});var NE=AE(Re()),CE=Z(),IE=mr(),Zi=PE(fn()),FE=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Nc=class extends CE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return FE}innerExtract(e,t){let n=NE.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"now":return Zi.now(e.reference);case"today":return Zi.today(e.reference);case"yesterday":return Zi.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return Zi.tomorrow(e.reference);case"tonight":return Zi.tonight(e.reference);default:s.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),IE.assignSimilarDate(a,n),a.imply("hour",0));break}return a}};Rr.default=Nc});var Xm=O(Xi=>{"use strict";var LE=Xi&&Xi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xi,"__esModule",{value:!0});var Uo=pt(),YE=Z(),UE=LE(Re()),WE=mr(),qE=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Cc=class extends YE.AbstractParserWithWordBoundaryChecking{innerPattern(){return qE}innerExtract(e,t){let n=UE.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":s.imply("meridiem",Uo.Meridiem.PM),s.imply("hour",15);break;case"evening":case"night":s.imply("meridiem",Uo.Meridiem.PM),s.imply("hour",20);break;case"midnight":WE.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"morning":s.imply("meridiem",Uo.Meridiem.AM),s.imply("hour",6);break;case"noon":s.imply("meridiem",Uo.Meridiem.AM),s.imply("hour",12);break}return s}};Xi.default=Cc});var fs=O(Yn=>{"use strict";var jE=Yn&&Yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.toDayJSClosestWeekday=Yn.toDayJSWeekday=void 0;var Qm=jE(Re());function $E(r,e,t){if(!t)return Jm(r,e);let n=Qm.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}Yn.toDayJSWeekday=$E;function Jm(r,e){let t=Qm.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var ey=xt(),GE=Ie(),BE=Z(),HE=fs(),zE=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${GE.matchAnyPattern(ey.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),VE=1,KE=2,ZE=3,Ic=class extends BE.AbstractParserWithWordBoundaryChecking{innerPattern(){return zE}innerExtract(e,t){let n=t[KE].toLowerCase(),s=ey.WEEKDAY_DICTIONARY[n],a=t[VE],o=t[ZE],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="last"||l=="past"?c="last":l=="next"?c="next":l=="this"&&(c="this");let h=HE.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};Fc.default=Ic});var sy=O(Qi=>{"use strict";var XE=Qi&&Qi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qi,"__esModule",{value:!0});var ny=xt(),ry=tt(),QE=XE(Re()),JE=Z(),eS=Ie(),tS=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${eS.matchAnyPattern(ny.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),rS=1,nS=2,Lc=class extends JE.AbstractParserWithWordBoundaryChecking{innerPattern(){return tS}innerExtract(e,t){let n=t[rS].toLowerCase(),s=t[nS].toLowerCase(),a=ny.TIME_UNIT_DICTIONARY[s];if(n=="next"||n.startsWith("after")){let c={};return c[a]=1,ry.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="last"||n=="past"){let c={};return c[a]=-1,ry.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=QE.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Qi.default=Lc});var xr=O(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.ParsingContext=ei.Chrono=void 0;var Qs=tt(),sS=Yc(),Js=class{constructor(e){e=e||sS.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new Js({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let s=this.parse(e,t,n);return s.length>0?s[0].start.date():null}parse(e,t,n){let s=new Wo(e,t,n),a=[];return this.parsers.forEach(o=>{let l=Js.executeParser(s,o);a=a.concat(l)}),a.sort((o,l)=>o.index-l.index),this.refiners.forEach(function(o){a=o.refine(s,a)}),a}static executeParser(e,t){let n=[],s=t.pattern(e),a=e.text,o=e.text,l=s.exec(o);for(;l;){let c=l.index+a.length-o.length;l.index=c;let h=t.extract(e,l);if(!h){o=a.substring(l.index+1),l=s.exec(o);continue}let m=null;h instanceof Qs.ParsingResult?m=h:h instanceof Qs.ParsingComponents?(m=e.createParsingResult(l.index,l[0]),m.start=h):m=e.createParsingResult(l.index,l[0],h),e.debug(()=>console.log(`${t.constructor.name} extracted result ${m}`)),n.push(m),o=a.substring(c+m.text.length),l=s.exec(o)}return n}};ei.Chrono=Js;var Wo=class{constructor(e,t,n){this.text=e,this.reference=new Qs.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof Qs.ParsingComponents?e:new Qs.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,s){let a=typeof t=="string"?t:this.text.substring(e,t),o=n?this.createParsingComponents(n):null,l=s?this.createParsingComponents(s):null;return new Qs.ParsingResult(this.reference,e,a,o,l)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};ei.ParsingContext=Wo});var hs=O(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var iy=Rt(),iS=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),qo=1,ay=5,oy=2,uy=3,Uc=4,Wc=class{constructor(e){this.groupNumberMonth=e?uy:oy,this.groupNumberDay=e?oy:uy}pattern(){return iS}extract(e,t){if(t[qo]=="/"||t[ay]=="/"){t.index+=t[0].length;return}let n=t.index+t[qo].length,s=t[0].substr(t[qo].length,t[0].length-t[qo].length-t[ay].length);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Uc]&&t[0].indexOf("/")<0)return;let a=e.createParsingResult(n,s),o=parseInt(t[this.groupNumberMonth]),l=parseInt(t[this.groupNumberDay]);if((o<1||o>12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),t[Uc]){let c=parseInt(t[Uc]),h=iy.findMostLikelyADYear(c);a.start.assign("year",h)}else{let c=iy.findYearClosestToRef(e.refDate,l,o);a.start.imply("year",c)}return a}};qc.default=Wc});var cy=O($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});var ly=xt(),aS=tt(),oS=Z(),uS=yr(),lS=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${ly.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),jc=class extends oS.AbstractParserWithWordBoundaryChecking{innerPattern(){return lS}innerExtract(e,t){let n=t[1].toLowerCase(),s=ly.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":s=uS.reverseTimeUnits(s);break}return aS.ParsingComponents.createRelativeFromReference(e.reference,s)}};$c.default=jc});var fy=O(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var cS=Vs(),Gc=tt(),dS=xt(),fS=yr();function dy(r){return r.text.match(/\s+(before|from)$/i)!=null}function hS(r){return r.text.match(/\s+(after|since)$/i)!=null}var Bc=class extends cS.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!dy(t)&&!hS(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let s=dS.parseTimeUnits(t.text);dy(t)&&(s=fS.reverseTimeUnits(s));let a=Gc.ParsingComponents.createRelativeFromReference(new Gc.ReferenceWithTimezone(n.start.date()),s);return new Gc.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,a)}};Hc.default=Bc});var Yc=O(at=>{"use strict";var Tt=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.createConfiguration=at.createCasualConfiguration=at.parseDate=at.parse=at.GB=at.strict=at.casual=void 0;var pS=Tt(dm()),mS=Tt(gm()),yS=Tt(wm()),gS=Tt(Em()),_S=Tt(Mm()),TS=Tt(Rm()),bS=Tt(Pm()),vS=Tt(Am()),wS=Tt(Nm()),DS=Tt(Cm()),kS=Tt(Lm()),ES=cn(),SS=Tt(Zm()),OS=Tt(Xm()),MS=Tt(ty()),RS=Tt(sy()),zc=xr(),xS=Tt(hs()),PS=Tt(cy()),AS=Tt(fy());at.casual=new zc.Chrono(hy(!1));at.strict=new zc.Chrono(jo(!0,!1));at.GB=new zc.Chrono(jo(!1,!0));function NS(r,e,t){return at.casual.parse(r,e,t)}at.parse=NS;function CS(r,e,t){return at.casual.parseDate(r,e,t)}at.parseDate=CS;function hy(r=!1){let e=jo(!1,r);return e.parsers.unshift(new SS.default),e.parsers.unshift(new OS.default),e.parsers.unshift(new gS.default),e.parsers.unshift(new RS.default),e.parsers.unshift(new PS.default),e}at.createCasualConfiguration=hy;function jo(r=!0,e=!1){return ES.includeCommonConfiguration({parsers:[new xS.default(e),new pS.default,new mS.default,new yS.default,new MS.default,new _S.default,new TS.default,new bS.default(r),new vS.default(r),new wS.default(r)],refiners:[new AS.default,new kS.default,new DS.default]},r)}at.createConfiguration=jo});var py=O(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});var IS=cs(),Vc=class extends IS.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Kc.default=Vc});var Ji=O(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseTimeUnits=Ue.TIME_UNITS_PATTERN=Ue.parseYear=Ue.YEAR_PATTERN=Ue.parseNumberPattern=Ue.NUMBER_PATTERN=Ue.TIME_UNIT_DICTIONARY=Ue.INTEGER_WORD_DICTIONARY=Ue.MONTH_DICTIONARY=Ue.WEEKDAY_DICTIONARY=void 0;var Zc=Ie(),FS=Rt();Ue.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Ue.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Ue.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Ue.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Ue.NUMBER_PATTERN=`(?:${Zc.matchAnyPattern(Ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function yy(r){let e=r.toLowerCase();return Ue.INTEGER_WORD_DICTIONARY[e]!==void 0?Ue.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Ue.parseNumberPattern=yy;Ue.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function LS(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return FS.findMostLikelyADYear(e)}Ue.parseYear=LS;var gy=`(${Ue.NUMBER_PATTERN})\\s{0,5}(${Zc.matchAnyPattern(Ue.TIME_UNIT_DICTIONARY)})\\s{0,5}`,my=new RegExp(gy,"i");Ue.TIME_UNITS_PATTERN=Zc.repeatedTimeunitPattern("",gy);function YS(r){let e={},t=r,n=my.exec(t);for(;n;)US(e,n),t=t.substring(n[0].length),n=my.exec(t);return e}Ue.parseTimeUnits=YS;function US(r,e){let t=yy(e[1]),n=Ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Ty=O(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var _y=Ji(),WS=Ie(),qS=Z(),jS=fs(),$S=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${WS.matchAnyPattern(_y.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),GS=1,BS=3,HS=2,Xc=class extends qS.AbstractParserWithWordBoundaryChecking{innerPattern(){return $S}innerExtract(e,t){let n=t[HS].toLowerCase(),s=_y.WEEKDAY_DICTIONARY[n],a=t[GS],o=t[BS],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l.match(/letzte/)?c="last":l.match(/chste/)?c="next":l.match(/diese/)&&(c="this");let h=jS.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};Qc.default=Xc});var Dy=O(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var Un=pt(),zS=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),VS=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),KS=2,by=3,vy=4,wy=5,ti=class{pattern(e){return zS}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ti.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=VS.exec(s);return a&&(n.end=ti.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[KS]),t[by]!=null&&(s=parseInt(t[by])),s>=60||n>24)return null;if(n>=12&&(a=Un.Meridiem.PM),t[wy]!=null){if(n>12)return null;let o=t[wy].toLowerCase();o.match(/morgen|vormittag/)&&(a=Un.Meridiem.AM,n==12&&(n=0)),o.match(/nachmittag|abend/)&&(a=Un.Meridiem.PM,n!=12&&(n+=12)),o.match(/nacht/)&&(n==12?(a=Un.Meridiem.AM,n=0):n<6?a=Un.Meridiem.AM:(a=Un.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",Un.Meridiem.AM):e.imply("meridiem",Un.Meridiem.PM),t[vy]!=null){let o=parseInt(t[vy]);if(o>=60)return null;e.assign("second",o)}return e}};Jc.default=ti});var ky=O(ea=>{"use strict";var ZS=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0});var XS=ZS(jr()),ed=class extends XS.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};ea.default=ed});var Ey=O(ta=>{"use strict";var QS=ta&&ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ta,"__esModule",{value:!0});var JS=QS(ln()),td=class extends JS.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};ta.default=td});var rd=O(na=>{"use strict";var eO=na&&na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(na,"__esModule",{value:!0});var tO=eO(Re()),ps=pt(),rO=Z(),nO=mr(),sO=yr(),ra=class extends rO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=tO.default(e.refDate),s=t[2].toLowerCase(),a=e.createParsingComponents();return nO.implySimilarTime(a,n),ra.extractTimeComponents(a,s)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=sO.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ps.Meridiem.AM);break}return e}};na.default=ra});var My=O(Pr=>{"use strict";var iO=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),aO=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),oO=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&iO(e,r,t);return aO(e,r),e},Oy=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0});var uO=Oy(Re()),lO=Z(),ms=mr(),cO=Oy(rd()),Sy=oO(fn()),dO=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),fO=1,hO=2,nd=class extends lO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return dO}innerExtract(e,t){let n=uO.default(e.refDate),s=(t[fO]||"").toLowerCase(),a=(t[hO]||"").toLowerCase(),o=e.createParsingComponents();switch(s){case"jetzt":o=Sy.now(e.reference);break;case"heute":o=Sy.today(e.reference);break;case"morgen":ms.assignTheNextDay(o,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),ms.assignTheNextDay(o,n);break;case"gestern":n=n.add(-1,"day"),ms.assignSimilarDate(o,n),ms.implySimilarTime(o,n);break;case"vorgestern":n=n.add(-2,"day"),ms.assignSimilarDate(o,n),ms.implySimilarTime(o,n);break;default:s.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),ms.assignSimilarDate(o,n),o.imply("hour",0));break}return a&&(o=cO.default.extractTimeComponents(o,a)),o}};Pr.default=nd});var Cy=O(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var pO=Rt(),Ay=Ji(),Ny=Ji(),mO=Ie(),yO=Z(),gO=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${mO.matchAnyPattern(Ay.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Ny.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ry=1,xy=2,_O=3,Py=4,sd=class extends yO.AbstractParserWithWordBoundaryChecking{innerPattern(){return gO}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Ay.MONTH_DICTIONARY[t[_O].toLowerCase()],a=parseInt(t[Ry]);if(a>31)return t.index=t.index+t[Ry].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Py]){let o=Ny.parseYear(t[Py]);n.start.assign("year",o)}else{let o=pO.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[xy]){let o=parseInt(t[xy]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};id.default=sd});var Iy=O(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var $o=Ji(),TO=tt(),bO=Z(),vO=yr(),wO=Ie(),ad=class extends bO.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${$o.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${wO.matchAnyPattern($o.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?$o.parseNumberPattern(t[2]):1,s=$o.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],a={};a[s]=n;let o=t[1]||t[3]||"";if(o=o.toLowerCase(),!!o)return(/vor/.test(o)||/letzte/.test(o)||/vergangen/.test(o))&&(a=vO.reverseTimeUnits(a)),TO.ParsingComponents.createRelativeFromReference(e.reference,a)}};od.default=ad});var Yy=O(bt=>{"use strict";var Ar=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bt,"__esModule",{value:!0});bt.createConfiguration=bt.createCasualConfiguration=bt.parseDate=bt.parse=bt.strict=bt.casual=void 0;var DO=cn(),Fy=xr(),kO=Ar(hs()),EO=Ar(Rc()),SO=Ar(py()),OO=Ar(Ty()),MO=Ar(Dy()),RO=Ar(ky()),xO=Ar(Ey()),PO=Ar(My()),AO=Ar(rd()),NO=Ar(Cy()),CO=Ar(Iy());bt.casual=new Fy.Chrono(Ly());bt.strict=new Fy.Chrono(ud(!0));function IO(r,e,t){return bt.casual.parse(r,e,t)}bt.parse=IO;function FO(r,e,t){return bt.casual.parseDate(r,e,t)}bt.parseDate=FO;function Ly(r=!0){let e=ud(!1,r);return e.parsers.unshift(new AO.default),e.parsers.unshift(new PO.default),e.parsers.unshift(new CO.default),e}bt.createCasualConfiguration=Ly;function ud(r=!0,e=!0){return DO.includeCommonConfiguration({parsers:[new EO.default,new kO.default(e),new SO.default,new MO.default,new NO.default,new OO.default],refiners:[new RO.default,new xO.default]},r)}bt.createConfiguration=ud});var Wy=O(Nr=>{"use strict";var LO=Nr&&Nr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),YO=Nr&&Nr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),UO=Nr&&Nr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&LO(e,r,t);return YO(e,r),e},WO=Nr&&Nr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nr,"__esModule",{value:!0});var qO=WO(Re()),jO=pt(),$O=Z(),Uy=mr(),Go=UO(fn()),ld=class extends $O.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=qO.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"maintenant":return Go.now(e.reference);case"aujourd'hui":return Go.today(e.reference);case"hier":return Go.yesterday(e.reference);case"demain":return Go.tomorrow(e.reference);default:s.match(/cette\s*nuit/)?(Uy.assignSimilarDate(a,n),a.imply("hour",22),a.imply("meridiem",jO.Meridiem.PM)):s.match(/la\s*veille/)&&(n=n.add(-1,"day"),Uy.assignSimilarDate(a,n),a.imply("hour",0))}return a}};Nr.default=ld});var qy=O(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var sa=pt(),GO=Z(),cd=class extends GO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),s=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":s.imply("hour",14),s.imply("minute",0),s.imply("meridiem",sa.Meridiem.PM);break;case"soir":s.imply("hour",18),s.imply("minute",0),s.imply("meridiem",sa.Meridiem.PM);break;case"matin":s.imply("hour",8),s.imply("minute",0),s.imply("meridiem",sa.Meridiem.AM);break;case"a midi":s.imply("hour",12),s.imply("minute",0),s.imply("meridiem",sa.Meridiem.AM);break;case"\xE0 minuit":s.imply("hour",0),s.imply("meridiem",sa.Meridiem.AM);break}return s}};dd.default=cd});var jy=O(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var BO=cs(),fd=class extends BO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};hd.default=fd});var $y=O(ia=>{"use strict";var HO=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0});var zO=HO(ln()),pd=class extends zO.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};ia.default=pd});var Gy=O(aa=>{"use strict";var VO=aa&&aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(aa,"__esModule",{value:!0});var KO=VO(jr()),md=class extends KO.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};aa.default=md});var Wn=O(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.parseTimeUnits=xe.TIME_UNITS_PATTERN=xe.parseYear=xe.YEAR_PATTERN=xe.parseOrdinalNumberPattern=xe.ORDINAL_NUMBER_PATTERN=xe.parseNumberPattern=xe.NUMBER_PATTERN=xe.TIME_UNIT_DICTIONARY=xe.INTEGER_WORD_DICTIONARY=xe.MONTH_DICTIONARY=xe.WEEKDAY_DICTIONARY=void 0;var yd=Ie();xe.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};xe.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};xe.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};xe.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};xe.NUMBER_PATTERN=`(?:${yd.matchAnyPattern(xe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Hy(r){let e=r.toLowerCase();return xe.INTEGER_WORD_DICTIONARY[e]!==void 0?xe.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}xe.parseNumberPattern=Hy;xe.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function ZO(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}xe.parseOrdinalNumberPattern=ZO;xe.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function XO(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}xe.parseYear=XO;var zy=`(${xe.NUMBER_PATTERN})\\s{0,5}(${yd.matchAnyPattern(xe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,By=new RegExp(zy,"i");xe.TIME_UNITS_PATTERN=yd.repeatedTimeunitPattern("",zy);function QO(r){let e={},t=r,n=By.exec(t);for(;n;)JO(e,n),t=t.substring(n[0].length),n=By.exec(t);return e}xe.parseTimeUnits=QO;function JO(r,e){let t=Hy(e[1]),n=xe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Ky=O(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var Vy=Wn(),eM=Ie(),tM=Z(),rM=fs(),nM=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${eM.matchAnyPattern(Vy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),sM=1,iM=2,gd=class extends tM.AbstractParserWithWordBoundaryChecking{innerPattern(){return nM}innerExtract(e,t){let n=t[sM].toLowerCase(),s=Vy.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[iM];a=a||"",a=a.toLowerCase();let o=null;a=="dernier"?o="last":a=="prochain"&&(o="next");let l=rM.toDayJSWeekday(e.refDate,s,o);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};_d.default=gd});var Jy=O(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var oa=pt(),aM=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),oM=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),uM=2,Zy=3,Xy=4,Qy=5,ri=class{pattern(e){return aM}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ri.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=oM.exec(s);return a&&(n.end=ri.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[uM]),t[Zy]!=null&&(s=parseInt(t[Zy])),s>=60||n>24)return null;if(n>=12&&(a=oa.Meridiem.PM),t[Qy]!=null){if(n>12)return null;let o=t[Qy][0].toLowerCase();o=="a"&&(a=oa.Meridiem.AM,n==12&&(n=0)),o=="p"&&(a=oa.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",oa.Meridiem.AM):e.imply("meridiem",oa.Meridiem.PM),t[Xy]!=null){let o=parseInt(t[Xy]);if(o>=60)return null;e.assign("second",o)}return e}};Td.default=ri});var ig=O(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var lM=Rt(),ng=Wn(),sg=Wn(),Bo=Wn(),cM=Ie(),dM=Z(),fM=new RegExp(`(?:on\\s*?)?(${Bo.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${Bo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${cM.matchAnyPattern(ng.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${sg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),eg=1,tg=2,hM=3,rg=4,bd=class extends dM.AbstractParserWithWordBoundaryChecking{innerPattern(){return fM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=ng.MONTH_DICTIONARY[t[hM].toLowerCase()],a=Bo.parseOrdinalNumberPattern(t[eg]);if(a>31)return t.index=t.index+t[eg].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[rg]){let o=sg.parseYear(t[rg]);n.start.assign("year",o)}else{let o=lM.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[tg]){let o=Bo.parseOrdinalNumberPattern(t[tg]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};vd.default=bd});var og=O(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var ag=Wn(),pM=tt(),mM=Z(),yM=yr(),wd=class extends mM.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${ag.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=ag.parseTimeUnits(t[1]),s=yM.reverseTimeUnits(n);return pM.ParsingComponents.createRelativeFromReference(e.reference,s)}};Dd.default=wd});var lg=O(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var ug=Wn(),gM=tt(),_M=Z(),kd=class extends _M.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${ug.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=ug.parseTimeUnits(t[1]);return gM.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ed.default=kd});var cg=O(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var Ho=Wn(),TM=tt(),bM=Z(),vM=yr(),wM=Ie(),Sd=class extends bM.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${Ho.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${wM.matchAnyPattern(Ho.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?Ho.parseNumberPattern(t[1]):1,s=Ho.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],a={};a[s]=n;let o=t[2]||t[4]||"";if(o=o.toLowerCase(),!!o)return(/derni[eè]re?s?/.test(o)||/pass[ée]e?s?/.test(o)||/pr[ée]c[ée]dents?/.test(o))&&(a=vM.reverseTimeUnits(a)),TM.ParsingComponents.createRelativeFromReference(e.reference,a)}};Od.default=Sd});var hg=O(vt=>{"use strict";var gr=vt&&vt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vt,"__esModule",{value:!0});vt.createConfiguration=vt.createCasualConfiguration=vt.parseDate=vt.parse=vt.strict=vt.casual=void 0;var DM=cn(),dg=xr(),kM=gr(Wy()),EM=gr(qy()),SM=gr(hs()),OM=gr(jy()),MM=gr($y()),RM=gr(Gy()),xM=gr(Ky()),PM=gr(Jy()),AM=gr(ig()),NM=gr(og()),CM=gr(lg()),IM=gr(cg());vt.casual=new dg.Chrono(fg());vt.strict=new dg.Chrono(Md(!0));function FM(r,e,t){return vt.casual.parse(r,e,t)}vt.parse=FM;function LM(r,e,t){return vt.casual.parseDate(r,e,t)}vt.parseDate=LM;function fg(r=!0){let e=Md(!1,r);return e.parsers.unshift(new kM.default),e.parsers.unshift(new EM.default),e.parsers.unshift(new IM.default),e}vt.createCasualConfiguration=fg;function Md(r=!0,e=!0){return DM.includeCommonConfiguration({parsers:[new SM.default(e),new AM.default,new OM.default,new PM.default,new NM.default,new CM.default,new xM.default],refiners:[new MM.default,new RM.default]},r)}vt.createConfiguration=Md});var pg=O(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.toHankaku=void 0;function YM(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,UM)}zo.toHankaku=YM;function UM(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var yg=O(ua=>{"use strict";var WM=ua&&ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ua,"__esModule",{value:!0});var Rd=pg(),qM=Rt(),jM=WM(Re()),$M=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,mg=1,GM=2,xd=3,BM=4,HM=5,zM=6,Pd=class{pattern(){return $M}extract(e,t){let n=parseInt(Rd.toHankaku(t[HM])),s=parseInt(Rd.toHankaku(t[zM])),a=e.createParsingComponents({day:s,month:n});if(t[mg]&&t[mg].match("\u540C|\u4ECA|\u672C")){let o=jM.default(e.refDate);a.assign("year",o.year())}if(t[GM]){let o=t[BM],l=o=="\u5143"?1:parseInt(Rd.toHankaku(o));t[xd]=="\u4EE4\u548C"?l+=2018:t[xd]=="\u5E73\u6210"?l+=1988:t[xd]=="\u662D\u548C"&&(l+=1925),a.assign("year",l)}else{let o=qM.findYearClosestToRef(e.refDate,s,n);a.imply("year",o)}return a}};ua.default=Pd});var gg=O(la=>{"use strict";var VM=la&&la.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(la,"__esModule",{value:!0});var KM=VM(jr()),Ad=class extends KM.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};la.default=Ad});var Tg=O(Cr=>{"use strict";var ZM=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),XM=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),QM=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ZM(e,r,t);return XM(e,r),e},JM=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var eR=JM(Re()),_g=pt(),Nd=QM(fn()),tR=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Cd=class{pattern(){return tR}extract(e,t){let n=t[0],s=eR.default(e.refDate),a=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Nd.yesterday(e.reference);case"\u660E\u65E5":return Nd.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Nd.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(a.imply("hour",22),a.assign("meridiem",_g.Meridiem.PM)):n.match("\u4ECA\u671D")&&(a.imply("hour",6),a.assign("meridiem",_g.Meridiem.AM)),a.assign("day",s.date()),a.assign("month",s.month()+1),a.assign("year",s.year()),a}};Cr.default=Cd});var wg=O(wt=>{"use strict";var Id=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0});wt.createConfiguration=wt.createCasualConfiguration=wt.parseDate=wt.parse=wt.strict=wt.casual=void 0;var rR=Id(yg()),nR=Id(gg()),sR=Id(Tg()),bg=xr();wt.casual=new bg.Chrono(vg());wt.strict=new bg.Chrono(Fd());function iR(r,e,t){return wt.casual.parse(r,e,t)}wt.parse=iR;function aR(r,e,t){return wt.casual.parseDate(r,e,t)}wt.parseDate=aR;function vg(){let r=Fd();return r.parsers.unshift(new sR.default),r}wt.createCasualConfiguration=vg;function Fd(){return{parsers:[new rR.default],refiners:[new nR.default]}}wt.createConfiguration=Fd});var Vo=O(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.parseYear=Gr.YEAR_PATTERN=Gr.MONTH_DICTIONARY=Gr.WEEKDAY_DICTIONARY=void 0;Gr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Gr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Gr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function oR(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Gr.parseYear=oR});var kg=O(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Dg=Vo(),uR=Ie(),lR=Z(),cR=fs(),dR=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${uR.matchAnyPattern(Dg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),fR=1,hR=2,pR=3,Ld=class extends lR.AbstractParserWithWordBoundaryChecking{innerPattern(){return dR}innerExtract(e,t){let n=t[hR].toLowerCase(),s=Dg.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[fR],o=t[pR],l=a||o||"";l=l.toLowerCase();let c=null;l=="passado"?c="this":l=="pr\xF3ximo"||l=="proximo"?c="next":l=="este"&&(c="this");let h=cR.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};Yd.default=Ld});var Eg=O(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var mR=cs(),Ud=class extends mR.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Wd.default=Ud});var Sg=O(ca=>{"use strict";var yR=ca&&ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ca,"__esModule",{value:!0});var gR=yR(ln()),qd=class extends gR.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};ca.default=qd});var Og=O(da=>{"use strict";var _R=da&&da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(da,"__esModule",{value:!0});var TR=_R(jr()),jd=class extends TR.default{patternBetween(){return/^\s*(?:-)\s*$/i}};da.default=jd});var Ng=O(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var bR=Rt(),Pg=Vo(),Ag=Vo(),vR=Ie(),wR=Z(),DR=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${vR.matchAnyPattern(Pg.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Ag.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Mg=1,Rg=2,kR=3,xg=4,$d=class extends wR.AbstractParserWithWordBoundaryChecking{innerPattern(){return DR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Pg.MONTH_DICTIONARY[t[kR].toLowerCase()],a=parseInt(t[Mg]);if(a>31)return t.index=t.index+t[Mg].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[xg]){let o=Ag.parseYear(t[xg]);n.start.assign("year",o)}else{let o=bR.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Rg]){let o=parseInt(t[Rg]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Gd.default=$d});var Cg=O(hn=>{"use strict";var ER=hn&&hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),SR=hn&&hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),OR=hn&&hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ER(e,r,t);return SR(e,r),e};Object.defineProperty(hn,"__esModule",{value:!0});var MR=Z(),Ko=OR(fn()),Bd=class extends MR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"agora":return Ko.now(e.reference);case"hoje":return Ko.today(e.reference);case"amanha":case"amanh\xE3":return Ko.tomorrow(e.reference);case"ontem":return Ko.yesterday(e.reference)}return s}};hn.default=Bd});var Ig=O(fa=>{"use strict";var RR=fa&&fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fa,"__esModule",{value:!0});var Zo=pt(),xR=Z(),PR=mr(),AR=RR(Re()),Hd=class extends xR.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=AR.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":s.imply("meridiem",Zo.Meridiem.PM),s.imply("hour",15);break;case"noite":s.imply("meridiem",Zo.Meridiem.PM),s.imply("hour",22);break;case"manha":case"manh\xE3":s.imply("meridiem",Zo.Meridiem.AM),s.imply("hour",6);break;case"meia-noite":PR.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"meio-dia":s.imply("meridiem",Zo.Meridiem.AM),s.imply("hour",12);break}return s}};fa.default=Hd});var Yg=O(Dt=>{"use strict";var qn=Dt&&Dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.createConfiguration=Dt.createCasualConfiguration=Dt.parseDate=Dt.parse=Dt.strict=Dt.casual=void 0;var NR=cn(),Fg=xr(),CR=qn(hs()),IR=qn(kg()),FR=qn(Eg()),LR=qn(Sg()),YR=qn(Og()),UR=qn(Ng()),WR=qn(Cg()),qR=qn(Ig());Dt.casual=new Fg.Chrono(Lg());Dt.strict=new Fg.Chrono(zd(!0));function jR(r,e,t){return Dt.casual.parse(r,e,t)}Dt.parse=jR;function $R(r,e,t){return Dt.casual.parseDate(r,e,t)}Dt.parseDate=$R;function Lg(r=!0){let e=zd(!1,r);return e.parsers.push(new WR.default),e.parsers.push(new qR.default),e}Dt.createCasualConfiguration=Lg;function zd(r=!0,e=!0){return NR.includeCommonConfiguration({parsers:[new CR.default(e),new IR.default,new FR.default,new UR.default],refiners:[new LR.default,new YR.default]},r)}Dt.createConfiguration=zd});var Ug=O(ha=>{"use strict";var GR=ha&&ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ha,"__esModule",{value:!0});var BR=GR(jr()),Vd=class extends BR.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};ha.default=Vd});var Wg=O(pa=>{"use strict";var HR=pa&&pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pa,"__esModule",{value:!0});var zR=HR(ln()),Kd=class extends zR.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};pa.default=Kd});var qg=O(pn=>{"use strict";var VR=pn&&pn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),KR=pn&&pn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ZR=pn&&pn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&VR(e,r,t);return KR(e,r),e};Object.defineProperty(pn,"__esModule",{value:!0});var XR=Z(),Xo=ZR(fn()),Zd=class extends XR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"nu":return Xo.now(e.reference);case"vandaag":return Xo.today(e.reference);case"morgen":case"morgend":return Xo.tomorrow(e.reference);case"gisteren":return Xo.yesterday(e.reference)}return s}};pn.default=Zd});var jg=O(ma=>{"use strict";var QR=ma&&ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ma,"__esModule",{value:!0});var Qo=pt(),JR=Z(),ex=QR(Re()),tx=mr(),rx=1,nx=2,Xd=class extends JR.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=ex.default(e.refDate),s=e.createParsingComponents();switch(t[rx]==="deze"&&(s.assign("day",e.refDate.getDate()),s.assign("month",e.refDate.getMonth()+1),s.assign("year",e.refDate.getFullYear())),t[nx].toLowerCase()){case"namiddag":case"'s namiddags":s.imply("meridiem",Qo.Meridiem.PM),s.imply("hour",15);break;case"avond":case"'s avonds'":s.imply("meridiem",Qo.Meridiem.PM),s.imply("hour",20);break;case"middernacht":tx.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"ochtend":case"'s ochtends":s.imply("meridiem",Qo.Meridiem.AM),s.imply("hour",6);break;case"middag":case"'s middags":s.imply("meridiem",Qo.Meridiem.AM),s.imply("hour",12);break}return s}};ma.default=Xd});var tr=O(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.parseTimeUnits=ve.TIME_UNITS_PATTERN=ve.parseYear=ve.YEAR_PATTERN=ve.parseOrdinalNumberPattern=ve.ORDINAL_NUMBER_PATTERN=ve.parseNumberPattern=ve.NUMBER_PATTERN=ve.TIME_UNIT_DICTIONARY=ve.ORDINAL_WORD_DICTIONARY=ve.INTEGER_WORD_DICTIONARY=ve.MONTH_DICTIONARY=ve.WEEKDAY_DICTIONARY=void 0;var Jo=Ie(),sx=Rt();ve.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};ve.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};ve.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};ve.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};ve.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};ve.NUMBER_PATTERN=`(?:${Jo.matchAnyPattern(ve.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function Gg(r){let e=r.toLowerCase();return ve.INTEGER_WORD_DICTIONARY[e]!==void 0?ve.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}ve.parseNumberPattern=Gg;ve.ORDINAL_NUMBER_PATTERN=`(?:${Jo.matchAnyPattern(ve.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function ix(r){let e=r.toLowerCase();return ve.ORDINAL_WORD_DICTIONARY[e]!==void 0?ve.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}ve.parseOrdinalNumberPattern=ix;ve.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function ax(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return sx.findMostLikelyADYear(e)}ve.parseYear=ax;var Bg=`(${ve.NUMBER_PATTERN})\\s{0,5}(${Jo.matchAnyPattern(ve.TIME_UNIT_DICTIONARY)})\\s{0,5}`,$g=new RegExp(Bg,"i");ve.TIME_UNITS_PATTERN=Jo.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Bg);function ox(r){let e={},t=r,n=$g.exec(t);for(;n;)ux(e,n),t=t.substring(n[0].length),n=$g.exec(t);return e}ve.parseTimeUnits=ox;function ux(r,e){let t=Gg(e[1]),n=ve.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var zg=O(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var Hg=tr(),lx=tt(),cx=Z(),Qd=class extends cx.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Hg.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Hg.parseTimeUnits(t[1]);return lx.ParsingComponents.createRelativeFromReference(e.reference,n)}};Jd.default=Qd});var Kg=O(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});var Vg=tr(),dx=Ie(),fx=Z(),hx=fs(),px=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${dx.matchAnyPattern(Vg.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),mx=1,yx=2,gx=3,ef=class extends fx.AbstractParserWithWordBoundaryChecking{innerPattern(){return px}innerExtract(e,t){let n=t[yx].toLowerCase(),s=Vg.WEEKDAY_DICTIONARY[n],a=t[mx],o=t[gx],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="vorige"?c="last":l=="volgende"?c="next":l=="deze"&&(c="this");let h=hx.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};tf.default=ef});var t_=O(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var _x=Rt(),Jg=tr(),eu=tr(),e_=tr(),Tx=Ie(),bx=Z(),vx=new RegExp(`(?:on\\s*?)?(${eu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${eu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+Tx.matchAnyPattern(Jg.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${e_.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),wx=3,Zg=1,Xg=2,Qg=4,rf=class extends bx.AbstractParserWithWordBoundaryChecking{innerPattern(){return vx}innerExtract(e,t){let n=Jg.MONTH_DICTIONARY[t[wx].toLowerCase()],s=eu.parseOrdinalNumberPattern(t[Zg]);if(s>31)return t.index=t.index+t[Zg].length,null;let a=e.createParsingComponents({day:s,month:n});if(t[Qg]){let c=e_.parseYear(t[Qg]);a.assign("year",c)}else{let c=_x.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[Xg])return a;let o=eu.parseOrdinalNumberPattern(t[Xg]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};nf.default=rf});var i_=O(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});var n_=tr(),Dx=Rt(),kx=Ie(),s_=tr(),Ex=Z(),Sx=new RegExp(`(${kx.matchAnyPattern(n_.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${s_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),Ox=1,r_=2,sf=class extends Ex.AbstractParserWithWordBoundaryChecking{innerPattern(){return Sx}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let s=t[Ox],a=n_.MONTH_DICTIONARY[s.toLowerCase()];if(n.assign("month",a),t[r_]){let o=s_.parseYear(t[r_]);n.assign("year",o)}else{let o=Dx.findYearClosestToRef(e.refDate,1,a);n.imply("year",o)}return n}};af.default=sf});var a_=O(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});var Mx=Z(),Rx=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),xx=1,Px=2,of=class extends Mx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Rx}innerExtract(e,t){let n=parseInt(t[Px]),s=parseInt(t[xx]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};uf.default=of});var o_=O(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var Ax=cs(),lf=class extends Ax.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};cf.default=lf});var c_=O(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var l_=tr(),Nx=Ie(),Cx=Z(),Ix=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Nx.matchAnyPattern(l_.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Fx=1,Lx=2,u_=3,Yx=4,df=class extends Cx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ix}innerExtract(e,t){let n=t[u_]?parseInt(t[u_]):l_.MONTH_DICTIONARY[t[Lx].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[Fx]);return{day:parseInt(t[Yx]),month:n,year:s}}};ff.default=df});var d_=O(ya=>{"use strict";var Ux=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var Wx=Z(),tu=pt(),hf=mr(),qx=Ux(Re()),jx=1,$x=2,pf=class extends Wx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[jx].toLowerCase(),s=t[$x].toLowerCase(),a=e.createParsingComponents(),o=qx.default(e.refDate);switch(n){case"gisteren":hf.assignSimilarDate(a,o.add(-1,"day"));break;case"van":hf.assignSimilarDate(a,o);break;case"morgen":hf.assignTheNextDay(a,o);break}switch(s){case"ochtend":a.imply("meridiem",tu.Meridiem.AM),a.imply("hour",6);break;case"middag":a.imply("meridiem",tu.Meridiem.AM),a.imply("hour",12);break;case"namiddag":a.imply("meridiem",tu.Meridiem.PM),a.imply("hour",15);break;case"avond":a.imply("meridiem",tu.Meridiem.PM),a.imply("hour",20);break}return a}};ya.default=pf});var h_=O(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var f_=tr(),Gx=tt(),Bx=Z(),Hx=yr(),zx=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${f_.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),mf=class extends Bx.AbstractParserWithWordBoundaryChecking{innerPattern(){return zx}innerExtract(e,t){let n=t[1].toLowerCase(),s=f_.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":s=Hx.reverseTimeUnits(s);break}return Gx.ParsingComponents.createRelativeFromReference(e.reference,s)}};yf.default=mf});var y_=O(ga=>{"use strict";var Vx=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var m_=tr(),p_=tt(),Kx=Vx(Re()),Zx=Z(),Xx=Ie(),Qx=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${Xx.matchAnyPattern(m_.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),Jx=1,eP=2,gf=class extends Zx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Qx}innerExtract(e,t){let n=t[Jx].toLowerCase(),s=t[eP].toLowerCase(),a=m_.TIME_UNIT_DICTIONARY[s];if(n=="volgend"||n=="volgende"||n=="komende"){let c={};return c[a]=1,p_.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="afgelopen"||n=="vorige"){let c={};return c[a]=-1,p_.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=Kx.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/maand/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/jaar/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};ga.default=gf});var g_=O(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var Tf=tr(),tP=tt(),rP=Z(),nP=yr(),sP=new RegExp("("+Tf.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),iP=new RegExp("("+Tf.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),_f=class extends rP.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?iP:sP}innerExtract(e,t){let n=Tf.parseTimeUnits(t[1]),s=nP.reverseTimeUnits(n);return tP.ParsingComponents.createRelativeFromReference(e.reference,s)}};bf.default=_f});var __=O(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});var wf=tr(),aP=tt(),oP=Z(),uP=new RegExp("("+wf.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),lP=new RegExp("("+wf.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),cP=1,vf=class extends oP.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?lP:uP}innerExtract(e,t){let n=wf.parseTimeUnits(t[cP]);return aP.ParsingComponents.createRelativeFromReference(e.reference,n)}};Df.default=vf});var w_=O(kt=>{"use strict";var Pt=kt&&kt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kt,"__esModule",{value:!0});kt.createConfiguration=kt.createCasualConfiguration=kt.parseDate=kt.parse=kt.strict=kt.casual=void 0;var dP=cn(),T_=xr(),fP=Pt(Ug()),hP=Pt(Wg()),pP=Pt(qg()),mP=Pt(jg()),yP=Pt(hs()),gP=Pt(zg()),_P=Pt(Kg()),TP=Pt(t_()),b_=Pt(i_()),bP=Pt(a_()),vP=Pt(o_()),wP=Pt(c_()),DP=Pt(d_()),kP=Pt(h_()),EP=Pt(y_()),SP=Pt(g_()),OP=Pt(__());kt.casual=new T_.Chrono(v_());kt.strict=new T_.Chrono(kf(!0));function MP(r,e,t){return kt.casual.parse(r,e,t)}kt.parse=MP;function RP(r,e,t){return kt.casual.parseDate(r,e,t)}kt.parseDate=RP;function v_(r=!0){let e=kf(!1,r);return e.parsers.unshift(new pP.default),e.parsers.unshift(new mP.default),e.parsers.unshift(new DP.default),e.parsers.unshift(new b_.default),e.parsers.unshift(new EP.default),e.parsers.unshift(new kP.default),e}kt.createCasualConfiguration=v_;function kf(r=!0,e=!0){return dP.includeCommonConfiguration({parsers:[new yP.default(e),new gP.default,new TP.default,new b_.default,new _P.default,new wP.default,new bP.default,new vP.default(r),new SP.default(r),new OP.default(r)],refiners:[new hP.default,new fP.default]},r)}kt.createConfiguration=kf});var S_=O(_a=>{"use strict";var xP=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0});var PP=xP(Re()),AP=Z(),NP=1,D_=2,CP=3,k_=4,E_=5,IP=6,Ef=class extends AP.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=PP.default(e.refDate),o=a;if(t[NP])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[D_]){let l=t[D_],c=t[CP];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day")),c=="\u65E9"||c=="\u671D"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[k_]){let c=t[k_][0];c=="\u65E9"||c=="\u671D"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"||c=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[E_]){let l=t[E_];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day"));let c=t[IP];if(c){let h=c[0];h=="\u65E9"||h=="\u671D"||h=="\u4E0A"?s.start.imply("hour",6):h=="\u4E0B"||h=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):h=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):h=="\u591C"||h=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):h=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};_a.default=Ef});var ni=O(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.zhStringToYear=zt.zhStringToNumber=zt.WEEKDAY_OFFSET=zt.NUMBER=void 0;zt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};zt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function FP(r){let e=0;for(let t=0;t{"use strict";var YP=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var UP=YP(Re()),WP=Z(),ys=ni(),Sf=1,O_=2,Of=3,Mf=class extends WP.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ys.NUMBER).join("")+"]{4}|["+Object.keys(ys.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ys.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ys.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=UP.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[O_]);if(isNaN(a)&&(a=ys.zhStringToNumber(t[O_])),s.start.assign("month",a),t[Of]){let o=parseInt(t[Of]);isNaN(o)&&(o=ys.zhStringToNumber(t[Of])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[Sf]){let o=parseInt(t[Sf]);isNaN(o)&&(o=ys.zhStringToYear(t[Sf])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};Ta.default=Mf});var x_=O(ba=>{"use strict";var qP=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var jP=qP(Re()),$P=Z(),R_=ni(),GP=new RegExp("(\\d+|["+Object.keys(R_.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Rf=1,BP=2,xf=class extends $P.AbstractParserWithWordBoundaryChecking{innerPattern(){return GP}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Rf]);if(isNaN(s)&&(s=R_.zhStringToNumber(t[Rf])),isNaN(s)){let c=t[Rf];if(c==="\u5E7E")s=3;else if(c==="\u534A")s=.5;else return null}let a=jP.default(e.refDate),l=t[BP][0];return l.match(/[日天星禮月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u79AE"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u9418")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};ba.default=xf});var A_=O(va=>{"use strict";var HP=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var zP=HP(Re()),VP=Z(),P_=ni(),KP=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(P_.WEEKDAY_OFFSET).join("|")+")"),Pf=class extends VP.AbstractParserWithWordBoundaryChecking{innerPattern(){return KP}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=P_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":(l=="\u4ECA"||l=="\u9019"||l=="\u5462")&&(o="this");let c=zP.default(e.refDate),h=!1,m=c.day();return o=="last"||o=="past"?(c=c.day(a-7),h=!0):o=="next"?(c=c.day(a+7),h=!0):o=="this"?c=c.day(a):Math.abs(a-7-m){"use strict";var ZP=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var XP=ZP(Re()),QP=Z(),Tr=ni(),JP=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Tr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),eA=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Tr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),ru=1,nu=2,su=3,iu=4,au=5,ou=6,_r=7,si=8,uu=9,Af=class extends QP.AbstractParserWithWordBoundaryChecking{innerPattern(){return JP}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=XP.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[ru]){var o=t[ru];o=="\u660E"||o=="\u807D"?n.hour()>1&&a.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a.add(-1,"day"):o=="\u524D"?a.add(-2,"day"):o=="\u5927\u524D"?a.add(-3,"day"):o=="\u5F8C"?a.add(2,"day"):o=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[iu]){var l=t[iu];l=="\u660E"||l=="\u807D"?a.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?a.add(-1,"day"):l=="\u524D"?a.add(-2,"day"):l=="\u5927\u524D"?a.add(-3,"day"):l=="\u5F8C"?a.add(2,"day"):l=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let c=0,h=0,m=-1;if(t[si]){var g=parseInt(t[si]);if(isNaN(g)&&(g=Tr.zhStringToNumber(t[si])),g>=60)return null;s.start.assign("second",g)}if(c=parseInt(t[ou]),isNaN(c)&&(c=Tr.zhStringToNumber(t[ou])),t[_r]?t[_r]=="\u534A"?h=30:t[_r]=="\u6B63"||t[_r]=="\u6574"?h=0:(h=parseInt(t[_r]),isNaN(h)&&(h=Tr.zhStringToNumber(t[_r]))):c>100&&(h=c%100,c=Math.floor(c/100)),h>=60||c>24)return null;if(c>=12&&(m=1),t[uu]){if(c>12)return null;var T=t[uu][0].toLowerCase();T=="a"&&(m=0,c==12&&(c=0)),T=="p"&&(m=1,c!=12&&(c+=12))}else if(t[nu]){var S=t[nu],v=S[0];v=="\u671D"||v=="\u65E9"?(m=0,c==12&&(c=0)):v=="\u665A"&&(m=1,c!=12&&(c+=12))}else if(t[su]){var R=t[su],C=R[0];C=="\u4E0A"||C=="\u671D"||C=="\u65E9"||C=="\u51CC"?(m=0,c==12&&(c=0)):(C=="\u4E0B"||C=="\u664F"||C=="\u665A")&&(m=1,c!=12&&(c+=12))}else if(t[au]){var $=t[au],B=$[0];B=="\u4E0A"||B=="\u671D"||B=="\u65E9"||B=="\u51CC"?(m=0,c==12&&(c=0)):(B=="\u4E0B"||B=="\u664F"||B=="\u665A")&&(m=1,c!=12&&(c+=12))}if(s.start.assign("hour",c),s.start.assign("minute",h),m>=0?s.start.assign("meridiem",m):c<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=eA.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let W=a.clone();if(s.end=e.createParsingComponents(),t[ru]){var o=t[ru];o=="\u660E"||o=="\u807D"?n.hour()>1&&W.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?W.add(-1,"day"):o=="\u524D"?W.add(-2,"day"):o=="\u5927\u524D"?W.add(-3,"day"):o=="\u5F8C"?W.add(2,"day"):o=="\u5927\u5F8C"&&W.add(3,"day"),s.end.assign("day",W.date()),s.end.assign("month",W.month()+1),s.end.assign("year",W.year())}else if(t[iu]){var l=t[iu];l=="\u660E"||l=="\u807D"?W.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?W.add(-1,"day"):l=="\u524D"?W.add(-2,"day"):l=="\u5927\u524D"?W.add(-3,"day"):l=="\u5F8C"?W.add(2,"day"):l=="\u5927\u5F8C"&&W.add(3,"day"),s.end.assign("day",W.date()),s.end.assign("month",W.month()+1),s.end.assign("year",W.year())}else s.end.imply("day",W.date()),s.end.imply("month",W.month()+1),s.end.imply("year",W.year());if(c=0,h=0,m=-1,t[si]){var g=parseInt(t[si]);if(isNaN(g)&&(g=Tr.zhStringToNumber(t[si])),g>=60)return null;s.end.assign("second",g)}if(c=parseInt(t[ou]),isNaN(c)&&(c=Tr.zhStringToNumber(t[ou])),t[_r]?t[_r]=="\u534A"?h=30:t[_r]=="\u6B63"||t[_r]=="\u6574"?h=0:(h=parseInt(t[_r]),isNaN(h)&&(h=Tr.zhStringToNumber(t[_r]))):c>100&&(h=c%100,c=Math.floor(c/100)),h>=60||c>24)return null;if(c>=12&&(m=1),t[uu]){if(c>12)return null;var T=t[uu][0].toLowerCase();T=="a"&&(m=0,c==12&&(c=0)),T=="p"&&(m=1,c!=12&&(c+=12)),s.start.isCertain("meridiem")||(m==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[nu]){var S=t[nu],v=S[0];v=="\u671D"||v=="\u65E9"?(m=0,c==12&&(c=0)):v=="\u665A"&&(m=1,c!=12&&(c+=12))}else if(t[su]){var R=t[su],C=R[0];C=="\u4E0A"||C=="\u671D"||C=="\u65E9"||C=="\u51CC"?(m=0,c==12&&(c=0)):(C=="\u4E0B"||C=="\u664F"||C=="\u665A")&&(m=1,c!=12&&(c+=12))}else if(t[au]){var $=t[au],B=$[0];B=="\u4E0A"||B=="\u671D"||B=="\u65E9"||B=="\u51CC"?(m=0,c==12&&(c=0)):(B=="\u4E0B"||B=="\u664F"||B=="\u665A")&&(m=1,c!=12&&(c+=12))}return s.text=s.text+t[0],s.end.assign("hour",c),s.end.assign("minute",h),m>=0?s.end.assign("meridiem",m):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>c?s.end.imply("meridiem",0):c>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var tA=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var rA=tA(Re()),nA=Z(),C_=ni(),sA=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(C_.WEEKDAY_OFFSET).join("|")+")"),Nf=class extends nA.AbstractParserWithWordBoundaryChecking{innerPattern(){return sA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=C_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=rA.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var iA=ka&&ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ka,"__esModule",{value:!0});var aA=iA(jr()),Cf=class extends aA.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};ka.default=Cf});var L_=O(Ea=>{"use strict";var oA=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var uA=oA(ln()),If=class extends uA.default{patternBetween(){return/^\s*$/i}};Ea.default=If});var Y_=O(ot=>{"use strict";var mn=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.createConfiguration=ot.createCasualConfiguration=ot.parseDate=ot.parse=ot.strict=ot.casual=ot.hant=void 0;var Ff=xr(),lA=mn(Yo()),cA=cn(),dA=mn(S_()),fA=mn(M_()),hA=mn(x_()),pA=mn(A_()),mA=mn(N_()),yA=mn(I_()),gA=mn(F_()),_A=mn(L_());ot.hant=new Ff.Chrono(Lf());ot.casual=new Ff.Chrono(Lf());ot.strict=new Ff.Chrono(Yf());function TA(r,e,t){return ot.casual.parse(r,e,t)}ot.parse=TA;function bA(r,e,t){return ot.casual.parseDate(r,e,t)}ot.parseDate=bA;function Lf(){let r=Yf();return r.parsers.unshift(new dA.default),r}ot.createCasualConfiguration=Lf;function Yf(){let r=cA.includeCommonConfiguration({parsers:[new fA.default,new pA.default,new yA.default,new mA.default,new hA.default],refiners:[new gA.default,new _A.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof lA.default)),r}ot.createConfiguration=Yf});var j_=O(Sa=>{"use strict";var vA=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var wA=vA(Re()),DA=Z(),kA=1,U_=2,EA=3,W_=4,q_=5,SA=6,Uf=class extends DA.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=wA.default(e.refDate),o=a;if(t[kA])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[U_]){let l=t[U_],c=t[EA];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day")),c=="\u65E9"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[W_]){let c=t[W_][0];c=="\u65E9"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[q_]){let l=t[q_];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day"));let c=t[SA];if(c){let h=c[0];h=="\u65E9"||h=="\u4E0A"?s.start.imply("hour",6):h=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):h=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):h=="\u591C"||h=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):h=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};Sa.default=Uf});var ii=O(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.zhStringToYear=Vt.zhStringToNumber=Vt.WEEKDAY_OFFSET=Vt.NUMBER=void 0;Vt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Vt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function OA(r){let e=0;for(let t=0;t{"use strict";var RA=Oa&&Oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oa,"__esModule",{value:!0});var xA=RA(Re()),PA=Z(),gs=ii(),Wf=1,$_=2,qf=3,jf=class extends PA.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(gs.NUMBER).join("")+"]{4}|["+Object.keys(gs.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(gs.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(gs.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=xA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[$_]);if(isNaN(a)&&(a=gs.zhStringToNumber(t[$_])),s.start.assign("month",a),t[qf]){let o=parseInt(t[qf]);isNaN(o)&&(o=gs.zhStringToNumber(t[qf])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[Wf]){let o=parseInt(t[Wf]);isNaN(o)&&(o=gs.zhStringToYear(t[Wf])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};Oa.default=jf});var H_=O(Ma=>{"use strict";var AA=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var NA=AA(Re()),CA=Z(),B_=ii(),IA=new RegExp("(\\d+|["+Object.keys(B_.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),$f=1,FA=2,Gf=class extends CA.AbstractParserWithWordBoundaryChecking{innerPattern(){return IA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[$f]);if(isNaN(s)&&(s=B_.zhStringToNumber(t[$f])),isNaN(s)){let c=t[$f];if(c==="\u51E0")s=3;else if(c==="\u534A")s=.5;else return null}let a=NA.default(e.refDate),l=t[FA][0];return l.match(/[日天星礼月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u793C"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u949F")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};Ma.default=Gf});var V_=O(Ra=>{"use strict";var LA=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var YA=LA(Re()),UA=Z(),z_=ii(),WA=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(z_.WEEKDAY_OFFSET).join("|")+")"),Bf=class extends UA.AbstractParserWithWordBoundaryChecking{innerPattern(){return WA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=z_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":l=="\u8FD9"&&(o="this");let c=YA.default(e.refDate),h=!1,m=c.day();return o=="last"||o=="past"?(c=c.day(a-7),h=!0):o=="next"?(c=c.day(a+7),h=!0):o=="this"?c=c.day(a):Math.abs(a-7-m){"use strict";var qA=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var jA=qA(Re()),$A=Z(),vr=ii(),GA=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(vr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(vr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(vr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),BA=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(vr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(vr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(vr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),lu=1,cu=2,du=3,fu=4,hu=5,pu=6,br=7,ai=8,mu=9,Hf=class extends $A.AbstractParserWithWordBoundaryChecking{innerPattern(){return GA}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=jA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[lu]){let m=t[lu];m=="\u660E"?n.hour()>1&&a.add(1,"day"):m=="\u6628"?a.add(-1,"day"):m=="\u524D"?a.add(-2,"day"):m=="\u5927\u524D"?a.add(-3,"day"):m=="\u540E"?a.add(2,"day"):m=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[fu]){let m=t[fu];m=="\u660E"?a.add(1,"day"):m=="\u6628"?a.add(-1,"day"):m=="\u524D"?a.add(-2,"day"):m=="\u5927\u524D"?a.add(-3,"day"):m=="\u540E"?a.add(2,"day"):m=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let o=0,l=0,c=-1;if(t[ai]){let m=parseInt(t[ai]);if(isNaN(m)&&(m=vr.zhStringToNumber(t[ai])),m>=60)return null;s.start.assign("second",m)}if(o=parseInt(t[pu]),isNaN(o)&&(o=vr.zhStringToNumber(t[pu])),t[br]?t[br]=="\u534A"?l=30:t[br]=="\u6B63"||t[br]=="\u6574"?l=0:(l=parseInt(t[br]),isNaN(l)&&(l=vr.zhStringToNumber(t[br]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[mu]){if(o>12)return null;let m=t[mu][0].toLowerCase();m=="a"&&(c=0,o==12&&(o=0)),m=="p"&&(c=1,o!=12&&(o+=12))}else if(t[cu]){let g=t[cu][0];g=="\u65E9"?(c=0,o==12&&(o=0)):g=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[du]){let g=t[du][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[hu]){let g=t[hu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}if(s.start.assign("hour",o),s.start.assign("minute",l),c>=0?s.start.assign("meridiem",c):o<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=BA.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let h=a.clone();if(s.end=e.createParsingComponents(),t[lu]){let m=t[lu];m=="\u660E"?n.hour()>1&&h.add(1,"day"):m=="\u6628"?h.add(-1,"day"):m=="\u524D"?h.add(-2,"day"):m=="\u5927\u524D"?h.add(-3,"day"):m=="\u540E"?h.add(2,"day"):m=="\u5927\u540E"&&h.add(3,"day"),s.end.assign("day",h.date()),s.end.assign("month",h.month()+1),s.end.assign("year",h.year())}else if(t[fu]){let m=t[fu];m=="\u660E"?h.add(1,"day"):m=="\u6628"?h.add(-1,"day"):m=="\u524D"?h.add(-2,"day"):m=="\u5927\u524D"?h.add(-3,"day"):m=="\u540E"?h.add(2,"day"):m=="\u5927\u540E"&&h.add(3,"day"),s.end.assign("day",h.date()),s.end.assign("month",h.month()+1),s.end.assign("year",h.year())}else s.end.imply("day",h.date()),s.end.imply("month",h.month()+1),s.end.imply("year",h.year());if(o=0,l=0,c=-1,t[ai]){let m=parseInt(t[ai]);if(isNaN(m)&&(m=vr.zhStringToNumber(t[ai])),m>=60)return null;s.end.assign("second",m)}if(o=parseInt(t[pu]),isNaN(o)&&(o=vr.zhStringToNumber(t[pu])),t[br]?t[br]=="\u534A"?l=30:t[br]=="\u6B63"||t[br]=="\u6574"?l=0:(l=parseInt(t[br]),isNaN(l)&&(l=vr.zhStringToNumber(t[br]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[mu]){if(o>12)return null;let m=t[mu][0].toLowerCase();m=="a"&&(c=0,o==12&&(o=0)),m=="p"&&(c=1,o!=12&&(o+=12)),s.start.isCertain("meridiem")||(c==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[cu]){let g=t[cu][0];g=="\u65E9"?(c=0,o==12&&(o=0)):g=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[du]){let g=t[du][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[hu]){let g=t[hu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}return s.text=s.text+t[0],s.end.assign("hour",o),s.end.assign("minute",l),c>=0?s.end.assign("meridiem",c):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>o?s.end.imply("meridiem",0):o>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var HA=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var zA=HA(Re()),VA=Z(),Z_=ii(),KA=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(Z_.WEEKDAY_OFFSET).join("|")+")"),zf=class extends VA.AbstractParserWithWordBoundaryChecking{innerPattern(){return KA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=Z_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=zA.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var ZA=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var XA=ZA(jr()),Vf=class extends XA.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};Aa.default=Vf});var J_=O(Na=>{"use strict";var QA=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var JA=QA(ln()),Kf=class extends JA.default{patternBetween(){return/^\s*$/i}};Na.default=Kf});var eT=O(ut=>{"use strict";var yn=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});ut.createConfiguration=ut.createCasualConfiguration=ut.parseDate=ut.parse=ut.strict=ut.casual=ut.hans=void 0;var Zf=xr(),eN=yn(Yo()),tN=cn(),rN=yn(j_()),nN=yn(G_()),sN=yn(H_()),iN=yn(V_()),aN=yn(K_()),oN=yn(X_()),uN=yn(Q_()),lN=yn(J_());ut.hans=new Zf.Chrono(Xf());ut.casual=new Zf.Chrono(Xf());ut.strict=new Zf.Chrono(Qf());function cN(r,e,t){return ut.casual.parse(r,e,t)}ut.parse=cN;function dN(r,e,t){return ut.casual.parseDate(r,e,t)}ut.parseDate=dN;function Xf(){let r=Qf();return r.parsers.unshift(new rN.default),r}ut.createCasualConfiguration=Xf;function Qf(){let r=tN.includeCommonConfiguration({parsers:[new nN.default,new iN.default,new oN.default,new aN.default,new sN.default],refiners:[new uN.default,new lN.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof eN.default)),r}ut.createConfiguration=Qf});var rT=O(rr=>{"use strict";var tT=rr&&rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fN=rr&&rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),hN=rr&&rr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tT(e,r,t)},pN=rr&&rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&tT(e,r,t);return fN(e,r),e};Object.defineProperty(rr,"__esModule",{value:!0});rr.hans=void 0;hN(Y_(),rr);rr.hans=pN(eT())});var Kt=O(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.parseTimeUnits=de.TIME_UNITS_PATTERN=de.parseYear=de.YEAR_PATTERN=de.parseOrdinalNumberPattern=de.ORDINAL_NUMBER_PATTERN=de.parseNumberPattern=de.NUMBER_PATTERN=de.TIME_UNIT_DICTIONARY=de.ORDINAL_WORD_DICTIONARY=de.INTEGER_WORD_DICTIONARY=de.MONTH_DICTIONARY=de.FULL_MONTH_NAME_DICTIONARY=de.WEEKDAY_DICTIONARY=de.REGEX_PARTS=void 0;var yu=Ie(),mN=Rt();de.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};de.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};de.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};de.MONTH_DICTIONARY=Object.assign(Object.assign({},de.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});de.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};de.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};de.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};de.NUMBER_PATTERN=`(?:${yu.matchAnyPattern(de.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function sT(r){let e=r.toLowerCase();return de.INTEGER_WORD_DICTIONARY[e]!==void 0?de.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}de.parseNumberPattern=sT;de.ORDINAL_NUMBER_PATTERN=`(?:${yu.matchAnyPattern(de.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function yN(r){let e=r.toLowerCase();return de.ORDINAL_WORD_DICTIONARY[e]!==void 0?de.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}de.parseOrdinalNumberPattern=yN;var Jf="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";de.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${Jf}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${Jf}|[5-9][0-9]${Jf})`;function gN(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return mN.findMostLikelyADYear(e)}de.parseYear=gN;var iT=`(${de.NUMBER_PATTERN})\\s{0,3}(${yu.matchAnyPattern(de.TIME_UNIT_DICTIONARY)})`,nT=new RegExp(iT,"i");de.TIME_UNITS_PATTERN=yu.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",iT);function _N(r){let e={},t=r,n=nT.exec(t);for(;n;)TN(e,n),t=t.substring(n[0].length).trim(),n=nT.exec(t);return e}de.parseTimeUnits=_N;function TN(r,e){let t=sT(e[1]),n=de.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var oT=O(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var Ca=Kt(),bN=tt(),vN=Z(),aT=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Ca.TIME_UNITS_PATTERN})${Ca.REGEX_PARTS.rightBoundary}`,wN=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${aT}`,Ca.REGEX_PARTS.flags),DN=new RegExp(aT,"i"),eh=class extends vN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ca.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?DN:wN}innerExtract(e,t){let n=Ca.parseTimeUnits(t[1]);return bN.ParsingComponents.createRelativeFromReference(e.reference,n)}};th.default=eh});var fT=O(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var kN=Rt(),Ia=Kt(),dT=Kt(),gu=Kt(),EN=Ie(),SN=Z(),ON=new RegExp(`(?:\u0441)?\\s*(${gu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${gu.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${EN.matchAnyPattern(Ia.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${dT.YEAR_PATTERN}(?![^\\s]\\d)))?${Ia.REGEX_PARTS.rightBoundary}`,Ia.REGEX_PARTS.flags),uT=1,lT=2,MN=3,cT=4,rh=class extends SN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ia.REGEX_PARTS.leftBoundary}innerPattern(){return ON}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Ia.MONTH_DICTIONARY[t[MN].toLowerCase()],a=gu.parseOrdinalNumberPattern(t[uT]);if(a>31)return t.index=t.index+t[uT].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[cT]){let o=dT.parseYear(t[cT]);n.start.assign("year",o)}else{let o=kN.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[lT]){let o=gu.parseOrdinalNumberPattern(t[lT]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};nh.default=rh});var mT=O(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var Fa=Kt(),RN=Rt(),xN=Ie(),pT=Kt(),PN=Z(),AN=new RegExp(`((?:\u0432)\\s*)?(${xN.matchAnyPattern(Fa.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${pT.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,Fa.REGEX_PARTS.flags),NN=2,hT=3,sh=class extends PN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Fa.REGEX_PARTS.leftBoundary}innerPattern(){return AN}innerExtract(e,t){let n=t[NN].toLowerCase();if(t[0].length<=3&&!Fa.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index,t.index+t[0].length);s.start.imply("day",1);let a=Fa.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[hT]){let o=pT.parseYear(t[hT]);s.start.assign("year",o)}else{let o=RN.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};ih.default=sh});var gT=O(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var _u=pt(),CN=cs(),yT=Kt(),ah=class extends CN.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return yT.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${yT.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",_u.Meridiem.PM)):s<6&&n.assign("meridiem",_u.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",_u.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",_u.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};oh.default=ah});var _T=O(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var Tu=Kt(),IN=tt(),FN=Z(),LN=yr(),YN=new RegExp(`(${Tu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Tu.REGEX_PARTS.flags),uh=class extends FN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Tu.REGEX_PARTS.leftBoundary}innerPattern(){return YN}innerExtract(e,t){let n=Tu.parseTimeUnits(t[1]),s=LN.reverseTimeUnits(n);return IN.ParsingComponents.createRelativeFromReference(e.reference,s)}};lh.default=uh});var TT=O(La=>{"use strict";var UN=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var WN=UN(jr()),ch=class extends WN.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};La.default=ch});var bT=O(Ya=>{"use strict";var qN=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var jN=qN(ln()),dh=class extends jN.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};Ya.default=dh});var vT=O(gn=>{"use strict";var $N=gn&&gn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),GN=gn&&gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),BN=gn&&gn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$N(e,r,t);return GN(e,r),e};Object.defineProperty(gn,"__esModule",{value:!0});var HN=Z(),Ua=BN(fn()),fh=Kt(),zN=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${fh.REGEX_PARTS.rightBoundary}`,fh.REGEX_PARTS.flags),hh=class extends HN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return fh.REGEX_PARTS.leftBoundary}innerPattern(e){return zN}innerExtract(e,t){let n=t[1].toLowerCase(),s=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return Ua.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return Ua.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return Ua.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Ua.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Ua.theDayBefore(e.reference,2)}return s}};gn.default=hh});var wT=O(Ir=>{"use strict";var VN=Ir&&Ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),KN=Ir&&Ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ZN=Ir&&Ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&VN(e,r,t);return KN(e,r),e},XN=Ir&&Ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ir,"__esModule",{value:!0});var QN=Z(),_s=ZN(fn()),JN=mr(),eC=XN(Re()),ph=Kt(),tC=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${ph.REGEX_PARTS.rightBoundary}`,ph.REGEX_PARTS.flags),mh=class extends QN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ph.REGEX_PARTS.leftBoundary}innerPattern(){return tC}innerExtract(e,t){let n=eC.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();if(s==="\u0441\u0435\u0439\u0447\u0430\u0441")return _s.now(e.reference);if(s==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||s==="\u0432\u0435\u0447\u0435\u0440\u0430")return _s.evening(e.reference);if(s.endsWith("\u0443\u0442\u0440\u043E\u043C")||s.endsWith("\u0443\u0442\u0440\u0430"))return _s.morning(e.reference);if(s.match(/в\s*полдень/))return _s.noon(e.reference);if(s.match(/прошлой\s*ночью/))return _s.lastNight(e.reference);if(s.match(/прошлым\s*вечером/))return _s.yesterdayEvening(e.reference);if(s.match(/следующей\s*ночью/)){let o=n.hour()<22?1:2;n=n.add(o,"day"),JN.assignSimilarDate(a,n),a.imply("hour",0)}return s.match(/в\s*полночь/)||s.endsWith("\u043D\u043E\u0447\u044C\u044E")?_s.midnight(e.reference):a}};Ir.default=mh});var DT=O(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var Wa=Kt(),rC=Ie(),nC=Z(),sC=fs(),iC=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${rC.matchAnyPattern(Wa.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${Wa.REGEX_PARTS.rightBoundary}`,Wa.REGEX_PARTS.flags),aC=1,oC=2,uC=3,yh=class extends nC.AbstractParserWithWordBoundaryChecking{innerPattern(){return iC}patternLeftBoundary(){return Wa.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[oC].toLowerCase(),s=Wa.WEEKDAY_DICTIONARY[n],a=t[aC],o=t[uC],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||l=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||l=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?c="last":l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?c="next":(l=="\u044D\u0442\u043E\u0442"||l=="\u044D\u0442\u0443"||l=="\u044D\u0442\u043E\u0439")&&(c="this");let h=sC.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};gh.default=yh});var ET=O(ja=>{"use strict";var lC=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var qa=Kt(),kT=tt(),cC=lC(Re()),dC=Z(),fC=Ie(),hC=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${fC.matchAnyPattern(qa.TIME_UNIT_DICTIONARY)})(?=\\s*)${qa.REGEX_PARTS.rightBoundary}`,qa.REGEX_PARTS.flags),pC=1,mC=2,_h=class extends dC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return qa.REGEX_PARTS.leftBoundary}innerPattern(){return hC}innerExtract(e,t){let n=t[pC].toLowerCase(),s=t[mC].toLowerCase(),a=qa.TIME_UNIT_DICTIONARY[s];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let c={};return c[a]=1,kT.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let c={};return c[a]=-1,kT.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=cC.default(e.reference.instant);return a.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):a.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):a.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};ja.default=_h});var ST=O(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var $a=Kt(),yC=tt(),gC=Z(),_C=yr(),TC=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${$a.TIME_UNITS_PATTERN})${$a.REGEX_PARTS.rightBoundary}`,$a.REGEX_PARTS.flags),Th=class extends gC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return $a.REGEX_PARTS.leftBoundary}innerPattern(){return TC}innerExtract(e,t){let n=t[1].toLowerCase(),s=$a.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":s=_C.reverseTimeUnits(s);break}return yC.ParsingComponents.createRelativeFromReference(e.reference,s)}};bh.default=Th});var RT=O(Et=>{"use strict";var nr=Et&&Et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Et,"__esModule",{value:!0});Et.createConfiguration=Et.createCasualConfiguration=Et.parseDate=Et.parse=Et.strict=Et.casual=void 0;var bC=nr(oT()),vC=nr(fT()),wC=nr(mT()),DC=nr(gT()),kC=nr(_T()),EC=nr(TT()),SC=nr(bT()),OC=cn(),MC=nr(vT()),RC=nr(wT()),xC=nr(DT()),PC=nr(ET()),OT=xr(),AC=nr(hs()),NC=nr(ST());Et.casual=new OT.Chrono(MT());Et.strict=new OT.Chrono(vh(!0));function CC(r,e,t){return Et.casual.parse(r,e,t)}Et.parse=CC;function IC(r,e,t){return Et.casual.parseDate(r,e,t)}Et.parseDate=IC;function MT(){let r=vh(!1);return r.parsers.unshift(new MC.default),r.parsers.unshift(new RC.default),r.parsers.unshift(new wC.default),r.parsers.unshift(new PC.default),r.parsers.unshift(new NC.default),r}Et.createCasualConfiguration=MT;function vh(r=!0){return OC.includeCommonConfiguration({parsers:[new AC.default(!0),new bC.default,new vC.default,new xC.default,new DC.default(r),new kC.default],refiners:[new SC.default,new EC.default]},r)}Et.createConfiguration=vh});var pt=O(ge=>{"use strict";var FC=ge&&ge.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),LC=ge&&ge.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),jn=ge&&ge.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&FC(e,r,t);return LC(e,r),e};Object.defineProperty(ge,"__esModule",{value:!0});ge.parseDate=ge.parse=ge.casual=ge.strict=ge.ru=ge.zh=ge.nl=ge.pt=ge.ja=ge.fr=ge.de=ge.Meridiem=ge.Chrono=ge.en=void 0;var wh=jn(Yc());ge.en=wh;var YC=xr();Object.defineProperty(ge,"Chrono",{enumerable:!0,get:function(){return YC.Chrono}});var UC;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(UC=ge.Meridiem||(ge.Meridiem={}));var WC=jn(Yy());ge.de=WC;var qC=jn(hg());ge.fr=qC;var jC=jn(wg());ge.ja=jC;var $C=jn(Yg());ge.pt=$C;var GC=jn(w_());ge.nl=GC;var BC=jn(rT());ge.zh=BC;var HC=jn(RT());ge.ru=HC;ge.strict=wh.strict;ge.casual=wh.casual;function zC(r,e,t){return ge.casual.parse(r,e,t)}ge.parse=zC;function VC(r,e,t){return ge.casual.parseDate(r,e,t)}ge.parseDate=VC});var bu=O((Dh,oi)=>{(function(r,e){typeof Dh=="object"&&typeof oi!="undefined"?oi.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(Dh,function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function s(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,u){return Object.prototype.hasOwnProperty.call(i,u)}function o(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var u;for(u in i)if(a(i,u))return!1;return!0}function l(i){return i===void 0}function c(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function h(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function m(i,u){var d=[],f,p=i.length;for(f=0;f>>0,f;for(f=0;f0)for(d=0;d=0;return(b?d?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+f}var w=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,D=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},M={};function k(i,u,d,f){var p=f;typeof f=="string"&&(p=function(){return this[f]()}),i&&(M[i]=p),u&&(M[u[0]]=function(){return _(p.apply(this,arguments),u[1],u[2])}),d&&(M[d]=function(){return this.localeData().ordinal(p.apply(this,arguments),i)})}function I(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function A(i){var u=i.match(w),d,f;for(d=0,f=u.length;d=0&&D.test(i);)i=i.replace(D,f),D.lastIndex=0,d-=1;return i}var ke={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function pe(i){var u=this._longDateFormat[i],d=this._longDateFormat[i.toUpperCase()];return u||!d?u:(this._longDateFormat[i]=d.match(w).map(function(f){return f==="MMMM"||f==="MM"||f==="DD"||f==="dddd"?f.slice(1):f}).join(""),this._longDateFormat[i])}var le="Invalid date";function Ce(){return this._invalidDate}var K="%d",We=/\d{1,2}/;function Xe(i){return this._ordinal.replace("%d",i)}var ct={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Or(i,u,d,f){var p=this._relativeTime[d];return V(p)?p(i,u,d,f):p.replace(/%d/i,i)}function it(i,u){var d=this._relativeTime[i>0?"future":"past"];return V(d)?d(u):d.replace(/%s/i,u)}var qe={};function dt(i,u){var d=i.toLowerCase();qe[d]=qe[d+"s"]=qe[u]=i}function gt(i){return typeof i=="string"?qe[i]||qe[i.toLowerCase()]:void 0}function On(i){var u={},d,f;for(f in i)a(i,f)&&(d=gt(f),d&&(u[d]=i[f]));return u}var Ii={};function je(i,u){Ii[i]=u}function Ls(i){var u=[],d;for(d in i)a(i,d)&&u.push({unit:d,priority:Ii[d]});return u.sort(function(f,p){return f.priority-p.priority}),u}function es(i){return i%4===0&&i%100!==0||i%400===0}function ft(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function ce(i){var u=+i,d=0;return u!==0&&isFinite(u)&&(d=ft(u)),d}function Jr(i,u){return function(d){return d!=null?(ts(this,i,d),e.updateOffset(this,u),this):Mt(this,i)}}function Mt(i,u){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+u]():NaN}function ts(i,u,d){i.isValid()&&!isNaN(d)&&(u==="FullYear"&&es(i.year())&&i.month()===1&&i.date()===29?(d=ce(d),i._d["set"+(i._isUTC?"UTC":"")+u](d,i.month(),yo(d,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+u](d))}function fo(i){return i=gt(i),V(this[i])?this[i]():this}function Ur(i,u){if(typeof i=="object"){i=On(i);var d=Ls(i),f,p=d.length;for(f=0;f68?1900:2e3)};var Tp=Jr("FullYear",!0);function sw(){return es(this.year())}function iw(i,u,d,f,p,b,x){var re;return i<100&&i>=0?(re=new Date(i+400,u,d,f,p,b,x),isFinite(re.getFullYear())&&re.setFullYear(i)):re=new Date(i,u,d,f,p,b,x),re}function Yi(i){var u,d;return i<100&&i>=0?(d=Array.prototype.slice.call(arguments),d[0]=i+400,u=new Date(Date.UTC.apply(null,d)),isFinite(u.getUTCFullYear())&&u.setUTCFullYear(i)):u=new Date(Date.UTC.apply(null,arguments)),u}function go(i,u,d){var f=7+u-d,p=(7+Yi(i,0,f).getUTCDay()-u)%7;return-p+f-1}function bp(i,u,d,f,p){var b=(7+d-f)%7,x=go(i,f,p),re=1+7*(u-1)+b+x,me,Ye;return re<=0?(me=i-1,Ye=Li(me)+re):re>Li(i)?(me=i+1,Ye=re-Li(i)):(me=i,Ye=re),{year:me,dayOfYear:Ye}}function Ui(i,u,d){var f=go(i.year(),u,d),p=Math.floor((i.dayOfYear()-f-1)/7)+1,b,x;return p<1?(x=i.year()-1,b=p+rn(x,u,d)):p>rn(i.year(),u,d)?(b=p-rn(i.year(),u,d),x=i.year()+1):(x=i.year(),b=p),{week:b,year:x}}function rn(i,u,d){var f=go(i,u,d),p=go(i+1,u,d);return(Li(i)-f+p)/7}k("w",["ww",2],"wo","week"),k("W",["WW",2],"Wo","isoWeek"),dt("week","w"),dt("isoWeek","W"),je("week",5),je("isoWeek",5),H("w",Le),H("ww",Le,_t),H("W",Le),H("WW",Le,_t),pr(["w","ww","W","WW"],function(i,u,d,f){u[f.substr(0,1)]=ce(i)});function aw(i){return Ui(i,this._week.dow,this._week.doy).week}var ow={dow:0,doy:6};function uw(){return this._week.dow}function lw(){return this._week.doy}function cw(i){var u=this.localeData().week(this);return i==null?u:this.add((i-u)*7,"d")}function dw(i){var u=Ui(this,1,4).week;return i==null?u:this.add((i-u)*7,"d")}k("d",0,"do","day"),k("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),k("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),k("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),k("e",0,0,"weekday"),k("E",0,0,"isoWeekday"),dt("day","d"),dt("weekday","e"),dt("isoWeekday","E"),je("day",11),je("weekday",11),je("isoWeekday",11),H("d",Le),H("e",Le),H("E",Le),H("dd",function(i,u){return u.weekdaysMinRegex(i)}),H("ddd",function(i,u){return u.weekdaysShortRegex(i)}),H("dddd",function(i,u){return u.weekdaysRegex(i)}),pr(["dd","ddd","dddd"],function(i,u,d,f){var p=d._locale.weekdaysParse(i,f,d._strict);p!=null?u.d=p:v(d).invalidWeekday=i}),pr(["d","e","E"],function(i,u,d,f){u[f]=ce(i)});function fw(i,u){return typeof i!="string"?i:isNaN(i)?(i=u.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function hw(i,u){return typeof i=="string"?u.weekdaysParse(i)%7||7:isNaN(i)?null:i}function ml(i,u){return i.slice(u,7).concat(i.slice(0,u))}var pw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),vp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),mw="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),yw=fr,gw=fr,_w=fr;function Tw(i,u){var d=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(u)?"format":"standalone"];return i===!0?ml(d,this._week.dow):i?d[i.day()]:d}function bw(i){return i===!0?ml(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function vw(i){return i===!0?ml(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function ww(i,u,d){var f,p,b,x=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)b=T([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(b,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(b,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(b,"").toLocaleLowerCase();return d?u==="dddd"?(p=nt.call(this._weekdaysParse,x),p!==-1?p:null):u==="ddd"?(p=nt.call(this._shortWeekdaysParse,x),p!==-1?p:null):(p=nt.call(this._minWeekdaysParse,x),p!==-1?p:null):u==="dddd"?(p=nt.call(this._weekdaysParse,x),p!==-1||(p=nt.call(this._shortWeekdaysParse,x),p!==-1)?p:(p=nt.call(this._minWeekdaysParse,x),p!==-1?p:null)):u==="ddd"?(p=nt.call(this._shortWeekdaysParse,x),p!==-1||(p=nt.call(this._weekdaysParse,x),p!==-1)?p:(p=nt.call(this._minWeekdaysParse,x),p!==-1?p:null)):(p=nt.call(this._minWeekdaysParse,x),p!==-1||(p=nt.call(this._weekdaysParse,x),p!==-1)?p:(p=nt.call(this._shortWeekdaysParse,x),p!==-1?p:null))}function Dw(i,u,d){var f,p,b;if(this._weekdaysParseExact)return ww.call(this,i,u,d);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),f=0;f<7;f++){if(p=T([2e3,1]).day(f),d&&!this._fullWeekdaysParse[f]&&(this._fullWeekdaysParse[f]=new RegExp("^"+this.weekdays(p,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[f]=new RegExp("^"+this.weekdaysShort(p,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[f]=new RegExp("^"+this.weekdaysMin(p,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[f]||(b="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[f]=new RegExp(b.replace(".",""),"i")),d&&u==="dddd"&&this._fullWeekdaysParse[f].test(i))return f;if(d&&u==="ddd"&&this._shortWeekdaysParse[f].test(i))return f;if(d&&u==="dd"&&this._minWeekdaysParse[f].test(i))return f;if(!d&&this._weekdaysParse[f].test(i))return f}}function kw(i){if(!this.isValid())return i!=null?this:NaN;var u=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=fw(i,this.localeData()),this.add(i-u,"d")):u}function Ew(i){if(!this.isValid())return i!=null?this:NaN;var u=(this.day()+7-this.localeData()._week.dow)%7;return i==null?u:this.add(i-u,"d")}function Sw(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var u=hw(i,this.localeData());return this.day(this.day()%7?u:u-7)}else return this.day()||7}function Ow(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||yl.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=yw),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Mw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||yl.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=gw),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Rw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||yl.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_w),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function yl(){function i($t,un){return un.length-$t.length}var u=[],d=[],f=[],p=[],b,x,re,me,Ye;for(b=0;b<7;b++)x=T([2e3,1]).day(b),re=ht(this.weekdaysMin(x,"")),me=ht(this.weekdaysShort(x,"")),Ye=ht(this.weekdays(x,"")),u.push(re),d.push(me),f.push(Ye),p.push(re),p.push(me),p.push(Ye);u.sort(i),d.sort(i),f.sort(i),p.sort(i),this._weekdaysRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+f.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+u.join("|")+")","i")}function gl(){return this.hours()%12||12}function xw(){return this.hours()||24}k("H",["HH",2],0,"hour"),k("h",["hh",2],0,gl),k("k",["kk",2],0,xw),k("hmm",0,0,function(){return""+gl.apply(this)+_(this.minutes(),2)}),k("hmmss",0,0,function(){return""+gl.apply(this)+_(this.minutes(),2)+_(this.seconds(),2)}),k("Hmm",0,0,function(){return""+this.hours()+_(this.minutes(),2)}),k("Hmmss",0,0,function(){return""+this.hours()+_(this.minutes(),2)+_(this.seconds(),2)});function wp(i,u){k(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),u)})}wp("a",!0),wp("A",!1),dt("hour","h"),je("hour",13);function Dp(i,u){return u._meridiemParse}H("a",Dp),H("A",Dp),H("H",Le),H("h",Le),H("k",Le),H("HH",Le,_t),H("hh",Le,_t),H("kk",Le,_t),H("hmm",Rn),H("hmmss",Ys),H("Hmm",Rn),H("Hmmss",Ys),Pe(["H","HH"],ne),Pe(["k","kk"],function(i,u,d){var f=ce(i);u[ne]=f===24?0:f}),Pe(["a","A"],function(i,u,d){d._isPm=d._locale.isPM(i),d._meridiem=i}),Pe(["h","hh"],function(i,u,d){u[ne]=ce(i),v(d).bigHour=!0}),Pe("hmm",function(i,u,d){var f=i.length-2;u[ne]=ce(i.substr(0,f)),u[ue]=ce(i.substr(f)),v(d).bigHour=!0}),Pe("hmmss",function(i,u,d){var f=i.length-4,p=i.length-2;u[ne]=ce(i.substr(0,f)),u[ue]=ce(i.substr(f,2)),u[jt]=ce(i.substr(p)),v(d).bigHour=!0}),Pe("Hmm",function(i,u,d){var f=i.length-2;u[ne]=ce(i.substr(0,f)),u[ue]=ce(i.substr(f))}),Pe("Hmmss",function(i,u,d){var f=i.length-4,p=i.length-2;u[ne]=ce(i.substr(0,f)),u[ue]=ce(i.substr(f,2)),u[jt]=ce(i.substr(p))});function Pw(i){return(i+"").toLowerCase().charAt(0)==="p"}var Aw=/[ap]\.?m?\.?/i,Nw=Jr("Hours",!0);function Cw(i,u,d){return i>11?d?"pm":"PM":d?"am":"AM"}var kp={calendar:oe,longDateFormat:ke,invalidDate:le,ordinal:K,dayOfMonthOrdinalParse:We,relativeTime:ct,months:Vv,monthsShort:pp,week:ow,weekdays:pw,weekdaysMin:mw,weekdaysShort:vp,meridiemParse:Aw},Je={},Wi={},qi;function Iw(i,u){var d,f=Math.min(i.length,u.length);for(d=0;d0;){if(p=_o(b.slice(0,d).join("-")),p)return p;if(f&&f.length>=d&&Iw(b,f)>=d-1)break;d--}u++}return qi}function Lw(i){return i.match("^[^/\\\\]*$")!=null}function _o(i){var u=null,d;if(Je[i]===void 0&&typeof oi!="undefined"&&oi&&oi.exports&&Lw(i))try{u=qi._abbr,d=require,d("./locale/"+i),An(u)}catch(f){Je[i]=null}return Je[i]}function An(i,u){var d;return i&&(l(u)?d=nn(i):d=_l(i,u),d?qi=d:typeof console!="undefined"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),qi._abbr}function _l(i,u){if(u!==null){var d,f=kp;if(u.abbr=i,Je[i]!=null)yt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),f=Je[i]._config;else if(u.parentLocale!=null)if(Je[u.parentLocale]!=null)f=Je[u.parentLocale]._config;else if(d=_o(u.parentLocale),d!=null)f=d._config;else return Wi[u.parentLocale]||(Wi[u.parentLocale]=[]),Wi[u.parentLocale].push({name:i,config:u}),null;return Je[i]=new Q(P(f,u)),Wi[i]&&Wi[i].forEach(function(p){_l(p.name,p.config)}),An(i),Je[i]}else return delete Je[i],null}function Yw(i,u){if(u!=null){var d,f,p=kp;Je[i]!=null&&Je[i].parentLocale!=null?Je[i].set(P(Je[i]._config,u)):(f=_o(i),f!=null&&(p=f._config),u=P(p,u),f==null&&(u.abbr=i),d=new Q(u),d.parentLocale=Je[i],Je[i]=d),An(i)}else Je[i]!=null&&(Je[i].parentLocale!=null?(Je[i]=Je[i].parentLocale,i===An()&&An(i)):Je[i]!=null&&delete Je[i]);return Je[i]}function nn(i){var u;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return qi;if(!n(i)){if(u=_o(i),u)return u;i=[i]}return Fw(i)}function Uw(){return Y(Je)}function Tl(i){var u,d=i._a;return d&&v(i).overflow===-2&&(u=d[Qe]<0||d[Qe]>11?Qe:d[G]<1||d[G]>yo(d[et],d[Qe])?G:d[ne]<0||d[ne]>24||d[ne]===24&&(d[ue]!==0||d[jt]!==0||d[is]!==0)?ne:d[ue]<0||d[ue]>59?ue:d[jt]<0||d[jt]>59?jt:d[is]<0||d[is]>999?is:-1,v(i)._overflowDayOfYear&&(uG)&&(u=G),v(i)._overflowWeeks&&u===-1&&(u=Bv),v(i)._overflowWeekday&&u===-1&&(u=Hv),v(i).overflow=u),i}var Ww=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,jw=/Z|[+-]\d\d(?::?\d\d)?/,To=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],bl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],$w=/^\/?Date\((-?\d+)/i,Gw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Bw={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Sp(i){var u,d,f=i._i,p=Ww.exec(f)||qw.exec(f),b,x,re,me,Ye=To.length,$t=bl.length;if(p){for(v(i).iso=!0,u=0,d=Ye;uLi(x)||i._dayOfYear===0)&&(v(i)._overflowDayOfYear=!0),d=Yi(x,0,i._dayOfYear),i._a[Qe]=d.getUTCMonth(),i._a[G]=d.getUTCDate()),u=0;u<3&&i._a[u]==null;++u)i._a[u]=f[u]=p[u];for(;u<7;u++)i._a[u]=f[u]=i._a[u]==null?u===2?1:0:i._a[u];i._a[ne]===24&&i._a[ue]===0&&i._a[jt]===0&&i._a[is]===0&&(i._nextDay=!0,i._a[ne]=0),i._d=(i._useUTC?Yi:iw).apply(null,f),b=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[ne]=24),i._w&&typeof i._w.d!="undefined"&&i._w.d!==b&&(v(i).weekdayMismatch=!0)}}function Jw(i){var u,d,f,p,b,x,re,me,Ye;u=i._w,u.GG!=null||u.W!=null||u.E!=null?(b=1,x=4,d=Ws(u.GG,i._a[et],Ui(ze(),1,4).year),f=Ws(u.W,1),p=Ws(u.E,1),(p<1||p>7)&&(me=!0)):(b=i._locale._week.dow,x=i._locale._week.doy,Ye=Ui(ze(),b,x),d=Ws(u.gg,i._a[et],Ye.year),f=Ws(u.w,Ye.week),u.d!=null?(p=u.d,(p<0||p>6)&&(me=!0)):u.e!=null?(p=u.e+b,(u.e<0||u.e>6)&&(me=!0)):p=b),f<1||f>rn(d,b,x)?v(i)._overflowWeeks=!0:me!=null?v(i)._overflowWeekday=!0:(re=bp(d,f,p,b,x),i._a[et]=re.year,i._dayOfYear=re.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function wl(i){if(i._f===e.ISO_8601){Sp(i);return}if(i._f===e.RFC_2822){Op(i);return}i._a=[],v(i).empty=!0;var u=""+i._i,d,f,p,b,x,re=u.length,me=0,Ye,$t;for(p=j(i._f,i._locale).match(w)||[],$t=p.length,d=0;d<$t;d++)b=p[d],f=(u.match(Us(b,i))||[])[0],f&&(x=u.substr(0,u.indexOf(f)),x.length>0&&v(i).unusedInput.push(x),u=u.slice(u.indexOf(f)+f.length),me+=f.length),M[b]?(f?v(i).empty=!1:v(i).unusedTokens.push(b),Ft(b,f,i)):i._strict&&!f&&v(i).unusedTokens.push(b);v(i).charsLeftOver=re-me,u.length>0&&v(i).unusedInput.push(u),i._a[ne]<=12&&v(i).bigHour===!0&&i._a[ne]>0&&(v(i).bigHour=void 0),v(i).parsedDateParts=i._a.slice(0),v(i).meridiem=i._meridiem,i._a[ne]=e0(i._locale,i._a[ne],i._meridiem),Ye=v(i).era,Ye!==null&&(i._a[et]=i._locale.erasConvertYear(Ye,i._a[et])),vl(i),Tl(i)}function e0(i,u,d){var f;return d==null?u:i.meridiemHour!=null?i.meridiemHour(u,d):(i.isPM!=null&&(f=i.isPM(d),f&&u<12&&(u+=12),!f&&u===12&&(u=0)),u)}function t0(i){var u,d,f,p,b,x,re=!1,me=i._f.length;if(me===0){v(i).invalidFormat=!0,i._d=new Date(NaN);return}for(p=0;pthis?this:i:$()});function xp(i,u){var d,f;if(u.length===1&&n(u[0])&&(u=u[0]),!u.length)return ze();for(d=u[0],f=1;fthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function w0(){if(!l(this._isDSTShifted))return this._isDSTShifted;var i={},u;return De(i,this),i=Mp(i),i._a?(u=i._isUTC?T(i._a):ze(i._a),this._isDSTShifted=this.isValid()&&h0(i._a,u.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function D0(){return this.isValid()?!this._isUTC:!1}function k0(){return this.isValid()?this._isUTC:!1}function Ap(){return this.isValid()?this._isUTC&&this._offset===0:!1}var E0=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,S0=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Mr(i,u){var d=i,f=null,p,b,x;return vo(i)?d={ms:i._milliseconds,d:i._days,M:i._months}:c(i)||!isNaN(+i)?(d={},u?d[u]=+i:d.milliseconds=+i):(f=E0.exec(i))?(p=f[1]==="-"?-1:1,d={y:0,d:ce(f[G])*p,h:ce(f[ne])*p,m:ce(f[ue])*p,s:ce(f[jt])*p,ms:ce(Dl(f[is]*1e3))*p}):(f=S0.exec(i))?(p=f[1]==="-"?-1:1,d={y:as(f[2],p),M:as(f[3],p),w:as(f[4],p),d:as(f[5],p),h:as(f[6],p),m:as(f[7],p),s:as(f[8],p)}):d==null?d={}:typeof d=="object"&&("from"in d||"to"in d)&&(x=O0(ze(d.from),ze(d.to)),d={},d.ms=x.milliseconds,d.M=x.months),b=new bo(d),vo(i)&&a(i,"_locale")&&(b._locale=i._locale),vo(i)&&a(i,"_isValid")&&(b._isValid=i._isValid),b}Mr.fn=bo.prototype,Mr.invalid=f0;function as(i,u){var d=i&&parseFloat(i.replace(",","."));return(isNaN(d)?0:d)*u}function Np(i,u){var d={};return d.months=u.month()-i.month()+(u.year()-i.year())*12,i.clone().add(d.months,"M").isAfter(u)&&--d.months,d.milliseconds=+u-+i.clone().add(d.months,"M"),d}function O0(i,u){var d;return i.isValid()&&u.isValid()?(u=El(u,i),i.isBefore(u)?d=Np(i,u):(d=Np(u,i),d.milliseconds=-d.milliseconds,d.months=-d.months),d):{milliseconds:0,months:0}}function Cp(i,u){return function(d,f){var p,b;return f!==null&&!isNaN(+f)&&(yt(u,"moment()."+u+"(period, number) is deprecated. Please use moment()."+u+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),b=d,d=f,f=b),p=Mr(d,f),Ip(this,p,i),this}}function Ip(i,u,d,f){var p=u._milliseconds,b=Dl(u._days),x=Dl(u._months);!i.isValid()||(f=f==null?!0:f,x&&yp(i,Mt(i,"Month")+x*d),b&&ts(i,"Date",Mt(i,"Date")+b*d),p&&i._d.setTime(i._d.valueOf()+p*d),f&&e.updateOffset(i,b||x))}var M0=Cp(1,"add"),R0=Cp(-1,"subtract");function Fp(i){return typeof i=="string"||i instanceof String}function x0(i){return be(i)||h(i)||Fp(i)||c(i)||A0(i)||P0(i)||i===null||i===void 0}function P0(i){var u=s(i)&&!o(i),d=!1,f=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],p,b,x=f.length;for(p=0;pd.valueOf():d.valueOf()9999?N(d,u?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):V(Date.prototype.toISOString)?u?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",N(d,"Z")):N(d,u?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function H0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",u="",d,f,p,b;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",u="Z"),d="["+i+'("]',f=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",p="-MM-DD[T]HH:mm:ss.SSS",b=u+'[")]',this.format(d+f+p+b)}function z0(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var u=N(this,i);return this.localeData().postformat(u)}function V0(i,u){return this.isValid()&&(be(i)&&i.isValid()||ze(i).isValid())?Mr({to:this,from:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function K0(i){return this.from(ze(),i)}function Z0(i,u){return this.isValid()&&(be(i)&&i.isValid()||ze(i).isValid())?Mr({from:this,to:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function X0(i){return this.to(ze(),i)}function Lp(i){var u;return i===void 0?this._locale._abbr:(u=nn(i),u!=null&&(this._locale=u),this)}var Yp=te("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Up(){return this._locale}var Do=1e3,qs=60*Do,ko=60*qs,Wp=(365*400+97)*24*ko;function js(i,u){return(i%u+u)%u}function qp(i,u,d){return i<100&&i>=0?new Date(i+400,u,d)-Wp:new Date(i,u,d).valueOf()}function jp(i,u,d){return i<100&&i>=0?Date.UTC(i+400,u,d)-Wp:Date.UTC(i,u,d)}function Q0(i){var u,d;if(i=gt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?jp:qp,i){case"year":u=d(this.year(),0,1);break;case"quarter":u=d(this.year(),this.month()-this.month()%3,1);break;case"month":u=d(this.year(),this.month(),1);break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":u=d(this.year(),this.month(),this.date());break;case"hour":u=this._d.valueOf(),u-=js(u+(this._isUTC?0:this.utcOffset()*qs),ko);break;case"minute":u=this._d.valueOf(),u-=js(u,qs);break;case"second":u=this._d.valueOf(),u-=js(u,Do);break}return this._d.setTime(u),e.updateOffset(this,!0),this}function J0(i){var u,d;if(i=gt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?jp:qp,i){case"year":u=d(this.year()+1,0,1)-1;break;case"quarter":u=d(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":u=d(this.year(),this.month()+1,1)-1;break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":u=d(this.year(),this.month(),this.date()+1)-1;break;case"hour":u=this._d.valueOf(),u+=ko-js(u+(this._isUTC?0:this.utcOffset()*qs),ko)-1;break;case"minute":u=this._d.valueOf(),u+=qs-js(u,qs)-1;break;case"second":u=this._d.valueOf(),u+=Do-js(u,Do)-1;break}return this._d.setTime(u),e.updateOffset(this,!0),this}function e1(){return this._d.valueOf()-(this._offset||0)*6e4}function t1(){return Math.floor(this.valueOf()/1e3)}function r1(){return new Date(this.valueOf())}function n1(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function s1(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function i1(){return this.isValid()?this.toISOString():null}function a1(){return C(this)}function o1(){return g({},v(this))}function u1(){return v(this).overflow}function l1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}k("N",0,0,"eraAbbr"),k("NN",0,0,"eraAbbr"),k("NNN",0,0,"eraAbbr"),k("NNNN",0,0,"eraName"),k("NNNNN",0,0,"eraNarrow"),k("y",["y",1],"yo","eraYear"),k("y",["yy",2],0,"eraYear"),k("y",["yyy",3],0,"eraYear"),k("y",["yyyy",4],0,"eraYear"),H("N",Ol),H("NN",Ol),H("NNN",Ol),H("NNNN",b1),H("NNNNN",v1),Pe(["N","NN","NNN","NNNN","NNNNN"],function(i,u,d,f){var p=d._locale.erasParse(i,f,d._strict);p?v(d).era=p:v(d).invalidEra=i}),H("y",dr),H("yy",dr),H("yyy",dr),H("yyyy",dr),H("yo",w1),Pe(["y","yy","yyy","yyyy"],et),Pe(["yo"],function(i,u,d,f){var p;d._locale._eraYearOrdinalRegex&&(p=i.match(d._locale._eraYearOrdinalRegex)),d._locale.eraYearOrdinalParse?u[et]=d._locale.eraYearOrdinalParse(i,p):u[et]=parseInt(i,10)});function c1(i,u){var d,f,p,b=this._eras||nn("en")._eras;for(d=0,f=b.length;d=0)return b[f]}function f1(i,u){var d=i.since<=i.until?1:-1;return u===void 0?e(i.since).year():e(i.since).year()+(u-i.offset)*d}function h1(){var i,u,d,f=this.localeData().eras();for(i=0,u=f.length;ib&&(u=b),R1.call(this,i,u,d,f,p))}function R1(i,u,d,f,p){var b=bp(i,u,d,f,p),x=Yi(b.year,0,b.dayOfYear);return this.year(x.getUTCFullYear()),this.month(x.getUTCMonth()),this.date(x.getUTCDate()),this}k("Q",0,"Qo","quarter"),dt("quarter","Q"),je("quarter",7),H("Q",Mn),Pe("Q",function(i,u){u[Qe]=(ce(i)-1)*3});function x1(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}k("D",["DD",2],"Do","date"),dt("date","D"),je("date",9),H("D",Le),H("DD",Le,_t),H("Do",function(i,u){return i?u._dayOfMonthOrdinalParse||u._ordinalParse:u._dayOfMonthOrdinalParseLenient}),Pe(["D","DD"],G),Pe("Do",function(i,u){u[G]=ce(i.match(Le)[0])});var Gp=Jr("Date",!0);k("DDD",["DDDD",3],"DDDo","dayOfYear"),dt("dayOfYear","DDD"),je("dayOfYear",4),H("DDD",rs),H("DDDD",Fi),Pe(["DDD","DDDD"],function(i,u,d){d._dayOfYear=ce(i)});function P1(i){var u=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?u:this.add(i-u,"d")}k("m",["mm",2],0,"minute"),dt("minute","m"),je("minute",14),H("m",Le),H("mm",Le,_t),Pe(["m","mm"],ue);var A1=Jr("Minutes",!1);k("s",["ss",2],0,"second"),dt("second","s"),je("second",15),H("s",Le),H("ss",Le,_t),Pe(["s","ss"],jt);var N1=Jr("Seconds",!1);k("S",0,0,function(){return~~(this.millisecond()/100)}),k(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),k(0,["SSS",3],0,"millisecond"),k(0,["SSSS",4],0,function(){return this.millisecond()*10}),k(0,["SSSSS",5],0,function(){return this.millisecond()*100}),k(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),k(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),k(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),k(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),dt("millisecond","ms"),je("millisecond",16),H("S",rs,Mn),H("SS",rs,_t),H("SSS",rs,Fi);var Nn,Bp;for(Nn="SSSS";Nn.length<=9;Nn+="S")H(Nn,dr);function C1(i,u){u[is]=ce(("0."+i)*1e3)}for(Nn="S";Nn.length<=9;Nn+="S")Pe(Nn,C1);Bp=Jr("Milliseconds",!1),k("z",0,0,"zoneAbbr"),k("zz",0,0,"zoneName");function I1(){return this._isUTC?"UTC":""}function F1(){return this._isUTC?"Coordinated Universal Time":""}var F=Te.prototype;F.add=M0,F.calendar=I0,F.clone=F0,F.diff=$0,F.endOf=J0,F.format=z0,F.from=V0,F.fromNow=K0,F.to=Z0,F.toNow=X0,F.get=fo,F.invalidAt=u1,F.isAfter=L0,F.isBefore=Y0,F.isBetween=U0,F.isSame=W0,F.isSameOrAfter=q0,F.isSameOrBefore=j0,F.isValid=a1,F.lang=Yp,F.locale=Lp,F.localeData=Up,F.max=a0,F.min=i0,F.parsingFlags=o1,F.set=Ur,F.startOf=Q0,F.subtract=R0,F.toArray=n1,F.toObject=s1,F.toDate=r1,F.toISOString=B0,F.inspect=H0,typeof Symbol!="undefined"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=i1,F.toString=G0,F.unix=t1,F.valueOf=e1,F.creationData=l1,F.eraName=h1,F.eraNarrow=p1,F.eraAbbr=m1,F.eraYear=y1,F.year=Tp,F.isLeapYear=sw,F.weekYear=D1,F.isoWeekYear=k1,F.quarter=F.quarters=x1,F.month=gp,F.daysInMonth=tw,F.week=F.weeks=cw,F.isoWeek=F.isoWeeks=dw,F.weeksInYear=O1,F.weeksInWeekYear=M1,F.isoWeeksInYear=E1,F.isoWeeksInISOWeekYear=S1,F.date=Gp,F.day=F.days=kw,F.weekday=Ew,F.isoWeekday=Sw,F.dayOfYear=P1,F.hour=F.hours=Nw,F.minute=F.minutes=A1,F.second=F.seconds=N1,F.millisecond=F.milliseconds=Bp,F.utcOffset=m0,F.utc=g0,F.local=_0,F.parseZone=T0,F.hasAlignedHourOffset=b0,F.isDST=v0,F.isLocal=D0,F.isUtcOffset=k0,F.isUtc=Ap,F.isUTC=Ap,F.zoneAbbr=I1,F.zoneName=F1,F.dates=te("dates accessor is deprecated. Use date instead.",Gp),F.months=te("months accessor is deprecated. Use month instead",gp),F.years=te("years accessor is deprecated. Use year instead",Tp),F.zone=te("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",y0),F.isDSTShifted=te("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",w0);function L1(i){return ze(i*1e3)}function Y1(){return ze.apply(null,arguments).parseZone()}function Hp(i){return i}var Me=Q.prototype;Me.calendar=y,Me.longDateFormat=pe,Me.invalidDate=Ce,Me.ordinal=Xe,Me.preparse=Hp,Me.postformat=Hp,Me.relativeTime=Or,Me.pastFuture=it,Me.set=q,Me.eras=c1,Me.erasParse=d1,Me.erasConvertYear=f1,Me.erasAbbrRegex=_1,Me.erasNameRegex=g1,Me.erasNarrowRegex=T1,Me.months=Xv,Me.monthsShort=Qv,Me.monthsParse=ew,Me.monthsRegex=nw,Me.monthsShortRegex=rw,Me.week=aw,Me.firstDayOfYear=lw,Me.firstDayOfWeek=uw,Me.weekdays=Tw,Me.weekdaysMin=vw,Me.weekdaysShort=bw,Me.weekdaysParse=Dw,Me.weekdaysRegex=Ow,Me.weekdaysShortRegex=Mw,Me.weekdaysMinRegex=Rw,Me.isPM=Pw,Me.meridiem=Cw;function So(i,u,d,f){var p=nn(),b=T().set(f,u);return p[d](b,i)}function zp(i,u,d){if(c(i)&&(u=i,i=void 0),i=i||"",u!=null)return So(i,u,d,"month");var f,p=[];for(f=0;f<12;f++)p[f]=So(i,f,d,"month");return p}function Rl(i,u,d,f){typeof i=="boolean"?(c(u)&&(d=u,u=void 0),u=u||""):(u=i,d=u,i=!1,c(u)&&(d=u,u=void 0),u=u||"");var p=nn(),b=i?p._week.dow:0,x,re=[];if(d!=null)return So(u,(d+b)%7,f,"day");for(x=0;x<7;x++)re[x]=So(u,(x+b)%7,f,"day");return re}function U1(i,u){return zp(i,u,"months")}function W1(i,u){return zp(i,u,"monthsShort")}function q1(i,u,d){return Rl(i,u,d,"weekdays")}function j1(i,u,d){return Rl(i,u,d,"weekdaysShort")}function $1(i,u,d){return Rl(i,u,d,"weekdaysMin")}An("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var u=i%10,d=ce(i%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th";return i+d}}),e.lang=te("moment.lang is deprecated. Use moment.locale instead.",An),e.langData=te("moment.langData is deprecated. Use moment.localeData instead.",nn);var sn=Math.abs;function G1(){var i=this._data;return this._milliseconds=sn(this._milliseconds),this._days=sn(this._days),this._months=sn(this._months),i.milliseconds=sn(i.milliseconds),i.seconds=sn(i.seconds),i.minutes=sn(i.minutes),i.hours=sn(i.hours),i.months=sn(i.months),i.years=sn(i.years),this}function Vp(i,u,d,f){var p=Mr(u,d);return i._milliseconds+=f*p._milliseconds,i._days+=f*p._days,i._months+=f*p._months,i._bubble()}function B1(i,u){return Vp(this,i,u,1)}function H1(i,u){return Vp(this,i,u,-1)}function Kp(i){return i<0?Math.floor(i):Math.ceil(i)}function z1(){var i=this._milliseconds,u=this._days,d=this._months,f=this._data,p,b,x,re,me;return i>=0&&u>=0&&d>=0||i<=0&&u<=0&&d<=0||(i+=Kp(xl(d)+u)*864e5,u=0,d=0),f.milliseconds=i%1e3,p=ft(i/1e3),f.seconds=p%60,b=ft(p/60),f.minutes=b%60,x=ft(b/60),f.hours=x%24,u+=ft(x/24),me=ft(Zp(u)),d+=me,u-=Kp(xl(me)),re=ft(d/12),d%=12,f.days=u,f.months=d,f.years=re,this}function Zp(i){return i*4800/146097}function xl(i){return i*146097/4800}function V1(i){if(!this.isValid())return NaN;var u,d,f=this._milliseconds;if(i=gt(i),i==="month"||i==="quarter"||i==="year")switch(u=this._days+f/864e5,d=this._months+Zp(u),i){case"month":return d;case"quarter":return d/3;case"year":return d/12}else switch(u=this._days+Math.round(xl(this._months)),i){case"week":return u/7+f/6048e5;case"day":return u+f/864e5;case"hour":return u*24+f/36e5;case"minute":return u*1440+f/6e4;case"second":return u*86400+f/1e3;case"millisecond":return Math.floor(u*864e5)+f;default:throw new Error("Unknown unit "+i)}}function K1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+ce(this._months/12)*31536e6:NaN}function an(i){return function(){return this.as(i)}}var Z1=an("ms"),X1=an("s"),Q1=an("m"),J1=an("h"),eD=an("d"),tD=an("w"),rD=an("M"),nD=an("Q"),sD=an("y");function iD(){return Mr(this)}function aD(i){return i=gt(i),this.isValid()?this[i+"s"]():NaN}function os(i){return function(){return this.isValid()?this._data[i]:NaN}}var oD=os("milliseconds"),uD=os("seconds"),lD=os("minutes"),cD=os("hours"),dD=os("days"),fD=os("months"),hD=os("years");function pD(){return ft(this.days()/7)}var on=Math.round,$s={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function mD(i,u,d,f,p){return p.relativeTime(u||1,!!d,i,f)}function yD(i,u,d,f){var p=Mr(i).abs(),b=on(p.as("s")),x=on(p.as("m")),re=on(p.as("h")),me=on(p.as("d")),Ye=on(p.as("M")),$t=on(p.as("w")),un=on(p.as("y")),Cn=b<=d.ss&&["s",b]||b0,Cn[4]=f,mD.apply(null,Cn)}function gD(i){return i===void 0?on:typeof i=="function"?(on=i,!0):!1}function _D(i,u){return $s[i]===void 0?!1:u===void 0?$s[i]:($s[i]=u,i==="s"&&($s.ss=u-1),!0)}function TD(i,u){if(!this.isValid())return this.localeData().invalidDate();var d=!1,f=$s,p,b;return typeof i=="object"&&(u=i,i=!1),typeof i=="boolean"&&(d=i),typeof u=="object"&&(f=Object.assign({},$s,u),u.s!=null&&u.ss==null&&(f.ss=u.s-1)),p=this.localeData(),b=yD(this,!d,f,p),d&&(b=p.pastFuture(+this,b)),p.postformat(b)}var Pl=Math.abs;function Gs(i){return(i>0)-(i<0)||+i}function Oo(){if(!this.isValid())return this.localeData().invalidDate();var i=Pl(this._milliseconds)/1e3,u=Pl(this._days),d=Pl(this._months),f,p,b,x,re=this.asSeconds(),me,Ye,$t,un;return re?(f=ft(i/60),p=ft(f/60),i%=60,f%=60,b=ft(d/12),d%=12,x=i?i.toFixed(3).replace(/\.?0+$/,""):"",me=re<0?"-":"",Ye=Gs(this._months)!==Gs(re)?"-":"",$t=Gs(this._days)!==Gs(re)?"-":"",un=Gs(this._milliseconds)!==Gs(re)?"-":"",me+"P"+(b?Ye+b+"Y":"")+(d?Ye+d+"M":"")+(u?$t+u+"D":"")+(p||f||i?"T":"")+(p?un+p+"H":"")+(f?un+f+"M":"")+(i?un+x+"S":"")):"P0D"}var Oe=bo.prototype;Oe.isValid=d0,Oe.abs=G1,Oe.add=B1,Oe.subtract=H1,Oe.as=V1,Oe.asMilliseconds=Z1,Oe.asSeconds=X1,Oe.asMinutes=Q1,Oe.asHours=J1,Oe.asDays=eD,Oe.asWeeks=tD,Oe.asMonths=rD,Oe.asQuarters=nD,Oe.asYears=sD,Oe.valueOf=K1,Oe._bubble=z1,Oe.clone=iD,Oe.get=aD,Oe.milliseconds=oD,Oe.seconds=uD,Oe.minutes=lD,Oe.hours=cD,Oe.days=dD,Oe.weeks=pD,Oe.months=fD,Oe.years=hD,Oe.humanize=TD,Oe.toISOString=Oo,Oe.toString=Oo,Oe.toJSON=Oo,Oe.locale=Lp,Oe.localeData=Up,Oe.toIsoString=te("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Oo),Oe.lang=Yp,k("X",0,0,"unix"),k("x",0,0,"valueOf"),H("x",Pn),H("X",po),Pe("X",function(i,u,d){d._d=new Date(parseFloat(i)*1e3)}),Pe("x",function(i,u,d){d._d=new Date(ce(i))});return e.version="2.29.4",t(ze),e.fn=F,e.min=o0,e.max=u0,e.now=l0,e.utc=T,e.unix=L1,e.months=U1,e.isDate=h,e.locale=An,e.invalid=$,e.duration=Mr,e.isMoment=be,e.weekdays=q1,e.parseZone=Y1,e.localeData=nn,e.isDuration=vo,e.monthsShort=W1,e.weekdaysMin=$1,e.defineLocale=_l,e.updateLocale=Yw,e.locales=Uw,e.weekdaysShort=j1,e.normalizeUnits=gt,e.relativeTimeRounding=gD,e.relativeTimeThreshold=_D,e.calendarFormat=C0,e.prototype=F,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var JT=O((lY,Su)=>{var AT,NT,CT,IT,FT,LT,YT,UT,WT,ku,Eh,qT,jT,$T,ci,GT,BT,HT,zT,VT,KT,ZT,XT,QT,Eu;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Su=="object"&&typeof Su.exports=="object"?r(t(e,t(Su.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=s?s(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])};AT=function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function a(){this.constructor=n}n.prototype=s===null?Object.create(s):(a.prototype=s.prototype,new a)},NT=Object.assign||function(n){for(var s,a=1,o=arguments.length;a=0;m--)(h=n[m])&&(c=(l<3?h(c):l>3?h(s,a,c):h(s,a))||c);return l>3&&c&&Object.defineProperty(s,a,c),c},FT=function(n,s){return function(a,o){s(a,o,n)}},LT=function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},YT=function(n,s,a,o){function l(c){return c instanceof a?c:new a(function(h){h(c)})}return new(a||(a=Promise))(function(c,h){function m(S){try{T(o.next(S))}catch(v){h(v)}}function g(S){try{T(o.throw(S))}catch(v){h(v)}}function T(S){S.done?c(S.value):l(S.value).then(m,g)}T((o=o.apply(n,s||[])).next())})},UT=function(n,s){var a={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,l,c,h;return h={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function m(T){return function(S){return g([T,S])}}function g(T){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,l&&(c=T[0]&2?l.return:T[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,T[1])).done)return c;switch(l=0,c&&(T=[T[0]&2,c.value]),T[0]){case 0:case 1:c=T;break;case 4:return a.label++,{value:T[1],done:!1};case 5:a.label++,l=T[1],T=[0];continue;case 7:T=a.ops.pop(),a.trys.pop();continue;default:if(c=a.trys,!(c=c.length>0&&c[c.length-1])&&(T[0]===6||T[0]===2)){a=0;continue}if(T[0]===3&&(!c||T[1]>c[0]&&T[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},Eh=function(n,s){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var o=a.call(n),l,c=[],h;try{for(;(s===void 0||s-- >0)&&!(l=o.next()).done;)c.push(l.value)}catch(m){h={error:m}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(h)throw h.error}}return c},qT=function(){for(var n=[],s=0;s1||m(R,C)})})}function m(R,C){try{g(o[R](C))}catch($){v(c[0][3],$)}}function g(R){R.value instanceof ci?Promise.resolve(R.value.v).then(T,S):v(c[0][2],R)}function T(R){m("next",R)}function S(R){m("throw",R)}function v(R,C){R(C),c.shift(),c.length&&m(c[0][0],c[0][1])}},BT=function(n){var s,a;return s={},o("next"),o("throw",function(l){throw l}),o("return"),s[Symbol.iterator]=function(){return this},s;function o(l,c){s[l]=n[l]?function(h){return(a=!a)?{value:ci(n[l](h)),done:l==="return"}:c?c(h):h}:c}},HT=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],a;return s?s.call(n):(n=typeof ku=="function"?ku(n):n[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(c){a[c]=n[c]&&function(h){return new Promise(function(m,g){h=n[c](h),l(m,g,h.done,h.value)})}}function l(c,h,m,g){Promise.resolve(g).then(function(T){c({value:T,done:m})},h)}},zT=function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n};var t=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};VT=function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&Eu(s,n,a);return t(s,n),s},KT=function(n){return n&&n.__esModule?n:{default:n}},ZT=function(n,s,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!o:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(n):o?o.value:s.get(n)},XT=function(n,s,a,o,l){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!l:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?l.call(n,a):l?l.value=a:s.set(n,a),a},QT=function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},r("__extends",AT),r("__assign",NT),r("__rest",CT),r("__decorate",IT),r("__param",FT),r("__metadata",LT),r("__awaiter",YT),r("__generator",UT),r("__exportStar",WT),r("__createBinding",Eu),r("__values",ku),r("__read",Eh),r("__spread",qT),r("__spreadArrays",jT),r("__spreadArray",$T),r("__await",ci),r("__asyncGenerator",GT),r("__asyncDelegator",BT),r("__asyncValues",HT),r("__makeTemplateObject",zT),r("__importStar",VT),r("__importDefault",KT),r("__classPrivateFieldGet",ZT),r("__classPrivateFieldSet",XT),r("__classPrivateFieldIn",QT)})});var Ub=O((Lb,Yb)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(_){return Object.prototype.toString.call(_)==="[object Array]"},n=10,s=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",o=typeof Reflect=="object",l=typeof setImmediate=="function",c=l?setImmediate:setTimeout,h=a?o&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(y){var _=Object.getOwnPropertyNames(y);return _.push.apply(_,Object.getOwnPropertySymbols(y)),_}:Object.keys;function m(){this._events={},this._conf&&g.call(this,this._conf)}function g(y){y&&(this._conf=y,y.delimiter&&(this.delimiter=y.delimiter),y.maxListeners!==r&&(this._maxListeners=y.maxListeners),y.wildcard&&(this.wildcard=y.wildcard),y.newListener&&(this._newListener=y.newListener),y.removeListener&&(this._removeListener=y.removeListener),y.verboseMemoryLeak&&(this.verboseMemoryLeak=y.verboseMemoryLeak),y.ignoreErrors&&(this.ignoreErrors=y.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function T(y,_){var w="(node) warning: possible EventEmitter memory leak detected. "+y+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+_+"."),typeof process!="undefined"&&process.emitWarning){var D=new Error(w);D.name="MaxListenersExceededWarning",D.emitter=this,D.count=y,process.emitWarning(D)}else console.error(w),console.trace&&console.trace()}var S=function(y,_,w){var D=arguments.length;switch(D){case 0:return[];case 1:return[y];case 2:return[y,_];case 3:return[y,_,w];default:for(var E=new Array(D);D--;)E[D]=arguments[D];return E}};function v(y,_){for(var w={},D,E=y.length,M=_?_.length:0,k=0;k0;)y=M[A],k.call(I,y,w[y]);this._listeners={},this._listenersCount=0,N()}}});function C(y,_,w,D){var E=Object.assign({},_);if(!y)return E;if(typeof y!="object")throw TypeError("options must be an object");var M=Object.keys(y),k=M.length,I,A,N;function j(pe){throw Error('Invalid "'+I+'" option value'+(pe?". Reason: "+pe:""))}for(var ke=0;ke0;)if(I===y[A])return M;k(_)}}var W=B(["function"]),De=B(["object","function"]);function Te(y,_,w){var D,E,M=0,k,I=new y(function(A,N,j){w=C(w,{timeout:0,overload:!1},{timeout:function(Ce,K){return Ce*=1,(typeof Ce!="number"||Ce<0||!Number.isFinite(Ce))&&K("timeout must be a positive number"),Ce}}),D=!w.overload&&typeof y.prototype.cancel=="function"&&typeof j=="function";function ke(){E&&(E=null),M&&(clearTimeout(M),M=0)}var pe=function(Ce){ke(),A(Ce)},le=function(Ce){ke(),N(Ce)};D?_(pe,le,j):(E=[function(Ce){le(Ce||Error("canceled"))}],_(pe,le,function(Ce){if(k)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Ce!="function")throw TypeError("onCancel callback must be a function");E.push(Ce)}),k=!0),w.timeout>0&&(M=setTimeout(function(){var Ce=Error("timeout");Ce.code="ETIMEDOUT",M=0,I.cancel(Ce),N(Ce)},w.timeout))});return D||(I.cancel=function(A){if(!!E){for(var N=E.length,j=1;j0;)le=it[I],le!=="_listeners"&&(qe=ee(y,_,w[le],D+1,E),qe&&(pe?pe.push.apply(pe,qe):pe=qe));return pe}else if(ct==="**"){for(Xe=D+1===E||D+2===E&&Or==="*",Xe&&w._listeners&&(pe=ee(y,_,w,E,E)),it=h(w),I=it.length;I-- >0;)le=it[I],le!=="_listeners"&&(le==="*"||le==="**"?(w[le]._listeners&&!Xe&&(qe=ee(y,_,w[le],E,E),qe&&(pe?pe.push.apply(pe,qe):pe=qe)),qe=ee(y,_,w[le],D,E)):le===Or?qe=ee(y,_,w[le],D+2,E):qe=ee(y,_,w[le],D,E),qe&&(pe?pe.push.apply(pe,qe):pe=qe));return pe}else w[ct]&&(pe=ee(y,_,w[ct],D+1,E));if(Ce=w["*"],Ce&&ee(y,_,Ce,D+1,E),K=w["**"],K)if(D0;)le=it[I],le!=="_listeners"&&(le===Or?ee(y,_,K[le],D+2,E):le===ct?ee(y,_,K[le],D+1,E):(We={},We[le]=K[le],ee(y,_,{"**":We},D+1,E)));else K._listeners?ee(y,_,K,E,E):K["*"]&&K["*"]._listeners&&ee(y,_,K["*"],E,E);return pe}function te(y,_,w){var D=0,E=0,M,k=this.delimiter,I=k.length,A;if(typeof y=="string")if((M=y.indexOf(k))!==-1){A=new Array(5);do A[D++]=y.slice(E,M),E=M+I;while((M=y.indexOf(k,E))!==-1);A[D++]=y.slice(E)}else A=[y],D=1;else A=y,D=y.length;if(D>1){for(M=0;M+10&&N._listeners.length>this._maxListeners&&(N._listeners.warned=!0,T.call(this,N._listeners.length,j))):N._listeners=_,!0;return!0}function It(y,_,w,D){for(var E=h(y),M=E.length,k,I,A,N=y._listeners,j;M-- >0;)I=E[M],k=y[I],I==="_listeners"?A=w:A=w?w.concat(I):[I],j=D||typeof I=="symbol",N&&_.push(j?A:A.join(this.delimiter)),typeof k=="object"&&It.call(this,k,_,A,j);return _}function yt(y){for(var _=h(y),w=_.length,D,E,M;w-- >0;)E=_[w],D=y[E],D&&(M=!0,E!=="_listeners"&&!yt(D)&&delete y[E]);return M}function V(y,_,w){this.emitter=y,this.event=_,this.listener=w}V.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function q(y,_,w){if(w===!0)E=!0;else if(w===!1)D=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var D=w.async,E=w.promisify,M=w.nextTick,k=w.objectify}if(D||M||E){var I=_,A=_._origin||_;if(M&&!s)throw Error("process.nextTick is not supported");E===r&&(E=_.constructor.name==="AsyncFunction"),_=function(){var N=arguments,j=this,ke=this.event;return E?M?Promise.resolve():new Promise(function(pe){c(pe)}).then(function(){return j.event=ke,I.apply(j,N)}):(M?process.nextTick:c)(function(){j.event=ke,I.apply(j,N)})},_._async=!0,_._origin=A}return[_,k?new V(this,y,_):this]}function P(y){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,y)}P.EventEmitter2=P,P.prototype.listenTo=function(y,_,w){if(typeof y!="object")throw TypeError("target musts be an object");var D=this;w=C(w,{on:r,off:r,reducers:r},{on:W,off:W,reducers:De});function E(M){if(typeof M!="object")throw TypeError("events must be an object");var k=w.reducers,I=be.call(D,y),A;I===-1?A=new R(D,y,w):A=D._observers[I];for(var N=h(M),j=N.length,ke,pe=typeof k=="function",le=0;le0;)E=w[D],(!y||E._target===y)&&(E.unsubscribe(_),M=!0);return M},P.prototype.delimiter=".",P.prototype.setMaxListeners=function(y){y!==r&&(this._maxListeners=y,this._conf||(this._conf={}),this._conf.maxListeners=y)},P.prototype.getMaxListeners=function(){return this._maxListeners},P.prototype.event="",P.prototype.once=function(y,_,w){return this._once(y,_,!1,w)},P.prototype.prependOnceListener=function(y,_,w){return this._once(y,_,!0,w)},P.prototype._once=function(y,_,w,D){return this._many(y,1,_,w,D)},P.prototype.many=function(y,_,w,D){return this._many(y,_,w,!1,D)},P.prototype.prependMany=function(y,_,w,D){return this._many(y,_,w,!0,D)},P.prototype._many=function(y,_,w,D,E){var M=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function k(){return--_===0&&M.off(y,k),w.apply(this,arguments)}return k._origin=w,this._on(y,k,D,E)},P.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||m.call(this);var y=arguments[0],_,w=this.wildcard,D,E,M,k,I;if(y==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(_=y,y!=="newListener"&&y!=="removeListener"&&typeof y=="object")){if(E=y.length,a){for(M=0;M3)for(D=new Array(A-1),k=1;k3)for(E=new Array(N-1),I=1;I0&&this._events[y].length>this._maxListeners&&(this._events[y].warned=!0,T.call(this,this._events[y].length,y))):this._events[y]=_,E)},P.prototype.off=function(y,_){if(typeof _!="function")throw new Error("removeListener only takes instances of Function");var w,D=[];if(this.wildcard){var E=typeof y=="string"?y.split(this.delimiter):y.slice();if(D=ee.call(this,null,E,this.listenerTree,0),!D)return this}else{if(!this._events[y])return this;w=this._events[y],D.push({_listeners:w})}for(var M=0;M0){for(D=this._all,_=0,w=D.length;_0;)D=_[w[M]],typeof D=="function"?E.push(D):E.push.apply(E,D);return E}else{if(this.wildcard){if(k=this.listenerTree,!k)return[];var I=[],A=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,I,A,k,0),I}return _?(D=_[y],D?typeof D=="function"?[D]:D:[]):[]}},P.prototype.eventNames=function(y){var _=this._events;return this.wildcard?It.call(this,this.listenerTree,[],null,y):_?h(_):[]},P.prototype.listenerCount=function(y){return this.listeners(y).length},P.prototype.hasListeners=function(y){if(this.wildcard){var _=[],w=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,_,w,this.listenerTree,0),_.length>0}var D=this._events,E=this._all;return!!(E&&E.length||D&&(y===r?h(D).length:D[y]))},P.prototype.listenersAny=function(){return this._all?this._all:[]},P.prototype.waitFor=function(y,_){var w=this,D=typeof _;return D==="number"?_={timeout:_}:D==="function"&&(_={filter:_}),_=C(_,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:W,Promise:$}),Te(_.Promise,function(E,M,k){function I(){var A=_.filter;if(!(A&&!A.apply(w,arguments)))if(w.off(y,I),_.handleError){var N=arguments[0];N?M(N):E(S.apply(null,arguments).slice(1))}else E(S.apply(null,arguments))}k(function(){w.off(y,I)}),w._on(y,I,!1)},{timeout:_.timeout,overload:_.overload})};function Q(y,_,w){w=C(w,{Promise,timeout:0,overload:!1},{Promise:$});var D=w.Promise;return Te(D,function(E,M,k){var I;if(typeof y.addEventListener=="function"){I=function(){E(S.apply(null,arguments))},k(function(){y.removeEventListener(_,I)}),y.addEventListener(_,I,{once:!0});return}var A=function(){N&&y.removeListener("error",N),E(S.apply(null,arguments))},N;_!=="error"&&(N=function(j){y.removeListener(_,A),M(j)},y.once("error",N)),k(function(){N&&y.removeListener("error",N),y.removeListener(_,A)}),y.once(_,A)},{timeout:w.timeout,overload:w.overload})}var Y=P.prototype;if(Object.defineProperties(P,{defaultMaxListeners:{get:function(){return Y._maxListeners},set:function(y){if(typeof y!="number"||y<0||Number.isNaN(y))throw TypeError("n must be a non-negative number");Y._maxListeners=y},enumerable:!0},once:{value:Q,writable:!0,configurable:!0}}),Object.defineProperties(Y,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return P});else if(typeof Lb=="object")Yb.exports=P;else{var oe=new Function("","return this")();oe.EventEmitter2=P}})()});var Qr=O(Qn=>{"use strict";Qn.__esModule=!0;var lF;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(lF=Qn.Operators||(Qn.Operators={}));var cF;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(cF=Qn.StructuralCharacters||(Qn.StructuralCharacters={}));var dF;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(dF=Qn.Tokens||(Qn.Tokens={}))});var tp=O(nl=>{"use strict";nl.__esModule=!0;var rt=Qr();nl.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};nl.VALID_TOKENS={identifierOnly:[{name:rt.Tokens.IDENTIFIER},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:rt.Tokens.IDENTIFIER},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.OPEN_PARENTHESIS},{name:rt.Tokens.OPERATOR,value:rt.Operators.NOT}],binaryOperator:[{name:rt.Tokens.OPERATOR,value:rt.Operators.AND},{name:rt.Tokens.OPERATOR,value:rt.Operators.OR},{name:rt.Tokens.OPERATOR,value:rt.Operators.XOR}],binaryOperatorOrClose:[{name:rt.Tokens.OPERATOR,value:rt.Operators.AND},{name:rt.Tokens.OPERATOR,value:rt.Operators.OR},{name:rt.Tokens.OPERATOR,value:rt.Operators.XOR},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.CLOSE_PARENTHESIS}]}});var rp=O(Dn=>{"use strict";Dn.__esModule=!0;var Oi=Qr();Dn.STRUCTURAL_CHARACTERS={"(":Oi.StructuralCharacters.OPEN_PARENTHESIS,")":Oi.StructuralCharacters.CLOSE_PARENTHESIS};Dn.OPERATORS={AND:Oi.Operators.AND,OR:Oi.Operators.OR,XOR:Oi.Operators.XOR,NOT:Oi.Operators.NOT};Dn.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));Dn.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);Dn.COMMENT_DELIMITER=String.fromCodePoint(35);Dn.EOL=String.fromCodePoint(10);Dn.ESCAPE_CHARACTER=String.fromCodePoint(92)});var gv=O(kn=>{"use strict";var np=kn&&kn.__assign||function(){return np=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";sp.__esModule=!0;var Mi=Qr(),ur=rp(),Ri=gv();sp.lex=function(r){for(var e=null,t=null,n=null,s=0;s{"use strict";var fF=En&&En.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";var Pi=oo&&oo.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";Sn.__esModule=!0;var wv=Qr();Sn.andUtil=function(r,e){return r&&e};Sn.orUtil=function(r,e){return r||e};Sn.xorUtil=function(r,e){return r!==e};Sn.notUtil=function(r){return!r};Sn.isIdentifier=function(r){var e=r.name,t=r.value;return e===wv.Tokens.IDENTIFIER&&typeof t=="string"};Sn.isOperator=function(r){var e=r.name,t=r.value;return e===wv.Tokens.OPERATOR&&typeof t=="string"};Sn.throwInvalidExpression=function(r){throw new TypeError("Invalid postfix expression: "+r)}});var Dv=O(cp=>{"use strict";var uo;cp.__esModule=!0;var up=Qr(),lp=op();cp.OPERATOR_MAP=(uo={},uo[up.Operators.AND]=lp.andUtil,uo[up.Operators.OR]=lp.orUtil,uo[up.Operators.XOR]=lp.xorUtil,uo)});var Ev=O(Cs=>{"use strict";var dp=Cs&&Cs.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";lo.__esModule=!0;var Sv=Ev();lo.getEvaluator=Sv.getEvaluator;lo.evaluate=Sv.evaluate;var yF=ap();lo.parse=yF.parse});var vF={};OD(vF,{default:()=>pl});module.exports=MD(vF);var Gv=require("obsidian");var mi=require("obsidian");var DF=new Error("timeout while waiting for mutex to become available"),kF=new Error("mutex already locked"),RD=new Error("request for lock canceled"),xD=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(m){try{h(n.next(m))}catch(g){o(g)}}function c(m){try{h(n.throw(m))}catch(g){o(g)}}function h(m){m.done?a(m.value):s(m.value).then(l,c)}h((n=n.apply(r,e||[])).next())})},Al=class{constructor(e,t=RD){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return xD(this,void 0,void 0,function*(){let[n,s]=yield this.acquire(t);try{return yield e(n)}finally{s()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let s=this._value,a=t;this._value-=t,t=this._value+1,n.resolve([s,this._newReleaser(a)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},PD=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(m){try{h(n.next(m))}catch(g){o(g)}}function c(m){try{h(n.throw(m))}catch(g){o(g)}}function h(m){m.done?a(m.value):s(m.value).then(l,c)}h((n=n.apply(r,e||[])).next())})},Mo=class{constructor(e){this._semaphore=new Al(1,e)}acquire(){return PD(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var vu=In(pt()),ui=In(bu());var Ts=In(bu()),sr=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new sr((0,Ts.default)().startOf(t).startOf("day"),(0,Ts.default)().endOf(t).startOf("day"))}static buildInvalid(){return new sr(Ts.default.invalid(),Ts.default.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=Ts.default.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=Ts.default.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var wr=class{static parseDate(e,t=!1){return(0,ui.default)(vu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e){let t=[wr.parseRelativeDateRange,wr.parseNumberedDateRange,wr.parseAbsoluteDateRange];for(let n of t){let s=n(e);if(s.isValid())return s}return sr.buildInvalid()}static parseAbsoluteDateRange(e){let t=vu.parse(e,void 0,{forwardDate:!0});if(t.length===0)return sr.buildInvalid();let n=t[0].start,s=t[1]&&t[1].start?t[1].start:n,a=(0,ui.default)(n.date()),o=(0,ui.default)(s.date());return new sr(a,o)}static parseRelativeDateRange(e){let t=/(last|this|next) (week|month|quarter|year)/,n=e.match(t);if(n&&n.length===3){let s=n[1],a=n[2],o=sr.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return sr.buildInvalid()}static parseNumberedDateRange(e){let t=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[n,s,a]of t){let o=e.match(n);if(o){let l=o[0].trim();return new sr((0,ui.default)(l,s).startOf(a),(0,ui.default)(l,s).endOf(a))}}return sr.buildInvalid()}};var KC={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function li(r){for(let[e,t]of Object.entries(KC))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var wu=["MO","TU","WE","TH","FR","SA","SU"],lt=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(wu.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=wu[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var He=function(r){return r!=null},ir=function(r){return typeof r=="number"},kh=function(r){return typeof r=="string"&&wu.includes(r)},At=Array.isArray,Dr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=we(t,e/t.length)),t.slice(0,e)+String(n))}var PT=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Lt=function(r,e){var t=r%e;return t*e<0?t+e:t},Du=function(r,e){return{div:Math.floor(r/e),mod:Lt(r,e)}},ar=function(r){return!He(r)||r.length===0},st=function(r){return!ar(r)},Ee=function(r,e){return st(r)&&r.indexOf(e)!==-1};var $n;(function(r){r.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],r.ONE_DAY=1e3*60*60*24,r.MAXYEAR=9999,r.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),r.PY_WEEKDAYS=[6,0,1,2,3,4,5],r.getYearDay=function(e){var t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((t.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/r.ONE_DAY)+1},r.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},r.isDate=function(e){return e instanceof Date},r.isValidDate=function(e){return r.isDate(e)&&!isNaN(e.getTime())},r.tzOffset=function(e){return e.getTimezoneOffset()*60*1e3},r.daysBetween=function(e,t){var n=e.getTime()-r.tzOffset(e),s=t.getTime()-r.tzOffset(t),a=n-s;return Math.round(a/r.ONE_DAY)},r.toOrdinal=function(e){return r.daysBetween(e,r.ORDINAL_BASE)},r.fromOrdinal=function(e){return new Date(r.ORDINAL_BASE.getTime()+e*r.ONE_DAY)},r.getMonthDays=function(e){var t=e.getUTCMonth();return t===1&&r.isLeapYear(e.getUTCFullYear())?29:r.MONTH_DAYS[t]},r.getWeekday=function(e){return r.PY_WEEKDAYS[e.getUTCDay()]},r.monthRange=function(e,t){var n=new Date(Date.UTC(e,t,1));return[r.getWeekday(n),r.getMonthDays(n)]},r.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},r.clone=function(e){var t=new Date(e.getTime());return t},r.cloneDates=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),_n=ZC;var eb=In(JT(),1),{__extends:di,__assign:Bt,__rest:cY,__decorate:dY,__param:fY,__metadata:hY,__awaiter:pY,__generator:mY,__exportStar:yY,__createBinding:gY,__values:_Y,__read:TY,__spread:bY,__spreadArrays:vY,__spreadArray:U,__await:wY,__asyncGenerator:DY,__asyncDelegator:kY,__asyncValues:EY,__makeTemplateObject:SY,__importStar:OY,__importDefault:MY,__classPrivateFieldGet:RY,__classPrivateFieldSet:xY,__classPrivateFieldIn:PY}=eb.default;var XC=function(r){di(e,r);function e(t,n,s){var a=r.call(this,t,n)||this;return a.iterator=s,a}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(_n),Sh=XC;var QC={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},vs=QC;var tb=function(r,e){return r.indexOf(e)!==-1},JC=function(r){return r.toString()},eI=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},tI=function(){function r(e,t,n,s){if(t===void 0&&(t=JC),n===void 0&&(n=vs),s===void 0&&(s=eI),this.text=[],this.language=n||vs,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);a.sort(function(m,g){return m-g}),o.sort(function(m,g){return g-m}),this.bymonthday=a.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(He(this.origOptions.byweekday)){var l=At(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(l);this.byweekday={allWeeks:l.filter(function(m){return!m.n}),someWeeks:l.filter(function(m){return Boolean(m.n)}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var h=function(m,g){return m.weekday-g.weekday};this.byweekday.allWeeks.sort(h),this.byweekday.someWeeks.sort(h),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(tb(["dtstart","wkst","freq"],n))return!0;if(!tb(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[X.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=ir(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,s){var a=this;s===void 0&&(s=","),At(e)||(e=[e]);var o=function(c,h,m){for(var g="",T=0;Te[0].length)&&(e=a,t=s)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function Ga(r,e){e===void 0&&(e=vs);var t={},n=new rI(e.tokens);if(!n.start(r))return null;return s(),t;function s(){n.expect("every");var T=n.acceptNumber();if(T&&(t.interval=parseInt(T[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=X.DAILY,n.nextSymbol()&&(o(),g());break;case"weekday(s)":t.freq=X.WEEKLY,t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR],n.nextSymbol(),g();break;case"week(s)":t.freq=X.WEEKLY,n.nextSymbol()&&(a(),g());break;case"hour(s)":t.freq=X.HOURLY,n.nextSymbol()&&(a(),g());break;case"minute(s)":t.freq=X.MINUTELY,n.nextSymbol()&&(a(),g());break;case"month(s)":t.freq=X.MONTHLY,n.nextSymbol()&&(a(),g());break;case"year(s)":t.freq=X.YEARLY,n.nextSymbol()&&(a(),g());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=X.WEEKLY;var S=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[X[S]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var v=c();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(X[v]),n.nextSymbol()}m(),g();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=X.YEARLY,t.bymonth=[l()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var R=l();if(!R)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(R),n.nextSymbol()}a(),g();break;default:throw new Error("Unknown symbol")}}function a(){var T=n.accept("on"),S=n.accept("the");if(!!(T||S))do{var v=h(),R=c(),C=l();if(v)R?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R].nth(v))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(v),n.accept("day(s)"));else if(R)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var $=n.acceptNumber();if(!$)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt($[0],10)];n.accept("comma");){if($=n.acceptNumber(),!$)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt($[0],10))}}else if(C)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(C);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var T=n.accept("at");if(!!T)do{var S=n.acceptNumber();if(!S)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(S[0],10)];n.accept("comma");){if(S=n.acceptNumber(),!S)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(S[0],10))}}while(n.accept("comma")||n.accept("at"))}function l(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var T=parseInt(n.value[1],10);if(T<-366||T>366)throw new Error("Nth out of range: "+T);return n.nextSymbol(),n.accept("last")?-T:T;default:return!1}}function m(){n.accept("on"),n.accept("the");var T=h();if(!!T)for(t.bymonthday=[T],n.nextSymbol();n.accept("comma");){if(T=h(),!T)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(T),n.nextSymbol()}}function g(){if(n.symbol==="until"){var T=Date.parse(n.text);if(!T)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(T)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var _e;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(_e||(_e={}));function Ba(r){return r<_e.HOURLY}var rb=function(r,e){return e===void 0&&(e=vs),new X(Ga(r,e)||void 0)},fi=["count","until","interval","byweekday","bymonthday","bymonth"];Br.IMPLEMENTED=[];Br.IMPLEMENTED[_e.HOURLY]=fi;Br.IMPLEMENTED[_e.MINUTELY]=fi;Br.IMPLEMENTED[_e.DAILY]=["byhour"].concat(fi);Br.IMPLEMENTED[_e.WEEKLY]=fi;Br.IMPLEMENTED[_e.MONTHLY]=fi;Br.IMPLEMENTED[_e.YEARLY]=["byweekno","byyearday"].concat(fi);var nb=function(r,e,t,n){return new Br(r,e,t,n).toString()},sb=Br.isFullyConvertible;var hi=function(){function r(e,t,n,s){this.hour=e,this.minute=t,this.second=n,this.millisecond=s||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r}();var ib=function(r){di(e,r);function e(t,n,s,a,o,l,c){var h=r.call(this,a,o,l,c)||this;return h.year=t,h.month=n,h.day=s,h}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return $n.getWeekday(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),s=Lt(this.month,12);this.month=s,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=Du(this.hour,24),o=a.div,l=a.mod;if(o&&(this.hour=l,this.addDaily(o)),ar(s)||Ee(s,this.hour))break}},e.prototype.addMinutes=function(t,n,s,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var o=Du(this.minute,60),l=o.div,c=o.mod;if(l&&(this.minute=c,this.addHours(l,!1,s)),(ar(s)||Ee(s,this.hour))&&(ar(a)||Ee(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,s,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var l=Du(this.second,60),c=l.div,h=l.mod;if(c&&(this.second=h,this.addMinutes(c,!1,s,a)),(ar(s)||Ee(s,this.hour))&&(ar(a)||Ee(a,this.minute))&&(ar(o)||Ee(o,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=$n.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>$n.MAXYEAR))return;t=$n.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var s=t.freq,a=t.interval,o=t.wkst,l=t.byhour,c=t.byminute,h=t.bysecond;switch(s){case _e.YEARLY:return this.addYears(a);case _e.MONTHLY:return this.addMonths(a);case _e.WEEKLY:return this.addWeekly(a,o);case _e.DAILY:return this.addDaily(a);case _e.HOURLY:return this.addHours(a,n,l);case _e.MINUTELY:return this.addMinutes(a,n,l,c);case _e.SECONDLY:return this.addSeconds(a,n,l,c,h)}},e}(hi);function Oh(r){for(var e=[],t=Object.keys(r),n=0,s=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||st(e.byweekno)||st(e.byyearday)||Boolean(e.bymonthday)||st(e.bymonthday)||He(e.byweekday)||He(e.byeaster)))switch(e.freq){case X.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case X.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case X.WEEKLY:e.byweekday=[se.getWeekday(e.dtstart)];break}if(He(e.bymonth)&&!At(e.bymonth)&&(e.bymonth=[e.bymonth]),He(e.byyearday)&&!At(e.byyearday)&&ir(e.byyearday)&&(e.byyearday=[e.byyearday]),!He(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(At(e.bymonthday)){for(var s=[],a=[],t=0;t0?s.push(n):n<0&&a.push(n)}e.bymonthday=s,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(He(e.byweekno)&&!At(e.byweekno)&&(e.byweekno=[e.byweekno]),!He(e.byweekday))e.bynweekday=null;else if(ir(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(kh(e.byweekday))e.byweekday=[lt.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof lt)!e.byweekday.n||e.freq>X.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var o=[],l=[],t=0;tX.MONTHLY?o.push(c.weekday):l.push([c.weekday,c.n])}e.byweekday=st(o)?o:null,e.bynweekday=st(l)?l:null}return He(e.byhour)?ir(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(m=0,h=l.yearlen+Lt(o-e.wkst,7)):h=n-m;for(var g=Math.floor(h/7),T=Lt(h,7),S=Math.floor(g+T/4),v=0;v0&&R<=S){var C=void 0;R>1?(C=m+(R-1)*7,m!==c&&(C-=7-c)):C=m;for(var $=0;$<7&&(l.wnomask[C]=1,C++,l.wdaymask[C]!==e.wkst);$++);}}if(Ee(e.byweekno,1)){var C=m+S*7;if(m!==c&&(C-=7-c),C=4?(De=0,be=Te+Lt(W-e.wkst,7)):be=n-m,B=Math.floor(52+Lt(be,7)/4)}if(Ee(e.byweekno,B))for(var C=0;Ca)return Tn(r);if(B>=t){var W=Eb(B,e);if(!r.accept(W)||l&&(--l,!l))return Tn(r)}}else for(var $=S;$a)return Tn(r);if(B>=t){var W=Eb(B,e);if(!r.accept(W)||l&&(--l,!l))return Tn(r)}}}if(e.interval===0||(c.add(e,R),c.year>se.MAXYEAR))return Tn(r);Ba(n)||(m=h.gettimeset(n)(c.hour,c.minute,c.second,0)),h.rebuild(c.year,c.month)}}function pI(r,e,t){var n=t.bymonth,s=t.byweekno,a=t.byweekday,o=t.byeaster,l=t.bymonthday,c=t.bynmonthday,h=t.byyearday;return st(n)&&!Ee(n,r.mmask[e])||st(s)&&!r.wnomask[e]||st(a)&&!Ee(a,r.wdaymask[e])||st(r.nwdaymask)&&!r.nwdaymask[e]||o!==null&&!Ee(r.eastermask,e)||(st(l)||st(c))&&!Ee(l,r.mdaymask[e])&&!Ee(c,r.nmdaymask[e])||st(h)&&(e=r.yearlen&&!Ee(h,e+1-r.yearlen)&&!Ee(h,-r.nextyearlen+e-r.yearlen))}function Eb(r,e){return new ws(r,e.tzid).rezonedDate()}function Tn(r){return r.getValue()}function mI(r,e,t,n,s){for(var a=!1,o=e;o=X.HOURLY&&st(s)&&!Ee(s,e.hour)||n>=X.MINUTELY&&st(a)&&!Ee(a,e.minute)||n>=X.SECONDLY&&st(o)&&!Ee(o,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var kr={MO:new lt(0),TU:new lt(1),WE:new lt(2),TH:new lt(3),FR:new lt(4),SA:new lt(5),SU:new lt(6)},Ha={freq:_e.YEARLY,dtstart:null,interval:1,wkst:kr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},ub=Object.keys(Ha),X=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new db,this.origOptions=Oh(e);var n=ab(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Ga(e,t)},r.fromText=function(e,t){return rb(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Ou(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Sh("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new _n("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,s){if(n===void 0&&(n=!1),!se.isValidDate(e)||!se.isValidDate(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:e,inc:n};if(s)return this._iter(new Sh("between",a,s));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new _n("between",a)),this._cacheAdd("between",o,a)),o},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!se.isValidDate(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new _n("before",n)),this._cacheAdd("before",s,n)),s},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!se.isValidDate(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new _n("after",n)),this._cacheAdd("after",s,n)),s},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return Ka(this.origOptions)},r.prototype.toText=function(e,t,n){return nb(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return sb(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=_e.YEARLY,r.MONTHLY=_e.MONTHLY,r.WEEKLY=_e.WEEKLY,r.DAILY=_e.DAILY,r.HOURLY=_e.HOURLY,r.MINUTELY=_e.MINUTELY,r.SECONDLY=_e.SECONDLY,r.MO=kr.MO,r.TU=kr.TU,r.WE=kr.WE,r.TH=kr.TH,r.FR=kr.FR,r.SA=kr.SA,r.SU=kr.SU,r.parseString=Va,r.optionsToString=Ka,r}();function Sb(r,e,t,n,s,a){var o={},l=r.accept;function c(T,S){t.forEach(function(v){v.between(T,S,!0).forEach(function(R){o[Number(R)]=!0})})}s.forEach(function(T){var S=new ws(T,a).rezonedDate();o[Number(S)]=!0}),r.accept=function(T){var S=Number(T);return isNaN(S)?l.call(this,T):!o[S]&&(c(new Date(S-1),new Date(S+1)),!o[S])?(o[S]=!0,l.call(this,T)):!0},r.method==="between"&&(c(r.args.after,r.args.before),r.accept=function(T){var S=Number(T);return o[S]?!0:(o[S]=!0,l.call(this,T))});for(var h=0;h1||s.length||a.length||o.length){var m=new xh(h);return m.dtstart(l),m.tzid(c||void 0),n.forEach(function(T){m.rrule(new X(Rh(T,l,c),h))}),s.forEach(function(T){m.rdate(T)}),a.forEach(function(T){m.exrule(new X(Rh(T,l,c),h))}),o.forEach(function(T){m.exdate(T)}),e.compatible&&e.dtstart&&m.rdate(l),m}var g=n[0]||{};return new X(Rh(g,g.dtstart||e.dtstart||l,g.tzid||e.tzid||c),h)}function Mu(r,e){return e===void 0&&(e={}),_I(r,TI(e))}function Rh(r,e,t){return Bt(Bt({},r),{dtstart:e,tzid:t})}function TI(r){var e=[],t=Object.keys(r),n=Object.keys(Ob);if(t.forEach(function(s){Ee(n,s)||e.push(s)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Bt(Bt({},Ob),r)}function bI(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=PT(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function vI(r){var e=bI(r),t=e.name,n=e.value,s=t.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:n}}function wI(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` -`),n=0;n0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function DI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Mb(r,e){return DI(e),r.split(",").map(function(t){return se.untilStringToDate(t)})}function Rb(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;ne in r?Bi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ae=(r,e)=>{for(var t in e||(e={}))nm.call(e,t)&&rm(r,t,e[t]);if(tm)for(var t of tm(e))Rk.call(e,t)&&rm(r,t,e[t]);return r},tr=(r,e)=>Dk(r,Sk(e));var S=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),xk=(r,e)=>{for(var t in e)Bi(r,t,{get:e[t],enumerable:!0})},sm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ok(e))!nm.call(r,s)&&s!==t&&Bi(r,s,{get:()=>e[s],enumerable:!(n=Ek(e,s))||n.enumerable});return r};var Fn=(r,e,t)=>(t=r!=null?kk(Mk(r)):{},sm(e||!r||!r.__esModule?Bi(t,"default",{value:r,enumerable:!0}):t,r)),Pk=r=>sm(Bi({},"__esModule",{value:!0}),r);var J=(r,e,t)=>new Promise((n,s)=>{var a=c=>{try{l(t.next(c))}catch(f){s(f)}},o=c=>{try{l(t.throw(c))}catch(f){s(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);l((t=t.apply(r,e)).next())});var Ie=S(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.matchAnyPattern=Ln.extractTerms=Ln.repeatedTimeunitPattern=void 0;function Ik(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Ln.repeatedTimeunitPattern=Ik;function im(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Ln.extractTerms=im;function Fk(r){return`(?:${im(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Ln.matchAnyPattern=Fk});var Re=S((Il,Fl)=>{(function(r,e){typeof Il=="object"&&typeof Fl!="undefined"?Fl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Il,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",s="second",a="minute",o="hour",l="day",c="week",f="month",p="quarter",g="year",T="date",O="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},$=function(V,q,P){var Q=String(V);return!Q||Q.length>=q?V:""+Array(q+1-Q.length).join(P)+V},B={s:$,z:function(V){var q=-V.utcOffset(),P=Math.abs(q),Q=Math.floor(P/60),Y=P%60;return(q<=0?"+":"-")+$(Q,2,"0")+":"+$(Y,2,"0")},m:function V(q,P){if(q.date(){"use strict";var Lk=Yn&&Yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.findYearClosestToRef=Yn.findMostLikelyADYear=void 0;var Yk=Lk(Re());function Uk(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Yn.findMostLikelyADYear=Uk;function Wk(r,e,t){let n=Yk.default(r),s=n;s=s.month(t-1),s=s.date(e),s=s.year(n.year());let a=s.add(1,"y"),o=s.add(-1,"y");return Math.abs(a.diff(n)){"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.parseTimeUnits=ye.TIME_UNITS_PATTERN=ye.parseYear=ye.YEAR_PATTERN=ye.parseOrdinalNumberPattern=ye.ORDINAL_NUMBER_PATTERN=ye.parseNumberPattern=ye.NUMBER_PATTERN=ye.TIME_UNIT_DICTIONARY=ye.ORDINAL_WORD_DICTIONARY=ye.INTEGER_WORD_DICTIONARY=ye.MONTH_DICTIONARY=ye.FULL_MONTH_NAME_DICTIONARY=ye.WEEKDAY_DICTIONARY=void 0;var Po=Ie(),qk=xt();ye.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};ye.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};ye.MONTH_DICTIONARY=Object.assign(Object.assign({},ye.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});ye.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};ye.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};ye.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};ye.NUMBER_PATTERN=`(?:${Po.matchAnyPattern(ye.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function om(r){let e=r.toLowerCase();return ye.INTEGER_WORD_DICTIONARY[e]!==void 0?ye.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}ye.parseNumberPattern=om;ye.ORDINAL_NUMBER_PATTERN=`(?:${Po.matchAnyPattern(ye.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function jk(r){let e=r.toLowerCase();return ye.ORDINAL_WORD_DICTIONARY[e]!==void 0?ye.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ye.parseOrdinalNumberPattern=jk;ye.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function $k(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return qk.findMostLikelyADYear(e)}ye.parseYear=$k;var um=`(${ye.NUMBER_PATTERN})\\s{0,3}(${Po.matchAnyPattern(ye.TIME_UNIT_DICTIONARY)})`,am=new RegExp(um,"i");ye.TIME_UNITS_PATTERN=Po.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",um);function Gk(r){let e={},t=r,n=am.exec(t);for(;n;)Bk(e,n),t=t.substring(n[0].length).trim(),n=am.exec(t);return e}ye.parseTimeUnits=Gk;function Bk(r,e){let t=om(e[1]),n=ye.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var lm=S((Ll,Yl)=>{(function(r,e){typeof Ll=="object"&&typeof Yl!="undefined"?Yl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Ll,function(){"use strict";var r="month",e="quarter";return function(t,n){var s=n.prototype;s.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var a=s.add;s.add=function(l,c){return l=Number(l),this.$utils().p(c)===e?this.add(3*l,r):a.bind(this)(l,c)};var o=s.startOf;s.startOf=function(l,c){var f=this.$utils(),p=!!f.u(c)||c;if(f.p(l)===e){var g=this.quarter()-1;return p?this.month(3*g).startOf(r).startOf("day"):this.month(3*g+2).endOf(r).endOf("day")}return o.bind(this)(l,c)}}})});var yr=S(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.implySimilarTime=Wr.assignSimilarTime=Wr.assignSimilarDate=Wr.assignTheNextDay=void 0;var cm=pt();function Hk(r,e){e=e.add(1,"day"),dm(r,e),fm(r,e)}Wr.assignTheNextDay=Hk;function dm(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Wr.assignSimilarDate=dm;function zk(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",cm.Meridiem.AM):r.assign("meridiem",cm.Meridiem.PM)}Wr.assignSimilarTime=zk;function fm(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Wr.implySimilarTime=fm});var hm=S(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.toTimezoneOffset=ls.TIMEZONE_ABBR_MAP=void 0;ls.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function Vk(r){var e;return r==null?null:typeof r=="number"?r:(e=ls.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}ls.toTimezoneOffset=Vk});var tt=S(qr=>{"use strict";var pm=qr&&qr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qr,"__esModule",{value:!0});qr.ParsingResult=qr.ParsingComponents=qr.ReferenceWithTimezone=void 0;var Kk=pm(lm()),Ao=pm(Re()),Ul=yr(),Zk=hm();Ao.default.extend(Kk.default);var Wl=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=Zk.toTimezoneOffset(e.timezone))}};qr.ReferenceWithTimezone=Wl;var cs=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let s in t)this.knownValues[s]=t[s];let n=Ao.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new cs(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return Ao.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let s=-e.getTimezoneOffset(),a=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:s;return s-a}static createRelativeFromReference(e,t){let n=Ao.default(e.instant);for(let a in t)n=n.add(t[a],a);let s=new cs(e);return t.hour||t.minute||t.second?(Ul.assignSimilarTime(s,n),Ul.assignSimilarDate(s,n),e.timezoneOffset!==null&&s.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Ul.implySimilarTime(s,n),e.timezoneOffset!==null&&s.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(s.assign("day",n.date()),s.assign("month",n.month()+1),s.assign("year",n.year())):(t.week&&s.imply("weekday",n.day()),s.imply("day",n.date()),t.month?(s.assign("month",n.month()+1),s.assign("year",n.year())):(s.imply("month",n.month()+1),t.year?s.assign("year",n.year()):s.imply("year",n.year())))),s}};qr.ParsingComponents=cs;var Hi=class{constructor(e,t,n,s,a){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=s||new cs(e),this.end=a}clone(){let e=new Hi(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};qr.ParsingResult=Hi});var Z=S(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.AbstractParserWithWordBoundaryChecking=void 0;var ql=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let s=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+s.length,t[0]=t[0].substring(s.length);for(let a=2;a{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var $l=Pt(),Xk=tt(),Qk=Z(),Jk=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${$l.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),eD=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${$l.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),jl=class extends Qk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?eD:Jk}innerExtract(e,t){let n=$l.parseTimeUnits(t[1]);return Xk.ParsingComponents.createRelativeFromReference(e.reference,n)}};Gl.default=jl});var vm=S(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var tD=xt(),Tm=Pt(),bm=Pt(),Co=Pt(),rD=Ie(),nD=Z(),sD=new RegExp(`(?:on\\s{0,3})?(${Co.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${Co.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${rD.matchAnyPattern(Tm.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${bm.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),ym=1,gm=2,iD=3,_m=4,Bl=class extends nD.AbstractParserWithWordBoundaryChecking{innerPattern(){return sD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Tm.MONTH_DICTIONARY[t[iD].toLowerCase()],a=Co.parseOrdinalNumberPattern(t[ym]);if(a>31)return t.index=t.index+t[ym].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[_m]){let o=bm.parseYear(t[_m]);n.start.assign("year",o)}else{let o=tD.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[gm]){let o=Co.parseOrdinalNumberPattern(t[gm]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Hl.default=Bl});var Sm=S(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var aD=xt(),Dm=Pt(),Io=Pt(),Em=Pt(),oD=Ie(),uD=Z(),lD=new RegExp(`(${oD.matchAnyPattern(Dm.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${Io.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Io.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${Em.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),cD=1,dD=2,wm=3,km=4,zl=class extends uD.AbstractParserWithWordBoundaryChecking{innerPattern(){return lD}innerExtract(e,t){let n=Dm.MONTH_DICTIONARY[t[cD].toLowerCase()],s=Io.parseOrdinalNumberPattern(t[dD]);if(s>31)return null;let a=e.createParsingComponents({day:s,month:n});if(t[km]){let c=Em.parseYear(t[km]);a.assign("year",c)}else{let c=aD.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[wm])return a;let o=Io.parseOrdinalNumberPattern(t[wm]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};Vl.default=zl});var Rm=S(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var Kl=Pt(),fD=xt(),hD=Ie(),Mm=Pt(),pD=Z(),mD=new RegExp(`((?:in)\\s*)?(${hD.matchAnyPattern(Kl.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Mm.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),yD=1,gD=2,Om=3,Zl=class extends pD.AbstractParserWithWordBoundaryChecking{innerPattern(){return mD}innerExtract(e,t){let n=t[gD].toLowerCase();if(t[0].length<=3&&!Kl.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index+(t[yD]||"").length,t.index+t[0].length);s.start.imply("day",1);let a=Kl.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[Om]){let o=Mm.parseYear(t[Om]);s.start.assign("year",o)}else{let o=fD.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};Xl.default=Zl});var Am=S(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var Pm=Pt(),_D=Ie(),TD=Z(),bD=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${_D.matchAnyPattern(Pm.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),vD=1,wD=2,xm=3,kD=4,Ql=class extends TD.AbstractParserWithWordBoundaryChecking{innerPattern(){return bD}innerExtract(e,t){let n=t[xm]?parseInt(t[xm]):Pm.MONTH_DICTIONARY[t[wD].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[vD]);return{day:parseInt(t[kD]),month:n,year:s}}};Jl.default=Ql});var Nm=S(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var DD=Z(),ED=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),SD=1,OD=2,ec=class extends DD.AbstractParserWithWordBoundaryChecking{innerPattern(){return ED}innerExtract(e,t){let n=parseInt(t[OD]),s=parseInt(t[SD]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};tc.default=ec});var ds=S(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.AbstractTimeExpressionParser=void 0;var Gt=pt();function MD(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function RD(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Cm=2,Ks=3,Fo=4,Lo=5,zi=6,rc=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let s=t.index+t[1].length,a=t[0].substring(t[1].length),o=e.createParsingResult(s,a,n);t.index+=t[0].length;let l=e.text.substring(t.index),f=this.getFollowingTimePatternThroughCache().exec(l);return a.match(/^\d{3,4}/)&&f&&f[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!f||f[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(o):(o.end=this.extractFollowingTimeComponents(e,f,o),o.end&&(o.text+=f[0]),this.checkAndReturnWithFollowingPattern(o))}extractPrimaryTimeComponents(e,t,n=!1){let s=e.createParsingComponents(),a=0,o=null,l=parseInt(t[Cm]);if(l>100){if(this.strictMode||t[Ks]!=null)return null;a=l%100,l=Math.floor(l/100)}if(l>24)return null;if(t[Ks]!=null){if(t[Ks].length==1&&!t[zi])return null;a=parseInt(t[Ks])}if(a>=60)return null;if(l>12&&(o=Gt.Meridiem.PM),t[zi]!=null){if(l>12)return null;let c=t[zi][0].toLowerCase();c=="a"&&(o=Gt.Meridiem.AM,l==12&&(l=0)),c=="p"&&(o=Gt.Meridiem.PM,l!=12&&(l+=12))}if(s.assign("hour",l),s.assign("minute",a),o!==null?s.assign("meridiem",o):l<12?s.imply("meridiem",Gt.Meridiem.AM):s.imply("meridiem",Gt.Meridiem.PM),t[Lo]!=null){let c=parseInt(t[Lo].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[Fo]!=null){let c=parseInt(t[Fo]);if(c>=60)return null;s.assign("second",c)}return s}extractFollowingTimeComponents(e,t,n){let s=e.createParsingComponents();if(t[Lo]!=null){let c=parseInt(t[Lo].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[Fo]!=null){let c=parseInt(t[Fo]);if(c>=60)return null;s.assign("second",c)}let a=parseInt(t[Cm]),o=0,l=-1;if(t[Ks]!=null?o=parseInt(t[Ks]):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(l=Gt.Meridiem.PM),t[zi]!=null){if(a>12)return null;let c=t[zi][0].toLowerCase();c=="a"&&(l=Gt.Meridiem.AM,a==12&&(a=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),c=="p"&&(l=Gt.Meridiem.PM,a!=12&&(a+=12)),n.start.isCertain("meridiem")||(l==Gt.Meridiem.AM?(n.start.imply("meridiem",Gt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Gt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return s.assign("hour",a),s.assign("minute",o),l>=0?s.assign("meridiem",l):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>a?s.imply("meridiem",Gt.Meridiem.AM):a<=12&&(s.assign("hour",a+12),s.assign("meridiem",Gt.Meridiem.PM)):a>12?s.imply("meridiem",Gt.Meridiem.PM):a<=12&&s.imply("meridiem",Gt.Meridiem.AM),s.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;let a=parseInt(s),o=parseInt(n);if(a>24||o>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=MD(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=RD(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};Yo.AbstractTimeExpressionParser=rc});var Im=S(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});var Uo=pt(),xD=ds(),nc=class extends xD.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Uo.Meridiem.PM)):s<6&&n.assign("meridiem",Uo.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",Uo.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",Uo.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};sc.default=nc});var gr=S(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.addImpliedTimeUnits=Zs.reverseTimeUnits=void 0;function PD(r){let e={};for(let t in r)e[t]=-r[t];return e}Zs.reverseTimeUnits=PD;function AD(r,e){let t=r.clone(),n=r.dayjs();for(let s in e)n=n.add(e[s],s);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}Zs.addImpliedTimeUnits=AD});var Fm=S(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var ac=Pt(),ND=tt(),CD=Z(),ID=gr(),FD=new RegExp(`(${ac.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),LD=new RegExp(`(${ac.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),ic=class extends CD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?LD:FD}innerExtract(e,t){let n=ac.parseTimeUnits(t[1]),s=ID.reverseTimeUnits(n);return ND.ParsingComponents.createRelativeFromReference(e.reference,s)}};oc.default=ic});var Lm=S(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var lc=Pt(),YD=tt(),UD=Z(),WD=new RegExp(`(${lc.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),qD=new RegExp("("+lc.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),jD=1,uc=class extends UD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?qD:WD}innerExtract(e,t){let n=lc.parseTimeUnits(t[jD]);return YD.ParsingComponents.createRelativeFromReference(e.reference,n)}};cc.default=uc});var Qs=S(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.MergingRefiner=Xs.Filter=void 0;var dc=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};Xs.Filter=dc;var fc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0],a=null;for(let o=1;o{console.log(`${this.constructor.name} merged ${c} and ${f} into ${p}`)}),s=p}}return s!=null&&n.push(s),n}};Xs.MergingRefiner=fc});var jr=S(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var $D=Qs(),hc=class extends $D.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(a=>{t.start.isCertain(a)||t.start.assign(a,n.start.get(a))}),t.start.getCertainComponents().forEach(a=>{n.start.isCertain(a)||n.start.assign(a,t.start.get(a))})),t.start.date().getTime()>n.start.date().getTime()){let a=t.start.dayjs(),o=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&a.add(-7,"days").isBefore(o)?(a=a.add(-7,"days"),t.start.imply("day",a.date()),t.start.imply("month",a.month()+1),t.start.imply("year",a.year())):n.start.isOnlyWeekdayComponent()&&o.add(7,"days").isAfter(a)?(o=o.add(7,"days"),n.start.imply("day",o.date()),n.start.imply("month",o.month()+1),n.start.imply("year",o.year())):[n,t]=[t,n]}let s=t.clone();return s.start=t.start,s.end=n.start,s.index=Math.min(t.index,n.index),t.index{"use strict";var GD=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0});var BD=GD(jr()),mc=class extends BD.default{patternBetween(){return/^\s*(to|-)\s*$/i}};Vi.default=mc});var Um=S(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.mergeDateTimeComponent=Js.mergeDateTimeResult=void 0;var HD=pt();function zD(r,e){let t=r.clone(),n=r.start,s=e.start;if(t.start=yc(n,s),r.end!=null||e.end!=null){let a=r.end==null?r.start:r.end,o=e.end==null?e.start:e.end,l=yc(a,o);r.end==null&&l.date().getTime(){"use strict";Object.defineProperty(_c,"__esModule",{value:!0});var VD=Qs(),Wm=Um(),gc=class extends VD.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let s=t.start.isOnlyDate()?Wm.mergeDateTimeResult(t,n):Wm.mergeDateTimeResult(n,t);return s.index=t.index,s.text=t.text+e+n.text,s}};_c.default=gc});var qm=S(Ki=>{"use strict";var KD=Ki&&Ki.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ki,"__esModule",{value:!0});var ZD=KD(ln()),Tc=class extends ZD.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};Ki.default=Tc});var jm=S(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var XD=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),QD={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},bc=class{constructor(e){this.timezone=Object.assign(Object.assign({},QD),e)}refine(e,t){var n;let s=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(a=>{var o,l;let c=e.text.substring(a.index+a.text.length),f=XD.exec(c);if(!f)return;let p=f[1].toUpperCase(),g=(l=(o=s[p])!==null&&o!==void 0?o:this.timezone[p])!==null&&l!==void 0?l:null;if(g===null)return;e.debug(()=>{console.log(`Extracting timezone: '${p}' into: ${g} for: ${a.start}`)});let T=a.start.get("timezoneOffset");T!==null&&g!=T&&(a.start.isCertain("timezoneOffset")||p!=f[1])||a.start.isOnlyDate()&&p!=f[1]||(a.text+=f[0],a.start.isCertain("timezoneOffset")||a.start.assign("timezoneOffset",g),a.end!=null&&!a.end.isCertain("timezoneOffset")&&a.end.assign("timezoneOffset",g))}),t}};vc.default=bc});var Wo=S(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var JD=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),eE=1,tE=2,rE=3,wc=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let s=e.text.substring(n.index+n.text.length),a=JD.exec(s);if(!a)return;e.debug(()=>{console.log(`Extracting timezone: '${a[0]}' into : ${n}`)});let o=parseInt(a[tE]),l=parseInt(a[rE]||"0"),c=o*60+l;c>14*60||(a[eE]==="-"&&(c=-c),n.end!=null&&n.end.assign("timezoneOffset",c),n.start.assign("timezoneOffset",c),n.text+=a[0])}),t}};kc.default=wc});var $m=S(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var Dc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0];for(let a=1;as.text.length&&(s=o):(n.push(s),s=o)}return s!=null&&n.push(s),n}};Ec.default=Dc});var Gm=S(Zi=>{"use strict";var nE=Zi&&Zi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zi,"__esModule",{value:!0});var sE=nE(Re()),Sc=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let s=sE.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&s.isAfter(n.start.dayjs()))for(let a=0;a<3&&s.isAfter(n.start.dayjs());a++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&s.isAfter(n.start.dayjs())&&(s.day()>=n.start.get("weekday")?s=s.day(n.start.get("weekday")+7):s=s.day(n.start.get("weekday")),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(s.day()>n.end.get("weekday")?s=s.day(n.end.get("weekday")+7):s=s.day(n.end.get("weekday")),n.end.imply("day",s.date()),n.end.imply("month",s.month()+1),n.end.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};Zi.default=Sc});var Bm=S(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});var iE=Qs(),Oc=class extends iE.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};Mc.default=Oc});var Pc=S(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var aE=Z(),oE=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),uE=1,lE=2,cE=3,Hm=4,dE=5,zm=6,Vm=7,Km=8,Zm=9,Rc=class extends aE.AbstractParserWithWordBoundaryChecking{innerPattern(){return oE}innerExtract(e,t){let n={};if(n.year=parseInt(t[uE]),n.month=parseInt(t[lE]),n.day=parseInt(t[cE]),t[Hm]!=null)if(n.hour=parseInt(t[Hm]),n.minute=parseInt(t[dE]),t[zm]!=null&&(n.second=parseInt(t[zm])),t[Vm]!=null&&(n.millisecond=parseInt(t[Vm])),t[Km]==null)n.timezoneOffset=0;else{let s=parseInt(t[Km]),a=0;t[Zm]!=null&&(a=parseInt(t[Zm]));let o=s*60;o<0?o-=a:o+=a,n.timezoneOffset=o}return n}};xc.default=Rc});var Xm=S(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var fE=Qs(),Ac=class extends fE.MergingRefiner{mergeResults(e,t,n){let s=n.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Nc.default=Ac});var cn=S(ei=>{"use strict";var fs=ei&&ei.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ei,"__esModule",{value:!0});ei.includeCommonConfiguration=void 0;var hE=fs(jm()),pE=fs(Wo()),Qm=fs($m()),mE=fs(Gm()),yE=fs(Bm()),gE=fs(Pc()),_E=fs(Xm());function TE(r,e=!1){return r.parsers.unshift(new gE.default),r.refiners.unshift(new _E.default),r.refiners.unshift(new hE.default),r.refiners.unshift(new pE.default),r.refiners.unshift(new Qm.default),r.refiners.push(new Qm.default),r.refiners.push(new mE.default),r.refiners.push(new yE.default(e)),r}ei.includeCommonConfiguration=TE});var fn=S(Ne=>{"use strict";var bE=Ne&&Ne.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.noon=Ne.morning=Ne.midnight=Ne.yesterdayEvening=Ne.evening=Ne.lastNight=Ne.tonight=Ne.theDayAfter=Ne.tomorrow=Ne.theDayBefore=Ne.yesterday=Ne.today=Ne.now=void 0;var $r=tt(),ti=bE(Re()),dn=yr(),Xi=pt();function vE(r){let e=ti.default(r.instant),t=new $r.ParsingComponents(r,{});return dn.assignSimilarDate(t,e),dn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Ne.now=vE;function wE(r){let e=ti.default(r.instant),t=new $r.ParsingComponents(r,{});return dn.assignSimilarDate(t,e),dn.implySimilarTime(t,e),t}Ne.today=wE;function kE(r){return Jm(r,1)}Ne.yesterday=kE;function Jm(r,e){return Cc(r,-e)}Ne.theDayBefore=Jm;function DE(r){return Cc(r,1)}Ne.tomorrow=DE;function Cc(r,e){let t=ti.default(r.instant),n=new $r.ParsingComponents(r,{});return t=t.add(e,"day"),dn.assignSimilarDate(n,t),dn.implySimilarTime(n,t),n}Ne.theDayAfter=Cc;function EE(r,e=22){let t=ti.default(r.instant),n=new $r.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",Xi.Meridiem.PM),dn.assignSimilarDate(n,t),n}Ne.tonight=EE;function SE(r,e=0){let t=ti.default(r.instant),n=new $r.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),dn.assignSimilarDate(n,t),n.imply("hour",e),n}Ne.lastNight=SE;function OE(r,e=20){let t=new $r.ParsingComponents(r,{});return t.imply("meridiem",Xi.Meridiem.PM),t.imply("hour",e),t}Ne.evening=OE;function ME(r,e=20){let t=ti.default(r.instant),n=new $r.ParsingComponents(r,{});return t=t.add(-1,"day"),dn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",Xi.Meridiem.PM),n}Ne.yesterdayEvening=ME;function RE(r){let e=new $r.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Ne.midnight=RE;function xE(r,e=6){let t=new $r.ParsingComponents(r,{});return t.imply("meridiem",Xi.Meridiem.AM),t.imply("hour",e),t}Ne.morning=xE;function PE(r){let e=new $r.ParsingComponents(r,{});return e.imply("meridiem",Xi.Meridiem.AM),e.imply("hour",12),e}Ne.noon=PE});var ey=S(Rr=>{"use strict";var AE=Rr&&Rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NE=Rr&&Rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CE=Rr&&Rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AE(e,r,t);return NE(e,r),e},IE=Rr&&Rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rr,"__esModule",{value:!0});var FE=IE(Re()),LE=Z(),YE=yr(),Qi=CE(fn()),UE=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Ic=class extends LE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return UE}innerExtract(e,t){let n=FE.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"now":return Qi.now(e.reference);case"today":return Qi.today(e.reference);case"yesterday":return Qi.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return Qi.tomorrow(e.reference);case"tonight":return Qi.tonight(e.reference);default:s.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),YE.assignSimilarDate(a,n),a.imply("hour",0));break}return a}};Rr.default=Ic});var ty=S(Ji=>{"use strict";var WE=Ji&&Ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ji,"__esModule",{value:!0});var qo=pt(),qE=Z(),jE=WE(Re()),$E=yr(),GE=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Fc=class extends qE.AbstractParserWithWordBoundaryChecking{innerPattern(){return GE}innerExtract(e,t){let n=jE.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":s.imply("meridiem",qo.Meridiem.PM),s.imply("hour",15);break;case"evening":case"night":s.imply("meridiem",qo.Meridiem.PM),s.imply("hour",20);break;case"midnight":$E.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"morning":s.imply("meridiem",qo.Meridiem.AM),s.imply("hour",6);break;case"noon":s.imply("meridiem",qo.Meridiem.AM),s.imply("hour",12);break}return s}};Ji.default=Fc});var hs=S(Un=>{"use strict";var BE=Un&&Un.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Un,"__esModule",{value:!0});Un.toDayJSClosestWeekday=Un.toDayJSWeekday=void 0;var ry=BE(Re());function HE(r,e,t){if(!t)return ny(r,e);let n=ry.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}Un.toDayJSWeekday=HE;function ny(r,e){let t=ry.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var sy=Pt(),zE=Ie(),VE=Z(),KE=hs(),ZE=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${zE.matchAnyPattern(sy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),XE=1,QE=2,JE=3,Lc=class extends VE.AbstractParserWithWordBoundaryChecking{innerPattern(){return ZE}innerExtract(e,t){let n=t[QE].toLowerCase(),s=sy.WEEKDAY_DICTIONARY[n],a=t[XE],o=t[JE],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="last"||l=="past"?c="last":l=="next"?c="next":l=="this"&&(c="this");let f=KE.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};Yc.default=Lc});var uy=S(ea=>{"use strict";var eS=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0});var oy=Pt(),ay=tt(),tS=eS(Re()),rS=Z(),nS=Ie(),sS=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${nS.matchAnyPattern(oy.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),iS=1,aS=2,Uc=class extends rS.AbstractParserWithWordBoundaryChecking{innerPattern(){return sS}innerExtract(e,t){let n=t[iS].toLowerCase(),s=t[aS].toLowerCase(),a=oy.TIME_UNIT_DICTIONARY[s];if(n=="next"||n.startsWith("after")){let c={};return c[a]=1,ay.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="last"||n=="past"){let c={};return c[a]=-1,ay.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=tS.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};ea.default=Uc});var xr=S(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.ParsingContext=si.Chrono=void 0;var ri=tt(),oS=Wc(),ni=class{constructor(e){e=e||oS.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new ni({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let s=this.parse(e,t,n);return s.length>0?s[0].start.date():null}parse(e,t,n){let s=new jo(e,t,n),a=[];return this.parsers.forEach(o=>{let l=ni.executeParser(s,o);a=a.concat(l)}),a.sort((o,l)=>o.index-l.index),this.refiners.forEach(function(o){a=o.refine(s,a)}),a}static executeParser(e,t){let n=[],s=t.pattern(e),a=e.text,o=e.text,l=s.exec(o);for(;l;){let c=l.index+a.length-o.length;l.index=c;let f=t.extract(e,l);if(!f){o=a.substring(l.index+1),l=s.exec(o);continue}let p=null;f instanceof ri.ParsingResult?p=f:f instanceof ri.ParsingComponents?(p=e.createParsingResult(l.index,l[0]),p.start=f):p=e.createParsingResult(l.index,l[0],f),e.debug(()=>console.log(`${t.constructor.name} extracted result ${p}`)),n.push(p),o=a.substring(c+p.text.length),l=s.exec(o)}return n}};si.Chrono=ni;var jo=class{constructor(e,t,n){this.text=e,this.reference=new ri.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof ri.ParsingComponents?e:new ri.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,s){let a=typeof t=="string"?t:this.text.substring(e,t),o=n?this.createParsingComponents(n):null,l=s?this.createParsingComponents(s):null;return new ri.ParsingResult(this.reference,e,a,o,l)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};si.ParsingContext=jo});var ps=S($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});var ly=xt(),uS=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),$o=1,cy=5,dy=2,fy=3,qc=4,jc=class{constructor(e){this.groupNumberMonth=e?fy:dy,this.groupNumberDay=e?dy:fy}pattern(){return uS}extract(e,t){if(t[$o]=="/"||t[cy]=="/"){t.index+=t[0].length;return}let n=t.index+t[$o].length,s=t[0].substr(t[$o].length,t[0].length-t[$o].length-t[cy].length);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[qc]&&t[0].indexOf("/")<0)return;let a=e.createParsingResult(n,s),o=parseInt(t[this.groupNumberMonth]),l=parseInt(t[this.groupNumberDay]);if((o<1||o>12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),t[qc]){let c=parseInt(t[qc]),f=ly.findMostLikelyADYear(c);a.start.assign("year",f)}else{let c=ly.findYearClosestToRef(e.refDate,l,o);a.start.imply("year",c)}return a}};$c.default=jc});var py=S(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var hy=Pt(),lS=tt(),cS=Z(),dS=gr(),fS=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${hy.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Gc=class extends cS.AbstractParserWithWordBoundaryChecking{innerPattern(){return fS}innerExtract(e,t){let n=t[1].toLowerCase(),s=hy.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":s=dS.reverseTimeUnits(s);break}return lS.ParsingComponents.createRelativeFromReference(e.reference,s)}};Bc.default=Gc});var yy=S(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var hS=Qs(),Hc=tt(),pS=Pt(),mS=gr();function my(r){return r.text.match(/\s+(before|from)$/i)!=null}function yS(r){return r.text.match(/\s+(after|since)$/i)!=null}var zc=class extends hS.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!my(t)&&!yS(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let s=pS.parseTimeUnits(t.text);my(t)&&(s=mS.reverseTimeUnits(s));let a=Hc.ParsingComponents.createRelativeFromReference(new Hc.ReferenceWithTimezone(n.start.date()),s);return new Hc.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,a)}};Vc.default=zc});var Wc=S(at=>{"use strict";var Tt=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.createConfiguration=at.createCasualConfiguration=at.parseDate=at.parse=at.GB=at.strict=at.casual=void 0;var gS=Tt(mm()),_S=Tt(vm()),TS=Tt(Sm()),bS=Tt(Rm()),vS=Tt(Am()),wS=Tt(Nm()),kS=Tt(Im()),DS=Tt(Fm()),ES=Tt(Lm()),SS=Tt(Ym()),OS=Tt(qm()),MS=cn(),RS=Tt(ey()),xS=Tt(ty()),PS=Tt(iy()),AS=Tt(uy()),Kc=xr(),NS=Tt(ps()),CS=Tt(py()),IS=Tt(yy());at.casual=new Kc.Chrono(gy(!1));at.strict=new Kc.Chrono(Go(!0,!1));at.GB=new Kc.Chrono(Go(!1,!0));function FS(r,e,t){return at.casual.parse(r,e,t)}at.parse=FS;function LS(r,e,t){return at.casual.parseDate(r,e,t)}at.parseDate=LS;function gy(r=!1){let e=Go(!1,r);return e.parsers.unshift(new RS.default),e.parsers.unshift(new xS.default),e.parsers.unshift(new bS.default),e.parsers.unshift(new AS.default),e.parsers.unshift(new CS.default),e}at.createCasualConfiguration=gy;function Go(r=!0,e=!1){return MS.includeCommonConfiguration({parsers:[new NS.default(e),new gS.default,new _S.default,new TS.default,new PS.default,new vS.default,new wS.default,new kS.default(r),new DS.default(r),new ES.default(r)],refiners:[new IS.default,new OS.default,new SS.default]},r)}at.createConfiguration=Go});var _y=S(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});var YS=ds(),Zc=class extends YS.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Xc.default=Zc});var ta=S(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseTimeUnits=Ue.TIME_UNITS_PATTERN=Ue.parseYear=Ue.YEAR_PATTERN=Ue.parseNumberPattern=Ue.NUMBER_PATTERN=Ue.TIME_UNIT_DICTIONARY=Ue.INTEGER_WORD_DICTIONARY=Ue.MONTH_DICTIONARY=Ue.WEEKDAY_DICTIONARY=void 0;var Qc=Ie(),US=xt();Ue.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Ue.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Ue.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Ue.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Ue.NUMBER_PATTERN=`(?:${Qc.matchAnyPattern(Ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function by(r){let e=r.toLowerCase();return Ue.INTEGER_WORD_DICTIONARY[e]!==void 0?Ue.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Ue.parseNumberPattern=by;Ue.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function WS(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return US.findMostLikelyADYear(e)}Ue.parseYear=WS;var vy=`(${Ue.NUMBER_PATTERN})\\s{0,5}(${Qc.matchAnyPattern(Ue.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ty=new RegExp(vy,"i");Ue.TIME_UNITS_PATTERN=Qc.repeatedTimeunitPattern("",vy);function qS(r){let e={},t=r,n=Ty.exec(t);for(;n;)jS(e,n),t=t.substring(n[0].length),n=Ty.exec(t);return e}Ue.parseTimeUnits=qS;function jS(r,e){let t=by(e[1]),n=Ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var ky=S(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});var wy=ta(),$S=Ie(),GS=Z(),BS=hs(),HS=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${$S.matchAnyPattern(wy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),zS=1,VS=3,KS=2,Jc=class extends GS.AbstractParserWithWordBoundaryChecking{innerPattern(){return HS}innerExtract(e,t){let n=t[KS].toLowerCase(),s=wy.WEEKDAY_DICTIONARY[n],a=t[zS],o=t[VS],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l.match(/letzte/)?c="last":l.match(/chste/)?c="next":l.match(/diese/)&&(c="this");let f=BS.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};ed.default=Jc});var Oy=S(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});var Wn=pt(),ZS=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),XS=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),QS=2,Dy=3,Ey=4,Sy=5,ii=class{pattern(e){return ZS}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ii.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=XS.exec(s);return a&&(n.end=ii.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[QS]),t[Dy]!=null&&(s=parseInt(t[Dy])),s>=60||n>24)return null;if(n>=12&&(a=Wn.Meridiem.PM),t[Sy]!=null){if(n>12)return null;let o=t[Sy].toLowerCase();o.match(/morgen|vormittag/)&&(a=Wn.Meridiem.AM,n==12&&(n=0)),o.match(/nachmittag|abend/)&&(a=Wn.Meridiem.PM,n!=12&&(n+=12)),o.match(/nacht/)&&(n==12?(a=Wn.Meridiem.AM,n=0):n<6?a=Wn.Meridiem.AM:(a=Wn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",Wn.Meridiem.AM):e.imply("meridiem",Wn.Meridiem.PM),t[Ey]!=null){let o=parseInt(t[Ey]);if(o>=60)return null;e.assign("second",o)}return e}};td.default=ii});var My=S(ra=>{"use strict";var JS=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ra,"__esModule",{value:!0});var eO=JS(jr()),rd=class extends eO.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};ra.default=rd});var Ry=S(na=>{"use strict";var tO=na&&na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(na,"__esModule",{value:!0});var rO=tO(ln()),nd=class extends rO.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};na.default=nd});var sd=S(ia=>{"use strict";var nO=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0});var sO=nO(Re()),ms=pt(),iO=Z(),aO=yr(),oO=gr(),sa=class extends iO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=sO.default(e.refDate),s=t[2].toLowerCase(),a=e.createParsingComponents();return aO.implySimilarTime(a,n),sa.extractTimeComponents(a,s)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=oO.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",ms.Meridiem.AM);break}return e}};ia.default=sa});var Ay=S(Pr=>{"use strict";var uO=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),lO=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),cO=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&uO(e,r,t);return lO(e,r),e},Py=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0});var dO=Py(Re()),fO=Z(),ys=yr(),hO=Py(sd()),xy=cO(fn()),pO=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),mO=1,yO=2,id=class extends fO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return pO}innerExtract(e,t){let n=dO.default(e.refDate),s=(t[mO]||"").toLowerCase(),a=(t[yO]||"").toLowerCase(),o=e.createParsingComponents();switch(s){case"jetzt":o=xy.now(e.reference);break;case"heute":o=xy.today(e.reference);break;case"morgen":ys.assignTheNextDay(o,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),ys.assignTheNextDay(o,n);break;case"gestern":n=n.add(-1,"day"),ys.assignSimilarDate(o,n),ys.implySimilarTime(o,n);break;case"vorgestern":n=n.add(-2,"day"),ys.assignSimilarDate(o,n),ys.implySimilarTime(o,n);break;default:s.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),ys.assignSimilarDate(o,n),o.imply("hour",0));break}return a&&(o=hO.default.extractTimeComponents(o,a)),o}};Pr.default=id});var Yy=S(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var gO=xt(),Fy=ta(),Ly=ta(),_O=Ie(),TO=Z(),bO=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${_O.matchAnyPattern(Fy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Ly.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ny=1,Cy=2,vO=3,Iy=4,ad=class extends TO.AbstractParserWithWordBoundaryChecking{innerPattern(){return bO}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Fy.MONTH_DICTIONARY[t[vO].toLowerCase()],a=parseInt(t[Ny]);if(a>31)return t.index=t.index+t[Ny].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Iy]){let o=Ly.parseYear(t[Iy]);n.start.assign("year",o)}else{let o=gO.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Cy]){let o=parseInt(t[Cy]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};od.default=ad});var Uy=S(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var Bo=ta(),wO=tt(),kO=Z(),DO=gr(),EO=Ie(),ud=class extends kO.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${Bo.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${EO.matchAnyPattern(Bo.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?Bo.parseNumberPattern(t[2]):1,s=Bo.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],a={};a[s]=n;let o=t[1]||t[3]||"";if(o=o.toLowerCase(),!!o)return(/vor/.test(o)||/letzte/.test(o)||/vergangen/.test(o))&&(a=DO.reverseTimeUnits(a)),wO.ParsingComponents.createRelativeFromReference(e.reference,a)}};ld.default=ud});var jy=S(bt=>{"use strict";var Ar=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bt,"__esModule",{value:!0});bt.createConfiguration=bt.createCasualConfiguration=bt.parseDate=bt.parse=bt.strict=bt.casual=void 0;var SO=cn(),Wy=xr(),OO=Ar(ps()),MO=Ar(Pc()),RO=Ar(_y()),xO=Ar(ky()),PO=Ar(Oy()),AO=Ar(My()),NO=Ar(Ry()),CO=Ar(Ay()),IO=Ar(sd()),FO=Ar(Yy()),LO=Ar(Uy());bt.casual=new Wy.Chrono(qy());bt.strict=new Wy.Chrono(cd(!0));function YO(r,e,t){return bt.casual.parse(r,e,t)}bt.parse=YO;function UO(r,e,t){return bt.casual.parseDate(r,e,t)}bt.parseDate=UO;function qy(r=!0){let e=cd(!1,r);return e.parsers.unshift(new IO.default),e.parsers.unshift(new CO.default),e.parsers.unshift(new LO.default),e}bt.createCasualConfiguration=qy;function cd(r=!0,e=!0){return SO.includeCommonConfiguration({parsers:[new MO.default,new OO.default(e),new RO.default,new PO.default,new FO.default,new xO.default],refiners:[new AO.default,new NO.default]},r)}bt.createConfiguration=cd});var Gy=S(Nr=>{"use strict";var WO=Nr&&Nr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),qO=Nr&&Nr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),jO=Nr&&Nr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&WO(e,r,t);return qO(e,r),e},$O=Nr&&Nr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nr,"__esModule",{value:!0});var GO=$O(Re()),BO=pt(),HO=Z(),$y=yr(),Ho=jO(fn()),dd=class extends HO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=GO.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"maintenant":return Ho.now(e.reference);case"aujourd'hui":return Ho.today(e.reference);case"hier":return Ho.yesterday(e.reference);case"demain":return Ho.tomorrow(e.reference);default:s.match(/cette\s*nuit/)?($y.assignSimilarDate(a,n),a.imply("hour",22),a.imply("meridiem",BO.Meridiem.PM)):s.match(/la\s*veille/)&&(n=n.add(-1,"day"),$y.assignSimilarDate(a,n),a.imply("hour",0))}return a}};Nr.default=dd});var By=S(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var aa=pt(),zO=Z(),fd=class extends zO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),s=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":s.imply("hour",14),s.imply("minute",0),s.imply("meridiem",aa.Meridiem.PM);break;case"soir":s.imply("hour",18),s.imply("minute",0),s.imply("meridiem",aa.Meridiem.PM);break;case"matin":s.imply("hour",8),s.imply("minute",0),s.imply("meridiem",aa.Meridiem.AM);break;case"a midi":s.imply("hour",12),s.imply("minute",0),s.imply("meridiem",aa.Meridiem.AM);break;case"\xE0 minuit":s.imply("hour",0),s.imply("meridiem",aa.Meridiem.AM);break}return s}};hd.default=fd});var Hy=S(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});var VO=ds(),pd=class extends VO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};md.default=pd});var zy=S(oa=>{"use strict";var KO=oa&&oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oa,"__esModule",{value:!0});var ZO=KO(ln()),yd=class extends ZO.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};oa.default=yd});var Vy=S(ua=>{"use strict";var XO=ua&&ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ua,"__esModule",{value:!0});var QO=XO(jr()),gd=class extends QO.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};ua.default=gd});var qn=S(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.parseTimeUnits=xe.TIME_UNITS_PATTERN=xe.parseYear=xe.YEAR_PATTERN=xe.parseOrdinalNumberPattern=xe.ORDINAL_NUMBER_PATTERN=xe.parseNumberPattern=xe.NUMBER_PATTERN=xe.TIME_UNIT_DICTIONARY=xe.INTEGER_WORD_DICTIONARY=xe.MONTH_DICTIONARY=xe.WEEKDAY_DICTIONARY=void 0;var _d=Ie();xe.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};xe.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};xe.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};xe.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};xe.NUMBER_PATTERN=`(?:${_d.matchAnyPattern(xe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Zy(r){let e=r.toLowerCase();return xe.INTEGER_WORD_DICTIONARY[e]!==void 0?xe.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}xe.parseNumberPattern=Zy;xe.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function JO(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}xe.parseOrdinalNumberPattern=JO;xe.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function eM(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}xe.parseYear=eM;var Xy=`(${xe.NUMBER_PATTERN})\\s{0,5}(${_d.matchAnyPattern(xe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ky=new RegExp(Xy,"i");xe.TIME_UNITS_PATTERN=_d.repeatedTimeunitPattern("",Xy);function tM(r){let e={},t=r,n=Ky.exec(t);for(;n;)rM(e,n),t=t.substring(n[0].length),n=Ky.exec(t);return e}xe.parseTimeUnits=tM;function rM(r,e){let t=Zy(e[1]),n=xe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Jy=S(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var Qy=qn(),nM=Ie(),sM=Z(),iM=hs(),aM=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${nM.matchAnyPattern(Qy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),oM=1,uM=2,Td=class extends sM.AbstractParserWithWordBoundaryChecking{innerPattern(){return aM}innerExtract(e,t){let n=t[oM].toLowerCase(),s=Qy.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[uM];a=a||"",a=a.toLowerCase();let o=null;a=="dernier"?o="last":a=="prochain"&&(o="next");let l=iM.toDayJSWeekday(e.refDate,s,o);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};bd.default=Td});var ng=S(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var la=pt(),lM=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),cM=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),dM=2,eg=3,tg=4,rg=5,ai=class{pattern(e){return lM}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ai.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=cM.exec(s);return a&&(n.end=ai.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[dM]),t[eg]!=null&&(s=parseInt(t[eg])),s>=60||n>24)return null;if(n>=12&&(a=la.Meridiem.PM),t[rg]!=null){if(n>12)return null;let o=t[rg][0].toLowerCase();o=="a"&&(a=la.Meridiem.AM,n==12&&(n=0)),o=="p"&&(a=la.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",la.Meridiem.AM):e.imply("meridiem",la.Meridiem.PM),t[tg]!=null){let o=parseInt(t[tg]);if(o>=60)return null;e.assign("second",o)}return e}};vd.default=ai});var lg=S(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var fM=xt(),og=qn(),ug=qn(),zo=qn(),hM=Ie(),pM=Z(),mM=new RegExp(`(?:on\\s*?)?(${zo.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${zo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${hM.matchAnyPattern(og.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${ug.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),sg=1,ig=2,yM=3,ag=4,wd=class extends pM.AbstractParserWithWordBoundaryChecking{innerPattern(){return mM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=og.MONTH_DICTIONARY[t[yM].toLowerCase()],a=zo.parseOrdinalNumberPattern(t[sg]);if(a>31)return t.index=t.index+t[sg].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[ag]){let o=ug.parseYear(t[ag]);n.start.assign("year",o)}else{let o=fM.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[ig]){let o=zo.parseOrdinalNumberPattern(t[ig]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};kd.default=wd});var dg=S(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var cg=qn(),gM=tt(),_M=Z(),TM=gr(),Dd=class extends _M.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${cg.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=cg.parseTimeUnits(t[1]),s=TM.reverseTimeUnits(n);return gM.ParsingComponents.createRelativeFromReference(e.reference,s)}};Ed.default=Dd});var hg=S(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var fg=qn(),bM=tt(),vM=Z(),Sd=class extends vM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${fg.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=fg.parseTimeUnits(t[1]);return bM.ParsingComponents.createRelativeFromReference(e.reference,n)}};Od.default=Sd});var pg=S(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var Vo=qn(),wM=tt(),kM=Z(),DM=gr(),EM=Ie(),Md=class extends kM.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${Vo.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${EM.matchAnyPattern(Vo.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?Vo.parseNumberPattern(t[1]):1,s=Vo.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],a={};a[s]=n;let o=t[2]||t[4]||"";if(o=o.toLowerCase(),!!o)return(/derni[eè]re?s?/.test(o)||/pass[ée]e?s?/.test(o)||/pr[ée]c[ée]dents?/.test(o))&&(a=DM.reverseTimeUnits(a)),wM.ParsingComponents.createRelativeFromReference(e.reference,a)}};Rd.default=Md});var gg=S(vt=>{"use strict";var _r=vt&&vt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vt,"__esModule",{value:!0});vt.createConfiguration=vt.createCasualConfiguration=vt.parseDate=vt.parse=vt.strict=vt.casual=void 0;var SM=cn(),mg=xr(),OM=_r(Gy()),MM=_r(By()),RM=_r(ps()),xM=_r(Hy()),PM=_r(zy()),AM=_r(Vy()),NM=_r(Jy()),CM=_r(ng()),IM=_r(lg()),FM=_r(dg()),LM=_r(hg()),YM=_r(pg());vt.casual=new mg.Chrono(yg());vt.strict=new mg.Chrono(xd(!0));function UM(r,e,t){return vt.casual.parse(r,e,t)}vt.parse=UM;function WM(r,e,t){return vt.casual.parseDate(r,e,t)}vt.parseDate=WM;function yg(r=!0){let e=xd(!1,r);return e.parsers.unshift(new OM.default),e.parsers.unshift(new MM.default),e.parsers.unshift(new YM.default),e}vt.createCasualConfiguration=yg;function xd(r=!0,e=!0){return SM.includeCommonConfiguration({parsers:[new RM.default(e),new IM.default,new xM.default,new CM.default,new FM.default,new LM.default,new NM.default],refiners:[new PM.default,new AM.default]},r)}vt.createConfiguration=xd});var _g=S(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.toHankaku=void 0;function qM(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,jM)}Ko.toHankaku=qM;function jM(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var bg=S(ca=>{"use strict";var $M=ca&&ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ca,"__esModule",{value:!0});var Pd=_g(),GM=xt(),BM=$M(Re()),HM=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,Tg=1,zM=2,Ad=3,VM=4,KM=5,ZM=6,Nd=class{pattern(){return HM}extract(e,t){let n=parseInt(Pd.toHankaku(t[KM])),s=parseInt(Pd.toHankaku(t[ZM])),a=e.createParsingComponents({day:s,month:n});if(t[Tg]&&t[Tg].match("\u540C|\u4ECA|\u672C")){let o=BM.default(e.refDate);a.assign("year",o.year())}if(t[zM]){let o=t[VM],l=o=="\u5143"?1:parseInt(Pd.toHankaku(o));t[Ad]=="\u4EE4\u548C"?l+=2018:t[Ad]=="\u5E73\u6210"?l+=1988:t[Ad]=="\u662D\u548C"&&(l+=1925),a.assign("year",l)}else{let o=GM.findYearClosestToRef(e.refDate,s,n);a.imply("year",o)}return a}};ca.default=Nd});var vg=S(da=>{"use strict";var XM=da&&da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(da,"__esModule",{value:!0});var QM=XM(jr()),Cd=class extends QM.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};da.default=Cd});var kg=S(Cr=>{"use strict";var JM=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),eR=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),tR=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&JM(e,r,t);return eR(e,r),e},rR=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var nR=rR(Re()),wg=pt(),Id=tR(fn()),sR=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Fd=class{pattern(){return sR}extract(e,t){let n=t[0],s=nR.default(e.refDate),a=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Id.yesterday(e.reference);case"\u660E\u65E5":return Id.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Id.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(a.imply("hour",22),a.assign("meridiem",wg.Meridiem.PM)):n.match("\u4ECA\u671D")&&(a.imply("hour",6),a.assign("meridiem",wg.Meridiem.AM)),a.assign("day",s.date()),a.assign("month",s.month()+1),a.assign("year",s.year()),a}};Cr.default=Fd});var Sg=S(wt=>{"use strict";var Ld=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0});wt.createConfiguration=wt.createCasualConfiguration=wt.parseDate=wt.parse=wt.strict=wt.casual=void 0;var iR=Ld(bg()),aR=Ld(vg()),oR=Ld(kg()),Dg=xr();wt.casual=new Dg.Chrono(Eg());wt.strict=new Dg.Chrono(Yd());function uR(r,e,t){return wt.casual.parse(r,e,t)}wt.parse=uR;function lR(r,e,t){return wt.casual.parseDate(r,e,t)}wt.parseDate=lR;function Eg(){let r=Yd();return r.parsers.unshift(new oR.default),r}wt.createCasualConfiguration=Eg;function Yd(){return{parsers:[new iR.default],refiners:[new aR.default]}}wt.createConfiguration=Yd});var Zo=S(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.parseYear=Gr.YEAR_PATTERN=Gr.MONTH_DICTIONARY=Gr.WEEKDAY_DICTIONARY=void 0;Gr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Gr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Gr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function cR(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Gr.parseYear=cR});var Mg=S(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var Og=Zo(),dR=Ie(),fR=Z(),hR=hs(),pR=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${dR.matchAnyPattern(Og.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),mR=1,yR=2,gR=3,Ud=class extends fR.AbstractParserWithWordBoundaryChecking{innerPattern(){return pR}innerExtract(e,t){let n=t[yR].toLowerCase(),s=Og.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[mR],o=t[gR],l=a||o||"";l=l.toLowerCase();let c=null;l=="passado"?c="this":l=="pr\xF3ximo"||l=="proximo"?c="next":l=="este"&&(c="this");let f=hR.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};Wd.default=Ud});var Rg=S(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var _R=ds(),qd=class extends _R.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};jd.default=qd});var xg=S(fa=>{"use strict";var TR=fa&&fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fa,"__esModule",{value:!0});var bR=TR(ln()),$d=class extends bR.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};fa.default=$d});var Pg=S(ha=>{"use strict";var vR=ha&&ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ha,"__esModule",{value:!0});var wR=vR(jr()),Gd=class extends wR.default{patternBetween(){return/^\s*(?:-)\s*$/i}};ha.default=Gd});var Lg=S(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var kR=xt(),Ig=Zo(),Fg=Zo(),DR=Ie(),ER=Z(),SR=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${DR.matchAnyPattern(Ig.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Fg.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Ag=1,Ng=2,OR=3,Cg=4,Bd=class extends ER.AbstractParserWithWordBoundaryChecking{innerPattern(){return SR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Ig.MONTH_DICTIONARY[t[OR].toLowerCase()],a=parseInt(t[Ag]);if(a>31)return t.index=t.index+t[Ag].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Cg]){let o=Fg.parseYear(t[Cg]);n.start.assign("year",o)}else{let o=kR.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Ng]){let o=parseInt(t[Ng]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Hd.default=Bd});var Yg=S(hn=>{"use strict";var MR=hn&&hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),RR=hn&&hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),xR=hn&&hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&MR(e,r,t);return RR(e,r),e};Object.defineProperty(hn,"__esModule",{value:!0});var PR=Z(),Xo=xR(fn()),zd=class extends PR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"agora":return Xo.now(e.reference);case"hoje":return Xo.today(e.reference);case"amanha":case"amanh\xE3":return Xo.tomorrow(e.reference);case"ontem":return Xo.yesterday(e.reference)}return s}};hn.default=zd});var Ug=S(pa=>{"use strict";var AR=pa&&pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pa,"__esModule",{value:!0});var Qo=pt(),NR=Z(),CR=yr(),IR=AR(Re()),Vd=class extends NR.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=IR.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":s.imply("meridiem",Qo.Meridiem.PM),s.imply("hour",15);break;case"noite":s.imply("meridiem",Qo.Meridiem.PM),s.imply("hour",22);break;case"manha":case"manh\xE3":s.imply("meridiem",Qo.Meridiem.AM),s.imply("hour",6);break;case"meia-noite":CR.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"meio-dia":s.imply("meridiem",Qo.Meridiem.AM),s.imply("hour",12);break}return s}};pa.default=Vd});var jg=S(kt=>{"use strict";var jn=kt&&kt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kt,"__esModule",{value:!0});kt.createConfiguration=kt.createCasualConfiguration=kt.parseDate=kt.parse=kt.strict=kt.casual=void 0;var FR=cn(),Wg=xr(),LR=jn(ps()),YR=jn(Mg()),UR=jn(Rg()),WR=jn(xg()),qR=jn(Pg()),jR=jn(Lg()),$R=jn(Yg()),GR=jn(Ug());kt.casual=new Wg.Chrono(qg());kt.strict=new Wg.Chrono(Kd(!0));function BR(r,e,t){return kt.casual.parse(r,e,t)}kt.parse=BR;function HR(r,e,t){return kt.casual.parseDate(r,e,t)}kt.parseDate=HR;function qg(r=!0){let e=Kd(!1,r);return e.parsers.push(new $R.default),e.parsers.push(new GR.default),e}kt.createCasualConfiguration=qg;function Kd(r=!0,e=!0){return FR.includeCommonConfiguration({parsers:[new LR.default(e),new YR.default,new UR.default,new jR.default],refiners:[new WR.default,new qR.default]},r)}kt.createConfiguration=Kd});var $g=S(ma=>{"use strict";var zR=ma&&ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ma,"__esModule",{value:!0});var VR=zR(jr()),Zd=class extends VR.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};ma.default=Zd});var Gg=S(ya=>{"use strict";var KR=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var ZR=KR(ln()),Xd=class extends ZR.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};ya.default=Xd});var Bg=S(pn=>{"use strict";var XR=pn&&pn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),QR=pn&&pn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),JR=pn&&pn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&XR(e,r,t);return QR(e,r),e};Object.defineProperty(pn,"__esModule",{value:!0});var ex=Z(),Jo=JR(fn()),Qd=class extends ex.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"nu":return Jo.now(e.reference);case"vandaag":return Jo.today(e.reference);case"morgen":case"morgend":return Jo.tomorrow(e.reference);case"gisteren":return Jo.yesterday(e.reference)}return s}};pn.default=Qd});var Hg=S(ga=>{"use strict";var tx=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var eu=pt(),rx=Z(),nx=tx(Re()),sx=yr(),ix=1,ax=2,Jd=class extends rx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=nx.default(e.refDate),s=e.createParsingComponents();switch(t[ix]==="deze"&&(s.assign("day",e.refDate.getDate()),s.assign("month",e.refDate.getMonth()+1),s.assign("year",e.refDate.getFullYear())),t[ax].toLowerCase()){case"namiddag":case"'s namiddags":s.imply("meridiem",eu.Meridiem.PM),s.imply("hour",15);break;case"avond":case"'s avonds'":s.imply("meridiem",eu.Meridiem.PM),s.imply("hour",20);break;case"middernacht":sx.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"ochtend":case"'s ochtends":s.imply("meridiem",eu.Meridiem.AM),s.imply("hour",6);break;case"middag":case"'s middags":s.imply("meridiem",eu.Meridiem.AM),s.imply("hour",12);break}return s}};ga.default=Jd});var rr=S(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.parseTimeUnits=ve.TIME_UNITS_PATTERN=ve.parseYear=ve.YEAR_PATTERN=ve.parseOrdinalNumberPattern=ve.ORDINAL_NUMBER_PATTERN=ve.parseNumberPattern=ve.NUMBER_PATTERN=ve.TIME_UNIT_DICTIONARY=ve.ORDINAL_WORD_DICTIONARY=ve.INTEGER_WORD_DICTIONARY=ve.MONTH_DICTIONARY=ve.WEEKDAY_DICTIONARY=void 0;var tu=Ie(),ox=xt();ve.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};ve.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};ve.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};ve.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};ve.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};ve.NUMBER_PATTERN=`(?:${tu.matchAnyPattern(ve.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function Vg(r){let e=r.toLowerCase();return ve.INTEGER_WORD_DICTIONARY[e]!==void 0?ve.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}ve.parseNumberPattern=Vg;ve.ORDINAL_NUMBER_PATTERN=`(?:${tu.matchAnyPattern(ve.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function ux(r){let e=r.toLowerCase();return ve.ORDINAL_WORD_DICTIONARY[e]!==void 0?ve.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}ve.parseOrdinalNumberPattern=ux;ve.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function lx(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return ox.findMostLikelyADYear(e)}ve.parseYear=lx;var Kg=`(${ve.NUMBER_PATTERN})\\s{0,5}(${tu.matchAnyPattern(ve.TIME_UNIT_DICTIONARY)})\\s{0,5}`,zg=new RegExp(Kg,"i");ve.TIME_UNITS_PATTERN=tu.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Kg);function cx(r){let e={},t=r,n=zg.exec(t);for(;n;)dx(e,n),t=t.substring(n[0].length),n=zg.exec(t);return e}ve.parseTimeUnits=cx;function dx(r,e){let t=Vg(e[1]),n=ve.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Xg=S(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});var Zg=rr(),fx=tt(),hx=Z(),ef=class extends hx.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Zg.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Zg.parseTimeUnits(t[1]);return fx.ParsingComponents.createRelativeFromReference(e.reference,n)}};tf.default=ef});var Jg=S(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var Qg=rr(),px=Ie(),mx=Z(),yx=hs(),gx=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${px.matchAnyPattern(Qg.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),_x=1,Tx=2,bx=3,rf=class extends mx.AbstractParserWithWordBoundaryChecking{innerPattern(){return gx}innerExtract(e,t){let n=t[Tx].toLowerCase(),s=Qg.WEEKDAY_DICTIONARY[n],a=t[_x],o=t[bx],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="vorige"?c="last":l=="volgende"?c="next":l=="deze"&&(c="this");let f=yx.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};nf.default=rf});var i_=S(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});var vx=xt(),n_=rr(),ru=rr(),s_=rr(),wx=Ie(),kx=Z(),Dx=new RegExp(`(?:on\\s*?)?(${ru.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${ru.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+wx.matchAnyPattern(n_.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${s_.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ex=3,e_=1,t_=2,r_=4,sf=class extends kx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Dx}innerExtract(e,t){let n=n_.MONTH_DICTIONARY[t[Ex].toLowerCase()],s=ru.parseOrdinalNumberPattern(t[e_]);if(s>31)return t.index=t.index+t[e_].length,null;let a=e.createParsingComponents({day:s,month:n});if(t[r_]){let c=s_.parseYear(t[r_]);a.assign("year",c)}else{let c=vx.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[t_])return a;let o=ru.parseOrdinalNumberPattern(t[t_]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};af.default=sf});var l_=S(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});var o_=rr(),Sx=xt(),Ox=Ie(),u_=rr(),Mx=Z(),Rx=new RegExp(`(${Ox.matchAnyPattern(o_.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${u_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),xx=1,a_=2,of=class extends Mx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Rx}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let s=t[xx],a=o_.MONTH_DICTIONARY[s.toLowerCase()];if(n.assign("month",a),t[a_]){let o=u_.parseYear(t[a_]);n.assign("year",o)}else{let o=Sx.findYearClosestToRef(e.refDate,1,a);n.imply("year",o)}return n}};uf.default=of});var c_=S(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var Px=Z(),Ax=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Nx=1,Cx=2,lf=class extends Px.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ax}innerExtract(e,t){let n=parseInt(t[Cx]),s=parseInt(t[Nx]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};cf.default=lf});var d_=S(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var Ix=ds(),df=class extends Ix.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};ff.default=df});var p_=S(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var h_=rr(),Fx=Ie(),Lx=Z(),Yx=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Fx.matchAnyPattern(h_.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Ux=1,Wx=2,f_=3,qx=4,hf=class extends Lx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Yx}innerExtract(e,t){let n=t[f_]?parseInt(t[f_]):h_.MONTH_DICTIONARY[t[Wx].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[Ux]);return{day:parseInt(t[qx]),month:n,year:s}}};pf.default=hf});var m_=S(_a=>{"use strict";var jx=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0});var $x=Z(),nu=pt(),mf=yr(),Gx=jx(Re()),Bx=1,Hx=2,yf=class extends $x.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[Bx].toLowerCase(),s=t[Hx].toLowerCase(),a=e.createParsingComponents(),o=Gx.default(e.refDate);switch(n){case"gisteren":mf.assignSimilarDate(a,o.add(-1,"day"));break;case"van":mf.assignSimilarDate(a,o);break;case"morgen":mf.assignTheNextDay(a,o);break}switch(s){case"ochtend":a.imply("meridiem",nu.Meridiem.AM),a.imply("hour",6);break;case"middag":a.imply("meridiem",nu.Meridiem.AM),a.imply("hour",12);break;case"namiddag":a.imply("meridiem",nu.Meridiem.PM),a.imply("hour",15);break;case"avond":a.imply("meridiem",nu.Meridiem.PM),a.imply("hour",20);break}return a}};_a.default=yf});var g_=S(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var y_=rr(),zx=tt(),Vx=Z(),Kx=gr(),Zx=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${y_.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),gf=class extends Vx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Zx}innerExtract(e,t){let n=t[1].toLowerCase(),s=y_.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":s=Kx.reverseTimeUnits(s);break}return zx.ParsingComponents.createRelativeFromReference(e.reference,s)}};_f.default=gf});var b_=S(Ta=>{"use strict";var Xx=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var T_=rr(),__=tt(),Qx=Xx(Re()),Jx=Z(),eP=Ie(),tP=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${eP.matchAnyPattern(T_.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),rP=1,nP=2,Tf=class extends Jx.AbstractParserWithWordBoundaryChecking{innerPattern(){return tP}innerExtract(e,t){let n=t[rP].toLowerCase(),s=t[nP].toLowerCase(),a=T_.TIME_UNIT_DICTIONARY[s];if(n=="volgend"||n=="volgende"||n=="komende"){let c={};return c[a]=1,__.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="afgelopen"||n=="vorige"){let c={};return c[a]=-1,__.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=Qx.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/maand/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/jaar/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Ta.default=Tf});var v_=S(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var vf=rr(),sP=tt(),iP=Z(),aP=gr(),oP=new RegExp("("+vf.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),uP=new RegExp("("+vf.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),bf=class extends iP.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?uP:oP}innerExtract(e,t){let n=vf.parseTimeUnits(t[1]),s=aP.reverseTimeUnits(n);return sP.ParsingComponents.createRelativeFromReference(e.reference,s)}};wf.default=bf});var w_=S(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var Df=rr(),lP=tt(),cP=Z(),dP=new RegExp("("+Df.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),fP=new RegExp("("+Df.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),hP=1,kf=class extends cP.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?fP:dP}innerExtract(e,t){let n=Df.parseTimeUnits(t[hP]);return lP.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ef.default=kf});var S_=S(Dt=>{"use strict";var At=Dt&&Dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.createConfiguration=Dt.createCasualConfiguration=Dt.parseDate=Dt.parse=Dt.strict=Dt.casual=void 0;var pP=cn(),k_=xr(),mP=At($g()),yP=At(Gg()),gP=At(Bg()),_P=At(Hg()),TP=At(ps()),bP=At(Xg()),vP=At(Jg()),wP=At(i_()),D_=At(l_()),kP=At(c_()),DP=At(d_()),EP=At(p_()),SP=At(m_()),OP=At(g_()),MP=At(b_()),RP=At(v_()),xP=At(w_());Dt.casual=new k_.Chrono(E_());Dt.strict=new k_.Chrono(Sf(!0));function PP(r,e,t){return Dt.casual.parse(r,e,t)}Dt.parse=PP;function AP(r,e,t){return Dt.casual.parseDate(r,e,t)}Dt.parseDate=AP;function E_(r=!0){let e=Sf(!1,r);return e.parsers.unshift(new gP.default),e.parsers.unshift(new _P.default),e.parsers.unshift(new SP.default),e.parsers.unshift(new D_.default),e.parsers.unshift(new MP.default),e.parsers.unshift(new OP.default),e}Dt.createCasualConfiguration=E_;function Sf(r=!0,e=!0){return pP.includeCommonConfiguration({parsers:[new TP.default(e),new bP.default,new wP.default,new D_.default,new vP.default,new EP.default,new kP.default,new DP.default(r),new RP.default(r),new xP.default(r)],refiners:[new yP.default,new mP.default]},r)}Dt.createConfiguration=Sf});var x_=S(ba=>{"use strict";var NP=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var CP=NP(Re()),IP=Z(),FP=1,O_=2,LP=3,M_=4,R_=5,YP=6,Of=class extends IP.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=CP.default(e.refDate),o=a;if(t[FP])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[O_]){let l=t[O_],c=t[LP];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day")),c=="\u65E9"||c=="\u671D"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[M_]){let c=t[M_][0];c=="\u65E9"||c=="\u671D"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"||c=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[R_]){let l=t[R_];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day"));let c=t[YP];if(c){let f=c[0];f=="\u65E9"||f=="\u671D"||f=="\u4E0A"?s.start.imply("hour",6):f=="\u4E0B"||f=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):f=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):f=="\u591C"||f=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):f=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};ba.default=Of});var oi=S(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.zhStringToYear=Vt.zhStringToNumber=Vt.WEEKDAY_OFFSET=Vt.NUMBER=void 0;Vt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};Vt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function UP(r){let e=0;for(let t=0;t{"use strict";var qP=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var jP=qP(Re()),$P=Z(),gs=oi(),Mf=1,P_=2,Rf=3,xf=class extends $P.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(gs.NUMBER).join("")+"]{4}|["+Object.keys(gs.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(gs.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(gs.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=jP.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[P_]);if(isNaN(a)&&(a=gs.zhStringToNumber(t[P_])),s.start.assign("month",a),t[Rf]){let o=parseInt(t[Rf]);isNaN(o)&&(o=gs.zhStringToNumber(t[Rf])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[Mf]){let o=parseInt(t[Mf]);isNaN(o)&&(o=gs.zhStringToYear(t[Mf])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};va.default=xf});var C_=S(wa=>{"use strict";var GP=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var BP=GP(Re()),HP=Z(),N_=oi(),zP=new RegExp("(\\d+|["+Object.keys(N_.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Pf=1,VP=2,Af=class extends HP.AbstractParserWithWordBoundaryChecking{innerPattern(){return zP}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Pf]);if(isNaN(s)&&(s=N_.zhStringToNumber(t[Pf])),isNaN(s)){let c=t[Pf];if(c==="\u5E7E")s=3;else if(c==="\u534A")s=.5;else return null}let a=BP.default(e.refDate),l=t[VP][0];return l.match(/[日天星禮月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u79AE"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u9418")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};wa.default=Af});var F_=S(ka=>{"use strict";var KP=ka&&ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ka,"__esModule",{value:!0});var ZP=KP(Re()),XP=Z(),I_=oi(),QP=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(I_.WEEKDAY_OFFSET).join("|")+")"),Nf=class extends XP.AbstractParserWithWordBoundaryChecking{innerPattern(){return QP}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=I_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":(l=="\u4ECA"||l=="\u9019"||l=="\u5462")&&(o="this");let c=ZP.default(e.refDate),f=!1,p=c.day();return o=="last"||o=="past"?(c=c.day(a-7),f=!0):o=="next"?(c=c.day(a+7),f=!0):o=="this"?c=c.day(a):Math.abs(a-7-p){"use strict";var JP=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var eA=JP(Re()),tA=Z(),br=oi(),rA=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),nA=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),su=1,iu=2,au=3,ou=4,uu=5,lu=6,Tr=7,ui=8,cu=9,Cf=class extends tA.AbstractParserWithWordBoundaryChecking{innerPattern(){return rA}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=eA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[su]){var o=t[su];o=="\u660E"||o=="\u807D"?n.hour()>1&&a.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a.add(-1,"day"):o=="\u524D"?a.add(-2,"day"):o=="\u5927\u524D"?a.add(-3,"day"):o=="\u5F8C"?a.add(2,"day"):o=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[ou]){var l=t[ou];l=="\u660E"||l=="\u807D"?a.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?a.add(-1,"day"):l=="\u524D"?a.add(-2,"day"):l=="\u5927\u524D"?a.add(-3,"day"):l=="\u5F8C"?a.add(2,"day"):l=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let c=0,f=0,p=-1;if(t[ui]){var g=parseInt(t[ui]);if(isNaN(g)&&(g=br.zhStringToNumber(t[ui])),g>=60)return null;s.start.assign("second",g)}if(c=parseInt(t[lu]),isNaN(c)&&(c=br.zhStringToNumber(t[lu])),t[Tr]?t[Tr]=="\u534A"?f=30:t[Tr]=="\u6B63"||t[Tr]=="\u6574"?f=0:(f=parseInt(t[Tr]),isNaN(f)&&(f=br.zhStringToNumber(t[Tr]))):c>100&&(f=c%100,c=Math.floor(c/100)),f>=60||c>24)return null;if(c>=12&&(p=1),t[cu]){if(c>12)return null;var T=t[cu][0].toLowerCase();T=="a"&&(p=0,c==12&&(c=0)),T=="p"&&(p=1,c!=12&&(c+=12))}else if(t[iu]){var O=t[iu],v=O[0];v=="\u671D"||v=="\u65E9"?(p=0,c==12&&(c=0)):v=="\u665A"&&(p=1,c!=12&&(c+=12))}else if(t[au]){var R=t[au],C=R[0];C=="\u4E0A"||C=="\u671D"||C=="\u65E9"||C=="\u51CC"?(p=0,c==12&&(c=0)):(C=="\u4E0B"||C=="\u664F"||C=="\u665A")&&(p=1,c!=12&&(c+=12))}else if(t[uu]){var $=t[uu],B=$[0];B=="\u4E0A"||B=="\u671D"||B=="\u65E9"||B=="\u51CC"?(p=0,c==12&&(c=0)):(B=="\u4E0B"||B=="\u664F"||B=="\u665A")&&(p=1,c!=12&&(c+=12))}if(s.start.assign("hour",c),s.start.assign("minute",f),p>=0?s.start.assign("meridiem",p):c<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=nA.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let W=a.clone();if(s.end=e.createParsingComponents(),t[su]){var o=t[su];o=="\u660E"||o=="\u807D"?n.hour()>1&&W.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?W.add(-1,"day"):o=="\u524D"?W.add(-2,"day"):o=="\u5927\u524D"?W.add(-3,"day"):o=="\u5F8C"?W.add(2,"day"):o=="\u5927\u5F8C"&&W.add(3,"day"),s.end.assign("day",W.date()),s.end.assign("month",W.month()+1),s.end.assign("year",W.year())}else if(t[ou]){var l=t[ou];l=="\u660E"||l=="\u807D"?W.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?W.add(-1,"day"):l=="\u524D"?W.add(-2,"day"):l=="\u5927\u524D"?W.add(-3,"day"):l=="\u5F8C"?W.add(2,"day"):l=="\u5927\u5F8C"&&W.add(3,"day"),s.end.assign("day",W.date()),s.end.assign("month",W.month()+1),s.end.assign("year",W.year())}else s.end.imply("day",W.date()),s.end.imply("month",W.month()+1),s.end.imply("year",W.year());if(c=0,f=0,p=-1,t[ui]){var g=parseInt(t[ui]);if(isNaN(g)&&(g=br.zhStringToNumber(t[ui])),g>=60)return null;s.end.assign("second",g)}if(c=parseInt(t[lu]),isNaN(c)&&(c=br.zhStringToNumber(t[lu])),t[Tr]?t[Tr]=="\u534A"?f=30:t[Tr]=="\u6B63"||t[Tr]=="\u6574"?f=0:(f=parseInt(t[Tr]),isNaN(f)&&(f=br.zhStringToNumber(t[Tr]))):c>100&&(f=c%100,c=Math.floor(c/100)),f>=60||c>24)return null;if(c>=12&&(p=1),t[cu]){if(c>12)return null;var T=t[cu][0].toLowerCase();T=="a"&&(p=0,c==12&&(c=0)),T=="p"&&(p=1,c!=12&&(c+=12)),s.start.isCertain("meridiem")||(p==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[iu]){var O=t[iu],v=O[0];v=="\u671D"||v=="\u65E9"?(p=0,c==12&&(c=0)):v=="\u665A"&&(p=1,c!=12&&(c+=12))}else if(t[au]){var R=t[au],C=R[0];C=="\u4E0A"||C=="\u671D"||C=="\u65E9"||C=="\u51CC"?(p=0,c==12&&(c=0)):(C=="\u4E0B"||C=="\u664F"||C=="\u665A")&&(p=1,c!=12&&(c+=12))}else if(t[uu]){var $=t[uu],B=$[0];B=="\u4E0A"||B=="\u671D"||B=="\u65E9"||B=="\u51CC"?(p=0,c==12&&(c=0)):(B=="\u4E0B"||B=="\u664F"||B=="\u665A")&&(p=1,c!=12&&(c+=12))}return s.text=s.text+t[0],s.end.assign("hour",c),s.end.assign("minute",f),p>=0?s.end.assign("meridiem",p):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>c?s.end.imply("meridiem",0):c>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var sA=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var iA=sA(Re()),aA=Z(),Y_=oi(),oA=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Y_.WEEKDAY_OFFSET).join("|")+")"),If=class extends aA.AbstractParserWithWordBoundaryChecking{innerPattern(){return oA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=Y_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=iA.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var uA=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var lA=uA(jr()),Ff=class extends lA.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};Sa.default=Ff});var q_=S(Oa=>{"use strict";var cA=Oa&&Oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oa,"__esModule",{value:!0});var dA=cA(ln()),Lf=class extends dA.default{patternBetween(){return/^\s*$/i}};Oa.default=Lf});var j_=S(ot=>{"use strict";var mn=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.createConfiguration=ot.createCasualConfiguration=ot.parseDate=ot.parse=ot.strict=ot.casual=ot.hant=void 0;var Yf=xr(),fA=mn(Wo()),hA=cn(),pA=mn(x_()),mA=mn(A_()),yA=mn(C_()),gA=mn(F_()),_A=mn(L_()),TA=mn(U_()),bA=mn(W_()),vA=mn(q_());ot.hant=new Yf.Chrono(Uf());ot.casual=new Yf.Chrono(Uf());ot.strict=new Yf.Chrono(Wf());function wA(r,e,t){return ot.casual.parse(r,e,t)}ot.parse=wA;function kA(r,e,t){return ot.casual.parseDate(r,e,t)}ot.parseDate=kA;function Uf(){let r=Wf();return r.parsers.unshift(new pA.default),r}ot.createCasualConfiguration=Uf;function Wf(){let r=hA.includeCommonConfiguration({parsers:[new mA.default,new gA.default,new TA.default,new _A.default,new yA.default],refiners:[new bA.default,new vA.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof fA.default)),r}ot.createConfiguration=Wf});var H_=S(Ma=>{"use strict";var DA=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var EA=DA(Re()),SA=Z(),OA=1,$_=2,MA=3,G_=4,B_=5,RA=6,qf=class extends SA.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=EA.default(e.refDate),o=a;if(t[OA])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[$_]){let l=t[$_],c=t[MA];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day")),c=="\u65E9"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[G_]){let c=t[G_][0];c=="\u65E9"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[B_]){let l=t[B_];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day"));let c=t[RA];if(c){let f=c[0];f=="\u65E9"||f=="\u4E0A"?s.start.imply("hour",6):f=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):f=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):f=="\u591C"||f=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):f=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};Ma.default=qf});var li=S(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.zhStringToYear=Kt.zhStringToNumber=Kt.WEEKDAY_OFFSET=Kt.NUMBER=void 0;Kt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Kt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function xA(r){let e=0;for(let t=0;t{"use strict";var AA=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var NA=AA(Re()),CA=Z(),_s=li(),jf=1,z_=2,$f=3,Gf=class extends CA.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(_s.NUMBER).join("")+"]{4}|["+Object.keys(_s.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(_s.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(_s.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=NA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[z_]);if(isNaN(a)&&(a=_s.zhStringToNumber(t[z_])),s.start.assign("month",a),t[$f]){let o=parseInt(t[$f]);isNaN(o)&&(o=_s.zhStringToNumber(t[$f])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[jf]){let o=parseInt(t[jf]);isNaN(o)&&(o=_s.zhStringToYear(t[jf])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};Ra.default=Gf});var Z_=S(xa=>{"use strict";var IA=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var FA=IA(Re()),LA=Z(),K_=li(),YA=new RegExp("(\\d+|["+Object.keys(K_.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),Bf=1,UA=2,Hf=class extends LA.AbstractParserWithWordBoundaryChecking{innerPattern(){return YA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Bf]);if(isNaN(s)&&(s=K_.zhStringToNumber(t[Bf])),isNaN(s)){let c=t[Bf];if(c==="\u51E0")s=3;else if(c==="\u534A")s=.5;else return null}let a=FA.default(e.refDate),l=t[UA][0];return l.match(/[日天星礼月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u793C"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u949F")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};xa.default=Hf});var Q_=S(Pa=>{"use strict";var WA=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var qA=WA(Re()),jA=Z(),X_=li(),$A=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(X_.WEEKDAY_OFFSET).join("|")+")"),zf=class extends jA.AbstractParserWithWordBoundaryChecking{innerPattern(){return $A}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=X_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":l=="\u8FD9"&&(o="this");let c=qA.default(e.refDate),f=!1,p=c.day();return o=="last"||o=="past"?(c=c.day(a-7),f=!0):o=="next"?(c=c.day(a+7),f=!0):o=="this"?c=c.day(a):Math.abs(a-7-p){"use strict";var GA=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var BA=GA(Re()),HA=Z(),wr=li(),zA=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),VA=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),du=1,fu=2,hu=3,pu=4,mu=5,yu=6,vr=7,ci=8,gu=9,Vf=class extends HA.AbstractParserWithWordBoundaryChecking{innerPattern(){return zA}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=BA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[du]){let p=t[du];p=="\u660E"?n.hour()>1&&a.add(1,"day"):p=="\u6628"?a.add(-1,"day"):p=="\u524D"?a.add(-2,"day"):p=="\u5927\u524D"?a.add(-3,"day"):p=="\u540E"?a.add(2,"day"):p=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[pu]){let p=t[pu];p=="\u660E"?a.add(1,"day"):p=="\u6628"?a.add(-1,"day"):p=="\u524D"?a.add(-2,"day"):p=="\u5927\u524D"?a.add(-3,"day"):p=="\u540E"?a.add(2,"day"):p=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let o=0,l=0,c=-1;if(t[ci]){let p=parseInt(t[ci]);if(isNaN(p)&&(p=wr.zhStringToNumber(t[ci])),p>=60)return null;s.start.assign("second",p)}if(o=parseInt(t[yu]),isNaN(o)&&(o=wr.zhStringToNumber(t[yu])),t[vr]?t[vr]=="\u534A"?l=30:t[vr]=="\u6B63"||t[vr]=="\u6574"?l=0:(l=parseInt(t[vr]),isNaN(l)&&(l=wr.zhStringToNumber(t[vr]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[gu]){if(o>12)return null;let p=t[gu][0].toLowerCase();p=="a"&&(c=0,o==12&&(o=0)),p=="p"&&(c=1,o!=12&&(o+=12))}else if(t[fu]){let g=t[fu][0];g=="\u65E9"?(c=0,o==12&&(o=0)):g=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[hu]){let g=t[hu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[mu]){let g=t[mu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}if(s.start.assign("hour",o),s.start.assign("minute",l),c>=0?s.start.assign("meridiem",c):o<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=VA.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let f=a.clone();if(s.end=e.createParsingComponents(),t[du]){let p=t[du];p=="\u660E"?n.hour()>1&&f.add(1,"day"):p=="\u6628"?f.add(-1,"day"):p=="\u524D"?f.add(-2,"day"):p=="\u5927\u524D"?f.add(-3,"day"):p=="\u540E"?f.add(2,"day"):p=="\u5927\u540E"&&f.add(3,"day"),s.end.assign("day",f.date()),s.end.assign("month",f.month()+1),s.end.assign("year",f.year())}else if(t[pu]){let p=t[pu];p=="\u660E"?f.add(1,"day"):p=="\u6628"?f.add(-1,"day"):p=="\u524D"?f.add(-2,"day"):p=="\u5927\u524D"?f.add(-3,"day"):p=="\u540E"?f.add(2,"day"):p=="\u5927\u540E"&&f.add(3,"day"),s.end.assign("day",f.date()),s.end.assign("month",f.month()+1),s.end.assign("year",f.year())}else s.end.imply("day",f.date()),s.end.imply("month",f.month()+1),s.end.imply("year",f.year());if(o=0,l=0,c=-1,t[ci]){let p=parseInt(t[ci]);if(isNaN(p)&&(p=wr.zhStringToNumber(t[ci])),p>=60)return null;s.end.assign("second",p)}if(o=parseInt(t[yu]),isNaN(o)&&(o=wr.zhStringToNumber(t[yu])),t[vr]?t[vr]=="\u534A"?l=30:t[vr]=="\u6B63"||t[vr]=="\u6574"?l=0:(l=parseInt(t[vr]),isNaN(l)&&(l=wr.zhStringToNumber(t[vr]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[gu]){if(o>12)return null;let p=t[gu][0].toLowerCase();p=="a"&&(c=0,o==12&&(o=0)),p=="p"&&(c=1,o!=12&&(o+=12)),s.start.isCertain("meridiem")||(c==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[fu]){let g=t[fu][0];g=="\u65E9"?(c=0,o==12&&(o=0)):g=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[hu]){let g=t[hu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[mu]){let g=t[mu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}return s.text=s.text+t[0],s.end.assign("hour",o),s.end.assign("minute",l),c>=0?s.end.assign("meridiem",c):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>o?s.end.imply("meridiem",0):o>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var KA=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var ZA=KA(Re()),XA=Z(),eT=li(),QA=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(eT.WEEKDAY_OFFSET).join("|")+")"),Kf=class extends XA.AbstractParserWithWordBoundaryChecking{innerPattern(){return QA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=eT.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=ZA.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var JA=Ca&&Ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ca,"__esModule",{value:!0});var eN=JA(jr()),Zf=class extends eN.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};Ca.default=Zf});var nT=S(Ia=>{"use strict";var tN=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var rN=tN(ln()),Xf=class extends rN.default{patternBetween(){return/^\s*$/i}};Ia.default=Xf});var sT=S(ut=>{"use strict";var yn=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});ut.createConfiguration=ut.createCasualConfiguration=ut.parseDate=ut.parse=ut.strict=ut.casual=ut.hans=void 0;var Qf=xr(),nN=yn(Wo()),sN=cn(),iN=yn(H_()),aN=yn(V_()),oN=yn(Z_()),uN=yn(Q_()),lN=yn(J_()),cN=yn(tT()),dN=yn(rT()),fN=yn(nT());ut.hans=new Qf.Chrono(Jf());ut.casual=new Qf.Chrono(Jf());ut.strict=new Qf.Chrono(eh());function hN(r,e,t){return ut.casual.parse(r,e,t)}ut.parse=hN;function pN(r,e,t){return ut.casual.parseDate(r,e,t)}ut.parseDate=pN;function Jf(){let r=eh();return r.parsers.unshift(new iN.default),r}ut.createCasualConfiguration=Jf;function eh(){let r=sN.includeCommonConfiguration({parsers:[new aN.default,new uN.default,new cN.default,new lN.default,new oN.default],refiners:[new dN.default,new fN.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof nN.default)),r}ut.createConfiguration=eh});var aT=S(nr=>{"use strict";var iT=nr&&nr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mN=nr&&nr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),yN=nr&&nr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&iT(e,r,t)},gN=nr&&nr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&iT(e,r,t);return mN(e,r),e};Object.defineProperty(nr,"__esModule",{value:!0});nr.hans=void 0;yN(j_(),nr);nr.hans=gN(sT())});var Zt=S(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.parseTimeUnits=fe.TIME_UNITS_PATTERN=fe.parseYear=fe.YEAR_PATTERN=fe.parseOrdinalNumberPattern=fe.ORDINAL_NUMBER_PATTERN=fe.parseNumberPattern=fe.NUMBER_PATTERN=fe.TIME_UNIT_DICTIONARY=fe.ORDINAL_WORD_DICTIONARY=fe.INTEGER_WORD_DICTIONARY=fe.MONTH_DICTIONARY=fe.FULL_MONTH_NAME_DICTIONARY=fe.WEEKDAY_DICTIONARY=fe.REGEX_PARTS=void 0;var _u=Ie(),_N=xt();fe.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};fe.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};fe.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};fe.MONTH_DICTIONARY=Object.assign(Object.assign({},fe.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});fe.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};fe.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};fe.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};fe.NUMBER_PATTERN=`(?:${_u.matchAnyPattern(fe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function uT(r){let e=r.toLowerCase();return fe.INTEGER_WORD_DICTIONARY[e]!==void 0?fe.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}fe.parseNumberPattern=uT;fe.ORDINAL_NUMBER_PATTERN=`(?:${_u.matchAnyPattern(fe.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function TN(r){let e=r.toLowerCase();return fe.ORDINAL_WORD_DICTIONARY[e]!==void 0?fe.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}fe.parseOrdinalNumberPattern=TN;var th="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";fe.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${th}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${th}|[5-9][0-9]${th})`;function bN(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return _N.findMostLikelyADYear(e)}fe.parseYear=bN;var lT=`(${fe.NUMBER_PATTERN})\\s{0,3}(${_u.matchAnyPattern(fe.TIME_UNIT_DICTIONARY)})`,oT=new RegExp(lT,"i");fe.TIME_UNITS_PATTERN=_u.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",lT);function vN(r){let e={},t=r,n=oT.exec(t);for(;n;)wN(e,n),t=t.substring(n[0].length).trim(),n=oT.exec(t);return e}fe.parseTimeUnits=vN;function wN(r,e){let t=uT(e[1]),n=fe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var dT=S(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var Fa=Zt(),kN=tt(),DN=Z(),cT=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Fa.TIME_UNITS_PATTERN})${Fa.REGEX_PARTS.rightBoundary}`,EN=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${cT}`,Fa.REGEX_PARTS.flags),SN=new RegExp(cT,"i"),rh=class extends DN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Fa.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?SN:EN}innerExtract(e,t){let n=Fa.parseTimeUnits(t[1]);return kN.ParsingComponents.createRelativeFromReference(e.reference,n)}};nh.default=rh});var yT=S(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var ON=xt(),La=Zt(),mT=Zt(),Tu=Zt(),MN=Ie(),RN=Z(),xN=new RegExp(`(?:\u0441)?\\s*(${Tu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Tu.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${MN.matchAnyPattern(La.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${mT.YEAR_PATTERN}(?![^\\s]\\d)))?${La.REGEX_PARTS.rightBoundary}`,La.REGEX_PARTS.flags),fT=1,hT=2,PN=3,pT=4,sh=class extends RN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return La.REGEX_PARTS.leftBoundary}innerPattern(){return xN}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=La.MONTH_DICTIONARY[t[PN].toLowerCase()],a=Tu.parseOrdinalNumberPattern(t[fT]);if(a>31)return t.index=t.index+t[fT].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[pT]){let o=mT.parseYear(t[pT]);n.start.assign("year",o)}else{let o=ON.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[hT]){let o=Tu.parseOrdinalNumberPattern(t[hT]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};ih.default=sh});var TT=S(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var Ya=Zt(),AN=xt(),NN=Ie(),_T=Zt(),CN=Z(),IN=new RegExp(`((?:\u0432)\\s*)?(${NN.matchAnyPattern(Ya.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${_T.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,Ya.REGEX_PARTS.flags),FN=2,gT=3,ah=class extends CN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ya.REGEX_PARTS.leftBoundary}innerPattern(){return IN}innerExtract(e,t){let n=t[FN].toLowerCase();if(t[0].length<=3&&!Ya.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index,t.index+t[0].length);s.start.imply("day",1);let a=Ya.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[gT]){let o=_T.parseYear(t[gT]);s.start.assign("year",o)}else{let o=AN.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};oh.default=ah});var vT=S(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var bu=pt(),LN=ds(),bT=Zt(),uh=class extends LN.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return bT.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${bT.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",bu.Meridiem.PM)):s<6&&n.assign("meridiem",bu.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",bu.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",bu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};lh.default=uh});var wT=S(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var vu=Zt(),YN=tt(),UN=Z(),WN=gr(),qN=new RegExp(`(${vu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,vu.REGEX_PARTS.flags),ch=class extends UN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return vu.REGEX_PARTS.leftBoundary}innerPattern(){return qN}innerExtract(e,t){let n=vu.parseTimeUnits(t[1]),s=WN.reverseTimeUnits(n);return YN.ParsingComponents.createRelativeFromReference(e.reference,s)}};dh.default=ch});var kT=S(Ua=>{"use strict";var jN=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var $N=jN(jr()),fh=class extends $N.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};Ua.default=fh});var DT=S(Wa=>{"use strict";var GN=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var BN=GN(ln()),hh=class extends BN.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};Wa.default=hh});var ET=S(gn=>{"use strict";var HN=gn&&gn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),zN=gn&&gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),VN=gn&&gn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&HN(e,r,t);return zN(e,r),e};Object.defineProperty(gn,"__esModule",{value:!0});var KN=Z(),qa=VN(fn()),ph=Zt(),ZN=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${ph.REGEX_PARTS.rightBoundary}`,ph.REGEX_PARTS.flags),mh=class extends KN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ph.REGEX_PARTS.leftBoundary}innerPattern(e){return ZN}innerExtract(e,t){let n=t[1].toLowerCase(),s=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return qa.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return qa.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return qa.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return qa.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return qa.theDayBefore(e.reference,2)}return s}};gn.default=mh});var ST=S(Ir=>{"use strict";var XN=Ir&&Ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),QN=Ir&&Ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),JN=Ir&&Ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&XN(e,r,t);return QN(e,r),e},eC=Ir&&Ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ir,"__esModule",{value:!0});var tC=Z(),Ts=JN(fn()),rC=yr(),nC=eC(Re()),yh=Zt(),sC=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${yh.REGEX_PARTS.rightBoundary}`,yh.REGEX_PARTS.flags),gh=class extends tC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return yh.REGEX_PARTS.leftBoundary}innerPattern(){return sC}innerExtract(e,t){let n=nC.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();if(s==="\u0441\u0435\u0439\u0447\u0430\u0441")return Ts.now(e.reference);if(s==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||s==="\u0432\u0435\u0447\u0435\u0440\u0430")return Ts.evening(e.reference);if(s.endsWith("\u0443\u0442\u0440\u043E\u043C")||s.endsWith("\u0443\u0442\u0440\u0430"))return Ts.morning(e.reference);if(s.match(/в\s*полдень/))return Ts.noon(e.reference);if(s.match(/прошлой\s*ночью/))return Ts.lastNight(e.reference);if(s.match(/прошлым\s*вечером/))return Ts.yesterdayEvening(e.reference);if(s.match(/следующей\s*ночью/)){let o=n.hour()<22?1:2;n=n.add(o,"day"),rC.assignSimilarDate(a,n),a.imply("hour",0)}return s.match(/в\s*полночь/)||s.endsWith("\u043D\u043E\u0447\u044C\u044E")?Ts.midnight(e.reference):a}};Ir.default=gh});var OT=S(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var ja=Zt(),iC=Ie(),aC=Z(),oC=hs(),uC=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${iC.matchAnyPattern(ja.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${ja.REGEX_PARTS.rightBoundary}`,ja.REGEX_PARTS.flags),lC=1,cC=2,dC=3,_h=class extends aC.AbstractParserWithWordBoundaryChecking{innerPattern(){return uC}patternLeftBoundary(){return ja.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[cC].toLowerCase(),s=ja.WEEKDAY_DICTIONARY[n],a=t[lC],o=t[dC],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||l=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||l=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?c="last":l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?c="next":(l=="\u044D\u0442\u043E\u0442"||l=="\u044D\u0442\u0443"||l=="\u044D\u0442\u043E\u0439")&&(c="this");let f=oC.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};Th.default=_h});var RT=S(Ga=>{"use strict";var fC=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var $a=Zt(),MT=tt(),hC=fC(Re()),pC=Z(),mC=Ie(),yC=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${mC.matchAnyPattern($a.TIME_UNIT_DICTIONARY)})(?=\\s*)${$a.REGEX_PARTS.rightBoundary}`,$a.REGEX_PARTS.flags),gC=1,_C=2,bh=class extends pC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return $a.REGEX_PARTS.leftBoundary}innerPattern(){return yC}innerExtract(e,t){let n=t[gC].toLowerCase(),s=t[_C].toLowerCase(),a=$a.TIME_UNIT_DICTIONARY[s];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let c={};return c[a]=1,MT.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let c={};return c[a]=-1,MT.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=hC.default(e.reference.instant);return a.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):a.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):a.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Ga.default=bh});var xT=S(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var Ba=Zt(),TC=tt(),bC=Z(),vC=gr(),wC=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${Ba.TIME_UNITS_PATTERN})${Ba.REGEX_PARTS.rightBoundary}`,Ba.REGEX_PARTS.flags),vh=class extends bC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ba.REGEX_PARTS.leftBoundary}innerPattern(){return wC}innerExtract(e,t){let n=t[1].toLowerCase(),s=Ba.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":s=vC.reverseTimeUnits(s);break}return TC.ParsingComponents.createRelativeFromReference(e.reference,s)}};wh.default=vh});var NT=S(Et=>{"use strict";var sr=Et&&Et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Et,"__esModule",{value:!0});Et.createConfiguration=Et.createCasualConfiguration=Et.parseDate=Et.parse=Et.strict=Et.casual=void 0;var kC=sr(dT()),DC=sr(yT()),EC=sr(TT()),SC=sr(vT()),OC=sr(wT()),MC=sr(kT()),RC=sr(DT()),xC=cn(),PC=sr(ET()),AC=sr(ST()),NC=sr(OT()),CC=sr(RT()),PT=xr(),IC=sr(ps()),FC=sr(xT());Et.casual=new PT.Chrono(AT());Et.strict=new PT.Chrono(kh(!0));function LC(r,e,t){return Et.casual.parse(r,e,t)}Et.parse=LC;function YC(r,e,t){return Et.casual.parseDate(r,e,t)}Et.parseDate=YC;function AT(){let r=kh(!1);return r.parsers.unshift(new PC.default),r.parsers.unshift(new AC.default),r.parsers.unshift(new EC.default),r.parsers.unshift(new CC.default),r.parsers.unshift(new FC.default),r}Et.createCasualConfiguration=AT;function kh(r=!0){return xC.includeCommonConfiguration({parsers:[new IC.default(!0),new kC.default,new DC.default,new NC.default,new SC.default(r),new OC.default],refiners:[new RC.default,new MC.default]},r)}Et.createConfiguration=kh});var pt=S(ge=>{"use strict";var UC=ge&&ge.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),WC=ge&&ge.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),$n=ge&&ge.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&UC(e,r,t);return WC(e,r),e};Object.defineProperty(ge,"__esModule",{value:!0});ge.parseDate=ge.parse=ge.casual=ge.strict=ge.ru=ge.zh=ge.nl=ge.pt=ge.ja=ge.fr=ge.de=ge.Meridiem=ge.Chrono=ge.en=void 0;var Dh=$n(Wc());ge.en=Dh;var qC=xr();Object.defineProperty(ge,"Chrono",{enumerable:!0,get:function(){return qC.Chrono}});var jC;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(jC=ge.Meridiem||(ge.Meridiem={}));var $C=$n(jy());ge.de=$C;var GC=$n(gg());ge.fr=GC;var BC=$n(Sg());ge.ja=BC;var HC=$n(jg());ge.pt=HC;var zC=$n(S_());ge.nl=zC;var VC=$n(aT());ge.zh=VC;var KC=$n(NT());ge.ru=KC;ge.strict=Dh.strict;ge.casual=Dh.casual;function ZC(r,e,t){return ge.casual.parse(r,e,t)}ge.parse=ZC;function XC(r,e,t){return ge.casual.parseDate(r,e,t)}ge.parseDate=XC});var wu=S((Eh,di)=>{(function(r,e){typeof Eh=="object"&&typeof di!="undefined"?di.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(Eh,function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function s(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,u){return Object.prototype.hasOwnProperty.call(i,u)}function o(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var u;for(u in i)if(a(i,u))return!1;return!0}function l(i){return i===void 0}function c(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function f(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function p(i,u){var d=[],h,m=i.length;for(h=0;h>>0,h;for(h=0;h0)for(d=0;d=0;return(b?d?"+":"":"-")+Math.pow(10,Math.max(0,m)).toString().substr(1)+h}var w=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,k=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},M={};function D(i,u,d,h){var m=h;typeof h=="string"&&(m=function(){return this[h]()}),i&&(M[i]=m),u&&(M[u[0]]=function(){return _(m.apply(this,arguments),u[1],u[2])}),d&&(M[d]=function(){return this.localeData().ordinal(m.apply(this,arguments),i)})}function I(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function A(i){var u=i.match(w),d,h;for(d=0,h=u.length;d=0&&k.test(i);)i=i.replace(k,h),k.lastIndex=0,d-=1;return i}var De={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function pe(i){var u=this._longDateFormat[i],d=this._longDateFormat[i.toUpperCase()];return u||!d?u:(this._longDateFormat[i]=d.match(w).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[i])}var le="Invalid date";function Ce(){return this._invalidDate}var K="%d",qe=/\d{1,2}/;function Xe(i){return this._ordinal.replace("%d",i)}var ct={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Or(i,u,d,h){var m=this._relativeTime[d];return V(m)?m(i,u,d,h):m.replace(/%d/i,i)}function it(i,u){var d=this._relativeTime[i>0?"future":"past"];return V(d)?d(u):d.replace(/%s/i,u)}var je={};function dt(i,u){var d=i.toLowerCase();je[d]=je[d+"s"]=je[u]=i}function gt(i){return typeof i=="string"?je[i]||je[i.toLowerCase()]:void 0}function Mn(i){var u={},d,h;for(h in i)a(i,h)&&(d=gt(h),d&&(u[d]=i[h]));return u}var Li={};function $e(i,u){Li[i]=u}function qs(i){var u=[],d;for(d in i)a(i,d)&&u.push({unit:d,priority:Li[d]});return u.sort(function(h,m){return h.priority-m.priority}),u}function ts(i){return i%4===0&&i%100!==0||i%400===0}function ft(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function ce(i){var u=+i,d=0;return u!==0&&isFinite(u)&&(d=ft(u)),d}function Jr(i,u){return function(d){return d!=null?(rs(this,i,d),e.updateOffset(this,u),this):Rt(this,i)}}function Rt(i,u){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+u]():NaN}function rs(i,u,d){i.isValid()&&!isNaN(d)&&(u==="FullYear"&&ts(i.year())&&i.month()===1&&i.date()===29?(d=ce(d),i._d["set"+(i._isUTC?"UTC":"")+u](d,i.month(),_o(d,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+u](d))}function po(i){return i=gt(i),V(this[i])?this[i]():this}function Ur(i,u){if(typeof i=="object"){i=Mn(i);var d=qs(i),h,m=d.length;for(h=0;h68?1900:2e3)};var kp=Jr("FullYear",!0);function ow(){return ts(this.year())}function uw(i,u,d,h,m,b,x){var te;return i<100&&i>=0?(te=new Date(i+400,u,d,h,m,b,x),isFinite(te.getFullYear())&&te.setFullYear(i)):te=new Date(i,u,d,h,m,b,x),te}function Wi(i){var u,d;return i<100&&i>=0?(d=Array.prototype.slice.call(arguments),d[0]=i+400,u=new Date(Date.UTC.apply(null,d)),isFinite(u.getUTCFullYear())&&u.setUTCFullYear(i)):u=new Date(Date.UTC.apply(null,arguments)),u}function To(i,u,d){var h=7+u-d,m=(7+Wi(i,0,h).getUTCDay()-u)%7;return-m+h-1}function Dp(i,u,d,h,m){var b=(7+d-h)%7,x=To(i,h,m),te=1+7*(u-1)+b+x,me,Ye;return te<=0?(me=i-1,Ye=Ui(me)+te):te>Ui(i)?(me=i+1,Ye=te-Ui(i)):(me=i,Ye=te),{year:me,dayOfYear:Ye}}function qi(i,u,d){var h=To(i.year(),u,d),m=Math.floor((i.dayOfYear()-h-1)/7)+1,b,x;return m<1?(x=i.year()-1,b=m+rn(x,u,d)):m>rn(i.year(),u,d)?(b=m-rn(i.year(),u,d),x=i.year()+1):(x=i.year(),b=m),{week:b,year:x}}function rn(i,u,d){var h=To(i,u,d),m=To(i+1,u,d);return(Ui(i)-h+m)/7}D("w",["ww",2],"wo","week"),D("W",["WW",2],"Wo","isoWeek"),dt("week","w"),dt("isoWeek","W"),$e("week",5),$e("isoWeek",5),H("w",Le),H("ww",Le,_t),H("W",Le),H("WW",Le,_t),mr(["w","ww","W","WW"],function(i,u,d,h){u[h.substr(0,1)]=ce(i)});function lw(i){return qi(i,this._week.dow,this._week.doy).week}var cw={dow:0,doy:6};function dw(){return this._week.dow}function fw(){return this._week.doy}function hw(i){var u=this.localeData().week(this);return i==null?u:this.add((i-u)*7,"d")}function pw(i){var u=qi(this,1,4).week;return i==null?u:this.add((i-u)*7,"d")}D("d",0,"do","day"),D("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),D("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),D("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),D("e",0,0,"weekday"),D("E",0,0,"isoWeekday"),dt("day","d"),dt("weekday","e"),dt("isoWeekday","E"),$e("day",11),$e("weekday",11),$e("isoWeekday",11),H("d",Le),H("e",Le),H("E",Le),H("dd",function(i,u){return u.weekdaysMinRegex(i)}),H("ddd",function(i,u){return u.weekdaysShortRegex(i)}),H("dddd",function(i,u){return u.weekdaysRegex(i)}),mr(["dd","ddd","dddd"],function(i,u,d,h){var m=d._locale.weekdaysParse(i,h,d._strict);m!=null?u.d=m:v(d).invalidWeekday=i}),mr(["d","e","E"],function(i,u,d,h){u[h]=ce(i)});function mw(i,u){return typeof i!="string"?i:isNaN(i)?(i=u.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function yw(i,u){return typeof i=="string"?u.weekdaysParse(i)%7||7:isNaN(i)?null:i}function gl(i,u){return i.slice(u,7).concat(i.slice(0,u))}var gw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ep="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_w="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Tw=hr,bw=hr,vw=hr;function ww(i,u){var d=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(u)?"format":"standalone"];return i===!0?gl(d,this._week.dow):i?d[i.day()]:d}function kw(i){return i===!0?gl(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function Dw(i){return i===!0?gl(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function Ew(i,u,d){var h,m,b,x=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)b=T([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(b,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(b,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(b,"").toLocaleLowerCase();return d?u==="dddd"?(m=nt.call(this._weekdaysParse,x),m!==-1?m:null):u==="ddd"?(m=nt.call(this._shortWeekdaysParse,x),m!==-1?m:null):(m=nt.call(this._minWeekdaysParse,x),m!==-1?m:null):u==="dddd"?(m=nt.call(this._weekdaysParse,x),m!==-1||(m=nt.call(this._shortWeekdaysParse,x),m!==-1)?m:(m=nt.call(this._minWeekdaysParse,x),m!==-1?m:null)):u==="ddd"?(m=nt.call(this._shortWeekdaysParse,x),m!==-1||(m=nt.call(this._weekdaysParse,x),m!==-1)?m:(m=nt.call(this._minWeekdaysParse,x),m!==-1?m:null)):(m=nt.call(this._minWeekdaysParse,x),m!==-1||(m=nt.call(this._weekdaysParse,x),m!==-1)?m:(m=nt.call(this._shortWeekdaysParse,x),m!==-1?m:null))}function Sw(i,u,d){var h,m,b;if(this._weekdaysParseExact)return Ew.call(this,i,u,d);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(m=T([2e3,1]).day(h),d&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(m,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(m,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(m,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[h]||(b="^"+this.weekdays(m,"")+"|^"+this.weekdaysShort(m,"")+"|^"+this.weekdaysMin(m,""),this._weekdaysParse[h]=new RegExp(b.replace(".",""),"i")),d&&u==="dddd"&&this._fullWeekdaysParse[h].test(i))return h;if(d&&u==="ddd"&&this._shortWeekdaysParse[h].test(i))return h;if(d&&u==="dd"&&this._minWeekdaysParse[h].test(i))return h;if(!d&&this._weekdaysParse[h].test(i))return h}}function Ow(i){if(!this.isValid())return i!=null?this:NaN;var u=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=mw(i,this.localeData()),this.add(i-u,"d")):u}function Mw(i){if(!this.isValid())return i!=null?this:NaN;var u=(this.day()+7-this.localeData()._week.dow)%7;return i==null?u:this.add(i-u,"d")}function Rw(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var u=yw(i,this.localeData());return this.day(this.day()%7?u:u-7)}else return this.day()||7}function xw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||_l.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Tw),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Pw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||_l.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=bw),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Aw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||_l.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=vw),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function _l(){function i($t,un){return un.length-$t.length}var u=[],d=[],h=[],m=[],b,x,te,me,Ye;for(b=0;b<7;b++)x=T([2e3,1]).day(b),te=ht(this.weekdaysMin(x,"")),me=ht(this.weekdaysShort(x,"")),Ye=ht(this.weekdays(x,"")),u.push(te),d.push(me),h.push(Ye),m.push(te),m.push(me),m.push(Ye);u.sort(i),d.sort(i),h.sort(i),m.sort(i),this._weekdaysRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+u.join("|")+")","i")}function Tl(){return this.hours()%12||12}function Nw(){return this.hours()||24}D("H",["HH",2],0,"hour"),D("h",["hh",2],0,Tl),D("k",["kk",2],0,Nw),D("hmm",0,0,function(){return""+Tl.apply(this)+_(this.minutes(),2)}),D("hmmss",0,0,function(){return""+Tl.apply(this)+_(this.minutes(),2)+_(this.seconds(),2)}),D("Hmm",0,0,function(){return""+this.hours()+_(this.minutes(),2)}),D("Hmmss",0,0,function(){return""+this.hours()+_(this.minutes(),2)+_(this.seconds(),2)});function Sp(i,u){D(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),u)})}Sp("a",!0),Sp("A",!1),dt("hour","h"),$e("hour",13);function Op(i,u){return u._meridiemParse}H("a",Op),H("A",Op),H("H",Le),H("h",Le),H("k",Le),H("HH",Le,_t),H("hh",Le,_t),H("kk",Le,_t),H("hmm",xn),H("hmmss",js),H("Hmm",xn),H("Hmmss",js),Pe(["H","HH"],re),Pe(["k","kk"],function(i,u,d){var h=ce(i);u[re]=h===24?0:h}),Pe(["a","A"],function(i,u,d){d._isPm=d._locale.isPM(i),d._meridiem=i}),Pe(["h","hh"],function(i,u,d){u[re]=ce(i),v(d).bigHour=!0}),Pe("hmm",function(i,u,d){var h=i.length-2;u[re]=ce(i.substr(0,h)),u[ue]=ce(i.substr(h)),v(d).bigHour=!0}),Pe("hmmss",function(i,u,d){var h=i.length-4,m=i.length-2;u[re]=ce(i.substr(0,h)),u[ue]=ce(i.substr(h,2)),u[jt]=ce(i.substr(m)),v(d).bigHour=!0}),Pe("Hmm",function(i,u,d){var h=i.length-2;u[re]=ce(i.substr(0,h)),u[ue]=ce(i.substr(h))}),Pe("Hmmss",function(i,u,d){var h=i.length-4,m=i.length-2;u[re]=ce(i.substr(0,h)),u[ue]=ce(i.substr(h,2)),u[jt]=ce(i.substr(m))});function Cw(i){return(i+"").toLowerCase().charAt(0)==="p"}var Iw=/[ap]\.?m?\.?/i,Fw=Jr("Hours",!0);function Lw(i,u,d){return i>11?d?"pm":"PM":d?"am":"AM"}var Mp={calendar:oe,longDateFormat:De,invalidDate:le,ordinal:K,dayOfMonthOrdinalParse:qe,relativeTime:ct,months:Xv,monthsShort:_p,week:cw,weekdays:gw,weekdaysMin:_w,weekdaysShort:Ep,meridiemParse:Iw},Je={},ji={},$i;function Yw(i,u){var d,h=Math.min(i.length,u.length);for(d=0;d0;){if(m=bo(b.slice(0,d).join("-")),m)return m;if(h&&h.length>=d&&Yw(b,h)>=d-1)break;d--}u++}return $i}function Ww(i){return i.match("^[^/\\\\]*$")!=null}function bo(i){var u=null,d;if(Je[i]===void 0&&typeof di!="undefined"&&di&&di.exports&&Ww(i))try{u=$i._abbr,d=require,d("./locale/"+i),Nn(u)}catch(h){Je[i]=null}return Je[i]}function Nn(i,u){var d;return i&&(l(u)?d=nn(i):d=bl(i,u),d?$i=d:typeof console!="undefined"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),$i._abbr}function bl(i,u){if(u!==null){var d,h=Mp;if(u.abbr=i,Je[i]!=null)yt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=Je[i]._config;else if(u.parentLocale!=null)if(Je[u.parentLocale]!=null)h=Je[u.parentLocale]._config;else if(d=bo(u.parentLocale),d!=null)h=d._config;else return ji[u.parentLocale]||(ji[u.parentLocale]=[]),ji[u.parentLocale].push({name:i,config:u}),null;return Je[i]=new Q(P(h,u)),ji[i]&&ji[i].forEach(function(m){bl(m.name,m.config)}),Nn(i),Je[i]}else return delete Je[i],null}function qw(i,u){if(u!=null){var d,h,m=Mp;Je[i]!=null&&Je[i].parentLocale!=null?Je[i].set(P(Je[i]._config,u)):(h=bo(i),h!=null&&(m=h._config),u=P(m,u),h==null&&(u.abbr=i),d=new Q(u),d.parentLocale=Je[i],Je[i]=d),Nn(i)}else Je[i]!=null&&(Je[i].parentLocale!=null?(Je[i]=Je[i].parentLocale,i===Nn()&&Nn(i)):Je[i]!=null&&delete Je[i]);return Je[i]}function nn(i){var u;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return $i;if(!n(i)){if(u=bo(i),u)return u;i=[i]}return Uw(i)}function jw(){return Y(Je)}function vl(i){var u,d=i._a;return d&&v(i).overflow===-2&&(u=d[Qe]<0||d[Qe]>11?Qe:d[G]<1||d[G]>_o(d[et],d[Qe])?G:d[re]<0||d[re]>24||d[re]===24&&(d[ue]!==0||d[jt]!==0||d[as]!==0)?re:d[ue]<0||d[ue]>59?ue:d[jt]<0||d[jt]>59?jt:d[as]<0||d[as]>999?as:-1,v(i)._overflowDayOfYear&&(uG)&&(u=G),v(i)._overflowWeeks&&u===-1&&(u=Vv),v(i)._overflowWeekday&&u===-1&&(u=Kv),v(i).overflow=u),i}var $w=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Gw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Bw=/Z|[+-]\d\d(?::?\d\d)?/,vo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],wl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Hw=/^\/?Date\((-?\d+)/i,zw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Vw={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function xp(i){var u,d,h=i._i,m=$w.exec(h)||Gw.exec(h),b,x,te,me,Ye=vo.length,$t=wl.length;if(m){for(v(i).iso=!0,u=0,d=Ye;uUi(x)||i._dayOfYear===0)&&(v(i)._overflowDayOfYear=!0),d=Wi(x,0,i._dayOfYear),i._a[Qe]=d.getUTCMonth(),i._a[G]=d.getUTCDate()),u=0;u<3&&i._a[u]==null;++u)i._a[u]=h[u]=m[u];for(;u<7;u++)i._a[u]=h[u]=i._a[u]==null?u===2?1:0:i._a[u];i._a[re]===24&&i._a[ue]===0&&i._a[jt]===0&&i._a[as]===0&&(i._nextDay=!0,i._a[re]=0),i._d=(i._useUTC?Wi:uw).apply(null,h),b=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[re]=24),i._w&&typeof i._w.d!="undefined"&&i._w.d!==b&&(v(i).weekdayMismatch=!0)}}function r0(i){var u,d,h,m,b,x,te,me,Ye;u=i._w,u.GG!=null||u.W!=null||u.E!=null?(b=1,x=4,d=Gs(u.GG,i._a[et],qi(ze(),1,4).year),h=Gs(u.W,1),m=Gs(u.E,1),(m<1||m>7)&&(me=!0)):(b=i._locale._week.dow,x=i._locale._week.doy,Ye=qi(ze(),b,x),d=Gs(u.gg,i._a[et],Ye.year),h=Gs(u.w,Ye.week),u.d!=null?(m=u.d,(m<0||m>6)&&(me=!0)):u.e!=null?(m=u.e+b,(u.e<0||u.e>6)&&(me=!0)):m=b),h<1||h>rn(d,b,x)?v(i)._overflowWeeks=!0:me!=null?v(i)._overflowWeekday=!0:(te=Dp(d,h,m,b,x),i._a[et]=te.year,i._dayOfYear=te.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Dl(i){if(i._f===e.ISO_8601){xp(i);return}if(i._f===e.RFC_2822){Pp(i);return}i._a=[],v(i).empty=!0;var u=""+i._i,d,h,m,b,x,te=u.length,me=0,Ye,$t;for(m=j(i._f,i._locale).match(w)||[],$t=m.length,d=0;d<$t;d++)b=m[d],h=(u.match($s(b,i))||[])[0],h&&(x=u.substr(0,u.indexOf(h)),x.length>0&&v(i).unusedInput.push(x),u=u.slice(u.indexOf(h)+h.length),me+=h.length),M[b]?(h?v(i).empty=!1:v(i).unusedTokens.push(b),Ft(b,h,i)):i._strict&&!h&&v(i).unusedTokens.push(b);v(i).charsLeftOver=te-me,u.length>0&&v(i).unusedInput.push(u),i._a[re]<=12&&v(i).bigHour===!0&&i._a[re]>0&&(v(i).bigHour=void 0),v(i).parsedDateParts=i._a.slice(0),v(i).meridiem=i._meridiem,i._a[re]=n0(i._locale,i._a[re],i._meridiem),Ye=v(i).era,Ye!==null&&(i._a[et]=i._locale.erasConvertYear(Ye,i._a[et])),kl(i),vl(i)}function n0(i,u,d){var h;return d==null?u:i.meridiemHour!=null?i.meridiemHour(u,d):(i.isPM!=null&&(h=i.isPM(d),h&&u<12&&(u+=12),!h&&u===12&&(u=0)),u)}function s0(i){var u,d,h,m,b,x,te=!1,me=i._f.length;if(me===0){v(i).invalidFormat=!0,i._d=new Date(NaN);return}for(m=0;mthis?this:i:$()});function Cp(i,u){var d,h;if(u.length===1&&n(u[0])&&(u=u[0]),!u.length)return ze();for(d=u[0],h=1;hthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function E0(){if(!l(this._isDSTShifted))return this._isDSTShifted;var i={},u;return ke(i,this),i=Ap(i),i._a?(u=i._isUTC?T(i._a):ze(i._a),this._isDSTShifted=this.isValid()&&y0(i._a,u.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function S0(){return this.isValid()?!this._isUTC:!1}function O0(){return this.isValid()?this._isUTC:!1}function Fp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var M0=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,R0=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Mr(i,u){var d=i,h=null,m,b,x;return ko(i)?d={ms:i._milliseconds,d:i._days,M:i._months}:c(i)||!isNaN(+i)?(d={},u?d[u]=+i:d.milliseconds=+i):(h=M0.exec(i))?(m=h[1]==="-"?-1:1,d={y:0,d:ce(h[G])*m,h:ce(h[re])*m,m:ce(h[ue])*m,s:ce(h[jt])*m,ms:ce(El(h[as]*1e3))*m}):(h=R0.exec(i))?(m=h[1]==="-"?-1:1,d={y:os(h[2],m),M:os(h[3],m),w:os(h[4],m),d:os(h[5],m),h:os(h[6],m),m:os(h[7],m),s:os(h[8],m)}):d==null?d={}:typeof d=="object"&&("from"in d||"to"in d)&&(x=x0(ze(d.from),ze(d.to)),d={},d.ms=x.milliseconds,d.M=x.months),b=new wo(d),ko(i)&&a(i,"_locale")&&(b._locale=i._locale),ko(i)&&a(i,"_isValid")&&(b._isValid=i._isValid),b}Mr.fn=wo.prototype,Mr.invalid=m0;function os(i,u){var d=i&&parseFloat(i.replace(",","."));return(isNaN(d)?0:d)*u}function Lp(i,u){var d={};return d.months=u.month()-i.month()+(u.year()-i.year())*12,i.clone().add(d.months,"M").isAfter(u)&&--d.months,d.milliseconds=+u-+i.clone().add(d.months,"M"),d}function x0(i,u){var d;return i.isValid()&&u.isValid()?(u=Ol(u,i),i.isBefore(u)?d=Lp(i,u):(d=Lp(u,i),d.milliseconds=-d.milliseconds,d.months=-d.months),d):{milliseconds:0,months:0}}function Yp(i,u){return function(d,h){var m,b;return h!==null&&!isNaN(+h)&&(yt(u,"moment()."+u+"(period, number) is deprecated. Please use moment()."+u+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),b=d,d=h,h=b),m=Mr(d,h),Up(this,m,i),this}}function Up(i,u,d,h){var m=u._milliseconds,b=El(u._days),x=El(u._months);!i.isValid()||(h=h==null?!0:h,x&&bp(i,Rt(i,"Month")+x*d),b&&rs(i,"Date",Rt(i,"Date")+b*d),m&&i._d.setTime(i._d.valueOf()+m*d),h&&e.updateOffset(i,b||x))}var P0=Yp(1,"add"),A0=Yp(-1,"subtract");function Wp(i){return typeof i=="string"||i instanceof String}function N0(i){return be(i)||f(i)||Wp(i)||c(i)||I0(i)||C0(i)||i===null||i===void 0}function C0(i){var u=s(i)&&!o(i),d=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],m,b,x=h.length;for(m=0;md.valueOf():d.valueOf()9999?N(d,u?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):V(Date.prototype.toISOString)?u?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",N(d,"Z")):N(d,u?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function K0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",u="",d,h,m,b;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",u="Z"),d="["+i+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",m="-MM-DD[T]HH:mm:ss.SSS",b=u+'[")]',this.format(d+h+m+b)}function Z0(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var u=N(this,i);return this.localeData().postformat(u)}function X0(i,u){return this.isValid()&&(be(i)&&i.isValid()||ze(i).isValid())?Mr({to:this,from:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function Q0(i){return this.from(ze(),i)}function J0(i,u){return this.isValid()&&(be(i)&&i.isValid()||ze(i).isValid())?Mr({from:this,to:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function e1(i){return this.to(ze(),i)}function qp(i){var u;return i===void 0?this._locale._abbr:(u=nn(i),u!=null&&(this._locale=u),this)}var jp=ne("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function $p(){return this._locale}var Eo=1e3,Bs=60*Eo,So=60*Bs,Gp=(365*400+97)*24*So;function Hs(i,u){return(i%u+u)%u}function Bp(i,u,d){return i<100&&i>=0?new Date(i+400,u,d)-Gp:new Date(i,u,d).valueOf()}function Hp(i,u,d){return i<100&&i>=0?Date.UTC(i+400,u,d)-Gp:Date.UTC(i,u,d)}function t1(i){var u,d;if(i=gt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?Hp:Bp,i){case"year":u=d(this.year(),0,1);break;case"quarter":u=d(this.year(),this.month()-this.month()%3,1);break;case"month":u=d(this.year(),this.month(),1);break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":u=d(this.year(),this.month(),this.date());break;case"hour":u=this._d.valueOf(),u-=Hs(u+(this._isUTC?0:this.utcOffset()*Bs),So);break;case"minute":u=this._d.valueOf(),u-=Hs(u,Bs);break;case"second":u=this._d.valueOf(),u-=Hs(u,Eo);break}return this._d.setTime(u),e.updateOffset(this,!0),this}function r1(i){var u,d;if(i=gt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?Hp:Bp,i){case"year":u=d(this.year()+1,0,1)-1;break;case"quarter":u=d(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":u=d(this.year(),this.month()+1,1)-1;break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":u=d(this.year(),this.month(),this.date()+1)-1;break;case"hour":u=this._d.valueOf(),u+=So-Hs(u+(this._isUTC?0:this.utcOffset()*Bs),So)-1;break;case"minute":u=this._d.valueOf(),u+=Bs-Hs(u,Bs)-1;break;case"second":u=this._d.valueOf(),u+=Eo-Hs(u,Eo)-1;break}return this._d.setTime(u),e.updateOffset(this,!0),this}function n1(){return this._d.valueOf()-(this._offset||0)*6e4}function s1(){return Math.floor(this.valueOf()/1e3)}function i1(){return new Date(this.valueOf())}function a1(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function o1(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function u1(){return this.isValid()?this.toISOString():null}function l1(){return C(this)}function c1(){return g({},v(this))}function d1(){return v(this).overflow}function f1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}D("N",0,0,"eraAbbr"),D("NN",0,0,"eraAbbr"),D("NNN",0,0,"eraAbbr"),D("NNNN",0,0,"eraName"),D("NNNNN",0,0,"eraNarrow"),D("y",["y",1],"yo","eraYear"),D("y",["yy",2],0,"eraYear"),D("y",["yyy",3],0,"eraYear"),D("y",["yyyy",4],0,"eraYear"),H("N",Rl),H("NN",Rl),H("NNN",Rl),H("NNNN",k1),H("NNNNN",D1),Pe(["N","NN","NNN","NNNN","NNNNN"],function(i,u,d,h){var m=d._locale.erasParse(i,h,d._strict);m?v(d).era=m:v(d).invalidEra=i}),H("y",fr),H("yy",fr),H("yyy",fr),H("yyyy",fr),H("yo",E1),Pe(["y","yy","yyy","yyyy"],et),Pe(["yo"],function(i,u,d,h){var m;d._locale._eraYearOrdinalRegex&&(m=i.match(d._locale._eraYearOrdinalRegex)),d._locale.eraYearOrdinalParse?u[et]=d._locale.eraYearOrdinalParse(i,m):u[et]=parseInt(i,10)});function h1(i,u){var d,h,m,b=this._eras||nn("en")._eras;for(d=0,h=b.length;d=0)return b[h]}function m1(i,u){var d=i.since<=i.until?1:-1;return u===void 0?e(i.since).year():e(i.since).year()+(u-i.offset)*d}function y1(){var i,u,d,h=this.localeData().eras();for(i=0,u=h.length;ib&&(u=b),A1.call(this,i,u,d,h,m))}function A1(i,u,d,h,m){var b=Dp(i,u,d,h,m),x=Wi(b.year,0,b.dayOfYear);return this.year(x.getUTCFullYear()),this.month(x.getUTCMonth()),this.date(x.getUTCDate()),this}D("Q",0,"Qo","quarter"),dt("quarter","Q"),$e("quarter",7),H("Q",Rn),Pe("Q",function(i,u){u[Qe]=(ce(i)-1)*3});function N1(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}D("D",["DD",2],"Do","date"),dt("date","D"),$e("date",9),H("D",Le),H("DD",Le,_t),H("Do",function(i,u){return i?u._dayOfMonthOrdinalParse||u._ordinalParse:u._dayOfMonthOrdinalParseLenient}),Pe(["D","DD"],G),Pe("Do",function(i,u){u[G]=ce(i.match(Le)[0])});var Vp=Jr("Date",!0);D("DDD",["DDDD",3],"DDDo","dayOfYear"),dt("dayOfYear","DDD"),$e("dayOfYear",4),H("DDD",ns),H("DDDD",Yi),Pe(["DDD","DDDD"],function(i,u,d){d._dayOfYear=ce(i)});function C1(i){var u=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?u:this.add(i-u,"d")}D("m",["mm",2],0,"minute"),dt("minute","m"),$e("minute",14),H("m",Le),H("mm",Le,_t),Pe(["m","mm"],ue);var I1=Jr("Minutes",!1);D("s",["ss",2],0,"second"),dt("second","s"),$e("second",15),H("s",Le),H("ss",Le,_t),Pe(["s","ss"],jt);var F1=Jr("Seconds",!1);D("S",0,0,function(){return~~(this.millisecond()/100)}),D(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),D(0,["SSS",3],0,"millisecond"),D(0,["SSSS",4],0,function(){return this.millisecond()*10}),D(0,["SSSSS",5],0,function(){return this.millisecond()*100}),D(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),D(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),D(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),D(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),dt("millisecond","ms"),$e("millisecond",16),H("S",ns,Rn),H("SS",ns,_t),H("SSS",ns,Yi);var Cn,Kp;for(Cn="SSSS";Cn.length<=9;Cn+="S")H(Cn,fr);function L1(i,u){u[as]=ce(("0."+i)*1e3)}for(Cn="S";Cn.length<=9;Cn+="S")Pe(Cn,L1);Kp=Jr("Milliseconds",!1),D("z",0,0,"zoneAbbr"),D("zz",0,0,"zoneName");function Y1(){return this._isUTC?"UTC":""}function U1(){return this._isUTC?"Coordinated Universal Time":""}var F=Te.prototype;F.add=P0,F.calendar=Y0,F.clone=U0,F.diff=H0,F.endOf=r1,F.format=Z0,F.from=X0,F.fromNow=Q0,F.to=J0,F.toNow=e1,F.get=po,F.invalidAt=d1,F.isAfter=W0,F.isBefore=q0,F.isBetween=j0,F.isSame=$0,F.isSameOrAfter=G0,F.isSameOrBefore=B0,F.isValid=l1,F.lang=jp,F.locale=qp,F.localeData=$p,F.max=l0,F.min=u0,F.parsingFlags=c1,F.set=Ur,F.startOf=t1,F.subtract=A0,F.toArray=a1,F.toObject=o1,F.toDate=i1,F.toISOString=V0,F.inspect=K0,typeof Symbol!="undefined"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=u1,F.toString=z0,F.unix=s1,F.valueOf=n1,F.creationData=f1,F.eraName=y1,F.eraNarrow=g1,F.eraAbbr=_1,F.eraYear=T1,F.year=kp,F.isLeapYear=ow,F.weekYear=S1,F.isoWeekYear=O1,F.quarter=F.quarters=N1,F.month=vp,F.daysInMonth=sw,F.week=F.weeks=hw,F.isoWeek=F.isoWeeks=pw,F.weeksInYear=x1,F.weeksInWeekYear=P1,F.isoWeeksInYear=M1,F.isoWeeksInISOWeekYear=R1,F.date=Vp,F.day=F.days=Ow,F.weekday=Mw,F.isoWeekday=Rw,F.dayOfYear=C1,F.hour=F.hours=Fw,F.minute=F.minutes=I1,F.second=F.seconds=F1,F.millisecond=F.milliseconds=Kp,F.utcOffset=_0,F.utc=b0,F.local=v0,F.parseZone=w0,F.hasAlignedHourOffset=k0,F.isDST=D0,F.isLocal=S0,F.isUtcOffset=O0,F.isUtc=Fp,F.isUTC=Fp,F.zoneAbbr=Y1,F.zoneName=U1,F.dates=ne("dates accessor is deprecated. Use date instead.",Vp),F.months=ne("months accessor is deprecated. Use month instead",vp),F.years=ne("years accessor is deprecated. Use year instead",kp),F.zone=ne("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",T0),F.isDSTShifted=ne("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",E0);function W1(i){return ze(i*1e3)}function q1(){return ze.apply(null,arguments).parseZone()}function Zp(i){return i}var Me=Q.prototype;Me.calendar=y,Me.longDateFormat=pe,Me.invalidDate=Ce,Me.ordinal=Xe,Me.preparse=Zp,Me.postformat=Zp,Me.relativeTime=Or,Me.pastFuture=it,Me.set=q,Me.eras=h1,Me.erasParse=p1,Me.erasConvertYear=m1,Me.erasAbbrRegex=v1,Me.erasNameRegex=b1,Me.erasNarrowRegex=w1,Me.months=ew,Me.monthsShort=tw,Me.monthsParse=nw,Me.monthsRegex=aw,Me.monthsShortRegex=iw,Me.week=lw,Me.firstDayOfYear=fw,Me.firstDayOfWeek=dw,Me.weekdays=ww,Me.weekdaysMin=Dw,Me.weekdaysShort=kw,Me.weekdaysParse=Sw,Me.weekdaysRegex=xw,Me.weekdaysShortRegex=Pw,Me.weekdaysMinRegex=Aw,Me.isPM=Cw,Me.meridiem=Lw;function Mo(i,u,d,h){var m=nn(),b=T().set(h,u);return m[d](b,i)}function Xp(i,u,d){if(c(i)&&(u=i,i=void 0),i=i||"",u!=null)return Mo(i,u,d,"month");var h,m=[];for(h=0;h<12;h++)m[h]=Mo(i,h,d,"month");return m}function Pl(i,u,d,h){typeof i=="boolean"?(c(u)&&(d=u,u=void 0),u=u||""):(u=i,d=u,i=!1,c(u)&&(d=u,u=void 0),u=u||"");var m=nn(),b=i?m._week.dow:0,x,te=[];if(d!=null)return Mo(u,(d+b)%7,h,"day");for(x=0;x<7;x++)te[x]=Mo(u,(x+b)%7,h,"day");return te}function j1(i,u){return Xp(i,u,"months")}function $1(i,u){return Xp(i,u,"monthsShort")}function G1(i,u,d){return Pl(i,u,d,"weekdays")}function B1(i,u,d){return Pl(i,u,d,"weekdaysShort")}function H1(i,u,d){return Pl(i,u,d,"weekdaysMin")}Nn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var u=i%10,d=ce(i%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th";return i+d}}),e.lang=ne("moment.lang is deprecated. Use moment.locale instead.",Nn),e.langData=ne("moment.langData is deprecated. Use moment.localeData instead.",nn);var sn=Math.abs;function z1(){var i=this._data;return this._milliseconds=sn(this._milliseconds),this._days=sn(this._days),this._months=sn(this._months),i.milliseconds=sn(i.milliseconds),i.seconds=sn(i.seconds),i.minutes=sn(i.minutes),i.hours=sn(i.hours),i.months=sn(i.months),i.years=sn(i.years),this}function Qp(i,u,d,h){var m=Mr(u,d);return i._milliseconds+=h*m._milliseconds,i._days+=h*m._days,i._months+=h*m._months,i._bubble()}function V1(i,u){return Qp(this,i,u,1)}function K1(i,u){return Qp(this,i,u,-1)}function Jp(i){return i<0?Math.floor(i):Math.ceil(i)}function Z1(){var i=this._milliseconds,u=this._days,d=this._months,h=this._data,m,b,x,te,me;return i>=0&&u>=0&&d>=0||i<=0&&u<=0&&d<=0||(i+=Jp(Al(d)+u)*864e5,u=0,d=0),h.milliseconds=i%1e3,m=ft(i/1e3),h.seconds=m%60,b=ft(m/60),h.minutes=b%60,x=ft(b/60),h.hours=x%24,u+=ft(x/24),me=ft(em(u)),d+=me,u-=Jp(Al(me)),te=ft(d/12),d%=12,h.days=u,h.months=d,h.years=te,this}function em(i){return i*4800/146097}function Al(i){return i*146097/4800}function X1(i){if(!this.isValid())return NaN;var u,d,h=this._milliseconds;if(i=gt(i),i==="month"||i==="quarter"||i==="year")switch(u=this._days+h/864e5,d=this._months+em(u),i){case"month":return d;case"quarter":return d/3;case"year":return d/12}else switch(u=this._days+Math.round(Al(this._months)),i){case"week":return u/7+h/6048e5;case"day":return u+h/864e5;case"hour":return u*24+h/36e5;case"minute":return u*1440+h/6e4;case"second":return u*86400+h/1e3;case"millisecond":return Math.floor(u*864e5)+h;default:throw new Error("Unknown unit "+i)}}function Q1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+ce(this._months/12)*31536e6:NaN}function an(i){return function(){return this.as(i)}}var J1=an("ms"),ek=an("s"),tk=an("m"),rk=an("h"),nk=an("d"),sk=an("w"),ik=an("M"),ak=an("Q"),ok=an("y");function uk(){return Mr(this)}function lk(i){return i=gt(i),this.isValid()?this[i+"s"]():NaN}function us(i){return function(){return this.isValid()?this._data[i]:NaN}}var ck=us("milliseconds"),dk=us("seconds"),fk=us("minutes"),hk=us("hours"),pk=us("days"),mk=us("months"),yk=us("years");function gk(){return ft(this.days()/7)}var on=Math.round,zs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function _k(i,u,d,h,m){return m.relativeTime(u||1,!!d,i,h)}function Tk(i,u,d,h){var m=Mr(i).abs(),b=on(m.as("s")),x=on(m.as("m")),te=on(m.as("h")),me=on(m.as("d")),Ye=on(m.as("M")),$t=on(m.as("w")),un=on(m.as("y")),In=b<=d.ss&&["s",b]||b0,In[4]=h,_k.apply(null,In)}function bk(i){return i===void 0?on:typeof i=="function"?(on=i,!0):!1}function vk(i,u){return zs[i]===void 0?!1:u===void 0?zs[i]:(zs[i]=u,i==="s"&&(zs.ss=u-1),!0)}function wk(i,u){if(!this.isValid())return this.localeData().invalidDate();var d=!1,h=zs,m,b;return typeof i=="object"&&(u=i,i=!1),typeof i=="boolean"&&(d=i),typeof u=="object"&&(h=Object.assign({},zs,u),u.s!=null&&u.ss==null&&(h.ss=u.s-1)),m=this.localeData(),b=Tk(this,!d,h,m),d&&(b=m.pastFuture(+this,b)),m.postformat(b)}var Nl=Math.abs;function Vs(i){return(i>0)-(i<0)||+i}function Ro(){if(!this.isValid())return this.localeData().invalidDate();var i=Nl(this._milliseconds)/1e3,u=Nl(this._days),d=Nl(this._months),h,m,b,x,te=this.asSeconds(),me,Ye,$t,un;return te?(h=ft(i/60),m=ft(h/60),i%=60,h%=60,b=ft(d/12),d%=12,x=i?i.toFixed(3).replace(/\.?0+$/,""):"",me=te<0?"-":"",Ye=Vs(this._months)!==Vs(te)?"-":"",$t=Vs(this._days)!==Vs(te)?"-":"",un=Vs(this._milliseconds)!==Vs(te)?"-":"",me+"P"+(b?Ye+b+"Y":"")+(d?Ye+d+"M":"")+(u?$t+u+"D":"")+(m||h||i?"T":"")+(m?un+m+"H":"")+(h?un+h+"M":"")+(i?un+x+"S":"")):"P0D"}var Oe=wo.prototype;Oe.isValid=p0,Oe.abs=z1,Oe.add=V1,Oe.subtract=K1,Oe.as=X1,Oe.asMilliseconds=J1,Oe.asSeconds=ek,Oe.asMinutes=tk,Oe.asHours=rk,Oe.asDays=nk,Oe.asWeeks=sk,Oe.asMonths=ik,Oe.asQuarters=ak,Oe.asYears=ok,Oe.valueOf=Q1,Oe._bubble=Z1,Oe.clone=uk,Oe.get=lk,Oe.milliseconds=ck,Oe.seconds=dk,Oe.minutes=fk,Oe.hours=hk,Oe.days=pk,Oe.weeks=gk,Oe.months=mk,Oe.years=yk,Oe.humanize=wk,Oe.toISOString=Ro,Oe.toString=Ro,Oe.toJSON=Ro,Oe.locale=qp,Oe.localeData=$p,Oe.toIsoString=ne("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ro),Oe.lang=jp,D("X",0,0,"unix"),D("x",0,0,"valueOf"),H("x",An),H("X",yo),Pe("X",function(i,u,d){d._d=new Date(parseFloat(i)*1e3)}),Pe("x",function(i,u,d){d._d=new Date(ce(i))});return e.version="2.29.4",t(ze),e.fn=F,e.min=c0,e.max=d0,e.now=f0,e.utc=T,e.unix=W1,e.months=j1,e.isDate=f,e.locale=Nn,e.invalid=$,e.duration=Mr,e.isMoment=be,e.weekdays=G1,e.parseZone=q1,e.localeData=nn,e.isDuration=ko,e.monthsShort=$1,e.weekdaysMin=H1,e.defineLocale=bl,e.updateLocale=qw,e.locales=jw,e.weekdaysShort=B1,e.normalizeUnits=gt,e.relativeTimeRounding=bk,e.relativeTimeThreshold=vk,e.calendarFormat=L0,e.prototype=F,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var nb=S((fY,Mu)=>{var FT,LT,YT,UT,WT,qT,jT,$T,GT,Su,Oh,BT,HT,zT,pi,VT,KT,ZT,XT,QT,JT,eb,tb,rb,Ou;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Mu=="object"&&typeof Mu.exports=="object"?r(t(e,t(Mu.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=s?s(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])};FT=function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function a(){this.constructor=n}n.prototype=s===null?Object.create(s):(a.prototype=s.prototype,new a)},LT=Object.assign||function(n){for(var s,a=1,o=arguments.length;a=0;p--)(f=n[p])&&(c=(l<3?f(c):l>3?f(s,a,c):f(s,a))||c);return l>3&&c&&Object.defineProperty(s,a,c),c},WT=function(n,s){return function(a,o){s(a,o,n)}},qT=function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},jT=function(n,s,a,o){function l(c){return c instanceof a?c:new a(function(f){f(c)})}return new(a||(a=Promise))(function(c,f){function p(O){try{T(o.next(O))}catch(v){f(v)}}function g(O){try{T(o.throw(O))}catch(v){f(v)}}function T(O){O.done?c(O.value):l(O.value).then(p,g)}T((o=o.apply(n,s||[])).next())})},$T=function(n,s){var a={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,l,c,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(T){return function(O){return g([T,O])}}function g(T){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,l&&(c=T[0]&2?l.return:T[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,T[1])).done)return c;switch(l=0,c&&(T=[T[0]&2,c.value]),T[0]){case 0:case 1:c=T;break;case 4:return a.label++,{value:T[1],done:!1};case 5:a.label++,l=T[1],T=[0];continue;case 7:T=a.ops.pop(),a.trys.pop();continue;default:if(c=a.trys,!(c=c.length>0&&c[c.length-1])&&(T[0]===6||T[0]===2)){a=0;continue}if(T[0]===3&&(!c||T[1]>c[0]&&T[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},Oh=function(n,s){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var o=a.call(n),l,c=[],f;try{for(;(s===void 0||s-- >0)&&!(l=o.next()).done;)c.push(l.value)}catch(p){f={error:p}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(f)throw f.error}}return c},BT=function(){for(var n=[],s=0;s1||p(R,C)})})}function p(R,C){try{g(o[R](C))}catch($){v(c[0][3],$)}}function g(R){R.value instanceof pi?Promise.resolve(R.value.v).then(T,O):v(c[0][2],R)}function T(R){p("next",R)}function O(R){p("throw",R)}function v(R,C){R(C),c.shift(),c.length&&p(c[0][0],c[0][1])}},KT=function(n){var s,a;return s={},o("next"),o("throw",function(l){throw l}),o("return"),s[Symbol.iterator]=function(){return this},s;function o(l,c){s[l]=n[l]?function(f){return(a=!a)?{value:pi(n[l](f)),done:l==="return"}:c?c(f):f}:c}},ZT=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],a;return s?s.call(n):(n=typeof Su=="function"?Su(n):n[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(c){a[c]=n[c]&&function(f){return new Promise(function(p,g){f=n[c](f),l(p,g,f.done,f.value)})}}function l(c,f,p,g){Promise.resolve(g).then(function(T){c({value:T,done:p})},f)}},XT=function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n};var t=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};QT=function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&Ou(s,n,a);return t(s,n),s},JT=function(n){return n&&n.__esModule?n:{default:n}},eb=function(n,s,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!o:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(n):o?o.value:s.get(n)},tb=function(n,s,a,o,l){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!l:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?l.call(n,a):l?l.value=a:s.set(n,a),a},rb=function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},r("__extends",FT),r("__assign",LT),r("__rest",YT),r("__decorate",UT),r("__param",WT),r("__metadata",qT),r("__awaiter",jT),r("__generator",$T),r("__exportStar",GT),r("__createBinding",Ou),r("__values",Su),r("__read",Oh),r("__spread",BT),r("__spreadArrays",HT),r("__spreadArray",zT),r("__await",pi),r("__asyncGenerator",VT),r("__asyncDelegator",KT),r("__asyncValues",ZT),r("__makeTemplateObject",XT),r("__importStar",QT),r("__importDefault",JT),r("__classPrivateFieldGet",eb),r("__classPrivateFieldSet",tb),r("__classPrivateFieldIn",rb)})});var jb=S((Wb,qb)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(_){return Object.prototype.toString.call(_)==="[object Array]"},n=10,s=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",o=typeof Reflect=="object",l=typeof setImmediate=="function",c=l?setImmediate:setTimeout,f=a?o&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(y){var _=Object.getOwnPropertyNames(y);return _.push.apply(_,Object.getOwnPropertySymbols(y)),_}:Object.keys;function p(){this._events={},this._conf&&g.call(this,this._conf)}function g(y){y&&(this._conf=y,y.delimiter&&(this.delimiter=y.delimiter),y.maxListeners!==r&&(this._maxListeners=y.maxListeners),y.wildcard&&(this.wildcard=y.wildcard),y.newListener&&(this._newListener=y.newListener),y.removeListener&&(this._removeListener=y.removeListener),y.verboseMemoryLeak&&(this.verboseMemoryLeak=y.verboseMemoryLeak),y.ignoreErrors&&(this.ignoreErrors=y.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function T(y,_){var w="(node) warning: possible EventEmitter memory leak detected. "+y+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+_+"."),typeof process!="undefined"&&process.emitWarning){var k=new Error(w);k.name="MaxListenersExceededWarning",k.emitter=this,k.count=y,process.emitWarning(k)}else console.error(w),console.trace&&console.trace()}var O=function(y,_,w){var k=arguments.length;switch(k){case 0:return[];case 1:return[y];case 2:return[y,_];case 3:return[y,_,w];default:for(var E=new Array(k);k--;)E[k]=arguments[k];return E}};function v(y,_){for(var w={},k,E=y.length,M=_?_.length:0,D=0;D0;)y=M[A],D.call(I,y,w[y]);this._listeners={},this._listenersCount=0,N()}}});function C(y,_,w,k){var E=Object.assign({},_);if(!y)return E;if(typeof y!="object")throw TypeError("options must be an object");var M=Object.keys(y),D=M.length,I,A,N;function j(pe){throw Error('Invalid "'+I+'" option value'+(pe?". Reason: "+pe:""))}for(var De=0;De0;)if(I===y[A])return M;D(_)}}var W=B(["function"]),ke=B(["object","function"]);function Te(y,_,w){var k,E,M=0,D,I=new y(function(A,N,j){w=C(w,{timeout:0,overload:!1},{timeout:function(Ce,K){return Ce*=1,(typeof Ce!="number"||Ce<0||!Number.isFinite(Ce))&&K("timeout must be a positive number"),Ce}}),k=!w.overload&&typeof y.prototype.cancel=="function"&&typeof j=="function";function De(){E&&(E=null),M&&(clearTimeout(M),M=0)}var pe=function(Ce){De(),A(Ce)},le=function(Ce){De(),N(Ce)};k?_(pe,le,j):(E=[function(Ce){le(Ce||Error("canceled"))}],_(pe,le,function(Ce){if(D)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Ce!="function")throw TypeError("onCancel callback must be a function");E.push(Ce)}),D=!0),w.timeout>0&&(M=setTimeout(function(){var Ce=Error("timeout");Ce.code="ETIMEDOUT",M=0,I.cancel(Ce),N(Ce)},w.timeout))});return k||(I.cancel=function(A){if(!!E){for(var N=E.length,j=1;j0;)le=it[I],le!=="_listeners"&&(je=ee(y,_,w[le],k+1,E),je&&(pe?pe.push.apply(pe,je):pe=je));return pe}else if(ct==="**"){for(Xe=k+1===E||k+2===E&&Or==="*",Xe&&w._listeners&&(pe=ee(y,_,w,E,E)),it=f(w),I=it.length;I-- >0;)le=it[I],le!=="_listeners"&&(le==="*"||le==="**"?(w[le]._listeners&&!Xe&&(je=ee(y,_,w[le],E,E),je&&(pe?pe.push.apply(pe,je):pe=je)),je=ee(y,_,w[le],k,E)):le===Or?je=ee(y,_,w[le],k+2,E):je=ee(y,_,w[le],k,E),je&&(pe?pe.push.apply(pe,je):pe=je));return pe}else w[ct]&&(pe=ee(y,_,w[ct],k+1,E));if(Ce=w["*"],Ce&&ee(y,_,Ce,k+1,E),K=w["**"],K)if(k0;)le=it[I],le!=="_listeners"&&(le===Or?ee(y,_,K[le],k+2,E):le===ct?ee(y,_,K[le],k+1,E):(qe={},qe[le]=K[le],ee(y,_,{"**":qe},k+1,E)));else K._listeners?ee(y,_,K,E,E):K["*"]&&K["*"]._listeners&&ee(y,_,K["*"],E,E);return pe}function ne(y,_,w){var k=0,E=0,M,D=this.delimiter,I=D.length,A;if(typeof y=="string")if((M=y.indexOf(D))!==-1){A=new Array(5);do A[k++]=y.slice(E,M),E=M+I;while((M=y.indexOf(D,E))!==-1);A[k++]=y.slice(E)}else A=[y],k=1;else A=y,k=y.length;if(k>1){for(M=0;M+10&&N._listeners.length>this._maxListeners&&(N._listeners.warned=!0,T.call(this,N._listeners.length,j))):N._listeners=_,!0;return!0}function It(y,_,w,k){for(var E=f(y),M=E.length,D,I,A,N=y._listeners,j;M-- >0;)I=E[M],D=y[I],I==="_listeners"?A=w:A=w?w.concat(I):[I],j=k||typeof I=="symbol",N&&_.push(j?A:A.join(this.delimiter)),typeof D=="object"&&It.call(this,D,_,A,j);return _}function yt(y){for(var _=f(y),w=_.length,k,E,M;w-- >0;)E=_[w],k=y[E],k&&(M=!0,E!=="_listeners"&&!yt(k)&&delete y[E]);return M}function V(y,_,w){this.emitter=y,this.event=_,this.listener=w}V.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function q(y,_,w){if(w===!0)E=!0;else if(w===!1)k=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var k=w.async,E=w.promisify,M=w.nextTick,D=w.objectify}if(k||M||E){var I=_,A=_._origin||_;if(M&&!s)throw Error("process.nextTick is not supported");E===r&&(E=_.constructor.name==="AsyncFunction"),_=function(){var N=arguments,j=this,De=this.event;return E?M?Promise.resolve():new Promise(function(pe){c(pe)}).then(function(){return j.event=De,I.apply(j,N)}):(M?process.nextTick:c)(function(){j.event=De,I.apply(j,N)})},_._async=!0,_._origin=A}return[_,D?new V(this,y,_):this]}function P(y){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,y)}P.EventEmitter2=P,P.prototype.listenTo=function(y,_,w){if(typeof y!="object")throw TypeError("target musts be an object");var k=this;w=C(w,{on:r,off:r,reducers:r},{on:W,off:W,reducers:ke});function E(M){if(typeof M!="object")throw TypeError("events must be an object");var D=w.reducers,I=be.call(k,y),A;I===-1?A=new R(k,y,w):A=k._observers[I];for(var N=f(M),j=N.length,De,pe=typeof D=="function",le=0;le0;)E=w[k],(!y||E._target===y)&&(E.unsubscribe(_),M=!0);return M},P.prototype.delimiter=".",P.prototype.setMaxListeners=function(y){y!==r&&(this._maxListeners=y,this._conf||(this._conf={}),this._conf.maxListeners=y)},P.prototype.getMaxListeners=function(){return this._maxListeners},P.prototype.event="",P.prototype.once=function(y,_,w){return this._once(y,_,!1,w)},P.prototype.prependOnceListener=function(y,_,w){return this._once(y,_,!0,w)},P.prototype._once=function(y,_,w,k){return this._many(y,1,_,w,k)},P.prototype.many=function(y,_,w,k){return this._many(y,_,w,!1,k)},P.prototype.prependMany=function(y,_,w,k){return this._many(y,_,w,!0,k)},P.prototype._many=function(y,_,w,k,E){var M=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function D(){return--_===0&&M.off(y,D),w.apply(this,arguments)}return D._origin=w,this._on(y,D,k,E)},P.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var y=arguments[0],_,w=this.wildcard,k,E,M,D,I;if(y==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(_=y,y!=="newListener"&&y!=="removeListener"&&typeof y=="object")){if(E=y.length,a){for(M=0;M3)for(k=new Array(A-1),D=1;D3)for(E=new Array(N-1),I=1;I0&&this._events[y].length>this._maxListeners&&(this._events[y].warned=!0,T.call(this,this._events[y].length,y))):this._events[y]=_,E)},P.prototype.off=function(y,_){if(typeof _!="function")throw new Error("removeListener only takes instances of Function");var w,k=[];if(this.wildcard){var E=typeof y=="string"?y.split(this.delimiter):y.slice();if(k=ee.call(this,null,E,this.listenerTree,0),!k)return this}else{if(!this._events[y])return this;w=this._events[y],k.push({_listeners:w})}for(var M=0;M0){for(k=this._all,_=0,w=k.length;_0;)k=_[w[M]],typeof k=="function"?E.push(k):E.push.apply(E,k);return E}else{if(this.wildcard){if(D=this.listenerTree,!D)return[];var I=[],A=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,I,A,D,0),I}return _?(k=_[y],k?typeof k=="function"?[k]:k:[]):[]}},P.prototype.eventNames=function(y){var _=this._events;return this.wildcard?It.call(this,this.listenerTree,[],null,y):_?f(_):[]},P.prototype.listenerCount=function(y){return this.listeners(y).length},P.prototype.hasListeners=function(y){if(this.wildcard){var _=[],w=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,_,w,this.listenerTree,0),_.length>0}var k=this._events,E=this._all;return!!(E&&E.length||k&&(y===r?f(k).length:k[y]))},P.prototype.listenersAny=function(){return this._all?this._all:[]},P.prototype.waitFor=function(y,_){var w=this,k=typeof _;return k==="number"?_={timeout:_}:k==="function"&&(_={filter:_}),_=C(_,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:W,Promise:$}),Te(_.Promise,function(E,M,D){function I(){var A=_.filter;if(!(A&&!A.apply(w,arguments)))if(w.off(y,I),_.handleError){var N=arguments[0];N?M(N):E(O.apply(null,arguments).slice(1))}else E(O.apply(null,arguments))}D(function(){w.off(y,I)}),w._on(y,I,!1)},{timeout:_.timeout,overload:_.overload})};function Q(y,_,w){w=C(w,{Promise,timeout:0,overload:!1},{Promise:$});var k=w.Promise;return Te(k,function(E,M,D){var I;if(typeof y.addEventListener=="function"){I=function(){E(O.apply(null,arguments))},D(function(){y.removeEventListener(_,I)}),y.addEventListener(_,I,{once:!0});return}var A=function(){N&&y.removeListener("error",N),E(O.apply(null,arguments))},N;_!=="error"&&(N=function(j){y.removeListener(_,A),M(j)},y.once("error",N)),D(function(){N&&y.removeListener("error",N),y.removeListener(_,A)}),y.once(_,A)},{timeout:w.timeout,overload:w.overload})}var Y=P.prototype;if(Object.defineProperties(P,{defaultMaxListeners:{get:function(){return Y._maxListeners},set:function(y){if(typeof y!="number"||y<0||Number.isNaN(y))throw TypeError("n must be a non-negative number");Y._maxListeners=y},enumerable:!0},once:{value:Q,writable:!0,configurable:!0}}),Object.defineProperties(Y,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return P});else if(typeof Wb=="object")qb.exports=P;else{var oe=new Function("","return this")();oe.EventEmitter2=P}})()});var Qr=S(Jn=>{"use strict";Jn.__esModule=!0;var fF;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(fF=Jn.Operators||(Jn.Operators={}));var hF;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(hF=Jn.StructuralCharacters||(Jn.StructuralCharacters={}));var pF;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(pF=Jn.Tokens||(Jn.Tokens={}))});var ip=S(il=>{"use strict";il.__esModule=!0;var rt=Qr();il.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};il.VALID_TOKENS={identifierOnly:[{name:rt.Tokens.IDENTIFIER},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:rt.Tokens.IDENTIFIER},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.OPEN_PARENTHESIS},{name:rt.Tokens.OPERATOR,value:rt.Operators.NOT}],binaryOperator:[{name:rt.Tokens.OPERATOR,value:rt.Operators.AND},{name:rt.Tokens.OPERATOR,value:rt.Operators.OR},{name:rt.Tokens.OPERATOR,value:rt.Operators.XOR}],binaryOperatorOrClose:[{name:rt.Tokens.OPERATOR,value:rt.Operators.AND},{name:rt.Tokens.OPERATOR,value:rt.Operators.OR},{name:rt.Tokens.OPERATOR,value:rt.Operators.XOR},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.CLOSE_PARENTHESIS}]}});var ap=S(Dn=>{"use strict";Dn.__esModule=!0;var xi=Qr();Dn.STRUCTURAL_CHARACTERS={"(":xi.StructuralCharacters.OPEN_PARENTHESIS,")":xi.StructuralCharacters.CLOSE_PARENTHESIS};Dn.OPERATORS={AND:xi.Operators.AND,OR:xi.Operators.OR,XOR:xi.Operators.XOR,NOT:xi.Operators.NOT};Dn.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));Dn.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);Dn.COMMENT_DELIMITER=String.fromCodePoint(35);Dn.EOL=String.fromCodePoint(10);Dn.ESCAPE_CHARACTER=String.fromCodePoint(92)});var bv=S(En=>{"use strict";var op=En&&En.__assign||function(){return op=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";up.__esModule=!0;var Pi=Qr(),lr=ap(),Ai=bv();up.lex=function(r){for(var e=null,t=null,n=null,s=0;s{"use strict";var mF=Sn&&Sn.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";var Ci=lo&&lo.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";On.__esModule=!0;var Ev=Qr();On.andUtil=function(r,e){return r&&e};On.orUtil=function(r,e){return r||e};On.xorUtil=function(r,e){return r!==e};On.notUtil=function(r){return!r};On.isIdentifier=function(r){var e=r.name,t=r.value;return e===Ev.Tokens.IDENTIFIER&&typeof t=="string"};On.isOperator=function(r){var e=r.name,t=r.value;return e===Ev.Tokens.OPERATOR&&typeof t=="string"};On.throwInvalidExpression=function(r){throw new TypeError("Invalid postfix expression: "+r)}});var Sv=S(pp=>{"use strict";var co;pp.__esModule=!0;var fp=Qr(),hp=dp();pp.OPERATOR_MAP=(co={},co[fp.Operators.AND]=hp.andUtil,co[fp.Operators.OR]=hp.orUtil,co[fp.Operators.XOR]=hp.xorUtil,co)});var Mv=S(Ls=>{"use strict";var mp=Ls&&Ls.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";fo.__esModule=!0;var Rv=Mv();fo.getEvaluator=Rv.getEvaluator;fo.evaluate=Rv.evaluate;var TF=cp();fo.parse=TF.parse});var DF={};xk(DF,{default:()=>yl});module.exports=Pk(DF);var zv=require("obsidian");var _i=require("obsidian");var SF=new Error("timeout while waiting for mutex to become available"),OF=new Error("mutex already locked"),Ak=new Error("request for lock canceled"),Nk=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(p){try{f(n.next(p))}catch(g){o(g)}}function c(p){try{f(n.throw(p))}catch(g){o(g)}}function f(p){p.done?a(p.value):s(p.value).then(l,c)}f((n=n.apply(r,e||[])).next())})},Cl=class{constructor(e,t=Ak){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return Nk(this,void 0,void 0,function*(){let[n,s]=yield this.acquire(t);try{return yield e(n)}finally{s()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let s=this._value,a=t;this._value-=t,t=this._value+1,n.resolve([s,this._newReleaser(a)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},Ck=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(p){try{f(n.next(p))}catch(g){o(g)}}function c(p){try{f(n.throw(p))}catch(g){o(g)}}function f(p){p.done?a(p.value):s(p.value).then(l,c)}f((n=n.apply(r,e||[])).next())})},xo=class{constructor(e){this._semaphore=new Cl(1,e)}acquire(){return Ck(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var ku=Fn(pt()),fi=Fn(wu());var bs=Fn(wu()),Bt=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new Bt((0,bs.default)().startOf(t).startOf("day"),(0,bs.default)().endOf(t).startOf("day"))}static buildInvalid(){return new Bt(bs.default.invalid(),bs.default.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=bs.default.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=bs.default.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var ir=class{static parseDate(e,t=!1){return(0,fi.default)(ku.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[ir.parseRelativeDateRange,ir.parseNumberedDateRange,ir.parseAbsoluteDateRange];for(let s of n){let a=s(e,t);if(a.isValid())return a}return Bt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=ku.parse(e,void 0,{forwardDate:t});if(n.length===0)return Bt.buildInvalid();let s=n[0].start,a=n[1]&&n[1].start?n[1].start:s,o=(0,fi.default)(s.date()),l=(0,fi.default)(a.date());return new Bt(o,l)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,s=e.match(n);if(s&&s.length===3){let a=s[1],o=s[2],l=Bt.buildRelative(o);switch(a){case"last":l.moveToPrevious(o);break;case"next":l.moveToNext(o);break}return l}return Bt.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[s,a,o]of n){let l=e.match(s);if(l){let c=l[0].trim();return new Bt((0,fi.default)(c,a).startOf(o),(0,fi.default)(c,a).endOf(o))}}return Bt.buildInvalid()}};var QC={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function hi(r){for(let[e,t]of Object.entries(QC))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Du=["MO","TU","WE","TH","FR","SA","SU"],lt=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Du.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Du[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var He=function(r){return r!=null},ar=function(r){return typeof r=="number"},Sh=function(r){return typeof r=="string"&&Du.includes(r)},Nt=Array.isArray,kr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=we(t,e/t.length)),t.slice(0,e)+String(n))}var IT=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Lt=function(r,e){var t=r%e;return t*e<0?t+e:t},Eu=function(r,e){return{div:Math.floor(r/e),mod:Lt(r,e)}},or=function(r){return!He(r)||r.length===0},st=function(r){return!or(r)},Ee=function(r,e){return st(r)&&r.indexOf(e)!==-1};var Gn;(function(r){r.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],r.ONE_DAY=1e3*60*60*24,r.MAXYEAR=9999,r.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),r.PY_WEEKDAYS=[6,0,1,2,3,4,5],r.getYearDay=function(e){var t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((t.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/r.ONE_DAY)+1},r.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},r.isDate=function(e){return e instanceof Date},r.isValidDate=function(e){return r.isDate(e)&&!isNaN(e.getTime())},r.tzOffset=function(e){return e.getTimezoneOffset()*60*1e3},r.daysBetween=function(e,t){var n=e.getTime()-r.tzOffset(e),s=t.getTime()-r.tzOffset(t),a=n-s;return Math.round(a/r.ONE_DAY)},r.toOrdinal=function(e){return r.daysBetween(e,r.ORDINAL_BASE)},r.fromOrdinal=function(e){return new Date(r.ORDINAL_BASE.getTime()+e*r.ONE_DAY)},r.getMonthDays=function(e){var t=e.getUTCMonth();return t===1&&r.isLeapYear(e.getUTCFullYear())?29:r.MONTH_DAYS[t]},r.getWeekday=function(e){return r.PY_WEEKDAYS[e.getUTCDay()]},r.monthRange=function(e,t){var n=new Date(Date.UTC(e,t,1));return[r.getWeekday(n),r.getMonthDays(n)]},r.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},r.clone=function(e){var t=new Date(e.getTime());return t},r.cloneDates=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),_n=JC;var sb=Fn(nb(),1),{__extends:mi,__assign:Ht,__rest:hY,__decorate:pY,__param:mY,__metadata:yY,__awaiter:gY,__generator:_Y,__exportStar:TY,__createBinding:bY,__values:vY,__read:wY,__spread:kY,__spreadArrays:DY,__spreadArray:U,__await:EY,__asyncGenerator:SY,__asyncDelegator:OY,__asyncValues:MY,__makeTemplateObject:RY,__importStar:xY,__importDefault:PY,__classPrivateFieldGet:AY,__classPrivateFieldSet:NY,__classPrivateFieldIn:CY}=sb.default;var eI=function(r){mi(e,r);function e(t,n,s){var a=r.call(this,t,n)||this;return a.iterator=s,a}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(_n),Mh=eI;var tI={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},ws=tI;var ib=function(r,e){return r.indexOf(e)!==-1},rI=function(r){return r.toString()},nI=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},sI=function(){function r(e,t,n,s){if(t===void 0&&(t=rI),n===void 0&&(n=ws),s===void 0&&(s=nI),this.text=[],this.language=n||ws,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);a.sort(function(p,g){return p-g}),o.sort(function(p,g){return g-p}),this.bymonthday=a.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(He(this.origOptions.byweekday)){var l=Nt(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(l);this.byweekday={allWeeks:l.filter(function(p){return!p.n}),someWeeks:l.filter(function(p){return Boolean(p.n)}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var f=function(p,g){return p.weekday-g.weekday};this.byweekday.allWeeks.sort(f),this.byweekday.someWeeks.sort(f),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(ib(["dtstart","wkst","freq"],n))return!0;if(!ib(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[X.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=ar(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,s){var a=this;s===void 0&&(s=","),Nt(e)||(e=[e]);var o=function(c,f,p){for(var g="",T=0;Te[0].length)&&(e=a,t=s)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function Ha(r,e){e===void 0&&(e=ws);var t={},n=new iI(e.tokens);if(!n.start(r))return null;return s(),t;function s(){n.expect("every");var T=n.acceptNumber();if(T&&(t.interval=parseInt(T[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=X.DAILY,n.nextSymbol()&&(o(),g());break;case"weekday(s)":t.freq=X.WEEKLY,t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR],n.nextSymbol(),g();break;case"week(s)":t.freq=X.WEEKLY,n.nextSymbol()&&(a(),g());break;case"hour(s)":t.freq=X.HOURLY,n.nextSymbol()&&(a(),g());break;case"minute(s)":t.freq=X.MINUTELY,n.nextSymbol()&&(a(),g());break;case"month(s)":t.freq=X.MONTHLY,n.nextSymbol()&&(a(),g());break;case"year(s)":t.freq=X.YEARLY,n.nextSymbol()&&(a(),g());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=X.WEEKLY;var O=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[X[O]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var v=c();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(X[v]),n.nextSymbol()}p(),g();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=X.YEARLY,t.bymonth=[l()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var R=l();if(!R)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(R),n.nextSymbol()}a(),g();break;default:throw new Error("Unknown symbol")}}function a(){var T=n.accept("on"),O=n.accept("the");if(!!(T||O))do{var v=f(),R=c(),C=l();if(v)R?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R].nth(v))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(v),n.accept("day(s)"));else if(R)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var $=n.acceptNumber();if(!$)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt($[0],10)];n.accept("comma");){if($=n.acceptNumber(),!$)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt($[0],10))}}else if(C)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(C);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var T=n.accept("at");if(!!T)do{var O=n.acceptNumber();if(!O)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(O[0],10)];n.accept("comma");){if(O=n.acceptNumber(),!O)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(O[0],10))}}while(n.accept("comma")||n.accept("at"))}function l(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function f(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var T=parseInt(n.value[1],10);if(T<-366||T>366)throw new Error("Nth out of range: "+T);return n.nextSymbol(),n.accept("last")?-T:T;default:return!1}}function p(){n.accept("on"),n.accept("the");var T=f();if(!!T)for(t.bymonthday=[T],n.nextSymbol();n.accept("comma");){if(T=f(),!T)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(T),n.nextSymbol()}}function g(){if(n.symbol==="until"){var T=Date.parse(n.text);if(!T)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(T)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var _e;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(_e||(_e={}));function za(r){return r<_e.HOURLY}var ab=function(r,e){return e===void 0&&(e=ws),new X(Ha(r,e)||void 0)},yi=["count","until","interval","byweekday","bymonthday","bymonth"];Br.IMPLEMENTED=[];Br.IMPLEMENTED[_e.HOURLY]=yi;Br.IMPLEMENTED[_e.MINUTELY]=yi;Br.IMPLEMENTED[_e.DAILY]=["byhour"].concat(yi);Br.IMPLEMENTED[_e.WEEKLY]=yi;Br.IMPLEMENTED[_e.MONTHLY]=yi;Br.IMPLEMENTED[_e.YEARLY]=["byweekno","byyearday"].concat(yi);var ob=function(r,e,t,n){return new Br(r,e,t,n).toString()},ub=Br.isFullyConvertible;var gi=function(){function r(e,t,n,s){this.hour=e,this.minute=t,this.second=n,this.millisecond=s||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r}();var lb=function(r){mi(e,r);function e(t,n,s,a,o,l,c){var f=r.call(this,a,o,l,c)||this;return f.year=t,f.month=n,f.day=s,f}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return Gn.getWeekday(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),s=Lt(this.month,12);this.month=s,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=Eu(this.hour,24),o=a.div,l=a.mod;if(o&&(this.hour=l,this.addDaily(o)),or(s)||Ee(s,this.hour))break}},e.prototype.addMinutes=function(t,n,s,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var o=Eu(this.minute,60),l=o.div,c=o.mod;if(l&&(this.minute=c,this.addHours(l,!1,s)),(or(s)||Ee(s,this.hour))&&(or(a)||Ee(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,s,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var l=Eu(this.second,60),c=l.div,f=l.mod;if(c&&(this.second=f,this.addMinutes(c,!1,s,a)),(or(s)||Ee(s,this.hour))&&(or(a)||Ee(a,this.minute))&&(or(o)||Ee(o,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Gn.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Gn.MAXYEAR))return;t=Gn.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var s=t.freq,a=t.interval,o=t.wkst,l=t.byhour,c=t.byminute,f=t.bysecond;switch(s){case _e.YEARLY:return this.addYears(a);case _e.MONTHLY:return this.addMonths(a);case _e.WEEKLY:return this.addWeekly(a,o);case _e.DAILY:return this.addDaily(a);case _e.HOURLY:return this.addHours(a,n,l);case _e.MINUTELY:return this.addMinutes(a,n,l,c);case _e.SECONDLY:return this.addSeconds(a,n,l,c,f)}},e}(gi);function Rh(r){for(var e=[],t=Object.keys(r),n=0,s=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||st(e.byweekno)||st(e.byyearday)||Boolean(e.bymonthday)||st(e.bymonthday)||He(e.byweekday)||He(e.byeaster)))switch(e.freq){case X.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case X.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case X.WEEKLY:e.byweekday=[se.getWeekday(e.dtstart)];break}if(He(e.bymonth)&&!Nt(e.bymonth)&&(e.bymonth=[e.bymonth]),He(e.byyearday)&&!Nt(e.byyearday)&&ar(e.byyearday)&&(e.byyearday=[e.byyearday]),!He(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(Nt(e.bymonthday)){for(var s=[],a=[],t=0;t0?s.push(n):n<0&&a.push(n)}e.bymonthday=s,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(He(e.byweekno)&&!Nt(e.byweekno)&&(e.byweekno=[e.byweekno]),!He(e.byweekday))e.bynweekday=null;else if(ar(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Sh(e.byweekday))e.byweekday=[lt.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof lt)!e.byweekday.n||e.freq>X.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var o=[],l=[],t=0;tX.MONTHLY?o.push(c.weekday):l.push([c.weekday,c.n])}e.byweekday=st(o)?o:null,e.bynweekday=st(l)?l:null}return He(e.byhour)?ar(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(p=0,f=l.yearlen+Lt(o-e.wkst,7)):f=n-p;for(var g=Math.floor(f/7),T=Lt(f,7),O=Math.floor(g+T/4),v=0;v0&&R<=O){var C=void 0;R>1?(C=p+(R-1)*7,p!==c&&(C-=7-c)):C=p;for(var $=0;$<7&&(l.wnomask[C]=1,C++,l.wdaymask[C]!==e.wkst);$++);}}if(Ee(e.byweekno,1)){var C=p+O*7;if(p!==c&&(C-=7-c),C=4?(ke=0,be=Te+Lt(W-e.wkst,7)):be=n-p,B=Math.floor(52+Lt(be,7)/4)}if(Ee(e.byweekno,B))for(var C=0;Ca)return Tn(r);if(B>=t){var W=Rb(B,e);if(!r.accept(W)||l&&(--l,!l))return Tn(r)}}else for(var $=O;$a)return Tn(r);if(B>=t){var W=Rb(B,e);if(!r.accept(W)||l&&(--l,!l))return Tn(r)}}}if(e.interval===0||(c.add(e,R),c.year>se.MAXYEAR))return Tn(r);za(n)||(p=f.gettimeset(n)(c.hour,c.minute,c.second,0)),f.rebuild(c.year,c.month)}}function gI(r,e,t){var n=t.bymonth,s=t.byweekno,a=t.byweekday,o=t.byeaster,l=t.bymonthday,c=t.bynmonthday,f=t.byyearday;return st(n)&&!Ee(n,r.mmask[e])||st(s)&&!r.wnomask[e]||st(a)&&!Ee(a,r.wdaymask[e])||st(r.nwdaymask)&&!r.nwdaymask[e]||o!==null&&!Ee(r.eastermask,e)||(st(l)||st(c))&&!Ee(l,r.mdaymask[e])&&!Ee(c,r.nmdaymask[e])||st(f)&&(e=r.yearlen&&!Ee(f,e+1-r.yearlen)&&!Ee(f,-r.nextyearlen+e-r.yearlen))}function Rb(r,e){return new ks(r,e.tzid).rezonedDate()}function Tn(r){return r.getValue()}function _I(r,e,t,n,s){for(var a=!1,o=e;o=X.HOURLY&&st(s)&&!Ee(s,e.hour)||n>=X.MINUTELY&&st(a)&&!Ee(a,e.minute)||n>=X.SECONDLY&&st(o)&&!Ee(o,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var Dr={MO:new lt(0),TU:new lt(1),WE:new lt(2),TH:new lt(3),FR:new lt(4),SA:new lt(5),SU:new lt(6)},Va={freq:_e.YEARLY,dtstart:null,interval:1,wkst:Dr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},fb=Object.keys(Va),X=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new mb,this.origOptions=Rh(e);var n=cb(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Ha(e,t)},r.fromText=function(e,t){return ab(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Ru(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Mh("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new _n("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,s){if(n===void 0&&(n=!1),!se.isValidDate(e)||!se.isValidDate(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:e,inc:n};if(s)return this._iter(new Mh("between",a,s));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new _n("between",a)),this._cacheAdd("between",o,a)),o},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!se.isValidDate(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new _n("before",n)),this._cacheAdd("before",s,n)),s},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!se.isValidDate(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new _n("after",n)),this._cacheAdd("after",s,n)),s},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return Xa(this.origOptions)},r.prototype.toText=function(e,t,n){return ob(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return ub(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=_e.YEARLY,r.MONTHLY=_e.MONTHLY,r.WEEKLY=_e.WEEKLY,r.DAILY=_e.DAILY,r.HOURLY=_e.HOURLY,r.MINUTELY=_e.MINUTELY,r.SECONDLY=_e.SECONDLY,r.MO=Dr.MO,r.TU=Dr.TU,r.WE=Dr.WE,r.TH=Dr.TH,r.FR=Dr.FR,r.SA=Dr.SA,r.SU=Dr.SU,r.parseString=Za,r.optionsToString=Xa,r}();function xb(r,e,t,n,s,a){var o={},l=r.accept;function c(T,O){t.forEach(function(v){v.between(T,O,!0).forEach(function(R){o[Number(R)]=!0})})}s.forEach(function(T){var O=new ks(T,a).rezonedDate();o[Number(O)]=!0}),r.accept=function(T){var O=Number(T);return isNaN(O)?l.call(this,T):!o[O]&&(c(new Date(O-1),new Date(O+1)),!o[O])?(o[O]=!0,l.call(this,T)):!0},r.method==="between"&&(c(r.args.after,r.args.before),r.accept=function(T){var O=Number(T);return o[O]?!0:(o[O]=!0,l.call(this,T))});for(var f=0;f1||s.length||a.length||o.length){var p=new Ah(f);return p.dtstart(l),p.tzid(c||void 0),n.forEach(function(T){p.rrule(new X(Ph(T,l,c),f))}),s.forEach(function(T){p.rdate(T)}),a.forEach(function(T){p.exrule(new X(Ph(T,l,c),f))}),o.forEach(function(T){p.exdate(T)}),e.compatible&&e.dtstart&&p.rdate(l),p}var g=n[0]||{};return new X(Ph(g,g.dtstart||e.dtstart||l,g.tzid||e.tzid||c),f)}function xu(r,e){return e===void 0&&(e={}),vI(r,wI(e))}function Ph(r,e,t){return Ht(Ht({},r),{dtstart:e,tzid:t})}function wI(r){var e=[],t=Object.keys(r),n=Object.keys(Pb);if(t.forEach(function(s){Ee(n,s)||e.push(s)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Ht(Ht({},Pb),r)}function kI(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=IT(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function DI(r){var e=kI(r),t=e.name,n=e.value,s=t.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:n}}function EI(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` +`),n=0;n0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function SI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Ab(r,e){return SI(e),r.split(",").map(function(t){return se.untilStringToDate(t)})}function Nb(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;nn}static nextAfterYears(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));St.isSkippingTooManyYears(e,t,a);)t=St.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new X(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function Nb(r){let e=`${r.startDateSymbol}${r.scheduledDateSymbol}${r.dueDateSymbol}`;return(t,n,s)=>{let a=[];a=a.concat(EI(t,n,s,e)),a=a.concat(SI(t,n,s,r.recurrenceSymbol));let o=kI(t,s,r),l=Ph(t,/([a-zA-Z'_-]*)/g,n),c=!1;if(l&&l.length>0){let h=l[0];if(h.length>=Math.max(1,s.autoSuggestMinMatch)){let m=o.filter(g=>g.displayText.toLowerCase().includes(h.toLowerCase()));for(let g of m)a.push({suggestionType:"match",displayText:g.displayText,appendText:g.appendText,insertAt:l.index,insertSkip:h.length}),c=!0}}return!c&&s.autoSuggestMinMatch===0&&(a=a.concat(o)),a.length>0&&!a.some(h=>h.suggestionType==="match")&&a.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` -`}),a=a.slice(0,s.autoSuggestMaxItems),a}}function kI(r,e,t){let n=a=>Object.values(t.prioritySymbols).some(o=>o.length>0&&a.includes(o)),s=[];if(r.includes(t.dueDateSymbol)||s.push({displayText:`${t.dueDateSymbol} due date`,appendText:`${t.dueDateSymbol} `}),r.includes(t.startDateSymbol)||s.push({displayText:`${t.startDateSymbol} start date`,appendText:`${t.startDateSymbol} `}),r.includes(t.scheduledDateSymbol)||s.push({displayText:`${t.scheduledDateSymbol} scheduled date`,appendText:`${t.scheduledDateSymbol} `}),n(r)||(s.push({displayText:`${t.prioritySymbols.High} high priority`,appendText:`${t.prioritySymbols.High} `}),s.push({displayText:`${t.prioritySymbols.Medium} medium priority`,appendText:`${t.prioritySymbols.Medium} `}),s.push({displayText:`${t.prioritySymbols.Low} low priority`,appendText:`${t.prioritySymbols.Low} `})),r.includes(t.recurrenceSymbol)||s.push({displayText:`${t.recurrenceSymbol} recurring (repeat)`,appendText:`${t.recurrenceSymbol} `}),!r.includes(t.createdDateSymbol)){let o=wr.parseDate("today",!0).format(ie.dateFormat);s.push({displayText:`${t.createdDateSymbol} created today (${o})`,appendText:`${t.createdDateSymbol} ${o} `})}return s}function EI(r,e,t,n){let s=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`([${n}])\\s*([0-9a-zA-Z ]*)`,"ug"),l=Ph(r,o,e);if(l&&l.length>=2){let c=l[1],h=l[2];if(h.length1?wr.parseDate(li(h),!0):null;m&&m.isValid()&&a.push({displayText:`${m.format(ie.dateFormat)}`,appendText:`${c} ${m.format(ie.dateFormat)} `,insertAt:l.index,insertSkip:l[0].length});let g=1,T=5,S=s.filter(v=>h&&h.length>=g&&v.toLowerCase().includes(h.toLowerCase())).slice(0,T);S.length===0&&(S=s.slice(0,T));for(let v of S){let C=`${wr.parseDate(v,!0).format(ie.dateFormat)}`;a.push({suggestionType:"match",displayText:`${v} (${C})`,appendText:`${c} ${C} `,insertAt:l.index,insertSkip:l[0].length})}}return a}function SI(r,e,t,n){var c;let s=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),l=Ph(r,o,e);if(l&&l.length>=2){let h=l[1],m=l[2];if(m.length0){let v=(c=St.fromText({recurrenceRuleText:m,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:c.toText();if(v){let R=`${h} ${v} `;if(a.push({suggestionType:"match",displayText:`\u2705 ${v}`,appendText:R,insertAt:l.index,insertSkip:l[0].length}),l[0]==R)return[]}}let g=1,T=t.autoSuggestMaxItems/2,S=s.filter(v=>m&&m.length>=g&&v.toLowerCase().includes(m.toLowerCase())).slice(0,T);S.length===0&&m.trim().length===0&&(S=s.slice(0,T));for(let v of S)a.push({suggestionType:"match",displayText:`${v}`,appendText:`${h} ${v} `,insertAt:l.index,insertSkip:l[0].length})}return a}function Ph(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s;return[]}var Za=class{constructor(){this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}},Hn=class{constructor(e,t){this.defaultLayout=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","doneDate","blockLink"];this.hiddenComponents=[];this.specificClasses=[];e?this.options=e:this.options=new Za,t?this.layoutComponents=t:this.layoutComponents=this.defaultLayout,this.layoutComponents=this.applyOptions(this.options)}applyOptions(e){let t=(s,a,o)=>a?(this.specificClasses.push(`tasks-layout-hide-${o}`),this.hiddenComponents.push(o),s.filter(l=>l!=o)):s,n=this.layoutComponents;return n=t(n,e.hidePriority,"priority"),n=t(n,e.hideRecurrenceRule,"recurrenceRule"),n=t(n,e.hideCreatedDate,"createdDate"),n=t(n,e.hideStartDate,"startDate"),n=t(n,e.hideScheduledDate,"scheduledDate"),n=t(n,e.hideDueDate,"dueDate"),n=t(n,e.hideDoneDate,"doneDate"),e.shortMode&&this.specificClasses.push("tasks-layout-short-mode"),n}};var Ah={prioritySymbols:{High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",recurrenceSymbol:"\u{1F501}",TaskFormatRegularExpressions:{priorityRegex:/([⏫🔼🔽])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},Xa=class{constructor(e){this.symbols=e}serialize(e){let t=new Hn,n="";for(let s of t.layoutComponents)n+=this.componentToString(e,t,s);return n}componentToString(e,t,n){var g;let{prioritySymbols:s,startDateSymbol:a,createdDateSymbol:o,scheduledDateSymbol:l,doneDateSymbol:c,recurrenceSymbol:h,dueDateSymbol:m}=this.symbols;switch(n){case"description":return e.description;case"priority":{let T="";return e.priority==="1"?T=" "+s.High:e.priority==="2"?T=" "+s.Medium:e.priority==="4"&&(T=" "+s.Low),T}case"startDate":return e.startDate?t.options.shortMode?" "+a:` ${a} ${e.startDate.format(ie.dateFormat)}`:"";case"createdDate":return e.createdDate?t.options.shortMode?" "+o:` ${o} ${e.createdDate.format(ie.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t.options.shortMode?" "+l:` ${l} ${e.scheduledDate.format(ie.dateFormat)}`;case"doneDate":return e.doneDate?t.options.shortMode?" "+c:` ${c} ${e.doneDate.format(ie.dateFormat)}`:"";case"dueDate":return e.dueDate?t.options.shortMode?" "+m:` ${m} ${e.dueDate.format(ie.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t.options.shortMode?" "+h:` ${h} ${e.recurrence.toText()}`:"";case"blockLink":return(g=e.blockLink)!=null?g:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}deserialize(e){let{prioritySymbols:t,TaskFormatRegularExpressions:n}=this.symbols,s,a="3",o=null,l=null,c=null,h=null,m=null,g="",T=null,S="",v=20,R=0;do{s=!1;let C=e.match(n.priorityRegex);if(C!==null){switch(C[1]){case t.Low:a="4";break;case t.Medium:a="2";break;case t.High:a="1";break}e=e.replace(n.priorityRegex,"").trim(),s=!0}let $=e.match(n.doneDateRegex);$!==null&&(h=window.moment($[1],ie.dateFormat),e=e.replace(n.doneDateRegex,"").trim(),s=!0);let B=e.match(n.dueDateRegex);B!==null&&(c=window.moment(B[1],ie.dateFormat),e=e.replace(n.dueDateRegex,"").trim(),s=!0);let W=e.match(n.scheduledDateRegex);W!==null&&(l=window.moment(W[1],ie.dateFormat),e=e.replace(n.scheduledDateRegex,"").trim(),s=!0);let De=e.match(n.startDateRegex);De!==null&&(o=window.moment(De[1],ie.dateFormat),e=e.replace(n.startDateRegex,"").trim(),s=!0);let Te=e.match(n.createdDateRegex);Te!==null&&(m=window.moment(Te[1],ie.dateFormat),e=e.replace(n.createdDateRegex,"").trim(),s=!0);let be=e.match(n.recurrenceRegex);be!==null&&(g=be[1].trim(),e=e.replace(n.recurrenceRegex,"").trim(),s=!0);let ee=e.match(ie.hashTagsFromEnd);if(ee!=null){e=e.replace(ie.hashTagsFromEnd,"").trim(),s=!0;let te=ee[0].trim();S=S.length>0?[te,S].join(" "):te}R++}while(s&&R<=v);return g.length>0&&(T=St.fromText({recurrenceRuleText:g,startDate:o,scheduledDate:l,dueDate:c})),S.length>0&&(e+=" "+S),{description:e,priority:a,startDate:o,createdDate:m,scheduledDate:l,dueDate:c,doneDate:h,recurrence:T,tags:$e.extractHashtags(e)}}};var Er=(o=>(o.TODO="TODO",o.DONE="DONE",o.IN_PROGRESS="IN_PROGRESS",o.CANCELLED="CANCELLED",o.NON_TASK="NON_TASK",o.EMPTY="EMPTY",o))(Er||{}),Ot=class{constructor(e,t,n,s,a="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=s,this.type=a}};var Zt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}constructor(e){this.configuration=e}static makeDone(){return new Zt(new Ot("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Zt(new Ot("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Zt(new Ot(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Zt(new Ot("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Zt(new Ot("/","In Progress","x",!0,"IN_PROGRESS"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return Er[e]||"TODO"}static createUnknownStatus(e){return new Zt(new Ot(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Zt.getTypeFromStatusTypeString(e[3]);return new Zt(new Ot(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}previewText(){let e="";return Zt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},fe=Zt;fe.DONE=Zt.makeDone(),fe.EMPTY=Zt.makeEmpty(),fe.TODO=Zt.makeTodo();var xu=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var mt=class{constructor(){this.coreStatuses=[fe.makeTodo().configuration,fe.makeDone().configuration],this.customStatuses=[fe.makeInProgress().configuration,fe.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let s=this.findStatusIndex(t,e);return s<=-1?!1:(e.splice(s,1,n),!0)}static findStatusIndex(e,t){let n=new fe(e);return t.findIndex(s=>new fe(s).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){mt.deleteAllCustomStatuses(e),new mt().customStatuses.forEach(n=>{mt.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(s=>{e.customStatuses.find(o=>o.symbol==s[0]&&o.name==s[1]&&o.nextStatusSymbol==s[2])?n.push(`The status ${s[1]} (${s[0]}) is already added.`):mt.addStatus(e.customStatuses,fe.createFromImportedValue(s))}),n}static applyToStatusRegistry(e,t){t.clearStatuses(),e.coreStatuses.forEach(n=>{t.add(n)}),e.customStatuses.forEach(n=>{t.add(n)})}};var Cb=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var zr=class{constructor(e,t,n,s,a,o){this.internalName=e;this.index=t;this.description=n;this.displayName=s;this.enabledByDefault=a;this.stable=o}static get values(){let e=[];return Cb.forEach(t=>{e=[...e,new zr(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return zr.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of zr.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};function Pu(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var Sr=class{static get(){let{globalFilter:e}=he();return e}static set(e){Nt({globalFilter:e})}static reset(){Nt({globalFilter:Sr.empty})}static isEmpty(){return Sr.get()===Sr.empty}static equals(e){return Sr.get()===e}static includedIn(e){let t=Sr.get();return e.includes(t)}static prependTo(e){return Sr.get()+" "+e}static removeAsWordFrom(e){if(Sr.isEmpty())return e;let t=RegExp("(^|\\s)"+Pu(Sr.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}static removeAsSubstringFrom(e){let t=Sr.get();return e.replace(t,"").trim()}static removeAsSubstringFromDependingOnSettings(e){let{removeGlobalFilter:t}=he();return t?Sr.removeAsSubstringFrom(e):e}},Fe=Sr;Fe.empty="";var pi={tasksPluginEmoji:{displayName:"Default",taskSerializer:new Xa(Ah),buildSuggestions:Nb(Ah)}},MI={globalFilter:Fe.empty,removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],statusSettings:new mt,features:zr.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new xu},zn=Ae({},MI),he=()=>{for(let r in zr.settingsFlags)zn.features[r]===void 0&&(zn.features[r]=zr.settingsFlags[r]);return zn.statusSettings.customStatuses.forEach((r,e,t)=>{var s,a;let n=fe.getTypeFromStatusTypeString(r.type);t[e]=new Ot((s=r.symbol)!=null?s:" ",r.name,(a=r.nextStatusSymbol)!=null?a:"x",r.availableAsCommand,n)}),Ae({},zn)},Nt=r=>(zn=Ae(Ae({},zn),r),he());var Ds=(r,e)=>(zn.generalSettings[r]=e,he()),Fb=r=>{var e;return(e=zn.features[r])!=null?e:!1};function Qa(){return pi[he().taskFormat]}var Ge=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==fe.EMPTY.symbol)}static getInstance(){return Ge.instance||(Ge.instance=new Ge),Ge.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof fe?this._registeredStatuses.push(e):this._registeredStatuses.push(new fe(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):fe.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):fe.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:fe.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return fe.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:fe.createUnknownStatus(e.nextStatusSymbol)}findUnknownStatuses(e){let t=e.filter(a=>!this.hasSymbol(a.symbol)),n=new Ge,s=[];return t.forEach(a=>{if(n.hasSymbol(a.symbol))return;let o=Ge.copyStatusWithNewName(a,`Unknown (${a.symbol})`);s.push(o),n.add(o)}),s}static copyStatusWithNewName(e,t){let n=new Ot(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new fe(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[fe.makeTodo(),fe.makeInProgress(),fe.makeDone(),fe.makeCancelled()].forEach(t=>{this.add(t)})}};var vn=class{static calculate(e){let t=0;if(e.dueDate!==null){let n=Math.round(window.moment().diff(e.dueDate)/vn.milliSecondsPerDay),s;n>=7?s=1:n>=-14?s=(n+14)*.8/21+.2:s=.2,t+=s*vn.dueCoefficient}switch(e.scheduledDate!==null&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*vn.scheduledCoefficient),e.startDate!==null&&window.moment().isBefore(e.startDate)&&(t+=1*vn.startedCoefficient),e.priority){case"1":t+=1*vn.priorityCoefficient;break;case"2":t+=.65*vn.priorityCoefficient;break;case"3":t+=.325*vn.priorityCoefficient;break}return t}},bn=vn;bn.dueCoefficient=12,bn.scheduledCoefficient=5,bn.startedCoefficient=-3,bn.priorityCoefficient=6,bn.milliSecondsPerDay=1e3*60*60*24;var Bb=require("obsidian");var eo=require("obsidian");var Wb=In(bu()),RI=require("obsidian"),qb=In(Ub());var Nh=class extends qb.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,s)=>n+s,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",s="";for(let a in this.options.minLevels)t.startsWith(a)&&a.length>=s.length&&(n=this.options.minLevels[a],s=a);return new Ch(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${(0,Wb.default)().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Au=new Nh,Ch=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e){Fh=r,Lh=e,Yh=t},Nu=t=>J(void 0,[t],function*({originalTask:r,newTasks:e}){if(Lh===void 0||Fh===void 0||Yh===void 0){Uh("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]),Ja.debug(`replaceTaskWithTasks entered. ${r.path}`),$b({originalTask:r,newTasks:e,vault:Lh,metadataCache:Fh,workspace:Yh,previousTries:0})});function Uh(r){console.error(r),new eo.Notice(r,15e3)}function Ih(r){console.warn(r),new eo.Notice(r,1e4)}function PI(r){Ja.debug(r)}var $b=o=>J(void 0,[o],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a}){Ja.debug(`tryRepetitive after ${a} previous tries`);let l=()=>{if(a>10){let C=`Tasks: Could not find the correct task line to update. +`).map(function(s){return s.replace(/^RRULE:/,"EXRULE:")}).filter(function(s){return!/^DTSTART/.test(s)}))}),this._rdate.length&&t.push(Fb("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Fb("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(` +`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}(X);function Cb(r,e){if(!(r instanceof X))throw new TypeError(String(r)+" is not RRule instance");Ee(e.map(String),String(r))||e.push(r)}function Ib(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");Ee(e.map(Number),Number(r))||(e.push(r),se.sort(e))}function Fb(r,e,t){var n=!t||t.toUpperCase()==="UTC",s=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(o){return se.timeToUntilString(o.valueOf(),n)}).join(",");return"".concat(s).concat(a)}function Hr(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?-1:!r.isValid()&&e.isValid()||r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var St=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:s,scheduledDate:a,dueDate:o}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=s,this.scheduledDate=a,this.dueDate=o}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:s}){try{let a=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(a==null)return null;let o=a[1].trim(),l=a[2]!==void 0,c=X.parseText(o);if(c!==null){let f=null;s?f=window.moment(s):n?f=window.moment(n):t&&(f=window.moment(t)),!l&&f!==null?c.dtstart=window.moment(f).startOf("day").utc(!0).toDate():c.dtstart=window.moment().startOf("day").utc(!0).toDate();let p=new X(c);return new St({rrule:p,baseOnToday:l,referenceDate:f,startDate:t,scheduledDate:n,dueDate:s})}}catch(a){}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){var t;let e;if(this.baseOnToday){let n=window.moment(),s=new X(tr(Ae({},this.rrule.origOptions),{dtstart:n.startOf("day").utc(!0).toDate()}));e=this.nextAfter(n.endOf("day"),s)}else{let n=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");e=this.nextAfter(n,this.rrule)}if(e!==null){let n=null,s=null,a=null;if(this.referenceDate){if(this.startDate){let o=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(o.asDays()),"days")}if(this.scheduledDate){let o=window.moment.duration(this.scheduledDate.diff(this.referenceDate));s=window.moment(e),s.add(Math.round(o.asDays()),"days")}if(this.dueDate){let o=window.moment.duration(this.dueDate.diff(this.referenceDate));a=window.moment(e),a.add(Math.round(o.asDays()),"days")}}return{startDate:n,scheduledDate:s,dueDate:a}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||Hr(this.startDate,e.startDate)!==0||Hr(this.scheduledDate,e.scheduledDate)!==0||Hr(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),s=this.toText(),a=s.match(/every( \d+)? month(s)?(.*)?/);a!==null&&(s.includes(" on ")||(n=St.nextAfterMonths(e,n,t,a[1])));let o=s.match(/every( \d+)? year(s)?(.*)?/);return o!==null&&(n=St.nextAfterYears(e,n,t,o[1])),St.addTimezone(n).toDate()}static nextAfterMonths(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));St.isSkippingTooManyMonths(e,t,a);)t=St.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let s=t.month()-e.month();return s+=(t.year()-e.year())*12,s>n}static nextAfterYears(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));St.isSkippingTooManyYears(e,t,a);)t=St.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new X(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function Nh(r){let e=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(t,n,s)=>{let a=[];a=a.concat(MI(t,n,s,e)),a=a.concat(RI(t,n,s,r.recurrenceSymbol));let o=OI(t,s,r),l=Ch(t,/([a-zA-Z'_-]*)/g,n),c=!1;if(l&&l.length>0){let f=l[0];if(f.length>=Math.max(1,s.autoSuggestMinMatch)){let p=o.filter(g=>g.displayText.toLowerCase().includes(f.toLowerCase()));for(let g of p)a.push({suggestionType:"match",displayText:g.displayText,appendText:g.appendText,insertAt:l.index,insertSkip:f.length}),c=!0}}return!c&&s.autoSuggestMinMatch===0&&(a=a.concat(o)),a.length>0&&!a.some(f=>f.suggestionType==="match")&&a.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` +`}),a=a.slice(0,s.autoSuggestMaxItems),a}}function OI(r,e,t){let n=a=>Object.values(t.prioritySymbols).some(o=>o.length>0&&a.includes(o)),s=[];if(r.includes(t.dueDateSymbol)||s.push({displayText:`${t.dueDateSymbol} due date`,appendText:`${t.dueDateSymbol} `}),r.includes(t.startDateSymbol)||s.push({displayText:`${t.startDateSymbol} start date`,appendText:`${t.startDateSymbol} `}),r.includes(t.scheduledDateSymbol)||s.push({displayText:`${t.scheduledDateSymbol} scheduled date`,appendText:`${t.scheduledDateSymbol} `}),n(r)||(s.push({displayText:`${t.prioritySymbols.High} high priority`,appendText:`${t.prioritySymbols.High} `}),s.push({displayText:`${t.prioritySymbols.Medium} medium priority`,appendText:`${t.prioritySymbols.Medium} `}),s.push({displayText:`${t.prioritySymbols.Low} low priority`,appendText:`${t.prioritySymbols.Low} `})),r.includes(t.recurrenceSymbol)||s.push({displayText:`${t.recurrenceSymbol} recurring (repeat)`,appendText:`${t.recurrenceSymbol} `}),!r.includes(t.createdDateSymbol)){let o=ir.parseDate("today",!0).format(ie.dateFormat);s.push({displayText:`${t.createdDateSymbol} created today (${o})`,appendText:`${t.createdDateSymbol} ${o} `})}return s}function MI(r,e,t,n){let s=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),l=Ch(r,o,e);if(l&&l.length>=2){let c=l[1],f=l[2];if(f.length1?ir.parseDate(hi(f),!0):null;p&&p.isValid()&&a.push({displayText:`${p.format(ie.dateFormat)}`,appendText:`${c} ${p.format(ie.dateFormat)} `,insertAt:l.index,insertSkip:l[0].length});let g=1,T=5,O=s.filter(v=>f&&f.length>=g&&v.toLowerCase().includes(f.toLowerCase())).slice(0,T);O.length===0&&(O=s.slice(0,T));for(let v of O){let C=`${ir.parseDate(v,!0).format(ie.dateFormat)}`;a.push({suggestionType:"match",displayText:`${v} (${C})`,appendText:`${c} ${C} `,insertAt:l.index,insertSkip:l[0].length})}}return a}function RI(r,e,t,n){var c;let s=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),l=Ch(r,o,e);if(l&&l.length>=2){let f=l[1],p=l[2];if(p.length0){let v=(c=St.fromText({recurrenceRuleText:p,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:c.toText();if(v){let R=`${f} ${v} `;if(a.push({suggestionType:"match",displayText:`\u2705 ${v}`,appendText:R,insertAt:l.index,insertSkip:l[0].length}),l[0]==R)return[]}}let g=1,T=t.autoSuggestMaxItems/2,O=s.filter(v=>p&&p.length>=g&&v.toLowerCase().includes(p.toLowerCase())).slice(0,T);O.length===0&&p.trim().length===0&&(O=s.slice(0,T));for(let v of O)a.push({suggestionType:"match",displayText:`${v}`,appendText:`${f} ${v} `,insertAt:l.index,insertSkip:l[0].length})}return a}function Ch(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s;return[]}var Qa=class{constructor(){this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}},zn=class{constructor(e,t){this.defaultLayout=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","doneDate","blockLink"];this.hiddenComponents=[];this.specificClasses=[];e?this.options=e:this.options=new Qa,t?this.layoutComponents=t:this.layoutComponents=this.defaultLayout,this.layoutComponents=this.applyOptions(this.options)}applyOptions(e){let t=(s,a,o)=>a?(this.specificClasses.push(`tasks-layout-hide-${o}`),this.hiddenComponents.push(o),s.filter(l=>l!=o)):s,n=this.layoutComponents;return n=t(n,e.hidePriority,"priority"),n=t(n,e.hideRecurrenceRule,"recurrenceRule"),n=t(n,e.hideCreatedDate,"createdDate"),n=t(n,e.hideStartDate,"startDate"),n=t(n,e.hideScheduledDate,"scheduledDate"),n=t(n,e.hideDueDate,"dueDate"),n=t(n,e.hideDoneDate,"doneDate"),e.shortMode&&this.specificClasses.push("tasks-layout-short-mode"),n}};var Ih={prioritySymbols:{High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",recurrenceSymbol:"\u{1F501}",TaskFormatRegularExpressions:{priorityRegex:/([⏫🔼🔽])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},Ds=class{constructor(e){this.symbols=e}serialize(e){let t=new zn,n="";for(let s of t.layoutComponents)n+=this.componentToString(e,t,s);return n}componentToString(e,t,n){var g;let{prioritySymbols:s,startDateSymbol:a,createdDateSymbol:o,scheduledDateSymbol:l,doneDateSymbol:c,recurrenceSymbol:f,dueDateSymbol:p}=this.symbols;switch(n){case"description":return e.description;case"priority":{let T="";return e.priority==="1"?T=" "+s.High:e.priority==="2"?T=" "+s.Medium:e.priority==="4"&&(T=" "+s.Low),T}case"startDate":return e.startDate?t.options.shortMode?" "+a:` ${a} ${e.startDate.format(ie.dateFormat)}`:"";case"createdDate":return e.createdDate?t.options.shortMode?" "+o:` ${o} ${e.createdDate.format(ie.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t.options.shortMode?" "+l:` ${l} ${e.scheduledDate.format(ie.dateFormat)}`;case"doneDate":return e.doneDate?t.options.shortMode?" "+c:` ${c} ${e.doneDate.format(ie.dateFormat)}`:"";case"dueDate":return e.dueDate?t.options.shortMode?" "+p:` ${p} ${e.dueDate.format(ie.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t.options.shortMode?" "+f:` ${f} ${e.recurrence.toText()}`:"";case"blockLink":return(g=e.blockLink)!=null?g:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,s="3",a=null,o=null,l=null,c=null,f=null,p="",g=null,T="",O=20,v=0;do{n=!1;let R=e.match(t.priorityRegex);R!==null&&(s=this.parsePriority(R[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let C=e.match(t.doneDateRegex);C!==null&&(c=window.moment(C[1],ie.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let $=e.match(t.dueDateRegex);$!==null&&(l=window.moment($[1],ie.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let B=e.match(t.scheduledDateRegex);B!==null&&(o=window.moment(B[1],ie.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let W=e.match(t.startDateRegex);W!==null&&(a=window.moment(W[1],ie.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let ke=e.match(t.createdDateRegex);ke!==null&&(f=window.moment(ke[1],ie.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let Te=e.match(t.recurrenceRegex);Te!==null&&(p=Te[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let be=e.match(ie.hashTagsFromEnd);if(be!=null){e=e.replace(ie.hashTagsFromEnd,"").trim(),n=!0;let ee=be[0].trim();T=T.length>0?[ee,T].join(" "):ee}v++}while(n&&v<=O);return p.length>0&&(g=St.fromText({recurrenceRuleText:p,startDate:a,scheduledDate:o,dueDate:l})),T.length>0&&(e+=" "+T),{description:e,priority:s,startDate:a,createdDate:f,scheduledDate:o,dueDate:l,doneDate:c,recurrence:g,tags:Ge.extractHashtags(e)}}};function Es(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Fh={prioritySymbols:{High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",recurrenceSymbol:"repeat::",TaskFormatRegularExpressions:{priorityRegex:Es(/priority:: *(high|medium|low)/),startDateRegex:Es(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:Es(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:Es(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:Es(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:Es(/completion:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:Es(/repeat:: *([a-zA-Z0-9, !]+)/)}},Pu=class extends Ds{constructor(){super(Fh)}parsePriority(e){switch(e){case"high":return"1";case"medium":return"2";case"low":return"4";default:return"3"}}componentToString(e,t,n){let s=super.componentToString(e,t,n);return s!==""&&!["blockLink","description"].includes(n)?` [${s.trim()}]`:s}};var Er=(o=>(o.TODO="TODO",o.DONE="DONE",o.IN_PROGRESS="IN_PROGRESS",o.CANCELLED="CANCELLED",o.NON_TASK="NON_TASK",o.EMPTY="EMPTY",o))(Er||{}),Ot=class{constructor(e,t,n,s,a="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=s,this.type=a}};var Xt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}constructor(e){this.configuration=e}static makeDone(){return new Xt(new Ot("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Xt(new Ot("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Xt(new Ot(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Xt(new Ot("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Xt(new Ot("/","In Progress","x",!0,"IN_PROGRESS"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return Er[e]||"TODO"}static createUnknownStatus(e){return new Xt(new Ot(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Xt.getTypeFromStatusTypeString(e[3]);return new Xt(new Ot(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}previewText(){let e="";return Xt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},he=Xt;he.DONE=Xt.makeDone(),he.EMPTY=Xt.makeEmpty(),he.TODO=Xt.makeTodo();var Au=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var mt=class{constructor(){this.coreStatuses=[he.makeTodo().configuration,he.makeDone().configuration],this.customStatuses=[he.makeInProgress().configuration,he.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let s=this.findStatusIndex(t,e);return s<=-1?!1:(e.splice(s,1,n),!0)}static findStatusIndex(e,t){let n=new he(e);return t.findIndex(s=>new he(s).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){mt.deleteAllCustomStatuses(e),new mt().customStatuses.forEach(n=>{mt.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(s=>{e.customStatuses.find(o=>o.symbol==s[0]&&o.name==s[1]&&o.nextStatusSymbol==s[2])?n.push(`The status ${s[1]} (${s[0]}) is already added.`):mt.addStatus(e.customStatuses,he.createFromImportedValue(s))}),n}static applyToStatusRegistry(e,t){t.clearStatuses(),e.coreStatuses.forEach(n=>{t.add(n)}),e.customStatuses.forEach(n=>{t.add(n)})}};var Lb=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var zr=class{constructor(e,t,n,s,a,o){this.internalName=e;this.index=t;this.description=n;this.displayName=s;this.enabledByDefault=a;this.stable=o}static get values(){let e=[];return Lb.forEach(t=>{e=[...e,new zr(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return zr.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of zr.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};function Nu(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var Sr=class{static get(){let{globalFilter:e}=de();return e}static set(e){Mt({globalFilter:e})}static reset(){Mt({globalFilter:Sr.empty})}static isEmpty(){return Sr.get()===Sr.empty}static equals(e){return Sr.get()===e}static includedIn(e){let t=Sr.get();return e.includes(t)}static prependTo(e){return Sr.get()+" "+e}static removeAsWordFrom(e){if(Sr.isEmpty())return e;let t=RegExp("(^|\\s)"+Nu(Sr.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}static removeAsSubstringFrom(e){let t=Sr.get();return e.replace(t,"").trim()}static removeAsSubstringFromDependingOnSettings(e){let{removeGlobalFilter:t}=de();return t?Sr.removeAsSubstringFrom(e):e}},Fe=Sr;Fe.empty="";var bn={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Ds(Ih),buildSuggestions:Nh(Ih)},dataview:{displayName:"Dataview",taskSerializer:new Pu,buildSuggestions:Nh(Fh)}},PI={globalFilter:Fe.empty,removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],statusSettings:new mt,features:zr.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new Au},Vn=Ae({},PI),de=()=>{for(let r in zr.settingsFlags)Vn.features[r]===void 0&&(Vn.features[r]=zr.settingsFlags[r]);return Vn.statusSettings.customStatuses.forEach((r,e,t)=>{var s,a;let n=he.getTypeFromStatusTypeString(r.type);t[e]=new Ot((s=r.symbol)!=null?s:" ",r.name,(a=r.nextStatusSymbol)!=null?a:"x",r.availableAsCommand,n)}),Ae({},Vn)},Mt=r=>(Vn=Ae(Ae({},Vn),r),de());var Ss=(r,e)=>(Vn.generalSettings[r]=e,de()),Ub=r=>{var e;return(e=Vn.features[r])!=null?e:!1};function eo(){return bn[de().taskFormat]}var Be=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==he.EMPTY.symbol)}static getInstance(){return Be.instance||(Be.instance=new Be),Be.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof he?this._registeredStatuses.push(e):this._registeredStatuses.push(new he(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):he.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):he.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:he.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return he.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:he.createUnknownStatus(e.nextStatusSymbol)}findUnknownStatuses(e){let t=e.filter(a=>!this.hasSymbol(a.symbol)),n=new Be,s=[];return t.forEach(a=>{if(n.hasSymbol(a.symbol))return;let o=Be.copyStatusWithNewName(a,`Unknown (${a.symbol})`);s.push(o),n.add(o)}),s}static copyStatusWithNewName(e,t){let n=new Ot(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new he(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[he.makeTodo(),he.makeInProgress(),he.makeDone(),he.makeCancelled()].forEach(t=>{this.add(t)})}};var wn=class{static calculate(e){let t=0;if(e.dueDate!==null){let n=Math.round(window.moment().diff(e.dueDate)/wn.milliSecondsPerDay),s;n>=7?s=1:n>=-14?s=(n+14)*.8/21+.2:s=.2,t+=s*wn.dueCoefficient}switch(e.scheduledDate!==null&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*wn.scheduledCoefficient),e.startDate!==null&&window.moment().isBefore(e.startDate)&&(t+=1*wn.startedCoefficient),e.priority){case"1":t+=1*wn.priorityCoefficient;break;case"2":t+=.65*wn.priorityCoefficient;break;case"3":t+=.325*wn.priorityCoefficient;break}return t}},vn=wn;vn.dueCoefficient=12,vn.scheduledCoefficient=5,vn.startedCoefficient=-3,vn.priorityCoefficient=6,vn.milliSecondsPerDay=1e3*60*60*24;var Vb=require("obsidian");var ro=require("obsidian");var $b=Fn(wu()),AI=require("obsidian"),Gb=Fn(jb());var Lh=class extends Gb.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,s)=>n+s,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",s="";for(let a in this.options.minLevels)t.startsWith(a)&&a.length>=s.length&&(n=this.options.minLevels[a],s=a);return new Yh(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${(0,$b.default)().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Cu=new Lh,Yh=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e){Wh=r,qh=e,jh=t},Iu=t=>J(void 0,[t],function*({originalTask:r,newTasks:e}){if(qh===void 0||Wh===void 0||jh===void 0){$h("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]),to.debug(`replaceTaskWithTasks entered. ${r.path}`),Hb({originalTask:r,newTasks:e,vault:qh,metadataCache:Wh,workspace:jh,previousTries:0})});function $h(r){console.error(r),new ro.Notice(r,15e3)}function Uh(r){console.warn(r),new ro.Notice(r,1e4)}function CI(r){to.debug(r)}var Hb=o=>J(void 0,[o],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a}){to.debug(`tryRepetitive after ${a} previous tries`);let l=()=>{if(a>10){let C=`Tasks: Could not find the correct task line to update. The task line not updated is: ${r.originalMarkdown} @@ -147,14 +147,14 @@ Recommendations: 1. Close all panes that have the above file open, and then re-open the file. 2. Check for exactly identical copies of the task line, in this file, and see if you can make them different. -`;Uh(C);return}let R=Math.min(Math.pow(10,a),100);Ja.debug(`timeout = ${R}`),setTimeout(()=>{$b({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a+1})},R)},c=t.getAbstractFileByPath(r.path);if(!(c instanceof eo.TFile))return Ih(`Tasks: No file found for task ${r.description}. Retrying ...`),l();if(!xI.includes(c.extension)){Uh(`Tasks: Does not support files with the ${c.extension} file extension.`);return}let h=n.getFileCache(c);if(h==null||h===null)return Ih(`Tasks: No file cache found for file ${c.path}. Retrying ...`),l();let m=h.listItems;if(m===void 0||m.length===0)return Ih(`Tasks: No list items found in file cache of ${c.path}. Retrying ...`),l();let T=(yield t.read(c)).split(` -`),S=AI(r,T,m,PI);if(S===void 0)return l();let v=[...T.slice(0,S),...e.map(R=>R.toFileLineString()),...T.slice(S+1)];yield t.modify(c,v.join(` -`))});function Gb(r,e){return r{Hb({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a+1})},R)},c=t.getAbstractFileByPath(r.path);if(!(c instanceof ro.TFile))return Uh(`Tasks: No file found for task ${r.description}. Retrying ...`),l();if(!NI.includes(c.extension)){$h(`Tasks: Does not support files with the ${c.extension} file extension.`);return}let f=n.getFileCache(c);if(f==null||f===null)return Uh(`Tasks: No file cache found for file ${c.path}. Retrying ...`),l();let p=f.listItems;if(p===void 0||p.length===0)return Uh(`Tasks: No list items found in file cache of ${c.path}. Retrying ...`),l();let T=(yield t.read(c)).split(` +`),O=II(r,T,p,CI);if(O===void 0)return l();let v=[...T.slice(0,O),...e.map(R=>R.toFileLineString()),...T.slice(O+1)];yield t.modify(c,v.join(` +`))});function zb(r,e){return r{c.preventDefault(),c.stopPropagation(),o.disabled=!0;let h=r.toggle();Nu({originalTask:r,newTasks:h})}),n.prepend(o),n.setAttribute("data-task",r.status.symbol.trim()),n.setAttribute("data-line",e.listIndex.toString()),n.setAttribute("data-task-status-name",r.status.name),n.setAttribute("data-task-status-type",r.status.type),o.setAttribute("data-line",e.listIndex.toString()),(l=e.layoutOptions)!=null&&l.shortMode&&GI({task:r,element:s,isFilenameUnique:e.isFilenameUnique}),n})}function UI(r,e,t,n){return J(this,null,function*(){let s={},a=new Hn(e.layoutOptions),o=pi.tasksPluginEmoji.taskSerializer;for(let l of a.layoutComponents){let c=o.componentToString(r,a,l);if(c){l==="description"&&(c=Fe.removeAsSubstringFromDependingOnSettings(c));let h=document.createElement("span");if(t.appendChild(h),h){let m=document.createElement("span");h.appendChild(m),yield WI(m,c,l,r,n);let[g,T]=Wh(l,r);qI(l,m),h.classList.add(...g);for(let S in T)h.dataset[S]=T[S];s=Ae(Ae({},s),T)}}}for(let l of a.hiddenComponents){let[c,h]=Wh(l,r);s=Ae(Ae({},s),h)}if(s.taskPriority===void 0){let[l,c]=Wh("priority",r);s=Ae(Ae({},s),c)}return s})}function WI(r,e,t,n,s){return J(this,null,function*(){if(t==="description"){let{debugSettings:a}=he();a.showTaskHiddenData&&(e+=`
\u{1F41B} ${n.lineNumber} . ${n.sectionStart} . ${n.sectionIndex} . '${n.originalMarkdown}'
'${n.path}' > '${n.precedingHeader}'
`),yield s(e,r,n.path);let o=r.querySelector("blockquote"),l=o!=null?o:r,c=l.querySelector("p");if(c!==null){for(;c.firstChild;)l.insertBefore(c.firstChild,c);c.remove()}r.querySelectorAll("p").forEach(h=>{h.hasChildNodes()||h.remove()}),r.querySelectorAll(".footnotes").forEach(h=>{h.remove()})}else r.innerHTML=e})}function Wh(r,e){let t=[],n={},s=(a,o)=>{let l=jI(a);l&&(n[o]=l)};switch(r){case"description":t.push(Vn.description);break;case"priority":{let a=null;e.priority==="1"?a="high":e.priority==="2"?a="medium":e.priority==="4"?a="low":a="normal",n.taskPriority=a,t.push(Vn.priority);break}case"createdDate":{let a=e.createdDate;a&&(t.push(Vn.createdDate),s(a,"taskCreated"));break}case"dueDate":{let a=e.dueDate;a&&(t.push(Vn.dueDate),s(a,"taskDue"));break}case"startDate":{let a=e.startDate;a&&(t.push(Vn.startDate),s(a,"taskStart"));break}case"scheduledDate":{let a=e.scheduledDate;a&&(t.push(Vn.scheduledDate),s(a,"taskScheduled"));break}case"doneDate":{let a=e.doneDate;a&&(t.push(Vn.doneDate),s(a,"taskDone"));break}case"recurrenceRule":{t.push(Vn.recurrenceRule);break}}return[t,n]}function qI(r,e){if(r==="description"){let t=e.getElementsByClassName("tag");for(let n=0;n0?t+="past-":n<0&&(t+="future-"),Math.abs(n)<=FI?t+=Math.abs(n).toString()+"d":t+=LI,t)}function $I(r){let e=/["&\x00\r\n]/g,t=r.replace(e,"-");return t=t.replace(/^[-_]+/,""),t.length>0?t:null}function GI({task:r,element:e,isFilenameUnique:t}){let{recurrenceSymbol:n,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:l,doneDateSymbol:c}=pi.tasksPluginEmoji.taskSerializer.symbols;e.addEventListener("mouseenter",()=>{let h=e.createDiv();h.addClasses(["tooltip","pop-up"]),r.recurrence&&h.createDiv().setText(`${n} ${r.recurrence.toText()}`),r.createdDate&&h.createDiv().setText(to({signifier:a,date:r.createdDate})),r.startDate&&h.createDiv().setText(to({signifier:s,date:r.startDate})),r.scheduledDate&&h.createDiv().setText(to({signifier:o,date:r.scheduledDate})),r.dueDate&&h.createDiv().setText(to({signifier:l,date:r.dueDate})),r.doneDate&&h.createDiv().setText(to({signifier:c,date:r.doneDate}));let m=r.getLinkText({isFilenameUnique:t});m&&h.createDiv().setText(`\u{1F517} ${m}`),e.addEventListener("mouseleave",()=>{h.remove()})})}function to({signifier:r,date:e}){return`${r} ${e.format(ie.dateFormat)} (${e.from(window.moment().startOf("day"))})`}var Xt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=he();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),s=e.substring(t,n),a=/(\d{4})-(\d{2})-(\d{2})/.exec(s);if(a||(a=/(\d{4})(\d{2})(\d{2})/.exec(s)),a){let o=window.moment([parseInt(a[1]),parseInt(a[2])-1,parseInt(a[3])]);if(o.isValid())return o}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let s=e.scheduledDate,a=e.scheduledDateIsInferred;return n===null?a&&(a=!1,s=null):a?s=n:this.canApplyFallback(e)&&(s=n,a=!0),new $e(er(Ae({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:s,scheduledDateIsInferred:a}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(s=>(n!==null&&!n.isSame(s.scheduledDate,"day")&&(s=new $e(er(Ae({},s),{scheduledDateIsInferred:!1}))),s))}};var or=class{},ie=or;ie.dateFormat="YYYY-MM-DD",ie.indentationRegex=/^([\s\t>]*)/,ie.listMarkerRegex=/([-*]|[0-9]+\.)/,ie.checkboxRegex=/\[(.)\]/u,ie.afterCheckboxRegex=/ *(.*)/u,ie.taskRegex=new RegExp(or.indentationRegex.source+or.listMarkerRegex.source+" +"+or.checkboxRegex.source+or.afterCheckboxRegex.source,"u"),ie.nonTaskRegex=new RegExp(or.indentationRegex.source+or.listMarkerRegex.source+"? *("+or.checkboxRegex.source+")?"+or.afterCheckboxRegex.source,"u"),ie.listItemRegex=new RegExp(or.indentationRegex.source+or.listMarkerRegex.source),ie.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,ie.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]*/g,ie.hashTagsFromEnd=new RegExp(or.hashTags.source+"$");var $e=class{constructor({status:e,description:t,taskLocation:n,indentation:s,listMarker:a,priority:o,createdDate:l,startDate:c,scheduledDate:h,dueDate:m,doneDate:g,recurrence:T,blockLink:S,tags:v,originalMarkdown:R,scheduledDateIsInferred:C}){this._urgency=null;this.status=e,this.description=t,this.indentation=s,this.listMarker=a,this.taskLocation=n,this.tags=v,this.priority=o,this.createdDate=l,this.startDate=c,this.scheduledDate=h,this.dueDate=m,this.doneDate=g,this.recurrence=T,this.blockLink=S,this.originalMarkdown=R,this.scheduledDateIsInferred=C}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let s=e.match(ie.taskRegex);if(s===null)return null;let a=s[4].trim();if(!Fe.includedIn(a))return null;let o=a,l=s[1],c=s[2],h=s[3],m=Ge.getInstance().bySymbolOrCreate(h),g=o.match(ie.blockLinkRegex),T=g!==null?g[0]:"";T!==""&&(o=o.replace(ie.blockLinkRegex,"").trim());let{taskSerializer:S}=Qa(),v=S.deserialize(o),R=!1;return Xt.canApplyFallback(v)&&n!==null&&(v.scheduledDate=n,R=!0),v.tags=v.tags.map(C=>C.trim()),v.tags=v.tags.filter(C=>!Fe.equals(C)),new $e(er(Ae({},v),{status:m,indentation:l,listMarker:c,taskLocation:t,blockLink:T,originalMarkdown:e,scheduledDateIsInferred:R}))}toLi(e){return J(this,null,function*(){return Hb(this,e)})}toString(){return Qa().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Ge.getInstance().getNextStatusOrCreate(this.status),t=null,n=null;if(e.isCompleted()){let{setDoneDate:o}=he();o&&(t=window.moment()),this.recurrence!==null&&(n=this.recurrence.next())}let s=new $e(er(Ae({},this),{status:e,doneDate:t})),a=[];if(n!==null){let{setCreatedDate:o}=he(),l=null;o&&(l=window.moment());let c=Ge.getInstance().getNextStatusOrCreate(e),h=new $e(er(Ae(Ae({},this),n),{status:c,blockLink:"",createdDate:l}));a.push(h)}return a.push(s),a}get urgency(){return this._urgency===null&&(this._urgency=bn.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,s)=>n.identicalTo(t[s]))}identicalTo(e){let t=["status","description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let a of t)if(this[a]!==e[a])return!1;if(this.tags.length!==e.tags.length||!this.tags.every(function(a,o){return a===e.tags[o]}))return!1;t=["createdDate","startDate","scheduledDate","dueDate","doneDate"];for(let a of t){let o=this[a],l=e[a];if(Hr(o,l)!==0)return!1}let n=this.recurrence,s=e.recurrence;return n===null&&s!==null||n!==null&&s===null?!1:!(n&&s&&!n.identicalTo(s))}static extractHashtags(e){var t,n;return(n=(t=e.match(ie.hashTags))==null?void 0:t.map(s=>s.trim()))!=null?n:[]}};var ro=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var Ct=class{constructor(e,t,n,s,a){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=s,this._precedingHeader=a}static fromUnknownPosition(e){return new Ct(e,0,0,0,null)}fromRenamedFile(e){return new Ct(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var ks=class{constructor({metadataCache:e,vault:t,events:n}){this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new Mo,this.state="Cold",this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){let e=this.metadataCache.on("resolved",()=>J(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){let{useFilenameAsScheduledDate:e}=he(),t=this.vault.on("create",a=>{a instanceof mi.TFile&&this.tasksMutex.runExclusive(()=>{this.indexFile(a)})});this.vaultEventReferences.push(t);let n=this.vault.on("delete",a=>{a instanceof mi.TFile&&this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(o=>o.path!==a.path),this.notifySubscribers()})});this.vaultEventReferences.push(n);let s=this.vault.on("rename",(a,o)=>{a instanceof mi.TFile&&this.tasksMutex.runExclusive(()=>{let l=new ro(()=>Xt.fromPath(a.path));this.tasks=this.tasks.map(c=>c.path===o?e?Xt.updateTaskPath(c,a.path,l.value):new $e(er(Ae({},c),{taskLocation:c.taskLocation.fromRenamedFile(a.path)})):c),this.notifySubscribers()})});this.vaultEventReferences.push(s)}subscribeToEvents(){let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.tasksMutex.runExclusive(()=>J(this,null,function*(){this.state="Initializing",yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.notifySubscribers()}))}indexFile(e){return J(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;let n=this.tasks.filter(o=>o.path===e.path),s=t.listItems,a=[];if(s!==void 0){let o=yield this.vault.cachedRead(e);a=this.getTasksFromFileContent(o,s,t,e)}$e.tasksListsIdentical(n,a)||(this.getState()=="Warm"&&console.debug(`At least one task, its line number or its heading has changed in ${e.path}: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.`),this.tasks=this.tasks.filter(o=>o.path!==e.path),this.tasks.push(...a),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,s){let a=[],o=e.split(` -`),l=o.length,c=new ro(()=>Xt.fromPath(s.path)),h=null,m=0;for(let g of t)if(g.task!==void 0){let T=g.position.start.line;if(T>=l)return console.log(`${s.path} Obsidian gave us a line number ${T} past the end of the file. ${l}.`),a;if((h===null||h.position.end.line{c.preventDefault(),c.stopPropagation(),o.disabled=!0;let f=r.toggle();Iu({originalTask:r,newTasks:f})}),n.prepend(o),n.setAttribute("data-task",r.status.symbol.trim()),n.setAttribute("data-line",e.listIndex.toString()),n.setAttribute("data-task-status-name",r.status.name),n.setAttribute("data-task-status-type",r.status.type),o.setAttribute("data-line",e.listIndex.toString()),(l=e.layoutOptions)!=null&&l.shortMode&&zI({task:r,element:s,isFilenameUnique:e.isFilenameUnique}),n})}function jI(r,e,t,n){return J(this,null,function*(){let s={},a=new zn(e.layoutOptions),o=bn.tasksPluginEmoji.taskSerializer;for(let l of a.layoutComponents){let c=o.componentToString(r,a,l);if(c){l==="description"&&(c=Fe.removeAsSubstringFromDependingOnSettings(c));let f=document.createElement("span");if(t.appendChild(f),f){let p=document.createElement("span");f.appendChild(p),yield $I(p,c,l,r,n);let[g,T]=Gh(l,r);GI(l,p),f.classList.add(...g);for(let O in T)f.dataset[O]=T[O];s=Ae(Ae({},s),T)}}}for(let l of a.hiddenComponents){let[c,f]=Gh(l,r);s=Ae(Ae({},s),f)}if(s.taskPriority===void 0){let[l,c]=Gh("priority",r);s=Ae(Ae({},s),c)}return s})}function $I(r,e,t,n,s){return J(this,null,function*(){if(t==="description"){let{debugSettings:a}=de();a.showTaskHiddenData&&(e+=`
\u{1F41B} ${n.lineNumber} . ${n.sectionStart} . ${n.sectionIndex} . '${n.originalMarkdown}'
'${n.path}' > '${n.precedingHeader}'
`),yield s(e,r,n.path);let o=r.querySelector("blockquote"),l=o!=null?o:r,c=l.querySelector("p");if(c!==null){for(;c.firstChild;)l.insertBefore(c.firstChild,c);c.remove()}r.querySelectorAll("p").forEach(f=>{f.hasChildNodes()||f.remove()}),r.querySelectorAll(".footnotes").forEach(f=>{f.remove()})}else r.innerHTML=e})}function Gh(r,e){let t=[],n={},s=(a,o)=>{let l=BI(a);l&&(n[o]=l)};switch(r){case"description":t.push(Kn.description);break;case"priority":{let a=null;e.priority==="1"?a="high":e.priority==="2"?a="medium":e.priority==="4"?a="low":a="normal",n.taskPriority=a,t.push(Kn.priority);break}case"createdDate":{let a=e.createdDate;a&&(t.push(Kn.createdDate),s(a,"taskCreated"));break}case"dueDate":{let a=e.dueDate;a&&(t.push(Kn.dueDate),s(a,"taskDue"));break}case"startDate":{let a=e.startDate;a&&(t.push(Kn.startDate),s(a,"taskStart"));break}case"scheduledDate":{let a=e.scheduledDate;a&&(t.push(Kn.scheduledDate),s(a,"taskScheduled"));break}case"doneDate":{let a=e.doneDate;a&&(t.push(Kn.doneDate),s(a,"taskDone"));break}case"recurrenceRule":{t.push(Kn.recurrenceRule);break}}return[t,n]}function GI(r,e){if(r==="description"){let t=e.getElementsByClassName("tag");for(let n=0;n0?t+="past-":n<0&&(t+="future-"),Math.abs(n)<=UI?t+=Math.abs(n).toString()+"d":t+=WI,t)}function HI(r){let e=/["&\x00\r\n]/g,t=r.replace(e,"-");return t=t.replace(/^[-_]+/,""),t.length>0?t:null}function zI({task:r,element:e,isFilenameUnique:t}){let{recurrenceSymbol:n,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:l,doneDateSymbol:c}=bn.tasksPluginEmoji.taskSerializer.symbols;e.addEventListener("mouseenter",()=>{let f=e.createDiv();f.addClasses(["tooltip","pop-up"]),r.recurrence&&f.createDiv().setText(`${n} ${r.recurrence.toText()}`),r.createdDate&&f.createDiv().setText(no({signifier:a,date:r.createdDate})),r.startDate&&f.createDiv().setText(no({signifier:s,date:r.startDate})),r.scheduledDate&&f.createDiv().setText(no({signifier:o,date:r.scheduledDate})),r.dueDate&&f.createDiv().setText(no({signifier:l,date:r.dueDate})),r.doneDate&&f.createDiv().setText(no({signifier:c,date:r.doneDate}));let p=r.getLinkText({isFilenameUnique:t});p&&f.createDiv().setText(`\u{1F517} ${p}`),e.addEventListener("mouseleave",()=>{f.remove()})})}function no({signifier:r,date:e}){return`${r} ${e.format(ie.dateFormat)} (${e.from(window.moment().startOf("day"))})`}var Qt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=de();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),s=e.substring(t,n),a=/(\d{4})-(\d{2})-(\d{2})/.exec(s);if(a||(a=/(\d{4})(\d{2})(\d{2})/.exec(s)),a){let o=window.moment([parseInt(a[1]),parseInt(a[2])-1,parseInt(a[3])]);if(o.isValid())return o}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let s=e.scheduledDate,a=e.scheduledDateIsInferred;return n===null?a&&(a=!1,s=null):a?s=n:this.canApplyFallback(e)&&(s=n,a=!0),new Ge(tr(Ae({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:s,scheduledDateIsInferred:a}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(s=>(n!==null&&!n.isSame(s.scheduledDate,"day")&&(s=new Ge(tr(Ae({},s),{scheduledDateIsInferred:!1}))),s))}};var ur=class{},ie=ur;ie.dateFormat="YYYY-MM-DD",ie.indentationRegex=/^([\s\t>]*)/,ie.listMarkerRegex=/([-*]|[0-9]+\.)/,ie.checkboxRegex=/\[(.)\]/u,ie.afterCheckboxRegex=/ *(.*)/u,ie.taskRegex=new RegExp(ur.indentationRegex.source+ur.listMarkerRegex.source+" +"+ur.checkboxRegex.source+ur.afterCheckboxRegex.source,"u"),ie.nonTaskRegex=new RegExp(ur.indentationRegex.source+ur.listMarkerRegex.source+"? *("+ur.checkboxRegex.source+")?"+ur.afterCheckboxRegex.source,"u"),ie.listItemRegex=new RegExp(ur.indentationRegex.source+ur.listMarkerRegex.source),ie.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,ie.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]*/g,ie.hashTagsFromEnd=new RegExp(ur.hashTags.source+"$");var Ge=class{constructor({status:e,description:t,taskLocation:n,indentation:s,listMarker:a,priority:o,createdDate:l,startDate:c,scheduledDate:f,dueDate:p,doneDate:g,recurrence:T,blockLink:O,tags:v,originalMarkdown:R,scheduledDateIsInferred:C}){this._urgency=null;this.status=e,this.description=t,this.indentation=s,this.listMarker=a,this.taskLocation=n,this.tags=v,this.priority=o,this.createdDate=l,this.startDate=c,this.scheduledDate=f,this.dueDate=p,this.doneDate=g,this.recurrence=T,this.blockLink=O,this.originalMarkdown=R,this.scheduledDateIsInferred=C}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let s=e.match(ie.taskRegex);if(s===null)return null;let a=s[4].trim();if(!Fe.includedIn(a))return null;let o=a,l=s[1],c=s[2],f=s[3],p=Be.getInstance().bySymbolOrCreate(f),g=o.match(ie.blockLinkRegex),T=g!==null?g[0]:"";T!==""&&(o=o.replace(ie.blockLinkRegex,"").trim());let{taskSerializer:O}=eo(),v=O.deserialize(o),R=!1;return Qt.canApplyFallback(v)&&n!==null&&(v.scheduledDate=n,R=!0),v.tags=v.tags.map(C=>C.trim()),v.tags=v.tags.filter(C=>!Fe.equals(C)),new Ge(tr(Ae({},v),{status:p,indentation:l,listMarker:c,taskLocation:t,blockLink:T,originalMarkdown:e,scheduledDateIsInferred:R}))}toLi(e){return J(this,null,function*(){return Kb(this,e)})}toString(){return eo().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Be.getInstance().getNextStatusOrCreate(this.status),t=null,n=null;if(e.isCompleted()){let{setDoneDate:o}=de();o&&(t=window.moment()),this.recurrence!==null&&(n=this.recurrence.next())}let s=new Ge(tr(Ae({},this),{status:e,doneDate:t})),a=[];if(n!==null){let{setCreatedDate:o}=de(),l=null;o&&(l=window.moment());let c=Be.getInstance().getNextStatusOrCreate(e),f=new Ge(tr(Ae(Ae({},this),n),{status:c,blockLink:"",createdDate:l}));a.push(f)}return a.push(s),a}get urgency(){return this._urgency===null&&(this._urgency=vn.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,s)=>n.identicalTo(t[s]))}identicalTo(e){let t=["status","description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let a of t)if(this[a]!==e[a])return!1;if(this.tags.length!==e.tags.length||!this.tags.every(function(a,o){return a===e.tags[o]}))return!1;t=["createdDate","startDate","scheduledDate","dueDate","doneDate"];for(let a of t){let o=this[a],l=e[a];if(Hr(o,l)!==0)return!1}let n=this.recurrence,s=e.recurrence;return n===null&&s!==null||n!==null&&s===null?!1:!(n&&s&&!n.identicalTo(s))}static extractHashtags(e){var t,n;return(n=(t=e.match(ie.hashTags))==null?void 0:t.map(s=>s.trim()))!=null?n:[]}};var so=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var Ct=class{constructor(e,t,n,s,a){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=s,this._precedingHeader=a}static fromUnknownPosition(e){return new Ct(e,0,0,0,null)}fromRenamedFile(e){return new Ct(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var Os=class{constructor({metadataCache:e,vault:t,events:n}){this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new xo,this.state="Cold",this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){let e=this.metadataCache.on("resolved",()=>J(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){let{useFilenameAsScheduledDate:e}=de(),t=this.vault.on("create",a=>{a instanceof _i.TFile&&this.tasksMutex.runExclusive(()=>{this.indexFile(a)})});this.vaultEventReferences.push(t);let n=this.vault.on("delete",a=>{a instanceof _i.TFile&&this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(o=>o.path!==a.path),this.notifySubscribers()})});this.vaultEventReferences.push(n);let s=this.vault.on("rename",(a,o)=>{a instanceof _i.TFile&&this.tasksMutex.runExclusive(()=>{let l=new so(()=>Qt.fromPath(a.path));this.tasks=this.tasks.map(c=>c.path===o?e?Qt.updateTaskPath(c,a.path,l.value):new Ge(tr(Ae({},c),{taskLocation:c.taskLocation.fromRenamedFile(a.path)})):c),this.notifySubscribers()})});this.vaultEventReferences.push(s)}subscribeToEvents(){let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.tasksMutex.runExclusive(()=>J(this,null,function*(){this.state="Initializing",yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.notifySubscribers()}))}indexFile(e){return J(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;let n=this.tasks.filter(o=>o.path===e.path),s=t.listItems,a=[];if(s!==void 0){let o=yield this.vault.cachedRead(e);a=this.getTasksFromFileContent(o,s,t,e)}Ge.tasksListsIdentical(n,a)||(this.getState()=="Warm"&&console.debug(`At least one task, its line number or its heading has changed in ${e.path}: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.`),this.tasks=this.tasks.filter(o=>o.path!==e.path),this.tasks.push(...a),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,s){let a=[],o=e.split(` +`),l=o.length,c=new so(()=>Qt.fromPath(s.path)),f=null,p=0;for(let g of t)if(g.task!==void 0){let T=g.position.start.line;if(T>=l)return console.log(`${s.path} Obsidian gave us a line number ${T} past the end of the file. ${l}.`),a;if((f===null||f.position.end.line=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var Xh=require("obsidian");var cv=require("obsidian");function Ss(){}function $h(r){return r()}function Vb(){return Object.create(null)}function Os(r){r.forEach($h)}function Zb(r){return typeof r=="function"}function Xb(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Qb(r){return Object.keys(r).length===0}var Jb=!1;function BI(){Jb=!0}function HI(){Jb=!1}function L(r,e){r.appendChild(e)}function yi(r,e,t){r.insertBefore(e,t||null)}function Ms(r){r.parentNode.removeChild(r)}function Gh(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function ev(r){return function(e){return e.preventDefault(),r.call(this,e)}}function z(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function VI(r){return Array.from(r.childNodes)}function Bh(r,e){e=""+e,r.wholeText!==e&&(r.data=e)}function Fr(r,e){r.value=e==null?"":e}function Hh(r,e){for(let t=0;t{let c=a.map($h).filter(Zb);o?o.push(...c):Os(c),r.$$.on_mount=[]}),l.forEach(ao)}function nv(r,e){let t=r.$$;t.fragment!==null&&(Os(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function rF(r,e){r.$$.dirty[0]===-1&&(no.push(r),XI(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let v=S.length?S[0]:T;return h.ctx&&s(h.ctx[g],h.ctx[g]=v)&&(!h.skip_bound&&h.bound[g]&&h.bound[g](v),m&&rF(r,g)),T}):[],h.update(),m=!0,Os(h.before_update),h.fragment=n?n(h.ctx):!1,e.target){if(e.hydrate){BI();let g=VI(e.target);h.fragment&&h.fragment.l(g),g.forEach(Ms)}else h.fragment&&h.fragment.c();e.intro&&eF(r.$$.fragment),tF(r,e.target,e.anchor,e.customElement),HI(),rv()}so(c)}var nF;typeof HTMLElement=="function"&&(nF=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map($h).filter(Zb);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){Os(this.$$.on_disconnect)}$destroy(){nv(this,1),this.$destroy=Ss}$on(r,e){let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!Qb(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Lu=class{$destroy(){nv(this,1),this.$destroy=Ss}$on(e,t){let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!Qb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Kh=In(pt());function iv(r,e,t){let n=r.slice();return n[45]=e[t],n}function av(r,e,t){let n=r.slice();return n[48]=e[t].value,n[49]=e[t].label,n[50]=e[t].symbol,n}function sF(r){let e,t=r[50]+"",n;return{c(){e=ae("span"),n=Qt(t)},m(s,a){yi(s,e,a),L(e,n)},p:Ss,d(s){s&&Ms(e)}}}function ov(r){let e,t,n,s,a,o,l,c,h=r[49]+"",m,g,T=r[50]&&r[50].charCodeAt(0)>=256,S,v,R,C,$=T&&sF(r);return{c(){e=ae("span"),t=ae("input"),o=Se(),l=ae("label"),c=ae("span"),m=Qt(h),g=Se(),$&&$.c(),v=Se(),z(t,"type","radio"),z(t,"id",n="priority-"+r[48]),t.__value=s=r[48],t.value=t.__value,z(t,"accesskey",a=r[15](r[49].charAt(0).toLowerCase())),r[33][0].push(t),z(c,"class","accesskey-first"),z(l,"for",S="priority-"+r[48])},m(B,W){yi(B,e,W),L(e,t),t.checked=t.__value===r[1].priority,L(e,o),L(e,l),L(l,c),L(c,m),L(l,g),$&&$.m(l,null),L(e,v),R||(C=Ht(t,"change",r[32]),R=!0)},p(B,W){W[0]&32768&&a!==(a=B[15](B[49].charAt(0).toLowerCase()))&&z(t,"accesskey",a),W[0]&3&&(t.checked=t.__value===B[1].priority),T&&$.p(B,W)},d(B){B&&Ms(e),r[33][0].splice(r[33][0].indexOf(t),1),$&&$.d(),R=!1,C()}}}function uv(r){let e,t=r[45].name+"",n,s,a=r[45].symbol+"",o,l,c;return{c(){e=ae("option"),n=Qt(t),s=Qt(" ["),o=Qt(a),l=Qt("]"),e.__value=c=r[45],e.value=e.__value},m(h,m){yi(h,e,m),L(e,n),L(e,s),L(e,o),L(e,l)},p(h,m){m[0]&1&&t!==(t=h[45].name+"")&&Bh(n,t),m[0]&1&&a!==(a=h[45].symbol+"")&&Bh(o,a),m[0]&1&&c!==(c=h[45])&&(e.__value=c,e.value=e.__value)},d(h){h&&Ms(e)}}}function iF(r){let e,t,n,s,a,o,l,c,h,m,g,T,S,v,R,C,$,B,W,De,Te,be,ee,te,It,yt,V,q,P,Q,Y,oe,y,_,w,D,E,M,k,I,A,N,j,ke,pe,le,Ce,K,We,Xe,ct,Or,it,qe,dt,gt,On,Ii,je,Ls,es,ft,ce,Jr,Mt,ts,fo,Ur,Mn,_t,Fi,cr,en,Le,Rn,Ys,rs,xn,ns,dr,Pn,ho,tn,po,fr,hr,H,Us,mo,ht,ss,Pe,pr=r[20],Ft=[];for(let G=0;Gtion',a=Se(),o=ae("textarea"),c=Se(),h=ae("div"),m=ae("label"),g=Qt("Priority"),S=Se();for(let G=0;Gart',Ce=Se(),K=ae("input"),Xe=Se(),ct=ae("code"),Or=Qt(r[17]),it=Se(),qe=new Es(!1),dt=Se(),gt=ae("div"),On=ae("label"),On.innerHTML=`Only - future dates:`,Ii=Se(),je=ae("input"),es=Se(),ft=ae("div"),ce=ae("label"),ce.innerHTML='Status',Jr=Se(),Mt=ae("select");for(let G=0;Gr[39].call(Mt)),z(ft,"class","tasks-modal-section"),z(_t,"for","status"),z(cr,"id","status"),z(cr,"type","checkbox"),z(cr,"class","task-list-item-checkbox tasks-modal-checkbox"),cr.checked=en=r[1].status.isCompleted(),cr.disabled=!0,z(Ur,"class","tasks-modal-section tasks-modal-status"),hr.disabled=Us=!r[14],z(hr,"type","submit"),z(hr,"class","mod-cta"),z(ht,"type","button"),z(fr,"class","tasks-modal-section tasks-modal-buttons"),Lr(t,"with-accesskeys",r[9]),z(e,"class","tasks-modal")},m(G,ne){yi(G,e,ne),L(e,t),L(t,n),L(n,s),L(n,a),L(n,o),Fr(o,r[1].description),r[31](o),L(t,c),L(t,h),L(h,m),L(m,g),L(h,S);for(let ue=0;ueno ${K} date`;let ct=Kh.parseDate(We,Xe,{forwardDate:Xe!=null});return ct!==null?window.moment(ct).format("YYYY-MM-DD"):`invalid ${K} date`}function Y(K,We){return Q(K,We,v.forwardOnly?new Date:void 0)}function oe(K){let We=null,Xe=Kh.parseDate(K,new Date,{forwardDate:v.forwardOnly});return Xe!==null&&(We=window.moment(Xe)),We}zh(()=>{let{provideAccessKeys:K}=he();t(9,V=K);let We=Fe.removeAsWordFrom(a.description);(We!=a.description||!Fe.includedIn(a.description))&&(yt=!0);let Xe="none";a.priority==="4"?Xe="low":a.priority==="2"?Xe="medium":a.priority==="1"&&(Xe="high"),t(1,v={description:We,status:a.status,priority:Xe,recurrenceRule:a.recurrence?a.recurrence.toText():"",createdDate:a.createdDate?a.createdDate.format("YYYY-MM-DD"):"",startDate:a.startDate?a.startDate.format("YYYY-MM-DD"):"",scheduledDate:a.scheduledDate?a.scheduledDate.format("YYYY-MM-DD"):"",dueDate:a.dueDate?a.dueDate.format("YYYY-MM-DD"):"",doneDate:a.doneDate?a.doneDate.format("YYYY-MM-DD"):"",forwardOnly:!0}),setTimeout(()=>{S.focus()},10)});let y=K=>{if(K.key&&!K.altKey&&!K.ctrlKey){let We=P.find(Xe=>Xe.label.charAt(0).toLowerCase()==K.key);We&&t(1,v.priority=We.value,v)}},_=()=>{o([])},w=K=>{K.key==="Enter"&&(K.preventDefault(),q&&E())},D=()=>{setTimeout(()=>{t(1,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},E=()=>{let K=v.description.trim();yt&&(K=Fe.prependTo(K));let We=oe(v.startDate),Xe=oe(v.scheduledDate),ct=oe(v.dueDate),Or=null;v.recurrenceRule&&(Or=St.fromText({recurrenceRuleText:v.recurrenceRule,startDate:We,scheduledDate:Xe,dueDate:ct}));let it;switch(v.priority){case"low":it="4";break;case"medium":it="2";break;case"high":it="1";break;default:it="3"}let qe=new $e(Object.assign(Object.assign({},a),{description:K,status:v.status,priority:it,recurrence:Or,startDate:We,scheduledDate:Xe,dueDate:ct,doneDate:window.moment(v.doneDate,"YYYY-MM-DD").isValid()?window.moment(v.doneDate,"YYYY-MM-DD"):null}));o([qe])},M=[[]];function k(){v.description=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function I(K){Fu[K?"unshift":"push"](()=>{S=K,t(10,S)})}function A(){v.priority=this.__value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function N(){v.recurrenceRule=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function j(){v.dueDate=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function ke(){v.scheduledDate=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function pe(){v.startDate=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function le(){v.forwardOnly=this.checked,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function Ce(){v.status=tv(this),t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}return r.$$set=K=>{"task"in K&&t(26,a=K.task),"onSubmit"in K&&t(27,o=K.onSubmit),"statusOptions"in K&&t(0,l=K.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&512){e:t(15,n=K=>V?K:null)}if(r.$$.dirty[0]&66){e:t(1,v.dueDate=li(v.dueDate),v),t(6,Te=Y("due",v.dueDate)),t(7,be=!Te.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,v.startDate=li(v.startDate),v),t(2,$=Y("start",v.startDate)),t(3,B=!$.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,v.scheduledDate=li(v.scheduledDate),v),t(4,W=Y("scheduled",v.scheduledDate)),t(5,De=!W.includes("invalid"))}if(r.$$.dirty[0]&268435458){e:if(t(8,te=!0),!v.recurrenceRule)t(12,ee="not recurring");else{let K=t(28,s=St.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||s===void 0?void 0:s.toText();K?t(12,ee=K):(t(12,ee="invalid recurrence rule"),t(8,te=!1))}}if(r.$$.dirty[0]&2){e:t(29,R=v.description.trim()!=="")}if(r.$$.dirty[0]&536871336){e:t(14,q=be&&te&&De&&B&&R)}if(r.$$.dirty[0]&2){e:t(11,C=Q("created",v.createdDate)),t(13,It=Q("done",v.doneDate))}},[l,v,$,B,W,De,Te,be,te,V,S,C,ee,It,q,n,h,m,g,T,P,y,_,w,D,E,a,o,s,R,k,I,A,M,N,j,ke,pe,le,Ce]}var Zh=class extends Lu{constructor(e){super(),sv(this,e,aF,iF,Xb,{task:26,onSubmit:27,statusOptions:0},null,[-1,-1])}},lv=Zh;var Kn=class extends cv.Modal{constructor({app:t,task:n,onSubmit:s}){super(t);this.task=n,this.onSubmit=a=>{a.length&&s(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task");let{contentEl:t}=this,n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new lv({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Ge.getInstance().registeredStatuses;return Ge.getInstance().bySymbol(this.task.status.symbol)===fe.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};var Yu=({line:r,path:e})=>{var v,R;let t=Xt.fromPath(e),n=$e.fromLine({line:r,taskLocation:Ct.fromUnknownPosition(e),fallbackDate:t});if(n!==null)return n;let{setCreatedDate:s}=he(),a=null;s&&(a=window.moment());let o=r.match(ie.nonTaskRegex);if(o===null)return console.error("Tasks: Cannot create task on line:",r),new $e({status:fe.TODO,description:"",taskLocation:Ct.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let l=o[1],c=(v=o[2])!=null?v:"-",h=(R=o[4])!=null?R:" ",m=Ge.getInstance().bySymbolOrCreate(h),g=o[5],T=r.match(ie.blockLinkRegex),S=T!==null?T[0]:"";return S!==""&&(g=g.replace(ie.blockLinkRegex,"")),new $e({status:m,description:g,taskLocation:Ct.fromUnknownPosition(e),indentation:l,listMarker:c,blockLink:S,priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var dv=(r,e,t,n)=>{var g;if(r)return t instanceof Xh.MarkdownView;if(!(t instanceof Xh.MarkdownView))return;let s=(g=t.file)==null?void 0:g.path;if(s===void 0)return;let o=e.getCursor().line,l=e.getLine(o),c=Yu({line:l,path:s}),h=T=>{let S=Xt.removeInferredStatusIfNeeded(c,T).map(v=>v.toFileLineString()).join(` -`);e.setLine(o,S)};new Kn({app:n,task:c,onSubmit:h}).open()};var Qh=require("obsidian");var fv=(r,e,t)=>{var c;if(r)return t instanceof Qh.MarkdownView;if(!(t instanceof Qh.MarkdownView))return;let n=(c=t.file)==null?void 0:c.path;if(n===void 0)return;let s=e.getCursor(),a=s.line,o=e.getLine(a),l=oF(o,n);e.setLine(a,l.text),e.setCursor(uF(s,l))},oF=(r,e)=>{let t=$e.fromLine({line:r,taskLocation:Ct.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggle().map(s=>s.toFileLineString());return{text:n.join(` -`),moveTo:{line:n.length-1}}}else{let n=r.match(ie.taskRegex);if(n!==null){let s=n[3],o=Ge.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(ie.taskRegex,`$1- [${o}] $4`)}}else if(ie.listItemRegex.test(r)){let s=r.replace(ie.listItemRegex,"$1$2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(ie.indentationRegex,"$1- ");return{text:s,moveTo:{ch:s.length}}}}},uF=(r,e)=>{var a;let t={line:0,ch:r.ch},n=Ae(Ae({},t),(a=e.moveTo)!=null?a:{}),s=e.text.split(` -`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var Uu=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,s)=>dv(t,n,s,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:fv})}};var Wu=class{constructor({obsidianEvents:e}){this.obsidianEvents=e}onCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.obsidianEvents.offref(e)}};var qu=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return J(this,null,function*(){var h;let n=e.findAll(".task-list-item").filter(m=>{var S;let g=(S=m.textContent)==null?void 0:S.split(` +`;console.error(a),e instanceof Error&&console.error(e.stack),this.state==="Initializing"&&new _i.Notice(a,1e4)}static getSection(e,t){if(t===void 0)return null;for(let n of t)if(n.position.start.line<=e&&n.position.end.line>=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var tp=require("obsidian");var hv=require("obsidian");function Rs(){}function zh(r){return r()}function Xb(){return Object.create(null)}function xs(r){r.forEach(zh)}function Jb(r){return typeof r=="function"}function ev(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function tv(r){return Object.keys(r).length===0}var rv=!1;function VI(){rv=!0}function KI(){rv=!1}function L(r,e){r.appendChild(e)}function Ti(r,e,t){r.insertBefore(e,t||null)}function Ps(r){r.parentNode.removeChild(r)}function Vh(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function nv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function z(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function XI(r){return Array.from(r.childNodes)}function Kh(r,e){e=""+e,r.wholeText!==e&&(r.data=e)}function Fr(r,e){r.value=e==null?"":e}function Zh(r,e){for(let t=0;t{let c=a.map(zh).filter(Jb);o?o.push(...c):xs(c),r.$$.on_mount=[]}),l.forEach(uo)}function av(r,e){let t=r.$$;t.fragment!==null&&(xs(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function iF(r,e){r.$$.dirty[0]===-1&&(io.push(r),eF(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let v=O.length?O[0]:T;return f.ctx&&s(f.ctx[g],f.ctx[g]=v)&&(!f.skip_bound&&f.bound[g]&&f.bound[g](v),p&&iF(r,g)),T}):[],f.update(),p=!0,xs(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){VI();let g=XI(e.target);f.fragment&&f.fragment.l(g),g.forEach(Ps)}else f.fragment&&f.fragment.c();e.intro&&nF(r.$$.fragment),sF(r,e.target,e.anchor,e.customElement),KI(),iv()}ao(c)}var aF;typeof HTMLElement=="function"&&(aF=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(zh).filter(Jb);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){xs(this.$$.on_disconnect)}$destroy(){av(this,1),this.$destroy=Rs}$on(r,e){let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!tv(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Uu=class{$destroy(){av(this,1),this.$destroy=Rs}$on(e,t){let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!tv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Jh=Fn(pt());function uv(r,e,t){let n=r.slice();return n[45]=e[t],n}function lv(r,e,t){let n=r.slice();return n[48]=e[t].value,n[49]=e[t].label,n[50]=e[t].symbol,n}function oF(r){let e,t=r[50]+"",n;return{c(){e=ae("span"),n=Jt(t)},m(s,a){Ti(s,e,a),L(e,n)},p:Rs,d(s){s&&Ps(e)}}}function cv(r){let e,t,n,s,a,o,l,c,f=r[49]+"",p,g,T=r[50]&&r[50].charCodeAt(0)>=256,O,v,R,C,$=T&&oF(r);return{c(){e=ae("span"),t=ae("input"),o=Se(),l=ae("label"),c=ae("span"),p=Jt(f),g=Se(),$&&$.c(),v=Se(),z(t,"type","radio"),z(t,"id",n="priority-"+r[48]),t.__value=s=r[48],t.value=t.__value,z(t,"accesskey",a=r[15](r[49].charAt(0).toLowerCase())),r[33][0].push(t),z(c,"class","accesskey-first"),z(l,"for",O="priority-"+r[48])},m(B,W){Ti(B,e,W),L(e,t),t.checked=t.__value===r[1].priority,L(e,o),L(e,l),L(l,c),L(c,p),L(l,g),$&&$.m(l,null),L(e,v),R||(C=zt(t,"change",r[32]),R=!0)},p(B,W){W[0]&32768&&a!==(a=B[15](B[49].charAt(0).toLowerCase()))&&z(t,"accesskey",a),W[0]&3&&(t.checked=t.__value===B[1].priority),T&&$.p(B,W)},d(B){B&&Ps(e),r[33][0].splice(r[33][0].indexOf(t),1),$&&$.d(),R=!1,C()}}}function dv(r){let e,t=r[45].name+"",n,s,a=r[45].symbol+"",o,l,c;return{c(){e=ae("option"),n=Jt(t),s=Jt(" ["),o=Jt(a),l=Jt("]"),e.__value=c=r[45],e.value=e.__value},m(f,p){Ti(f,e,p),L(e,n),L(e,s),L(e,o),L(e,l)},p(f,p){p[0]&1&&t!==(t=f[45].name+"")&&Kh(n,t),p[0]&1&&a!==(a=f[45].symbol+"")&&Kh(o,a),p[0]&1&&c!==(c=f[45])&&(e.__value=c,e.value=e.__value)},d(f){f&&Ps(e)}}}function uF(r){let e,t,n,s,a,o,l,c,f,p,g,T,O,v,R,C,$,B,W,ke,Te,be,ee,ne,It,yt,V,q,P,Q,Y,oe,y,_,w,k,E,M,D,I,A,N,j,De,pe,le,Ce,K,qe,Xe,ct,Or,it,je,dt,gt,Mn,Li,$e,qs,ts,ft,ce,Jr,Rt,rs,po,Ur,Rn,_t,Yi,dr,en,Le,xn,js,ns,Pn,ss,fr,An,mo,tn,yo,hr,pr,H,$s,go,ht,is,Pe,mr=r[20],Ft=[];for(let G=0;Gtion',a=Se(),o=ae("textarea"),c=Se(),f=ae("div"),p=ae("label"),g=Jt("Priority"),O=Se();for(let G=0;Gart',Ce=Se(),K=ae("input"),Xe=Se(),ct=ae("code"),Or=Jt(r[17]),it=Se(),je=new Ms(!1),dt=Se(),gt=ae("div"),Mn=ae("label"),Mn.innerHTML=`Only + future dates:`,Li=Se(),$e=ae("input"),ts=Se(),ft=ae("div"),ce=ae("label"),ce.innerHTML='Status',Jr=Se(),Rt=ae("select");for(let G=0;Gr[39].call(Rt)),z(ft,"class","tasks-modal-section"),z(_t,"for","status"),z(dr,"id","status"),z(dr,"type","checkbox"),z(dr,"class","task-list-item-checkbox tasks-modal-checkbox"),dr.checked=en=r[1].status.isCompleted(),dr.disabled=!0,z(Ur,"class","tasks-modal-section tasks-modal-status"),pr.disabled=$s=!r[14],z(pr,"type","submit"),z(pr,"class","mod-cta"),z(ht,"type","button"),z(hr,"class","tasks-modal-section tasks-modal-buttons"),Lr(t,"with-accesskeys",r[9]),z(e,"class","tasks-modal")},m(G,re){Ti(G,e,re),L(e,t),L(t,n),L(n,s),L(n,a),L(n,o),Fr(o,r[1].description),r[31](o),L(t,c),L(t,f),L(f,p),L(p,g),L(f,O);for(let ue=0;ueno ${K} date`;let ct=Jh.parseDate(qe,Xe,{forwardDate:Xe!=null});return ct!==null?window.moment(ct).format("YYYY-MM-DD"):`invalid ${K} date`}function Y(K,qe){return Q(K,qe,v.forwardOnly?new Date:void 0)}function oe(K){let qe=null,Xe=Jh.parseDate(K,new Date,{forwardDate:v.forwardOnly});return Xe!==null&&(qe=window.moment(Xe)),qe}Xh(()=>{let{provideAccessKeys:K}=de();t(9,V=K);let qe=Fe.removeAsWordFrom(a.description);(qe!=a.description||!Fe.includedIn(a.description))&&(yt=!0);let Xe="none";a.priority==="4"?Xe="low":a.priority==="2"?Xe="medium":a.priority==="1"&&(Xe="high"),t(1,v={description:qe,status:a.status,priority:Xe,recurrenceRule:a.recurrence?a.recurrence.toText():"",createdDate:a.createdDate?a.createdDate.format("YYYY-MM-DD"):"",startDate:a.startDate?a.startDate.format("YYYY-MM-DD"):"",scheduledDate:a.scheduledDate?a.scheduledDate.format("YYYY-MM-DD"):"",dueDate:a.dueDate?a.dueDate.format("YYYY-MM-DD"):"",doneDate:a.doneDate?a.doneDate.format("YYYY-MM-DD"):"",forwardOnly:!0}),setTimeout(()=>{O.focus()},10)});let y=K=>{if(K.key&&!K.altKey&&!K.ctrlKey){let qe=P.find(Xe=>Xe.label.charAt(0).toLowerCase()==K.key);qe&&t(1,v.priority=qe.value,v)}},_=()=>{o([])},w=K=>{K.key==="Enter"&&(K.preventDefault(),q&&E())},k=()=>{setTimeout(()=>{t(1,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},E=()=>{let K=v.description.trim();yt&&(K=Fe.prependTo(K));let qe=oe(v.startDate),Xe=oe(v.scheduledDate),ct=oe(v.dueDate),Or=null;v.recurrenceRule&&(Or=St.fromText({recurrenceRuleText:v.recurrenceRule,startDate:qe,scheduledDate:Xe,dueDate:ct}));let it;switch(v.priority){case"low":it="4";break;case"medium":it="2";break;case"high":it="1";break;default:it="3"}let je=new Ge(Object.assign(Object.assign({},a),{description:K,status:v.status,priority:it,recurrence:Or,startDate:qe,scheduledDate:Xe,dueDate:ct,doneDate:window.moment(v.doneDate,"YYYY-MM-DD").isValid()?window.moment(v.doneDate,"YYYY-MM-DD"):null}));o([je])},M=[[]];function D(){v.description=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function I(K){Yu[K?"unshift":"push"](()=>{O=K,t(10,O)})}function A(){v.priority=this.__value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function N(){v.recurrenceRule=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function j(){v.dueDate=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function De(){v.scheduledDate=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function pe(){v.startDate=this.value,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function le(){v.forwardOnly=this.checked,t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}function Ce(){v.status=sv(this),t(1,v),t(6,Te),t(2,$),t(4,W),t(0,l)}return r.$$set=K=>{"task"in K&&t(26,a=K.task),"onSubmit"in K&&t(27,o=K.onSubmit),"statusOptions"in K&&t(0,l=K.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&512){e:t(15,n=K=>V?K:null)}if(r.$$.dirty[0]&66){e:t(1,v.dueDate=hi(v.dueDate),v),t(6,Te=Y("due",v.dueDate)),t(7,be=!Te.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,v.startDate=hi(v.startDate),v),t(2,$=Y("start",v.startDate)),t(3,B=!$.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,v.scheduledDate=hi(v.scheduledDate),v),t(4,W=Y("scheduled",v.scheduledDate)),t(5,ke=!W.includes("invalid"))}if(r.$$.dirty[0]&268435458){e:if(t(8,ne=!0),!v.recurrenceRule)t(12,ee="not recurring");else{let K=t(28,s=St.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||s===void 0?void 0:s.toText();K?t(12,ee=K):(t(12,ee="invalid recurrence rule"),t(8,ne=!1))}}if(r.$$.dirty[0]&2){e:t(29,R=v.description.trim()!=="")}if(r.$$.dirty[0]&536871336){e:t(14,q=be&&ne&&ke&&B&&R)}if(r.$$.dirty[0]&2){e:t(11,C=Q("created",v.createdDate)),t(13,It=Q("done",v.doneDate))}},[l,v,$,B,W,ke,Te,be,ne,V,O,C,ee,It,q,n,f,p,g,T,P,y,_,w,k,E,a,o,s,R,D,I,A,M,N,j,De,pe,le,Ce]}var ep=class extends Uu{constructor(e){super(),ov(this,e,lF,uF,ev,{task:26,onSubmit:27,statusOptions:0},null,[-1,-1])}},fv=ep;var Zn=class extends hv.Modal{constructor({app:t,task:n,onSubmit:s}){super(t);this.task=n,this.onSubmit=a=>{a.length&&s(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task");let{contentEl:t}=this,n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new fv({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Be.getInstance().registeredStatuses;return Be.getInstance().bySymbol(this.task.status.symbol)===he.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};var Wu=({line:r,path:e})=>{var v,R;let t=Qt.fromPath(e),n=Ge.fromLine({line:r,taskLocation:Ct.fromUnknownPosition(e),fallbackDate:t});if(n!==null)return n;let{setCreatedDate:s}=de(),a=null;s&&(a=window.moment());let o=r.match(ie.nonTaskRegex);if(o===null)return console.error("Tasks: Cannot create task on line:",r),new Ge({status:he.TODO,description:"",taskLocation:Ct.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let l=o[1],c=(v=o[2])!=null?v:"-",f=(R=o[4])!=null?R:" ",p=Be.getInstance().bySymbolOrCreate(f),g=o[5],T=r.match(ie.blockLinkRegex),O=T!==null?T[0]:"";return O!==""&&(g=g.replace(ie.blockLinkRegex,"")),new Ge({status:p,description:g,taskLocation:Ct.fromUnknownPosition(e),indentation:l,listMarker:c,blockLink:O,priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var pv=(r,e,t,n)=>{var g;if(r)return t instanceof tp.MarkdownView;if(!(t instanceof tp.MarkdownView))return;let s=(g=t.file)==null?void 0:g.path;if(s===void 0)return;let o=e.getCursor().line,l=e.getLine(o),c=Wu({line:l,path:s}),f=T=>{let O=Qt.removeInferredStatusIfNeeded(c,T).map(v=>v.toFileLineString()).join(` +`);e.setLine(o,O)};new Zn({app:n,task:c,onSubmit:f}).open()};var rp=require("obsidian");var mv=(r,e,t)=>{var c;if(r)return t instanceof rp.MarkdownView;if(!(t instanceof rp.MarkdownView))return;let n=(c=t.file)==null?void 0:c.path;if(n===void 0)return;let s=e.getCursor(),a=s.line,o=e.getLine(a),l=cF(o,n);e.setLine(a,l.text),e.setCursor(dF(s,l))},cF=(r,e)=>{let t=Ge.fromLine({line:r,taskLocation:Ct.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggle().map(s=>s.toFileLineString());return{text:n.join(` +`),moveTo:{line:n.length-1}}}else{let n=r.match(ie.taskRegex);if(n!==null){let s=n[3],o=Be.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(ie.taskRegex,`$1- [${o}] $4`)}}else if(ie.listItemRegex.test(r)){let s=r.replace(ie.listItemRegex,"$1$2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(ie.indentationRegex,"$1- ");return{text:s,moveTo:{ch:s.length}}}}},dF=(r,e)=>{var a;let t={line:0,ch:r.ch},n=Ae(Ae({},t),(a=e.moveTo)!=null?a:{}),s=e.text.split(` +`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var qu=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,s)=>pv(t,n,s,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:mv})}};var ju=class{constructor({obsidianEvents:e}){this.obsidianEvents=e}onCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.obsidianEvents.offref(e)}};var $u=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return J(this,null,function*(){var f;let n=e.findAll(".task-list-item").filter(p=>{var O;let g=(O=p.textContent)==null?void 0:O.split(` `);if(g===void 0)return!1;let T=null;for(let v=0;vhv.ViewPlugin.fromClass(Jh),Jh=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let T=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. -If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(T),new pv.Notice(T,45e3)}return!1}let{state:s}=this.view,a=this.view.posAtDOM(t),o=s.doc.lineAt(a),l=$e.fromLine({line:o.text,taskLocation:Ct.fromUnknownPosition(""),fallbackDate:null});if(console.debug(`Live Preview Extension: toggle called. Position: ${a} Line: ${o.text}`),l===null)return!1;e.preventDefault();let h=l.toggle().map(T=>T.toFileLineString()).join(s.lineBreak),m=s.update({changes:{from:o.from,to:o.to,insert:h}});this.view.dispatch(m);let g=t.checked;return setTimeout(()=>{t.checked=g},1),!0}};var fl=require("obsidian");var wn=class{constructor(e,t,n){this.property=e,this.comparator=wn.maybeReverse(n,t)}static maybeReverse(e,t){return e?wn.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var Zn=class{constructor(e,t){this.property=e,this.grouper=t}};var Ve=class{canCreateFilterForLine(e){return Ve.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Pu(this.fieldNameSingular())}supportsSorting(){return!1}parseSortLine(e){return!this.supportsSorting()||!this.canCreateSorterForLine(e)?null:this.createSorterFromLine(e)}canCreateSorterForLine(e){return this.supportsSorting()?Ve.lineMatchesFilter(this.sorterRegExp(),e):!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=Ve.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`)}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new wn(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(){return new Zn(this.fieldNameSingular(),this.grouper())}};var Ke=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Ke("None of",e,"NOT")}static booleanXor(e){return new Ke("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let s=0;syv.ViewPlugin.fromClass(np),np=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let T=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. +If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(T),new gv.Notice(T,45e3)}return!1}let{state:s}=this.view,a=this.view.posAtDOM(t),o=s.doc.lineAt(a),l=Ge.fromLine({line:o.text,taskLocation:Ct.fromUnknownPosition(""),fallbackDate:null});if(console.debug(`Live Preview Extension: toggle called. Position: ${a} Line: ${o.text}`),l===null)return!1;e.preventDefault();let f=l.toggle().map(T=>T.toFileLineString()).join(s.lineBreak),p=s.update({changes:{from:o.from,to:o.to,insert:f}});this.view.dispatch(p);let g=t.checked;return setTimeout(()=>{t.checked=g},1),!0}};var pl=require("obsidian");var kn=class{constructor(e,t,n){this.property=e,this.comparator=kn.maybeReverse(n,t)}static maybeReverse(e,t){return e?kn.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var Xn=class{constructor(e,t){this.property=e,this.grouper=t}};var Ve=class{canCreateFilterForLine(e){return Ve.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Nu(this.fieldNameSingular())}supportsSorting(){return!1}parseSortLine(e){return!this.supportsSorting()||!this.canCreateSorterForLine(e)?null:this.createSorterFromLine(e)}canCreateSorterForLine(e){return this.supportsSorting()?Ve.lineMatchesFilter(this.sorterRegExp(),e):!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=Ve.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`)}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new kn(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(){return new Xn(this.fieldNameSingular(),this.grouper())}};var Ke=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Ke("None of",e,"NOT")}static booleanXor(e){return new Ke("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let s=0;s ${t.asString(" ")} -`}},Ze=class{constructor(e){this.instruction=e}get filter(){return this._filter}set filter(e){this._filter=e}get filterFunction(){if(this._filter)return this._filter.filterFunction}static fromFilter(e){let t=new Ze(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new Ze(e);return n.error=t,n}};var ju=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new Ze(e);return e===this._instruction?(t.filter=new Jt(e,this._filter,new Ke(e)),t):(t.error=`do not understand filter: ${e}`,t)}};var Vr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new ju(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let n of this._filters){let s=n.createFilterOrErrorMessage(e);if(s.error===void 0)return s}let t=new Ze(e);return t.error=`do not understand filter: ${e}`,t}};var Xn=class extends Ve{constructor(){super(...arguments);this._filters=new Vr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Kr=class extends Xn{constructor(){super(),this._filters.add("done",e=>e.status.type==="DONE"||e.status.type==="CANCELLED"||e.status.type==="NON_TASK"),this._filters.add("not done",e=>e.status.type==="TODO"||e.status.type==="IN_PROGRESS")}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Kr.oldStatusName(e),s=Kr.oldStatusName(t);return ns?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[Kr.oldStatusName(e)]}};var Wt=class extends Ve{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Vr,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);if(n.filter!==void 0)return n;let s=new Ze(t),a=Ve.getMatch(this.filterRegExp(),t);if(a!==null){let o=a[1],l=a[2],c=wr.parseDateRange(l);if(!c.isValid())s.error="do not understand "+this.fieldName()+" date";else{let h=this.buildFilterFunction(o,c),m=Wt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),c);s.filter=new Jt(t,h,m)}}else s.error="do not understand query filter ("+this.fieldName()+" date)";return s}buildFilterFunction(t,n){let s;return t==="before"?s=a=>a?a.isBefore(n.start):this.filterResultIfFieldMissing():t==="after"?s=a=>a?a.isAfter(n.end):this.filterResultIfFieldMissing():s=a=>a?a.isSameOrAfter(n.start)&&a.isSameOrBefore(n.end):this.filterResultIfFieldMissing(),this.getFilter(s)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (before|after|on|in)? ?(.*)`)}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,s,a){let o,l="YYYY-MM-DD (dddd Do MMMM YYYY)",c;switch(n){case"before":o=n,c=a.start.format(l);break;case"after":o=n,c=a.end.format(l);break;default:if(a.start.isSame(a.end))o="on",c=a.start.format(l);else{let m=`${t} date is between:`,g=[new Ke(`${a.start.format(l)} and`),new Ke(`${a.end.format(l)} inclusive`)];return s&&g.push(new Ke(`OR no ${t} date`)),new Ke(m,g)}break}let h=`${t} date is ${o} ${c}`;return s&&(h+=` OR no ${t} date`),new Ke(h)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Hr(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:[n.format("YYYY-MM-DD dddd")]}}};var gi=class extends Wt{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var ep=class extends Ve{createFilterOrErrorMessage(e){let t=new Ze(e),n=Ve.getMatch(this.filterRegExp(),e);if(n!==null){let s=n[5],a=null;switch(s){case"low":a="4";break;case"none":a="3";break;case"medium":a="2";break;case"high":a="1";break}if(a===null)return t.error="do not understand priority",t;let o=e,l;switch(n[3]){case"above":l=c=>c.priority.localeCompare(a)<0;break;case"below":l=c=>c.priority.localeCompare(a)>0;break;case"not":l=c=>c.priority!==a;break;default:l=c=>c.priority===a,o=`${this.fieldName()} is ${s}`}t.filter=new Jt(e,l,new Ke(o))}else t.error="do not understand query filter (priority)";return t}fieldName(){return"priority"}filterRegExp(){return ep.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>{let t="ERROR";switch(e.priority){case"1":t="High";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break}return[`Priority ${e.priority}: ${t}`]}}},Rs=ep;Rs.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(low|none|medium|high))$/;var $u=class{constructor(e,t){this.nestingLevel=e,this.name=t}};var Gu=class{constructor(e){this.lastHeadingAtLevel=new Array;let n=e.keys().next().value.length;for(let s=0;st.set(l,o)),e.pop();return t}};var Hu=class extends Map{},zu=class extends Bu{},Vu=class{constructor(e,t){this.groups=new Hu;let n=this.buildGroupingTree(e,t);this.groups=n.generateAllPaths(),this.groups=this.getSortedGroups()}buildGroupingTree(e,t){let n=new zu(t),s=[n];for(let a of e){let o=[];for(let l of s)for(let c of l.values){let h=Zr.getGroupNamesForTask(a,c);for(let m of h){let g=l.children.get(m);g===void 0&&(g=new zu([]),l.children.set(m,g),o.push(g)),g.values.push(c)}}s=o}return n}getSortedGroups(){return new Hu([...this.groups.entries()].sort())}};var Ku=class{constructor(e,t,n){this.groups=e,this.groupHeadings=t,this.tasks=n}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` +`}},Ze=class{constructor(e){this.instruction=e}get filter(){return this._filter}set filter(e){this._filter=e}get filterFunction(){if(this._filter)return this._filter.filterFunction}static fromFilter(e){let t=new Ze(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new Ze(e);return n.error=t,n}};var Gu=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new Ze(e);return e===this._instruction?(t.filter=new er(e,this._filter,new Ke(e)),t):(t.error=`do not understand filter: ${e}`,t)}};var Vr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Gu(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let n of this._filters){let s=n.createFilterOrErrorMessage(e);if(s.error===void 0)return s}let t=new Ze(e);return t.error=`do not understand filter: ${e}`,t}};var Qn=class extends Ve{constructor(){super(...arguments);this._filters=new Vr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Kr=class extends Qn{constructor(){super(),this._filters.add("done",e=>e.status.type==="DONE"||e.status.type==="CANCELLED"||e.status.type==="NON_TASK"),this._filters.add("not done",e=>e.status.type==="TODO"||e.status.type==="IN_PROGRESS")}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Kr.oldStatusName(e),s=Kr.oldStatusName(t);return ns?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[Kr.oldStatusName(e)]}};var Wt=class extends Ve{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Vr,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);if(n.filter!==void 0)return n;let s=new Ze(t),a=Ve.getMatch(this.filterRegExp(),t);if(a!==null){let o=a[1],l=a[2],c=a[3],f=ir.parseDateRange(c);if(!f.isValid()){let p=ir.parseDate(o);p.isValid()&&(f=new Bt(p,p))}if(!f.isValid())s.error="do not understand "+this.fieldName()+" date";else{let p=this.buildFilterFunction(l,f),g=Wt.buildExplanation(this.fieldNameForExplanation(),l,this.filterResultIfFieldMissing(),f);s.filter=new er(t,p,g)}}else s.error="do not understand query filter ("+this.fieldName()+" date)";return s}buildFilterFunction(t,n){let s;return t==="before"?s=a=>a?a.isBefore(n.start):this.filterResultIfFieldMissing():t==="after"?s=a=>a?a.isAfter(n.end):this.filterResultIfFieldMissing():s=a=>a?a.isSameOrAfter(n.start)&&a.isSameOrBefore(n.end):this.filterResultIfFieldMissing(),this.getFilter(s)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} ((before|after|on|in)? ?(.*))`)}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,s,a){let o,l="YYYY-MM-DD (dddd Do MMMM YYYY)",c;switch(n){case"before":o=n,c=a.start.format(l);break;case"after":o=n,c=a.end.format(l);break;default:if(a.start.isSame(a.end))o="on",c=a.start.format(l);else{let p=`${t} date is between:`,g=[new Ke(`${a.start.format(l)} and`),new Ke(`${a.end.format(l)} inclusive`)];return s&&g.push(new Ke(`OR no ${t} date`)),new Ke(p,g)}break}let f=`${t} date is ${o} ${c}`;return s&&(f+=` OR no ${t} date`),new Ke(f)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Hr(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:[n.format("YYYY-MM-DD dddd")]}}};var bi=class extends Wt{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var sp=class extends Ve{createFilterOrErrorMessage(e){let t=new Ze(e),n=Ve.getMatch(this.filterRegExp(),e);if(n!==null){let s=n[5],a=null;switch(s){case"low":a="4";break;case"none":a="3";break;case"medium":a="2";break;case"high":a="1";break}if(a===null)return t.error="do not understand priority",t;let o=e,l;switch(n[3]){case"above":l=c=>c.priority.localeCompare(a)<0;break;case"below":l=c=>c.priority.localeCompare(a)>0;break;case"not":l=c=>c.priority!==a;break;default:l=c=>c.priority===a,o=`${this.fieldName()} is ${s}`}t.filter=new er(e,l,new Ke(o))}else t.error="do not understand query filter (priority)";return t}fieldName(){return"priority"}filterRegExp(){return sp.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>{let t="ERROR";switch(e.priority){case"1":t="High";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break}return[`Priority ${e.priority}: ${t}`]}}},As=sp;As.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(low|none|medium|high))$/;var Bu=class{constructor(e,t){this.nestingLevel=e,this.name=t}};var Hu=class{constructor(e){this.lastHeadingAtLevel=new Array;let n=e.keys().next().value.length;for(let s=0;st.set(l,o)),e.pop();return t}};var Vu=class extends Map{},Ku=class extends zu{},Zu=class{constructor(e,t){this.groups=new Vu;let n=this.buildGroupingTree(e,t);this.groups=n.generateAllPaths(),this.groups=this.getSortedGroups()}buildGroupingTree(e,t){let n=new Ku(t),s=[n];for(let a of e){let o=[];for(let l of s)for(let c of l.values){let f=Zr.getGroupNamesForTask(a,c);for(let p of f){let g=l.children.get(p);g===void 0&&(g=new Ku([]),l.children.set(p,g),o.push(g)),g.values.push(c)}}s=o}return n}getSortedGroups(){return new Vu([...this.groups.entries()].sort())}};var Xu=class{constructor(e,t,n){this.groups=e,this.groupHeadings=t,this.tasks=n}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` `;return e}toString(){let e=` `;e+=`Group names: [${this.groups}] `;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} ${t.name} -`;return e+=this.tasksAsStringOfLines(),e}};var Zu=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length;let n=new Vu(e,t);this.addTasks(n)}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";for(let n of this.groups)e+=n.toString(),e+=` +`;return e+=this.tasksAsStringOfLines(),e}};var Qu=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length;let n=new Zu(e,t);this.addTasks(n)}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";for(let n of this.groups)e+=n.toString(),e+=` --- `;return e+=` ${this.totalTasksCount()} tasks -`,e}addTasks(e){let t=new Gu(e.groups);for(let[n,s]of e.groups){let a=t.getHeadingsForTaskGroup(n),o=new Ku(n,a,s);this.add(o)}}add(e){this._groups.push(e)}};var _i=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var Ti=class extends _i{constructor(t){super();this.stringToFind=t}matches(t){return Ti.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}};var bi=class extends _i{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/,s=t.match(n);if(s!==null){let a=new RegExp(s[1],s[2]);return new bi(a)}else return null}matches(t){return t.match(this.regex)!==null}};var qt=class extends Ve{createFilterOrErrorMessage(e){let t=Ve.getMatch(this.filterRegExp(),e);if(t===null)return Ze.fromError(e,`do not understand query filter (${this.fieldName()})`);let[n,s,a]=t,o=null;if(s.includes("include"))o=new Ti(a);else if(s.includes("regex")&&(o=bi.validateAndConstruct(a),o===null))return Ze.fromError(e,`cannot parse regex (${this.fieldName()}); check your leading and trailing slashes for your query`);if(o===null)return Ze.fromError(e,`do not understand query filter (${this.fieldName()})`);let l=s.match(/not/)!==null,c=new Jt(e,this.getFilter(o,l),new Ke(e));return Ze.fromFilter(c)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`)}getFilter(e,t){return n=>{let s=e.matches(this.value(n));return t?!s:s}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}};var vi=class extends qt{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var Xr=class{static fromGroupingProperty(e){return new Zn(e,Xr.grouperForProperty(e))}static by(e,t){return new Zu(e,t)}static getGroupNamesForTask(e,t){return e.grouper(t)}static grouperForProperty(e){return Xr.groupers[e]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}static groupByFolder(e){let t=e.path,n=e.filename+".md",s=t.substring(0,t.lastIndexOf(n));return s===""?["/"]:[Xr.escapeMarkdownCharacters(s)]}static groupByRoot(e){let t=e.path.replace(/\\/g,"/"),n=t.indexOf("/");return n==-1?["/"]:[Xr.escapeMarkdownCharacters(t.substring(0,n+1))]}static groupByBacklink(e){if(e.getLinkText({isFilenameUnique:!0})===null)return["Unknown Location"];let n="Unknown Location";if(e.filename!==null&&(n=Xr.escapeMarkdownCharacters(e.filename)),e.precedingHeader===null||e.precedingHeader.length===0)return[n];let s=new vi().createGrouper().grouper,a=s(e)[0];return n===a?[n]:[`${n} > ${a}`]}},Zr=Xr;Zr.groupers={backlink:Xr.groupByBacklink,folder:Xr.groupByFolder,root:Xr.groupByRoot};var wi=class extends qt{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Zr.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var Di=class extends Ve{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return Ze.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}};var ki=class{static by(e,t){let n=[new Di().comparator(),new Kr().comparator(),new gi().comparator(),new Rs().comparator(),new wi().comparator()],s=[];for(let a of e)s.push(a.comparator);return t.sort(ki.makeCompositeComparator([...s,...n]))}static makeCompositeComparator(e){return(t,n)=>{for(let s of e){let a=s(t,n);if(a!==0)return a}return 0}}};var xs=class extends qt{fieldName(){return"description"}value(e){return Fe.removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=xs.cleanDescription(e.description),s=xs.cleanDescription(t.description);return n.localeCompare(s,void 0,{numeric:!0})}}static cleanDescription(e){e=Fe.removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let s=n[1];e=s.substring(s.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var Xu=class extends Wt{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Qu=class extends Wt{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Ju=class extends Xn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var el=class extends Wt{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var tl=class extends Wt{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Ei=class extends Wt{constructor(){let e=new Vr;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return Array.of(e.startDate,e.scheduledDate,e.dueDate)}earliestDate(e){return new Ei().dates(e).sort(Hr)[0]}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var rl=class extends Xn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var Si=class extends qt{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let s=e.matchesAnyOf(this.values(n));return t?!s:s}}createGrouper(){return new Zn(this.fieldNamePlural(),this.grouper())}};var Ps=class extends Si{constructor(){super();this.filterInstructions=new Vr,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let s=!!n[1],a=isNaN(+n[2])?1:+n[2],o=Ps.makeCompareByTagComparator(a);return new wn(this.fieldNameSingular(),o,s)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/}comparator(){return Ps.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,s)=>{if(n.tags.length===0&&s.tags.length===0)return 0;if(n.tags.length===0)return 1;if(s.tags.length===0)return-1;let a=t-1;if(n.tags.length=t)return 1;if(s.tags.length=t)return-1;if(n.tags.lengtht.tags.length==0?["(No tags)"]:t.tags}};var Mv=In(Ov());var al=class extends Ve{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){let n=new Ze(t);if(t.length===0)return n.error="empty line",n;let s=this.preprocessExpression(t);try{let a=(0,Mv.parse)(s);for(let c of a)if(c.name==="IDENTIFIER"&&c.value){let h=c.value.trim();if(!(h in this.subFields)){let m=ol(h);if(m===null)return n.error=`couldn't parse sub-expression '${h}'`,n;if(m.error)return n.error=`couldn't parse sub-expression '${h}': ${m.error}`,n;m.filter&&(this.subFields[h]=m.filter)}}else if(c.name==="OPERATOR"){if(c.value==null)return n.error="empty operator in boolean query",n;if(!this.supportedOperators.includes(c.value))return n.error=`unknown boolean operator '${c.value}'`,n}let o=c=>this.filterTaskWithParsedQuery(c,a),l=this.constructExplanation(a);return n.filter=new Jt(t,o,l),n}catch(a){let o=a instanceof Error?a.message:"unknown error type";return n.error=`malformed boolean query -- ${o} (check the documentation for guidelines)`,n}return n}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n){let s=l=>l==="true",a=l=>l?"true":"false",o=[];for(let l of n)if(l.name==="IDENTIFIER"){if(l.value==null)throw Error("null token value");let h=this.subFields[l.value.trim()].filterFunction(t);o.push(a(h))}else if(l.name==="OPERATOR")if(l.value==="NOT"){let c=s(o.pop());o.push(a(!c))}else if(l.value==="OR"){let c=s(o.pop()),h=s(o.pop());o.push(a(c||h))}else if(l.value==="AND"){let c=s(o.pop()),h=s(o.pop());o.push(a(c&&h))}else if(l.value==="XOR"){let c=s(o.pop()),h=s(o.pop());o.push(a(c&&!h||!c&&h))}else throw Error("Unsupported operator: "+l.value);else throw Error("Unsupported token type: "+l);return s(o[0])}constructExplanation(t){let n=[];for(let s of t)if(s.name==="IDENTIFIER"){if(s.value==null)throw Error("null token value");let a=this.subFields[s.value.trim()];n.push(a.explanation)}else if(s.name==="OPERATOR")if(s.value==="NOT"){let a=n.pop();n.push(Ke.booleanNot([a]))}else if(s.value==="OR"){let a=n.pop(),o=n.pop();n.push(Ke.booleanOr([o,a]))}else if(s.value==="AND"){let a=n.pop(),o=n.pop();n.push(Ke.booleanAnd([o,a]))}else if(s.value==="XOR"){let a=n.pop(),o=n.pop();n.push(Ke.booleanXor([o,a]))}else throw Error("Unsupported operator: "+s.value);else throw Error("Unsupported token type: "+s);return n[0]}};var ul=class extends qt{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var ll=class extends qt{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var Jn=class extends Ve{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`);return Ve.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=Ve.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let[n,s,a]=t,o=Er[a.toUpperCase()];if(!o)return this.helpMessage(e);let l;switch(s){case"is":l=c=>c.status.type===o;break;case"is not":l=c=>c.status.type!==o;break;default:return this.helpMessage(e)}return Ze.fromFilter(new Jt(e,l,new Ke(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`)}helpMessage(e){let t=Object.values(Er).filter(s=>s!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. +`,e}addTasks(e){let t=new Hu(e.groups);for(let[n,s]of e.groups){let a=t.getHeadingsForTaskGroup(n),o=new Xu(n,a,s);this.add(o)}}add(e){this._groups.push(e)}};var vi=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var wi=class extends vi{constructor(t){super();this.stringToFind=t}matches(t){return wi.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}};var ki=class extends vi{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/,s=t.match(n);if(s!==null){let a=new RegExp(s[1],s[2]);return new ki(a)}else return null}matches(t){return t.match(this.regex)!==null}};var qt=class extends Ve{createFilterOrErrorMessage(e){let t=Ve.getMatch(this.filterRegExp(),e);if(t===null)return Ze.fromError(e,`do not understand query filter (${this.fieldName()})`);let[n,s,a]=t,o=null;if(s.includes("include"))o=new wi(a);else if(s.includes("regex")&&(o=ki.validateAndConstruct(a),o===null))return Ze.fromError(e,`cannot parse regex (${this.fieldName()}); check your leading and trailing slashes for your query`);if(o===null)return Ze.fromError(e,`do not understand query filter (${this.fieldName()})`);let l=s.match(/not/)!==null,c=new er(e,this.getFilter(o,l),new Ke(e));return Ze.fromFilter(c)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`)}getFilter(e,t){return n=>{let s=e.matches(this.value(n));return t?!s:s}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}};var Di=class extends qt{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var Xr=class{static fromGroupingProperty(e){return new Xn(e,Xr.grouperForProperty(e))}static by(e,t){return new Qu(e,t)}static getGroupNamesForTask(e,t){return e.grouper(t)}static grouperForProperty(e){return Xr.groupers[e]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}static groupByFolder(e){let t=e.path,n=e.filename+".md",s=t.substring(0,t.lastIndexOf(n));return s===""?["/"]:[Xr.escapeMarkdownCharacters(s)]}static groupByRoot(e){let t=e.path.replace(/\\/g,"/"),n=t.indexOf("/");return n==-1?["/"]:[Xr.escapeMarkdownCharacters(t.substring(0,n+1))]}static groupByBacklink(e){if(e.getLinkText({isFilenameUnique:!0})===null)return["Unknown Location"];let n="Unknown Location";if(e.filename!==null&&(n=Xr.escapeMarkdownCharacters(e.filename)),e.precedingHeader===null||e.precedingHeader.length===0)return[n];let s=new Di().createGrouper().grouper,a=s(e)[0];return n===a?[n]:[`${n} > ${a}`]}},Zr=Xr;Zr.groupers={backlink:Xr.groupByBacklink,folder:Xr.groupByFolder,root:Xr.groupByRoot};var Ei=class extends qt{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Zr.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var Si=class extends Ve{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return Ze.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}};var Oi=class{static by(e,t){let n=[new Si().comparator(),new Kr().comparator(),new bi().comparator(),new As().comparator(),new Ei().comparator()],s=[];for(let a of e)s.push(a.comparator);return t.sort(Oi.makeCompositeComparator([...s,...n]))}static makeCompositeComparator(e){return(t,n)=>{for(let s of e){let a=s(t,n);if(a!==0)return a}return 0}}};var Ns=class extends qt{fieldName(){return"description"}value(e){return Fe.removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Ns.cleanDescription(e.description),s=Ns.cleanDescription(t.description);return n.localeCompare(s,void 0,{numeric:!0})}}static cleanDescription(e){e=Fe.removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let s=n[1];e=s.substring(s.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var Ju=class extends Wt{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var el=class extends Wt{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var tl=class extends Qn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var rl=class extends Wt{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var nl=class extends Wt{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Mi=class extends Wt{constructor(){let e=new Vr;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return Array.of(e.startDate,e.scheduledDate,e.dueDate)}earliestDate(e){return new Mi().dates(e).sort(Hr)[0]}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var sl=class extends Qn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var Ri=class extends qt{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let s=e.matchesAnyOf(this.values(n));return t?!s:s}}createGrouper(){return new Xn(this.fieldNamePlural(),this.grouper())}};var Cs=class extends Ri{constructor(){super();this.filterInstructions=new Vr,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let s=!!n[1],a=isNaN(+n[2])?1:+n[2],o=Cs.makeCompareByTagComparator(a);return new kn(this.fieldNameSingular(),o,s)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/}comparator(){return Cs.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,s)=>{if(n.tags.length===0&&s.tags.length===0)return 0;if(n.tags.length===0)return 1;if(s.tags.length===0)return-1;let a=t-1;if(n.tags.length=t)return 1;if(s.tags.length=t)return-1;if(n.tags.lengtht.tags.length==0?["(No tags)"]:t.tags}};var Pv=Fn(xv());var ul=class extends Ve{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){let n=new Ze(t);if(t.length===0)return n.error="empty line",n;let s=this.preprocessExpression(t);try{let a=(0,Pv.parse)(s);for(let c of a)if(c.name==="IDENTIFIER"&&c.value){let f=c.value.trim();if(!(f in this.subFields)){let p=ll(f);if(p===null)return n.error=`couldn't parse sub-expression '${f}'`,n;if(p.error)return n.error=`couldn't parse sub-expression '${f}': ${p.error}`,n;p.filter&&(this.subFields[f]=p.filter)}}else if(c.name==="OPERATOR"){if(c.value==null)return n.error="empty operator in boolean query",n;if(!this.supportedOperators.includes(c.value))return n.error=`unknown boolean operator '${c.value}'`,n}let o=c=>this.filterTaskWithParsedQuery(c,a),l=this.constructExplanation(a);return n.filter=new er(t,o,l),n}catch(a){let o=a instanceof Error?a.message:"unknown error type";return n.error=`malformed boolean query -- ${o} (check the documentation for guidelines)`,n}return n}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n){let s=l=>l==="true",a=l=>l?"true":"false",o=[];for(let l of n)if(l.name==="IDENTIFIER"){if(l.value==null)throw Error("null token value");let f=this.subFields[l.value.trim()].filterFunction(t);o.push(a(f))}else if(l.name==="OPERATOR")if(l.value==="NOT"){let c=s(o.pop());o.push(a(!c))}else if(l.value==="OR"){let c=s(o.pop()),f=s(o.pop());o.push(a(c||f))}else if(l.value==="AND"){let c=s(o.pop()),f=s(o.pop());o.push(a(c&&f))}else if(l.value==="XOR"){let c=s(o.pop()),f=s(o.pop());o.push(a(c&&!f||!c&&f))}else throw Error("Unsupported operator: "+l.value);else throw Error("Unsupported token type: "+l);return s(o[0])}constructExplanation(t){let n=[];for(let s of t)if(s.name==="IDENTIFIER"){if(s.value==null)throw Error("null token value");let a=this.subFields[s.value.trim()];n.push(a.explanation)}else if(s.name==="OPERATOR")if(s.value==="NOT"){let a=n.pop();n.push(Ke.booleanNot([a]))}else if(s.value==="OR"){let a=n.pop(),o=n.pop();n.push(Ke.booleanOr([o,a]))}else if(s.value==="AND"){let a=n.pop(),o=n.pop();n.push(Ke.booleanAnd([o,a]))}else if(s.value==="XOR"){let a=n.pop(),o=n.pop();n.push(Ke.booleanXor([o,a]))}else throw Error("Unsupported operator: "+s.value);else throw Error("Unsupported token type: "+s);return n[0]}};var cl=class extends qt{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var dl=class extends qt{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var es=class extends Ve{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`);return Ve.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=Ve.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let[n,s,a]=t,o=Er[a.toUpperCase()];if(!o)return this.helpMessage(e);let l;switch(s){case"is":l=c=>c.status.type===o;break;case"is not":l=c=>c.status.type!==o;break;default:return this.helpMessage(e)}return Ze.fromFilter(new er(e,l,new Ke(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`)}helpMessage(e){let t=Object.values(Er).filter(s=>s!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. Allowed options: 'is' and 'is not' (without quotes). Allowed values: ${t} Note: values are case-insensitive, so 'in_progress' works too, for example. - Example: ${this.fieldNameSingular()} is not NON_TASK`;return Ze.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Jn.groupName(e),s=Jn.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[Jn.groupName(e)]}static groupName(e){let t;switch(e.status.type){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return t+" "+e.status.type}};var cl=class extends qt{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var fp=[()=>new ll,()=>new Jn,()=>new Kr,()=>new rl,()=>new Rs,()=>new Ei,()=>new Xu,()=>new tl,()=>new el,()=>new gi,()=>new Qu,()=>new wi,()=>new xs,()=>new Ps,()=>new vi,()=>new Ju,()=>new al,()=>new ul,()=>new Di,()=>new cl];function ol(r){for(let e of fp){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Rv(r){let e=/^sort by /;if(r.match(e)===null)return null;for(let t of fp){let s=t().parseSortLine(r);if(s)return s}return null}function xv(r){let e=/^group by /;if(r.match(e)===null)return null;for(let t of fp){let n=t(),s=n.fieldNameSingular();if(n.supportsGrouping()&&(r===`group by ${s}`||n instanceof Si&&r===`group by ${n.fieldNamePlural()}`))return n.createGrouper()}return null}var Ai=class{constructor({source:e}){this._limit=void 0;this._layoutOptions=new Za;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.groupByRegexp=/^group by (backlink|folder|root)/;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (to )?(\d+)( tasks?)?/;this.commentRegexp=/^#.*/;this.source=e,e.split(` + Example: ${this.fieldNameSingular()} is not NON_TASK`;return Ze.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=es.groupName(e),s=es.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[es.groupName(e)]}static groupName(e){let t;switch(e.status.type){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return t+" "+e.status.type}};var fl=class extends qt{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var yp=[()=>new dl,()=>new es,()=>new Kr,()=>new sl,()=>new As,()=>new Mi,()=>new Ju,()=>new nl,()=>new rl,()=>new bi,()=>new el,()=>new Ei,()=>new Ns,()=>new Cs,()=>new Di,()=>new tl,()=>new ul,()=>new cl,()=>new Si,()=>new fl];function ll(r){for(let e of yp){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Av(r){let e=/^sort by /;if(r.match(e)===null)return null;for(let t of yp){let s=t().parseSortLine(r);if(s)return s}return null}function Nv(r){let e=/^group by /;if(r.match(e)===null)return null;for(let t of yp){let n=t(),s=n.fieldNameSingular();if(n.supportsGrouping()&&(r===`group by ${s}`||n instanceof Ri&&r===`group by ${n.fieldNamePlural()}`))return n.createGrouper()}return null}var Ii=class{constructor({source:e}){this._limit=void 0;this._layoutOptions=new Qa;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.groupByRegexp=/^group by (backlink|folder|root)/;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (to )?(\d+)( tasks?)?/;this.commentRegexp=/^#.*/;this.source=e,e.split(` `).map(t=>t.trim()).forEach(t=>{switch(!0){case t==="":break;case this.shortModeRegexp.test(t):this._layoutOptions.shortMode=!0;break;case this.explainQueryRegexp.test(t):this._layoutOptions.explainQuery=!0;break;case this.limitRegexp.test(t):this.parseLimit({line:t});break;case this.parseSortBy({line:t}):break;case this.parseGroupBy2({line:t}):break;case this.groupByRegexp.test(t):this.parseGroupBy({line:t});break;case this.hideOptionsRegexp.test(t):this.parseHideOptions({line:t});break;case this.commentRegexp.test(t):break;case this.parseFilter(t):break;default:this._error=`do not understand query: ${t}`}})}explainQuery(){return`Explanation of this Tasks code block query: `+this.explainQueryWithoutIntroduction()}explainQueryWithoutIntroduction(){let e="";Fe.isEmpty()||(e+=`Only tasks containing the global filter '${Fe.get()}'. @@ -205,13 +205,13 @@ ${this.totalTasksCount()} tasks `),e+=this.filters[s].explainFilterIndented("");this._limit!==void 0&&(e+=` At most ${this._limit} task`,this._limit!==1&&(e+="s"),e+=`. -`);let{debugSettings:n}=he();return n.ignoreSortInstructions&&(e+=` +`);let{debugSettings:n}=de();return n.ignoreSortInstructions&&(e+=` -NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.`),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}applyQueryToTasks(e){this.filters.forEach(a=>{e=e.filter(a.filterFunction)});let{debugSettings:t}=he(),s=(t.ignoreSortInstructions?e:ki.by(this.sorting,e)).slice(0,this.limit);return Zr.by(this.grouping,s)}parseHideOptions({line:e}){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1]==="hide";switch(t[2]){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;default:this._error="do not understand hide/show option"}}}parseFilter(e){let t=ol(e);return t!=null?(t.filter?this._filters.push(t.filter):this._error=t.error,!0):!1}parseLimit({line:e}){let t=e.match(this.limitRegexp);t!==null?this._limit=Number.parseInt(t[2],10):this._error="do not understand query limit"}parseSortBy({line:e}){let t=Rv(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=e.match(this.groupByRegexp);t!==null?this._grouping.push(Zr.fromGroupingProperty(t[1])):this._error="do not understand query grouping"}parseGroupBy2({line:e}){let t=xv(e);return t?(this._grouping.push(t),!0):!1}};var dl=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return J(this,null,function*(){n.addChild(new hp({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},hp=class extends fl.MarkdownRenderChild{constructor({app:t,events:n,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.events=n,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=new Ai({source:a}),this.queryType="tasks";break;default:this.query=new Ai({source:a}),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=new Ai({source:this.source}),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return J(this,arguments,function*({tasks:t,state:n}){var o;let a=this.containerEl.createEl("div");if(n==="Warm"&&this.query.error===void 0){console.debug(`Render ${this.queryType} called for a block in active file "${this.filePath}", to select from ${t.length} tasks: plugin state: ${n}`),this.query.layoutOptions.explainQuery&&this.createExplanation(a);let l=this.query.applyQueryToTasks(t);for(let h of l.groups){this.addGroupHeadings(a,h.groupHeadings);let{taskList:m}=yield this.createTasksList({tasks:h.tasks,content:a});a.appendChild(m)}let c=l.totalTasksCount();console.debug(`${c} of ${t.length} tasks displayed in a block in "${this.filePath}"`),this.addTaskCount(a,c)}else this.query.error!==void 0?a.createDiv().innerHTML=`
Tasks query: ${this.query.error.replace(/\n/g,"
")}
`:a.setText("Loading Tasks ...");(o=this.containerEl.firstChild)==null||o.replaceWith(a)})}createExplanation(t){let n=this.query.explainQuery(),s=t.createEl("pre");s.addClasses(["plugin-tasks-query-explanation"]),s.setText(n),t.appendChild(s)}createTasksList(s){return J(this,arguments,function*({tasks:t,content:n}){let a=t.length,o=new Hn(this.query.layoutOptions),l=n.createEl("ul");l.addClasses(["contains-task-list","plugin-tasks-query-result"]),l.addClasses(o.specificClasses);let c=this.getGroupingAttribute();c&&c.length>0&&(l.dataset.taskGroupBy=c);for(let h=0;hC.remove());let v=this.query.layoutOptions.shortMode,R=T.createSpan("task-extras");this.query.layoutOptions.hideUrgency||this.addUrgency(R,m),this.query.layoutOptions.hideBacklinks||this.addBacklinks(R,m,v,g),this.query.layoutOptions.hideEditButton||this.addEditButton(R,m),l.appendChild(T)}return{taskList:l,tasksCount:a}})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(a=>{a.preventDefault();let o=c=>{Nu({originalTask:n,newTasks:Xt.removeInferredStatusIfNeeded(n,c)})};new Kn({app:this.app,task:n,onSubmit:o}).open()})}addUrgency(t,n){let s=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:s,cls:"tasks-urgency"})}addGroupHeadings(t,n){for(let s of n)this.addGroupHeading(t,s)}addGroupHeading(t,n){return J(this,null,function*(){let s;n.nestingLevel===0?s=t.createEl("h4",{cls:"tasks-group-heading"}):n.nestingLevel===1?s=t.createEl("h5",{cls:"tasks-group-heading"}):s=t.createEl("h6",{cls:"tasks-group-heading"}),yield fl.MarkdownRenderer.renderMarkdown(n.name,s,this.filePath,this)})}addBacklinks(t,n,s,a){var h;let o=t.createSpan({cls:"tasks-backlink"});s||o.append(" (");let l=o.createEl("a");if(l.href=n.path,l.setAttribute("data-href",n.path),l.rel="noopener",l.target="_blank",l.addClass("internal-link"),s&&l.addClass("internal-link-short-mode"),n.precedingHeader!==null){let m=n.precedingHeader.replace(/#/g,"");l.href=l.href+"#"+m,l.setAttribute("data-href",l.getAttribute("data-href")+"#"+m)}let c;s?c=" \u{1F517}":c=(h=n.getLinkText({isFilenameUnique:a}))!=null?h:"",l.setText(c),s||o.append(")")}addTaskCount(t,n){this.query.layoutOptions.hideTaskCount||t.createDiv({text:`${n} task${n!==1?"s":""}`,cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let s=n[1];return this.app.vault.getMarkdownFiles().filter(o=>{if(o.basename===s)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var Be=require("obsidian");function Pv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function Av(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function Nv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function Cv(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function Iv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function Fv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Lv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Yv=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Yr=require("obsidian");var Is=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,s,a]=e,o=[];if(o.push(...this.validateType(a)),t===s&&a!=="NON_TASK"&&o.push(`Status symbol '${t}' toggles to itself`),o.length>0)return o;let l=fe.createFromImportedValue(e).configuration;return o.push(...this.validateSymbolTypeConventions(l)),o.push(...this.validate(l)),o}validateSymbol(e){return Is.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Is.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=Er[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,s=new Ge,a=n==="X"?"x":n,o=s.bySymbol(a);return o.type!=="EMPTY"&&(e.nextStatusSymbol!==o.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${o.nextStatusSymbol}'`),e.type!==o.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${o.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var Fs=new Is,lr=class extends Yr.Modal{constructor(t,n,s){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=s}statusConfiguration(){return new Ot(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return J(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),s;new Yr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(h=>{s=h,h.setValue(this.statusSymbol).onChange(m=>{this.statusSymbol=m,lr.setValid(h,Fs.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(h=>{lr.setValid(s,Fs.validateSymbol(this.statusConfiguration()))});let a;new Yr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(h=>{a=h,h.setValue(this.statusName).onChange(m=>{this.statusName=m,lr.setValid(h,Fs.validateName(this.statusConfiguration()))})}).then(h=>{lr.setValid(a,Fs.validateName(this.statusConfiguration()))});let o;new Yr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(h=>{o=h,h.setValue(this.statusNextSymbol).onChange(m=>{this.statusNextSymbol=m,lr.setValid(h,Fs.validateNextSymbol(this.statusConfiguration()))})}).then(h=>{lr.setValid(o,Fs.validateNextSymbol(this.statusConfiguration()))}),new Yr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(h=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(g=>{h.addOption(g,g)}),h.setValue(this.type).onChange(g=>{this.type=fe.getTypeFromStatusTypeString(g)})}),fe.tasksPluginCanCreateCommandsForStatuses()&&new Yr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(h=>{h.setValue(this.statusAvailableAsCommand).onChange(m=>J(this,null,function*(){this.statusAvailableAsCommand=m}))});let l=t.createDiv(),c=new Yr.Setting(l);c.addButton(h=>(h.setTooltip("Save").setIcon("checkmark").onClick(()=>J(this,null,function*(){let m=Fs.validate(this.statusConfiguration());if(m.length>0){let g=m.join(` +NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.`),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}applyQueryToTasks(e){this.filters.forEach(a=>{e=e.filter(a.filterFunction)});let{debugSettings:t}=de(),s=(t.ignoreSortInstructions?e:Oi.by(this.sorting,e)).slice(0,this.limit);return Zr.by(this.grouping,s)}parseHideOptions({line:e}){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1]==="hide";switch(t[2]){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;default:this._error="do not understand hide/show option"}}}parseFilter(e){let t=ll(e);return t!=null?(t.filter?this._filters.push(t.filter):this._error=t.error,!0):!1}parseLimit({line:e}){let t=e.match(this.limitRegexp);t!==null?this._limit=Number.parseInt(t[2],10):this._error="do not understand query limit"}parseSortBy({line:e}){let t=Av(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=e.match(this.groupByRegexp);t!==null?this._grouping.push(Zr.fromGroupingProperty(t[1])):this._error="do not understand query grouping"}parseGroupBy2({line:e}){let t=Nv(e);return t?(this._grouping.push(t),!0):!1}};var hl=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return J(this,null,function*(){n.addChild(new gp({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},gp=class extends pl.MarkdownRenderChild{constructor({app:t,events:n,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.events=n,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=new Ii({source:a}),this.queryType="tasks";break;default:this.query=new Ii({source:a}),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=new Ii({source:this.source}),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return J(this,arguments,function*({tasks:t,state:n}){var o;let a=this.containerEl.createEl("div");if(n==="Warm"&&this.query.error===void 0){console.debug(`Render ${this.queryType} called for a block in active file "${this.filePath}", to select from ${t.length} tasks: plugin state: ${n}`),this.query.layoutOptions.explainQuery&&this.createExplanation(a);let l=this.query.applyQueryToTasks(t);for(let f of l.groups){this.addGroupHeadings(a,f.groupHeadings);let{taskList:p}=yield this.createTasksList({tasks:f.tasks,content:a});a.appendChild(p)}let c=l.totalTasksCount();console.debug(`${c} of ${t.length} tasks displayed in a block in "${this.filePath}"`),this.addTaskCount(a,c)}else this.query.error!==void 0?a.createDiv().innerHTML=`
Tasks query: ${this.query.error.replace(/\n/g,"
")}
`:a.setText("Loading Tasks ...");(o=this.containerEl.firstChild)==null||o.replaceWith(a)})}createExplanation(t){let n=this.query.explainQuery(),s=t.createEl("pre");s.addClasses(["plugin-tasks-query-explanation"]),s.setText(n),t.appendChild(s)}createTasksList(s){return J(this,arguments,function*({tasks:t,content:n}){let a=t.length,o=new zn(this.query.layoutOptions),l=n.createEl("ul");l.addClasses(["contains-task-list","plugin-tasks-query-result"]),l.addClasses(o.specificClasses);let c=this.getGroupingAttribute();c&&c.length>0&&(l.dataset.taskGroupBy=c);for(let f=0;fC.remove());let v=this.query.layoutOptions.shortMode,R=T.createSpan("task-extras");this.query.layoutOptions.hideUrgency||this.addUrgency(R,p),this.query.layoutOptions.hideBacklinks||this.addBacklinks(R,p,v,g),this.query.layoutOptions.hideEditButton||this.addEditButton(R,p),l.appendChild(T)}return{taskList:l,tasksCount:a}})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(a=>{a.preventDefault();let o=c=>{Iu({originalTask:n,newTasks:Qt.removeInferredStatusIfNeeded(n,c)})};new Zn({app:this.app,task:n,onSubmit:o}).open()})}addUrgency(t,n){let s=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:s,cls:"tasks-urgency"})}addGroupHeadings(t,n){for(let s of n)this.addGroupHeading(t,s)}addGroupHeading(t,n){return J(this,null,function*(){let s;n.nestingLevel===0?s=t.createEl("h4",{cls:"tasks-group-heading"}):n.nestingLevel===1?s=t.createEl("h5",{cls:"tasks-group-heading"}):s=t.createEl("h6",{cls:"tasks-group-heading"}),yield pl.MarkdownRenderer.renderMarkdown(n.name,s,this.filePath,this)})}addBacklinks(t,n,s,a){var f;let o=t.createSpan({cls:"tasks-backlink"});s||o.append(" (");let l=o.createEl("a");if(l.href=n.path,l.setAttribute("data-href",n.path),l.rel="noopener",l.target="_blank",l.addClass("internal-link"),s&&l.addClass("internal-link-short-mode"),n.precedingHeader!==null){let p=n.precedingHeader.replace(/#/g,"");l.href=l.href+"#"+p,l.setAttribute("data-href",l.getAttribute("data-href")+"#"+p)}let c;s?c=" \u{1F517}":c=(f=n.getLinkText({isFilenameUnique:a}))!=null?f:"",l.setText(c),s||o.append(")")}addTaskCount(t,n){this.query.layoutOptions.hideTaskCount||t.createDiv({text:`${n} task${n!==1?"s":""}`,cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let s=n[1];return this.app.vault.getMarkdownFiles().filter(o=>{if(o.basename===s)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var We=require("obsidian");function Cv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function Iv(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function Fv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function Lv(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function Yv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function Uv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Wv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var qv=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Yr=require("obsidian");var Ys=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,s,a]=e,o=[];if(o.push(...this.validateType(a)),t===s&&a!=="NON_TASK"&&o.push(`Status symbol '${t}' toggles to itself`),o.length>0)return o;let l=he.createFromImportedValue(e).configuration;return o.push(...this.validateSymbolTypeConventions(l)),o.push(...this.validate(l)),o}validateSymbol(e){return Ys.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Ys.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=Er[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,s=new Be,a=n==="X"?"x":n,o=s.bySymbol(a);return o.type!=="EMPTY"&&(e.nextStatusSymbol!==o.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${o.nextStatusSymbol}'`),e.type!==o.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${o.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var Us=new Ys,cr=class extends Yr.Modal{constructor(t,n,s){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=s}statusConfiguration(){return new Ot(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return J(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),s;new Yr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(f=>{s=f,f.setValue(this.statusSymbol).onChange(p=>{this.statusSymbol=p,cr.setValid(f,Us.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(f=>{cr.setValid(s,Us.validateSymbol(this.statusConfiguration()))});let a;new Yr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(f=>{a=f,f.setValue(this.statusName).onChange(p=>{this.statusName=p,cr.setValid(f,Us.validateName(this.statusConfiguration()))})}).then(f=>{cr.setValid(a,Us.validateName(this.statusConfiguration()))});let o;new Yr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(f=>{o=f,f.setValue(this.statusNextSymbol).onChange(p=>{this.statusNextSymbol=p,cr.setValid(f,Us.validateNextSymbol(this.statusConfiguration()))})}).then(f=>{cr.setValid(o,Us.validateNextSymbol(this.statusConfiguration()))}),new Yr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(f=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(g=>{f.addOption(g,g)}),f.setValue(this.type).onChange(g=>{this.type=he.getTypeFromStatusTypeString(g)})}),he.tasksPluginCanCreateCommandsForStatuses()&&new Yr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(f=>{f.setValue(this.statusAvailableAsCommand).onChange(p=>J(this,null,function*(){this.statusAvailableAsCommand=p}))});let l=t.createDiv(),c=new Yr.Setting(l);c.addButton(f=>(f.setTooltip("Save").setIcon("checkmark").onClick(()=>J(this,null,function*(){let p=Us.validate(this.statusConfiguration());if(p.length>0){let g=p.join(` `)+` -Fix errors before saving.`;new Yr.Notice(g);return}this.saved=!0,this.close()})),h)),c.addExtraButton(h=>(h.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),h))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?lr.removeValidationError(t):lr.setValidationError(t)}};var Ni=class extends Be.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return J(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Global filter Settings"}),new Be.Setting(t).setName("Global task filter").setDesc(Ni.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(s=>{s.setPlaceholder("e.g. #task or TODO").setValue(Fe.get()).onChange(a=>J(this,null,function*(){Fe.set(a),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(s=>{let a=he();s.setValue(a.removeGlobalFilter).onChange(o=>J(this,null,function*(){Nt({removeGlobalFilter:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=he();Yv.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new Be.Setting(t).setName("Set created date on every added task").setDesc("Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.").addToggle(s=>{let a=he();s.setValue(a.setCreatedDate).onChange(o=>J(this,null,function*(){Nt({setCreatedDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Set done date on every completed task").setDesc("Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.").addToggle(s=>{let a=he();s.setValue(a.setDoneDate).onChange(o=>J(this,null,function*(){Nt({setDoneDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Ni.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
The date in the file name must be in one of YYYY-MM-DD or YYYYMMDD formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(s=>{let a=he();s.setValue(a.useFilenameAsScheduledDate).onChange(o=>J(this,null,function*(){Nt({useFilenameAsScheduledDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(s=>J(this,null,function*(){let a=he();yield this.plugin.saveSettings(),s.setValue(Ni.renderFolderArray(a.filenameAsDateFolders)).onChange(o=>J(this,null,function*(){let l=Ni.parseCommaSeparatedFolders(o);Nt({filenameAsDateFolders:l}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Auto-suggest Settings"}),new Be.Setting(t).setName("Auto-suggest task content").setDesc("Enabling this will open an intelligent suggest menu while typing inside a recognized task line.").addToggle(s=>{let a=he();s.setValue(a.autoSuggestInEditor).onChange(o=>J(this,null,function*(){Nt({autoSuggestInEditor:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(s=>{let a=he();s.setLimits(0,3,1).setValue(a.autoSuggestMinMatch).setDynamicTooltip().onChange(o=>J(this,null,function*(){Nt({autoSuggestMinMatch:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(s=>{let a=he();s.setLimits(3,12,1).setValue(a.autoSuggestMaxItems).setDynamicTooltip().onChange(o=>J(this,null,function*(){Nt({autoSuggestMaxItems:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new Be.Setting(t).setName("Provide access keys in dialogs").setDesc("If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.").addToggle(s=>{let a=he();s.setValue(a.provideAccessKeys).onChange(o=>J(this,null,function*(){Nt({provideAccessKeys:o}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,s){let a=t.createEl("details",{cls:"tasks-nested-settings",attr:Ae({},n.open||s[n.text]?{open:!0}:{})});a.empty(),a.ontoggle=()=>{s[n.text]=a.open,Nt({headingOpened:s}),this.plugin.saveSettings()};let o=a.createEl("summary");if(new Be.Setting(o).setHeading().setName(n.text),o.createDiv("collapser").createDiv("handle"),n.notice!==null){let l=a.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&l.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(l=>{if(!(l.featureFlag!==""&&!Fb(l.featureFlag))&&(l.type==="checkbox"?new Be.Setting(a).setName(l.name).setDesc(l.description).addToggle(c=>{let h=he();h.generalSettings[l.settingName]||Ds(l.settingName,l.initialValue),c.setValue(h.generalSettings[l.settingName]).onChange(m=>J(this,null,function*(){Ds(l.settingName,m),yield this.plugin.saveSettings()}))}):l.type==="text"?new Be.Setting(a).setName(l.name).setDesc(l.description).addText(c=>{let h=he();h.generalSettings[l.settingName]||Ds(l.settingName,l.initialValue);let m=g=>J(this,null,function*(){Ds(l.settingName,g),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(h.generalSettings[l.settingName].toString()).onChange((0,Be.debounce)(m,500,!0))}):l.type==="textarea"?new Be.Setting(a).setName(l.name).setDesc(l.description).addTextArea(c=>{let h=he();h.generalSettings[l.settingName]||Ds(l.settingName,l.initialValue);let m=g=>J(this,null,function*(){Ds(l.settingName,g),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(h.generalSettings[l.settingName].toString()).onChange((0,Be.debounce)(m,500,!0)),c.inputEl.rows=8,c.inputEl.cols=40}):l.type==="function"&&this.customFunctions[l.settingName](a,this),l.notice!==null)){let c=a.createEl("p",{cls:l.notice.class,text:l.notice.text});l.notice.html!==null&&c.insertAdjacentHTML("beforeend",l.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:s}=he();s.coreStatuses.forEach(a=>{Uv(t,a,s.coreStatuses,s,n,n.plugin,!0)})}insertCustomTaskStatusSettings(t,n){let{statusSettings:s}=he();s.customStatuses.forEach(h=>{Uv(t,h,s.customStatuses,s,n,n.plugin,!1)}),t.createEl("div"),new Be.Setting(t).addButton(h=>{h.setButtonText("Add New Task Status").setCta().onClick(()=>J(this,null,function*(){mt.addStatus(s.customStatuses,new Ot("","","",!1,"TODO")),yield Ci(s,n)}))}).infoEl.remove();let o=[["AnuPpuccin Theme",Pv()],["Aura Theme",Av()],["Ebullientworks Theme",Nv()],["ITS Theme & SlRvb Checkboxes",Cv()],["Minimal Theme",Fv()],["Things Theme",Lv()],["LYT Mode Theme (Dark mode only)",Iv()]];for(let[h,m]of o)new Be.Setting(t).addButton(T=>{let S=`${h}: Add ${m.length} supported Statuses`;T.setButtonText(S).onClick(()=>J(this,null,function*(){yield bF(m,s,n)}))}).infoEl.remove();new Be.Setting(t).addButton(h=>{h.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>J(this,null,function*(){let g=this.plugin.getTasks().map(S=>S.status),T=Ge.getInstance().findUnknownStatuses(g);T.length!==0&&(T.forEach(S=>{mt.addStatus(s.customStatuses,S)}),yield Ci(s,n))}))}).infoEl.remove(),new Be.Setting(t).addButton(h=>{h.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>J(this,null,function*(){mt.resetAllCustomStatuses(s),yield Ci(s,n)}))}).infoEl.remove()}},co=Ni;co.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Uv(r,e,t,n,s,a,o){let l=r.createEl("pre");l.addClass("row-for-status"),l.textContent=new fe(e).previewText();let c=new Be.Setting(r);c.infoEl.replaceWith(l),o||c.addExtraButton(h=>{h.setIcon("cross").setTooltip("Delete").onClick(()=>J(this,null,function*(){mt.deleteStatus(t,e)&&(yield Ci(n,s))}))}),c.addExtraButton(h=>{h.setIcon("pencil").setTooltip("Edit").onClick(()=>J(this,null,function*(){let m=new lr(a,e,o);m.onClose=()=>J(this,null,function*(){m.saved&&mt.replaceStatus(t,e,m.statusConfiguration())&&(yield Ci(n,s))}),m.open()}))}),c.infoEl.remove()}function bF(r,e,t){return J(this,null,function*(){mt.bulkAddStatusCollection(e,r).forEach(s=>{new Be.Notice(s)}),yield Ci(e,t)})}function Ci(r,e){return J(this,null,function*(){Nt({statusSettings:r}),mt.applyToStatusRegistry(r,Ge.getInstance()),yield e.saveSettings(!0)})}var Wv=require("obsidian");var hl=class extends Wv.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let a=n.getLine(t.line);return Fe.includedIn(a)&&a.match(ie.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:a.length},query:a}:null}getSuggestions(t){var o,l,c;let n=t.query,s=t.editor.getCursor();return((c=(l=(o=Qa()).buildSuggestions)==null?void 0:l.call(o,n,s.ch,this.settings))!=null?c:[]).map(h=>er(Ae({},h),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var c,h,m;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let g=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(h=(c=s==null?void 0:s.cm)==null?void 0:c.contentDOM)==null||h.dispatchEvent(g);return}let a=t.context.editor.getCursor(),o={line:a.line,ch:(m=t.insertAt)!=null?m:a.ch},l=t.insertSkip?{line:a.line,ch:o.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,o,l),t.context.editor.setCursor({line:a.line,ch:o.ch+t.appendText.length})}};var qv=(r,e)=>{let t,n=new Promise((o,l)=>{t=o});return e(r,o=>{let l=o.map(c=>c.toFileLineString()).join(` -`);t(l)}).open(),n};var jv=(r,e)=>{let t=Yu({line:"",path:""});return new Kn({app:r,task:t,onSubmit:e})};var $v=r=>({createTaskLineModal:()=>qv(r,jv)});var pl=class extends Gv.Plugin{get apiV1(){return $v(app)}onload(){return J(this,null,function*(){Au.registerConsoleLogger(),console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new co({plugin:this})),jb({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let t=new Wu({obsidianEvents:this.app.workspace});this.cache=new ks({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlineRenderer=new qu({plugin:this}),this.queryRenderer=new dl({plugin:this,events:t}),this.registerEditorExtension(mv()),this.registerEditorSuggest(new hl(this.app,he())),new Uu({plugin:this})})}loadTaskStatuses(){return J(this,null,function*(){let{statusSettings:t}=he();mt.applyToStatusRegistry(t,Ge.getInstance())})}onunload(){var t;console.log('unloading plugin "tasks"'),(t=this.cache)==null||t.unload()}loadSettings(){return J(this,null,function*(){let t=yield this.loadData();Nt(t),yield this.loadTaskStatuses()})}saveSettings(){return J(this,null,function*(){yield this.saveData(he())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; +Fix errors before saving.`;new Yr.Notice(g);return}this.saved=!0,this.close()})),f)),c.addExtraButton(f=>(f.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),f))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?cr.removeValidationError(t):cr.setValidationError(t)}};var Ws=class extends We.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return J(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new We.Setting(t).setName("Task Format").setDesc(Ws.createFragmentWithHTML('

The format that Tasks uses to read and write tasks.

Important: Tasks currently only supports one format at a time. Selecting Dataview will currently stop Tasks reading its own emoji signifiers.

See the documentation.

')).addDropdown(s=>{for(let a of Object.keys(bn))s.addOption(a,bn[a].displayName);s.setValue(de().taskFormat).onChange(a=>J(this,null,function*(){Mt({taskFormat:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new We.Setting(t).setName("Global task filter").setDesc(Ws.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(s=>{s.setPlaceholder("e.g. #task or TODO").setValue(Fe.get()).onChange(a=>J(this,null,function*(){Fe.set(a),yield this.plugin.saveSettings()}))}),new We.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(s=>{let a=de();s.setValue(a.removeGlobalFilter).onChange(o=>J(this,null,function*(){Mt({removeGlobalFilter:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=de();qv.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new We.Setting(t).setName("Set created date on every added task").setDesc("Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.").addToggle(s=>{let a=de();s.setValue(a.setCreatedDate).onChange(o=>J(this,null,function*(){Mt({setCreatedDate:o}),yield this.plugin.saveSettings()}))}),new We.Setting(t).setName("Set done date on every completed task").setDesc("Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.").addToggle(s=>{let a=de();s.setValue(a.setDoneDate).onChange(o=>J(this,null,function*(){Mt({setDoneDate:o}),yield this.plugin.saveSettings()}))}),new We.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Ws.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
The date in the file name must be in one of YYYY-MM-DD or YYYYMMDD formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(s=>{let a=de();s.setValue(a.useFilenameAsScheduledDate).onChange(o=>J(this,null,function*(){Mt({useFilenameAsScheduledDate:o}),yield this.plugin.saveSettings()}))}),new We.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(s=>J(this,null,function*(){let a=de();yield this.plugin.saveSettings(),s.setValue(Ws.renderFolderArray(a.filenameAsDateFolders)).onChange(o=>J(this,null,function*(){let l=Ws.parseCommaSeparatedFolders(o);Mt({filenameAsDateFolders:l}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Auto-suggest Settings"}),new We.Setting(t).setName("Auto-suggest task content").setDesc("Enabling this will open an intelligent suggest menu while typing inside a recognized task line.").addToggle(s=>{let a=de();s.setValue(a.autoSuggestInEditor).onChange(o=>J(this,null,function*(){Mt({autoSuggestInEditor:o}),yield this.plugin.saveSettings()}))}),new We.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(s=>{let a=de();s.setLimits(0,3,1).setValue(a.autoSuggestMinMatch).setDynamicTooltip().onChange(o=>J(this,null,function*(){Mt({autoSuggestMinMatch:o}),yield this.plugin.saveSettings()}))}),new We.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(s=>{let a=de();s.setLimits(3,12,1).setValue(a.autoSuggestMaxItems).setDynamicTooltip().onChange(o=>J(this,null,function*(){Mt({autoSuggestMaxItems:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new We.Setting(t).setName("Provide access keys in dialogs").setDesc("If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.").addToggle(s=>{let a=de();s.setValue(a.provideAccessKeys).onChange(o=>J(this,null,function*(){Mt({provideAccessKeys:o}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,s){let a=t.createEl("details",{cls:"tasks-nested-settings",attr:Ae({},n.open||s[n.text]?{open:!0}:{})});a.empty(),a.ontoggle=()=>{s[n.text]=a.open,Mt({headingOpened:s}),this.plugin.saveSettings()};let o=a.createEl("summary");if(new We.Setting(o).setHeading().setName(n.text),o.createDiv("collapser").createDiv("handle"),n.notice!==null){let l=a.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&l.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(l=>{if(!(l.featureFlag!==""&&!Ub(l.featureFlag))&&(l.type==="checkbox"?new We.Setting(a).setName(l.name).setDesc(l.description).addToggle(c=>{let f=de();f.generalSettings[l.settingName]||Ss(l.settingName,l.initialValue),c.setValue(f.generalSettings[l.settingName]).onChange(p=>J(this,null,function*(){Ss(l.settingName,p),yield this.plugin.saveSettings()}))}):l.type==="text"?new We.Setting(a).setName(l.name).setDesc(l.description).addText(c=>{let f=de();f.generalSettings[l.settingName]||Ss(l.settingName,l.initialValue);let p=g=>J(this,null,function*(){Ss(l.settingName,g),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(f.generalSettings[l.settingName].toString()).onChange((0,We.debounce)(p,500,!0))}):l.type==="textarea"?new We.Setting(a).setName(l.name).setDesc(l.description).addTextArea(c=>{let f=de();f.generalSettings[l.settingName]||Ss(l.settingName,l.initialValue);let p=g=>J(this,null,function*(){Ss(l.settingName,g),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(f.generalSettings[l.settingName].toString()).onChange((0,We.debounce)(p,500,!0)),c.inputEl.rows=8,c.inputEl.cols=40}):l.type==="function"&&this.customFunctions[l.settingName](a,this),l.notice!==null)){let c=a.createEl("p",{cls:l.notice.class,text:l.notice.text});l.notice.html!==null&&c.insertAdjacentHTML("beforeend",l.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:s}=de();s.coreStatuses.forEach(a=>{jv(t,a,s.coreStatuses,s,n,n.plugin,!0)})}insertCustomTaskStatusSettings(t,n){let{statusSettings:s}=de();s.customStatuses.forEach(f=>{jv(t,f,s.customStatuses,s,n,n.plugin,!1)}),t.createEl("div"),new We.Setting(t).addButton(f=>{f.setButtonText("Add New Task Status").setCta().onClick(()=>J(this,null,function*(){mt.addStatus(s.customStatuses,new Ot("","","",!1,"TODO")),yield Fi(s,n)}))}).infoEl.remove();let o=[["AnuPpuccin Theme",Cv()],["Aura Theme",Iv()],["Ebullientworks Theme",Fv()],["ITS Theme & SlRvb Checkboxes",Lv()],["Minimal Theme",Uv()],["Things Theme",Wv()],["LYT Mode Theme (Dark mode only)",Yv()]];for(let[f,p]of o)new We.Setting(t).addButton(T=>{let O=`${f}: Add ${p.length} supported Statuses`;T.setButtonText(O).onClick(()=>J(this,null,function*(){yield kF(p,s,n)}))}).infoEl.remove();new We.Setting(t).addButton(f=>{f.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>J(this,null,function*(){let g=this.plugin.getTasks().map(O=>O.status),T=Be.getInstance().findUnknownStatuses(g);T.length!==0&&(T.forEach(O=>{mt.addStatus(s.customStatuses,O)}),yield Fi(s,n))}))}).infoEl.remove(),new We.Setting(t).addButton(f=>{f.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>J(this,null,function*(){mt.resetAllCustomStatuses(s),yield Fi(s,n)}))}).infoEl.remove()}},ho=Ws;ho.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function jv(r,e,t,n,s,a,o){let l=r.createEl("pre");l.addClass("row-for-status"),l.textContent=new he(e).previewText();let c=new We.Setting(r);c.infoEl.replaceWith(l),o||c.addExtraButton(f=>{f.setIcon("cross").setTooltip("Delete").onClick(()=>J(this,null,function*(){mt.deleteStatus(t,e)&&(yield Fi(n,s))}))}),c.addExtraButton(f=>{f.setIcon("pencil").setTooltip("Edit").onClick(()=>J(this,null,function*(){let p=new cr(a,e,o);p.onClose=()=>J(this,null,function*(){p.saved&&mt.replaceStatus(t,e,p.statusConfiguration())&&(yield Fi(n,s))}),p.open()}))}),c.infoEl.remove()}function kF(r,e,t){return J(this,null,function*(){mt.bulkAddStatusCollection(e,r).forEach(s=>{new We.Notice(s)}),yield Fi(e,t)})}function Fi(r,e){return J(this,null,function*(){Mt({statusSettings:r}),mt.applyToStatusRegistry(r,Be.getInstance()),yield e.saveSettings(!0)})}var $v=require("obsidian");var ml=class extends $v.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let a=n.getLine(t.line);return Fe.includedIn(a)&&a.match(ie.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:a.length},query:a}:null}getSuggestions(t){var o,l,c;let n=t.query,s=t.editor.getCursor();return((c=(l=(o=eo()).buildSuggestions)==null?void 0:l.call(o,n,s.ch,this.settings))!=null?c:[]).map(f=>tr(Ae({},f),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var c,f,p;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let g=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(f=(c=s==null?void 0:s.cm)==null?void 0:c.contentDOM)==null||f.dispatchEvent(g);return}let a=t.context.editor.getCursor(),o={line:a.line,ch:(p=t.insertAt)!=null?p:a.ch},l=t.insertSkip?{line:a.line,ch:o.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,o,l),t.context.editor.setCursor({line:a.line,ch:o.ch+t.appendText.length})}};var Gv=(r,e)=>{let t,n=new Promise((o,l)=>{t=o});return e(r,o=>{let l=o.map(c=>c.toFileLineString()).join(` +`);t(l)}).open(),n};var Bv=(r,e)=>{let t=Wu({line:"",path:""});return new Zn({app:r,task:t,onSubmit:e})};var Hv=r=>({createTaskLineModal:()=>Gv(r,Bv)});var yl=class extends zv.Plugin{get apiV1(){return Hv(app)}onload(){return J(this,null,function*(){Cu.registerConsoleLogger(),console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new ho({plugin:this})),Bb({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let t=new ju({obsidianEvents:this.app.workspace});this.cache=new Os({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlineRenderer=new $u({plugin:this}),this.queryRenderer=new hl({plugin:this,events:t}),this.registerEditorExtension(_v()),this.registerEditorSuggest(new ml(this.app,de())),new qu({plugin:this})})}loadTaskStatuses(){return J(this,null,function*(){let{statusSettings:t}=de();mt.applyToStatusRegistry(t,Be.getInstance())})}onunload(){var t;console.log('unloading plugin "tasks"'),(t=this.cache)==null||t.unload()}loadSettings(){return J(this,null,function*(){let t=yield this.loadData();Mt(t),yield this.loadTaskStatuses()})}saveSettings(){return J(this,null,function*(){yield this.saveData(de())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 diff --git a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json index 26e04468..8ad7b69f 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +++ b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-tasks-plugin", "name": "Tasks", - "version": "3.2.0", + "version": "3.3.0", "minAppVersion": "0.14.6", "description": "Task management for Obsidian", "author": "Martin Schenck and Clare Macrae", diff --git a/.obsidian/plugins/quickadd/data.json b/.obsidian/plugins/quickadd/data.json index 9042c8b9..5ea2548c 100644 --- a/.obsidian/plugins/quickadd/data.json +++ b/.obsidian/plugins/quickadd/data.json @@ -48,7 +48,14 @@ "devMode": false, "templateFolderPath": "00.01 Admin/Templates", "announceUpdates": true, - "version": "0.21.0", + "version": "0.23.0", + "ai": { + "OpenAIApiKey": "", + "defaultModel": "Ask me", + "defaultSystemPrompt": "As an AI assistant within Obsidian, your primary goal is to help users manage their ideas and knowledge more effectively. Format your responses using Markdown syntax. Please use the [[Obsidian]] link format. You can write aliases for the links by writing [[Obsidian|the alias after the pipe symbol]]. To use mathematical notation, use LaTeX syntax. LaTeX syntax for larger equations should be on separate lines, surrounded with double dollar signs ($$). You can also inline math expressions by wrapping it in $ symbols. For example, use $$w_{ij}^{\text{new}}:=w_{ij}^{\text{current}}+etacdotdelta_jcdot x_{ij}$$ on a separate line, but you can write \"($eta$ = learning rate, $delta_j$ = error term, $x_{ij}$ = input)\" inline.", + "promptTemplatesFolderPath": "", + "showAssistant": true + }, "migrations": { "migrateToMacroIDFromEmbeddedMacro": true, "useQuickAddTemplateFolder": true, diff --git a/.obsidian/plugins/quickadd/main.js b/.obsidian/plugins/quickadd/main.js index 2fe6f569..8f46b462 100644 --- a/.obsidian/plugins/quickadd/main.js +++ b/.obsidian/plugins/quickadd/main.js @@ -33,10 +33,10 @@ __export(main_exports, { default: () => QuickAdd }); module.exports = __toCommonJS(main_exports); -var import_obsidian35 = require("obsidian"); +var import_obsidian38 = require("obsidian"); // src/quickAddSettingsTab.ts -var import_obsidian30 = require("obsidian"); +var import_obsidian33 = require("obsidian"); // node_modules/.pnpm/svelte@3.55.1/node_modules/svelte/internal/index.mjs function noop() { @@ -201,6 +201,13 @@ function set_data(text2, data) { function set_input_value(input, value) { input.value = value == null ? "" : value; } +function set_style(node, key, value, important) { + if (value === null) { + node.style.removeProperty(key); + } else { + node.style.setProperty(key, value, important ? "important" : ""); + } +} function select_option(select, value) { for (let i = 0; i < select.options.length; i += 1) { const option = select.options[i]; @@ -511,7 +518,7 @@ function make_dirty(component, i) { } component.$$.dirty[i / 31 | 0] |= 1 << i % 31; } -function init(component, options, instance18, create_fragment18, not_equal, props, append_styles2, dirty = [-1]) { +function init(component, options, instance19, create_fragment19, not_equal, props, append_styles2, dirty = [-1]) { const parent_component = current_component; set_current_component(component); const $$ = component.$$ = { @@ -534,7 +541,7 @@ function init(component, options, instance18, create_fragment18, not_equal, prop }; append_styles2 && append_styles2($$.root); let ready = false; - $$.ctx = instance18 ? instance18(component, options.props || {}, (i, ret, ...rest) => { + $$.ctx = instance19 ? instance19(component, options.props || {}, (i, ret, ...rest) => { const value = rest.length ? rest[0] : ret; if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { if (!$$.skip_bound && $$.bound[i]) @@ -547,7 +554,7 @@ function init(component, options, instance18, create_fragment18, not_equal, prop $$.update(); ready = true; run_all($$.before_update); - $$.fragment = create_fragment18 ? create_fragment18($$.ctx) : false; + $$.fragment = create_fragment19 ? create_fragment19($$.ctx) : false; if (options.target) { if (options.hydrate) { start_hydrating(); @@ -5034,7 +5041,7 @@ function addArrowKeyNavigation(buttons) { } // src/gui/choiceList/ChoiceView.svelte -var import_obsidian29 = require("obsidian"); +var import_obsidian32 = require("obsidian"); // src/gui/ChoiceBuilder/choiceBuilder.ts var import_obsidian7 = require("obsidian"); @@ -5578,26 +5585,26 @@ var passive = { passive: true }; function effect3(_ref) { - var state = _ref.state, instance18 = _ref.instance, options = _ref.options; + var state = _ref.state, instance19 = _ref.instance, options = _ref.options; var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; var window2 = getWindow(state.elements.popper); var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); if (scroll) { scrollParents.forEach(function(scrollParent) { - scrollParent.addEventListener("scroll", instance18.update, passive); + scrollParent.addEventListener("scroll", instance19.update, passive); }); } if (resize) { - window2.addEventListener("resize", instance18.update, passive); + window2.addEventListener("resize", instance19.update, passive); } return function() { if (scroll) { scrollParents.forEach(function(scrollParent) { - scrollParent.removeEventListener("scroll", instance18.update, passive); + scrollParent.removeEventListener("scroll", instance19.update, passive); }); } if (resize) { - window2.removeEventListener("resize", instance18.update, passive); + window2.removeEventListener("resize", instance19.update, passive); } }; } @@ -6479,7 +6486,7 @@ function popperGenerator(generatorOptions) { }; var effectCleanupFns = []; var isDestroyed = false; - var instance18 = { + var instance19 = { state, setOptions: function setOptions(setOptionsAction) { var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; @@ -6516,7 +6523,7 @@ function popperGenerator(generatorOptions) { } } runModifierEffects(); - return instance18.update(); + return instance19.update(); }, forceUpdate: function forceUpdate() { if (isDestroyed) { @@ -6558,14 +6565,14 @@ function popperGenerator(generatorOptions) { state, options: _options, name, - instance: instance18 + instance: instance19 }) || state; } } }, update: debounce(function() { return new Promise(function(resolve) { - instance18.forceUpdate(); + instance19.forceUpdate(); resolve(state); }); }), @@ -6578,9 +6585,9 @@ function popperGenerator(generatorOptions) { if (true) { console.error(INVALID_ELEMENT_ERROR); } - return instance18; + return instance19; } - instance18.setOptions(options).then(function(state2) { + instance19.setOptions(options).then(function(state2) { if (!isDestroyed && options.onFirstUpdate) { options.onFirstUpdate(state2); } @@ -6592,7 +6599,7 @@ function popperGenerator(generatorOptions) { var cleanupFn = effect4({ state, name, - instance: instance18, + instance: instance19, options: options2 }); var noopFn = function noopFn2() { @@ -6607,7 +6614,7 @@ function popperGenerator(generatorOptions) { }); effectCleanupFns = []; } - return instance18; + return instance19; }; } @@ -6740,13 +6747,13 @@ var TextInputSuggest = class { { name: "sameWidth", enabled: true, - fn: ({ state, instance: instance18 }) => { + fn: ({ state, instance: instance19 }) => { const targetWidth = `${state.rects.reference.width}px`; if (state.styles.popper.width === targetWidth) { return; } state.styles.popper.width = targetWidth; - void instance18.update(); + void instance19.update(); }, phase: "beforeWrite", requires: ["computeStyles"] @@ -6766,6 +6773,7 @@ var TextInputSuggest = class { // src/constants.ts var VALUE_SYNTAX = "{{value}}"; var DATE_SYNTAX = "{{date}}"; +var TIME_SYNTAX = "{{time}}"; var NAME_SYNTAX = "{{name}}"; var VARIABLE_SYNTAX = "{{value:}}"; var FIELD_VAR_SYNTAX = "{{field:}}"; @@ -6789,6 +6797,8 @@ var DATE_REGEX = new RegExp(/{{DATE(\+-?[0-9]+)?}}/i); var DATE_REGEX_FORMATTED = new RegExp( /{{DATE:([^}\n\r+]*)(\+-?[0-9]+)?}}/i ); +var TIME_REGEX = new RegExp(/{{TIME}}/i); +var TIME_REGEX_FORMATTED = new RegExp(/{{TIME:([^}\n\r+]*)}}/i); var NAME_VALUE_REGEX = new RegExp(/{{NAME}}|{{VALUE}}/i); var VARIABLE_REGEX = new RegExp(/{{VALUE:([^\n\r}]*)}}/i); var FIELD_VAR_REGEX = new RegExp(/{{FIELD:([^\n\r}]*)}}/i); @@ -6849,6 +6859,10 @@ var TITLE_SYNTAX_SUGGEST_REGEX = new RegExp( var SELECTED_SYNTAX_SUGGEST_REGEX = new RegExp( /{{[S]?[E]?[L]?[E]?[C]?[T]?[E]?[D]?[}]?[}]?/i ); +var TIME_SYNTAX_SUGGEST_REGEX = new RegExp(/{{[T]?[I]?[M]?[E]?[}]?[}]?/i); +var TIME_FORMAT_SYNTAX_SUGGEST_REGEX = new RegExp( + /{{[T]?[I]?[M]?[E]?[:]?$|{{TIME:[^\n\r}]*}}$/i +); var fileExistsIncrement = "Increment the file name"; var fileExistsAppendToBottom = "Append to the bottom of the file"; var fileExistsAppendToTop = "Append to the top of the file"; @@ -9045,6 +9059,31 @@ var Formatter = class { } return output; } + replaceTimeInString(input) { + let output = input; + while (TIME_REGEX.test(output)) { + const timeMatch = TIME_REGEX.exec(output); + if (!timeMatch) + throw new Error("unable to parse time"); + output = this.replacer( + output, + TIME_REGEX, + getDate({ format: "HH:mm" }) + ); + } + while (TIME_REGEX_FORMATTED.test(output)) { + const timeMatch = TIME_REGEX_FORMATTED.exec(output); + if (!timeMatch) + throw new Error("unable to parse time"); + const format3 = timeMatch[1]; + output = this.replacer( + output, + TIME_REGEX_FORMATTED, + getDate({ format: format3 }) + ); + } + return output; + } async replaceValueInString(input) { let output = input; while (NAME_VALUE_REGEX.test(output)) { @@ -9237,6 +9276,7 @@ var FileNameDisplayFormatter = class extends Formatter { let output = input; output = await this.replaceMacrosInString(output); output = this.replaceDateInString(output); + output = this.replaceTimeInString(output); output = await this.replaceValueInString(output); output = await this.replaceDateVariableInString(output); output = await this.replaceVariableInString(output); @@ -9371,6 +9411,9 @@ var FormatSyntaxSuggester = class extends TextInputSuggest { const dateMatch = DATE_SYNTAX_SUGGEST_REGEX.exec(input); if (dateMatch) callback(dateMatch, 0 /* Date */, DATE_SYNTAX); + const timeMatch = TIME_SYNTAX_SUGGEST_REGEX.exec(input); + if (timeMatch) + callback(timeMatch, 10 /* Time */, TIME_SYNTAX); const nameMatch = NAME_SYNTAX_SUGGEST_REGEX.exec(input); if (nameMatch) callback(nameMatch, 4 /* Name */, NAME_SYNTAX); @@ -9386,7 +9429,7 @@ var FormatSyntaxSuggester = class extends TextInputSuggest { ); const selectedMatch = SELECTED_SYNTAX_SUGGEST_REGEX.exec(input); if (selectedMatch) - callback(selectedMatch, 7 /* Macro */, SELECTED_SYNTAX); + callback(selectedMatch, 11 /* Selected */, SELECTED_SYNTAX); const variableMatch = VARIABLE_SYNTAX_SUGGEST_REGEX.exec(input); if (variableMatch) callback(variableMatch, 5 /* Variable */, "{{VALUE:}}"); @@ -9683,7 +9726,7 @@ var TemplateChoiceBuilder = class extends ChoiceBuilder { }; // src/gui/ChoiceBuilder/captureChoiceBuilder.ts -var import_obsidian22 = require("obsidian"); +var import_obsidian23 = require("obsidian"); // src/engine/QuickAddEngine.ts var import_obsidian10 = require("obsidian"); @@ -10296,6 +10339,244 @@ function escapeRegExp(text2) { return text2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } +// src/ai/AIAssistant.ts +var import_obsidian17 = require("obsidian"); + +// src/utils/invariant.ts +function invariant(condition, message) { + if (!condition) { + throw new Error(typeof message === "function" ? message() : message); + } + return; +} + +// src/ai/AIAssistant.ts +var noticeMsg = (task, message) => `Assistant is ${task}.${message ? ` + +${message}` : ""}`; +async function repeatUntilResolved(callback, promise, interval) { + if (typeof callback !== "function") { + throw new TypeError("Callback must be a function."); + } + if (!(promise instanceof Promise)) { + throw new TypeError("Promise must be an instance of Promise."); + } + if (typeof interval !== "number" || interval <= 0) { + throw new TypeError("Interval must be a positive number."); + } + let isDone = false; + promise.finally(() => { + isDone = true; + }); + while (!isDone) { + callback(); + await sleep(interval); + } +} +async function getTargetPromptTemplate(userDefinedPromptTemplate, promptTemplates) { + let targetFile; + if (userDefinedPromptTemplate.enable) { + targetFile = promptTemplates.find( + (item) => item.path.endsWith(userDefinedPromptTemplate.name) + ); + } else { + const basenames = promptTemplates.map((f) => f.basename); + targetFile = await GenericSuggester.Suggest( + app, + basenames, + promptTemplates + ); + } + invariant(targetFile, "Prompt template does not exist"); + const targetTemplatePath = targetFile.path; + const file = app.vault.getAbstractFileByPath(targetTemplatePath); + invariant(file instanceof import_obsidian17.TFile, `${targetTemplatePath} is not a file`); + const targetTemplateContent = await app.vault.cachedRead(file); + return [targetFile.basename, targetTemplateContent]; +} +async function runAIAssistant(settings, formatter) { + const notice = settings.showAssistantMessages ? new import_obsidian17.Notice(noticeMsg("starting", ""), 1e6) : { setMessage: () => { + }, hide: () => { + } }; + try { + const { + apiKey, + model, + outputVariableName: outputVariable, + promptTemplate, + systemPrompt, + promptTemplateFolder + } = settings; + const promptTemplates = getMarkdownFilesInFolder(promptTemplateFolder); + const [targetKey, targetPrompt] = await getTargetPromptTemplate( + promptTemplate, + promptTemplates + ); + notice.setMessage( + noticeMsg("waiting", "QuickAdd is formatting the prompt template.") + ); + const formattedPrompt = await formatter(targetPrompt); + const promptingMsg = [ + "prompting", + `Using prompt template "${targetKey}".` + ]; + notice.setMessage(noticeMsg(promptingMsg[0], promptingMsg[1])); + const makeRequest = OpenAIRequest(apiKey, model, systemPrompt); + const res = makeRequest(formattedPrompt); + const time_start = Date.now(); + await repeatUntilResolved( + () => { + notice.setMessage( + noticeMsg( + promptingMsg[0], + `${promptingMsg[1]} (${((Date.now() - time_start) / 1e3).toFixed(2)}s)` + ) + ); + }, + res, + 100 + ); + const result = await res; + const time_end = Date.now(); + notice.setMessage( + noticeMsg(`finished`, `Took ${(time_end - time_start) / 1e3}s.`) + ); + const output = result.choices[0].message.content; + const outputInMarkdownBlockQuote = ("> " + output).replace( + /\n/g, + "\n> " + ); + const variables = { + [outputVariable]: output, + [`${outputVariable}-quoted`]: outputInMarkdownBlockQuote + }; + setTimeout(() => notice.hide(), 5e3); + return variables; + } catch (error) { + notice.setMessage( + noticeMsg("dead", error.message) + ); + setTimeout(() => notice.hide(), 5e3); + } +} +function OpenAIRequest(apiKey, model, systemPrompt) { + return async function makeRequest(prompt) { + try { + const response = await (0, import_obsidian17.requestUrl)({ + url: `https://api.openai.com/v1/chat/completions`, + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${apiKey}` + }, + body: JSON.stringify({ + model, + messages: [ + { role: "system", content: systemPrompt }, + { role: "user", content: prompt } + ] + }) + }); + return response.json; + } catch (error) { + console.log(error); + throw new Error( + `Error while making request to OpenAI API: ${error.message}` + ); + } + }; +} + +// node_modules/.pnpm/zustand@4.3.6/node_modules/zustand/esm/vanilla.mjs +var import_meta = {}; +var createStoreImpl = (createState) => { + let state; + const listeners = /* @__PURE__ */ new Set(); + const setState = (partial, replace) => { + const nextState = typeof partial === "function" ? partial(state) : partial; + if (!Object.is(nextState, state)) { + const previousState = state; + state = (replace != null ? replace : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState); + listeners.forEach((listener) => listener(state, previousState)); + } + }; + const getState = () => state; + const subscribe = (listener) => { + listeners.add(listener); + return () => listeners.delete(listener); + }; + const destroy = () => { + if ((import_meta.env && import_meta.env.MODE) !== "production") { + console.warn( + "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." + ); + } + listeners.clear(); + }; + const api = { setState, getState, subscribe, destroy }; + state = createState(setState, getState, api); + return api; +}; +var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl; + +// src/types/macros/QuickAddMacro.ts +var QuickAddMacro = class { + constructor(name) { + this.name = name; + this.id = v4_default(); + this.commands = []; + this.runOnStartup = false; + } +}; + +// src/settingsStore.ts +var settingsStore = function() { + const useSettingsStore = createStore((set, get2) => ({ + ...DEFAULT_SETTINGS, + setSettings: (settings) => set((state) => ({ ...state, ...settings })) + })); + const { getState, setState, subscribe } = useSettingsStore; + return { + getState, + setState, + subscribe, + setMacro: (macroId, macro) => { + setState((state) => { + const macroIdx = state.macros.findIndex( + (m) => m.id === macroId + ); + if (macroIdx === -1) { + throw new Error("Macro not found"); + } + const newState = { + ...state, + macros: [...state.macros] + }; + newState.macros[macroIdx] = macro; + return newState; + }); + }, + createMacro: (name) => { + if (name === "" || getState().macros.some((m) => m.name === name)) { + throw new Error("Invalid macro name"); + } + const macro = new QuickAddMacro(name); + setState((state) => ({ + ...state, + macros: [...state.macros, macro] + })); + return macro; + }, + getMacro: (macroId) => { + return getState().macros.find((m) => m.id === macroId); + } + }; +}(); + +// src/ai/models.ts +var models = ["gpt-3.5-turbo", "gpt-4", "text-davinci-003"]; +var models_and_ask_me = [...models, "Ask me"]; + // src/engine/MacroChoiceEngine.ts var MacroChoiceEngine = class extends QuickAddChoiceEngine { constructor(app2, plugin, choice, macros, choiceExecutor, variables) { @@ -10343,6 +10624,9 @@ var MacroChoiceEngine = class extends QuickAddChoiceEngine { if (command?.type === "EditorCommand" /* EditorCommand */) { await this.executeEditorCommand(command); } + if (command?.type === "AIAssistant" /* AIAssistant */) { + await this.executeAIAssistant(command); + } Object.keys(this.params.variables).forEach((key) => { this.choiceExecutor.variables.set( key, @@ -10478,6 +10762,33 @@ ${error.message}` break; } } + async executeAIAssistant(command) { + const aiSettings = settingsStore.getState().ai; + const options = [...models]; + const model = command.model === "Ask me" ? await GenericSuggester.Suggest(app, options, options) : command.model; + const formatter = new CompleteFormatter( + app, + QuickAdd.instance, + this.choiceExecutor + ); + const aiOutputVariables = await runAIAssistant( + { + apiKey: aiSettings.OpenAIApiKey, + model, + outputVariableName: command.outputVariableName, + promptTemplate: command.promptTemplate, + promptTemplateFolder: aiSettings.promptTemplatesFolderPath, + systemPrompt: command.systemPrompt, + showAssistantMessages: aiSettings.showAssistant + }, + async (input) => { + return formatter.formatFileContent(input); + } + ); + for (const key in aiOutputVariables) { + this.choiceExecutor.variables.set(key, aiOutputVariables[key]); + } + } }; // src/engine/SingleMacroEngine.ts @@ -10510,7 +10821,7 @@ var SingleMacroEngine = class extends MacroChoiceEngine { }; // src/formatters/completeFormatter.ts -var import_obsidian20 = require("obsidian"); +var import_obsidian21 = require("obsidian"); // src/engine/SingleInlineScriptEngine.ts var SingleInlineScriptEngine = class extends MacroChoiceEngine { @@ -10528,7 +10839,7 @@ var SingleInlineScriptEngine = class extends MacroChoiceEngine { }; // src/gui/MathModal.ts -var import_obsidian18 = require("obsidian"); +var import_obsidian19 = require("obsidian"); // src/LaTeXSymbols.ts var LATEX_CURSOR_MOVE_HERE = "\u261A"; @@ -11302,7 +11613,7 @@ ${LATEX_CURSOR_MOVE_HERE} var LaTeXSymbols = [...commands, ...environments.map(beginEndGen)]; // src/gui/suggesters/LaTeXSuggester.ts -var import_obsidian17 = require("obsidian"); +var import_obsidian18 = require("obsidian"); var LATEX_REGEX = new RegExp(/\\([a-z{}A-Z0-9]*)$/); var LaTeXSuggester = class extends TextInputSuggest { constructor(inputEl) { @@ -11312,7 +11623,7 @@ var LaTeXSuggester = class extends TextInputSuggest { this.symbols = Object.assign([], LaTeXSymbols); this.elementsRendered = this.symbols.reduce((elements, symbol) => { try { - elements[symbol.toString()] = (0, import_obsidian17.renderMath)(symbol, true); + elements[symbol.toString()] = (0, import_obsidian18.renderMath)(symbol, true); } catch { } return elements; @@ -11381,7 +11692,7 @@ var LaTeXSuggester = class extends TextInputSuggest { }; // src/gui/MathModal.ts -var MathModal = class extends import_obsidian18.Modal { +var MathModal = class extends import_obsidian19.Modal { constructor() { super(QuickAdd.instance.app); this.didSubmit = false; @@ -11414,12 +11725,12 @@ var MathModal = class extends import_obsidian18.Modal { this.contentEl.empty(); const mathDiv = this.contentEl.createDiv(); mathDiv.className = "math math-block is-loaded"; - const tc = new import_obsidian18.TextAreaComponent(this.contentEl); + const tc = new import_obsidian19.TextAreaComponent(this.contentEl); tc.inputEl.style.width = "100%"; tc.inputEl.style.height = "10rem"; this.inputEl = tc.inputEl; tc.onChange( - (0, import_obsidian18.debounce)( + (0, import_obsidian19.debounce)( async (value) => await this.mathjaxLoop(mathDiv, value), 50 ) @@ -11429,11 +11740,11 @@ var MathModal = class extends import_obsidian18.Modal { } async onOpen() { super.onOpen(); - await (0, import_obsidian18.loadMathJax)(); + await (0, import_obsidian19.loadMathJax)(); } async mathjaxLoop(container, value) { - const html = (0, import_obsidian18.renderMath)(value, true); - await (0, import_obsidian18.finishRenderMath)(); + const html = (0, import_obsidian19.renderMath)(value, true); + await (0, import_obsidian19.finishRenderMath)(); container.empty(); container.append(html); } @@ -11450,7 +11761,7 @@ var MathModal = class extends import_obsidian18.Modal { } } createButton(container, text2, callback) { - const btn = new import_obsidian18.ButtonComponent(container); + const btn = new import_obsidian19.ButtonComponent(container); btn.setButtonText(text2).onClick(callback); return btn; } @@ -11507,8 +11818,8 @@ var InputPrompt = class { }; // src/gui/InputSuggester/inputSuggester.ts -var import_obsidian19 = require("obsidian"); -var InputSuggester = class extends import_obsidian19.FuzzySuggestModal { +var import_obsidian20 = require("obsidian"); +var InputSuggester = class extends import_obsidian20.FuzzySuggestModal { constructor(app2, displayItems, items, options = {}) { super(app2); this.displayItems = displayItems; @@ -11584,6 +11895,7 @@ var CompleteFormatter = class extends Formatter { output = await this.replaceMacrosInString(output); output = await this.replaceTemplateInString(output); output = this.replaceDateInString(output); + output = this.replaceTimeInString(output); output = await this.replaceValueInString(output); output = await this.replaceSelectedInString(output); output = await this.replaceDateVariableInString(output); @@ -11686,7 +11998,7 @@ var CompleteFormatter = class extends Formatter { ).run(); } async getSelectedText() { - const activeView = this.app.workspace.getActiveViewOfType(import_obsidian20.MarkdownView); + const activeView = this.app.workspace.getActiveViewOfType(import_obsidian21.MarkdownView); if (!activeView) return ""; return activeView.editor.getSelection(); @@ -11715,7 +12027,7 @@ var CompleteFormatter = class extends Formatter { }; // src/engine/TemplateEngine.ts -var import_obsidian21 = require("obsidian"); +var import_obsidian22 = require("obsidian"); var TemplateEngine = class extends QuickAddEngine { constructor(app2, plugin, choiceFormatter) { super(app2); @@ -11828,7 +12140,7 @@ ${formattedTemplateContent}`; if (!MARKDOWN_FILE_EXTENSION_REGEX.test(templatePath)) correctTemplatePath += ".md"; const templateFile = this.app.vault.getAbstractFileByPath(correctTemplatePath); - if (!(templateFile instanceof import_obsidian21.TFile)) + if (!(templateFile instanceof import_obsidian22.TFile)) throw new Error( `Template file not found at path "${correctTemplatePath}".` ); @@ -11866,6 +12178,7 @@ var FormatDisplayFormatter = class extends Formatter { async format(input) { let output = input; output = this.replaceDateInString(output); + output = this.replaceTimeInString(output); output = await this.replaceValueInString(output); output = await this.replaceDateVariableInString(output); output = await this.replaceVariableInString(output); @@ -11952,12 +12265,12 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } addCapturedToSetting() { let textField; - new import_obsidian22.Setting(this.contentEl).setName("Capture To").setDesc("File to capture to. Supports some format syntax."); + new import_obsidian23.Setting(this.contentEl).setName("Capture To").setDesc("File to capture to. Supports some format syntax."); const captureToContainer = this.contentEl.createDiv("captureToContainer"); const captureToActiveFileContainer = captureToContainer.createDiv("captureToActiveFileContainer"); const captureToActiveFileText = captureToActiveFileContainer.createEl("span"); captureToActiveFileText.textContent = "Capture to active file"; - const captureToActiveFileToggle = new import_obsidian22.ToggleComponent( + const captureToActiveFileToggle = new import_obsidian23.ToggleComponent( captureToActiveFileContainer ); captureToActiveFileToggle.setValue(this.choice?.captureToActiveFile); @@ -11972,7 +12285,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { void (async () => formatDisplay.textContent = await displayFormatter.format( this.choice.captureTo ))(); - const formatInput = new import_obsidian22.TextComponent(captureToFileContainer); + const formatInput = new import_obsidian23.TextComponent(captureToFileContainer); formatInput.setPlaceholder("File name format"); textField = formatInput; formatInput.inputEl.style.width = "100%"; @@ -11995,7 +12308,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } } addPrependSetting() { - const prependSetting = new import_obsidian22.Setting(this.contentEl); + const prependSetting = new import_obsidian23.Setting(this.contentEl); prependSetting.setName("Write to bottom of file").setDesc( `Put value at the bottom of the file - otherwise at the ${this.choice?.captureToActiveFile ? "active cursor location" : "top"}.` ).addToggle((toggle) => { @@ -12010,14 +12323,14 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { }); } addTaskSetting() { - const taskSetting = new import_obsidian22.Setting(this.contentEl); + const taskSetting = new import_obsidian23.Setting(this.contentEl); taskSetting.setName("Task").setDesc("Formats the value as a task.").addToggle((toggle) => { toggle.setValue(this.choice.task); toggle.onChange((value) => this.choice.task = value); }); } addAppendLinkSetting() { - const appendLinkSetting = new import_obsidian22.Setting(this.contentEl); + const appendLinkSetting = new import_obsidian23.Setting(this.contentEl); appendLinkSetting.setName("Append link").setDesc( "Add a link on your current cursor position, linking to the file you're capturing to." ).addToggle((toggle) => { @@ -12027,7 +12340,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } addInsertAfterSetting() { let insertAfterInput; - const insertAfterSetting = new import_obsidian22.Setting(this.contentEl); + const insertAfterSetting = new import_obsidian23.Setting(this.contentEl); insertAfterSetting.setName("Insert after").setDesc( "Insert capture after specified line. Accepts format syntax." ).addToggle((toggle) => { @@ -12046,7 +12359,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { void (async () => insertAfterFormatDisplay.innerText = await displayFormatter.format( this.choice.insertAfter.after ))(); - insertAfterInput = new import_obsidian22.TextComponent(this.contentEl); + insertAfterInput = new import_obsidian23.TextComponent(this.contentEl); insertAfterInput.setPlaceholder("Insert after"); insertAfterInput.inputEl.style.width = "100%"; insertAfterInput.inputEl.style.marginBottom = "8px"; @@ -12060,7 +12373,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { this.plugin ); if (this.choice.insertAfter.enabled) { - const insertAtEndSetting = new import_obsidian22.Setting(this.contentEl); + const insertAtEndSetting = new import_obsidian23.Setting(this.contentEl); insertAtEndSetting.setName("Insert at end of section").setDesc( "Insert the text at the end of the section, rather than at the top." ).addToggle( @@ -12068,7 +12381,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { (value) => this.choice.insertAfter.insertAtEnd = value ) ); - const considerSubsectionsSetting = new import_obsidian22.Setting( + const considerSubsectionsSetting = new import_obsidian23.Setting( this.contentEl ); considerSubsectionsSetting.setName("Consider subsections").setDesc( @@ -12091,7 +12404,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } }) ); - const createLineIfNotFound = new import_obsidian22.Setting(this.contentEl); + const createLineIfNotFound = new import_obsidian23.Setting(this.contentEl); createLineIfNotFound.setName("Create line if not found").setDesc("Creates the 'insert after' line if it is not found.").addToggle((toggle) => { if (!this.choice.insertAfter?.createIfNotFound) this.choice.insertAfter.createIfNotFound = false; @@ -12111,14 +12424,14 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } addFormatSetting() { let textField; - const enableSetting = new import_obsidian22.Setting(this.contentEl); + const enableSetting = new import_obsidian23.Setting(this.contentEl); enableSetting.setName("Capture format").setDesc("Set the format of the capture.").addToggle((toggleComponent) => { toggleComponent.setValue(this.choice.format.enabled).onChange((value) => { this.choice.format.enabled = value; textField.setDisabled(!value); }); }); - const formatInput = new import_obsidian22.TextAreaComponent(this.contentEl); + const formatInput = new import_obsidian23.TextAreaComponent(this.contentEl); formatInput.setPlaceholder("Format"); textField = formatInput; formatInput.inputEl.style.width = "100%"; @@ -12143,7 +12456,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { createWithTemplate: false, template: "" }; - const createFileIfItDoesntExist = new import_obsidian22.Setting(this.contentEl); + const createFileIfItDoesntExist = new import_obsidian23.Setting(this.contentEl); createFileIfItDoesntExist.setName("Create file if it doesn't exist").addToggle( (toggle) => toggle.setValue(this.choice?.createFileIfItDoesntExist?.enabled).setTooltip("Create file if it doesn't exist").onChange((value) => { this.choice.createFileIfItDoesntExist.enabled = value; @@ -12153,7 +12466,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } addCreateWithTemplateSetting() { let templateSelector; - const createWithTemplateSetting = new import_obsidian22.Setting(this.contentEl); + const createWithTemplateSetting = new import_obsidian23.Setting(this.contentEl); createWithTemplateSetting.setName("Create file with given template.").addToggle( (toggle) => toggle.setValue( this.choice.createFileIfItDoesntExist?.createWithTemplate @@ -12162,7 +12475,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { templateSelector.setDisabled(!value); }) ); - templateSelector = new import_obsidian22.TextComponent(this.contentEl); + templateSelector = new import_obsidian23.TextComponent(this.contentEl); templateSelector.setValue(this.choice?.createFileIfItDoesntExist?.template ?? "").setPlaceholder("Template path").setDisabled( !this.choice?.createFileIfItDoesntExist?.createWithTemplate ); @@ -12179,7 +12492,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { }); } addOpenFileSetting() { - const noOpenSetting = new import_obsidian22.Setting(this.contentEl); + const noOpenSetting = new import_obsidian23.Setting(this.contentEl); noOpenSetting.setName("Open").setDesc("Open the file that is captured to.").addToggle((toggle) => { toggle.setValue(this.choice.openFile); toggle.onChange((value) => { @@ -12196,7 +12509,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { }); } addOpenFileInNewTabSetting() { - const newTabSetting = new import_obsidian22.Setting(this.contentEl); + const newTabSetting = new import_obsidian23.Setting(this.contentEl); newTabSetting.setName("New Tab").setDesc("Open the file that is captured to in a new tab.").addToggle((toggle) => { toggle.setValue(this.choice?.openFileInNewTab?.enabled); toggle.onChange( @@ -12218,7 +12531,7 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { (value) => this.choice.openFileInNewTab.direction = value ); }); - new import_obsidian22.Setting(this.contentEl).setName("Focus new pane").setDesc("Focus the opened tab immediately").addToggle( + new import_obsidian23.Setting(this.contentEl).setName("Focus new pane").setDesc("Focus the opened tab immediately").addToggle( (toggle) => toggle.setValue(this.choice.openFileInNewTab.focus).onChange( (value) => this.choice.openFileInNewTab.focus = value ) @@ -12227,11 +12540,11 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { }; // src/gui/ChoiceBuilder/macroChoiceBuilder.ts -var import_obsidian26 = require("obsidian"); -var import_obsidian27 = require("obsidian"); +var import_obsidian28 = require("obsidian"); +var import_obsidian29 = require("obsidian"); // src/gui/MacroGUIs/MacroBuilder.ts -var import_obsidian25 = require("obsidian"); +var import_obsidian27 = require("obsidian"); // src/types/macros/UserScript.ts var UserScript = class extends Command { @@ -12723,7 +13036,7 @@ var NestedChoiceCommand = class extends SvelteComponent { var NestedChoiceCommand_default = NestedChoiceCommand; // src/gui/MacroGUIs/CommandList.svelte -var import_obsidian24 = require("obsidian"); +var import_obsidian26 = require("obsidian"); // src/gui/MacroGUIs/Components/UserScriptCommand.svelte function create_fragment15(ctx) { @@ -12888,8 +13201,21 @@ var UserScriptCommand = class extends SvelteComponent { var UserScriptCommand_default = UserScriptCommand; // src/gui/MacroGUIs/UserScriptSettingsModal.ts -var import_obsidian23 = require("obsidian"); -var UserScriptSettingsModal = class extends import_obsidian23.Modal { +var import_obsidian24 = require("obsidian"); + +// src/utils/setPasswordOnBlur.ts +function setPasswordOnBlur(el) { + el.addEventListener("focus", () => { + el.type = "text"; + }); + el.addEventListener("blur", () => { + el.type = "password"; + }); + el.type = "password"; +} + +// src/gui/MacroGUIs/UserScriptSettingsModal.ts +var UserScriptSettingsModal = class extends import_obsidian24.Modal { constructor(app2, command, settings) { super(app2); this.command = command; @@ -12940,39 +13266,30 @@ var UserScriptSettingsModal = class extends import_obsidian23.Modal { } } } - setPasswordOnBlur(el) { - el.addEventListener("focus", () => { - el.type = "text"; - }); - el.addEventListener("blur", () => { - el.type = "password"; - }); - el.type = "password"; - } addInputBox(name, value, placeholder, passwordOnBlur) { - new import_obsidian23.Setting(this.contentEl).setName(name).addText((input) => { + new import_obsidian24.Setting(this.contentEl).setName(name).addText((input) => { input.setValue(value).onChange((value2) => this.command.settings[name] = value2).setPlaceholder(placeholder ?? ""); if (passwordOnBlur) { - this.setPasswordOnBlur(input.inputEl); + setPasswordOnBlur(input.inputEl); } }); } addToggle(name, value) { - new import_obsidian23.Setting(this.contentEl).setName(name).addToggle( + new import_obsidian24.Setting(this.contentEl).setName(name).addToggle( (toggle) => toggle.setValue(value).onChange((value2) => this.command.settings[name] = value2) ); } addDropdown(name, options, value) { - new import_obsidian23.Setting(this.contentEl).setName(name).addDropdown((dropdown) => { + new import_obsidian24.Setting(this.contentEl).setName(name).addDropdown((dropdown) => { options.forEach((item) => void dropdown.addOption(item, item)); dropdown.setValue(value); dropdown.onChange((value2) => this.command.settings[name] = value2); }); } addFormatInput(name, value, placeholder) { - new import_obsidian23.Setting(this.contentEl).setName(name); + new import_obsidian24.Setting(this.contentEl).setName(name); const formatDisplay = this.contentEl.createEl("span"); - const input = new import_obsidian23.TextAreaComponent(this.contentEl); + const input = new import_obsidian24.TextAreaComponent(this.contentEl); new FormatSyntaxSuggester(this.app, input.inputEl, QuickAdd.instance); const displayFormatter = new FormatDisplayFormatter( this.app, @@ -12989,54 +13306,334 @@ var UserScriptSettingsModal = class extends import_obsidian23.Modal { } }; -// src/gui/MacroGUIs/CommandList.svelte -function add_css8(target) { - append_styles(target, "svelte-1ukgrgp", ".quickAddCommandList.svelte-1ukgrgp{display:grid;grid-template-columns:auto;width:auto;border:0 solid black;overflow-y:auto;height:auto;margin-bottom:8px;padding:20px}"); -} -function get_each_context4(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[33] = list[i]; - child_ctx[34] = list; - child_ctx[35] = i; - return child_ctx; -} -function create_else_block2(ctx) { - let standardcommand; - let updating_command; - let updating_dragDisabled; - let updating_startDrag; +// src/gui/MacroGUIs/Components/AIAssistantCommand.svelte +function create_fragment16(ctx) { + let div1; + let li; + let t0_value = ctx[0].name + ""; + let t0; + let t1; + let div0; + let span0; + let icon0; + let t2; + let span1; + let icon1; + let t3; + let span2; + let icon2; + let span2_style_value; + let span2_tabindex_value; let current; - function standardcommand_command_binding(value) { - ctx[27](value, ctx[33], ctx[34], ctx[35]); - } - function standardcommand_dragDisabled_binding(value) { - ctx[28](value); - } - function standardcommand_startDrag_binding(value) { - ctx[29](value); - } - let standardcommand_props = {}; - if (ctx[33] !== void 0) { - standardcommand_props.command = ctx[33]; - } - if (ctx[3] !== void 0) { - standardcommand_props.dragDisabled = ctx[3]; - } - if (ctx[4] !== void 0) { - standardcommand_props.startDrag = ctx[4]; - } - standardcommand = new StandardCommand_default({ props: standardcommand_props }); - binding_callbacks.push(() => bind(standardcommand, "command", standardcommand_command_binding)); - binding_callbacks.push(() => bind(standardcommand, "dragDisabled", standardcommand_dragDisabled_binding)); - binding_callbacks.push(() => bind(standardcommand, "startDrag", standardcommand_startDrag_binding)); - standardcommand.$on("deleteCommand", ctx[30]); - standardcommand.$on("updateCommand", ctx[7]); + let mounted; + let dispose; + icon0 = new Icon_default({ props: { data: faCog } }); + icon1 = new Icon_default({ props: { data: faTrash } }); + icon2 = new Icon_default({ props: { data: faBars } }); return { c() { - create_component(standardcommand.$$.fragment); - }, - m(target, anchor) { - mount_component(standardcommand, target, anchor); + div1 = element("div"); + li = element("li"); + t0 = text(t0_value); + t1 = space(); + div0 = element("div"); + span0 = element("span"); + create_component(icon0.$$.fragment); + t2 = space(); + span1 = element("span"); + create_component(icon1.$$.fragment); + t3 = space(); + span2 = element("span"); + create_component(icon2.$$.fragment); + attr(span0, "class", "clickable"); + attr(span1, "class", "clickable"); + attr(span2, "aria-label", "Drag-handle"); + attr(span2, "style", span2_style_value = (ctx[2] ? "cursor: grab" : "cursor: grabbing") + ";"); + attr(span2, "tabindex", span2_tabindex_value = ctx[2] ? 0 : -1); + attr(div1, "class", "quickAddCommandListItem"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, li); + append(li, t0); + append(div1, t1); + append(div1, div0); + append(div0, span0); + mount_component(icon0, span0, null); + append(div0, t2); + append(div0, span1); + mount_component(icon1, span1, null); + append(div0, t3); + append(div0, span2); + mount_component(icon2, span2, null); + current = true; + if (!mounted) { + dispose = [ + listen(span0, "click", ctx[5]), + listen(span1, "click", ctx[6]), + listen(span2, "mousedown", function() { + if (is_function(ctx[1])) + ctx[1].apply(this, arguments); + }), + listen(span2, "touchstart", function() { + if (is_function(ctx[1])) + ctx[1].apply(this, arguments); + }) + ]; + mounted = true; + } + }, + p(new_ctx, [dirty]) { + ctx = new_ctx; + if ((!current || dirty & 1) && t0_value !== (t0_value = ctx[0].name + "")) + set_data(t0, t0_value); + if (!current || dirty & 4 && span2_style_value !== (span2_style_value = (ctx[2] ? "cursor: grab" : "cursor: grabbing") + ";")) { + attr(span2, "style", span2_style_value); + } + if (!current || dirty & 4 && span2_tabindex_value !== (span2_tabindex_value = ctx[2] ? 0 : -1)) { + attr(span2, "tabindex", span2_tabindex_value); + } + }, + i(local) { + if (current) + return; + transition_in(icon0.$$.fragment, local); + transition_in(icon1.$$.fragment, local); + transition_in(icon2.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(icon0.$$.fragment, local); + transition_out(icon1.$$.fragment, local); + transition_out(icon2.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) + detach(div1); + destroy_component(icon0); + destroy_component(icon1); + destroy_component(icon2); + mounted = false; + run_all(dispose); + } + }; +} +function instance16($$self, $$props, $$invalidate) { + let { command } = $$props; + let { startDrag } = $$props; + let { dragDisabled } = $$props; + const dispatch = createEventDispatcher(); + function deleteCommand() { + dispatch("deleteCommand", command.id); + } + function configureAssistant() { + dispatch("configureAssistant", command); + } + const click_handler = () => configureAssistant(); + const click_handler_1 = () => deleteCommand(); + $$self.$$set = ($$props2) => { + if ("command" in $$props2) + $$invalidate(0, command = $$props2.command); + if ("startDrag" in $$props2) + $$invalidate(1, startDrag = $$props2.startDrag); + if ("dragDisabled" in $$props2) + $$invalidate(2, dragDisabled = $$props2.dragDisabled); + }; + return [ + command, + startDrag, + dragDisabled, + deleteCommand, + configureAssistant, + click_handler, + click_handler_1 + ]; +} +var AIAssistantCommand = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance16, create_fragment16, safe_not_equal, { + command: 0, + startDrag: 1, + dragDisabled: 2 + }); + } +}; +var AIAssistantCommand_default = AIAssistantCommand; + +// src/gui/MacroGUIs/AIAssistantCommandSettingsModal.ts +var import_obsidian25 = require("obsidian"); +var AIAssistantCommandSettingsModal = class extends import_obsidian25.Modal { + constructor(settings) { + super(app); + this.settings = settings; + this.waitForClose = new Promise( + (resolve, reject) => { + this.rejectPromise = reject; + this.resolvePromise = resolve; + } + ); + this.open(); + this.display(); + } + display() { + const header = this.contentEl.createEl("h2", { + text: `${this.settings.name} Settings` + }); + header.style.textAlign = "center"; + header.style.cursor = "pointer"; + header.style.userSelect = "none"; + header.addEventListener("click", async () => { + try { + const newName = await GenericInputPrompt.Prompt( + app, + "New name", + this.settings.name, + this.settings.name + ); + if (newName && newName !== this.settings.name) { + this.settings.name = newName; + this.reload(); + } + } catch (error) { + } + }); + this.addPromptTemplateSetting(this.contentEl); + this.addModelSetting(this.contentEl); + this.addOutputVariableNameSetting(this.contentEl); + this.addSystemPromptSetting(this.contentEl); + } + reload() { + this.contentEl.empty(); + this.display(); + } + addPromptTemplateSetting(container) { + const promptTemplatesFolder = settingsStore.getState().ai.promptTemplatesFolderPath; + const promptTemplateFiles = getMarkdownFilesInFolder( + promptTemplatesFolder + ).map((f) => f.name); + new import_obsidian25.Setting(container).setName("Prompt Template").setDesc( + "Enabling this will have the assistant use the prompt template you specify. If disable, the assistant will ask you for a prompt template to use." + ).addToggle((toggle) => { + toggle.setValue(this.settings.promptTemplate.enable); + toggle.onChange((value) => { + this.settings.promptTemplate.enable = value; + }); + }).addText((text2) => { + text2.setValue(this.settings.promptTemplate.name).onChange( + (value) => { + this.settings.promptTemplate.name = value; + } + ); + new GenericTextSuggester( + app, + text2.inputEl, + promptTemplateFiles + ); + }); + } + addModelSetting(container) { + new import_obsidian25.Setting(container).setName("Model").setDesc("The model the AI Assistant will use").addDropdown((dropdown) => { + for (const model of models_and_ask_me) { + dropdown.addOption(model, model); + } + dropdown.setValue(this.settings.model); + dropdown.onChange((value) => { + this.settings.model = value; + }); + }); + } + addOutputVariableNameSetting(container) { + new import_obsidian25.Setting(container).setName("Output variable name").setDesc( + "The name of the variable used to store the AI Assistant output, i.e. {{value:output}}." + ).addText((text2) => { + text2.setValue(this.settings.outputVariableName).onChange( + (value) => { + this.settings.outputVariableName = value; + } + ); + }); + } + addSystemPromptSetting(contentEl) { + new import_obsidian25.Setting(contentEl).setName("System Prompt").setDesc("The system prompt for the AI Assistant"); + const textAreaComponent = new import_obsidian25.TextAreaComponent(contentEl); + textAreaComponent.setValue(this.settings.systemPrompt).onChange(async (value) => { + this.settings.systemPrompt = value; + formatDisplay.innerText = await displayFormatter.format(value); + }); + new FormatSyntaxSuggester( + this.app, + textAreaComponent.inputEl, + QuickAdd.instance + ); + const displayFormatter = new FormatDisplayFormatter( + this.app, + QuickAdd.instance + ); + textAreaComponent.inputEl.style.width = "100%"; + textAreaComponent.inputEl.style.height = "100px"; + textAreaComponent.inputEl.style.minHeight = "100px"; + textAreaComponent.inputEl.style.marginBottom = "1em"; + const formatDisplay = this.contentEl.createEl("span"); + void (async () => formatDisplay.innerText = await displayFormatter.format( + this.settings.systemPrompt ?? "" + ))(); + } + onClose() { + this.resolvePromise(this.settings); + super.onClose(); + } +}; + +// src/gui/MacroGUIs/CommandList.svelte +function add_css8(target) { + append_styles(target, "svelte-1ngraqt", ".quickAddCommandList.svelte-1ngraqt{display:grid;grid-template-columns:auto;width:auto;border:0 solid black;overflow-y:auto;height:auto;margin-bottom:8px;padding:20px}"); +} +function get_each_context4(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[38] = list[i]; + child_ctx[39] = list; + child_ctx[40] = i; + return child_ctx; +} +function create_else_block2(ctx) { + let standardcommand; + let updating_command; + let updating_dragDisabled; + let updating_startDrag; + let current; + function standardcommand_command_binding(value) { + ctx[32](value, ctx[38], ctx[39], ctx[40]); + } + function standardcommand_dragDisabled_binding(value) { + ctx[33](value); + } + function standardcommand_startDrag_binding(value) { + ctx[34](value); + } + let standardcommand_props = {}; + if (ctx[38] !== void 0) { + standardcommand_props.command = ctx[38]; + } + if (ctx[3] !== void 0) { + standardcommand_props.dragDisabled = ctx[3]; + } + if (ctx[4] !== void 0) { + standardcommand_props.startDrag = ctx[4]; + } + standardcommand = new StandardCommand_default({ props: standardcommand_props }); + binding_callbacks.push(() => bind(standardcommand, "command", standardcommand_command_binding)); + binding_callbacks.push(() => bind(standardcommand, "dragDisabled", standardcommand_dragDisabled_binding)); + binding_callbacks.push(() => bind(standardcommand, "startDrag", standardcommand_startDrag_binding)); + standardcommand.$on("deleteCommand", ctx[35]); + standardcommand.$on("updateCommand", ctx[7]); + return { + c() { + create_component(standardcommand.$$.fragment); + }, + m(target, anchor) { + mount_component(standardcommand, target, anchor); current = true; }, p(new_ctx, dirty) { @@ -13044,7 +13641,7 @@ function create_else_block2(ctx) { const standardcommand_changes = {}; if (!updating_command && dirty[0] & 5) { updating_command = true; - standardcommand_changes.command = ctx[33]; + standardcommand_changes.command = ctx[38]; add_flush_callback(() => updating_command = false); } if (!updating_dragDisabled && dirty[0] & 8) { @@ -13074,6 +13671,81 @@ function create_else_block2(ctx) { } }; } +function create_if_block_32(ctx) { + let aiassistantcommand; + let updating_command; + let updating_dragDisabled; + let updating_startDrag; + let current; + function aiassistantcommand_command_binding(value) { + ctx[28](value, ctx[38], ctx[39], ctx[40]); + } + function aiassistantcommand_dragDisabled_binding(value) { + ctx[29](value); + } + function aiassistantcommand_startDrag_binding(value) { + ctx[30](value); + } + let aiassistantcommand_props = {}; + if (ctx[38] !== void 0) { + aiassistantcommand_props.command = ctx[38]; + } + if (ctx[3] !== void 0) { + aiassistantcommand_props.dragDisabled = ctx[3]; + } + if (ctx[4] !== void 0) { + aiassistantcommand_props.startDrag = ctx[4]; + } + aiassistantcommand = new AIAssistantCommand_default({ props: aiassistantcommand_props }); + binding_callbacks.push(() => bind(aiassistantcommand, "command", aiassistantcommand_command_binding)); + binding_callbacks.push(() => bind(aiassistantcommand, "dragDisabled", aiassistantcommand_dragDisabled_binding)); + binding_callbacks.push(() => bind(aiassistantcommand, "startDrag", aiassistantcommand_startDrag_binding)); + aiassistantcommand.$on("deleteCommand", ctx[31]); + aiassistantcommand.$on("updateCommand", ctx[7]); + aiassistantcommand.$on("configureAssistant", ctx[10]); + return { + c() { + create_component(aiassistantcommand.$$.fragment); + }, + m(target, anchor) { + mount_component(aiassistantcommand, target, anchor); + current = true; + }, + p(new_ctx, dirty) { + ctx = new_ctx; + const aiassistantcommand_changes = {}; + if (!updating_command && dirty[0] & 5) { + updating_command = true; + aiassistantcommand_changes.command = ctx[38]; + add_flush_callback(() => updating_command = false); + } + if (!updating_dragDisabled && dirty[0] & 8) { + updating_dragDisabled = true; + aiassistantcommand_changes.dragDisabled = ctx[3]; + add_flush_callback(() => updating_dragDisabled = false); + } + if (!updating_startDrag && dirty[0] & 16) { + updating_startDrag = true; + aiassistantcommand_changes.startDrag = ctx[4]; + add_flush_callback(() => updating_startDrag = false); + } + aiassistantcommand.$set(aiassistantcommand_changes); + }, + i(local) { + if (current) + return; + transition_in(aiassistantcommand.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(aiassistantcommand.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(aiassistantcommand, detaching); + } + }; +} function create_if_block_22(ctx) { let userscriptcommand; let updating_command; @@ -13081,17 +13753,17 @@ function create_if_block_22(ctx) { let updating_startDrag; let current; function userscriptcommand_command_binding(value) { - ctx[23](value, ctx[33], ctx[34], ctx[35]); + ctx[24](value, ctx[38], ctx[39], ctx[40]); } function userscriptcommand_dragDisabled_binding(value) { - ctx[24](value); + ctx[25](value); } function userscriptcommand_startDrag_binding(value) { - ctx[25](value); + ctx[26](value); } let userscriptcommand_props = {}; - if (ctx[33] !== void 0) { - userscriptcommand_props.command = ctx[33]; + if (ctx[38] !== void 0) { + userscriptcommand_props.command = ctx[38]; } if (ctx[3] !== void 0) { userscriptcommand_props.dragDisabled = ctx[3]; @@ -13103,7 +13775,7 @@ function create_if_block_22(ctx) { binding_callbacks.push(() => bind(userscriptcommand, "command", userscriptcommand_command_binding)); binding_callbacks.push(() => bind(userscriptcommand, "dragDisabled", userscriptcommand_dragDisabled_binding)); binding_callbacks.push(() => bind(userscriptcommand, "startDrag", userscriptcommand_startDrag_binding)); - userscriptcommand.$on("deleteCommand", ctx[26]); + userscriptcommand.$on("deleteCommand", ctx[27]); userscriptcommand.$on("updateCommand", ctx[7]); userscriptcommand.$on("configureScript", ctx[9]); return { @@ -13119,7 +13791,7 @@ function create_if_block_22(ctx) { const userscriptcommand_changes = {}; if (!updating_command && dirty[0] & 5) { updating_command = true; - userscriptcommand_changes.command = ctx[33]; + userscriptcommand_changes.command = ctx[38]; add_flush_callback(() => updating_command = false); } if (!updating_dragDisabled && dirty[0] & 8) { @@ -13156,17 +13828,17 @@ function create_if_block_14(ctx) { let updating_startDrag; let current; function nestedchoicecommand_command_binding(value) { - ctx[19](value, ctx[33], ctx[34], ctx[35]); + ctx[20](value, ctx[38], ctx[39], ctx[40]); } function nestedchoicecommand_dragDisabled_binding(value) { - ctx[20](value); + ctx[21](value); } function nestedchoicecommand_startDrag_binding(value) { - ctx[21](value); + ctx[22](value); } let nestedchoicecommand_props = {}; - if (ctx[33] !== void 0) { - nestedchoicecommand_props.command = ctx[33]; + if (ctx[38] !== void 0) { + nestedchoicecommand_props.command = ctx[38]; } if (ctx[3] !== void 0) { nestedchoicecommand_props.dragDisabled = ctx[3]; @@ -13178,7 +13850,7 @@ function create_if_block_14(ctx) { binding_callbacks.push(() => bind(nestedchoicecommand, "command", nestedchoicecommand_command_binding)); binding_callbacks.push(() => bind(nestedchoicecommand, "dragDisabled", nestedchoicecommand_dragDisabled_binding)); binding_callbacks.push(() => bind(nestedchoicecommand, "startDrag", nestedchoicecommand_startDrag_binding)); - nestedchoicecommand.$on("deleteCommand", ctx[22]); + nestedchoicecommand.$on("deleteCommand", ctx[23]); nestedchoicecommand.$on("updateCommand", ctx[7]); nestedchoicecommand.$on("configureChoice", ctx[8]); return { @@ -13194,7 +13866,7 @@ function create_if_block_14(ctx) { const nestedchoicecommand_changes = {}; if (!updating_command && dirty[0] & 5) { updating_command = true; - nestedchoicecommand_changes.command = ctx[33]; + nestedchoicecommand_changes.command = ctx[38]; add_flush_callback(() => updating_command = false); } if (!updating_dragDisabled && dirty[0] & 8) { @@ -13231,17 +13903,17 @@ function create_if_block5(ctx) { let updating_startDrag; let current; function waitcommand_command_binding(value) { - ctx[15](value, ctx[33], ctx[34], ctx[35]); + ctx[16](value, ctx[38], ctx[39], ctx[40]); } function waitcommand_dragDisabled_binding(value) { - ctx[16](value); + ctx[17](value); } function waitcommand_startDrag_binding(value) { - ctx[17](value); + ctx[18](value); } let waitcommand_props = {}; - if (ctx[33] !== void 0) { - waitcommand_props.command = ctx[33]; + if (ctx[38] !== void 0) { + waitcommand_props.command = ctx[38]; } if (ctx[3] !== void 0) { waitcommand_props.dragDisabled = ctx[3]; @@ -13253,7 +13925,7 @@ function create_if_block5(ctx) { binding_callbacks.push(() => bind(waitcommand, "command", waitcommand_command_binding)); binding_callbacks.push(() => bind(waitcommand, "dragDisabled", waitcommand_dragDisabled_binding)); binding_callbacks.push(() => bind(waitcommand, "startDrag", waitcommand_startDrag_binding)); - waitcommand.$on("deleteCommand", ctx[18]); + waitcommand.$on("deleteCommand", ctx[19]); waitcommand.$on("updateCommand", ctx[7]); return { c() { @@ -13268,7 +13940,7 @@ function create_if_block5(ctx) { const waitcommand_changes = {}; if (!updating_command && dirty[0] & 5) { updating_command = true; - waitcommand_changes.command = ctx[33]; + waitcommand_changes.command = ctx[38]; add_flush_callback(() => updating_command = false); } if (!updating_dragDisabled && dirty[0] & 8) { @@ -13304,16 +13976,24 @@ function create_each_block4(key_1, ctx) { let if_block; let if_block_anchor; let current; - const if_block_creators = [create_if_block5, create_if_block_14, create_if_block_22, create_else_block2]; + const if_block_creators = [ + create_if_block5, + create_if_block_14, + create_if_block_22, + create_if_block_32, + create_else_block2 + ]; const if_blocks = []; function select_block_type(ctx2, dirty) { - if (ctx2[33].type === "Wait" /* Wait */) + if (ctx2[38].type === "Wait" /* Wait */) return 0; - if (ctx2[33].type === "NestedChoice" /* NestedChoice */) + if (ctx2[38].type === "NestedChoice" /* NestedChoice */) return 1; - if (ctx2[33].type === "UserScript" /* UserScript */) + if (ctx2[38].type === "UserScript" /* UserScript */) return 2; - return 3; + if (ctx2[38].type === "AIAssistant" /* AIAssistant */) + return 3; + return 4; } current_block_type_index = select_block_type(ctx, [-1, -1]); if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); @@ -13374,7 +14054,7 @@ function create_each_block4(key_1, ctx) { } }; } -function create_fragment16(ctx) { +function create_fragment17(ctx) { let ol; let each_blocks = []; let each_1_lookup = /* @__PURE__ */ new Map(); @@ -13382,8 +14062,8 @@ function create_fragment16(ctx) { let current; let mounted; let dispose; - let each_value = ctx[0].filter(ctx[14]); - const get_key = (ctx2) => ctx2[33].id; + let each_value = ctx[0].filter(ctx[15]); + const get_key = (ctx2) => ctx2[38].id; for (let i = 0; i < each_value.length; i += 1) { let child_ctx = get_each_context4(ctx, each_value, i); let key = get_key(child_ctx); @@ -13395,7 +14075,7 @@ function create_fragment16(ctx) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(ol, "class", "quickAddCommandList svelte-1ukgrgp"); + attr(ol, "class", "quickAddCommandList svelte-1ngraqt"); }, m(target, anchor) { insert(target, ol, anchor); @@ -13418,8 +14098,8 @@ function create_fragment16(ctx) { } }, p(ctx2, dirty) { - if (dirty[0] & 927) { - each_value = ctx2[0].filter(ctx2[14]); + if (dirty[0] & 1951) { + each_value = ctx2[0].filter(ctx2[15]); group_outros(); each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, ol, outro_and_destroy_block, create_each_block4, null, get_each_context4); check_outros(); @@ -13457,7 +14137,7 @@ function create_fragment16(ctx) { } }; } -function instance16($$self, $$props, $$invalidate) { +function instance17($$self, $$props, $$invalidate) { let { commands: commands2 } = $$props; let { deleteCommand } = $$props; let { saveCommands } = $$props; @@ -13522,6 +14202,13 @@ function instance16($$self, $$props, $$invalidate) { } new UserScriptSettingsModal(app2, command, userScript.settings).open(); } + async function configureAssistant(e) { + const command = e.detail; + const newSetings = await new AIAssistantCommandSettingsModal(command).waitForClose; + if (newSetings) { + updateCommand(command); + } + } const func = (c) => c.id !== SHADOW_PLACEHOLDER_ITEM_ID; function waitcommand_command_binding(value, command, each_value, command_index) { each_value[command_index] = value; @@ -13562,6 +14249,19 @@ function instance16($$self, $$props, $$invalidate) { $$invalidate(4, startDrag); } const deleteCommand_handler_2 = async (e) => await deleteCommand(e.detail); + function aiassistantcommand_command_binding(value, command, each_value, command_index) { + each_value[command_index] = value; + $$invalidate(0, commands2); + } + function aiassistantcommand_dragDisabled_binding(value) { + dragDisabled = value; + $$invalidate(3, dragDisabled); + } + function aiassistantcommand_startDrag_binding(value) { + startDrag = value; + $$invalidate(4, startDrag); + } + const deleteCommand_handler_3 = async (e) => await deleteCommand(e.detail); function standardcommand_command_binding(value, command, each_value, command_index) { each_value[command_index] = value; $$invalidate(0, commands2); @@ -13574,18 +14274,18 @@ function instance16($$self, $$props, $$invalidate) { startDrag = value; $$invalidate(4, startDrag); } - const deleteCommand_handler_3 = async (e) => await deleteCommand(e.detail); + const deleteCommand_handler_4 = async (e) => await deleteCommand(e.detail); $$self.$$set = ($$props2) => { if ("commands" in $$props2) $$invalidate(0, commands2 = $$props2.commands); if ("deleteCommand" in $$props2) $$invalidate(1, deleteCommand = $$props2.deleteCommand); if ("saveCommands" in $$props2) - $$invalidate(10, saveCommands = $$props2.saveCommands); + $$invalidate(11, saveCommands = $$props2.saveCommands); if ("app" in $$props2) - $$invalidate(11, app2 = $$props2.app); + $$invalidate(12, app2 = $$props2.app); if ("plugin" in $$props2) - $$invalidate(12, plugin = $$props2.plugin); + $$invalidate(13, plugin = $$props2.plugin); }; return [ commands2, @@ -13598,6 +14298,7 @@ function instance16($$self, $$props, $$invalidate) { updateCommandFromEvent, configureChoice, configureScript, + configureAssistant, saveCommands, app2, plugin, @@ -13615,10 +14316,14 @@ function instance16($$self, $$props, $$invalidate) { userscriptcommand_dragDisabled_binding, userscriptcommand_startDrag_binding, deleteCommand_handler_2, + aiassistantcommand_command_binding, + aiassistantcommand_dragDisabled_binding, + aiassistantcommand_startDrag_binding, + deleteCommand_handler_3, standardcommand_command_binding, standardcommand_dragDisabled_binding, standardcommand_startDrag_binding, - deleteCommand_handler_3 + deleteCommand_handler_4 ]; } var CommandList = class extends SvelteComponent { @@ -13627,23 +14332,23 @@ var CommandList = class extends SvelteComponent { init( this, options, - instance16, - create_fragment16, + instance17, + create_fragment17, safe_not_equal, { commands: 0, deleteCommand: 1, - saveCommands: 10, - app: 11, - plugin: 12, - updateCommandList: 13 + saveCommands: 11, + app: 12, + plugin: 13, + updateCommandList: 14 }, add_css8, [-1, -1] ); } get updateCommandList() { - return this.$$.ctx[13]; + return this.$$.ctx[14]; } }; var CommandList_default = CommandList; @@ -13672,6 +14377,18 @@ var NestedChoiceCommand2 = class extends Command { } }; +// src/types/macros/QuickCommands/AIAssistantCommand.ts +var AIAssistantCommand2 = class extends Command { + constructor() { + super("AI Assistant", "AIAssistant" /* AIAssistant */); + const defaults = settingsStore.getState().ai; + this.model = defaults.defaultModel; + this.systemPrompt = defaults.defaultSystemPrompt; + this.outputVariableName = "output"; + this.promptTemplate = { enable: false, name: "" }; + } +}; + // src/gui/MacroGUIs/MacroBuilder.ts function getChoicesAsList(nestedChoices) { const arr = []; @@ -13687,7 +14404,7 @@ function getChoicesAsList(nestedChoices) { recursive(nestedChoices); return arr; } -var MacroBuilder = class extends import_obsidian25.Modal { +var MacroBuilder = class extends import_obsidian27.Modal { constructor(app2, plugin, macro, choices) { super(app2); this.commands = []; @@ -13763,7 +14480,7 @@ var MacroBuilder = class extends import_obsidian25.Modal { this.addCommandToMacro(command); input.setValue(""); }; - new import_obsidian25.Setting(this.contentEl).setName("Obsidian command").setDesc("Add an Obsidian command").addText((textComponent) => { + new import_obsidian27.Setting(this.contentEl).setName("Obsidian command").setDesc("Add an Obsidian command").addText((textComponent) => { input = textComponent; textComponent.inputEl.style.marginRight = "1em"; textComponent.setPlaceholder("Obsidian command"); @@ -13811,7 +14528,7 @@ var MacroBuilder = class extends import_obsidian25.Modal { } this.addCommandToMacro(command); }; - new import_obsidian25.Setting(this.contentEl).setName("Editor commands").setDesc("Add editor command").addDropdown((dropdown) => { + new import_obsidian27.Setting(this.contentEl).setName("Editor commands").setDesc("Add editor command").addDropdown((dropdown) => { dropdownComponent = dropdown; dropdown.selectEl.style.marginRight = "1em"; dropdown.addOption("Copy" /* Copy */, "Copy" /* Copy */).addOption("Cut" /* Cut */, "Cut" /* Cut */).addOption("Paste" /* Paste */, "Paste" /* Paste */).addOption( @@ -13838,7 +14555,7 @@ var MacroBuilder = class extends import_obsidian25.Modal { this.addCommandToMacro(new UserScript(value, file.path)); input.setValue(""); }; - new import_obsidian25.Setting(this.contentEl).setName("User Scripts").setDesc("Add user script").addText((textComponent) => { + new import_obsidian27.Setting(this.contentEl).setName("User Scripts").setDesc("Add user script").addText((textComponent) => { input = textComponent; textComponent.inputEl.style.marginRight = "1em"; textComponent.setPlaceholder("User script"); @@ -13869,7 +14586,7 @@ var MacroBuilder = class extends import_obsidian25.Modal { this.addCommandToMacro(new ChoiceCommand(choice.name, choice.id)); input.setValue(""); }; - new import_obsidian25.Setting(this.contentEl).setName("Choices").setDesc("Add existing choice").addText((textComponent) => { + new import_obsidian27.Setting(this.contentEl).setName("Choices").setDesc("Add existing choice").addText((textComponent) => { input = textComponent; textComponent.inputEl.style.marginRight = "1em"; textComponent.setPlaceholder("Choice"); @@ -13941,9 +14658,18 @@ var MacroBuilder = class extends import_obsidian25.Modal { this.newChoiceButton(quickCommandContainer, "Capture", CaptureChoice); this.newChoiceButton(quickCommandContainer, "Template", TemplateChoice); this.addAddWaitCommandButton(quickCommandContainer); + this.addAIAssistantCommandButton(quickCommandContainer); + } + addAIAssistantCommandButton(quickCommandContainer) { + const button = new import_obsidian27.ButtonComponent( + quickCommandContainer + ); + button.setIcon("bot").setTooltip("Add AI Assistant command").onClick(() => { + this.addCommandToMacro(new AIAssistantCommand2()); + }); } addAddWaitCommandButton(quickCommandContainer) { - const button = new import_obsidian25.ButtonComponent( + const button = new import_obsidian27.ButtonComponent( quickCommandContainer ); button.setIcon("clock").setTooltip("Add wait command").onClick(() => { @@ -13951,7 +14677,7 @@ var MacroBuilder = class extends import_obsidian25.Modal { }); } newChoiceButton(container, typeName, type) { - const button = new import_obsidian25.ButtonComponent(container); + const button = new import_obsidian27.ButtonComponent(container); button.setButtonText(typeName).setTooltip(`Add ${typeName} Choice`).onClick(() => { const captureChoice = new type( `Untitled ${typeName} Choice` @@ -13965,92 +14691,6 @@ var MacroBuilder = class extends import_obsidian25.Modal { } }; -// node_modules/.pnpm/zustand@4.3.6/node_modules/zustand/esm/vanilla.mjs -var import_meta = {}; -var createStoreImpl = (createState) => { - let state; - const listeners = /* @__PURE__ */ new Set(); - const setState = (partial, replace) => { - const nextState = typeof partial === "function" ? partial(state) : partial; - if (!Object.is(nextState, state)) { - const previousState = state; - state = (replace != null ? replace : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState); - listeners.forEach((listener) => listener(state, previousState)); - } - }; - const getState = () => state; - const subscribe = (listener) => { - listeners.add(listener); - return () => listeners.delete(listener); - }; - const destroy = () => { - if ((import_meta.env && import_meta.env.MODE) !== "production") { - console.warn( - "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." - ); - } - listeners.clear(); - }; - const api = { setState, getState, subscribe, destroy }; - state = createState(setState, getState, api); - return api; -}; -var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl; - -// src/types/macros/QuickAddMacro.ts -var QuickAddMacro = class { - constructor(name) { - this.name = name; - this.id = v4_default(); - this.commands = []; - this.runOnStartup = false; - } -}; - -// src/settingsStore.ts -var settingsStore = function() { - const useSettingsStore = createStore((set, get2) => ({ - ...DEFAULT_SETTINGS, - setSettings: (settings) => set((state) => ({ ...state, ...settings })) - })); - const { getState, setState, subscribe } = useSettingsStore; - return { - getState, - setState, - subscribe, - setMacro: (macroId, macro) => { - setState((state) => { - const macroIdx = state.macros.findIndex( - (m) => m.id === macroId - ); - if (macroIdx === -1) { - throw new Error("Macro not found"); - } - const newState = { - ...state, - macros: [...state.macros] - }; - newState.macros[macroIdx] = macro; - return newState; - }); - }, - createMacro: (name) => { - if (name === "" || getState().macros.some((m) => m.name === name)) { - throw new Error("Invalid macro name"); - } - const macro = new QuickAddMacro(name); - setState((state) => ({ - ...state, - macros: [...state.macros, macro] - })); - return macro; - }, - getMacro: (macroId) => { - return getState().macros.find((m) => m.id === macroId); - } - }; -}(); - // src/gui/ChoiceBuilder/macroChoiceBuilder.ts var MacroChoiceBuilder = class extends ChoiceBuilder { constructor(app2, choice, macros, choices) { @@ -14084,7 +14724,7 @@ var MacroChoiceBuilder = class extends ChoiceBuilder { if (hasOwnMacro) return; const createMacroButtonContainer = container.createDiv(); - const createMacroButton = new import_obsidian26.ButtonComponent( + const createMacroButton = new import_obsidian28.ButtonComponent( createMacroButtonContainer ); createMacroButton.setIcon("plus").setCta().setTooltip("Create Macro").onClick(() => { @@ -14099,7 +14739,7 @@ var MacroChoiceBuilder = class extends ChoiceBuilder { } addConfigureMacroButton(container) { const configureMacroButtonContainer = container.createDiv(); - const configureMacroButton = new import_obsidian26.ButtonComponent( + const configureMacroButton = new import_obsidian28.ButtonComponent( configureMacroButtonContainer ); configureMacroButton.setIcon("cog").setTooltip("Configure Macro").onClick(async () => { @@ -14120,7 +14760,7 @@ var MacroChoiceBuilder = class extends ChoiceBuilder { } addSelectMacroSearch(container) { const selectMacroDropdownContainer = container.createDiv("selectMacroDropdownContainer"); - const dropdown = new import_obsidian27.DropdownComponent( + const dropdown = new import_obsidian29.DropdownComponent( selectMacroDropdownContainer ); const macroOptions = {}; @@ -14152,8 +14792,8 @@ var MacroChoiceBuilder = class extends ChoiceBuilder { }; // src/MacrosManager.ts -var import_obsidian28 = require("obsidian"); -var MacrosManager = class extends import_obsidian28.Modal { +var import_obsidian30 = require("obsidian"); +var MacrosManager = class extends import_obsidian30.Modal { constructor(app2, plugin, macros, choices) { super(app2); this.app = app2; @@ -14196,14 +14836,14 @@ var MacrosManager = class extends import_obsidian28.Modal { } addMacroSetting(macro, container) { const configureMacroContainer = container.createDiv(); - const macroSetting = new import_obsidian28.Setting(configureMacroContainer); + const macroSetting = new import_obsidian30.Setting(configureMacroContainer); macroSetting.setName(macro.name); macroSetting.infoEl.style.fontWeight = "bold"; this.addMacroConfigurationItem( configureMacroContainer, (itemContainerEl) => { this.addSpanWithText(itemContainerEl, "Run on plugin load"); - const toggle = new import_obsidian28.ToggleComponent( + const toggle = new import_obsidian30.ToggleComponent( itemContainerEl ); toggle.setValue(macro.runOnStartup); @@ -14217,7 +14857,7 @@ var MacrosManager = class extends import_obsidian28.Modal { this.addMacroConfigurationItem( configureMacroContainer, (itemContainerEl) => { - const deleteButton = new import_obsidian28.ButtonComponent( + const deleteButton = new import_obsidian30.ButtonComponent( itemContainerEl ); deleteButton.setClass("mod-warning"); @@ -14228,7 +14868,7 @@ var MacrosManager = class extends import_obsidian28.Modal { this.reload(); this.macroContainer.scrollTop = scroll; }); - const configureButton = new import_obsidian28.ButtonComponent( + const configureButton = new import_obsidian30.ButtonComponent( itemContainerEl ); configureButton.setClass("mod-cta"); @@ -14271,11 +14911,11 @@ var MacrosManager = class extends import_obsidian28.Modal { addAddMacroBar() { const addMacroBarContainer = this.contentEl.createDiv(); addMacroBarContainer.addClass("addMacroBarContainer"); - const nameInput = new import_obsidian28.TextComponent( + const nameInput = new import_obsidian30.TextComponent( addMacroBarContainer ); nameInput.setPlaceholder("Macro name"); - const addMacroButton = new import_obsidian28.ButtonComponent( + const addMacroButton = new import_obsidian30.ButtonComponent( addMacroBarContainer ); addMacroButton.setButtonText("Add macro").setClass("mod-cta").onClick(() => { @@ -14299,24 +14939,124 @@ var MacrosManager = class extends import_obsidian28.Modal { } }; +// src/gui/AIAssistantSettingsModal.ts +var import_obsidian31 = require("obsidian"); +var AIAssistantSettingsModal = class extends import_obsidian31.Modal { + constructor(settings) { + super(app); + this.settings = settings; + this.waitForClose = new Promise( + (resolve, reject) => { + this.rejectPromise = reject; + this.resolvePromise = resolve; + } + ); + this.open(); + this.display(); + } + display() { + this.contentEl.createEl("h2", { + text: "AI Assistant Settings" + }).style.textAlign = "center"; + this.addApiKeySetting(this.contentEl); + this.addDefaultModelSetting(this.contentEl); + this.addPromptTemplateFolderPathSetting(this.contentEl); + this.addShowAssistantSetting(this.contentEl); + this.addDefaultSystemPromptSetting(this.contentEl); + } + reload() { + this.contentEl.empty(); + this.display(); + } + addApiKeySetting(container) { + new import_obsidian31.Setting(container).setName("API Key").setDesc("The API Key for the AI Assistant").addText((text2) => { + setPasswordOnBlur(text2.inputEl); + text2.setValue(this.settings.OpenAIApiKey).onChange((value) => { + this.settings.OpenAIApiKey = value; + }); + text2.inputEl.placeholder = "sk-..."; + }); + } + addDefaultModelSetting(container) { + new import_obsidian31.Setting(container).setName("Default Model").setDesc("The default model for the AI Assistant").addDropdown((dropdown) => { + for (const model of models_and_ask_me) { + dropdown.addOption(model, model); + } + dropdown.setValue(this.settings.defaultModel); + dropdown.onChange((value) => { + this.settings.defaultModel = value; + }); + }); + } + addPromptTemplateFolderPathSetting(container) { + new import_obsidian31.Setting(container).setName("Prompt Template Folder Path").setDesc("Path to your folder with prompt templates").addText((text2) => { + text2.setValue(this.settings.promptTemplatesFolderPath).onChange( + (value) => { + this.settings.promptTemplatesFolderPath = value; + } + ); + }); + } + addShowAssistantSetting(container) { + new import_obsidian31.Setting(container).setName("Show Assistant").setDesc("Show status messages from the AI Assistant").addToggle((toggle) => { + toggle.setValue(this.settings.showAssistant); + toggle.onChange((value) => { + this.settings.showAssistant = value; + }); + }); + } + addDefaultSystemPromptSetting(contentEl) { + new import_obsidian31.Setting(contentEl).setName("Default System Prompt").setDesc("The default system prompt for the AI Assistant"); + const textAreaComponent = new import_obsidian31.TextAreaComponent(contentEl); + textAreaComponent.setValue(this.settings.defaultSystemPrompt).onChange(async (value) => { + this.settings.defaultSystemPrompt = value; + formatDisplay.innerText = await displayFormatter.format(value); + }); + new FormatSyntaxSuggester( + this.app, + textAreaComponent.inputEl, + QuickAdd.instance + ); + const displayFormatter = new FormatDisplayFormatter( + this.app, + QuickAdd.instance + ); + textAreaComponent.inputEl.style.width = "100%"; + textAreaComponent.inputEl.style.height = "100px"; + textAreaComponent.inputEl.style.minHeight = "100px"; + textAreaComponent.inputEl.style.marginBottom = "1em"; + const formatDisplay = this.contentEl.createEl("span"); + void (async () => formatDisplay.innerText = await displayFormatter.format( + this.settings.defaultSystemPrompt ?? "" + ))(); + } + onClose() { + this.resolvePromise(this.settings); + super.onClose(); + } +}; + // src/gui/choiceList/ChoiceView.svelte function add_css9(target) { - append_styles(target, "svelte-wcmtyt", ".choiceViewBottomBar.svelte-wcmtyt{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin-top:1rem}@media(max-width: 800px){.choiceViewBottomBar.svelte-wcmtyt{flex-direction:column}}"); + append_styles(target, "svelte-1ikpkxq", ".choiceViewBottomBar.svelte-1ikpkxq{display:flex;flex-direction:row;align-items:center;justify-content:space-between;margin-top:1rem}@media(max-width: 800px){.choiceViewBottomBar.svelte-1ikpkxq{flex-direction:column}}"); } -function create_fragment17(ctx) { - let div1; +function create_fragment18(ctx) { + let div2; let choicelist; let updating_choices; let t0; + let div1; let div0; - let button; + let button0; let t2; + let button1; + let t4; let addchoicebox; let current; let mounted; let dispose; function choicelist_choices_binding(value) { - ctx[12](value); + ctx[13](value); } let choicelist_props = { type: "main" }; if (ctx[0] !== void 0) { @@ -14328,33 +15068,46 @@ function create_fragment17(ctx) { choicelist.$on("configureChoice", ctx[4]); choicelist.$on("toggleCommand", ctx[5]); choicelist.$on("duplicateChoice", ctx[6]); - choicelist.$on("reorderChoices", ctx[13]); + choicelist.$on("reorderChoices", ctx[14]); addchoicebox = new AddChoiceBox_default({}); addchoicebox.$on("addChoice", ctx[2]); return { c() { - div1 = element("div"); + div2 = element("div"); create_component(choicelist.$$.fragment); t0 = space(); + div1 = element("div"); div0 = element("div"); - button = element("button"); - button.textContent = "Manage Macros"; + button0 = element("button"); + button0.textContent = "Manage Macros"; t2 = space(); + button1 = element("button"); + button1.textContent = "AI Assistant"; + t4 = space(); create_component(addchoicebox.$$.fragment); - attr(button, "class", "mod-cta"); - attr(div0, "class", "choiceViewBottomBar svelte-wcmtyt"); + attr(button0, "class", "mod-cta"); + attr(button1, "class", "mod-cta"); + set_style(div0, "display", "flex"); + set_style(div0, "gap", "4px"); + attr(div1, "class", "choiceViewBottomBar svelte-1ikpkxq"); }, m(target, anchor) { - insert(target, div1, anchor); - mount_component(choicelist, div1, null); - append(div1, t0); + insert(target, div2, anchor); + mount_component(choicelist, div2, null); + append(div2, t0); + append(div2, div1); append(div1, div0); - append(div0, button); + append(div0, button0); append(div0, t2); - mount_component(addchoicebox, div0, null); + append(div0, button1); + append(div1, t4); + mount_component(addchoicebox, div1, null); current = true; if (!mounted) { - dispose = listen(button, "click", ctx[7]); + dispose = [ + listen(button0, "click", ctx[7]), + listen(button1, "click", ctx[8]) + ]; mounted = true; } }, @@ -14381,11 +15134,11 @@ function create_fragment17(ctx) { }, d(detaching) { if (detaching) - detach(div1); + detach(div2); destroy_component(choicelist); destroy_component(addchoicebox); mounted = false; - dispose(); + run_all(dispose); } }; } @@ -14410,7 +15163,7 @@ function updateChoiceHelper(oldChoice, newChoice) { } return oldChoice; } -function instance17($$self, $$props, $$invalidate) { +function instance18($$self, $$props, $$invalidate) { let { choices = [] } = $$props; let { macros = [] } = $$props; let { saveChoices } = $$props; @@ -14420,7 +15173,7 @@ function instance17($$self, $$props, $$invalidate) { onMount(() => { const unsubSettingsStore = settingsStore.subscribe((settings) => { $$invalidate(0, choices = settings.choices); - $$invalidate(8, macros = settings.macros); + $$invalidate(9, macros = settings.macros); }); return () => { unsubSettingsStore(); @@ -14459,7 +15212,7 @@ function instance17($$self, $$props, $$invalidate) { if (!userConfirmed) return; if (hasOwnMacro) { - $$invalidate(8, macros = macros.filter((macro) => macro.id !== choice.macroId)); + $$invalidate(9, macros = macros.filter((macro) => macro.id !== choice.macroId)); saveMacros(macros); } $$invalidate(0, choices = choices.filter((value) => deleteChoiceHelper(choice.id, value))); @@ -14547,7 +15300,13 @@ function instance17($$self, $$props, $$invalidate) { const newMacros = await new MacrosManager(app2, plugin, macros, choices).waitForClose; if (newMacros) { saveMacros(newMacros); - $$invalidate(8, macros = newMacros); + $$invalidate(9, macros = newMacros); + } + } + async function openAISettings() { + const newSettings = await new AIAssistantSettingsModal(settingsStore.getState().ai).waitForClose; + if (newSettings) { + settingsStore.setState((state) => ({ ...state, ai: newSettings })); } } function choicelist_choices_binding(value) { @@ -14559,15 +15318,15 @@ function instance17($$self, $$props, $$invalidate) { if ("choices" in $$props2) $$invalidate(0, choices = $$props2.choices); if ("macros" in $$props2) - $$invalidate(8, macros = $$props2.macros); + $$invalidate(9, macros = $$props2.macros); if ("saveChoices" in $$props2) $$invalidate(1, saveChoices = $$props2.saveChoices); if ("saveMacros" in $$props2) - $$invalidate(9, saveMacros = $$props2.saveMacros); + $$invalidate(10, saveMacros = $$props2.saveMacros); if ("app" in $$props2) - $$invalidate(10, app2 = $$props2.app); + $$invalidate(11, app2 = $$props2.app); if ("plugin" in $$props2) - $$invalidate(11, plugin = $$props2.plugin); + $$invalidate(12, plugin = $$props2.plugin); }; return [ choices, @@ -14578,6 +15337,7 @@ function instance17($$self, $$props, $$invalidate) { toggleCommandForChoice, handleDuplicateChoice, openMacroManager, + openAISettings, macros, saveMacros, app2, @@ -14592,16 +15352,16 @@ var ChoiceView = class extends SvelteComponent { init( this, options, - instance17, - create_fragment17, + instance18, + create_fragment18, safe_not_equal, { choices: 0, - macros: 8, + macros: 9, saveChoices: 1, - saveMacros: 9, - app: 10, - plugin: 11 + saveMacros: 10, + app: 11, + plugin: 12 }, add_css9 ); @@ -14618,6 +15378,13 @@ var DEFAULT_SETTINGS = { templateFolderPath: "", announceUpdates: true, version: "0.0.0", + ai: { + OpenAIApiKey: "", + defaultModel: "Ask me", + defaultSystemPrompt: `As an AI assistant within Obsidian, your primary goal is to help users manage their ideas and knowledge more effectively. Format your responses using Markdown syntax. Please use the [[Obsidian]] link format. You can write aliases for the links by writing [[Obsidian|the alias after the pipe symbol]]. To use mathematical notation, use LaTeX syntax. LaTeX syntax for larger equations should be on separate lines, surrounded with double dollar signs ($$). You can also inline math expressions by wrapping it in $ symbols. For example, use $$w_{ij}^{ ext{new}}:=w_{ij}^{ ext{current}}+etacdotdelta_jcdot x_{ij}$$ on a separate line, but you can write "($eta$ = learning rate, $delta_j$ = error term, $x_{ij}$ = input)" inline.`, + promptTemplatesFolderPath: "", + showAssistant: true + }, migrations: { migrateToMacroIDFromEmbeddedMacro: false, useQuickAddTemplateFolder: false, @@ -14626,7 +15393,7 @@ var DEFAULT_SETTINGS = { setVersionAfterUpdateModalRelease: false } }; -var QuickAddSettingsTab = class extends import_obsidian30.PluginSettingTab { +var QuickAddSettingsTab = class extends import_obsidian33.PluginSettingTab { constructor(app2, plugin) { super(app2, plugin); this.plugin = plugin; @@ -14641,7 +15408,7 @@ var QuickAddSettingsTab = class extends import_obsidian30.PluginSettingTab { this.addAnnounceUpdatesSetting(); } addAnnounceUpdatesSetting() { - const setting = new import_obsidian30.Setting(this.containerEl); + const setting = new import_obsidian33.Setting(this.containerEl); setting.setName("Announce Updates"); setting.setDesc( "Display release notes when a new version is installed. This includes new features, demo videos, and bug fixes." @@ -14658,7 +15425,7 @@ var QuickAddSettingsTab = class extends import_obsidian30.PluginSettingTab { this.choiceView.$destroy(); } addChoicesSetting() { - const setting = new import_obsidian30.Setting(this.containerEl); + const setting = new import_obsidian33.Setting(this.containerEl); setting.infoEl.remove(); setting.settingEl.style.display = "block"; this.choiceView = new ChoiceView_default({ @@ -14678,7 +15445,7 @@ var QuickAddSettingsTab = class extends import_obsidian30.PluginSettingTab { }); } addUseMultiLineInputPromptSetting() { - new import_obsidian30.Setting(this.containerEl).setName("Use Multi-line Input Prompt").setDesc( + new import_obsidian33.Setting(this.containerEl).setName("Use Multi-line Input Prompt").setDesc( "Use multi-line input prompt instead of single-line input prompt" ).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inputPrompt === "multi-line").setTooltip("Use multi-line input prompt").onChange((value) => { @@ -14695,7 +15462,7 @@ var QuickAddSettingsTab = class extends import_obsidian30.PluginSettingTab { ); } addTemplateFolderPathSetting() { - const setting = new import_obsidian30.Setting(this.containerEl); + const setting = new import_obsidian33.Setting(this.containerEl); setting.setName("Template Folder Path"); setting.setDesc( "Path to the folder where templates are stored. Used to suggest template files when configuring QuickAdd." @@ -14707,7 +15474,7 @@ var QuickAddSettingsTab = class extends import_obsidian30.PluginSettingTab { new GenericTextSuggester( app, text2.inputEl, - app.vault.getAllLoadedFiles().filter((f) => f instanceof import_obsidian30.TFolder && f.path !== "/").map((f) => f.path) + app.vault.getAllLoadedFiles().filter((f) => f instanceof import_obsidian33.TFolder && f.path !== "/").map((f) => f.path) ); }); } @@ -14750,7 +15517,7 @@ var ConsoleErrorLogger = class extends QuickAddLogger { }; // src/logger/guiLogger.ts -var import_obsidian31 = require("obsidian"); +var import_obsidian34 = require("obsidian"); var GuiLogger = class extends QuickAddLogger { constructor(plugin) { super(); @@ -14758,11 +15525,11 @@ var GuiLogger = class extends QuickAddLogger { } logError(msg) { const error = this.getQuickAddError(msg, "ERROR" /* Error */); - new import_obsidian31.Notice(this.formatOutputString(error), 15e3); + new import_obsidian34.Notice(this.formatOutputString(error), 15e3); } logWarning(msg) { const warning = this.getQuickAddError(msg, "WARNING" /* Warning */); - new import_obsidian31.Notice(this.formatOutputString(warning)); + new import_obsidian34.Notice(this.formatOutputString(warning)); } logMessage(msg) { } @@ -14783,17 +15550,7 @@ var StartupMacroEngine = class extends MacroChoiceEngine { }; // src/engine/TemplateChoiceEngine.ts -var import_obsidian32 = require("obsidian"); - -// src/utils/invariant.ts -function invariant(condition, message) { - if (!condition) { - throw new Error(typeof message === "function" ? message() : message); - } - return; -} - -// src/engine/TemplateChoiceEngine.ts +var import_obsidian35 = require("obsidian"); var TemplateChoiceEngine = class extends TemplateEngine { constructor(app2, plugin, choice, choiceExecutor) { super(app2, plugin, choiceExecutor); @@ -14827,7 +15584,7 @@ var TemplateChoiceEngine = class extends TemplateEngine { let createdFile; if (await this.app.vault.adapter.exists(filePath)) { const file = this.app.vault.getAbstractFileByPath(filePath); - if (!(file instanceof import_obsidian32.TFile) || file.extension !== "md") { + if (!(file instanceof import_obsidian35.TFile) || file.extension !== "md") { log.logError( `'${filePath}' already exists and is not a valid markdown file.` ); @@ -16059,8 +16816,8 @@ This is in order to prevent data loss.` }; // src/gui/suggesters/choiceSuggester.ts -var import_obsidian33 = require("obsidian"); -var ChoiceSuggester = class extends import_obsidian33.FuzzySuggestModal { +var import_obsidian36 = require("obsidian"); +var ChoiceSuggester = class extends import_obsidian36.FuzzySuggestModal { constructor(plugin, choices, choiceExecutor) { super(plugin.app); this.plugin = plugin; @@ -16077,7 +16834,7 @@ var ChoiceSuggester = class extends import_obsidian33.FuzzySuggestModal { } renderSuggestion(item, el) { el.empty(); - void import_obsidian33.MarkdownRenderer.renderMarkdown(item.item.name, el, "", this.plugin); + void import_obsidian36.MarkdownRenderer.renderMarkdown(item.item.name, el, "", this.plugin); el.classList.add("quickadd-choice-suggestion"); } getItemText(item) { @@ -16393,7 +17150,7 @@ QuickAdd will now revert to backup.` var migrate_default = migrate; // src/gui/UpdateModal/UpdateModal.ts -var import_obsidian34 = require("obsidian"); +var import_obsidian37 = require("obsidian"); async function getReleaseNotesAfter(repoOwner, repoName, releaseTagName) { const response = await fetch( `https://api.github.com/repos/${repoOwner}/${repoName}/releases` @@ -16421,7 +17178,7 @@ function addExtraHashToHeadings(markdownText, numHashes = 1) { } return lines.join("\n"); } -var UpdateModal = class extends import_obsidian34.Modal { +var UpdateModal = class extends import_obsidian37.Modal { constructor(previousQAVersion) { super(app); this.previousVersion = previousQAVersion; @@ -16476,7 +17233,7 @@ ${andNow} ${addExtraHashToHeadings( releaseNotes )}`; - void import_obsidian34.MarkdownRenderer.renderMarkdown( + void import_obsidian37.MarkdownRenderer.renderMarkdown( markdownStr, contentDiv, app.vault.getRoot().path, @@ -16486,7 +17243,7 @@ ${addExtraHashToHeadings( }; // src/main.ts -var QuickAdd = class extends import_obsidian35.Plugin { +var QuickAdd = class extends import_obsidian38.Plugin { get api() { return QuickAddApi.GetApi(app, this, new ChoiceExecutor(app, this)); } diff --git a/.obsidian/plugins/quickadd/manifest.json b/.obsidian/plugins/quickadd/manifest.json index 868ac7fb..92c8df29 100644 --- a/.obsidian/plugins/quickadd/manifest.json +++ b/.obsidian/plugins/quickadd/manifest.json @@ -1,7 +1,7 @@ { "id": "quickadd", "name": "QuickAdd", - "version": "0.21.0", + "version": "0.23.0", "minAppVersion": "0.13.19", "description": "Quickly add new pages or content to your vault.", "author": "Christian B. B. Houmann", diff --git a/.obsidian/plugins/quickadd/styles.css b/.obsidian/plugins/quickadd/styles.css index 5b5c8e56..9a323848 100644 --- a/.obsidian/plugins/quickadd/styles.css +++ b/.obsidian/plugins/quickadd/styles.css @@ -154,6 +154,7 @@ justify-content: flex-end; align-content: center; margin-bottom: 1em; + gap: 4px; } .yesNoPromptButtonContainer { display: flex; diff --git a/.obsidian/workspace-mobile.json b/.obsidian/workspace-mobile.json index 85f48123..4bcd1cb5 100644 --- a/.obsidian/workspace-mobile.json +++ b/.obsidian/workspace-mobile.json @@ -16,55 +16,55 @@ } }, { - "id": "0bb037799af389e5", + "id": "740cf05f194f7dc2", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "01.02 Home/@Main Dashboard.md", - "mode": "preview", + "file": "04.03 Creative snippets/Working note - Project 1.md", + "mode": "source", "source": false } } }, { - "id": "740cf05f194f7dc2", + "id": "f8e12ac7f9e42e53", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "04.03 Creative snippets/Working note - Project 1.md", - "mode": "source", + "file": "03.04 Cinematheque/@Cinematheque.md", + "mode": "preview", "source": false } } }, { - "id": "f8e12ac7f9e42e53", + "id": "67fd24083505a69e", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "03.04 Cinematheque/@Cinematheque.md", + "file": "01.02 Home/@Shopping list.md", "mode": "preview", "source": false } } }, { - "id": "67fd24083505a69e", + "id": "bfd967afc5acbbe7", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "01.02 Home/@Shopping list.md", + "file": "01.02 Home/@Main Dashboard.md", "mode": "preview", "source": false } } }, { - "id": "bfd967afc5acbbe7", + "id": "ed92d0843874fb76", "type": "leaf", "state": { "type": "markdown", @@ -76,7 +76,7 @@ } } ], - "currentTab": 5 + "currentTab": 4 } ], "direction": "vertical" @@ -150,7 +150,7 @@ "state": { "type": "backlink", "state": { - "file": "01.07 Animals/@Sally.md", + "file": "01.02 Home/@Main Dashboard.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -167,7 +167,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "01.07 Animals/@Sally.md", + "file": "01.02 Home/@Main Dashboard.md", "linksCollapsed": false, "unlinkedCollapsed": false } @@ -198,7 +198,7 @@ } }, { - "id": "4eedcd8ce0374f39", + "id": "48cd0e29bda7ee76", "type": "leaf", "state": { "type": "DICE_ROLLER_VIEW", @@ -239,41 +239,43 @@ }, "active": "bfd967afc5acbbe7", "lastOpenFiles": [ - "01.07 Animals/2023-04-17 Health check.md", + "00.01 Admin/Calendars/2023-04-25.md", + "00.01 Admin/Calendars/2023-04-26.md", + "01.02 Home/@Main Dashboard.md", "01.07 Animals/@Sally.md", - "01.07 Animals/2023-04-19 First S&B.md", + "05.02 Networks/Server Alias.md", + "05.02 Networks/Server Tools.md", + "00.03 News/What Was Twitter, Anyway.md", + "00.03 News/My High-Flying Life as a Corporate Spy Who Lied His Way to the Top.md", + "00.03 News/“It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later.md", + "00.03 News/Dril Is Everyone. More Specifically, He’s a Guy Named Paul..md", + "00.03 News/Inside Rupert Murdoch’s Succession Drama.md", + "00.03 News/Behind the Scenes of Barack Obama’s Reading Lists.md", + "00.01 Admin/Test Canvas.canvas", + "00.01 Admin/Calendars/2023-04-24.md", + "00.02 Inbox/Le Temps gagné.md", + "03.03 Food & Wine/Big Shells With Spicy Lamb Sausage and Pistachios.md", + "01.02 Home/@Shopping list.md", + "00.01 Admin/Pictures/Sally/ima17322442484184474150.jpeg", + "00.01 Admin/Calendars/2023-04-23.md", + "01.04 MRCK/@@MRCK.md", + "00.03 News/The Spectacular Life of Octavia E. Butler.md", + "03.02 Travels/@Italy.md", + "03.02 Travels/Cannavacciuolo Bistrot.md", + "02.03 Zürich/@@Zürich.md", + "00.01 Admin/Calendars/2022-08-07.md", + "00.01 Admin/Calendars/2022-08-13.md", + "00.01 Admin/Calendars/2022-12-29.md", + "00.01 Admin/Calendars/2023-04-10.md", + "00.01 Admin/Pictures/Sally/IMG_2943.jpg", + "00.01 Admin/Pictures/Sally/IMG_2941.jpg", + "00.01 Admin/Pictures/Sally/IMG_2937.jpg", "00.01 Admin/Pictures/Sally/IMG_2931.jpg", "00.01 Admin/Pictures/Sally/IMG_2933.jpg", "00.01 Admin/Pictures/Sally/IMG_2934.jpg", - "01.07 Animals/2023-04-01 Purchase decision.md", - "01.07 Animals/2023-04-03 Vet check.md", - "01.07 Animals/2023-04-12 Departure from Mallorca.md", - "01.07 Animals/2023-04-17 Arrival in ZH.md", - "00.01 Admin/Calendars/2023-04-19.md", - "01.02 Home/@Main Dashboard.md", - "02.03 Zürich/Juan Bautista Bossio.md", - "02.03 Zürich/Polo Park Zürich.md", - "03.02 Travels/Francisco Podesta.md", - "00.01 Admin/Calendars/2023-04-17.md", - "00.01 Admin/Calendars/2023-04-18.md", - "03.03 Food & Wine/@Main dishes.md", - "03.03 Food & Wine/Lemon Chicken.md", - "01.02 Home/@Shopping list.md", - "02.02 Paris/@Restaurants Paris.md", - "02.02 Paris/L'Aube.md", - "02.02 Paris/Inavoué.md", - "00.03 News/The Fox News Trial Starts Tomorrow. Fox Is Already Losing..md", "00.01 Admin/Pictures/Sally/IMG_2921.jpg", "00.01 Admin/Pictures/Sally/IMG_2922.jpg", "00.01 Admin/Pictures/Sally/ima10864532422667985477.jpeg", - "00.01 Admin/Test Sheet 2.md", - "00.01 Admin/Calendars/2023-04-16.md", - "03.02 Travels/Mallorca.md", - "03.02 Travels/Es Figueral.md", - "00.01 Admin/Pictures/Sally/IMG_2633.jpg", - "00.01 Admin/Pictures/Sally/IMG_2635.jpg", - "00.01 Admin/Pictures/Sally/IMG_2634.jpg", - "00.01 Admin/Pictures/Sally/IMG_2632.jpg", "00.01 Admin/Pictures/Sally", "01.07 Animals", "00.01 Admin/Pictures/Gallery", diff --git a/00.01 Admin/Calendars/2022-08-07.md b/00.01 Admin/Calendars/2022-08-07.md index fc88f8a5..d452dbd0 100644 --- a/00.01 Admin/Calendars/2022-08-07.md +++ b/00.01 Admin/Calendars/2022-08-07.md @@ -98,7 +98,7 @@ This section does serve for quick memos.   -Loret ipsum +⛰: [[@@Zürich#Nature|Jungfrauhoch]]   diff --git a/00.01 Admin/Calendars/2022-12-29.md b/00.01 Admin/Calendars/2022-12-29.md index c3990908..9665d05c 100644 --- a/00.01 Admin/Calendars/2022-12-29.md +++ b/00.01 Admin/Calendars/2022-12-29.md @@ -94,7 +94,7 @@ This section does serve for quick memos.   -Loret ipsum +🏰: [[@@Zürich#Villages|Stein am Rhein]]   diff --git a/00.01 Admin/Calendars/2023-04-10.md b/00.01 Admin/Calendars/2023-04-10.md index 10e2eee7..76c3982f 100644 --- a/00.01 Admin/Calendars/2023-04-10.md +++ b/00.01 Admin/Calendars/2023-04-10.md @@ -114,7 +114,7 @@ This section does serve for quick memos.   -Rheinfall & Schaffhausen +🏰: [[@@Zürich#Nature|Rheinfall]] & [[@@Zürich#Cities|Schaffhausen]] 🍽: [[Lemon Chicken]] diff --git a/00.01 Admin/Calendars/2023-04-16.md b/00.01 Admin/Calendars/2023-04-16.md index 5cb276b3..72eecb22 100644 --- a/00.01 Admin/Calendars/2023-04-16.md +++ b/00.01 Admin/Calendars/2023-04-16.md @@ -114,6 +114,8 @@ This section does serve for quick memos.   +🏰: [[@@Zürich#Villages|Lenzburg]] + 🍽: [[Korean Barbecue-Style Meatballs]]   diff --git a/00.01 Admin/Calendars/2023-04-19.md b/00.01 Admin/Calendars/2023-04-19.md index 6a269e4a..1a76b935 100644 --- a/00.01 Admin/Calendars/2023-04-19.md +++ b/00.01 Admin/Calendars/2023-04-19.md @@ -16,13 +16,13 @@ Stress: 27.5 FrontHeadBar: 5 EarHeadBar: 35 BackHeadBar: 20 -Water: 2.25 +Water: 3.25 Coffee: 5 -Steps: +Steps: 10551 Weight: Ski: IceSkating: -Riding: +Riding: 1 Racket: Football: Swim: diff --git a/00.01 Admin/Calendars/2023-04-20.md b/00.01 Admin/Calendars/2023-04-20.md new file mode 100644 index 00000000..03dc3ca9 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-20.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-20 +Date: 2023-04-20 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 8.5 +Happiness: 75 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 3.66 +Coffee: 0 +Steps: 4713 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-19|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-21|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-20Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-20NSave + +  + +# 2023-04-20 + +  + +> [!summary]+ +> Daily note for 2023-04-20 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-20 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-20]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-21.md b/00.01 Admin/Calendars/2023-04-21.md new file mode 100644 index 00000000..1547c5f3 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-21.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-21 +Date: 2023-04-21 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 8 +Happiness: 75 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 3.83 +Coffee: 1 +Steps: 11224 +Weight: +Ski: +IceSkating: +Riding: 1 +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-20|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-22|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-21Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-21NSave + +  + +# 2023-04-21 + +  + +> [!summary]+ +> Daily note for 2023-04-21 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-21 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-21]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-22.md b/00.01 Admin/Calendars/2023-04-22.md new file mode 100644 index 00000000..b2aceefc --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-22.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-22 +Date: 2023-04-22 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 80 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 3.91 +Coffee: 0 +Steps: 8924 +Weight: +Ski: +IceSkating: +Riding: 1 +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-21|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-23|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-22Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-22NSave + +  + +# 2023-04-22 + +  + +> [!summary]+ +> Daily note for 2023-04-22 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-22 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-22]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-23.md b/00.01 Admin/Calendars/2023-04-23.md new file mode 100644 index 00000000..234c79eb --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-23.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-23 +Date: 2023-04-23 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 8 +Happiness: 80 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 2.2 +Coffee: 2 +Steps: 12053 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-22|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-24|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-23Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-23NSave + +  + +# 2023-04-23 + +  + +> [!summary]+ +> Daily note for 2023-04-23 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-23 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🏰: [[@@Zürich#Villages|Aarburg]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-23]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-24.md b/00.01 Admin/Calendars/2023-04-24.md new file mode 100644 index 00000000..e0fa8bb0 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-24.md @@ -0,0 +1,136 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-24 +Date: 2023-04-24 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7 +Happiness: 80 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 3.95 +Coffee: 4 +Steps: 20081 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-23|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-25|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-24Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-24NSave + +  + +# 2023-04-24 + +  + +> [!summary]+ +> Daily note for 2023-04-24 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-24 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🍽: [[Big Shells With Spicy Lamb Sausage and Pistachios]] + +📺: [[Succession (2018–)]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-24]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-25.md b/00.01 Admin/Calendars/2023-04-25.md new file mode 100644 index 00000000..544c5f81 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-25.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-25 +Date: 2023-04-25 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7 +Happiness: 75 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 2.75 +Coffee: 3 +Steps: 6802 +Weight: 94.8 +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-24|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-26|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-25Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-25NSave + +  + +# 2023-04-25 + +  + +> [!summary]+ +> Daily note for 2023-04-25 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-25 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +📺: [[Succession (2018–)]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-25]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-26.md b/00.01 Admin/Calendars/2023-04-26.md new file mode 100644 index 00000000..c2d1fc13 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-26.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-26 +Date: 2023-04-26 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 80 +Gratefulness: 90 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: +Coffee: +Steps: +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-25|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-27|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-26Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-26NSave + +  + +# 2023-04-26 + +  + +> [!summary]+ +> Daily note for 2023-04-26 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-26 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-26]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/Events/2023-04-21 Angers SCO - PSG (1-2).md b/00.01 Admin/Calendars/Events/2023-04-21 Angers SCO - PSG (1-2).md new file mode 100644 index 00000000..952296b4 --- /dev/null +++ b/00.01 Admin/Calendars/Events/2023-04-21 Angers SCO - PSG (1-2).md @@ -0,0 +1,14 @@ +--- + +title: Angers SCO - PSG (1-2) +allDay: false +startTime: 21:00 +endTime: 23:00 +date: 2023-04-21 +completed: null +CollapseMetaTable: true + +--- + +[[2023-04-21|Ce jour]], Angers SCO - [[Paris SG]]: 1-2 +Buteurs:: ⚽⚽ M’Bappé
⚽ Thioub (SCO) diff --git a/00.01 Admin/Pictures/Sally/IMG_2937.jpg b/00.01 Admin/Pictures/Sally/IMG_2937.jpg new file mode 100644 index 00000000..497cb771 Binary files /dev/null and b/00.01 Admin/Pictures/Sally/IMG_2937.jpg differ diff --git a/00.01 Admin/Pictures/Sally/IMG_2941.jpg b/00.01 Admin/Pictures/Sally/IMG_2941.jpg new file mode 100644 index 00000000..fa71c65d Binary files /dev/null and b/00.01 Admin/Pictures/Sally/IMG_2941.jpg differ diff --git a/00.01 Admin/Pictures/Sally/IMG_2943.jpg b/00.01 Admin/Pictures/Sally/IMG_2943.jpg new file mode 100644 index 00000000..9f9150e4 Binary files /dev/null and b/00.01 Admin/Pictures/Sally/IMG_2943.jpg differ diff --git a/00.01 Admin/Pictures/Sally/ima17322442484184474150.jpeg b/00.01 Admin/Pictures/Sally/ima17322442484184474150.jpeg new file mode 100644 index 00000000..7b6d6cef Binary files /dev/null and b/00.01 Admin/Pictures/Sally/ima17322442484184474150.jpeg differ diff --git a/00.01 Admin/Test Canvas.canvas b/00.01 Admin/Test Canvas.canvas new file mode 100644 index 00000000..4ab0f9a6 --- /dev/null +++ b/00.01 Admin/Test Canvas.canvas @@ -0,0 +1,15 @@ +{ + "nodes":[ + {"type":"text","text":"\n","id":"e4889634623a84ae","x":425,"y":720,"width":435,"height":200}, + {"type":"text","text":"```dataview\nTable without id \"![](\" + Source.Cover + \")\" as \"Cover\", file.link as \"Title\", Source.Author as \"Author\", Source.Published as \"Publication Date\", Source.Language as \"Language\" \nwhere Source.Type = \"Book\"\nwhere ReadingState = \"🟧\"\n```","id":"419b58907d6d0610","x":-40,"y":720,"width":405,"height":523}, + {"type":"text","text":"```dataview\ntable without id file.link as \"Title\", Tag as \"Themes\" from \"00.03 News\"\nwhere contains(Read, \"🟥\")\nlimit 6\n```","id":"21094e4af9cf9502","x":-40,"y":1320,"width":405,"height":640}, + {"type":"text","text":"``` tracker\nsearchType: frontmatter\nsearchTarget: Happiness, Steps, Ski, Riding, Racket, Football, Swim, IceSkating\nfolder: /00.01 Admin/Calendars\nmonth:\n mode: annotation\n startWeekOn: 'Mon'\n threshold: 75, 10000, 0, 0, 0, 0, 0, 0\n color: green\n headerMonthColor: orange\n dimNotInMonth: false\n annotation: ☀️,🏃,🎿,🏇,🎾,⚽,🏊🏼‍♂️, ⛸\n showAnnotationOfAllTargets: true\n```","id":"6096454290cfc990","x":920,"y":720,"width":435,"height":420}, + {"id":"f7b69542268fdc17","x":-40,"y":2000,"width":405,"height":400,"type":"text","text":"```dataview\nTable without id \"[[\" + file.name + \"|\" + replace(file.name, \"@\", \"\") + \"]]\" as \"Name\", Tag as \"Tag\" , \"Next review on \" + NextReviewDate as \"Date\", choice(NextReviewDate > date(today), \"☑️ On track\", choice(NextReviewDate < date(today), \"⚠️ Review overdue\", \"🚦 Review today\")) as \"Review\" from #✅\nWhere DocType = \"Task\"\nsort NextReviewDate asc\n```"}, + {"id":"e0714d5f838497bc","x":920,"y":1200,"width":435,"height":477,"type":"text","text":"### 😴 Sleep Pattern\n\n```tracker\nsearchType: frontmatter\nsearchTarget: Sleep\nfolder: /00.01 Admin/Calendars\nstartDate: 2022-01-22\nline:\n xAxisLabel: Date\n yAxisLabel: Hours slept\n lineColor: green\n showPoint: false\n xAxisColor: grey\n xAxisLabelColor: grey\n yAxisColor: grey\n yAxisLabelColor: grey\n```"}, + {"type":"text","text":"```dataviewjs\nconst today = DateTime.now()\nconst endOfYear = {\n year: today.year,\n month: 12,\n day: 31\n}\n\nconst lifespan = { year: 85 } \nconst birthday = DateTime.fromObject({\n year: 1984,\n month: 7,\n day: 7\n});\nconst deathday = birthday.plus(lifespan)\n\nfunction progress(type) {\n let value;\n \n switch(type) {\n case \"lifespan\": \n value = (today.year - birthday.year) / lifespan.year * 100;\n break;\n case \"year\":\n value = today.month / 12 * 100\n break;\n case \"month\":\n value = today.day / today.daysInMonth * 100\n break;\n case \"day\":\n value = today.hour / 24 * 100\n break;\n }\n return ` | ${parseInt(value)} %`\n}\n\n\ndv.span(`\n| | | |\n| --- | --- |:---:|\n| **Life** | ${progress(\"lifespan\")}\n| | |\n| **Year** | ${progress(\"year\")}\n| **Month**| ${progress(\"month\")}\n| **Day**| ${progress(\"day\")}\n`)\n```\n","id":"7e80f44c67f7a9e8","x":425,"y":940,"width":435,"height":200}, + {"id":"6dd9182a1b72702a","x":425,"y":1200,"width":435,"height":477,"type":"text","text":"### 👣 Daily steps\n\n``` tracker\nsearchType: frontmatter\nsearchTarget: Steps\nfolder: /00.01 Admin/Calendars\nstartDate: 2022-01-22\nendDate:\nline:\n xAxisLabel: Date\n yAxisLabel: \"# of steps\"\n lineColor: cyan\n showPoint: false\n xAxisColor: grey\n xAxisLabelColor: grey\n yAxisColor: grey\n yAxisLabelColor: grey\n```"}, + {"id":"3eacafacaea81472","x":425,"y":1720,"width":435,"height":477,"type":"text","text":"### ⚖️ Weight\n\n``` tracker\nsearchType: frontmatter\nsearchTarget: Weight\nfolder: /00.01 Admin/Calendars\nstartDate: 2023-01-10\nignoreZeroValue: true\nline:\n xAxisLabel: Date\n yAxisLabel: Weight\n lineColor: red\n showPoint: false\n xAxisColor: grey\n xAxisLabelColor: grey\n xAxisTickInterval: 1w\n yAxisColor: grey\n yAxisLabelColor: grey\n fillGap: true\n```"}, + {"id":"469332051f4aac8d","x":920,"y":1720,"width":435,"height":477,"type":"text","text":"### 🚰 Water Consumption\n\n``` tracker\nsearchType: frontmatter\nsearchTarget: Water\nfolder: /00.01 Admin/Calendars\nstartDate: 2022-01-22\nendDate:\nline:\n xAxisLabel: Date\n yAxisLabel: Amount of soft drink (liter)\n lineColor: blue\n showPoint: false\n xAxisColor: grey\n xAxisLabelColor: grey\n yAxisColor: grey\n yAxisLabelColor: grey\n```"} + ], + "edges":[] +} \ No newline at end of file diff --git a/00.03 News/Behind the Scenes of Barack Obama’s Reading Lists.md b/00.03 News/Behind the Scenes of Barack Obama’s Reading Lists.md index 6e752d4d..431dfbe6 100644 --- a/00.03 News/Behind the Scenes of Barack Obama’s Reading Lists.md +++ b/00.03 News/Behind the Scenes of Barack Obama’s Reading Lists.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-25]] --- diff --git a/00.03 News/Dril Is Everyone. More Specifically, He’s a Guy Named Paul..md b/00.03 News/Dril Is Everyone. More Specifically, He’s a Guy Named Paul..md new file mode 100644 index 00000000..f1e64d93 --- /dev/null +++ b/00.03 News/Dril Is Everyone. More Specifically, He’s a Guy Named Paul..md @@ -0,0 +1,161 @@ +--- + +Tag: ["🤵🏻", "🐥", "🌐", "👤"] +Date: 2023-04-23 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-23 +Link: https://www.theringer.com/tech/2023/4/12/23673003/dril-twitter-interview-profile-identity +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: [[2023-04-25]] + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-DrilIsEveryoneMoreSpecificallyHesNamedPaulNSave + +  + +# Dril Is Everyone. More Specifically, He’s a Guy Named Paul. + +*“Man is a double being and can take, now the god’s-eye view of things, now the brute’s eye view.” —Aldous Huxley,* Ends and Means*, 1937* + +*“the wise man bowed his head solemnly and spoke: ‘theres actually zero difference between good & bad things. you imbecile. you fucking moron’” —*[*Dril, Twitter, 2014*](https://twitter.com/dril/status/473265809079693312?lang=en) + +Dril is a real person, or so I had been told. Sitting in the House of Pies in the Los Feliz neighborhood of Los Angeles, I was waiting for him to join me in a booth—but I didn’t know who was actually going to show up. + +It was the quiet midafternoon hours at the diner, which is a relic of when the area was less upscale, and it still partially attracts an off-key clientele of misfits and bozos, some of whom are alone and in no hurry to leave. (As I sat, an older man in oversized overalls walked by carrying a seat cushion; it was unclear whether he worked there.) This venue was the most readily available approximation of Dril’s world that I could think of. + +While I waited, I pulled up Dril’s Twitter account and looked at [a recent post](https://twitter.com/dril/status/1631067010355404801): “The fact is,” he wrote, “people arent doing a good job wiping their ass these days. And its attracting all manner of stray dogs and coyotes to our towns.” The likes were ticking up and up in real time as they moved toward their eventual zenith of almost 17,000. By Dril standards, this wasn’t even a particularly popular—or deranged—post. + +With 1.7 million highly engaged followers, Dril is one of the more powerful Twitter users and, by default, one of the more powerful figures on the internet. Active since 2008, the Dril account—simultaneously known by the profile name “Wint”—with its grainy Jack Nicholson avatar, has been responsible for countless viral posts, just as beloved for the vivid scenes they induce as for the baffling grammatical and spelling errors they contain. Many of his tweets have become part of the permanent online lexicon: “[‘im not owned! im not owned!!’](https://twitter.com/dril/status/134787490526658561), i continue to insist as i slowly shrink and transform into a corn cob”; “[issuing correction on a previous post of mine](https://twitter.com/dril/status/831805955402776576?lang=en), regarding the terror group ISIL. you do not, under any circumstances, ‘gotta hand it to them’”; “[i am selling six beautfiul, extremely ill, white horses](https://twitter.com/dril/status/504134967946141697?lang=en). they no longer recognize me as their father, and are the Burden of my life.” + +To most people, he is nothing; show the unaffiliated some of his posts, and they will likely just generate confusion and possibly anguish. (“Uh, so, I think I’ll stick with gardening. Where bull poop helps good things grow, and the tweets come from birds, not nitwits,” read [one](https://www.washingtonpost.com/technology/2022/11/22/dril-musk-twitter-future/?commentID=424b0bae-efbd-4824-bb52-d5ea64ed85b5) of many upset people in the comment section of a recent [*Washington Post* feature](https://www.washingtonpost.com/technology/2022/11/22/dril-musk-twitter-future/) about Dril, inadvertently adopting their own Dril-esque cadence in the process.) But to a large sect of the Very Online, he is king—the undisputed poet laureate of shitposting, the architect of a satire so effective that it has become impossible to tell when Dril stopped mocking the way people speak online and when we, instead, started speaking like Dril online. + +For almost 10 years, he was entirely anonymous. Like a decent number of the people in the so-called [“Weird Twitter” scene](https://www.buzzfeednews.com/article/jwherrman/weird-twitter-the-oral-history) that Dril is still vaguely a part of, he doesn’t put his real name on the account—but as time has gone on and his popularity has grown, it’s become nothing short of miraculous that he’s kept up the mystery. He’s a [pyramid](https://twitter.com/dril/status/217087278013616128)\-[obsessed](https://twitter.com/dril/status/1167921495659577346) phantom. He’s [banky](https://twitter.com/dril/status/13408516505075712?lang=en). Still, over the years, some of his digital curtain has begun to part—largely spurred by his [being doxxed](https://www.thedailybeast.com/who-on-earth-would-dox-dril-the-only-good-anonymous-person-on-the-internet) in 2017, when his identity was revealed to supposedly be that of a man named Paul. + +Around the same time, Dril started a [Patreon](https://www.patreon.com/dril), released a book, *Dril Official* [*“Mr. Ten Years”*](https://www.amazon.com/Dril-Official-Years-Anniversary-Collection/dp/1724941682/ref=sr_1_5?crid=251ST9WWDUWP5&keywords=dril&qid=1680303126&s=books&sprefix=dri%2Cstripbooks%2C158&sr=1-5) *Anniversary Collection*, and had an Adult Swim television show, *TruthPoint*—a surrealist Infowars parody in which he manifested behind a cheap old man mask and bantered with self-professed [“manic pixie stream boy”](https://youtu.be/7t948ZQfH1g?t=140) cohost Derek Estevez-Olsen. Dril also began doing an interview here and there, but never anything substantial, and always in character. I reached out to him via email, and when he replied, the name attached to the account was “paul d.” But I still wasn’t totally sure that he wouldn’t walk into House of Pies with his mask on, throw a plate against a wall, and then walk out. + +“I’m Paul,” he said, once he found me and after I began by asking whom, exactly, I could say I was speaking to. + +Paul Dochney, who is 35, does not, in fact, look like a mutant Jack Nicholson. He has soft features and a gentle disposition and looks something like a young Eugene Mirman. It’s difficult to say what I expected to find sitting across from me, but it wasn’t this. Looking at him, you’d never presume that this was the person who made [candle purchasing a matter of financial insecurity](https://twitter.com/dril/status/384408932061417472?lang=en). + +He opted to stick with water—not a terrible decision at the House of Pies, but also, I worried, a choice that theoretically allowed him a quick exit at any point. For a while, I got the sense that he might have been deciding how much to reveal to me in real time, based on how the conversation went. But one thing he was clear about from the beginning: It was all right to end this game of living in the digital shadows. + +“I mean, my name is already out there,” he said, acknowledging the fact that, after the doxxing, he had at separate points confirmed his name on both [Twitter](https://twitter.com/dril/status/1028250494580404226?lang=en) and [Reddit](https://old.reddit.com/r/IAmA/comments/fuc6ql/i_am_dril_ceo_of_the_dril_account_on_twittercom/fmddeh3/). “It’s in my Wikipedia article. Maybe people need to grow up. Just accept that I’m not like Santa Claus. I’m not a magic elf who posts.” + +In some sense, anonymity has served a creative purpose. “Practically, it’s a good tool,” Estevez-Olsen told me later in a phone interview, “because when you make a post, you don’t want to be like, ‘From Paul Dochney, [I fuck flags](https://twitter.com/dril/status/171450835388203008?lang=en)’ or whatever. You want to have some distance from it.” (He would know: “Estevez-Olsen” is itself a *TruthPoint* stage name that he asked me to use for reasons of privacy.) + +But the secrecy has also lingered because of the types of personalities Dril naturally attracts to his orbit. “Most people are normal,” Dochney explained. “But there’s, like, three or four weirdos who just ruin it for everyone.” Jon Hendren, a fellow titan of Weird Twitter who is known by his subtle handle, @fart, told me that he had seen some disturbing messages people had sent Dochney in the past—that he wasn’t being paranoid or dramatic. “It’s gotta be kind of surreal,” Hendren said. “And it’s got to be kind of difficult to live with.” + +Dril may be a phantom, but Dochney, like the rest of us, did come from somewhere. He was raised in New Jersey in a working-class family, he explained to me; his father worked as a FedEx manager “for the longest time,” and his mother was a homemaker who also chased down side jobs. “I was very into the internet from a very early age,” Dochney said, nursing his cup of water. “I was kind of in the background most of the time, just daydreaming about video games and stuff like that. I mean, I had a few friends. I wasn’t a total outcast or a weirdo. But I was on the quiet side.” + +After dropping out after his first attempt at college, Dochney eventually gave it another shot at Wilmington University in Delaware—“the cheapest college I could find that would still give me a valid bachelor’s degree,” he said. There, he studied media design: “Like, web design and HTML and the Adobe Suite and all that stuff,” he said. “Graphics.” + +In essence, the character of Dril was born on Something Awful, an outsider comedy website that had particularly popular message boards and file-sharing forums in the 2000s. It was where many—if not most—of the essential Weird Twitter personalities came from, and where some, like Hendren, were (poorly) paid moderators or contributors. “Effort was looked down upon for a long time,” said Hendren, who added that he apparently once banned Dochney from one of the forums (although he is friendly with him these days). “And so if you’re just naturally funny, and if you’re just naturally saying good things, then you did fine there.” + +Cynicism and brashness defined the Something Awful aesthetic. Its founder, Richard Kyanka, explained [to *Vice*](https://www.vice.com/en/article/nzg4yw/fuck-you-and-die-an-oral-history-of-something-awful) in 2017 that part of his goal with the site was to produce “parodies of wonks who were saying the internet was the future without saying, ‘Well there could be a possible downside to the internet.’” He went on, “Everybody was talking about how the internet was going to revolutionize everything and everything was going to be great, but nobody ever talked about how shitty the internet could also be.” + +Dochney was a regular in the infamous Fuck You and Die forum, and he said that he mostly posted artwork. (“They had this, like, flag system,” he remembered, “where you could post these little images of, like, cartoons or, like, asses that are shitting.”) At that time, Dochney went by “gigantic drill” on the site, a name he came up with when he was still a teenager. “If there was some inspiration behind it, I’ve forgotten it by now,” he said. + +About two years after Twitter was founded in 2006, a friend told him he should sign up and join the growing group of Something Awful affiliates who were taking advantage of what was then a novelty: a mobile-friendly way to post. The handle “@drill” with two *l*’s was taken, so “@dril” it was. Dochney’s first post, which has since gone on to have an inexplicable life of its own, was partially a response to a friend who had told him to sign up: [“no.”](https://twitter.com/dril/status/922321981) + +“This is in 2008,” Dochney said, “when it was brand new, and everyone was just posting bullshit like, ‘Oh, this is what I had for lunch.’ It was just, like, tech guys posting inane details about their lives. I posted ‘no’ because I didn’t care for it at the time. I still really don’t care for it.” + +Dochney posts often, and with seeming abandon. “[For the Pleasure of the Fans](https://www.amazon.com/gp/product/B0BPGQ6YVQ?ref_=dbs_m_mng_rwt_calw_tpbk_0&storeType=ebooks&qid=1680306759&sr=1-1),” he recently released [four versions](https://www.amazon.com/dp/B0BPT7XJN2?binding=paperback&searchxofy=true&ref_=dbs_s_bs_series_rwt_tpbk&qid=1680306759&sr=1-1) of a book compiling 10,000 of his “finest” posts, the equivalent of roughly two posts per day during the 14 years of time covered. (The font in these books is beyond minuscule, and getting past the line spacing to actually read the tweets is a high-wire act; the format is its own joke.) “I just post whatever bullshit I’m thinking,” Dochney explained of the Dril Process. “I kind of have to get into, like, the writing mood. But there’s no ritual or anything. Usually when I’m driving or I’m in the shower, I’ll come up with some sort of idea.” + +The character of Dril is fluid, but taken as a whole, the blurry image starts to come into focus: It’s that of an easily agitated, overly confident, wildly crass, IBS-ridden middle-aged man thrashing away on a computer—probably a PC. He speaks in outlandish non sequiturs and engages with brands with unreasonable love and hate in equal measure. He is the dark, democratic promise of the internet—that anyone can use it to broadcast their opinions at any time—fulfilled. “I just go back to how specific and unique it is,” comedian and actor David Cross told me. “There’s nobody quite like him, and it perfectly encapsulates that Twitter dialogue.” + +When I asked Dochney whether the type of person he’s satirizing is more common now or merely more visible, he said, “I think there’s just so many of those minds out there that we can only see because of the internet. In the 1920s or whatever, there were just as many dumb, crazy people who only met, like, four people in their entire life, and just died in obscurity.” He noted that he appreciates that the site “records this interesting snapshot of all the insane people who exist in the background and just post.” It was one of the only moments when he had anything remotely complimentary to say about Twitter. + +Since Dochney moved to L.A. a few years ago, which he did to hopefully “get a job *entertaining* in some capacity,” he has survived mainly on his various Dril-based incomes. He told me he’s making a decent living but clarified that he probably makes “as much money as a Kmart manager or something.” (His Patreon, which is now focused on funding the development of a video game and is available in “disgusting” and “Fucked” tiers, is currently taking in $1,468 a month from roughly 500 subscribers.) + +There is clearly a market for what Dochney does, but tapping into it hasn’t been the easiest process. He recalled talking to a publisher about potentially putting out his book *The Get Rich and Become God Method*, which is a textbook-sized survey of his art and humor and also quite literally a step-by-step guide to getting rich and becoming God. “I sent them the PDF,” he said, “and I did not get a response from them. I can imagine that, like, they turned to Page 11 and saw a Ku Klux Klan member with his blue penis sticking out, and just said, ‘No, thank you. I can’t market this for the life of me.’” (The page being referenced is titled “Thoughts of My Son,” and it features said blue, seminude Ku Klux Klan member being defended by his father: “I ask that you PLEASE look BEYOND his Crude Visage before you lay Judgement upon this Man,” the father pleads. “AND read some of his Posts.”) Like his other books, *Method* was eventually [self-released](https://www.amazon.com/Rich-Become-Method-DRIL-collection/dp/B09JJCGM6Y/ref=sr_1_6?crid=251ST9WWDUWP5&keywords=dril&qid=1680308564&s=books&sprefix=dri%2Cstripbooks%2C158&sr=1-6). + +The arrival of *TruthPoint* on Adult Swim was an unexpected moment in Dochney’s career, not just because it marked his transition from writer to performer—something he said he had never dabbled in before—but also because of the corporate legitimacy of it. Still, *TruthPoint* was one of the more bizarre programs I have ever watched in any capacity, let alone on a channel owned by Warner Bros. (The second episode, which is almost an hour long, [at one point](https://youtu.be/ONBj_5PHzoE?t=2544) features Estevez-Olsen reading a passage from the novelization of the 2001 movie *Lara Croft: Tomb Raider*, which is itself an adaptation of the video game franchise of the same name; Dril’s review of the book was “This is a thriller from beginning to end, folks.”) The show had promise, but the timing was bad; the pandemic forced them to do episodes over video calls, and new episodes stopped airing in fall 2020. + +Dochney and Estevez-Olsen are working to keep the *TruthPoint* enterprise alive—ideally by rebooting it in a more sketch-oriented format, they said. (Estevez-Olsen cited Chris Morris’s ’90s news parody show, [*Brass Eye*](https://www.youtube.com/watch?v=1Pr8xnNi7OM), as a partial model.) But part of the difficulty is communicating just what the show is—who, exactly, they are. + +“We met with this agent from a big \[agency\]. We were showing him the pitch decks we had put together that we worked hard on,” Estevez-Olsen said. “He was just like, ‘Yeah, I don’t know if I can do anything for you. Because it’s almost like you’re saying you’re not comedians, really, you’re not writers—we can’t, like, put you on a sitcom as a writing team.’ I think in that moment, I felt pretty stupid. I felt like an outsider artist, and we’re, like, dragging in our misshapen barrels that we were painting in the backyard and being like, ‘You should put this in a museum.’” + +In the diner, I asked Dochney whether he thought of himself as a writer, and he said, “I kind of consider myself a lot of things. I do art and writing. But I’d rather be called a writer than a social media influencer or something like that. That is vile to me.” + +Defining and understanding how social media works in the artistic realm is still a new field. It is also one that will likely be far more important in the grand scheme of things than many would like to imagine. “This is the world young artists and art students live in,” Aaron Betsky, a writer and critic specializing in art and design, noted in a 2014 [*New Yorker* feature](https://www.newyorker.com/magazine/2014/02/10/man-and-machine-susan-orlean) about Horse\_ebooks, a bot-imitating piece of Twitter art. “The way we represent our world is more and more digitally based and networked. If art is in any way reflecting our world, it will have to adopt and adapt these techniques and technologies.” + +Mark Sample, professor and chair of digital studies at Davidson College, told me that he believes Dril might be understood within the developing field of netprov (as in internet improvisation). Not altogether unrelated to electronic literature, or net art as a whole, netprov is, Sample explained, “the idea of using a social media platform as a kind of improvisational space in which the people on the other side aren’t really sure, are they seeing something that’s really sincere and earnest, or are they watching a performance?” I started to imagine Dril as the Ornette Coleman of the internet, but Sample said he likens it in some way to a living statue street performer “who’s just *always* doing it, whether there’s even a crowd around or not.” + +Darcie Wilder, writer of the tweet-inspired 2017 novel *literally show me a healthy person*, sees something that’s similar to performance art: “It’s not just the jokes he’s doing—it’s the performance and the actual whole thing,” she told me. + +Perhaps no artist has done more to push forward the conversation about how social media can exist in the artistic realm than Jacob Bakkila, who ran Horse\_ebooks as part of a larger artistic collaboration with Thomas Bender. The Horse\_ebooks project was deliberately ended in 2013—“No one wants to work on a painting forever,” Bakkila said at the time—and Bakkila, who now works in advertising in addition to his ongoing work as a multimedia artist, spoke thoughtfully to me over video call about the promise of art in the digital landscape. But of anyone I talked to, he was the most concerned about the risk of overintellectualizing Dril’s act—of being the type of person who, in his analogy, would study photosynthesis but forget to watch “the leaves change color.” + +“He’s a poster,” Bakkila said. “And I think that there’s a great beauty to that because it’s also the native language of the internet. … It’s what the internet is designed to do, is to let you post on it. And it goes deeper—in that sense, it’s more profound than comedy, although obviously he’s very funny. And it’s more profound than art, although obviously he’s artistic. But I think first and foremost, he’s a poster. And he’s the best one we have.” + +Often, when people talk about Dril, they use him as a vehicle to talk about Twitter itself—its initial promise, its inevitable demise. The approach is something like using Andy Kaufman to talk about *Saturday Night Live*; it’s not wrong, exactly, but it is a missed opportunity for something more specific, and more interesting, at any rate. There is plenty to learn about Twitter through Dril, but less to learn about Dril through Twitter. + +Dochney described his popularity on the site as “incidental” and his association with it more as a millstone than a gift. “I do find a lot of aspects of Twitter very disgusting,” he said. “It would not be my first choice of websites to get popular on, but that’s just the way it goes. And I got to work with that.” (Twitter, for what it’s worth, seems to value Dril’s presence, as he is [reportedly](https://www.theverge.com/2023/3/28/23659842/twitter-boost-elon-musk-dril-mrbeast-algorithm-accounts) one of about 35 elite users, along with the likes of LeBron James and Alexandria Ocasio-Cortez, currently being “boosted” on the site.) + +Posting, in its various forms and locations, is a skill, and Dochney knows how to recognize it as well as anybody. Donald Trump, he noted, is “a very good poster”—a skill that is likely bolstered by the fact that he’s also “legitimately probably nuts, a little bit.” (“Sometimes,” Dochney did add, however, “being mentally ill makes you a *worse* poster.”) As for memes, one of the primary forms of posting, Dochney doesn’t “respect” them: “I think memes are just jokes you stole, basically,” he said. “I like making shit.” + +To my eye, Dochney hasn’t lost a step in his second decade of posting as Dril, and more than that, some of his best posts have [been](https://twitter.com/dril/status/1613611545875054592?lang=en) [in](https://twitter.com/dril/status/1551754703632887808?s=20&t=2UktvnaJh2IDNGxUZh6hug) [the](https://twitter.com/dril/status/1628999985445613568?s=21&t=ZbcX4APnXt9vnLt_8L1Q3g) [last](https://twitter.com/dril/status/1625907835623337987?s=21&t=6_HhQaydaKAMVeLGXkWXag) [year](https://twitter.com/dril/status/1638350541440024576?s=12&t=xxsywDoqJRgpVg2pnmf4zw). But the criticisms and half-serious conspiracy theories are constant. One that Dochney is particularly irritated by is the “you didn’t *used* to be topical” line: “I was always a product of what was going on around me,” he said, exasperated. “So it’s kind of weird when people start accusing me of, like, ‘Oh, you sold your account to Waffle House, and now you’re posting differently,’ or some bullshit like that.” If anything, Dochney added, he believes he’s been “doing the same shtick almost to a fault, really.” + +When *TruthPoint* was first announced in 2019, there was enough of a cynical reaction from some of Dril’s followers that Darcie Wilder addressed it in [an essay](https://theoutline.com/post/8108/dril-adult-swim-show-selling-out?zd=2&zi=xbxqc2ng) for *The Outline* (a platform that, notably, is now dead): “Twitter and Hollywood are obviously vastly different ecosystems,” she wrote, “but as the time we spend staring into a screen becomes split between traditional entertainment products and crowdsourced online content presented by tech platforms, their value becomes intertwined. But only one of these industries pays its writers.” + +“Neither one of us really had in our heart of hearts,” Estevez-Olsen told me, “that we were going to write 140-character, pithy, little, funny, cute things for the rest of our lives. Paul wanted to—like me—write books, make TV shows, do whatever you can to build a world and express all of that.” The way Dochney put it, posting, for him, is “kind of like going to the bathroom, really—just putting something out there.” He seemed a little worn out by the idea of being an old man firing up Twitter. “Posting is not something you want to do forever,” he said. + +Contrary to the nature of his comedy—pitch black, often finding a deceptively amusing way to channel some of the most disturbing inclinations that society has—Dochney does not identify as a nihilistic person. The darkness of the internet, he believes, is an illusion that comes from when “you’re on Twitter, and you’re just exposed to the worst of it, mainlined 24/7,” he said. “I don’t want to be like one of those guys, like, ‘You know, war is not so bad if you look at the positive stuff.’ But it’s not 100 percent hopeless, I’d say.” + +This surprised me. If there’s one accent in the posting language that could be arguably sourced to Dril, it’s the disaffected irony so many of us have adopted online—the way we seem increasingly allergic to earnestness and blanketed in a wisecracking despair. I told him his answer was pretty starkly different from the image I had of Dril in my head: sweating, drooling, grinning maniacally, on the verge of a heart attack. + +“If I wasn’t relatively happy with my life, maybe I could have been that guy,” he said. “Maybe if my posts never took off and I was still working in a mail room at the age of almost 40, I would be just as angry, and posting about my ass and balls with all sincerity.” + +In January, I went to see *TruthPoint Cataclysm*, a live reincarnation of the *TruthPoint* show, which functioned as the first substantial time that Dochney had made a public appearance as Dril. The performance was at the Elysian Theater in the freeway-adjacent stretch of L.A.’s Frogtown, and tickets for the 135-seat venue were sold out. Inside, however, there were some empty seats, mostly in the front, which was perhaps a sign of an instinctive avoidance of a splash zone that did, actually, become a factor later on. + +Presented in 12D—“10 times more than a normal 2D experience,” according to Estevez-Olsen—the show’s topic was gambling, with Dril and Estevez-Olsen engaging in a variety of salient debates about best practices when betting money, whether in the casino or with crypto or what have you. Toward the end of the show, there was a raffle to give away a copy of a small book that Dochney had supposedly written called *How to Cheat at Casino Games by Being a Bitch.* In a fit of fury, he tore one of the copies of this book up, and Estevez-Olsen threw the pages into the audience. + +On my way out, I made off with a few torn sheets, which I was later amused to find consisted of semi-coherent chapters—filled with actual jokes. (“If you want to make any decent money at the track, there’s one thing you must remember,” the section on horse racing reads. “You’ve got to get ‘WET’, which stands for ‘Win Every Time.’”) Dochney had sat down and written all this out and then had it printed, presumably just for the bit—or for his own personal satisfaction, or both. + +The whole event—from the in-person nature of it to the physical prop book—felt very distant from anything I might experience while aimlessly scrolling around on my phone. Still, despite his [live comedy sets](https://www.instagram.com/p/CqYcsmfJgRA/?utm_source=ig_web_copy_link) with Estevez-Olsen and [his gigs hosting movie screenings](https://twitter.com/dril/status/1641284631206166529), Twitter remains at the forefront of everything when we talk about Dril. And it most likely will until the platform is out of our lives. + +“I think it’s getting further away from, like, whatever cool thing it was,” said Wilder, who told me she used to think Twitter was its own art but these days finds that belief “embarrassing.” “Now it’s obviously just, like, data mining and advertising. … Dril is also very different from that. Like, those things don’t really apply to his feed. It’s really weird that he’s still so successful.” + +Late last year, as Twitter users worried about the future of the platform amid [new CEO Elon Musk’s takeover](https://www.theringer.com/tech/2022/11/22/23471923/twitter-elon-musk-layoffs-changes-future), the thought of losing Dril prompted at least one user to [catalog every Dril tweet](https://twitter.com/nickfarruggia/status/1594121736987250688) like he was grabbing the family pets and photo albums from a burning home. But Dochney wondered whether Twitter’s demise could potentially force him to “grow in ways I never thought possible.” He also considered the notion that it might destroy his career entirely. Either way, he decided, “You gotta commend Elon for doing everything in his power to wipe this nuisance website off the face of the earth.” (Add swapping [Twitter’s blue bird logo for Doge](https://variety.com/2023/digital/news/elon-musk-twitter-logo-doge-dogecoin-meme-1235572343/) last week to Musk’s long list of screwups.) + +Regardless of Twitter’s fate, one development that’s guaranteed in the immediate future is that relinquishing pure anonymity will change things for Dochney, at least to some degree. If his fans were replying with [“don’t do this”](https://twitter.com/TygerbugGarrett/status/1028265972619042816) and [“this account is ruined now”](https://twitter.com/Canama139/status/1028303795913220096) when he posted his name a few years ago, how they’d respond to a gesture far more forthright remains to be seen. + +“They want it to be, like, an insane guy who lives in the woods or something,” said Estevez-Olsen. “Or they want it to be just a blurry man. But yeah, it’s a guy named Paul. He’s, like, fairly normal. … I feel like if people find out about who he is in real life, and then they suddenly don’t like the stuff anymore, that’s just silly. If you like what he’s written, you like it, and that’s all there is to it.” + +David Cross brought up when Bobcat Goldthwait decided to stop performing in [his outlandish voice](https://www.youtube.com/watch?v=O0qAfWWQJ5w), even though it was what the comedian was initially known for. “At some point, he was like, ‘Fuck it, I don’t want to do this anymore,’” Cross said. “I mean, it’s Bob Dylan going electric.” + +One way I’ve processed the idea of Dochney’s story undergoing a sea change is to remind myself that he is, by nature, a troll. And more than that, he’s a troll who trolls trolls. The most disappointing thing Dochney could become is predictable, even in something as outlandish as perpetual namelessness. I’m glad he didn’t walk into the House of Pies and throw a plate against the wall. But part of the fun is that I thought there was a chance he might do it anyway. + +Before meeting up with Dochney, I wrote down a list of artists and art that I thought he might have some lineage from, and late in our conversation, I began rattling them off to see whether he felt any attachment. I wanted to attempt to understand Dochney within the context of the history of comedy. + +*Looney Tunes*? “I was more of a *Ren & Stimpy* child,” he said. Kurt Vonnegut? “Pretty good.” Jack Handey? “I really liked that.” *A Confederacy of Dunces*? “I thought it was funny. I thought it was kind of ahead of its time. … \[Ignatius J. Reilly\] was, like, the first internet nerd before the internet even existed.” Marcel Duchamp—the, uh, [“urinal guy,”](https://www.tate.org.uk/art/artworks/duchamp-fountain-t07573) I stammered. “I don’t know if I can respect a man who you refer to as ‘the urinal guy,’” he replied. + +Dochney described himself as being “overexposed” to comedy these days and didn’t appear to be too enamored of the mainstream comedy scene in general. But there was one moment when he noticeably brightened up about the subject of comedy he was a fan of—and that was when he was talking about posts that he thought were categorically funnier than his. The Dril page often retweets arcane mutterings from accounts with essentially no followers, and Dochney was explaining one way he sometimes navigates Twitter to locate these lonely crevices of social media: Think of something, and spell it hilariously wrong. + +The other day, he said, he took “Willy Wonka” and spelled it “Welly Wonka,” and he found a bunch of posts from “the dumbest people ever” talking about the characters from Roald Dahl’s books. He also found what appeared to be an elementary school classroom that was “taking place on Twitter for some reason.” The class was discussing Wonka, and the teacher had prompted the students to choose three words that they would use to describe the Oompa Loompas in some way. “The responses were some of the funniest shit I’ve probably ever seen,” he said. “There was one that was, like, ‘small, clown, smart.’ The other one was, like, ‘short, dumb, unfunny.’” + +I told him that it felt like a demonstration of the fact that, ultimately, there’s nobody funnier than someone who’s not trying to be in the first place. + +“It’s very sad for all these professional comedians that there’s something there that they can never grasp,” he said. “And I guess me, too, in a way.” + +[*Nate Rogers*](https://twitter.com/nate_rgrs) *is a writer in Los Angeles. His writing has appeared in* The New York Times*,* Los Angeles Times*,* GQ*, and elsewhere.* + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/Inside Rupert Murdoch’s Succession Drama.md b/00.03 News/Inside Rupert Murdoch’s Succession Drama.md index 495b4d74..a6f762dd 100644 --- a/00.03 News/Inside Rupert Murdoch’s Succession Drama.md +++ b/00.03 News/Inside Rupert Murdoch’s Succession Drama.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-25]] --- @@ -68,7 +68,7 @@ It’s ironic that Murdoch’s fortunes would become entwined with Trump’s, be Trump more than delivered. One source with direct knowledge of their conversations told me Murdoch lobbied Trump to punish Facebook and Google for siphoning his newspapers’ advertising revenue. In 2019, Trump’s Justice Department launched an antitrust investigation of Google. In 2021, Google settled and struck a lucrative content-sharing deal with Murdoch. The source also said Murdoch pushed Trump to open up land for fracking to boost the value of Murdoch’s fossil fuel investments. The Trump administration released nearly 13 million acres of federally controlled land to fracking companies. Murdoch, who sources say has become more pro-life in recent years, encouraged Trump to appoint judges who would overturn *Roe v. Wade.* “Rupert wanted Trump’s Supreme Court justices in so they could make abortion illegal,” a source who spoke to Murdoch said. Murdoch’s alliance with Trump made Murdoch more powerful than ever but carried a personal cost. -F**or many American** families during the Trump years, politics became a third rail. And so it was for the Murdochs. Among Murdoch’s adult children, Elisabeth and James tilted #resistance, whereas Lachlan was hard-core MAGA. (The eldest Murdoch son was particularly close with Fox News host Tucker Carlson, sources said.) Meanwhile, Murdoch’s new wife despised Trump—and let Murdoch know it. “During dinners we had with Jerry and Rupert, Jerry wouldn’t hold back,” Cashin, Hall’s friend, said. According to a source, Murdoch wanted to buy a house in Florida to be closer to Mar-a-Lago, but Hall refused. Hall told friends she was alarmed by Trump’s lack of qualifications or respect for the office. At a lunch shortly after the 2016 election, Hall asked Trump to reroute the Dakota Access Pipeline away from Native American reservations that were protesting the project. Trump responded by asking if she wanted to serve in his administration as head of the Bureau of Indian Affairs. “It was horrible. I couldn’t wait to get away,” she later told friends.  +F**or many American** families during the Trump years, politics became a third rail. And so it was for the Murdochs. Among Murdoch’s adult children, Elisabeth and James tilted `#resistance`, whereas Lachlan was hard-core MAGA. (The eldest Murdoch son was particularly close with Fox News host Tucker Carlson, sources said.) Meanwhile, Murdoch’s new wife despised Trump—and let Murdoch know it. “During dinners we had with Jerry and Rupert, Jerry wouldn’t hold back,” Cashin, Hall’s friend, said. According to a source, Murdoch wanted to buy a house in Florida to be closer to Mar-a-Lago, but Hall refused. Hall told friends she was alarmed by Trump’s lack of qualifications or respect for the office. At a lunch shortly after the 2016 election, Hall asked Trump to reroute the Dakota Access Pipeline away from Native American reservations that were protesting the project. Trump responded by asking if she wanted to serve in his administration as head of the Bureau of Indian Affairs. “It was horrible. I couldn’t wait to get away,” she later told friends.  Discontent among the Murdochs simmered for the first months of Trump’s term. But after the August 2017 neo-Nazi march in Charlottesville, Virginia, tensions boiled over. James and his wife, Kathryn, a former marketing communications professional turned philanthropist, were aghast that Trump’s “very fine people on both sides” comment drew a moral equivalency between tiki-torch-wielding neo-Nazis chanting “Jews will not replace us!” and the counterprotesters standing up to them. James confronted Rupert and Lachlan about Fox News’s full-throated defense of Trump’s remarks. They rebuffed him. “They were both in denial. They didn’t want to see it for what it was,” a source briefed on the conversations said. Stymied, James took his criticism public. Days after the march, he donated $1 million to the Anti-Defamation League and sent an email to friends, which promptly leaked to the press, that denounced Trump’s refusal to condemn white supremacy. “I can’t even believe I have to write this: standing up to Nazis is essential; there are no good Nazis. Or Klansmen, or terrorists,” James wrote. It was an inflection point for James. He wanted out. At that very moment, Murdoch set in motion a media deal that would give the younger son a graceful and lucrative exit strategy.  diff --git a/00.03 News/My High-Flying Life as a Corporate Spy Who Lied His Way to the Top.md b/00.03 News/My High-Flying Life as a Corporate Spy Who Lied His Way to the Top.md new file mode 100644 index 00000000..4355b9ec --- /dev/null +++ b/00.03 News/My High-Flying Life as a Corporate Spy Who Lied His Way to the Top.md @@ -0,0 +1,577 @@ +--- + +Tag: ["📈", "🤵🏻", "🤥", "🏦"] +Date: 2023-04-23 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-23 +Link: https://narratively.com/my-high-flying-life-as-a-corporate-spy-who-lied-his-way-to-the-top/ +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: [[2023-04-25]] + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-CorporateSpyWhoLiedHisWaytotheTopNSave + +  + +# My High-Flying Life as a Corporate Spy Who Lied His Way to the Top + +[![](https://narratively.com/wp-content/uploads/2023/04/RuseFinalHighRes.jpeg)](https://www.amazon.com/Ruse-Lying-American-Hollywood-Street/dp/1586423169) + +This story is an adapted excerpt from [*Ruse: Lying the American Dream from Hollywood to Wall Street*](https://www.amazon.com/Ruse-Lying-American-Hollywood-Street/dp/1586423169), by Robert Kerbeck, reprinted with permission from Steerforth Press. + +Phone to my ear, I listen to it ring the way a stage actor, surging with adrenaline, counts the final seconds to his cue. Eyes closed, I breathe in sync with it. + +A woman picks up on the fourth ring. I recognize the voice and feel the tension in my knuckles relax a bit. My eyes pop open and I hit my mark. + +“Hey, Zoe, it’s Kevin in compliance.” + +“Hi, Kev,” she says. + +“How you doin’?” I ask, my Philly accent like a fist tapping at the window. + +“The cancer is back.” + +It pains me to hear this. I’ve been calling Zoe for more than a decade, and she’s never been anything less than incredibly helpful. I count on her to help me do my job and do it well. Though we’ve never met, I like her and feel like we know each other. I hate the idea of her getting sick and leaving the company, one of the largest financial institutions in the world. Among other things, it means my work will get much more challenging. + +I need her to look up the name, title and cell phone number for a high-level executive at the bank, plus the names and numbers of everyone who reports to him. I’m in kind of a hurry, but I’m not an asshole. I need to hear about her illness first. + +“I’m sorry to hear that, Zoe. What’s the situation?” + +“It’s not good,” she says. + +I can tell she is going to say something else, and I’m pretty sure I know what it is. She’s going to share with me how much time she has left. I can hear it in her pauses. After so many years working the phone, I’ve learned to pick out the nuances, the things being said behind what’s being said, entire life stories even, in a hesitation or vocal inflection, in blank moments in time. + +“Hey, I had a friend who was down for the count, and he’s still around five years later,” I say. “They’re coming up with new treatments every day. You’ve just got to stick around, and they’ll find something.” + +“I’m on a new chemical now.” + +“See? Don’t you worry. You and I will be having these chats for years to come.” + +I mean it. She knows I do. I can hear it in the whisper of a smile on the other end of the line. + +A few years ago, after she got divorced, Zoe tried to initiate a little flirtation. I was game. Among other things, that kind of rapport would help grease the wheels when I needed help with something. + +“Are you single?” she’d asked. + +“I am at the moment.” + +“Do you ever visit Dallas?” + +“No,” I said. “Working in compliance, I only get to travel to state capitals to meet with regulators. Austin is as close as I get.” + +“My daughter has a softball tournament in Austin this weekend. Are you going to still be there Friday? You could stay on. It would be fun to finally meet you.” + +“I wish. But I’m out of here tonight as soon as we file these docs, then on to the next capital for more of the same.” + +“Darn it,” she said. “Maybe next time.” + +“For sure.” + +Zoe didn’t stay single long. Once she remarried, our chats focused on my miserable, lonely days traveling around trying to please uptight state regulators. Zoe often reminds me that my life shouldn’t all be about work. + +“I hope I’ll be around long enough to see you getting out there more,” she says. + +“You and me both,” I respond, and my tone cues her that we need to get to the real purpose of my call. + +“What do you need, Kev?” + +I sigh and give her the name of a senior executive. I need to know his entire organization from top to bottom, every name all the way down to the junior analyst level, plus each individual’s location and cell phone number. Zoe knows I’m off-site and don’t have access to any of this information at the moment. + +“Wow,” she says as she pulls up the name on the bank’s internal database. “He has over 200 people in his group. This is going to take forever.” + +Zoe reads me all the names and titles. She gives me precise descriptions of what each team does and offers each individual’s cell number and physical location. My hand cramps as I scribble everything down. By the time she finishes, more than an hour has passed. I thank her earnestly. + +“I’ve gotta take a break after that,” Zoe says. “I’m exhausted.” + +“You deserve one,” I say. + +Zoe knows that what I do is critical for our multibillion-dollar company to continue doing what it does, so she provides what I ask of her, over and over, year after year, even though it has absolutely nothing to do with her job. Even though it eats up hours of her time. Even though she is not authorized to give me any of that information. + +And, most important, even though every single thing she knows about me, and everything I’ve ever told her, is a lie. + +My name is not Kevin, and I don’t work in compliance. + +I am not an employee of Zoe’s company, let alone an executive. + +I’ve never met a state regulator, uptight or otherwise. + +I am not sitting in an antiseptic office in a blocky municipal building in Austin. I’ve got my feet up on my desk in the converted toolshed that is my home office in Malibu. Shirtless, in board shorts and flip-flops, I gaze out at the Pacific and breathe in its familiar salty musk while I casually manipulate her. + +I am not single. My wife’s in the house doing yoga. + +My friend who survived cancer? That actually is true. Every good liar knows you need to throw in one big truth to anchor the rest of the bullshit. + +But all that internal data about reporting structures and titles and top earners? One of the largest executive search firms in the world has secretly hired me to steal it. And those private cell phone numbers? My client is going to target the bank’s best moneymakers and try to poach them, securing their meaty portfolios as well. It’s late 2006, and Wall Street is bursting — year-end bonuses are projected to be 10 to 25 percent higher than last year’s, netting the top bankers and traders as much as $40 million apiece. + +All of which is to say, this seemingly innocuous phone call is taking place in a capitalist ecosystem defined by outrageous, unchecked excess and, yes, rampant deception. The world of corporate spying is shady but lucrative, and I am one of the best. + +Zoe’s intelligence alone has netted me hundreds of thousands of dollars in fees over the years. + +“Anything else, Kev?” she says. + +“Nope,” I say, “that’s everything. Thanks again. Go take that break, yeah? You’ve earned it.” + +“Ain’t that the truth,” she says. + +We chuckle and hang up. + +*The truth.* Funny. + +![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==) + +It was the late 1980s and I’d finally worked up the courage to move to New York City to become an actor, dashing my father’s dreams for me to take over the family car business. Yes, I am the child of a car salesman but it goes *way* deeper than that. My great-grandfather sold horse carriages before cars were invented, then switched over to become one of Philadelphia’s first automobile dealers. My grandfather had taken over that dealership and my father had taken it over from him. Now it was supposed to be my turn but I found that the trickery of car sales didn’t feel right to me, which soon turned out to be pretty damn ironic. + +My college roommate’s brother, Paxton “Pax” Freed, lived in Manhattan and had offered to show me around the city. A 5-foot-6 actor-musician with a mop of wavy brown hair, he was always clad in a black leather jacket like a mini Springsteen. One day, Pax mentioned his new phone job. He got me an interview with his boss, Leona, and I made my way to the Upper East Side, a section of the city I’d never visited. + +Leona seemed old to me, though she couldn’t have been much more than 40. She wore leopard-print pants, a brightly colored blouse with matching silk scarf, gaudy gold jewelry and too much makeup, reminding me of Mrs. Robinson in *The Graduate*. I was playing it safe, wearing a suit and tie and carrying a briefcase with my résumé in it. I’m not sure what she was expecting, but she eyed me as if my leading-man looks had made a good first impression. + +“Nice outfit,” she said. “You look like you should be selling cars.” + +“Actually, I did sell cars,” I said, a little clumsily. “For my dad’s dealership.” + +“I’m teasing you. Pax told me.” + +She ushered me inside the cleanest apartment I’d ever seen. Everything seemed to be in perfect order, as well as white. On top of the wall-to-wall carpeting was some type of fur rug (polar bear, I would later learn). Whatever her business was, it was lucrative. + +“I didn’t think you’d be so . . . tall.” Leona gestured for me to sit in a white, padded chair in the center of the rug. I prayed I hadn’t stepped in any dog doo on my trek from the subway. + +“Pax tells me you left working for your dad to be an actor.” + +I nodded. + +“How did he take that?” + +I was a bit flummoxed by the question. “Uh, not well,” I finally said. + +“Why do you want to be an actor?” she asked. + +I launched into a rambling monologue about how I’d started acting at the University of Pennsylvania and was cast as the lead in play after play. I explained the first few breaks were what gave me the guts to move to New York. + +“It’s a hard life,” Leona said. “Hard to make a living. Hard to keep it going. That’s what your dad is worried about.” + +“I can take care of myself.” + +Leona sighed. “I have no doubt.” She stood and offered her hand to bid me goodbye. + +She hadn’t even asked for my résumé, which I’d forgotten to pull out. Just like that, the Upper East Side fantasia spit me right back out onto the dirty streets of downtown, as unemployed as ever. It was time to pick up a crate of Kraft macaroni and cheese. + +Pax called the next day. He said Leona was hiring me at the rate of $8 an hour, and I was to start training immediately. I couldn’t believe it. *Coo-coo-ca-choo*, Leona. + +“She hires everyone,” he quickly clarified. “Because nobody works out.” + +It was only then I realized that Leona hadn’t asked about my phone skills or sales skills — or any skills, really. She’d also not said a word about what the job actually entailed. + +![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==) + +The following day I made my way to the Williamsburg section of Brooklyn to work with Leona’s trainer, Deirdre. In the late ’80s, Brooklyn was the antithesis of the Upper East Side. The crack epidemic was hitting hard. The subway train I took over the Williamsburg Bridge was still covered in ’70s graffiti. I found the building I was looking for and trudged sweatily up four flights of stairs. Along the way, I heard yelling and screaming from inside more than one apartment. I knocked on the door of 4C and a cute young woman with striking green eyes opened it. She was wearing a flowing and flowery Laura Ashley-type dress. + +“Top o’ the morning,” she said with a bright smile. “I’m Deirdre O’Conor. That’s with one *n*, not two, the way true Irish people spell it.” + +“I didn’t know.” + +“I’m American but Irish on both sides. What about you? Are you Irish?” + +“Nope.” + +“Not at all?” She seemed concerned, as if she might not be able to train me if I didn’t have some Irish blood. + +“I’m part Welsh.” + +“Oh,” she said, suddenly happy again. “I love the Welsh. They’re almost as nice as the Irish.” + +She laughed and showed me into her apartment, which consisted of two rooms: a bedroom and a living room with a bathtub in the middle of it. + +“You’ll work in my bedroom,” she said. “Come on.” + +*Her bedroom.* What kind of work was she going to have me doing? + +Deirdre set me up at a small desk in front of her bed, which was just a mattress on the floor. She pulled up a chair next to me and handed me a writing pad. + +“First, you’ll need a name.” + +“What for?” + +“For your ploy. You can’t use your real name. What happens when you get famous?” Deirdre said this as if it were a given. + +“I need a fake name for phone sales?” + +“We’re not doing sales. Didn’t Pax tell you that?” + +Pax hadn’t told me anything, as if he was afraid to tell people what he did for a living. + +“We get non-public information from Wall Street companies.” + +“What kind of information?” + +“Their org charts, for starters.” + +I had no idea what these were. I guess it was obvious by the look on my face. + +“Their *organizational* charts,” she said slowly, as if I were developmentally disabled. “You know: Who reports to whom?” Deirdre pulled a giant red book from a cabinet and flipped it open. “Like this.” + +It was some sort of directory. At the top of each page was the name of a bank or financial institution and beneath was a list of the executives working at that company, along with their titles. + +“We get information like this for Leona’s executive search firm clients. Their headhunters use our charts to identify the best people and steal them away to *their* clients.” + +“Why do they need us when they have directories like this?” I pointed at the massive book, which had to be more than a thousand pages. + +She scoffed. “This is worthless. It’s out of date the second they print it. Half of these executives are gone or in different roles. Wall Street is ultra-competitive. People are constantly moving around to better jobs, often thanks to us. But it’s a good starting point, which is why Leona buys it. We use these names as leads to help get us what we want.” + +“Which is?” + +“I’ll show you.” She grabbed my pad and elbowed me out of my chair. “Always write your name down, so you don’t forget who you are.” She wrote *Maeve* on the side of a page, picked up the phone, pushed the speaker button, and dialed a number listed in the directory. + +“Shearson Lehman,” an operator answered. + +“Hello, how is your day going?” Deirdre-as-Maeve asked. She seemed to have put on a slight Irish accent. + +“It’s fine. How can I help you?” + +“I’m an exchange student from Ireland writing a paper. You haven’t been there, have you?” + +“No, I haven’t, but I’d like to go. My ancestors were from Ireland.” + +Deirdre looked at me and raised her eyebrows. + +“You must come and visit. I live in Galway. Ask for Maeve O’Shea.” + +The operator laughed. Her brusque, business-like tone from the beginning of the call had disappeared. “How can I help you, Maeve?” + +“Do you have a Ken Monahan listed?” Dierdre pointed at a name on one of the pages in the directory to clue me in as to what she was doing. + +There was a brief pause as the operator looked up the name. + +“I do. He’s in investment banking.” + +“Can you see which department within investment banking?” + +“He’s the head of mergers and acquisitions.” + +“Oh golly, that’s what I’m writing my paper on. Can you see the list of the people in that department?” + +“I can. It’s very long.” + +“Can you read it to me? Please? I’m sending out a survey, and if I don’t get enough responses my paper won’t count. It’s part of my citizenship application.” + +Her story sounded kooky as well as unbelievable, but sure enough the operator began to read off the names. Deirdre got up and handed me her pen, mouthing *write*. I scribbled down every name, filling seven or eight pages with my sloppy writing, while Deirdre flitted about her bedroom straightening up. + +“That was the last one,” the operator said after Xavier Zoydius, or whatever name came last on her alphabetical list. + +Deirdre returned to the desk and leaned over my shoulder. She smelled great and reminded me of the commercials for Irish Spring soap. “I almost forgot,” she said. “Does your directory list titles?” + +“It does.” + +“Can you zip through them real fast? This is the last thing.” + +I noticed Deirdre had dropped her accent. I wondered if I should warn her. + +The operator ran through the list again, this time giving me titles: managing directors and VPs, associates and analysts. I barely understood what they meant. + +When the operator finished, Deirdre popped back to her position over my shoulder. + +“I’m so sorry, but I need phone numbers, too. I promise, this is it.” + +“You said that already.” + +“I know, but I promise this time.” + +The operator gave me the direct phone extensions for every name on the list. + +“Thank you, operator. What was your name?” + +“Colleen.” + +“A good Irish name,” Deirdre said. + +“I’m not supposed to do that, you know.” + +“I know, thank you. We Irish have to stick together. Have a great day!” + +Deirdre disconnected the call and did a jig, complete with Irish step dancing. + +“That’s amazing,” I said. + +“Pretty impressive, huh? This information is worth a lot of money.” + +“No, what’s amazing is that she was stupid enough to give you all that. Why? Because you’re a student? Oh wait, because you’re an *Irish* student? With all due respect, your accent was going in and out the whole time. I don’t know how she didn’t notice.” + +Deirdre stopped dancing. “She helped me because the Irish are kind, something the Welsh clearly are not.” + +“I’m not trying to be mean. It just doesn’t make sense your story worked. You got lucky the operator was Irish.” + +Deirdre shook her head, as if I’d failed my first test. “Learn this, smarty-pants. The operator is your best friend. I ask every single one if they’re Irish. You have no idea how many of them are. Irish immigrants pretty much built this city — that’s why they’re more than willing to help a young Irish girl new to New York. I always look for Irish names when I call people. By the way, once someone starts giving information, they rarely stop. They’re not listening to your accent anymore. They don’t even remember the name you gave them. They’re under your spell. You should choose an Irish name as your pseudonym.” She pointed a finger at me. “Though you better be nice if you use one.” + +I trained with Deirdre for two weeks, taking the subway every morning to her apartment in Brooklyn. Then I discovered that Leona had another worker, an actress and playwright named Andi, who lived two blocks from me. As much as I enjoyed Deirdre’s delightful Irish frolic, I was eager to give up the commute, and Leona gave me the go-ahead to transfer to Andi’s place. + +On my first morning there, I sat at the kitchen table while Andi made herself breakfast. + +“Let’s hear what you’ve got.” She pushed the speaker button on the phone. + +Doing a ruse call was hard enough without someone judging me as I did it. Plus, the firm I was calling was Goldman Sachs, by far the most difficult bank to research. Pax said getting information out of them was like robbing Fort Knox. + +“Hello, this is, uh, Kieran O’Shaughnessy,” I said, making a feeble attempt at an Irish accent, which was far worse than Deirdre’s. “I’m a student at NYU.” + +“Who?” the operator asked. + +I went further with the accent, channeling the leprechaun in the Lucky Charms commercials. “Kieran O’Shaughnessy. I’ve just come from Ireland. I be a student at NYU.” + +“NY who? I can’t understand you. Who are you calling for?” + +“What be your name, operator?” In my head, I was obsessively repeating the tagline from the commercials — *“They’re after me lucky charms!”* — to help me get the accent right. + +“We don’t give out names at the switchboard.” + +“Ah, but you sound Irish.” + +The woman sounded less Irish than any voice I’d ever heard. She hung up. + +I picked up the phone, made a few more calls using the same lame script, and got nothing. Not a name, not a title, not a direct extension. + +What worked consistently for Deirdre and Andi didn’t work for me. I’d spend hours and hours on the phone, yet often end up with only three or four names from groups that had dozens of people. Even in the beginning, I knew there had to be a better way, a better story, for me to get the intelligence Leona’s clients wanted so badly. + +I went to pick up the phone again, but Andi put her hand over mine. + +“Relax. You need to find your voice.” + +It sounded a lot like the advice my acting teacher was giving me. + +“Look,” Andi continued. “Deirdre is great at training people because she’s a sweetheart. But right now you sound like a poor imitation of her. A couple of times your accent was more Scottish than Irish.” + +She laughed, and because it was true as well as funny — I was terrible at accents — I laughed with her. + +“Do you know how many actors Leona has hired to do this job? Hundreds. Everyone sees her ad in *Backstage* and thinks how great it would be to have a flexible, part-time job. Do you know how many people have worked out? Three: me, Deirdre and your buddy Pax. You could be the fourth. But you’ve got to find your own style. Oh, and pick a shorter pseudonym. One-syllable names generally work best.” + +Andi picked up the phone and hit the speaker button. She dialed and the same operator I’d spoken with earlier answered. + +“I’m sorry to bother you,” Andi said. “I’m the assistant of an executive that does business with your firm, and like an idiot I lost the Christmas card mailing list you guys sent us.” Andi’s voice slipped as if she might cry. “I’m going to lose my job.” + +“Sorry to hear.” The operator’s tone seemed different. + +“Me, too. I’ve got a kid, you know.” Andi’s voice cracked now like she actually was crying. + +“I’ve got two myself.” + +“Is there any chance you could check this one name for me? Gus Walraven? I think he’s in structured finance.” + +“Sure, no problem.” There was a brief pause as the operator looked for the name in her directory. “Got him. Yup, structured finance.” + +“What floor is he on? I need that for the card.” + +“He’s on seven, but if you are sending something you’ll need the mail stop. The code for the structured finance group is 7B36.” + +“You saved my life.” + +“Happy to do it.” + +“One more thing. Can you read me the other names in the mail stop?” + +![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==) + +Over the next decade, my acting career grew in fits and starts. I landed theater roles in New York opposite future stars like James Gandolfini and Calista Flockhart, and when I moved to L.A. a few years later, started booking TV jobs on shows like *Chicago Hope, Melrose Place* and *ER*. It always seemed like my big break was just around the corner. When I was featured in the ads for the *Sisters* episode in which I killed George Clooney, an actor friend of mine called from New York to say he was proud of me for making it in Hollywood. I declined to tell him that my acting income, after commissions and taxes, wasn’t much above the poverty line.![](https://narratively.com/wp-content/uploads/2023/04/uitwerking-spot-1-1320x981.jpg) + +What *did* pay the bills was rusing. The $8/hour survival job that helped me make rent in New York blossomed into something bigger. As I got good at it, I started hearing from other firms and took on work from multiple clients. I had no idea how they found me since I certainly wasn’t advertising my unethical and, ahem, likely illegal services. Still, it was just a job; something to pay the bills in between auditions. Shit, what was the harm in finagling a few names out of unthinkably rich corporations anyway? But it was about to become something bigger and *much* more dangerous. + +I’d met my girlfriend, Gardia, a few years earlier. She worked for Madonna’s record company, Maverick, and in addition to being brazen, she was Southern California through and through. She’d even been part of an all-girl punk rock skateboard gang called the Hags. Gardia wasn’t fazed by the ethics of what I did. She had seen music business dealings that made lying on the phone seem quaint. + +She was also sick and tired of being an undervalued and underpaid assistant, so after a blowup with her boss she decided to come work with me. Gardia quickly helped turn my survival job into a thriving enterprise. She bought filing cabinets and developed a detailed filing system. She began typing up the research to make it look professional, as well as legible, since my handwriting was atrocious. By taking over the parts of the business I sucked at, Gardia enabled me to focus on what I did best: rusing. + +Instantly, our revenue increased. *A lot.* + +Gardia and I moved into a rented house in Santa Monica together and set up an office in the basement. She even tried to make some ruse calls herself, but like nearly everyone before her, she wasn’t able to handle the constant lying. + +As we approached the turn of the millennium, the computer bug Y2K was projected to wreak absolute havoc on computer systems and networks across the globe, when electronic calendars failed to comprehend the transition from the year ’99 to ’00. + +I’d like to say I was the one who recognized the potential in using the computer bug to our advantage, but it was my old buddy Pax who was the genius. Though I lived in Santa Monica now and he still lived in New York, we spoke on the phone regularly and remained competitive about our rusing techniques like we were fighting to be salesman of the month at my father’s old dealership. + +“I’ve got a wicked new ploy for the millennium,” he bragged one morning. “I say I’m in IT working on Y2K, and all anyone wants to know is whether we’re going to make the deadline. I tell them we’re working night and day, and that we have to input every single piece of information manually. I’ve never had people more willing to give up intel. They feel sorry for me!” + +Pax was right. The impending “disaster” of Y2K was a gold mine. We were able to obtain more valuable intelligence than ever before, which also enabled us to raise our rates. In 1999, I made more than $100,000 for the first time. + +Even after an expensive wedding and honeymoon on the Big Island, Gardia and I still had money to sock away to buy a house. I should’ve been happy, but I was depressed about the state of my acting career, which was in its death throes. I’d arrived in L.A. with big dreams that were starting to fizzle. Those plum TV jobs were drying up and now I was lucky to get roles on B-grade shows such as *Renegade* and *Pacific Blue*, which seemed to solidify me as a second- or third-tier TV actor. + +Beyond the wrenching disappointment of my artist dreams slipping away lay the cold reality that all I was left with was the ruse. Yes, I was doing better than ever with it, but the situation had started to feel like whoring either way. + +But now that I had a mortgage, I no longer cared about legal or moral implications, and I resented my old classmates who had gotten MBAs from Wharton and bragged about their millions. Exclusively targeting executives making ridiculous money felt like poetic justice. So I left Leona and started my own spying firm; I figured if I got in and out of each call carefully, the odds of any corporation coming after me were manageable, or so I prayed late at night. + +Wall Street assistants were paid by the hour and left the second the clock struck 5. After that, most executives answered their own phones. You’d think they’d be tougher to squeeze for intel, but I found them to be far easier marks than their assistants. + +“Jim Cassel,” one executive answered. Wall Street guys didn’t go in much for greetings or small talk when they answered the phone. + +“Hey, Jim, it’s Tom Chirico in tax,” I said, using the real name of the tax department head. “One of the partners from Price Waterhouse was in here this week. As you know, they do the audit for us. They’ve got tickets for the Knicks and the Rangers and have some openings for upcoming games. You guys in institutional sales have been killing it, so I figured you deserved first crack. You into it?” + +“It’s a suite, right? With booze and food?” + +As if the free tickets weren’t enough. + +“Come on,” I said. “It’s a luxury suite.” + +“Hell, yeah! What games?” + +“I’m not sure yet. I’ve got to put together a list first to send to them. Read me the roster of the people on your desk, but give me the top producers first. We don’t want one of your junior guys getting a front row seat, now do we?” + +Jim told me the names of his team members with the heaviest hitters first, which would be incredibly valuable information for my client since now they would only be stealing the best executives from their top rival. + +“Anyone else? Don’t be shy. The more names you give, the more tickets I can get.” + +“You want the traders, too?” + +“Sure, why not? The more the merrier.” + +Jim read me the names of the traders, the sales traders, the research department and the junior analysts. He would’ve given me the names of the janitorial staff and told me which one cleaned the windows best had I asked. + +“Perfect,” I said. “I’ll be in touch with dates.” + +I felt a twinge of guilt and even a bit of fear about what might happen when those tickets didn’t arrive, but I reminded myself that the guy on the other end was raking in an unconscionable amount of money, as were most of the names he’d given me. + +They could pay for their own damn tickets. + +By this point the ruse was providing a powerful stream of revenue, and it only continued to grow. From 2002 to 2008, my annual income increased rapidly — from $204,000 to $352,000 to $498,000 to $916,000 to well over $1 million to, eventually, nearly $2 million. Clients were so desperate for the non-public intelligence and other dirty little corporate secrets we provided that they kept offering more and more money. One even paid double and overnighted me the entire fee in advance when I told him I was too busy. + +There was such demand for top Wall Street talent that multiple clients often tasked us with extracting the exact same intelligence, enabling me to make double or even triple for one job. It had never occurred to me that I could make this kind of money. + +In 2005, we started getting a ton of work in the financial derivatives space. I didn’t even know what a derivative was, not that it mattered. And soon I came up with the most nuclear ruse yet: the compliance ploy. + +As I was to learn, individuals working in compliance were feared by others within the firm. This made even surly assistants hesitant to take a stand. No one wanted to be on the bad side of compliance, the corporation’s version of Orwell’s Thought Police, who were constantly on red alert for any whiff of risk or malfeasance. This put me in a strategically powerful position. The flip side was that because almost all compliance officers were lawyers from top schools, they were exactly the types that could, would and did come after me. Before these super lawyers had moved to Wall Street to make the big money, most had worked in the public sector doing fraud enforcement for the Securities and Exchange Commission or the Federal Reserve. Now that I was actively *impersonating* them, they had more than enough incentive and resources, both professional and personal, to track me down and bust my ass. Departments with names like Insider Threat Protection, Surveillance Unit, and Financial Crimes Compliance scared the hell out of me. + +I once received a letter from a Swiss investment bank after I’d foolishly given out my fax number in a fit of desperation. A kind secretary had offered to send me what I needed, but instead a cease-and-desist letter came through from the deputy head of the firm’s U.S. legal department warning that if I ever called again he would alert the authorities. + +One of the most terrifying encounters happened when Pax and I were working on a particularly challenging assignment from opposite coasts. He called me in a panic. + +“They’re after me!” Pax’s normally strong voice was shaky. “They came to my apartment.” + +“What? Who?” + +“The police. My neighbor said they were banging on my door. They told my landlord they’re looking for me. I’m going to be arrested.” He sounded like he was hyperventilating. + +“Whoa, calm down,” I said. “Where are you now?” + +“In my apartment. They were here an hour ago. They just missed me.” + +“Hang up right now and call me from a pay phone.” + +Suddenly, preparing for the audition I had that afternoon was no longer a priority. If the authorities had found Pax, it meant they were listening to his calls. If they’d tapped his phone, they had my number, too. For all I knew, the police — or the feds — would show up at my place any second. Before I could start hyperventilating, too, the phone rang again and I answered it. + +“I’m going to turn myself in,” Pax said. + +“Don’t be stupid, just hang on a second. Let’s think this thing through.” + +I recalled the attorney who once warned us that what we did was in a “dark gray” area of legality. He said it was conceivable that an aggrieved corporation, sick of losing its top executives to rival firms, which could cost it tens of millions, even billions, of dollars, might take action against us for the theft of names that led to those losses. Since Pax and I were using the telephone (as well as fraudulent pretenses) to obtain the information, we were susceptible to federal wire fraud charges, punishable by a hefty fine or up to 20 years in prison. If the violation affected a financial institution, the potential penalties went up to $1 million and 30 years. Apparently each ruse call our stupid asses made could be considered a separate crime! Pax and I had made *thousands* of those calls. We could be in prison for the rest of our lives. + +While Pax was packing his stuff to flee, he got a voicemail message. It wasn’t from the police, but from investigators with Sprint, a phone company he’d been targeting recently. + +“They said they know what I’ve been doing.” + +“Do not call them,” I shouted. “You must have pissed somebody off and they called their internal security. Those investigators have no authority to talk to you,” I said, “let alone arrest you. Ignore them. They’re just trying to scare you.” + +I had no idea if that was the truth, but I needed Pax to believe it was. For his sake and, possibly, mine. + +The following days I was on edge as I waited to hear from Pax. In the shower, I noticed clumps of hair coming off in my hands. + +One week later, I returned from an audition and the phone was ringing incessantly. + +“Dude,” Pax said when I answered. “They think I’m that computer hacker, the one being hunted by the Secret Service and the FBI.” + +“Who?” + +“Kevin Mitnick.” + +I recalled reading an article about him the prior summer. Mitnick had been described as the Darth Vader of the hacking world — aka the “Darkside Hacker” — and a threat to national security. Mitnick got passwords and codes so he could hack into corporations to gain access to trade secrets worth billions. I’m sure one wire-tapped phone call with my panicked friend had made it clear to the investigators that Pax didn’t possess the skill set — or the balls — to escape a parking ticket, much less run a worldwide hacking operation. Mitnick was eventually caught, arrested as a domestic terrorist and placed in solitary confinement. I got to keep rusing from the beach in Malibu, and I never took an assignment researching phone companies again. + +But taking the ruse to new heights was a perpetually tempting gamble. I went so far as to impersonate the CEOs and COOs of some of the world’s largest publicly traded companies, and not just on Wall Street. Tech, pharma, consumer products, industrial behemoths, even defense contractors across the globe all fell victim to the ruse. Many of the men I pretended to be were regular talking heads on CNBC and Fox Business. Some were even on presidential commissions and advisory committees. I called them and listened to their outgoing voicemail messages to study their inflections and the timbre of their voices. None of the men had accents, which was extremely fortunate for me. Indeed, they all pretty much sounded (and looked) the same. Risky as it was, their elevated public status was why I chose them. If people believed I was the top dog, there was no secret they wouldn’t divulge: unreleased product intel, future plans and strategies, internal rankings of top employees — I could learn anything and everything my clients wanted to know. Indeed, most people were blown away that they even had the CEO on the phone, like they’d been gifted a rare audience with the king. They fawned, they flattered, they gave it up. More times than I can remember they’d say, “I can’t believe I’m actually talking to you.” And I wanted to respond: “You’re not.” + +I kept rusing for years, and I kept making great money — until some tech industry folks created a little thing called LinkedIn that made publicly available much of the information I charged a lot of money for. + +![](https://narratively.com/wp-content/uploads/2023/04/uitwerking-spot-2-1320x1320.jpg)Still, there continues to be highly sensitive and extremely valuable information that firms simply cannot obtain on social media. And if they want it badly enough, they hire a corporate spy like me. All these years later, I still have many of my moles, including my longest-running one, Zoe. I gave her a call not too long ago. + +“Hey, it’s Kevin, how’s it going?” I said when she picked up. + +“Oh, hi, Kevin, this is Debbie,” said a woman I didn’t recognize, and my stomach plunged. Before I could dwell too long on the likely reason for Zoe’s absence, Debbie added, “I’ll get Zoe. She’s right here.” + +Whew. But now I shifted to a different concern. No one else had ever answered her line before. I prayed Zoe wasn’t leaving the firm. + +“You again,” Zoe said when she came on the line. + +“Missed me?” + +“Not a bit.” She laughed. “I have my own job, you know.” + +“Please. You love these calls.” + +“I do?” + +“They make you realize *your* job isn’t so crappy.” + +“That’s true,” she said. “I could never do what you do. I couldn’t handle the pressure.” + +“You don’t want to do what I do, trust me.” + +It occurred to me that despite myself I had just uttered a factual statement. + +Zoe got quiet, and all at once I knew she had bad news. + +“The cancer has spread,” she said, choking up. “It’s in my bones, in my liver.” + +“Hey,” I snapped. “You’ve had cancer since I’ve known you. You’re not going anywhere, so don’t even think about it.” + +She seemed to regain her composure. “I’m on an experimental oral chemo now. The doctors say it’s working.” + +“What did I tell you? Does Debbie there know?” + +“Yes. She’s kind of filling in. I’ve been missing a lot of work so they hired her to work with me.” + +It all came together. Here I was worried that Zoe was quitting and what that would mean for my easy access to her prime intel when she was actually training a replacement *because she was dying*. + +“She knows about you,” Zoe said, now trying to reassure me. “I told her you’d be calling now and then for information, that whenever she sees an anonymous number it’s probably you. I said you’re one of my favorite people at the firm.” + +It was my turn to choke up. + +Zoe and I had never met. How could she care so much about me? I was such a talented liar I’d somehow convinced Zoe I was a person worthy of her friendship, her praise. But then I was also a professional listener, something I did earnestly and thoughtfully. Perhaps unlike others Zoe had confided in, I was actually present in our conversations, as if we were scene partners. I actively searched for ways to comfort her. I genuinely tried to help. I always made her laugh. I desperately wanted our play to have a happy ending, not this hackneyed third-act fatality. + +“I’m going to give you her direct number,” Zoe said. “In case I’m not here.” + +I mumbled something indecipherable. There were no words I could say this time. Zoe was getting her affairs in order. And part of that was supplying me with a new mole, a small gesture for her that would have a great impact for me. Any comfort I would offer her now would ring as false as the name I’d given her all those years ago. + +She read me Debbie’s number. “I’m going to miss you, Kev.” + +Either way, I knew this would be our last call and that I’d soon be dialing Debbie’s number, since I couldn’t handle carrying the knowledge of Zoe’s impending death — which I truly cared about — while pretending to be someone I wasn’t. + +It’s hard to be sincere when you’re lying about everything else. + +“What do you need?” Zoe asked. + +Since this was going to be my last call with her, I decided to go big. + +“I need the names of every person in investment banking.” + +“U.S. only?” + +Might as well go out with a bang. “Globally.” + +This was likely close to — no joke — a *thousand* names. I waited for Zoe to freak out and say this was finally just too much, even for her. + +“Well,” she said, “we better get started then.” + +***Want the full story? Order your copy of [Ruse: Lying the American Dream from Hollywood to Wall Street.](https://www.amazon.com/Ruse-Lying-American-Hollywood-Street/dp/1586423169)***  + +[![](https://narratively.com/wp-content/uploads/2023/04/RuseFinalHighRes.jpeg)](https://www.amazon.com/Ruse-Lying-American-Hollywood-Street/dp/1586423169) + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/Saving the Horses of Our Imagination.md b/00.03 News/Saving the Horses of Our Imagination.md index 7805a670..4159d282 100644 --- a/00.03 News/Saving the Horses of Our Imagination.md +++ b/00.03 News/Saving the Horses of Our Imagination.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-20]] --- diff --git a/00.03 News/The Case of the Fake Sherlock.md b/00.03 News/The Case of the Fake Sherlock.md index db598e46..b5c68675 100644 --- a/00.03 News/The Case of the Fake Sherlock.md +++ b/00.03 News/The Case of the Fake Sherlock.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-20]] --- diff --git a/00.03 News/The Fox News Trial Starts Tomorrow. Fox Is Already Losing..md b/00.03 News/The Fox News Trial Starts Tomorrow. Fox Is Already Losing..md index c78267ee..c4d319c4 100644 --- a/00.03 News/The Fox News Trial Starts Tomorrow. Fox Is Already Losing..md +++ b/00.03 News/The Fox News Trial Starts Tomorrow. Fox Is Already Losing..md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-20]] --- diff --git a/00.03 News/The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists.md b/00.03 News/The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists.md new file mode 100644 index 00000000..531ea3b2 --- /dev/null +++ b/00.03 News/The ‘Dead Ringers’ Story The Strange Death of the Twin Gynecologists.md @@ -0,0 +1,123 @@ +--- + +Tag: ["🤵🏻", "🩺", "🚺", "🪦"] +Date: 2023-04-22 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-22 +Link: https://www.vulture.com/article/twin-gynecologists-stewart-marcus-cyril-marcus-dead-ringers-inspiration.html +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-TheDeadRingersStoryNSave + +  + +# The ‘Dead Ringers’ Story: The Strange Death of the Twin Gynecologists + +## A patient’s notes. + +![](https://pyxis.nymag.com/v1/imgs/5b2/835/88ae0e4d2b64a24fa299aefdcfb675b662-twin-gynecologists-lede.rhorizontal.w1100.jpg) + +Photo: Matthew Klein + +**Editor’s note:** *New York’*s issue of September 8, 1975 included a cover story about two gynecologist twin brothers who had died under strange circumstances on the Upper East Side. The brothers’ story eventually inspired a novel, [*Twins*](https://www.amazon.com/Twins-Bari-Wood/dp/0434877859?tag=vulture-20&ascsubtag=[]vu[p]clg432equ002u0id5kg0xcee3)*,* by Bari Wood and Jack Geasland, and a film adaptation, *Dead Ringers,* directed by David Cronenberg and starring Jeremy Irons in both roles. In April 2023, [*Dead Ringers*](https://www.vulture.com/2023/03/dead-ringer-rachel-weisz-amazon-prime-clip.html) was remade as a Prime Video TV series, this time with Rachel Weisz as the doctors. + +Like so many other people I spoke with this summer, I found myself uncharacteristically haunted by the deaths of Stewart and Cyril Marcus, the twin gynecologists found gaunt and already partially decayed in their East 63rd Street apartment amidst a litter of garbage and pharmaceuticals. The story of their deaths had, for me, even in its barest bones, that element of stupefying reality that Philip Roth calls an “embarrassment” to the writer’s imagination; here was a reality that could make the capabilities of even the most imaginative writer seem meager. + +Several aspects of the deaths contributed to my stupefaction. One was the very fact of the men’s twinship, the doubleness which had given them a mutual birth date and now a mutual death date as well. Another was the men’s prominence. When beggars die in a state of bizarre deterioration in New York, there are no comets seen; when two doctors still on the staff of a mighty New York hospital die in a state of bizarre deterioration, the heavens themselves blaze forth questions of responsibility. Had these men actually been seeing patients — perhaps even performing operations — while already on their route to disintegration? (Such was the case, as it turned out.) + +Had none of their learned colleagues noticed, if not a mental alteration then at least the clear signs of physical change that had come over them? (They had, and, in fact, New York Hospital decided to dismiss the Marcuses — but only weeks before their deaths.). + +![package-table-of-contents-photo](https://pyxis.nymag.com/v1/imgs/264/570/0c61d6adbf9f79f68901383cbf63f68820-twin-gynecologists-cover.2x.rvertical.w330.jpg) + +But I had a special personal reason for curiosity about the deaths of the Marcuses, for I had once been a patient of Stewart’s. At least, it was Stewart whom I called for appointments and whose name appeared on the bills I received, although the friend who had recommended him to me told me she sometimes had her doubts about which twin she was actually getting. Yes, they were that much alike. She was convinced that from time to time they had played classic twin jokes, one substituting for the other. Another woman with whom I spoke had had the same impression recently, and said, “Of course, they never told the patients they were doing this. But I got so I could tell which was which. Stewart’s neck was thicker.” Other patients could tell which twin was which because they detected a difference not in anatomy but in personality. Their doctor, kindly on one visit, would be strangely inaccessible on the next. Thus, the story grew that one was a “good twin,” the other a “bad twin.” But there was widespread disagreement as to which was the good one, which the bad. And it was never quite clear whether the personality change was a result of the twins’ pinch-hitting for each other, or whether because within each twin there was a split and ranging personality. I tended toward the latter belief, and was convinced I always saw the same doctor, but that he had dark and darker moods. + +Eventually I left off seeing him. This was about eight years ago. I had found him/them distant, remote, incapable of or unwilling to engage in discussion or explanation. Hardly what one wants in a doctor. His/their reputations were good. They were among the few surgeons to have perfected the “purse string,” an operation that helped women who had difficulty carrying a fetus to full term. They were said, also, to be the best gynecologists in town — in those days — at inserting with a minimum of pain the then still new IUD’s — intrauterine devices. But communication with him/them was so often difficult that I finally realized that reputation was, for me, less important than responsiveness. + +Perhaps because of having felt so strongly *my* Dr. Marcus’s distance from life, I wasn’t really surprised when I read of his and his brother’s deaths. The initial police reaction was that they were victims of a suicide pact. There were no signs of anyone’s having forced entry into their apartment; no signs of external violence to either body. Stewart was found face up on the floor, nude except for his socks; Cyril was found dressed in his shorts and face down on a big double bed. Stewart had died several days before Cyril. There was no note — the usual accompaniment to suicide — although according to Bill Terrell, the building repairman who called the police and, with them, was the first to enter the apartment, there was a piece of paper in a typewriter with the name and address of the woman whom Cyril had married and divorced. + +More mysterious than the question of whether their deaths had been intentional or accidental was the fact that the *cause* of death remained unknown for days. Despite the fact that Cyril, a man close to six feet tall, had weighed just over 100 pounds at the time of his death, and Stewart had been gaunt as well, no sign of serious physical ill­ness was found in either man. No cancer: no heart condition. + +Ultimately, extensive tests conducted by the Medical Examiner revealed that drugs — barbiturates — had caused their deaths, but not because they had suddenly taken a large quantity. Rather, they had been taking large quantities for a long period of time, and it was when they stopped — and had the fatal convulsions typical of barbiturate withdrawal — that they had died. + +It is not easy to portray the Marcuses. The relatives are loath to talk about them, for obvious reasons. The wife from whom Cyril was divorced has children whom he sired. She feels an enormous, brooding compassion for her ex-husband. Colleagues of the Marcuses and those in an administrative capacity at New York Hospital were even less willing to talk, although three weeks after all my attempts at interviewing them had been defensively rejected, the *Times* was able to shame them into finally addressing the press. Because of these difficulties, I had to follow another direction and it took me closer to a resolution of the personal questions troubling me. + +I went first to the building in which the Marcuses had been found dead. Cyril had lived there — in apartment 10H at 1161 York Avenue — for some five years, apparently since the time he had separated from his wife and children; Stewart had moved in with him sometime in the last few months. To the doormen and building employees, the two doctors were always distant, remote, too arrogant for a “Good morning” or even a “Hot weather, isn’t it?” + +Because the two doctors eschewed small talk. no one talked to them much after a while. Thus it was that on a Tuesday, the Tuesday on which, presumably, the second twin was to die, his brother having done so several days earlier, doorman George Sich — who had worked in the building for 25 years — saw one of the twins leave the building sick and depleted and yet was unsure about how far to carry an offer of help. The twin — we now know it was Cyril — neared a table in the lobby on which packages were occasionally placed and began to stagger a bit. “I thought he looked ill,” says the doorman: “I thought he was going to faint, and I hurried over to help him.” But when Sich reached his side, the twin recovered his balance and said in an icy tone. “I’m all right.” + +Inside the apartment that day, the other brother — Stewart — already lay dead. He had become just another part of the debris and decaying organic matter that had been collecting around the twins for a lengthy period of time. The newspapers described the apartment in which the bodies were found as “messy.” Stronger words were used by building employees and policemen who went into the rooms. In the room in which Cyril died there was no inch of floor space that was not covered with litter and garbage, not just in a single layer, but almost a foot and a half high. Bits of unfinished TV dinners and chicken bones, paper bags and sandwich wrappers from Gristede’s were heaped around the bed, a collection of plastic wraps from the dry cleaner’s entirely filled one closet, and human feces rotted in a handsome leather armchair of the type so many doctors favor. + +Bill Terrell, the building repairman, says that he knew from the first that there was a dead body within. Neighbors had been complaining for two days that there was a smell emanating from 10H. Terrell says, “I knew what the smell meant. I was in combat, you see. The real conflict.” + +But Terrell had reasons beyond the nose on his face to suspect that there was a dead man — or two dead men — in the apartment. Once before he had been called upon to break open the door to 10H. It is his story of this event that makes the death of the Marcuses seem not just a sudden inexplicable tragedy but a tragedy with long, concealed roots. That other time, about three years ago, Terrell had been passing by 10H on his way from a repair job in a nearby apartment when he heard a buzzing sound within. It sounded like a phone off the hook. He thought nothing of it until, several hours later, he had cause to be on the tenth floor once again, passed 10H, and once again heard the buzzing. This time he rang the doorbell and began to pound loudly on the door. When no one answered his noises, Terrell says, he got the phone number of Cyril’s brother Stewart and telephoned him at his office. Terrell said to Stewart, “There’s something not quite kosher at your brother’s place. I think your brother needs help.” + +What happened next amazed and intrigued Terrell. There was, he says, a long silence. He got the feeling that Stewart was somehow consulting the air waves, communing with his brother, because he said nothing for a long, long time and then, quite abruptly, said, “Yes, You’re right. He does need help. I’ll be right over.” In Stewart’s presence, Terrell took apart the door lock. When they entered the apartment, they saw Cyril lying unconscious in the foyer. Stewart turned pale. Terrell said, “Give him artificial respiration.” “I can’t touch my brother. You do it.” “I can’t,” said Terrell. “You’re the doctor. You do it.” + +But in the end, neither of them did it. Stewart was too shaken and Terrell went to call help and an ambulance. It arrived within minutes, and one of the doctors who came rushing in saw Cyril and said, “Boy! He’s just about had it.” + +There is still, I think, some primitive terror of twins that lurks in us. It is so strong that, although we have come eons away from the kinds of superstitions that drove the Aborigines of Australia to murder one or even both of a twin set at birth, or some West African tribes to kill not just twin infants but the woman who had given birth to them, we are nevertheless mysteriously stirred and frightened when twins, born on the same day, die — or worse yet *choose* to die — at the same shared time. It arouses in us an almost primordial anxiety. *How* can it happen? It can’t, and yet it does. It happened here in 1952 when two ancient twin sisters were found withered from malnutrition in a Greenwich Village apartment, only to expire within hours of each other and their discovery. It happened in a North Carolina mental institution in 1962 when twin brothers, hospitalized for schizophrenia, were found dead within minutes of each other in separate ends of the hospital. The simultaneous or nearly simultaneous death of twins happens rarely, but when it does, it seems like some mysterious arithmetical proposition far beyond the ordinary computation involved in life and death. + +And yet sometimes there was humor connected with the Marcuses’ twinship. Once, when they were interns at Mount Sinai, they had participated in a hospital show, one twin exiting stage left just as his brother entered stage right, dressed alike, moving alike, trick photography in the flesh; it brought the house down. But for the most part, the stories that have accrued around the Marcus brothers are neither humorous nor focused on their attractive looks, nor even on the outstanding gynecological textbook they wrote in 1966. + +The words used to describe the Marcuses by even the most psychologically unsophisticated — words like “remote,” “distant,” “icy” — are the classical language used in psychiatric textbooks to describe schizoid personalities. Although some years ago Cyril, when married, displayed photographs of his children in his office, and Stewart was known to talk admiringly of their doctor-father, in the last few years of their life they seem to have felt connected to no one, except, perhaps, to each other. They had always been extraordinarily close and had shared, in their adolescence in Bayonne, New Jersey, and their college days at Syracuse University, the same aspirations, achievements, and goals. Sometimes this caused distress in people around them. + +One woman — a physician — recalls the Marcuses well because they were gynecological residents in the hospital where she delivered her first child 20 years ago. She remarked to me: “Having the Marcuses was a horrible experience; one would check with his fingers to see how far I was dilated — standard procedure, but never very pleasant — then he would call his brother, and have him check too. They did this twice. It was painful enough to have two people do it. And unnecessary. I finally had to have my husband demand that they stop this. It was as if one couldn’t have an experience without sharing it with his brother.” + +At the same time, the brothers seem to have feared alienating each other. Or at least Stewart feared alienating Cyril. A woman who was Cyril’s patient and grew to dislike his personality nevertheless felt that the Marcus twins had an expertise with women who had previously miscarried and now wanted to give birth. On one occasion she recommended such a friend to Stewart, explaining to her friend that she was sure she would not be able to bear Cyril’s icy mannerisms. The friend called Stewart and said she had been recommended to him by a patient of Cyril’s. Stewart refused to see her. “I can’t take patients away from my brother,” he explained. The woman argued with him. “I am not Cyril’s patient; my friend was Cyril’s patient and she has recommended you.” Stewart, this woman recalled, “grew apoplectic and he said he would never see my friend or me.” + +The Marcuses seem to have found in their twinship a proof of specialness, of their unique importance in a world of singletons. Sometimes that feeling was expressed in harsh, cruel ways. I know this because of a conversation I happen — eerily — to have had two weeks before the announcement of their deaths, with a woman who was explaining to me how it had felt to have twins. In retrospect, it seems amazing to me and to Arlene Gross that she and I had been talking about the Marcuses on a rainy Sunday as one of them already lay dying. Mrs. Gross had said to me that afternoon, “I didn’t know I was going to have twins. Still, I suspected it. There are twins in both my husband’s and my own families. But no one believed me. The obstetrician — a Dr. Marcus — certainly didn’t. On one of my visits I told him I thought maybe I was carrying twins, and he got peculiar, hateful and cold. I’ll never forget it. He stared at me and he said, ‘You pregnant women are all alike. Just because you overeat and get fat, you think you are going to have twins.’ He spoke to me with such contempt. It was as if I’d said I thought I was going to have the Messiah, as if giving birth to twins was something too special for the likes of me. Which was funny, since *he* was a twin.” + +There is one essential of personality that emerges in all these accounts, whether they deal with the twins’ closeness, their feelings about their twinship, or their awe of each other. It is that they were frequently hostile, even hurtful, to their women patients. Curiously, in view of their ultimate gaunt condition, they often seemed to insult women about their weight. The woman who gave birth to twins had been told she was fat; still, she was heavy at the time and she felt that the insult had been just, if cruel. But another woman who was five feet, eight inches tall and weighed, toward the end of her pregnancy, 155 pounds — a gain of only 20 pounds over her normal weight — was told by Cyril, “You’re disgustingly obese.” + +And there is another common thread in the accounts patients give of the Marcuses. It is that they could not abide disagreement. They seem to have grown paranoid and angry whenever they were questioned. One woman I spoke with tells an anguished story of being scheduled by Cyril for an operation three years ago, only to have had him fail to keep the appointment. She was in the hospital and already being prepped for the operation when she received a phone call from him. He explained to her in ordinary tones that the operation would have to be delayed till the afternoon because the doctor who was using the operating room at present was running late. The woman accepted the explanation. Afternoon came and once again the nurses started prepping her and once again there came a telephone call from Dr. Cyril Marcus. Again, still reasonable, he explained with some solicitude that he could not perform the operation. He would do it the next morning. When he called her the third time — the next morning — he suddenly announced that he had decided to postpone the operation and do a biopsy. “And this was the odd part,” said the woman. “I had always before found him pleasant, nice. When he told me — and later my husband — that now he had decided to do something different with me instead of operating, we felt it was certainly our right to know why he had changed his mind. But once we began questioning him he flew off the handle, became overwrought. He couldn’t brook being questioned. And he spoke so strangely that my husband decided I should just leave the hospital and seek another gynecologist. I did. I had the operation. It was fine. And I never went back to Cyril.” + +Jean Baer, writer and author with her psychologist husband, Dr. Herbert Fensterheim, of the recent book on assertiveness training *Don’t Say Yes When You Want to Say No*, was a patient of Stewart’s until just a year ago. “Most of the time I saw him, I was working full time as well as writing. My time was very important to me. I’d developed the habit — when it came to doctors and dentists — of always calling their offices prior to setting out from my home for appointments, just to be certain they weren’t running late. Several times when I’d call before an appointment with Marcus, the secretary there would tell me, ‘Yes, he will be free in 15 minutes,’ and so I’d leave my office and get up there, but when I’d arrive, he’d be nowhere to be seen. And it wasn’t as if the secretary had made a mistake. I could see she was embarrassed. She had no idea where he was. She’d just been told to answer calls that way. I’d have to wait and eventually he’d show up. But worse, once I needed him in an emergency and the secretary told me he never left a number where he could be reached.” + +Despite these provocations, Ms. Baer continued seeing Stewart Marcus. She even continued seeing him after a time when, just before she was to leave on a vacation, Stewart failed to keep his promise to see her, and Cyril — telephoned for advice — lashed out at her over the wires. + +“All I wanted was to know whether Stewart was going to be able to see me before I left and, if not, what to do about a certain problem I had. Cyril started screaming. I mean *screaming*. No one has ever spoken to me that way in my life.” + +In my own experience, I can think of almost no other occupation but medicine in which explosive, paranoid, peculiar behavior is so long tolerated. In an office, in a shop, even in political life, there are checks and balances and interactions which eventually serve to inform and protect and dissuade the public. This is not true in medicine with its private-practice secrecy and the unwillingness of doctors to criticize their peers. Patients can, of course, leave doctors. But there IS almost no way they can communicate to other, less-wary patients what their own ex­periences may have unveiled. + +Nor had the kind of excitable, angry behavior which Ms. Baer describes arisen in the twins only recently. One quite medically sophisticated woman who had used Cyril as her obstetrician ten years ago reported to me that he had grown violently angry with her when she had told him that, because she was an older woman and feared she might give birth to a mentally retarded child, she wanted him to arrange with the hospital pediatrician to administer to her newborn a PKU test — a test for mental retardation now required by law and automatically given to all infants born in New York State. The test was not yet law at the time, however, and Cyril Marcus was enraged at the request. He told the woman the idea was ridiculous, that he had not even had the test for his own children, and that she was being grossly demanding. Shortly before she gave birth, the test did become standard procedure, but, if anything, this made Cyril even more angry and hostile to her. + +What of their colleagues? While they speak less freely than do the patients, they too reveal a dark side of the doctors. Dr. Myron Buchman, a prominent New York Hospital gynecologist and longtime colleague of the Marcuses’, says, “No one really knew them well.” Another doctor at New York Hospital with whom I spoke said, “No one was shocked at their deaths. They were isolates and had always kept to themselves.” A third gynecologist, Dr. Stanley Birnbaum, said, “There was no one they were really friendly with at the hospital,” and explained, “everybody felt they were sick, somehow, but just what was the nature of their illness, if any, I have no idea.” + +In general, the picture that emerges of the Marcuses is of two men who shared a psychological disturbance that antedated their extreme barbitu­rate addiction and eventual death. It is common for identical twins to share psychological traits and capabilities as well as physical similarities. Thus we have had many sets of twins who enter the same professional field as one another and achieve almost equal prominence — the playwrights Anthony and Peter Shaffer, the painters Raphael and Moses Soyer, the doctors Alan and Manfred Guttmacher. Identical twins tend to resemble each other — even when reared in different households and economic settings — in such things as IQ, mathematical ability, musical talent, degree of self-confidence, and even in mental disease and the rate at which it develops. They do not show a greater incidence of such disease than do other members of the population, but when one twin develops a mental illness, the risk of its development in the other is very high. Illustrations of this are so dramatic and convincing that twin re­search has become the backbone of the growing psychiatric conviction that such mental illnesses as schizophrenia and manic-depressive disease are genetically transmitted. + +It is therefore not unlikely to as­sume that both the Marcuses deteri­orated from the same mental illness at the same rate. Nor is it necessary — or even sensible — to ask, “What made them die?” if the implication of the question is, “Who did it? What woman or man? What disappointment?” For many years the brothers had been withdrawn, isolated, suspicious. At some point they intensified their isolation by seeking the increased withdrawal and somnambulism that barbiturates offer, and in the end they opted for — or simply grew too weak on drugs to consume any more and thus ward off — the ultimate somnambulism of the grave. Theirs is a story of a slow groping toward death on the part of two men who already had but a tenuous connection with people — and that connection, after all, is life. + +Thus, in the operating room one day last year, one of the Marcuses pulled the anesthesia mask off a patient and placed it over his own face, longing for unconsciousness and extinction. It was for this — and other similar reasons — that so many of those who knew the Marcuses said they were not surprised by the brothers’ death, and seemed even to have anticipated it. But why hadn’t they shared their suspicions, blazoned them about town? And why had New York Hospital waited so long to initiate the twins’ dismissal, when years ago the brothers were already showing signs to patients of dangerous mood shifts and impersonality? + +These days, I find I am disillusioned with all the colleagues of the Marcuses who knew how sick and unreliable the twins were, but who felt it necessary, out of medical solidarity and a self­-serving sympathy for troubled peers, to keep silent — up to and even after the bitter end. I find I keep asking myself, Who was that woman whose anesthesia mask was removed? It might have been me or you. + +- [Seeing Double: 16 Essential Identical-Twin Movies](https://www.vulture.com/article/the-16-best-identical-twin-movies.html) +- [Rachel Weisz Plays God (Twice Over) in *Dead Ringers*](https://www.vulture.com/2023/03/dead-ringers-trailer-release-date-cast.html) +- [Grab a Bite With Two Rachel Weiszes in This Exclusive *Dead Ringers* Clip](https://www.vulture.com/2023/03/dead-ringer-rachel-weisz-amazon-prime-clip.html) + +[See All](https://www.vulture.com/tags/dead-ringers) + +‘Dead Ringers’: The Strange Death of the Twin Gynecologists + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/What Was Twitter, Anyway.md b/00.03 News/What Was Twitter, Anyway.md new file mode 100644 index 00000000..1fb688e8 --- /dev/null +++ b/00.03 News/What Was Twitter, Anyway.md @@ -0,0 +1,183 @@ +--- + +Tag: ["🤵🏻", "🐥", "🌐"] +Date: 2023-04-23 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-23 +Link: https://www.nytimes.com/2023/04/18/magazine/twitter-dying.html +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: [[2023-04-25]] + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-WhatWasTwitterAnywayNSave + +  + +# What Was Twitter, Anyway? + +![A color photograph of a nest filled with trash, including cigarette butts, a soda tab, wire, chewed-up bubble gum and a blue feather in the middle.](https://static01.nyt.com/images/2023/04/23/magazine/23mag-twitter1/23mag-twitter1-articleLarge.jpg?quality=75&auto=webp&disable=upscale) + +Credit...Photograph by Jamie Chung. Concept by Pablo Delcan. + +The Great Read + +Whether the platform is dying or not, it’s time to reckon with how exactly it broke our brains. + +Credit...Photograph by Jamie Chung. Concept by Pablo Delcan. + +- April 18, 2023 + +### Listen to This Article + +Audio Recording by Audm + +The trouble began, as it usually does, when I saw something funny on my computer. It was the middle of the morning on a Wednesday, a few years back, and I came across news that Le Creuset, the French cookware brand, had made a line of “Star Wars”-themed pots and pans. There was a roaster made to look like Han Solo frozen in carbonite ($450) and a Dutch oven with Tatooine’s twin suns on it (“Our Dutch oven promises an end result that’s anything but dry — unlike the sun-scorched lands of Tatooine”; $900). A set of mini cocottes had been decorated to resemble the lovable droid characters C-3PO, R2-D2 and BB-8. + +I was also looking at Twitter that day, something that I can say for sure not only because of what happened next, but also because I look at Twitter just about every day. (This is not terribly unusual in my profession — I am an editor at The New York Times Magazine — but I think it should be stated clearly upfront that I have something of an acute problem with it.) I took a screenshot of the cocottes and uploaded it to the site. I wrote, as an accompanying caption, “The Star Wars/Le Creuset pots imply the existence of a Type of Guy I find genuinely unimaginable...” — just like that, ellipsis and all. I hit send. I guess I went back to work after that. My email records show that I sent a big edit memo to a writer. Then, around lunchtime, things started happening. + +If you don’t use Twitter — which is perfectly normal; about three-quarters of Americans don’t — you should know that the platform has a function called quote-tweeting, which was introduced in 2015. It allows users to show a tweet they’ve encountered to their own followers, while adding their own text or image to comment on it. You often see people use this function to respond to some contrived prompt that crosses their feed (“What’s a great song that features an impressive horn section?”). Less often, though often enough that the practice has its own name, quote-tweets are used to roast and clown on people — to trot them out in front of a new audience, drop their pants and spank them. This is referred to as “dunking.” + +At some point in the early afternoon, someone dunked on me by quote-tweeting my observation and adding, in The Onion’s headline style: “Area Man Has Never Heard of Women.” My post was now in front of a new audience, and that audience was now reading it framed by what I would consider an uncharitable interpretation of my point. + +New quote-tweets started to pour in, each one putting me in front of another audience of followers, some minuscule and others quite large. “I enjoyed that this tweet manages to be sexist on multiple levels”; “#newsflash WOMEN cook and like Star Wars”; “Imagine a woman”; “Hi, have you met women?”; “Women like Star Wars. Men cook.”; “My husband is a huge Star Wars fan and is the cook in the house. He bakes too. Sorry to blow your mind.”; “i luv a good dose of homophobia and toxic masculinity in the year of our lord 2019 🙄.” My notifications flooded for the next 24 hours as the tweet continued to find its way into new corners of the site. Some people replied directly: “... are you aware that girls can like star wars too”; “Willy, get a better imagination, and cut it out with the gatekeeping”; “Men cook. Women like Star Wars. If you can’t imagine those things, that’s about you, not other people.”; “Showed my son, he’s trying to find them to order them now. Btw, he’s a Marine.” Other replies can’t be printed here. + +None of these people were *wrong*, exactly. It was true that in the split second between learning of the pots and posting about them, I had imagined a stereotypically geeky and slovenly guy as the customer, and Le Creuset as the kind of thing you put on your wedding registry — that is indeed why I thought the products were funny. It’s not as if this was a terribly original thought; I didn’t wake up and introduce to our culture, on a random Wednesday, the idea that male nerds like to buy “Star Wars” memorabilia. Nor had these broader gender corollaries — that men don’t cook, that women don’t like “Star Wars” — so much as crossed my mind. In any event, I no longer have any trouble imagining what “Star Wars”-Le Creuset customers are like. + +I was wrong on another level, too: The pots and pans were, as many Twitter users would find time to inform me, wildly popular, and are now available only on the secondary market, in some cases for multiple times their retail value. Still, wrong as I may have been, the responses I managed to provoke were stunning to me — for their volume, their woundedness, their consistency and the way the “Star Wars”-liking issue was so salient that I was called sexist for *not* associating cookware with women. Luckily, the sheer inanity of the topic offered a measure of safety you don’t typically get when you bring negative attention to yourself on Twitter. I could afford to take the anthropological view. I felt like Bill Paxton at the end of “Twister” — strapped in and able to see down the barrel of this thing and admire its beautiful, treacherous contours. + +Twitter is both short-form and fast-moving, which together make it feel conversational. Like all conversations, it’s highly context-dependent, and like all *good* conversations, it’s guided by the pleasure principle. That’s what makes it fun: Who doesn’t want to be the person who can make everyone laugh at a dinner party? But Twitter also puts your dinner-party remarks in front of people who were not invited to the dinner party, showing them exactly how little you considered them before chiming in. And, of course, no one involved is having fun at a dinner party at any point in this process; everyone is, like you, probably alone, on the computer, experiencing the feeling we used to know as boredom. + +Though it didn’t feel this way at the time, as I look back now, it’s clear that no one was actually *upset* about the “Star Wars” thing, not in any meaningful sense. A couple of people tried to draw a connection between my retrograde outlook on novelty Dutch ovens and my employer — always an alarming development — but mostly it was low-effort clowning that felt charged only because it was traveling along such high-energy vectors (sexism, homophobia, “Star Wars” fandom). The platform can coax this exact sort of response out of its users with an incredibly small amount of effort. It’s only on the receiving end, where all these messages collect in one place, that it feels oppressive. + +This sort of thing is happening to dozens of people at any moment on Twitter, routinely enough that it’s more than some unfortunate externality, though not so often that you’d say it’s the *point* of the platform. (It, too, has a name: “getting ratioed.”) You have a few options when this happens. In theory, you can just log out and wait for it to end, but no one does that, because who knows what might happen when you’re not watching. You can go private, which basically ends it, though in a way that looks like admitting defeat. (I did this, briefly, so I could go to sleep that night.) You can delete the tweet, or even delete your whole account. But you can also do what I chose to do the next morning, which is to continue posting about it, because it’s fun, and because it really doesn’t take much effort at all. That’s basically the whole problem right there. + +This all happened on and around Dec. 4, 2019. Though none of us knew it at the time, a mysterious new respiratory disease had just begun circulating in central China. This would set in motion a spectacular series of events that would make Twitter the focal point of pitched battles about freedom of speech, community health, racial justice and American democracy. At the same time, the pandemic and the federal response to it would create bizarre macroeconomic dynamics that would help one man grow his net worth *tenfold* in two years, transforming him from a high-profile but middle-of-the-pack billionaire into the wealthiest man in human history. For a time, anyway. It appears that [Elon Musk was troubled enough by Twitter’s role](https://www.nytimes.com/2022/10/27/technology/elon-musk-twitter-deal-complete.html) in the discourse battles that he felt he should control it himself, and $44 billion later — nearly double his entire net worth at the outset of the pandemic — he has his wish. + +> ## What exactly have we been doing here for the last decade and a half? + +Musk has done many things to Twitter, both the app and the business, during his six months as chief executive and owner. He has laid off more than half the staff, changed the interface and functionality of the product and aggressively pushed users to sign up for a paid subscription version of the service. He says that usage has gone up, but because he has taken the company private, we only have his word on that. According to most estimates, ad spending has plummeted. Musk himself has reportedly estimated that the company is now worth about $20 billion, a negative 55 percent return. He has, meanwhile, enlisted a small group of journalists — many of whom have taken a political journey similar to Musk’s in recent years — to sift through company emails and Slacks in an effort to reveal overreach on the part of the old regime in its management of the global conversation. They published reams of lightly redacted emails, showing regular correspondence between Twitter’s trust-and-safety team and the F.B.I., and other organs of the state, which apparently spend a considerable amount of time scrutinizing individual Twitter accounts. + +Musk’s takeover of the platform has not only strained the dinner-party metaphor (a new host comes in and dominates the conversation, demanding money from you and accusing the hosts from before of being F.B.I. stooges?); it has also strained the sense of conviviality that made Twitter feel like a party in the first place. The site feels a little emptier, though certainly not dead. More like the part of the dinner party when only the serious drinkers remain. Whiskey is being poured into wineglasses, and the cheese plate has become an ashtray. It’s still a great time — indeed, it’s a little looser — but it also feels as if many of us are just avoiding the inevitable. Eventually, we’ll scrape the plates, load the dishwasher and leave the pans to soak (“Hey, cool Dutch oven — are those the twin suns of Tatooine?”). It’s possible the party will stretch on until sunrise, when the more sensible guests will return. But for now, someone just turned up the lights, and it’s probably time to ask ourselves: What exactly *have* we been doing here for the last decade and a half? + +**A number of** narratives have developed over the years to explain what Twitter has been doing to us. There was, in the wake of Trump’s election, the focus on Russian “bots” and “trolls” — two words often used interchangeably, though they mean totally different things — sowing discord and amplifying divisive rhetoric. As the Trump years progressed, this evolved into a broader concern about “disinformation,” “misinformation” and whether and how Twitter should seek to stop them. And behind all this lurked vague concerns about “the algorithm,” the exotic mathematical force accused of steering hypnotized users into right-wing extremism, or imprisoning people in a cocoon of smug liberalism, or somehow both. + +Those narratives all express fears about what happens when people *consume* information online, but they have little useful to say about how or why all that information is produced in the first place. After all, everything you read on Twitter, whether it comes from the president of the United States or your local dogcatcher, is a result of the process known as posting. And only a small proportion of users post. There is a lot of research on this topic, and it can be bracing reading for the Twitter addict. In 2021, the Pew Research Center took a close look at about 1,000 U.S.-based accounts, plucked out of a bigger survey of the site. This sample was split into two — the “most active users,” who made up just 25 percent of the group, and the rest. Statistically speaking, no one in the bottom 75 percent even posted at all: They produced a median of zero posts a month. They also checked the site far less frequently and were more likely to find it uncivil. + +There’s also some data about the heavy users, and though Pew would not approve, let’s pretend, for our purposes, that it can be used to make a composite sketch of one. We’ll call him Joe Sixpost. Joe produces about 65 tweets a month, an average of two a day. Only 14 percent of his output is his own material, original stand-alone tweets posted to the timeline; half of his posts are retweets of stuff other people posted, and the remainder are quote-tweets or replies to other tweets. None of this stuff travels far. Joe has a median of 230 followers, and on average his efforts earn him 37 likes and one retweet a month. Nevertheless, it is heavy users like this — just the top quartile — who produced *97 percent* of the larger group’s posts. + +Let me be frank: These are pathetic numbers. Over the last 48 hours, I have made 14 posts. Five were “original” posts to the timeline. I also retweeted a writer I work with, my twin brother and Grover Norquist, and replied to tweets replying to my own. Thus, in two days, I put myself on track to make 210 posts a month. (I won’t mention the like and retweet numbers, but suffice it to say I had individual posts that absolutely *rinsed* Joe Sixpost’s monthly counts.) And this was a period during which I took care of my young child, did garbage duty in my building, tried to go grocery shopping but discovered I had a flat tire, walked to a different store, cooked dinner (that’s right), read, watched “Party Down,” slept, got my kid to day care, changed the flat tire and worked on this article. I didn’t even think I was on Twitter very much. But because my posts go out to so many more accounts than even an “active user” like Joe Sixpost’s do — by a factor of 100 — I’d still do more to shape reality on the platform even if I posted less frequently than he did. Which, as we’ve established, I don’t. + +People afflicted with this unyielding desire to post are rare enough that we probably aren’t easily captured in studies like Pew’s. If you pick a thousand people at random, you might not find many of us, and if you do, our derangement will be smoothed out into averages and obscured by medians, blinding you to the fact that the bulk of your Twitter reading comes from a tiny minority of the population that shares this peculiar deficiency with me. When we talk about the problems created by Twitter, we focus on what happens when people read the wrong sort of post, like disinformation from a malign actor. If we consider the posting side of things at all, it is to lament the excesses of cancel culture — typically from the receiving end. But if we really want to understand what Twitter has done to us, surely it would make more sense to account for the millions and millions of more ordinary posts the platform generates by design. Why has a small sliver of humanity taken it upon themselves to heap their thoughts into this hopper every day? + +Part of answering this question involves realizing that a tweet isn’t just a matter of one person speaking and others listening. Kevin Munger, an assistant professor of political science and social data analytics at Penn State — he also happens to be an acquaintance of mine — thinks of this confusion as the overhang of the “broadcast paradigm” in an era when it is no longer relevant. Many people conceive of tweets as analogous to TV or newspaper or radio — that “there are people who tweet, there are people who read the tweets,” as Munger puts it. “And the tweet is just text, right, and it’s static.” + +But there is no such separation between creator and consumer, and that’s not what a tweet is. “If you look at a tweet, it’s always already encoding audience feedback,” Munger points out. Right beneath the text of the tweet is information about what the network thinks of it: the numbers of replies, retweets and likes. “You can’t actually conceive of a tweet except as a synthetic object, which contains both the original message and the audience feedback,” he explains. In fact, a tweet contains layers of information beyond that: not just how many people liked it or replied, but who, and what they said, and how *they* present themselves, and whom they follow, and who follows them, and so on. Every post contains within it a unique core sample of the network and its makeup. And whether they admit it or not, Munger says, all of this helps users build mental models of the platform. + +Munger is highly pessimistic about our ability to use Twitter to debate or deliberate anything of importance. Instead, he suggests, we use the site as a “vibes-detection machine” — a means of discovering subtle shifts in sentiment within our local orbits; a way to suss out, in an almost postrational way, which ideas, symbols and beliefs pair with one another. (If this sounds fanciful to you, ask a heavy Twitter user what set of political commitments is signified by using a Greek statue as an avatar.) But it’s hard to detect vibes unless you put a signal out there first; there’s no way to grasp the thing from outside looking in. “In order to understand how it works,” Munger says, “you have to act on it and allow it to act on you.” You have to post. + +Image + +![A color photo illustration of a blue bird holding an extinguished match in its mouth.](https://static01.nyt.com/images/2023/04/23/magazine/23mag-twitter2/23mag-twitter2-articleLarge.jpg?quality=75&auto=webp&disable=upscale) + +Credit...Photo illustration by Jamie Chung. Concept by Pablo Delcan. + +**Nick Bilton’s 2013** book, **‘**‘Hatching Twitter,” was disorienting reading for me, because it took me back to a place I thought I knew well: San Francisco, 2006. I was in college at the time, but I grew up in the city and went back for all my breaks. The summer he founded Twitter, Jack Dorsey was hanging out in the Mission and working South of Market. So was I. We both had recently learned how to send text messages and enjoyed visiting Dolores Park. The difference between us was that Dorsey was about to take a central role in the industry that would remake our city and convulse the entire planet in the bargain, and I was mostly just hanging out with my friends. + +Back then, the social internet was a more naïve and hopeful place. Just look at Dorsey, whose Flickr account from the era is still up and public. You can see all sorts of relics from Dorsey’s prebillionaire social life in and around the city: trips to Coachella and Point Reyes, arty photographs of street signs. And in the mix, you can find [screenshots of early Twttr,](https://www.flickr.com/photos/jackdorsey/188430472/) as it was known. The logo is green, bubbly and sweaty; it looks like a new flavor of SoBe. [The very first layout](https://www.flickr.com/photos/jackdorsey/182614595/) looks nearly identical to Craigslist. “What’s your status?” it asks at the top, and below you can see Dorsey’s colleagues responding. “Preparing a pizza,” writes Florian Weber, one of the project’s first engineers. “having some coffee,” offers Biz Stone, another founder. “so excited about new odeo ideas,” writes Evan Williams, whose start-up Odeo employed Dorsey and was helping develop this new concept that would swallow it whole. + +Dorsey had nurtured the basic idea of Twitter for years — a site that would be like AOL Instant Messenger’s “away message” for anywhere, or “a more ‘live’ LiveJournal,” as he put it in a post on Flickr. He wanted to call it Status, and it was important to him that the service be principally social. In his book, Bilton recounts how Dorsey initially considered and dismissed using audio as a medium because it would be impossible to use at a nightclub. That was, in Dorsey’s mind, a key use case. But Williams, who created Blogger and sold it to Google for millions, came to see something else in Twitter: To him, its potential lay in its ability to create a running record of what was going on in the outside world. The book recounts a somewhat absurd, but revealing, philosophical argument between the two founders. If one of them were to see a fire on Market and Third, in downtown San Francisco, and tweet about it, would he be tweeting that there was a fire on Market and Third? Or would he be tweeting that he was witnessing a fire on Market and Third? Dorsey was insistent that it was the latter: “You’re talking about your status as you look at the fire.” + +To Dorsey, the fact that Twitter creates a record of the world would be an incidental byproduct of all this status-sharing. But as time went on, and more people joined, the Williams view came to look prophetic. It would be vindicated on a January afternoon in 2009, when an Airbus A320 taking off from LaGuardia collided with a flock of geese over the Bronx, losing power in both engines and forcing the quick-thinking pilot to ditch the plane in the Hudson. A businessman named Janis Krums was on a ferry to New Jersey when the boat’s captain announced that a plane was down in the water, and they were going to see if they could help. Krums figured it was a small single-engine craft, and was stunned when they pulled up to a commercial airliner. He had an iPhone, and he took a picture of the plane in the icy water, with passengers crowding onto life rafts. He posted it to Twitter with a brief caption. Krums handed the phone to one of the rescued passengers, who wanted to call his loved ones, and forgot about it amid the rescue efforts. By the time he and his phone were reunited, about 30 minutes later, it had exploded with messages and missed calls from news agencies. “The tweet had gone around the world,” he told me. “And I had no idea.” The biggest story of the day had been broken by some random guy with a smartphone. Reporters called it so many times that they drained Krums’s battery within an hour. He was finally able to make it back to Jersey by nightfall, at which point he was being interviewed on morning radio in Australia. + +Later that year, Williams, having ousted Dorsey to become Twitter’s chief executive, would change the site’s prompt from “What are you doing?” to “What’s happening?” as it remains to this day. But if that seems like a clean victory for Williams, it wasn’t quite. Because what Krums wrote was exactly what *Dorsey* had imagined; it was about not just the plane but also the fact that he, Krums, was looking at it. “There’s a plane in the Hudson,” [he wrote](https://twitter.com/jkrums/status/1121915133?lang=en). “I’m on the ferry going to pick up the people. Crazy.” + +Twitter could never be just about the outside world or about our internal ones; it would always have to be both. Dorsey and Williams were correct to identify this as a conflict, even if they could not design or engineer it away. These two repellent magnets were fused together and left under the platform’s floorboards. More and more people joined, hoping to learn what was happening in the world and to share what was happening in theirs. Eventually, the situation that obtained was altogether stranger than Williams or Dorsey could have imagined. + +**Twitter took off** first with geeks in San Francisco, and then with people in the tech-media-music orbit at South by Southwest in 2007. From there, it continued to annex populations prone to graphomania (reporters, rappers, academics) and those that just had more things to say than opportunities to say them (comedians, editors, TV writers, lawyers). Twitter quickly figured out that its value lay in its ability to surface conversations: What was the world talking about? In 2008, it began plumbing its depths to identify trends. These were the early days of the Big Data era, and the idea was that within all the chatter could be found some hidden rhythm, a form of crowd wisdom. It wasn’t long before people got the idea that they could harness Twitter’s firehose of information to do things like trade stocks — one hedge fund, started in 2011, promised 15 to 20 percent returns based on its algorithmic ability to divine market movements. It shuttered after a month. + +Twitter’s takeover of the media class was rapid. In April 2009, Maureen Dowd [interviewed Williams and Stone](https://www.nytimes.com/2009/04/22/opinion/22dowd.html), telling them that she “would rather be tied up to stakes in the Kalahari Desert, have honey poured over me and red ants eat out my eyes than open a Twitter account”; she signed up three months later to promote her column. Later that spring, [a Time cover story](https://content.time.com/time/subscriber/article/0,33009,1902818,00.html) noted that Twitter users had begun using the site as a “pointing device” and sharing longer-form content. (“It’s just as easy to use Twitter to spread the word about a brilliant 10,000-word New Yorker article as it is to spread the word about your Lucky Charms habit.”) This would make it an incredible way to keep up on the news — and absolutely irresistible to journalists. By the next year, the Times media reporter David Carr was writing [an ode to the site](https://www.nytimes.com/2010/01/03/weekinreview/03carr.html), correctly predicting it was more than a fad and lauding it for both its relative civility and its “obvious utility” for information-gathering. “If all kinds of people are pointing at the same thing at the same instant,” he wrote, “it must be a pretty big deal.” + +I am told by my superiors here at The Times that there was a time when journalists would talk about what they’d been reading at the bar, or at cocktail parties. One of these people told me, and I don’t think he was kidding, that an article of his went viral by *fax machine*. I’ll have to take his word for it, because I’ve never known a life in journalism free from the gravitational pull of Twitter. In fact, I probably owe my career to it. In 2011, I wrote an essay for a website called The Awl, and the very thing that Carr described happened: The article, which was [about the McRib](https://www.theawl.com/2011/11/a-conspiracy-of-hogs-the-mcrib-as-arbitrage/), went viral on Twitter, putting my work in front of editors at places like The Times. A few months earlier, I was at the precipice of giving up on writing; within about a year, I would be regularly freelancing. After a while, I had a full-time job as an editor. + +There was, around this time, an enormous expansion in web media, with BuzzFeed, Vice and others pouring truckloads of venture capital into the field. And though Twitter never drove much traffic, it was nevertheless important for journalists to be there, because everyone else was there; this was where your articles would be read and digested by your peers and betters (as well as, theoretically, the reading public). It was doubly important because of how precarious these new jobs were. Your Twitter profile was also your calling card, potentially a life raft to a new job. The platform was an extremely fraught sort of LinkedIn, one you would use to publicly waste company time. + +Looking back, it’s hard not to see this as a tragic bargain. Twitter took the wild world of blogging and corralled the whole thing, offering writers a deal they couldn’t refuse: Instant, constant access to an enormous audience, without necessarily needing to write more than 140 characters. But they would never again be as alone with their thoughts, even when they were off the platform. Twitter follows you, mentally, and besides, anything can be brought back there for judgment. Perhaps worst of all, they would be gently cowed into talking about whatever it was everyone else was talking about, or risk being ignored, and replaced by someone who would. + +But this journalistic swarming instinct made Twitter an ideal place for activists to get a message out. If there is one good thing that can be said about Twitter, it’s that it really was democratizing: It allowed the previously voiceless to walk right up to the powerful and put stuff right in front of their faces, at any time of day. The Green Revolution in Iran, the Tahrir Square protests and Occupy Wall Street — all of these made use of Twitter in creative ways. Two of the biggest social movements of the last decade are often rendered as one word with a hashtag attached to it. The real action of Black Lives Matter may have taken place in the streets, and the long-delayed consequences of Me Too delivered in boardrooms or courtrooms, but these movements couldn’t have begun if they could not corral and excite latent political energies via social platforms. + +Really, Twitter was good for getting *any* sort of message out there. Governors and senators, Shaquille O’Neal and Sears; Mahmoud Ahmadinejad, the American Enterprise Institute and Chrissy Teigen; the Dalai Lama, Rachel Maddow and the guy who does “Dilbert” — all could use the same exact tools to be heard, and to hear, at all hours of the day. For some, it was their job to get a message out; for others, an ancillary goal; for others still, a reluctant undertaking done in the name of relevance. In any event, the barrier between work and goofing around grew dangerously thin, especially as more influential people and entities arrived. + +Because as soon as Twitter began bringing all these people together, it amounted to an irresistible target. Twitter was an exceptional tool, above all else, for making jokes. Some groups elevated it to an art, profoundly transforming the folkways and language of the platform — “Black Twitter” chief among them. There was also “Weird Twitter,” an unfortunate label that refers as much to a specific group of people as to the sensibility they shared. What Weird Twitter posters had in common, beyond being (mostly) funny, was a special brain damage that granted them access to the hidden frequencies of the internet. + +In 2010, a young Canadian named Stefan Heck joined Twitter in search of Vancouver Canucks news but soon fell in with what would become the Weird Twitter crowd. Lots of corporations had come to Twitter to offer quick customer service, and Heck and his friends enjoyed messing with them. (Like tweeting at PetSmart: “if my turtle stops moving after i smoke it out its just sleeping right?”) One hashtag that often trended in those days was `#tcot`, the “Top Conservatives on Twitter,” and Heck and his friends often found their way there in search of a good time. Heck recalls it being full of “you know, 70-year-old guys, like, retired boat salesmen and dentists.” He can’t remember for sure, but he believes this is where they eventually found the 1980s TV star Scott Baio, who was and remains a conservative culture warrior. + +Unlike other celebrities on the platform, Baio would actually respond to people. “He felt like a real guy who posted,” Heck says. “He was in it for the love of the game.” In 2011, when Heck and friends started asking him if he was an adult-diaper fetishist, Baio snapped, blocking everyone who asked him about diapers and tweeting to complain about it. Heck and others started posting “#RIPScottBaio,” and apparently did so with enough volume that it became a trending topic, persuading some untold number of people that the actor had died. Someone reportedly edited Wikipedia to certify his death from “diaper-related illness.” By the next day, NBC’s “Today” show was debunking the claim on its website. + +To Heck, the Baio episode showed how small and wide-open the site was — how it could be gamed. (The incident was brought to my attention when I asked Mike Caulfield, a research scientist at the University of Washington’s Center for an Informed Public, if he could think of any watershed moments in Twitter history; he thought it was interesting for more or less the same reasons.) A small conspiracy could capture the platform’s homuncular version of reality and tickle it until it shouted nonsense. Indeed, Twitter’s own insistence that it could connect the whole world and surface the most engaging conversations amounted to an enormous “KICK ME” sign on its back. It had grown from a place where people shared *what they were having for lunch* to one that was either changing the world or purely self-contained, a pearl of heightened reactions accreting around a tiny grain of provocation. No one was ever really sure which. + +But if you were good at the game, it could be good for you, both on Twitter and off. People got commissions and book deals — not many, but enough. Some people lost their jobs — not many, but enough. A couple of people got TV shows out of it. Once, someone told a story so wild it was turned into a feature film. Hell, one guy even went and got himself elected president. + +Image + +Credit...Photograph by Jamie Chung. Concept by Pablo Delcan + +**The election of** Donald Trump made Twitter an extremely fraught environment. Did you hate the way the media reported on him? They were all there to tweet at about it. Did you blame everything that was happening on people slightly to your left? Slightly to your right? A random podcaster? Someone you didn’t know existed until five seconds ago? They were there, too. And, of course, so was the president. Some of his opponents suspected his election might be the fault of the platform itself. This idea gave us a solid six years of discourse on Russian bots and trolls and disinformation, though none of this, according to a recent study in Nature, had any meaningful effect on voters’ 2016 decision-making. In all the bickering, it was easy to lose track of what was keeping us on Twitter in the first place. + +One compelling theory comes from Chris Bail, a sociology professor at Duke, who began studying Twitter in the years when these debates were raging. Bail was especially curious about the “filter bubble,” the idea that social media platforms encircle users with opinions they share, causing them to be less amenable to arguments from the other side. Bail had read research showing that social media has actually given people a more diverse information diet. “Even convincing people that that’s true is really hard,” he told me, because there is an enormous apparatus of talking heads telling them otherwise. + +So Bail and his colleagues designed an experiment to test the filter bubble: They exposed partisan Twitter users to a bot that would retweet counterpartisan speech 24 times a day, for a month, and interviewed participants before and after. In the end, they showed that the reality was stranger than the theory: The more attention respondents paid to the bots, the more entrenched they became in their beliefs. These results were especially true of conservatives. Bail even saw some participants yelling at the experiment’s bots. “This happened so often that three of the most extreme conservatives in our study began following each other,” Bail writes in his book “Breaking the Social Media Prism.” “The trio teamed up to attack many of the messages our liberal bot retweeted for an entire week, often pushing each other to make increasingly extreme criticism as time passed.” + +Bail argues that Twitter is a “prism” that bends both the depiction of reality you see through it and your own efforts to show who you are to the world. The platform, Bail writes, taps into the human desire to “present different versions of ourselves, observe what other people think of them and revise our identities accordingly.” People like to think of social media as a mirror, he told me: “I can see what’s going on, and I can see my place in what’s going on.” But Twitter is not a random sampling of reality. Almost all the feedback you receive on the site comes from its most active users. “And the most active social media users,” Bail says, “are a weird group of people.” Somehow this fact doesn’t override our desire to fit in, which is then pointed in strange directions: “We see this distorted reality,” Bail says, “we understand it as reality, and we react accordingly.” As we all do this, together, we create feedback loops that further warp the projection of reality. (You could see this dynamic especially clearly at the height of the pandemic, when Twitter’s feed was some people’s primary porthole to the outside world.) + +One thing Kevin Munger pointed out to me is that Twitter users are running Bail’s experiment on one another constantly. Pervasive quote-tweet dunking, for example, is often used to highlight the most galling ideas coming from one’s political foes, feeding users outrageous caricatures of the other side. There are also numerous accounts — Libs of TikTok most notorious among them — that exist for this sole purpose: to drag speech out of its intended context in another gamified discourse, across the partisan divide, to make people mad. Bail ran his experiment for only a month; imagine doing this for about a decade. + +Bail told me that before he settled on the prism, he considered sonar as his central metaphor, because of the way Twitter allows users to send out a message and see what bounces back. This is a helpful way of thinking about Trump, whose Twitter habit was largely seen as a sideshow, a means of circumventing the press or just evidence of his terrible impulse control. It was all those things, of course. But this is also the man who discovered, lurking within the rot of the two-party system, a strange new shape in the electorate. Should we regard it as pure coincidence that he spent all those years on Twitter, with an enormous following and the sonar capabilities of an Ohio-class submarine? Even Trump’s campaign rallies and governing style had this highly provisional, posting-like rhythm to them: He tried things out, saw what worked and pocketed those moves. Is it so hard to believe that the image-obsessed salesman, up in his gilded cockpit in the vibes-detection machine, was learning something about what people wanted to hear? + +We could ask similar questions about Musk, whose increased exposure to the site has coincided with his transformation from beloved entrepreneur to substantially less beloved culture warrior. One of Bail’s chief observations about Twitter is that its prismatic qualities generate a strong effect on users: Its feedback makes very clear who your friends and enemies are. This can act as a sort of centrifugal force, pushing people deeper into the belief structures of their “team,” and pushing moderates out of the conversation entirely. We can’t know exactly why Musk seems to have become so engaged with culture-war topics, but Bail’s ideas suggest one explanation: Through the prism, he saw the most disingenuous arguments from both sides over the most contentious issues of the day, his own behavior very much included. And one side welcomed him while the other rejected him. + +Now that Musk owns the site, he has repeatedly stated that his goal is to bring back “free speech,” and he has tweeted several times about the “woke mind virus” that he believes threatens civilization. It seems he thinks it might live within his new plaything, and can be dislodged if he turns it upside-down and shakes it just right. But it’s not clear he knows where it is: Was it in the staff? He has laid off most of them now; many others have left of their own volition. Was it in their content-moderation team? He has treated Twitter’s San Francisco offices like Stasi HQ, revealing the inner workings of the previous regime. Is it in the algorithm or the UX? He has changed all that too, and continues to tinker with them, seemingly based on passing whims and grudges — or sometimes inscrutable urges. He added more metrics to every tweet, briefly changed the site’s logo to a shiba inu and obscured the “W” on the sign that hangs from the company’s Market Street headquarters. (Musk did not respond to a request for comment; Twitter’s press email autoreplied, as it apparently does to all incoming messages, “💩.”) + +The net effect of all of this has been a buggy site — and one that feels less alive. Not just because so many influential people have departed but also because Musk broke the spell. You can no longer believe that this platform offers an unobstructed view to the outside world, if you ever did, now that his hands have so thoroughly smudged up the glass. + +It’s hard to look back on nearly a decade and a half of posting without feeling something like regret. Not regret that I’ve harmed my reputation with countless people who don’t know me, and some who do — though there is that. Not regret that I’ve experienced all the psychic damage described herein — though there is that too. And not even regret that I could have been doing something more productive with my time — of course there’s that, but whatever. What’s disconcerting is how easy it was to pass all the hours this way. The world just sort of falls away when you’re looking at the feed. For all the time I spent, I didn’t even really put that much into it. + +There is a famous thought experiment in thermodynamics called Maxwell’s Demon, named for the Scottish physicist James Clerk Maxwell. Musk certainly knows it; he’s a big admirer of Maxwell’s. (He once tweeted “[Maxwell was incredible](https://twitter.com/elonmusk/status/1443268776930119680?lang=en),” but that was right around the time a cricketer named Glenn Maxwell did something impressive in an Indian Premier League match, so he just ended up confusing much of South Asia.) Maxwell proposed a means of circumventing the second law of thermodynamics, which basically states that in a closed system, disorder will increase naturally unless energy is used to stop it; heat will always dissipate into cold. What if, Maxwell asked, you had a box split in two by a wall, and a tiny being sitting atop the wall, operating a little door, and this being was clever enough to track individual molecules and know how fast they were moving? If he let only faster-moving molecules go from Chamber A to Chamber B, and only slower-moving molecules pass the other way, then, without any new energy being introduced, Chamber B would become very hot. + +This is basically a thought experiment about information overcoming the limits of the physical world, so it naturally found fans in the world of computing. The “mailer-daemon” that returns bounced emails to your inbox, for example, is one of many background processes that takes its name from Maxwell’s concept. Dorsey was enamored of the idea; he had a tattoo that read “0daemon!?” and once wrote a poem about a “jak daemon,” a cyberpunk hacker type who manipulates “the background process in small ways to drive various aspects of the world.” + +I thought about Maxwell’s Demon as I reconsidered the “Star Wars”-Le Creuset thing, and how clear it was that no one involved had even been especially angry. It’s in episodes like this that Twitter manages to violate the discursive law that, until quite recently, prevented random Australians from yelling at you when you’re trying to go to bed. In the real world, you can go 30-some years without ever encountering the sensitivities of the “Star Wars” cookware community. But Twitter can, if you tell it just the right thing, shoot every last one of them at you through a little door, creating a pocket of extreme heat without anyone having meant to do much at all. This is perhaps the central paradox of Twitter: It can produce enormous outcomes without meaningful inputs. + +I happen to know about Maxwell’s Demon only because it makes an appearance in Thomas Pynchon’s “The Crying of Lot 49,” a 1966 novella centered on a clandestine communications network that is used by a baffling array of people (anarcho-syndicalists, tech geeks, assorted perverts and cranks) and seems particularly popular in San Francisco. Instead of mailboxes, it operates through a system of containers disguised to look like trash cans; the only one of these the protagonist finds is somewhere South of Market, just blocks from where Twitter would be born. It’s a book I read 20 years ago. If I’d come to it more recently, I doubt the mention of Maxwell would have stuck in my mind, thanks to either normal aging or some irreversible damage I’ve done to my brain by staring at Twitter. + +But I’m glad I remembered it, because what I read when I pulled my copy down off the shelf was the best way of thinking about Twitter I’ve encountered. In the novella, an East Bay inventor named John Nefastis has designed a box, complete with two pistons attached to a crankshaft and a flywheel, that he claims contains the molecule-sorting demon. It can be used to provide unlimited free energy, but it doesn’t work unless there is someone sitting outside, looking at it. There was, Nefastis believed, a certain type of person, a “sensitive,” capable of communicating with the demon within as it gathered its data on the billions of particles inside the box — positions, vectors, levels of excitement. The sensitive could process all that information, telling the demon which piston to fire. Together, the demon and the sensitive would move the molecules to and fro, creating a perpetual-motion machine. The box was a closed system, separate from the outside world, but it could nevertheless do work on anything it was connected to. + +Pynchon’s protagonist tries, and fails, to operate the Nefastis Machine. But when I open Twitter, I see a lot of people who *can* talk to that demon; who can process, intuitively, the positions and attitudes of unimaginable numbers of others; who know just what to tell the demon to make things move; who are happy, or close enough, spending hours sitting with the box, watching the pistons pump. Activists, politicians, journalists, comedians, snack-food brands and Stephen King — all have taken their turn at the box. Union organizers, venture capitalists, grad students and amateur historians — they could make the flywheel turn. No one even has to do much of anything to make it move. But none of us have the power to stop it, either. And at some point — back before we really knew what we were doing — we hooked those pistons up all over the place. + +And though it seems unlikely that Twitter itself will disappear, the powerful mechanism it became over the years — the one that made an often unprofitable company so valuable in the first place; the one that allowed a collectively conjured illusion to transform the real world — seems to be sputtering and squealing, and all the noise is making it hard to communicate with the demon within. The platform could continue to operate in some form, even as the mechanism slowly rusts or eventually grinds to a halt. If that happens, the world would feel exactly the same — and utterly transformed. And I, and others, and maybe you, too, would have to contend with what we’d really been doing the whole time: staring into a box, hoping to see it move. + +--- + +Prop stylist: Ariana Salvato. + +**Willy Staley** is a story editor for the magazine. He has written about the effort to [count the country’s billionaires,](https://www.nytimes.com/2022/04/07/magazine/billionaires.html) the [TV show “The Sopranos,”](https://www.nytimes.com/2021/09/29/magazine/sopranos.html) the [writer and director Mike Judge](https://www.nytimes.com/2017/04/13/magazine/mike-judge-the-bard-of-suck.html) and [the professional skateboarder Tyshawn Jones.](https://www.nytimes.com/interactive/2019/08/29/magazine/tyshawn-jones.html) **Jamie Chung** is a photographer who has worked on nearly a dozen covers for the magazine. He won awards this year from American Photography and the Society of Publication Designers. **Pablo Delcan** is a designer and art director from Spain who is now based in Callicoon, N.Y. His work blends traditional and modern techniques across mediums like illustration, print design and animation. + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/“It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later.md b/00.03 News/“It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later.md index 6a1d83f5..57ac4750 100644 --- a/00.03 News/“It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later.md +++ b/00.03 News/“It’s Unimaginable Pain” The Everyday Affects of the Marathon Bombings, 10 Years Later.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-25]] --- diff --git a/01.02 Home/@Shopping list.md b/01.02 Home/@Shopping list.md index 69f6932f..0289c5a5 100644 --- a/01.02 Home/@Shopping list.md +++ b/01.02 Home/@Shopping list.md @@ -72,7 +72,7 @@ style: number - [x] ☕ Coffee ✅ 2022-03-01 - [x] 🍶 Coke 0 ✅ 2022-03-14 - [x] 🧃 Apfelschorle ✅ 2022-12-21 -- [x] 🍊 Morning juice ✅ 2023-04-07 +- [x] 🍊 Morning juice ✅ 2023-04-23 - [x] 🍺 Beer ✅ 2022-02-06   @@ -90,7 +90,7 @@ style: number - [x] 🧈 Beurre ✅ 2023-04-07 - [x] 🧀 Fromage à servir ✅ 2023-03-06 - [x] 🧀 Fromage rapé ✅ 2023-03-06 -- [x] 🧀 Parmeggiano ✅ 2023-04-07 +- [x] 🧀 Parmeggiano ✅ 2023-04-24 - [x] 🫕 Fondue cheese ✅ 2022-12-23 - [x] 🫕 Raclette cheese ✅ 2022-12-31 - [x] 🍦 Sour Cream ✅ 2022-10-29 @@ -103,9 +103,9 @@ style: number #### Breakfast - [x] 🥯 Bread ✅ 2023-03-11 -- [x] 🍯 Honey/Jam ✅ 2023-04-07 +- [x] 🍯 Honey/Jam ✅ 2023-04-23 - [x] 🍫 Nutella ✅ 2022-02-15 -- [x] 🥚 Eggs ✅ 2023-04-07 +- [x] 🥚 Eggs ✅ 2023-04-23   @@ -117,11 +117,11 @@ style: number - [x] 🫑 Bell pepper ✅ 2023-01-24 - [x] 🥦 Fennel ✅ 2022-10-29 - [x] 🥦 Radish ✅ 2022-10-29 -- [x] 🥦 Broccoli ✅ 2023-03-06 +- [x] 🥦 Broccoli ✅ 2023-04-24 - [x] 🧅 Onions ✅ 2022-12-26 - [x] 🧅 Spring onion ✅ 2023-04-07 - [x] 🧄 Garlic ✅ 2023-01-19 -- [x] 🍋 Lemon ✅ 2023-04-07 +- [x] 🍋 Lemon ✅ 2023-04-24 - [x] 🍋 Lime ✅ 2023-01-09   @@ -134,7 +134,7 @@ style: number - [x] 🥓 Bacon ✅ 2023-04-07 - [x] 🐔 Chicken thighs ✅ 2023-04-18 - [x] 🐔 Chicken breasts ✅ 2023-04-18 -- [x] 🌭 Spicy sausage ✅ 2023-03-06 +- [x] 🌭 Spicy sausage ✅ 2023-04-23 - [x] 🐟 Salmon fillet ✅ 2022-10-29   @@ -142,7 +142,7 @@ style: number #### Bases - [x] 🍝 Pasta ✅ 2023-01-24 -- [x] 🍜 Noodles ✅ 2023-02-05 +- [x] 🍜 Noodles ✅ 2023-04-23 - [x] 🌾 Bulgur ✅ 2022-10-29 - [x] 🍚 Rice ✅ 2022-12-26 - [x] 🥔 Potatoes ✅ 2023-04-07 diff --git a/01.02 Home/Household.md b/01.02 Home/Household.md index 3f0a0427..b7f9d4d1 100644 --- a/01.02 Home/Household.md +++ b/01.02 Home/Household.md @@ -73,7 +73,8 @@ style: number #### 🚮 Garbage collection -- [ ] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-04-25 +- [ ] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-05-09 +- [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-04-25 ✅ 2023-04-24 - [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-05-02 - [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-04-18 ✅ 2023-04-17 @@ -82,8 +83,8 @@ style: number #### 🏠 House chores - [ ] 🛎️ :house: [[Household]]: Pay rent %%done_del%% 🔁 every month on the last 📅 2023-04-30 -- [ ] 🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%% 🔁 every month on the last Saturday 🛫 2023-04-03 📅 2023-04-29 -- [ ] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-04-24 +- [ ] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-05-01 +- [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-04-24 ✅ 2023-04-21 - [ ] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-04-29   diff --git a/01.03 Family/Achille Bédier.md b/01.03 Family/Achille Bédier.md index 2b737542..6c1b54b5 100644 --- a/01.03 Family/Achille Bédier.md +++ b/01.03 Family/Achille Bédier.md @@ -103,7 +103,8 @@ style: number   -- [w] :birthday: **[[Achille Bédier|Achille]]** 🔁 every year 📅 2023-04-20 +- [ ] :birthday: **[[Achille Bédier|Achille]]** 🔁 every year 📅 2024-04-20 +- [x] :birthday: **[[Achille Bédier|Achille]]** 🔁 every year 📅 2023-04-20 ✅ 2023-04-20 - [x] :birthday: **[[Achille Bédier|Achille]]** 🔁 every year 📅 2022-04-20 ✅ 2022-04-20   diff --git a/01.03 Family/Isaure Bédier.md b/01.03 Family/Isaure Bédier.md index f15ea8f2..7eb8c6f7 100644 --- a/01.03 Family/Isaure Bédier.md +++ b/01.03 Family/Isaure Bédier.md @@ -103,7 +103,8 @@ style: number   -- [w] :birthday: **[[Isaure Bédier|Isaure]]** %%done_del%% 🔁 every year 📅 2023-04-21 +- [ ] :birthday: **[[Isaure Bédier|Isaure]]** %%done_del%% 🔁 every year 📅 2024-04-21 +- [x] :birthday: **[[Isaure Bédier|Isaure]]** %%done_del%% 🔁 every year 📅 2023-04-21 ✅ 2023-04-21 - [x] :birthday: **[[Isaure Bédier|Isaure]]** 🔁 every year 📅 2022-04-21 ✅ 2022-04-21   diff --git a/01.03 Family/Quentin de Villeneuve.md b/01.03 Family/Quentin de Villeneuve.md index 049ba9a7..21f233cc 100644 --- a/01.03 Family/Quentin de Villeneuve.md +++ b/01.03 Family/Quentin de Villeneuve.md @@ -103,7 +103,8 @@ style: number   -- [w] :birthday: **[[Quentin de Villeneuve|Quentin BV]]** %%done_del%% 🔁 every year 📅 2023-04-21 +- [ ] :birthday: **[[Quentin de Villeneuve|Quentin BV]]** %%done_del%% 🔁 every year 📅 2024-04-21 +- [x] :birthday: **[[Quentin de Villeneuve|Quentin BV]]** %%done_del%% 🔁 every year 📅 2023-04-21 ✅ 2023-04-21 - [x] :birthday: **[[Quentin de Villeneuve|Quentin BV]]** 🔁 every year 📅 2022-04-21 ✅ 2022-04-21   diff --git a/01.04 MRCK/@@MRCK.md b/01.04 MRCK/@@MRCK.md index 7e89e816..da771ca9 100644 --- a/01.04 MRCK/@@MRCK.md +++ b/01.04 MRCK/@@MRCK.md @@ -223,7 +223,9 @@ Paris, Zürich, London - [ ] :gift: :books: Livre - [ ] :gift: :books: mon bel oranger - [ ] :gift: :books: tistou les pouces verts + - [ ] :gift: :books: The Seven Sisters, Lucinda Riley - [ ] :gift: :books: Parabel of the Sower, [[The Spectacular Life of Octavia E. Butler|Octavia E. Butler]] + - [x] :gift: :books: Kindred, [[The Spectacular Life of Octavia E. Butler|Octavia E. Butler]] ✅ 2023-02-25 - [x] :gift: :books: [[How Noah Baumbach Made ‘White Noise’ a Disaster Movie for Our Moment|White Noise]], Don Delillo ✅ 2022-12-17 - [x] :gift: :books: [[Say Nothing]], Patrick Madden Keefe ✅ 2022-10-07 - [x] :gift: :books: The Second Sex, Simone de Beauvoir ✅ 2022-02-20 diff --git a/02.03 Zürich/@@Zürich.md b/02.03 Zürich/@@Zürich.md index d5609adc..aec12f3f 100644 --- a/02.03 Zürich/@@Zürich.md +++ b/02.03 Zürich/@@Zürich.md @@ -73,7 +73,7 @@ style: number   ### Master Navigation -[[#^Top|TOP]] +       [[@Restaurants Zürich|🍽]]      [[@Café Zürich|:coffee:]]       [[@Sport Zürich|:soccer:]]       [[@Bars Zürich|:cocktail:]] @@ -84,8 +84,69 @@ style: number   +### Day trips + +  + +#### Around Zürich + +- [x] Uetliberg ✅ 2022-04-17 +- [x] Dolderberg (+bahn) ✅ 2022-04-15 + +  + +#### Cities + +- [x] Lucerne ✅ 2023-04-23 +- [ ] Berne +- [ ] Winterthur +- [x] Zug ✅ 2023-04-23 +- [x] Konstanz ✅ 2023-04-23 +- [ ] Basel +- [x] Vaduz (FL) ✅ 2023-04-23 +- [x] Schaffhausen ✅ 2023-04-10 +- [ ] Sankt Gallen + +  + +#### Villages + +- [x] Stein am Rhein ✅ 2022-12-29 +- [x] Lenzburg ✅ 2023-04-16 +- [ ] Einsiedeln +- [x] Aarburg ✅ 2023-04-23 +- [ ] Grüningen +- [ ] Bremgarten +- [x] Arbon ✅ 2023-04-23 +- [ ] Rheinfelden +- [ ] Laugenburg +- [ ] Eglisau +- [ ] Steckborn +- [ ] Diessenhofen +- [ ] Gersau +- [ ] Lichtensteig +- [ ] Schwellbrunn +- [ ] Triesenberg (FL) + +  + +#### Nature + +- [x] Mount Rigi ✅ 2022-08-13 +- [x] Jungfrauhoch ✅ 2022-08-07 +- [x] Rheinfall ✅ 2023-04-10 +- [x] Bodensee ✅ 2023-04-23 +- [ ] Mount Titlis +- [ ] Lauterbrunnen + +  + +--- + +  + ### Search -[[#^Top|TOP]] +   ```button diff --git a/03.02 Travels/Cannavacciuolo Bistrot.md b/03.02 Travels/Cannavacciuolo Bistrot.md new file mode 100644 index 00000000..e08f5e43 --- /dev/null +++ b/03.02 Travels/Cannavacciuolo Bistrot.md @@ -0,0 +1,115 @@ +--- + +Alias: [""] +Tag: ["🍴"] +Date: 2023-04-23 +DocType: "Place" +Hierarchy: "NonRoot" +TimeStamp: +location: [45.06265,7.7009129] +Place: + Type: Restaurant + SubType: Modern + Style: Italian + Location: Torino + Country: Italy + Status: Recommended +CollapseMetaTable: true +Phone: "+39 011 8399893" +Email: "" +Website: "[Bistrot Cannavacciuolo Torino: vieni a provare il menù dello Chef](https://www.cannavacciuolobistrot.it/torino/)" +Instagram: cannavacciuolobistrotorino + +--- + +Parent:: [[@Italy|Italia]] + +  + +```dataviewjs +let tempPhone = dv.current().Phone ? dv.current().Phone.replaceAll(" ", "") : '+000' +let tempMail = dv.current().Email ? dv.current().Email : "" +let tempCoorSet = dv.current().location ? dv.current().location : [0,0] +dv.el('center', '[📲](tel:' + tempPhone + ')     [📧](mailto:' + tempMail + ')     [🗺️](' + "https://waze.com/ul?ll=" + tempCoorSet[0] + "%2C" + tempCoorSet[1] + "&navigate=yes" + ')') +``` + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-CannavacciuoloBistroSave + +  + +# Cannavacciuolo Bistrot + +  + +> [!summary]+ +> Note Description + +  + +```toc +style: number +``` + +  + +--- + +  + +### 📇 Contact + +  + +> [!address] 🗺 +> VIA UMBERTO COSMO, 6 +> 10131 Torino +> Italia + +  + +☎️ `= this.Phone` + +📧 `= this.Email` + +🌐 `= this.Website` + +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### 🔗 Other activity + +  + +```dataview +Table DocType as "Doc type" from [[Cannavaciuolo Bistro]] +where !contains(file.name, "@@Travel") +sort DocType asc +``` + +  +  \ No newline at end of file diff --git a/05.02 Networks/Configuring UFW.md b/05.02 Networks/Configuring UFW.md index 42175bbd..5f1706c2 100644 --- a/05.02 Networks/Configuring UFW.md +++ b/05.02 Networks/Configuring UFW.md @@ -237,7 +237,8 @@ sudo bash /etc/addip4ban/addip4ban.sh #### Ban List Tasks -- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-22 +- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-29 +- [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-22 ✅ 2023-04-21 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-15 ✅ 2023-04-15 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-08 ✅ 2023-04-07 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-01 ✅ 2023-04-03 @@ -249,7 +250,8 @@ sudo bash /etc/addip4ban/addip4ban.sh - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-02-18 ✅ 2023-02-17 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-02-11 ✅ 2023-02-11 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-02-04 ✅ 2023-02-04 -- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-22 +- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-29 +- [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-22 ✅ 2023-04-21 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-15 ✅ 2023-04-15 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-08 ✅ 2023-04-07 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-01 ✅ 2023-04-03 diff --git a/06.01 Finances/2023.ledger b/06.01 Finances/2023.ledger index 58b1e9d8..8b4d884b 100644 --- a/06.01 Finances/2023.ledger +++ b/06.01 Finances/2023.ledger @@ -211,4 +211,76 @@ alias f=expenses:Food 2023/04/19 PPZ - deposit for the key expenses:Sport:CHF CHF50.00 - liability:CreditCard:CHF \ No newline at end of file + liability:CreditCard:CHF + +2023/04/18 Tak & saddle: Sally + expenses:Horse:CHF CHF1010.00 + assets:Cash:CHF + +2023/04/19 Juan: birthday shoggi + expenses:Horse:CHF CHF35.00 + liability:CreditCard:CHF + +2023/04/20 Migros + expenses:Food:CHF CHF6.95 + liability:CreditCard.CHF + +2023/04/20 Box (Mars, April) + expenses:Horse:CHF CHF1153.92 + assets:Cash:CHF + +2023/04/20 Migros + expenses:Food:CHF CHF18.90 + liability:CreditCard:CHF + +2023/04/21 Masque - Sally + expenses:Horse:CHF CHF25.00 + assets:Cash:CHF + +2023/04/21 Wincasa + expenses:Housing:CHF CHF22.70 + assets:Cash:CHF + +2023/04/21 Petrol + expenses:Car:CHF CHF80.01 + liability:CreditCard:CHF + +2023/04/22 Curry wurst + expenses:Food:CHF CHF9.80 + assets:Cash:CHF + +2023/04/22 Drinks + expenses:Horse:CHF CHF17.80 + liability:CredutCard:CHF + +2023/04/22 Beers + expenses:Horse:CHF CHF14.94 + liability:CreditCard:CHF + +2023/04/23 Mövenpick + expenses:Food:CHF CHF5.10 + assets:Cash:CHF + +2023/04/24 Cash + expenses:Current expenses:CHF CHF200.00 + assets:Cash:CHF + +2023/04/23 Coop + expenses:Food:CHF CHF38.45 + liability:CreditCard:CHF + +2023/04/24 Migros + expenses:Food:CHF CHF7.75 + assets:Cash:CHF + +2023/04/23 Indian takeaway + expenses:Food:CHF CHF41.90 + liability:CreditCard:CHF + +2023/04/25 Coop + expenses:Food:CHF CHF0.95 + assets:Cash:CHF + +2023/04/24 Migros + expenses:Food:CHF CHF8.80 + assets:Cash:CHF \ No newline at end of file