From 37e23b6132847c5049e68838491b00c3a4258c74 Mon Sep 17 00:00:00 2001 From: Olexii Bulhakov Date: Sun, 7 Jan 2024 12:26:43 +0200 Subject: [PATCH] Save obsidian config --- .../.obsidian/community-plugins.json | 4 +- .../number-headings-obsidian/data.json | 83 -- .../plugins/number-headings-obsidian/main.js | 1184 ++++++++++++++++- docs/_obsidian/.obsidian/workspace.json | 4 +- .../calculation-method/calculation-method.md | 36 +- docs/_obsidian/index.md | 2 +- 6 files changed, 1159 insertions(+), 154 deletions(-) diff --git a/docs/_obsidian/.obsidian/community-plugins.json b/docs/_obsidian/.obsidian/community-plugins.json index 8684749..1bd4f93 100644 --- a/docs/_obsidian/.obsidian/community-plugins.json +++ b/docs/_obsidian/.obsidian/community-plugins.json @@ -1,4 +1,4 @@ [ - "number-headings-obsidian", - "obsidian-mkdocs-publisher" + "obsidian-mkdocs-publisher", + "number-headings-obsidian" ] \ No newline at end of file diff --git a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json index a68b850..6cdef25 100644 --- a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json +++ b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json @@ -1,87 +1,4 @@ { - "github": { - "user": "", - "repo": "", - "branch": "main", - "automaticallyMergePR": true, - "tokenPath": "%configDir%/plugins/%pluginID%/env", - "api": { - "tiersForApi": "Github Free/Pro/Team (default)", - "hostname": "" - }, - "workflow": { - "commitMessage": "[PUBLISHER] Merge", - "name": "" - }, - "otherRepo": [], - "verifiedRepo": false, - "rateLimit": 0 - }, - "upload": { - "behavior": "fixed", - "defaultName": "", - "rootFolder": "", - "yamlFolderKey": "", - "frontmatterTitle": { - "enable": false, - "key": "title" - }, - "replaceTitle": [], - "replacePath": [], - "autoclean": { - "enable": false, - "excluded": [] - }, - "folderNote": { - "enable": false, - "rename": "index.md", - "addTitle": { - "enable": false, - "key": "title" - } - }, - "metadataExtractorPath": "" - }, - "conversion": { - "hardbreak": false, - "dataview": true, - "censorText": [], - "tags": { - "inline": false, - "exclude": [], - "fields": [] - }, - "links": { - "internal": false, - "unshared": false, - "wiki": false, - "slugify": false - } - }, - "embed": { - "attachments": true, - "overrideAttachments": [], - "keySendFile": [], - "notes": false, - "folder": "", - "convertEmbedToLinks": "keep", - "charConvert": "->" - }, - "plugin": { - "shareKey": "share", - "fileMenu": false, - "editorMenu": false, - "excludedFolder": [], - "copyLink": { - "enable": false, - "links": "", - "removePart": [], - "addCmd": false - }, - "noticeError": false, - "displayModalRepoEditing": false, - "migrated": true - }, "skipTopLevel": false, "firstLevel": 2, "maxLevel": 6, diff --git a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js index 5d3f427..ff3e07f 100644 --- a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js +++ b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js @@ -1,48 +1,1136 @@ -/** GENERATED BY OBSIDIAN-PLUGIN-CLI, DO NOT EDIT */ -var wc=Object.create;var ri=Object.defineProperty;var Ec=Object.getOwnPropertyDescriptor;var Cc=Object.getOwnPropertyNames;var vc=Object.getPrototypeOf,xc=Object.prototype.hasOwnProperty;var Ur=t=>ri(t,"__esModule",{value:!0});var lt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),us=(t,e)=>{Ur(t);for(var n in e)ri(t,n,{get:e[n],enumerable:!0})},kc=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cc(e))!xc.call(t,i)&&i!=="default"&&ri(t,i,{get:()=>e[i],enumerable:!(n=Ec(e,i))||n.enumerable});return t},W=t=>kc(Ur(ri(t!=null?wc(vc(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var m=(t,e,n)=>new Promise((i,s)=>{var r=u=>{try{o(n.next(u))}catch(c){s(c)}},a=u=>{try{o(n.throw(u))}catch(c){s(c)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(r,a);o((n=n.apply(t,e)).next())});var Wr=lt((Op,qr)=>{qr.exports=_r;function _r(t,e,n,i){if(typeof n!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(e)?e.reverse().reduce(function(s,r){return _r.bind(null,t,r,s,i)},n)():Promise.resolve().then(function(){return t.registry[e]?t.registry[e].reduce(function(s,r){return r.hook.bind(null,s,i)},n)():n(i)})}});var zr=lt((Np,Kr)=>{Kr.exports=Sc;function Sc(t,e,n,i){var s=i;t.registry[n]||(t.registry[n]=[]),e==="before"&&(i=function(r,a){return Promise.resolve().then(s.bind(null,a)).then(r.bind(null,a))}),e==="after"&&(i=function(r,a){var o;return Promise.resolve().then(r.bind(null,a)).then(function(u){return o=u,s(o,a)}).then(function(){return o})}),e==="error"&&(i=function(r,a){return Promise.resolve().then(r.bind(null,a)).catch(function(o){return s(o,a)})}),t.registry[n].push({hook:i,orig:s})}});var Yr=lt((Bp,Zr)=>{Zr.exports=Tc;function Tc(t,e,n){if(!!t.registry[e]){var i=t.registry[e].map(function(s){return s.orig}).indexOf(n);i!==-1&&t.registry[e].splice(i,1)}}});var ia=lt((Lp,yn)=>{var Jr=Wr(),Ac=zr(),Pc=Yr(),Qr=Function.bind,Xr=Qr.bind(Qr);function ea(t,e,n){var i=Xr(Pc,null).apply(null,n?[e,n]:[e]);t.api={remove:i},t.remove=i,["before","error","after","wrap"].forEach(function(s){var r=n?[e,s,n]:[e,s];t[s]=t.api[s]=Xr(Ac,null).apply(null,r)})}function Rc(){var t="h",e={registry:{}},n=Jr.bind(null,e,t);return ea(n,e,t),n}function ta(){var t={registry:{}},e=Jr.bind(null,t);return ea(e,t),e}var na=!1;function jt(){return na||(console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'),na=!0),ta()}jt.Singular=Rc.bind();jt.Collection=ta.bind();yn.exports=jt;yn.exports.Hook=jt;yn.exports.Singular=jt.Singular;yn.exports.Collection=jt.Collection});var fa=lt((_t,ha)=>{"use strict";var _c=function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")},wt=_c();ha.exports=_t=wt.fetch;wt.fetch&&(_t.default=wt.fetch.bind(wt));_t.Headers=wt.Headers;_t.Request=wt.Request;_t.Response=wt.Response});var ga=lt((jp,ma)=>{ma.exports=pa;function pa(t,e){if(t&&e)return pa(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){n[i]=t[i]}),n;function n(){for(var i=new Array(arguments.length),s=0;s{var Da=ga();ds.exports=Da(ui);ds.exports.strict=Da(ba);ui.proto=ui(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return ui(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ba(this)},configurable:!0})});function ui(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function ba(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}});var ts=lt(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});require("obsidian");var pt=class extends Error{},jo=class extends pt{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},Ho=class extends pt{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},Uo=class extends pt{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},en=class extends pt{},$s=class extends pt{constructor(e){super(`Invalid unit ${e}`)}},Re=class extends pt{},at=class extends pt{constructor(){super("Zone is an abstract class")}},P="numeric",Ve="short",Oe="long",Ni={year:P,month:P,day:P},_o={year:P,month:Ve,day:P},eh={year:P,month:Ve,day:P,weekday:Ve},qo={year:P,month:Oe,day:P},Wo={year:P,month:Oe,day:P,weekday:Oe},Ko={hour:P,minute:P},zo={hour:P,minute:P,second:P},Zo={hour:P,minute:P,second:P,timeZoneName:Ve},Yo={hour:P,minute:P,second:P,timeZoneName:Oe},Jo={hour:P,minute:P,hourCycle:"h23"},Qo={hour:P,minute:P,second:P,hourCycle:"h23"},Xo={hour:P,minute:P,second:P,hourCycle:"h23",timeZoneName:Ve},eu={hour:P,minute:P,second:P,hourCycle:"h23",timeZoneName:Oe},tu={year:P,month:P,day:P,hour:P,minute:P},nu={year:P,month:P,day:P,hour:P,minute:P,second:P},iu={year:P,month:Ve,day:P,hour:P,minute:P},su={year:P,month:Ve,day:P,hour:P,minute:P,second:P},th={year:P,month:Ve,day:P,weekday:Ve,hour:P,minute:P},ru={year:P,month:Oe,day:P,hour:P,minute:P,timeZoneName:Ve},au={year:P,month:Oe,day:P,hour:P,minute:P,second:P,timeZoneName:Ve},ou={year:P,month:Oe,day:P,weekday:Oe,hour:P,minute:P,timeZoneName:Oe},uu={year:P,month:Oe,day:P,weekday:Oe,hour:P,minute:P,second:P,timeZoneName:Oe},tn=class{get type(){throw new at}get name(){throw new at}get ianaName(){return this.name}get isUniversal(){throw new at}offsetName(e,n){throw new at}formatOffset(e,n){throw new at}offset(e){throw new at}equals(e){throw new at}get isValid(){throw new at}},Vs=null,$n=class extends tn{static get instance(){return Vs===null&&(Vs=new $n),Vs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:i}){return Cu(e,n,i)}formatOffset(e,n){return Hn(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},Bi={};function nh(t){return Bi[t]||(Bi[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Bi[t]}var ih={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function sh(t,e){let n=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,a,o,u,c,d]=i;return[a,s,r,o,u,c,d]}function rh(t,e){let n=t.formatToParts(e),i=[];for(let s=0;s=0?w:1e3+w,(p-F)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},lu={};function ah(t,e={}){let n=JSON.stringify([t,e]),i=lu[n];return i||(i=new Intl.ListFormat(t,e),lu[n]=i),i}var Gs={};function js(t,e={}){let n=JSON.stringify([t,e]),i=Gs[n];return i||(i=new Intl.DateTimeFormat(t,e),Gs[n]=i),i}var Hs={};function oh(t,e={}){let n=JSON.stringify([t,e]),i=Hs[n];return i||(i=new Intl.NumberFormat(t,e),Hs[n]=i),i}var Us={};function uh(t,e={}){let{base:n,...i}=e,s=JSON.stringify([t,i]),r=Us[s];return r||(r=new Intl.RelativeTimeFormat(t,e),Us[s]=r),r}var Vn=null;function lh(){return Vn||(Vn=new Intl.DateTimeFormat().resolvedOptions().locale,Vn)}function ch(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let i,s;try{i=js(t).resolvedOptions(),s=t}catch(o){let u=t.substring(0,n);i=js(u).resolvedOptions(),s=u}let{numberingSystem:r,calendar:a}=i;return[s,r,a]}}function dh(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function hh(t){let e=[];for(let n=1;n<=12;n++){let i=B.utc(2009,n,1);e.push(t(i))}return e}function fh(t){let e=[];for(let n=1;n<=7;n++){let i=B.utc(2016,11,13+n);e.push(t(i))}return e}function Mi(t,e,n,i){let s=t.listingMode();return s==="error"?null:s==="en"?n(e):i(e)}function ph(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var cu=class{constructor(e,n,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:s,floor:r,...a}=i;if(!n||Object.keys(a).length>0){let o={useGrouping:!1,...i};i.padTo>0&&(o.minimumIntegerDigits=i.padTo),this.inf=oh(e,o)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):Ws(e,3);return ae(n,this.padTo)}}},du=class{constructor(e,n,i){this.opts=i,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&Xe.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let r={...this.opts};r.timeZone=r.timeZone||s,this.dtf=js(n,r)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:i}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},hu=class{constructor(e,n,i){this.opts={style:"long",...i},!n&&wu()&&(this.rtf=uh(e,i))}format(e,n){return this.rtf?this.rtf.format(e,n):Ph(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},Q=class{static fromOpts(e){return Q.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,n,i,s=!1){let r=e||se.defaultLocale,a=r||(s?"en-US":lh()),o=n||se.defaultNumberingSystem,u=i||se.defaultOutputCalendar;return new Q(a,o,u,r)}static resetCache(){Vn=null,Gs={},Hs={},Us={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:i}={}){return Q.create(e,n,i)}constructor(e,n,i,s){let[r,a,o]=ch(e);this.locale=r,this.numberingSystem=n||a||null,this.outputCalendar=i||o||null,this.intl=dh(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ph(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Q.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Mi(this,e,ku,()=>{let i=n?{month:e,day:"numeric"}:{month:e},s=n?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=hh(r=>this.extract(r,i,"month"))),this.monthsCache[s][e]})}weekdays(e,n=!1){return Mi(this,e,Au,()=>{let i=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=n?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=fh(r=>this.extract(r,i,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return Mi(this,void 0,()=>Pu,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[B.utc(2016,11,13,9),B.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Mi(this,e,Ru,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[B.utc(-40,1,1),B.utc(2017,1,1)].map(i=>this.extract(i,n,"era"))),this.eraCache[e]})}extract(e,n,i){let s=this.dtFormatter(e,n),r=s.formatToParts(),a=r.find(o=>o.type.toLowerCase()===i);return a?a.value:null}numberFormatter(e={}){return new cu(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new du(e,this.intl,n)}relFormatter(e={}){return new hu(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ah(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}},_s=null,Ee=class extends tn{static get utcInstance(){return _s===null&&(_s=new Ee(0)),_s}static instance(e){return e===0?Ee.utcInstance:new Ee(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Ee(ji(n[1],n[2]))}return null}constructor(e){super();this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Hn(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Hn(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Hn(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},fu=class extends tn{constructor(e){super();this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function mt(t,e){if(H(t)||t===null)return e;if(t instanceof tn)return t;if(mh(t)){let n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?$n.instance:n==="utc"||n==="gmt"?Ee.utcInstance:Ee.parseSpecifier(n)||Xe.create(t)}else return Tt(t)?Ee.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new fu(t)}var pu=()=>Date.now(),mu="system",gu=null,Du=null,bu=null,yu=60,Fu,se=class{static get now(){return pu}static set now(e){pu=e}static set defaultZone(e){mu=e}static get defaultZone(){return mt(mu,$n.instance)}static get defaultLocale(){return gu}static set defaultLocale(e){gu=e}static get defaultNumberingSystem(){return Du}static set defaultNumberingSystem(e){Du=e}static get defaultOutputCalendar(){return bu}static set defaultOutputCalendar(e){bu=e}static get twoDigitCutoffYear(){return yu}static set twoDigitCutoffYear(e){yu=e%100}static get throwOnInvalid(){return Fu}static set throwOnInvalid(e){Fu=e}static resetCaches(){Q.resetCache(),Xe.resetCache()}};function H(t){return typeof t=="undefined"}function Tt(t){return typeof t=="number"}function Ii(t){return typeof t=="number"&&t%1==0}function mh(t){return typeof t=="string"}function gh(t){return Object.prototype.toString.call(t)==="[object Date]"}function wu(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function Dh(t){return Array.isArray(t)?t:[t]}function Eu(t,e,n){if(t.length!==0)return t.reduce((i,s)=>{let r=[e(s),s];return i&&n(i[0],r[0])===i[0]?i:r},null)[1]}function bh(t,e){return e.reduce((n,i)=>(n[i]=t[i],n),{})}function nn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ot(t,e,n){return Ii(t)&&t>=e&&t<=n}function yh(t,e){return t-e*Math.floor(t/e)}function ae(t,e=2){let n=t<0,i;return n?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function gt(t){if(!(H(t)||t===null||t===""))return parseInt(t,10)}function At(t){if(!(H(t)||t===null||t===""))return parseFloat(t)}function qs(t){if(!(H(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Ws(t,e,n=!1){let i=10**e;return(n?Math.trunc:Math.round)(t*i)/i}function Gn(t){return t%4==0&&(t%100!=0||t%400==0)}function jn(t){return Gn(t)?366:365}function $i(t,e){let n=yh(e-1,12)+1,i=t+(e-n)/12;return n===2?Gn(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Vi(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Gi(t){let e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,n=t-1,i=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return e===4||i===3?53:52}function Ks(t){return t>99?t:t>se.twoDigitCutoffYear?1900+t:2e3+t}function Cu(t,e,n,i=null){let s=new Date(t),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);let a={timeZoneName:e,...r},o=new Intl.DateTimeFormat(n,a).formatToParts(s).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function ji(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let i=parseInt(e,10)||0,s=n<0||Object.is(n,-0)?-i:i;return n*60+s}function vu(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Re(`Invalid unit value ${t}`);return e}function Hi(t,e){let n={};for(let i in t)if(nn(t,i)){let s=t[i];if(s==null)continue;n[e(i)]=vu(s)}return n}function Hn(t,e){let n=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${ae(n,2)}:${ae(i,2)}`;case"narrow":return`${s}${n}${i>0?`:${i}`:""}`;case"techie":return`${s}${ae(n,2)}${ae(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ui(t){return bh(t,["hour","minute","second","millisecond"])}var Fh=["January","February","March","April","May","June","July","August","September","October","November","December"],xu=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wh=["J","F","M","A","M","J","J","A","S","O","N","D"];function ku(t){switch(t){case"narrow":return[...wh];case"short":return[...xu];case"long":return[...Fh];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Su=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Tu=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Eh=["M","T","W","T","F","S","S"];function Au(t){switch(t){case"narrow":return[...Eh];case"short":return[...Tu];case"long":return[...Su];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Pu=["AM","PM"],Ch=["Before Christ","Anno Domini"],vh=["BC","AD"],xh=["B","A"];function Ru(t){switch(t){case"narrow":return[...xh];case"short":return[...vh];case"long":return[...Ch];default:return null}}function kh(t){return Pu[t.hour<12?0:1]}function Sh(t,e){return Au(e)[t.weekday-1]}function Th(t,e){return ku(e)[t.month-1]}function Ah(t,e){return Ru(e)[t.year<0?0:1]}function Ph(t,e,n="always",i=!1){let s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&r){let f=t==="days";switch(e){case 1:return f?"tomorrow":`next ${s[t][0]}`;case-1:return f?"yesterday":`last ${s[t][0]}`;case 0:return f?"today":`this ${s[t][0]}`}}let a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,c=s[t],d=i?u?c[1]:c[2]||c[1]:u?s[t][0]:t;return a?`${o} ${d} ago`:`in ${o} ${d}`}function Ou(t,e){let n="";for(let i of t)i.literal?n+=i.val:n+=e(i.val);return n}var Rh={D:Ni,DD:_o,DDD:qo,DDDD:Wo,t:Ko,tt:zo,ttt:Zo,tttt:Yo,T:Jo,TT:Qo,TTT:Xo,TTTT:eu,f:tu,ff:iu,fff:ru,ffff:ou,F:nu,FF:su,FFF:au,FFFF:uu},De=class{static create(e,n={}){return new De(e,n)}static parseFormat(e){let n=null,i="",s=!1,r=[];for(let a=0;a0&&r.push({literal:s||/^\s+$/.test(i),val:i}),n=null,i="",s=!s):s||o===n?i+=o:(i.length>0&&r.push({literal:/^\s+$/.test(i),val:i}),i=o,n=o)}return i.length>0&&r.push({literal:s||/^\s+$/.test(i),val:i}),r}static macroTokenToFormatOpts(e){return Rh[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return ae(e,n);let i={...this.opts};return n>0&&(i.padTo=n),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,n){let i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(F,w)=>this.loc.extract(e,F,w),a=F=>e.isOffsetFixed&&e.offset===0&&F.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,F.format):"",o=()=>i?kh(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(F,w)=>i?Th(e,F):r(w?{month:F}:{month:F,day:"numeric"},"month"),c=(F,w)=>i?Sh(e,F):r(w?{weekday:F}:{weekday:F,month:"long",day:"numeric"},"weekday"),d=F=>{let w=De.macroTokenToFormatOpts(F);return w?this.formatWithSystemDefault(e,w):F},f=F=>i?Ah(e,F):r({era:F},"era"),p=F=>{switch(F){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?r({day:"numeric"},"day"):this.num(e.day);case"dd":return s?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return s?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?r({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return s?r({month:"numeric"},"month"):this.num(e.month);case"MM":return s?r({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return s?r({year:"numeric"},"year"):this.num(e.year);case"yy":return s?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return d(F)}};return Ou(De.parseFormat(n),p)}formatDurationFromString(e,n){let i=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=u=>c=>{let d=i(c);return d?this.num(u.get(d),c.length):c},r=De.parseFormat(n),a=r.reduce((u,{literal:c,val:d})=>c?u:u.concat(d),[]),o=e.shiftTo(...a.map(i).filter(u=>u));return Ou(r,s(o))}},Be=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Nu=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sn(...t){let e=t.reduce((n,i)=>n+i.source,"");return RegExp(`^${e}$`)}function rn(...t){return e=>t.reduce(([n,i,s],r)=>{let[a,o,u]=r(e,s);return[{...n,...a},o||i,u]},[{},null,1]).slice(0,2)}function an(t,...e){if(t==null)return[null,null];for(let[n,i]of e){let s=n.exec(t);if(s)return i(s)}return[null,null]}function Bu(...t){return(e,n)=>{let i={},s;for(s=0;sF!==void 0&&(w||F&&d)?-F:F;return[{years:p(At(n)),months:p(At(i)),weeks:p(At(s)),days:p(At(r)),hours:p(At(a)),minutes:p(At(o)),seconds:p(At(u),u==="-0"),milliseconds:p(qs(c),f)}]}var _h={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 Ys(t,e,n,i,s,r,a){let o={year:e.length===2?Ks(gt(e)):gt(e),month:xu.indexOf(n)+1,day:gt(i),hour:gt(s),minute:gt(r)};return a&&(o.second=gt(a)),t&&(o.weekday=t.length>3?Su.indexOf(t)+1:Tu.indexOf(t)+1),o}var qh=/^(?:(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\d)(\d\d)))$/;function Wh(t){let[,e,n,i,s,r,a,o,u,c,d,f]=t,p=Ys(e,s,i,n,r,a,o),F;return u?F=_h[u]:c?F=0:F=ji(d,f),[p,new Ee(F)]}function Kh(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var zh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Zh=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Yh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function $u(t){let[,e,n,i,s,r,a,o]=t;return[Ys(e,s,i,n,r,a,o),Ee.utcInstance]}function Jh(t){let[,e,n,i,s,r,a,o]=t;return[Ys(e,o,n,i,s,r,a),Ee.utcInstance]}var Qh=sn(Nh,Zs),Xh=sn(Bh,Zs),ef=sn(Lh,Zs),tf=sn(Mu),Vu=rn(Gh,un,Un,_n),nf=rn(Mh,un,Un,_n),sf=rn(Ih,un,Un,_n),rf=rn(un,Un,_n);function af(t){return an(t,[Qh,Vu],[Xh,nf],[ef,sf],[tf,rf])}function of(t){return an(Kh(t),[qh,Wh])}function uf(t){return an(t,[zh,$u],[Zh,$u],[Yh,Jh])}function lf(t){return an(t,[Hh,Uh])}var cf=rn(un);function df(t){return an(t,[jh,cf])}var hf=sn($h,Vh),ff=sn(Iu),pf=rn(un,Un,_n);function mf(t){return an(t,[hf,Vu],[ff,pf])}var Gu="Invalid Duration",ju={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},gf={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...ju},Le=146097/400,ln=146097/4800,Df={years:{quarters:4,months:12,weeks:Le/7,days:Le,hours:Le*24,minutes:Le*24*60,seconds:Le*24*60*60,milliseconds:Le*24*60*60*1e3},quarters:{months:3,weeks:Le/28,days:Le/4,hours:Le*24/4,minutes:Le*24*60/4,seconds:Le*24*60*60/4,milliseconds:Le*24*60*60*1e3/4},months:{weeks:ln/7,days:ln,hours:ln*24,minutes:ln*24*60,seconds:ln*24*60*60,milliseconds:ln*24*60*60*1e3},...ju},Pt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bf=Pt.slice(0).reverse();function Dt(t,e,n=!1){let i={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new O(i)}function Hu(t,e){let n=e.milliseconds??0;for(let i of bf.slice(1))e[i]&&(n+=e[i]*t[i].milliseconds);return n}function Uu(t,e){let n=Hu(t,e)<0?-1:1;Pt.reduceRight((i,s)=>{if(H(e[s]))return i;if(i){let r=e[i]*n,a=t[s][i],o=Math.floor(r/a);e[s]+=o*n,e[i]-=o*a*n}return s},null),Pt.reduce((i,s)=>{if(H(e[s]))return i;if(i){let r=e[i]%1;e[i]-=r,e[s]+=r*t[i][s]}return s},null)}function yf(t){let e={};for(let[n,i]of Object.entries(t))i!==0&&(e[n]=i);return e}var O=class{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,i=n?Df:gf;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Q.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,n){return O.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new Re(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new O({values:Hi(e,O.normalizeUnit),loc:Q.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Tt(e))return O.fromMillis(e);if(O.isDuration(e))return e;if(typeof e=="object")return O.fromObject(e);throw new Re(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[i]=lf(e);return i?O.fromObject(i,n):O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[i]=df(e);return i?O.fromObject(i,n):O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new Re("need to specify a reason the Duration is invalid");let i=e instanceof Be?e:new Be(e,n);if(se.throwOnInvalid)throw new Uo(i);return new O({invalid:i})}static normalizeUnit(e){let n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new $s(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){let i={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?De.create(this.loc,i).formatDurationFromString(this,e):Gu}toHuman(e={}){if(!this.isValid)return Gu;let n=Pt.map(i=>{let s=this.values[i];return H(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ws(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},B.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?Hu(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=O.fromDurationLike(e),i={};for(let s of Pt)(nn(n.values,s)||nn(this.values,s))&&(i[s]=n.get(s)+this.get(s));return Dt(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let n=O.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=vu(e(this.values[i],i));return Dt(this,{values:n},!0)}get(e){return this[O.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...Hi(e,O.normalizeUnit)};return Dt(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:i,matrix:s}={}){let a={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:s,conversionAccuracy:i};return Dt(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return Uu(this.matrix,e),Dt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=yf(this.normalize().shiftToAll().toObject());return Dt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>O.normalizeUnit(a));let n={},i={},s=this.toObject(),r;for(let a of Pt)if(e.indexOf(a)>=0){r=a;let o=0;for(let c in i)o+=this.matrix[c][a]*i[c],i[c]=0;Tt(s[a])&&(o+=s[a]);let u=Math.trunc(o);n[a]=u,i[a]=(o*1e3-u*1e3)/1e3}else Tt(s[a])&&(i[a]=s[a]);for(let a in i)i[a]!==0&&(n[r]+=a===r?i[a]:i[a]/this.matrix[r][a]);return Uu(this.matrix,n),Dt(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Dt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(let i of Pt)if(!n(this.values[i],e.values[i]))return!1;return!0}},cn="Invalid Interval";function Ff(t,e){return!t||!t.isValid?ee.invalid("missing or invalid start"):!e||!e.isValid?ee.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?ee.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(Kn).filter(a=>this.contains(a)).sort(),i=[],{s}=this,r=0;for(;s+this.e?this.e:a;i.push(ee.fromDateTimes(s,o)),s=o,r+=1}return i}splitBy(e){let n=O.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:i}=this,s=1,r,a=[];for(;iu*s));r=+o>+this.e?this.e:o,a.push(ee.fromDateTimes(i,r)),i=r,s+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let n=this.s>e.s?this.s:e.s,i=this.e=i?null:ee.fromDateTimes(n,i)}union(e){if(!this.isValid)return this;let n=this.se.e?this.e:e.e;return ee.fromDateTimes(n,i)}static merge(e){let[n,i]=e.sort((s,r)=>s.s-r.s).reduce(([s,r],a)=>r?r.overlaps(a)||r.abutsStart(a)?[s,r.union(a)]:[s.concat([r]),a]:[s,a],[[],null]);return i&&n.push(i),n}static xor(e){let n=null,i=0,s=[],r=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...r),o=a.sort((u,c)=>u.time-c.time);for(let u of o)i+=u.type==="s"?1:-1,i===1?n=u.time:(n&&+n!=+u.time&&s.push(ee.fromDateTimes(n,u.time)),n=null);return ee.merge(s)}difference(...e){return ee.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:cn}toLocaleString(e=Ni,n={}){return this.isValid?De.create(this.s.loc.clone(n),e).formatInterval(this):cn}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:cn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:cn}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:cn}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:cn}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):O.invalid(this.invalidReason)}mapEndpoints(e){return ee.fromDateTimes(e(this.s),e(this.e))}},qn=class{static hasDST(e=se.defaultZone){let n=B.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return Xe.isValidZone(e)}static normalizeZone(e){return mt(e,se.defaultZone)}static months(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null,outputCalendar:r="gregory"}={}){return(s||Q.create(n,i,r)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null,outputCalendar:r="gregory"}={}){return(s||Q.create(n,i,r)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Q.create(n,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Q.create(n,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Q.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Q.create(n,null,"gregory").eras(e)}static features(){return{relative:wu()}}};function _u(t,e){let n=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=n(e)-n(t);return Math.floor(O.fromMillis(i).as("days"))}function wf(t,e,n){let i=[["years",(u,c)=>c.year-u.year],["quarters",(u,c)=>c.quarter-u.quarter+(c.year-u.year)*4],["months",(u,c)=>c.month-u.month+(c.year-u.year)*12],["weeks",(u,c)=>{let d=_u(u,c);return(d-d%7)/7}],["days",_u]],s={},r=t,a,o;for(let[u,c]of i)n.indexOf(u)>=0&&(a=u,s[u]=c(t,e),o=r.plus(s),o>e?(s[u]--,t=r.plus(s),t>e&&(o=t,s[u]--,t=r.plus(s))):t=o);return[t,s,o,a]}function Ef(t,e,n,i){let[s,r,a,o]=wf(t,e,n),u=e-s,c=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);c.length===0&&(a0?O.fromMillis(u,i).shiftTo(...c).plus(d):d}var Js={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},qu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Cf=Js.hanidec.replace(/[\[|\]]/g,"").split("");function vf(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=r&&i<=a&&(e+=i-r)}}return parseInt(e,10)}else return e}function Ge({numberingSystem:t},e=""){return new RegExp(`${Js[t||"latn"]}${e}`)}var xf="missing Intl.DateTimeFormat.formatToParts support";function z(t,e=n=>n){return{regex:t,deser:([n])=>e(vf(n))}}var kf=String.fromCharCode(160),Wu=`[ ${kf}]`,Ku=new RegExp(Wu,"g");function Sf(t){return t.replace(/\./g,"\\.?").replace(Ku,Wu)}function zu(t){return t.replace(/\./g,"").replace(Ku," ").toLowerCase()}function je(t,e){return t===null?null:{regex:RegExp(t.map(Sf).join("|")),deser:([n])=>t.findIndex(i=>zu(n)===zu(i))+e}}function Zu(t,e){return{regex:t,deser:([,n,i])=>ji(n,i),groups:e}}function _i(t){return{regex:t,deser:([e])=>e}}function Tf(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Af(t,e){let n=Ge(e),i=Ge(e,"{2}"),s=Ge(e,"{3}"),r=Ge(e,"{4}"),a=Ge(e,"{6}"),o=Ge(e,"{1,2}"),u=Ge(e,"{1,3}"),c=Ge(e,"{1,6}"),d=Ge(e,"{1,9}"),f=Ge(e,"{2,4}"),p=Ge(e,"{4,6}"),F=E=>({regex:RegExp(Tf(E.val)),deser:([V])=>V,literal:!0}),k=(E=>{if(t.literal)return F(E);switch(E.val){case"G":return je(e.eras("short"),0);case"GG":return je(e.eras("long"),0);case"y":return z(c);case"yy":return z(f,Ks);case"yyyy":return z(r);case"yyyyy":return z(p);case"yyyyyy":return z(a);case"M":return z(o);case"MM":return z(i);case"MMM":return je(e.months("short",!0),1);case"MMMM":return je(e.months("long",!0),1);case"L":return z(o);case"LL":return z(i);case"LLL":return je(e.months("short",!1),1);case"LLLL":return je(e.months("long",!1),1);case"d":return z(o);case"dd":return z(i);case"o":return z(u);case"ooo":return z(s);case"HH":return z(i);case"H":return z(o);case"hh":return z(i);case"h":return z(o);case"mm":return z(i);case"m":return z(o);case"q":return z(o);case"qq":return z(i);case"s":return z(o);case"ss":return z(i);case"S":return z(u);case"SSS":return z(s);case"u":return _i(d);case"uu":return _i(o);case"uuu":return z(n);case"a":return je(e.meridiems(),0);case"kkkk":return z(r);case"kk":return z(f,Ks);case"W":return z(o);case"WW":return z(i);case"E":case"c":return z(n);case"EEE":return je(e.weekdays("short",!1),1);case"EEEE":return je(e.weekdays("long",!1),1);case"ccc":return je(e.weekdays("short",!0),1);case"cccc":return je(e.weekdays("long",!0),1);case"Z":case"ZZ":return Zu(new RegExp(`([+-]${o.source})(?::(${i.source}))?`),2);case"ZZZ":return Zu(new RegExp(`([+-]${o.source})(${i.source})?`),2);case"z":return _i(/[a-z_+-/]{1,256}?/i);case" ":return _i(/[^\S\n\r]/);default:return F(E)}})(t)||{invalidReason:xf};return k.token=t,k}var Pf={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Rf(t,e,n){let{type:i,value:s}=t;if(i==="literal"){let u=/^\s+$/.test(s);return{literal:!u,val:u?" ":s}}let r=e[i],a=i;i==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=n.hour12?"hour12":"hour24");let o=Pf[a];if(typeof o=="object"&&(o=o[r]),o)return{literal:!1,val:o}}function Of(t){return[`^${t.map(n=>n.regex).reduce((n,i)=>`${n}(${i.source})`,"")}$`,t]}function Nf(t,e,n){let i=t.match(e);if(i){let s={},r=1;for(let a in n)if(nn(n,a)){let o=n[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(i.slice(r,r+u))),r+=u}return[i,s]}else return[i,{}]}function Bf(t){let e=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null,i;return H(t.z)||(n=Xe.create(t.z)),H(t.Z)||(n||(n=new Ee(t.Z)),i=t.Z),H(t.q)||(t.M=(t.q-1)*3+1),H(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),H(t.u)||(t.S=qs(t.u)),[Object.keys(t).reduce((r,a)=>{let o=e(a);return o&&(r[o]=t[a]),r},{}),n,i]}var Qs=null;function Lf(){return Qs||(Qs=B.fromMillis(1555555555555)),Qs}function Mf(t,e){if(t.literal)return t;let n=De.macroTokenToFormatOpts(t.val),i=Qu(n,e);return i==null||i.includes(void 0)?t:i}function Yu(t,e){return Array.prototype.concat(...t.map(n=>Mf(n,e)))}function Ju(t,e,n){let i=Yu(De.parseFormat(n),t),s=i.map(a=>Af(a,t)),r=s.find(a=>a.invalidReason);if(r)return{input:e,tokens:i,invalidReason:r.invalidReason};{let[a,o]=Of(s),u=RegExp(a,"i"),[c,d]=Nf(e,u,o),[f,p,F]=d?Bf(d):[null,null,void 0];if(nn(d,"a")&&nn(d,"H"))throw new en("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:u,rawMatches:c,matches:d,result:f,zone:p,specificOffset:F}}}function If(t,e,n){let{result:i,zone:s,specificOffset:r,invalidReason:a}=Ju(t,e,n);return[i,s,r,a]}function Qu(t,e){if(!t)return null;let i=De.create(e,t).dtFormatter(Lf()),s=i.formatToParts(),r=i.resolvedOptions();return s.map(a=>Rf(a,t,r))}var Xu=[0,31,59,90,120,151,181,212,243,273,304,334],el=[0,31,60,91,121,152,182,213,244,274,305,335];function Me(t,e){return new Be("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function tl(t,e,n){let i=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let s=i.getUTCDay();return s===0?7:s}function nl(t,e,n){return n+(Gn(t)?el:Xu)[e-1]}function il(t,e){let n=Gn(t)?el:Xu,i=n.findIndex(r=>rGi(e)?(o=e+1,a=1):o=e,{weekYear:o,weekNumber:a,weekday:r,...Ui(t)}}function sl(t){let{weekYear:e,weekNumber:n,weekday:i}=t,s=tl(e,1,4),r=jn(e),a=n*7+i-s-3,o;a<1?(o=e-1,a+=jn(o)):a>r?(o=e+1,a-=jn(e)):o=e;let{month:u,day:c}=il(o,a);return{year:o,month:u,day:c,...Ui(t)}}function er(t){let{year:e,month:n,day:i}=t,s=nl(e,n,i);return{year:e,ordinal:s,...Ui(t)}}function rl(t){let{year:e,ordinal:n}=t,{month:i,day:s}=il(e,n);return{year:e,month:i,day:s,...Ui(t)}}function $f(t){let e=Ii(t.weekYear),n=ot(t.weekNumber,1,Gi(t.weekYear)),i=ot(t.weekday,1,7);return e?n?i?!1:Me("weekday",t.weekday):Me("week",t.week):Me("weekYear",t.weekYear)}function Vf(t){let e=Ii(t.year),n=ot(t.ordinal,1,jn(t.year));return e?n?!1:Me("ordinal",t.ordinal):Me("year",t.year)}function al(t){let e=Ii(t.year),n=ot(t.month,1,12),i=ot(t.day,1,$i(t.year,t.month));return e?n?i?!1:Me("day",t.day):Me("month",t.month):Me("year",t.year)}function ol(t){let{hour:e,minute:n,second:i,millisecond:s}=t,r=ot(e,0,23)||e===24&&n===0&&i===0&&s===0,a=ot(n,0,59),o=ot(i,0,59),u=ot(s,0,999);return r?a?o?u?!1:Me("millisecond",s):Me("second",i):Me("minute",n):Me("hour",e)}var tr="Invalid DateTime",ul=864e13;function qi(t){return new Be("unsupported zone",`the zone "${t.name}" is not supported`)}function nr(t){return t.weekData===null&&(t.weekData=Xs(t.c)),t.weekData}function Rt(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new B({...n,...e,old:n})}function ll(t,e,n){let i=t-e*60*1e3,s=n.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;let r=n.offset(i);return s===r?[i,s]:[t-Math.min(s,r)*60*1e3,Math.max(s,r)]}function Wi(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ki(t,e,n){return ll(Vi(t),e,n)}function cl(t,e){let n=t.o,i=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,r={...t.c,year:i,month:s,day:Math.min(t.c.day,$i(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=O.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=Vi(r),[u,c]=ll(o,n,t.zone);return a!==0&&(u+=a,c=t.zone.offset(u)),{ts:u,o:c}}function Wn(t,e,n,i,s,r){let{setZone:a,zone:o}=n;if(t&&Object.keys(t).length!==0||e){let u=e||o,c=B.fromObject(t,{...n,zone:u,specificOffset:r});return a?c:c.setZone(o)}else return B.invalid(new Be("unparsable",`the input "${s}" can't be parsed as ${i}`))}function zi(t,e,n=!0){return t.isValid?De.create(Q.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ir(t,e){let n=t.c.year>9999||t.c.year<0,i="";return n&&t.c.year>=0&&(i+="+"),i+=ae(t.c.year,n?6:4),e?(i+="-",i+=ae(t.c.month),i+="-",i+=ae(t.c.day)):(i+=ae(t.c.month),i+=ae(t.c.day)),i}function dl(t,e,n,i,s,r){let a=ae(t.c.hour);return e?(a+=":",a+=ae(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=":")):a+=ae(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=ae(t.c.second),(t.c.millisecond!==0||!i)&&(a+=".",a+=ae(t.c.millisecond,3))),s&&(t.isOffsetFixed&&t.offset===0&&!r?a+="Z":t.o<0?(a+="-",a+=ae(Math.trunc(-t.o/60)),a+=":",a+=ae(Math.trunc(-t.o%60))):(a+="+",a+=ae(Math.trunc(t.o/60)),a+=":",a+=ae(Math.trunc(t.o%60)))),r&&(a+="["+t.zone.ianaName+"]"),a}var hl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Gf={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},jf={ordinal:1,hour:0,minute:0,second:0,millisecond:0},fl=["year","month","day","hour","minute","second","millisecond"],Hf=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Uf=["year","ordinal","hour","minute","second","millisecond"];function pl(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new $s(t);return e}function ml(t,e){let n=mt(e.zone,se.defaultZone),i=Q.fromObject(e),s=se.now(),r,a;if(H(t.year))r=s;else{for(let c of fl)H(t[c])&&(t[c]=hl[c]);let o=al(t)||ol(t);if(o)return B.invalid(o);let u=n.offset(s);[r,a]=Ki(t,u,n)}return new B({ts:r,zone:n,loc:i,o:a})}function gl(t,e,n){let i=H(n.round)?!0:n.round,s=(a,o)=>(a=Ws(a,i||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(a,o)),r=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return s(r(n.unit),n.unit);for(let a of n.units){let o=r(a);if(Math.abs(o)>=1)return s(o,a)}return s(t>e?-0:0,n.units[n.units.length-1])}function Dl(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var B=class{constructor(e){let n=e.zone||se.defaultZone,i=e.invalid||(Number.isNaN(e.ts)?new Be("invalid input"):null)||(n.isValid?null:qi(n));this.ts=H(e.ts)?se.now():e.ts;let s=null,r=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[s,r]=[e.old.c,e.old.o];else{let o=n.offset(this.ts);s=Wi(this.ts,o),i=Number.isNaN(s.year)?new Be("invalid input"):null,s=i?null:s,r=i?null:o}this._zone=n,this.loc=e.loc||Q.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=r,this.isLuxonDateTime=!0}static now(){return new B({})}static local(){let[e,n]=Dl(arguments),[i,s,r,a,o,u,c]=n;return ml({year:i,month:s,day:r,hour:a,minute:o,second:u,millisecond:c},e)}static utc(){let[e,n]=Dl(arguments),[i,s,r,a,o,u,c]=n;return e.zone=Ee.utcInstance,ml({year:i,month:s,day:r,hour:a,minute:o,second:u,millisecond:c},e)}static fromJSDate(e,n={}){let i=gh(e)?e.valueOf():NaN;if(Number.isNaN(i))return B.invalid("invalid input");let s=mt(n.zone,se.defaultZone);return s.isValid?new B({ts:i,zone:s,loc:Q.fromObject(n)}):B.invalid(qi(s))}static fromMillis(e,n={}){if(Tt(e))return e<-ul||e>ul?B.invalid("Timestamp out of range"):new B({ts:e,zone:mt(n.zone,se.defaultZone),loc:Q.fromObject(n)});throw new Re(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Tt(e))return new B({ts:e*1e3,zone:mt(n.zone,se.defaultZone),loc:Q.fromObject(n)});throw new Re("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let i=mt(n.zone,se.defaultZone);if(!i.isValid)return B.invalid(qi(i));let s=se.now(),r=H(n.specificOffset)?i.offset(s):n.specificOffset,a=Hi(e,pl),o=!H(a.ordinal),u=!H(a.year),c=!H(a.month)||!H(a.day),d=u||c,f=a.weekYear||a.weekNumber,p=Q.fromObject(n);if((d||o)&&f)throw new en("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new en("Can't mix ordinal dates with month/day");let F=f||a.weekday&&!d,w,k,E=Wi(s,r);F?(w=Hf,k=Gf,E=Xs(E)):o?(w=Uf,k=jf,E=er(E)):(w=fl,k=hl);let V=!1;for(let $ of w){let I=a[$];H(I)?V?a[$]=k[$]:a[$]=E[$]:V=!0}let L=F?$f(a):o?Vf(a):al(a),G=L||ol(a);if(G)return B.invalid(G);let b=F?sl(a):o?rl(a):a,[v,M]=Ki(b,r,i),x=new B({ts:v,zone:i,o:M,loc:p});return a.weekday&&d&&e.weekday!==x.weekday?B.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${x.toISO()}`):x}static fromISO(e,n={}){let[i,s]=af(e);return Wn(i,s,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[i,s]=of(e);return Wn(i,s,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[i,s]=uf(e);return Wn(i,s,n,"HTTP",n)}static fromFormat(e,n,i={}){if(H(e)||H(n))throw new Re("fromFormat requires an input string and a format");let{locale:s=null,numberingSystem:r=null}=i,a=Q.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0}),[o,u,c,d]=If(a,e,n);return d?B.invalid(d):Wn(o,u,i,`format ${n}`,e,c)}static fromString(e,n,i={}){return B.fromFormat(e,n,i)}static fromSQL(e,n={}){let[i,s]=mf(e);return Wn(i,s,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new Re("need to specify a reason the DateTime is invalid");let i=e instanceof Be?e:new Be(e,n);if(se.throwOnInvalid)throw new jo(i);return new B({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let i=Qu(e,Q.fromObject(n));return i?i.map(s=>s?s.val:null).join(""):null}static expandFormat(e,n={}){return Yu(De.parseFormat(e),Q.fromObject(n)).map(s=>s.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?nr(this).weekYear:NaN}get weekNumber(){return this.isValid?nr(this).weekNumber:NaN}get weekday(){return this.isValid?nr(this).weekday:NaN}get ordinal(){return this.isValid?er(this.c).ordinal:NaN}get monthShort(){return this.isValid?qn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,n=6e4,i=Vi(this.c),s=this.zone.offset(i-e),r=this.zone.offset(i+e),a=this.zone.offset(i-s*n),o=this.zone.offset(i-r*n);if(a===o)return[this];let u=i-a*n,c=i-o*n,d=Wi(u,a),f=Wi(c,o);return d.hour===f.hour&&d.minute===f.minute&&d.second===f.second&&d.millisecond===f.millisecond?[Rt(this,{ts:u}),Rt(this,{ts:c})]:[this]}get isInLeapYear(){return Gn(this.year)}get daysInMonth(){return $i(this.year,this.month)}get daysInYear(){return this.isValid?jn(this.year):NaN}get weeksInWeekYear(){return this.isValid?Gi(this.weekYear):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:i,calendar:s}=De.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:i,outputCalendar:s}}toUTC(e=0,n={}){return this.setZone(Ee.instance(e),n)}toLocal(){return this.setZone(se.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:i=!1}={}){if(e=mt(e,se.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(n||i){let r=e.offset(this.ts),a=this.toObject();[s]=Ki(a,r,e)}return Rt(this,{ts:s,zone:e})}else return B.invalid(qi(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:i}={}){let s=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:i});return Rt(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=Hi(e,pl),i=!H(n.weekYear)||!H(n.weekNumber)||!H(n.weekday),s=!H(n.ordinal),r=!H(n.year),a=!H(n.month)||!H(n.day),o=r||a,u=n.weekYear||n.weekNumber;if((o||s)&&u)throw new en("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new en("Can't mix ordinal dates with month/day");let c;i?c=sl({...Xs(this.c),...n}):H(n.ordinal)?(c={...this.toObject(),...n},H(n.day)&&(c.day=Math.min($i(c.year,c.month),c.day))):c=rl({...er(this.c),...n});let[d,f]=Ki(c,this.o,this.zone);return Rt(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;let n=O.fromDurationLike(e);return Rt(this,cl(this,n))}minus(e){if(!this.isValid)return this;let n=O.fromDurationLike(e).negate();return Rt(this,cl(this,n))}startOf(e){if(!this.isValid)return this;let n={},i=O.normalizeUnit(e);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(i==="weeks"&&(n.weekday=1),i==="quarters"){let s=Math.ceil(this.month/3);n.month=(s-1)*3+1}return this.set(n)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,n={}){return this.isValid?De.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):tr}toLocaleString(e=Ni,n={}){return this.isValid?De.create(this.loc.clone(n),e).formatDateTime(this):tr}toLocaleParts(e={}){return this.isValid?De.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;let a=e==="extended",o=ir(this,a);return o+="T",o+=dl(this,a,n,i,s,r),o}toISODate({format:e="extended"}={}){return this.isValid?ir(this,e==="extended"):null}toISOWeekDate(){return zi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:r=!1,format:a="extended"}={}){return this.isValid?(s?"T":"")+dl(this,a==="extended",n,e,i,r):null}toRFC2822(){return zi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ir(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(n||e)&&(i&&(s+=" "),n?s+="z":e&&(s+="ZZ")),zi(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():tr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",i={}){if(!this.isValid||!e.isValid)return O.invalid("created by diffing an invalid DateTime");let s={locale:this.locale,numberingSystem:this.numberingSystem,...i},r=Dh(n).map(O.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,u=a?e:this,c=Ef(o,u,r,s);return a?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(B.now(),e,n)}until(e){return this.isValid?ee.fromDateTimes(this,e):this}hasSame(e,n){if(!this.isValid)return!1;let i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(n)<=i&&i<=s.endOf(n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let n=e.base||B.fromObject({},{zone:this.zone}),i=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(B.isDateTime))throw new Re("max requires all arguments be DateTimes");return Eu(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,i={}){let{locale:s=null,numberingSystem:r=null}=i,a=Q.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return Ju(a,e,n)}static fromStringExplain(e,n,i={}){return B.fromFormatExplain(e,n,i)}static get DATE_SHORT(){return Ni}static get DATE_MED(){return _o}static get DATE_MED_WITH_WEEKDAY(){return eh}static get DATE_FULL(){return qo}static get DATE_HUGE(){return Wo}static get TIME_SIMPLE(){return Ko}static get TIME_WITH_SECONDS(){return zo}static get TIME_WITH_SHORT_OFFSET(){return Zo}static get TIME_WITH_LONG_OFFSET(){return Yo}static get TIME_24_SIMPLE(){return Jo}static get TIME_24_WITH_SECONDS(){return Qo}static get TIME_24_WITH_SHORT_OFFSET(){return Xo}static get TIME_24_WITH_LONG_OFFSET(){return eu}static get DATETIME_SHORT(){return tu}static get DATETIME_SHORT_WITH_SECONDS(){return nu}static get DATETIME_MED(){return iu}static get DATETIME_MED_WITH_SECONDS(){return su}static get DATETIME_MED_WITH_WEEKDAY(){return th}static get DATETIME_FULL(){return ru}static get DATETIME_FULL_WITH_SECONDS(){return au}static get DATETIME_HUGE(){return ou}static get DATETIME_HUGE_WITH_SECONDS(){return uu}};function Kn(t){if(B.isDateTime(t))return t;if(t&&t.valueOf&&Tt(t.valueOf()))return B.fromJSDate(t);if(t&&typeof t=="object")return B.fromObject(t);throw new Re(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var sr={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},_f={allowHtml:!0};({...sr,..._f});var Zi=class{constructor(e){this.value=e,this.successful=!0}map(e){return new Zi(e(this.value))}flatMap(e){return e(this.value)}mapErr(e){return this}bimap(e,n){return this.map(e)}orElse(e){return this.value}cast(){return this}orElseThrow(e){return this.value}},Yi=class{constructor(e){this.error=e,this.successful=!1}map(e){return this}flatMap(e){return this}mapErr(e){return new Yi(e(this.error))}bimap(e,n){return this.mapErr(n)}orElse(e){return e}cast(){return this}orElseThrow(e){throw e?new Error(e(this.error)):new Error(""+this.error)}},Ji;(function(t){function e(r){return new Zi(r)}t.success=e;function n(r){return new Yi(r)}t.failure=n;function i(r,a,o){return r.successful?a.successful?o(r.value,a.value):n(a.error):n(r.error)}t.flatMap2=i;function s(r,a,o){return i(r,a,(u,c)=>e(o(u,c)))}t.map2=s})(Ji||(Ji={}));var qf=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Qi={exports:{}};Qi.exports;(function(t,e){(function(n,i){t.exports=i()})(typeof self!="undefined"?self:qf,function(){return function(n){var i={};function s(r){if(i[r])return i[r].exports;var a=i[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=n,s.c=i,s.d=function(r,a,o){s.o(r,a)||Object.defineProperty(r,a,{configurable:!1,enumerable:!0,get:o})},s.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},s.n=function(r){var a=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(a,"a",a),a},s.o=function(r,a){return Object.prototype.hasOwnProperty.call(r,a)},s.p="",s(s.s=0)}([function(n,i,s){function r(h){if(!(this instanceof r))return new r(h);this._=h}var a=r.prototype;function o(h,D){for(var y=0;y>7),buf:function(S){var T=u(function(A,j,Y,ve){return A.concat(Y===ve.length-1?Buffer.from([j,0]).readUInt16BE(0):ve.readUInt16BE(Y))},[],S);return Buffer.from(c(function(A){return(A<<1&65535)>>8},T))}(y.buf)}}),y}function f(){return typeof Buffer!="undefined"}function p(){if(!f())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function F(h){p();var D=u(function(T,A){return T+A},0,h);if(D%8!=0)throw new Error("The bits ["+h.join(", ")+"] add up to "+D+" which is not an even number of bytes; the total should be divisible by 8");var y,C=D/8,S=(y=function(T){return T>48},u(function(T,A){return T||(y(A)?A:T)},null,h));if(S)throw new Error(S+" bit range requested exceeds 48 bit (6 byte) Number max.");return new r(function(T,A){var j=C+A;return j>T.length?$(A,C.toString()+" bytes"):x(j,u(function(Y,ve){var pe=d(ve,Y.buf);return{coll:Y.coll.concat(pe.v),buf:pe.buf}},{coll:[],buf:T.slice(A,j)},h).coll)})}function w(h,D){return new r(function(y,C){return p(),C+D>y.length?$(C,D+" bytes for "+h):x(C+D,y.slice(C,C+D))})}function k(h,D){if(typeof(y=D)!="number"||Math.floor(y)!==y||D<0||D>6)throw new Error(h+" requires integer length in range [0, 6].");var y}function E(h){return k("uintBE",h),w("uintBE("+h+")",h).map(function(D){return D.readUIntBE(0,h)})}function V(h){return k("uintLE",h),w("uintLE("+h+")",h).map(function(D){return D.readUIntLE(0,h)})}function L(h){return k("intBE",h),w("intBE("+h+")",h).map(function(D){return D.readIntBE(0,h)})}function G(h){return k("intLE",h),w("intLE("+h+")",h).map(function(D){return D.readIntLE(0,h)})}function b(h){return h instanceof r}function v(h){return{}.toString.call(h)==="[object Array]"}function M(h){return f()&&Buffer.isBuffer(h)}function x(h,D){return{status:!0,index:h,value:D,furthest:-1,expected:[]}}function $(h,D){return v(D)||(D=[D]),{status:!1,index:-1,value:null,furthest:h,expected:D}}function I(h,D){if(!D||h.furthest>D.furthest)return h;var y=h.furthest===D.furthest?function(C,S){if(function(){if(r._supportsSet!==void 0)return r._supportsSet;var st=typeof Set!="undefined";return r._supportsSet=st,st}()&&Array.from){for(var T=new Set(C),A=0;A=0;){if(A in y){C=y[A].line,T===0&&(T=y[A].lineStart);break}(h.charAt(A)===` -`||h.charAt(A)==="\r"&&h.charAt(A+1)!==` -`)&&(S++,T===0&&(T=A+1)),A--}var j=C+S,Y=D-T;return y[D]={line:j,lineStart:T},{offset:D,line:j+1,column:Y+1}}function ce(h){if(!b(h))throw new Error("not a parser: "+h)}function Fe(h,D){return typeof h=="string"?h.charAt(D):h[D]}function X(h){if(typeof h!="number")throw new Error("not a number: "+h)}function de(h){if(typeof h!="function")throw new Error("not a function: "+h)}function Ce(h){if(typeof h!="string")throw new Error("not a string: "+h)}var te=2,ke=3,ne=8,qe=5*ne,Xn=4*ne,gn=" ";function Se(h,D){return new Array(D+1).join(h)}function We(h,D,y){var C=D-h.length;return C<=0?h:Se(y,C)+h}function Nr(h,D,y,C){return{from:h-D>0?h-D:0,to:h+y>C?C:h+y}}function cc(h,D){var y,C,S,T,A,j=D.index,Y=j.offset,ve=1;if(Y===h.length)return"Got the end of the input";if(M(h)){var pe=Y-Y%ne,it=Y-pe,Ae=Nr(pe,qe,Xn+ne,h.length),st=c(function(oe){return c(function(It){return We(It.toString(16),2,"0")},oe)},function(oe,It){var $t=oe.length,Ft=[],Vt=0;if($t<=It)return[oe.slice()];for(var Gt=0;Gt<$t;Gt++)Ft[Vt]||Ft.push([]),Ft[Vt].push(oe[Gt]),(Gt+1)%It==0&&Vt++;return Ft}(h.slice(Ae.from,Ae.to).toJSON().data,ne));T=function(oe){return oe.from===0&&oe.to===1?{from:oe.from,to:oe.to}:{from:oe.from/ne,to:Math.floor(oe.to/ne)}}(Ae),C=pe/ne,y=3*it,it>=4&&(y+=1),ve=2,S=c(function(oe){return oe.length<=4?oe.join(" "):oe.slice(0,4).join(" ")+" "+oe.slice(4).join(" ")},st),(A=(8*(T.to>0?T.to-1:T.to)).toString(16).length)<2&&(A=2)}else{var Mt=h.split(/\r\n|[\n\r\u2028\u2029]/);y=j.column-1,C=j.line-1,T=Nr(C,te,ke,Mt.length),S=Mt.slice(T.from,T.to),A=T.to.toString().length}var Fc=C-T.from;return M(h)&&(A=(8*(T.to>0?T.to-1:T.to)).toString(16).length)<2&&(A=2),u(function(oe,It,$t){var Ft,Vt=$t===Fc,Gt=Vt?"> ":gn;return Ft=M(h)?We((8*(T.from+$t)).toString(16),A,"0"):We((T.from+$t+1).toString(),A," "),[].concat(oe,[Gt+Ft+" | "+It],Vt?[gn+Se(" ",A)+" | "+We("",y," ")+Se("^",ve)]:[])},[],S).join(` -`)}function Br(h,D){return[` -`,"-- PARSING FAILED "+Se("-",50),` - -`,cc(h,D),` - -`,(y=D.expected,y.length===1?`Expected: - -`+y[0]:`Expected one of the following: - -`+y.join(", ")),` -`].join("");var y}function Lr(h){return h.flags!==void 0?h.flags:[h.global?"g":"",h.ignoreCase?"i":"",h.multiline?"m":"",h.unicode?"u":"",h.sticky?"y":""].join("")}function ei(){for(var h=[].slice.call(arguments),D=h.length,y=0;y=2?X(D):D=0;var y=function(S){return RegExp("^(?:"+S.source+")",Lr(S))}(h),C=""+h;return r(function(S,T){var A=y.exec(S.slice(T));if(A){if(0<=D&&D<=A.length){var j=A[0],Y=A[D];return x(T+j.length,Y)}return $(T,"valid match group (0 to "+A.length+") in "+C)}return $(T,C)})}function yt(h){return r(function(D,y){return x(y,h)})}function ni(h){return r(function(D,y){return $(y,h)})}function ii(h){if(b(h))return r(function(D,y){var C=h._(D,y);return C.index=y,C.value="",C});if(typeof h=="string")return ii(Dn(h));if(h instanceof RegExp)return ii(nt(h));throw new Error("not a string, regexp, or parser: "+h)}function Ir(h){return ce(h),r(function(D,y){var C=h._(D,y),S=D.slice(y,C.index);return C.status?$(y,'not "'+S+'"'):x(y,null)})}function si(h){return de(h),r(function(D,y){var C=Fe(D,y);return y=h.length?$(D,"any character/byte"):x(D+1,Fe(h,D))}),hc=r(function(h,D){return x(h.length,h.slice(D))}),os=r(function(h,D){return D=0}).desc(D)},r.optWhitespace=Dc,r.Parser=r,r.range=function(h,D){return si(function(y){return h<=y&&y<=D}).desc(h+"-"+D)},r.regex=nt,r.regexp=nt,r.sepBy=Mr,r.sepBy1=rs,r.seq=ei,r.seqMap=bt,r.seqObj=function(){for(var h,D={},y=0,C=(h=arguments,Array.prototype.slice.call(h)),S=C.length,T=0;T255)throw new Error("Value specified to byte constructor ("+h+"=0x"+h.toString(16)+") is larger in value than a single byte.");var D=(h>15?"0x":"0x0")+h.toString(16);return r(function(y,C){var S=Fe(y,C);return S===h?x(C+1,S):$(C,D)})},buffer:function(h){return w("buffer",h).map(function(D){return Buffer.from(D)})},encodedString:function(h,D){return w("string",D).map(function(y){return y.toString(h)})},uintBE:E,uint8BE:E(1),uint16BE:E(2),uint32BE:E(4),uintLE:V,uint8LE:V(1),uint16LE:V(2),uint32LE:V(4),intBE:L,int8BE:L(1),int16BE:L(2),int32BE:L(4),intLE:G,int8LE:G(1),int16LE:G(2),int32LE:G(4),floatBE:w("floatBE",4).map(function(h){return h.readFloatBE(0)}),floatLE:w("floatLE",4).map(function(h){return h.readFloatLE(0)}),doubleBE:w("doubleBE",8).map(function(h){return h.readDoubleBE(0)}),doubleLE:w("doubleLE",8).map(function(h){return h.readDoubleLE(0)})},n.exports=r}])})})(Qi,Qi.exports);var g=Qi.exports,rr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\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2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function bl(t){return t==null?t:t.shiftToAll().normalize()}function yl(t){return t.includes("/")&&(t=t.substring(t.lastIndexOf("/")+1)),t.endsWith(".md")&&(t=t.substring(0,t.length-3)),t}g.alt(g.regex(new RegExp(rr(),"")),g.regex(/[0-9\p{Letter}_-]+/u).map(t=>t.toLocaleLowerCase()),g.whitespace.map(t=>"-"),g.any.map(t=>"")).many().map(t=>t.join(""));var Wf=g.alt(g.regex(new RegExp(rr(),"")),g.regex(/[0-9\p{Letter}_-]+/u),g.whitespace.map(t=>" "),g.any.map(t=>" ")).many().map(t=>t.join("").split(/\s+/).join(" ").trim());function Kf(t){return Wf.tryParse(t)}function zf(t){return t=bl(t),t=O.fromObject(Object.fromEntries(Object.entries(t.toObject()).filter(([,e])=>e!=0))),t.toHuman()}var zn;(function(t){function e(b,v=sr,M=!1){let x=n(b);if(!x)return v.renderNullAs;switch(x.type){case"null":return v.renderNullAs;case"string":return x.value;case"number":case"boolean":return""+x.value;case"html":return x.value.outerHTML;case"widget":return x.value.markdown();case"link":return x.value.markdown();case"function":return"";case"array":let $="";return M&&($+="["),$+=x.value.map(I=>e(I,v,!0)).join(", "),M&&($+="]"),$;case"object":return"{ "+Object.entries(x.value).map(I=>I[0]+": "+e(I[1],v,!0)).join(", ")+" }";case"date":return x.value.second==0&&x.value.hour==0&&x.value.minute==0?x.value.toFormat(v.defaultDateFormat):x.value.toFormat(v.defaultDateTimeFormat);case"duration":return zf(x.value)}}t.toString=e;function n(b){return p(b)?{type:"null",value:b}:c(b)?{type:"number",value:b}:u(b)?{type:"string",value:b}:w(b)?{type:"boolean",value:b}:f(b)?{type:"duration",value:b}:d(b)?{type:"date",value:b}:E(b)?{type:"widget",value:b}:F(b)?{type:"array",value:b}:k(b)?{type:"link",value:b}:G(b)?{type:"function",value:b}:V(b)?{type:"html",value:b}:L(b)?{type:"object",value:b}:void 0}t.wrapValue=n;function i(b,v){if(L(b)){let M={};for(let[x,$]of Object.entries(b))M[x]=i($,v);return M}else if(F(b)){let M=[];for(let x of b)M.push(i(x,v));return M}else return v(b)}t.mapLeaves=i;function s(b,v,M){var x,$;if(b===void 0&&(b=null),v===void 0&&(v=null),b===null&&v===null)return 0;if(b===null)return-1;if(v===null)return 1;let I=n(b),K=n(v);if(I===void 0&&K===void 0)return 0;if(I===void 0)return-1;if(K===void 0)return 1;if(I.type!=K.type)return I.type.localeCompare(K.type);if(I.value===K.value)return 0;switch(I.type){case"string":return I.value.localeCompare(K.value);case"number":return I.valueSe),X=Fe(Ne.path).localeCompare(Fe(ce.path));if(X!=0)return X;let de=Ne.type.localeCompare(ce.type);return de!=0?de:Ne.subpath&&!ce.subpath?1:!Ne.subpath&&ce.subpath?-1:!Ne.subpath&&!ce.subpath?0:((x=Ne.subpath)!==null&&x!==void 0?x:"").localeCompare(($=ce.subpath)!==null&&$!==void 0?$:"");case"date":return I.value0;case"boolean":return v.value;case"link":return!!v.value.path;case"date":return v.value.toMillis()!=0;case"duration":return v.value.as("seconds")!=0;case"object":return Object.keys(v.value).length>0;case"array":return v.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}t.isTruthy=a;function o(b){if(b==null)return b;if(t.isArray(b))return[].concat(b.map(v=>o(v)));if(t.isObject(b)){let v={};for(let[M,x]of Object.entries(b))v[M]=o(x);return v}else return b}t.deepCopy=o;function u(b){return typeof b=="string"}t.isString=u;function c(b){return typeof b=="number"}t.isNumber=c;function d(b){return b instanceof B}t.isDate=d;function f(b){return b instanceof O}t.isDuration=f;function p(b){return b==null}t.isNull=p;function F(b){return Array.isArray(b)}t.isArray=F;function w(b){return typeof b=="boolean"}t.isBoolean=w;function k(b){return b instanceof be}t.isLink=k;function E(b){return b instanceof Xi}t.isWidget=E;function V(b){return typeof HTMLElement!="undefined"?b instanceof HTMLElement:!1}t.isHtml=V;function L(b){return typeof b=="object"&&!V(b)&&!E(b)&&!F(b)&&!f(b)&&!d(b)&&!k(b)&&b!==void 0&&!p(b)}t.isObject=L;function G(b){return typeof b=="function"}t.isFunction=G})(zn||(zn={}));var Fl;(function(t){function e(s){return zn.isObject(s)&&Object.keys(s).length==2&&"key"in s&&"rows"in s}t.isElementGroup=e;function n(s){for(let r of s)if(!e(r))return!1;return!0}t.isGrouping=n;function i(s){if(n(s)){let r=0;for(let a of s)r+=i(a.rows);return r}else return s.length}t.count=i})(Fl||(Fl={}));var be=class{static file(e,n=!1,i){return new be({path:e,embed:n,display:i,subpath:void 0,type:"file"})}static infer(e,n=!1,i){if(e.includes("#^")){let s=e.split("#^");return be.block(s[0],s[1],n,i)}else if(e.includes("#")){let s=e.split("#");return be.header(s[0],s[1],n,i)}else return be.file(e,n,i)}static header(e,n,i,s){return new be({path:e,embed:i,display:s,subpath:Kf(n),type:"header"})}static block(e,n,i,s){return new be({path:e,embed:i,display:s,subpath:n,type:"block"})}static fromObject(e){return new be(e)}constructor(e){Object.assign(this,e)}equals(e){return e==null||e==null?!1:this.path==e.path&&this.type==e.type&&this.subpath==e.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(e){return new be(Object.assign({},this,{path:e}))}withDisplay(e){return new be(Object.assign({},this,{display:e}))}withHeader(e){return be.header(this.path,e,this.embed,this.display)}toFile(){return be.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let e=new be(this);return e.embed=!0,e}}fromEmbed(){if(this.embed){let e=new be(this);return e.embed=!1,e}else return this}markdown(){let e=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?e+="|"+this.display:(e+="|"+yl(this.path),(this.type=="header"||this.type=="block")&&(e+=" > "+this.subpath)),e+="]]",e}obsidianLink(){var e,n;let i=this.path.replace("|","\\|");return this.type=="header"?i+"#"+((e=this.subpath)===null||e===void 0?void 0:e.replace("|","\\|")):this.type=="block"?i+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):i}fileName(){return yl(this.path).replace(".md","")}},Xi=class{constructor(e){this.$widget=e}},wl=class extends Xi{constructor(e,n){super("dataview:list-pair");this.key=e,this.value=n}markdown(){return`${zn.toString(this.key)}: ${zn.toString(this.value)}`}},El=class extends Xi{constructor(e,n){super("dataview:external-link");this.url=e,this.display=n}markdown(){var e;return`[${(e=this.display)!==null&&e!==void 0?e:this.url}](${this.url})`}},Cl;(function(t){function e(a,o){return new wl(a,o)}t.listPair=e;function n(a,o){return new El(a,o)}t.externalLink=n;function i(a){return a.$widget==="dataview:list-pair"}t.isListPair=i;function s(a){return a.$widget==="dataview:external-link"}t.isExternalLink=s;function r(a){return i(a)||s(a)}t.isBuiltin=r})(Cl||(Cl={}));var ie;(function(t){function e(p){return{type:"variable",name:p}}t.variable=e;function n(p){return{type:"literal",value:p}}t.literal=n;function i(p,F,w){return{type:"binaryop",left:p,op:F,right:w}}t.binaryOp=i;function s(p,F){return{type:"index",object:p,index:F}}t.index=s;function r(p){let F=p.split("."),w=t.variable(F[0]);for(let k=1;k"||p==">="||p=="!="||p=="="}t.isCompareOp=f,t.NULL=t.literal(null)})(ie||(ie={}));var et;(function(t){function e(d){return{type:"tag",tag:d}}t.tag=e;function n(d){return{type:"csv",path:d}}t.csv=n;function i(d){return{type:"folder",folder:d}}t.folder=i;function s(d,f){return{type:"link",file:d,direction:f?"incoming":"outgoing"}}t.link=s;function r(d,f,p){return{type:"binaryop",left:d,op:f,right:p}}t.binaryOp=r;function a(d,f){return{type:"binaryop",left:d,op:"&",right:f}}t.and=a;function o(d,f){return{type:"binaryop",left:d,op:"|",right:f}}t.or=o;function u(d){return{type:"negate",child:d}}t.negate=u;function c(){return{type:"empty"}}t.empty=c})(et||(et={}));var vl=new RegExp(rr(),""),ar={year:O.fromObject({years:1}),years:O.fromObject({years:1}),yr:O.fromObject({years:1}),yrs:O.fromObject({years:1}),month:O.fromObject({months:1}),months:O.fromObject({months:1}),mo:O.fromObject({months:1}),mos:O.fromObject({months:1}),week:O.fromObject({weeks:1}),weeks:O.fromObject({weeks:1}),wk:O.fromObject({weeks:1}),wks:O.fromObject({weeks:1}),w:O.fromObject({weeks:1}),day:O.fromObject({days:1}),days:O.fromObject({days:1}),d:O.fromObject({days:1}),hour:O.fromObject({hours:1}),hours:O.fromObject({hours:1}),hr:O.fromObject({hours:1}),hrs:O.fromObject({hours:1}),h:O.fromObject({hours:1}),minute:O.fromObject({minutes:1}),minutes:O.fromObject({minutes:1}),min:O.fromObject({minutes:1}),mins:O.fromObject({minutes:1}),m:O.fromObject({minutes:1}),second:O.fromObject({seconds:1}),seconds:O.fromObject({seconds:1}),sec:O.fromObject({seconds:1}),secs:O.fromObject({seconds:1}),s:O.fromObject({seconds:1})},or={now:()=>B.local(),today:()=>B.local().startOf("day"),yesterday:()=>B.local().startOf("day").minus(O.fromObject({days:1})),tomorrow:()=>B.local().startOf("day").plus(O.fromObject({days:1})),sow:()=>B.local().startOf("week"),"start-of-week":()=>B.local().startOf("week"),eow:()=>B.local().endOf("week"),"end-of-week":()=>B.local().endOf("week"),soy:()=>B.local().startOf("year"),"start-of-year":()=>B.local().startOf("year"),eoy:()=>B.local().endOf("year"),"end-of-year":()=>B.local().endOf("year"),som:()=>B.local().startOf("month"),"start-of-month":()=>B.local().startOf("month"),eom:()=>B.local().endOf("month"),"end-of-month":()=>B.local().endOf("month")},ur=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function Zf(t){let e=-1;for(;(e=t.indexOf("|",e+1))>=0;)if(!(e>0&&t[e-1]=="\\"))return[t.substring(0,e).replace(/\\\|/g,"|"),t.substring(e+1)];return[t.replace(/\\\|/g,"|"),void 0]}function Yf(t){let[e,n]=Zf(t);return be.infer(e,!1,n)}function Zn(t,e,n){return g.seqMap(t,g.seq(g.optWhitespace,e,g.optWhitespace,t).many(),(i,s)=>{if(s.length==0)return i;let r=n(i,s[0][1],s[0][3]);for(let a=1;a(s,r)=>{let a=t._(s,r);if(!a.status)return a;for(let o of e){let u=o(a.value)._(s,a.index);if(!u.status)return a;a=u}return a})}var He=g.createLanguage({number:t=>g.regexp(/-?[0-9]+(\.[0-9]+)?/).map(e=>Number.parseFloat(e)).desc("number"),string:t=>g.string('"').then(g.alt(t.escapeCharacter,g.noneOf('"\\')).atLeast(0).map(e=>e.join(""))).skip(g.string('"')).desc("string"),escapeCharacter:t=>g.string("\\").then(g.any).map(e=>e==='"'?'"':e==="\\"?"\\":"\\"+e),bool:t=>g.regexp(/true|false|True|False/).map(e=>e.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:t=>g.seqMap(g.string("#"),g.alt(g.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(e,n)=>e+n.join("")).desc("tag ('#hello/stuff')"),identifier:t=>g.seqMap(g.alt(g.regexp(/\p{Letter}/u),g.regexp(vl).desc("text")),g.alt(g.regexp(/[0-9\p{Letter}_-]/u),g.regexp(vl).desc("text")).many(),(e,n)=>e+n.join("")).desc("variable identifier"),link:t=>g.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(e=>Yf(e)).desc("file link"),embedLink:t=>g.seqMap(g.string("!").atMost(1),t.link,(e,n)=>(e.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:t=>g.regexp(/\+|-/).map(e=>e).desc("'+' or '-'"),binaryMulDiv:t=>g.regexp(/\*|\/|%/).map(e=>e).desc("'*' or '/' or '%'"),binaryCompareOp:t=>g.regexp(/>=|<=|!=|>|<|=/).map(e=>e).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:t=>g.regexp(/and|or|&|\|/i).map(e=>e.toLowerCase()=="and"?"&":e.toLowerCase()=="or"?"|":e).desc("'and' or 'or'"),rootDate:t=>g.seqMap(g.regexp(/\d{4}/),g.string("-"),g.regexp(/\d{2}/),(e,n,i)=>B.fromObject({year:Number.parseInt(e),month:Number.parseInt(i)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:t=>g.alt(...Object.keys(or).sort((e,n)=>n.length-e.length).map(g.string)),date:t=>Jf(t.rootDate,e=>g.seqMap(g.string("-"),g.regexp(/\d{2}/),(n,i)=>e.set({day:Number.parseInt(i)})),e=>g.seqMap(g.string("T"),g.regexp(/\d{2}/),(n,i)=>e.set({hour:Number.parseInt(i)})),e=>g.seqMap(g.string(":"),g.regexp(/\d{2}/),(n,i)=>e.set({minute:Number.parseInt(i)})),e=>g.seqMap(g.string(":"),g.regexp(/\d{2}/),(n,i)=>e.set({second:Number.parseInt(i)})),e=>g.alt(g.seqMap(g.string("."),g.regexp(/\d{3}/),(n,i)=>e.set({millisecond:Number.parseInt(i)})),g.succeed(e)),e=>g.alt(g.seqMap(g.string("+").or(g.string("-")),g.regexp(/\d{1,2}(:\d{2})?/),(n,i)=>e.setZone("UTC"+n+i,{keepLocalTime:!0})),g.seqMap(g.string("Z"),()=>e.setZone("utc",{keepLocalTime:!0})),g.seqMap(g.string("["),g.regexp(/[0-9A-Za-z+-\/]+/u),g.string("]"),(n,i,s)=>e.setZone(i,{keepLocalTime:!0})))).assert(e=>e.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:t=>g.alt(t.dateShorthand.map(e=>or[e]()),t.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:t=>g.alt(...Object.keys(ar).sort((e,n)=>n.length-e.length).map(g.string)),duration:t=>g.seqMap(t.number,g.optWhitespace,t.durationType,(e,n,i)=>ar[i].mapUnits(s=>s*e)).sepBy1(g.string(",").trim(g.optWhitespace).or(g.optWhitespace)).map(e=>e.reduce((n,i)=>n.plus(i))).desc("duration like 4hr2min"),rawNull:t=>g.string("null"),tagSource:t=>t.tag.map(e=>et.tag(e)),csvSource:t=>g.seqMap(g.string("csv(").skip(g.optWhitespace),t.string,g.string(")"),(e,n,i)=>et.csv(n)),linkIncomingSource:t=>t.link.map(e=>et.link(e.path,!0)),linkOutgoingSource:t=>g.seqMap(g.string("outgoing(").skip(g.optWhitespace),t.link,g.string(")"),(e,n,i)=>et.link(n.path,!1)),folderSource:t=>t.string.map(e=>et.folder(e)),parensSource:t=>g.seqMap(g.string("("),g.optWhitespace,t.source,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>i),negateSource:t=>g.seqMap(g.alt(g.string("-"),g.string("!")),t.atomSource,(e,n)=>et.negate(n)),atomSource:t=>g.alt(t.parensSource,t.negateSource,t.linkOutgoingSource,t.linkIncomingSource,t.folderSource,t.tagSource,t.csvSource),binaryOpSource:t=>Zn(t.atomSource,t.binaryBooleanOp.map(e=>e),et.binaryOp),source:t=>t.binaryOpSource,variableField:t=>t.identifier.chain(e=>ur.includes(e.toUpperCase())?g.fail("Variable fields cannot be a keyword ("+ur.join(" or ")+")"):g.succeed(ie.variable(e))).desc("variable"),numberField:t=>t.number.map(e=>ie.literal(e)).desc("number"),stringField:t=>t.string.map(e=>ie.literal(e)).desc("string"),boolField:t=>t.bool.map(e=>ie.literal(e)).desc("boolean"),dateField:t=>g.seqMap(g.string("date("),g.optWhitespace,t.datePlus,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>ie.literal(i)).desc("date"),durationField:t=>g.seqMap(g.string("dur("),g.optWhitespace,t.duration,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>ie.literal(i)).desc("duration"),nullField:t=>t.rawNull.map(e=>ie.NULL),linkField:t=>t.link.map(e=>ie.literal(e)),listField:t=>t.field.sepBy(g.string(",").trim(g.optWhitespace)).wrap(g.string("[").skip(g.optWhitespace),g.optWhitespace.then(g.string("]"))).map(e=>ie.list(e)).desc("list ('[1, 2, 3]')"),objectField:t=>g.seqMap(t.identifier.or(t.string),g.string(":").trim(g.optWhitespace),t.field,(e,n,i)=>({name:e,value:i})).sepBy(g.string(",").trim(g.optWhitespace)).wrap(g.string("{").skip(g.optWhitespace),g.optWhitespace.then(g.string("}"))).map(e=>{let n={};for(let i of e)n[i.name]=i.value;return ie.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:t=>g.alt(t.date,t.duration.map(e=>bl(e)),t.string,t.tag,t.embedLink,t.bool,t.number,t.rawNull),inlineFieldList:t=>t.atomInlineField.sepBy(g.string(",").trim(g.optWhitespace).lookahead(t.atomInlineField)),inlineField:t=>g.alt(g.seqMap(t.atomInlineField,g.string(",").trim(g.optWhitespace),t.inlineFieldList,(e,n,i)=>[e].concat(i)),t.atomInlineField),atomField:t=>g.alt(t.embedLink.map(e=>ie.literal(e)),t.negatedField,t.linkField,t.listField,t.objectField,t.lambdaField,t.parensField,t.boolField,t.numberField,t.stringField,t.dateField,t.durationField,t.nullField,t.variableField),indexField:t=>g.seqMap(t.atomField,g.alt(t.dotPostfix,t.indexPostfix,t.functionPostfix).many(),(e,n)=>{let i=e;for(let s of n)switch(s.type){case"dot":i=ie.index(i,ie.literal(s.field));break;case"index":i=ie.index(i,s.field);break;case"function":i=ie.func(i,s.fields);break}return i}),negatedField:t=>g.seqMap(g.string("!"),t.indexField,(e,n)=>ie.negate(n)).desc("negated field"),parensField:t=>g.seqMap(g.string("("),g.optWhitespace,t.field,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>i),lambdaField:t=>g.seqMap(t.identifier.sepBy(g.string(",").trim(g.optWhitespace)).wrap(g.string("(").trim(g.optWhitespace),g.string(")").trim(g.optWhitespace)),g.string("=>").trim(g.optWhitespace),t.field,(e,n,i)=>({type:"lambda",arguments:e,value:i})),dotPostfix:t=>g.seqMap(g.string("."),t.identifier,(e,n)=>({type:"dot",field:n})),indexPostfix:t=>g.seqMap(g.string("["),g.optWhitespace,t.field,g.optWhitespace,g.string("]"),(e,n,i,s,r)=>({type:"index",field:i})),functionPostfix:t=>g.seqMap(g.string("("),g.optWhitespace,t.field.sepBy(g.string(",").trim(g.optWhitespace)),g.optWhitespace,g.string(")"),(e,n,i,s,r)=>({type:"function",fields:i})),binaryMulDivField:t=>Zn(t.indexField,t.binaryMulDiv,ie.binaryOp),binaryPlusMinusField:t=>Zn(t.binaryMulDivField,t.binaryPlusMinus,ie.binaryOp),binaryCompareField:t=>Zn(t.binaryPlusMinusField,t.binaryCompareOp,ie.binaryOp),binaryBooleanField:t=>Zn(t.binaryCompareField,t.binaryBooleanOp,ie.binaryOp),binaryOpField:t=>t.binaryBooleanField,field:t=>t.binaryOpField});function Qf(t){try{return Ji.success(He.field.tryParse(t))}catch(e){return Ji.failure(""+e)}}var es;(function(t){function e(i,s){return{name:i,field:s}}t.named=e;function n(i,s){return{field:i,direction:s}}t.sortBy=n})(es||(es={}));function Xf(t){return g.custom((e,n)=>(i,s)=>{let r=t._(i,s);return r.status?Object.assign({},r,{value:[r.value,i.substring(s,r.index)]}):r})}function ep(t){return t.split(/[\r\n]+/).map(e=>e.trim()).join("")}function xl(t,e){return g.eof.map(t).or(g.whitespace.then(e))}var tp=g.createLanguage({queryType:t=>g.alt(g.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(e=>e.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:t=>g.seqMap(He.field.skip(g.whitespace),g.regexp(/AS/i).skip(g.whitespace),He.identifier.or(He.string),(e,n,i)=>es.named(i,e)),namedField:t=>g.alt(t.explicitNamedField,Xf(He.field).map(([e,n])=>es.named(ep(n),e))),sortField:t=>g.seqMap(He.field.skip(g.optWhitespace),g.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(e,n)=>{let i=n.length==0?"ascending":n[0].toLowerCase();return i=="desc"&&(i="descending"),i=="asc"&&(i="ascending"),{field:e,direction:i}}),headerClause:t=>t.queryType.chain(e=>{switch(e){case"table":return xl(()=>({type:e,fields:[],showId:!0}),g.seqMap(g.regexp(/WITHOUT\s+ID/i).skip(g.optWhitespace).atMost(1),g.sepBy(t.namedField,g.string(",").trim(g.optWhitespace)),(n,i)=>({type:e,fields:i,showId:n.length==0})));case"list":return xl(()=>({type:e,format:void 0,showId:!0}),g.seqMap(g.regexp(/WITHOUT\s+ID/i).skip(g.optWhitespace).atMost(1),He.field.atMost(1),(n,i)=>({type:e,format:i.length==1?i[0]:void 0,showId:n.length==0})));case"task":return g.succeed({type:e});case"calendar":return g.whitespace.then(g.seqMap(t.namedField,n=>({type:e,showId:!0,field:n})));default:return g.fail(`Unrecognized query type '${e}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:t=>g.seqMap(g.regexp(/FROM/i),g.whitespace,He.source,(e,n,i)=>i),whereClause:t=>g.seqMap(g.regexp(/WHERE/i),g.whitespace,He.field,(e,n,i)=>({type:"where",clause:i})).desc("WHERE "),sortByClause:t=>g.seqMap(g.regexp(/SORT/i),g.whitespace,t.sortField.sepBy1(g.string(",").trim(g.optWhitespace)),(e,n,i)=>({type:"sort",fields:i})).desc("SORT field [ASC/DESC]"),limitClause:t=>g.seqMap(g.regexp(/LIMIT/i),g.whitespace,He.field,(e,n,i)=>({type:"limit",amount:i})).desc("LIMIT "),flattenClause:t=>g.seqMap(g.regexp(/FLATTEN/i).skip(g.whitespace),t.namedField,(e,n)=>({type:"flatten",field:n})).desc("FLATTEN [AS ]"),groupByClause:t=>g.seqMap(g.regexp(/GROUP BY/i).skip(g.whitespace),t.namedField,(e,n)=>({type:"group",field:n})).desc("GROUP BY [AS ]"),clause:t=>g.alt(t.fromClause,t.whereClause,t.sortByClause,t.limitClause,t.groupByClause,t.flattenClause),query:t=>g.seqMap(t.headerClause.trim(g.optWhitespace),t.fromClause.trim(g.optWhitespace).atMost(1),t.clause.trim(g.optWhitespace).many(),(e,n,i)=>({header:e,source:n.length==0?et.folder(""):n[0],operations:i,settings:sr}))}),np=t=>{var e;return t?(e=t.plugins.plugins.dataview)===null||e===void 0?void 0:e.api:window.DataviewAPI},ip=t=>t.plugins.enabledPlugins.has("dataview");tt.DATE_SHORTHANDS=or;tt.DURATION_TYPES=ar;tt.EXPRESSION=He;tt.KEYWORDS=ur;tt.QUERY_LANGUAGE=tp;tt.getAPI=np;tt.isPluginEnabled=ip;tt.parseField=Qf});us(exports,{default:()=>Or});function ct(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}var xa=W(ia());function sa(t){return Object.prototype.toString.call(t)==="[object Object]"}function ai(t){var e,n;return sa(t)===!1?!1:(e=t.constructor,e===void 0?!0:(n=e.prototype,!(sa(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function Oc(t){return t?Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{}):{}}function ra(t,e){let n=Object.assign({},t);return Object.keys(e).forEach(i=>{ai(e[i])?i in t?n[i]=ra(t[i],e[i]):Object.assign(n,{[i]:e[i]}):Object.assign(n,{[i]:e[i]})}),n}function aa(t){for(let e in t)t[e]===void 0&&delete t[e];return t}function ls(t,e,n){if(typeof e=="string"){let[s,r]=e.split(" ");n=Object.assign(r?{method:s,url:r}:{url:s},n)}else n=Object.assign({},e);n.headers=Oc(n.headers),aa(n),aa(n.headers);let i=ra(t||{},n);return t&&t.mediaType.previews.length&&(i.mediaType.previews=t.mediaType.previews.filter(s=>!i.mediaType.previews.includes(s)).concat(i.mediaType.previews)),i.mediaType.previews=i.mediaType.previews.map(s=>s.replace(/-preview/,"")),i}function Nc(t,e){let n=/\?/.test(t)?"&":"?",i=Object.keys(e);return i.length===0?t:t+n+i.map(s=>s==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${s}=${encodeURIComponent(e[s])}`).join("&")}var Bc=/\{[^}]+\}/g;function Lc(t){return t.replace(/^\W+|\W+$/g,"").split(/,/)}function Mc(t){let e=t.match(Bc);return e?e.map(Lc).reduce((n,i)=>n.concat(i),[]):[]}function oa(t,e){return Object.keys(t).filter(n=>!e.includes(n)).reduce((n,i)=>(n[i]=t[i],n),{})}function ua(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}function Ht(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function Fn(t,e,n){return e=t==="+"||t==="#"?ua(e):Ht(e),n?Ht(n)+"="+e:e}function Ut(t){return t!=null}function cs(t){return t===";"||t==="&"||t==="?"}function Ic(t,e,n,i){var s=t[n],r=[];if(Ut(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),r.push(Fn(e,s,cs(e)?n:""));else if(i==="*")Array.isArray(s)?s.filter(Ut).forEach(function(a){r.push(Fn(e,a,cs(e)?n:""))}):Object.keys(s).forEach(function(a){Ut(s[a])&&r.push(Fn(e,s[a],a))});else{let a=[];Array.isArray(s)?s.filter(Ut).forEach(function(o){a.push(Fn(e,o))}):Object.keys(s).forEach(function(o){Ut(s[o])&&(a.push(Ht(o)),a.push(Fn(e,s[o].toString())))}),cs(e)?r.push(Ht(n)+"="+a.join(",")):a.length!==0&&r.push(a.join(","))}else e===";"?Ut(s)&&r.push(Ht(n)):s===""&&(e==="&"||e==="?")?r.push(Ht(n)+"="):s===""&&r.push("");return r}function $c(t){return{expand:Vc.bind(null,t)}}function Vc(t,e){var n=["+","#",".","/",";","?","&"];return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,s,r){if(s){let o="",u=[];if(n.indexOf(s.charAt(0))!==-1&&(o=s.charAt(0),s=s.substr(1)),s.split(/,/g).forEach(function(c){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(c);u.push(Ic(e,o,d[1],d[2]||d[3]))}),o&&o!=="+"){var a=",";return o==="?"?a="&":o!=="#"&&(a=o),(u.length!==0?o:"")+u.join(a)}else return u.join(",")}else return ua(r)})}function la(t){let e=t.method.toUpperCase(),n=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},t.headers),s,r=oa(t,["method","baseUrl","url","headers","request","mediaType"]),a=Mc(n);n=$c(n).expand(r),/^http/.test(n)||(n=t.baseUrl+n);let o=Object.keys(t).filter(d=>a.includes(d)).concat("baseUrl"),u=oa(r,o);if(!/application\/octet-stream/i.test(i.accept)&&(t.mediaType.format&&(i.accept=i.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),t.mediaType.previews.length)){let d=i.accept.match(/[\w-]+(?=-preview)/g)||[];i.accept=d.concat(t.mediaType.previews).map(f=>{let p=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${f}-preview${p}`}).join(",")}return["GET","HEAD"].includes(e)?n=Nc(n,u):"data"in u?s=u.data:Object.keys(u).length&&(s=u),!i["content-type"]&&typeof s!="undefined"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof s=="undefined"&&(s=""),Object.assign({method:e,url:n,headers:i},typeof s!="undefined"?{body:s}:null,t.request?{request:t.request}:null)}function Gc(t,e,n){return la(ls(t,e,n))}function ca(t,e){let n=ls(t,e),i=Gc.bind(null,n);return Object.assign(i,{DEFAULTS:n,defaults:ca.bind(null,n),merge:ls.bind(null,n),parse:la})}var jc="7.0.6",Hc=`octokit-endpoint.js/${jc} ${ct()}`,Uc={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Hc},mediaType:{format:"",previews:[]}},da=ca(null,Uc);var Fa=W(fa());var oi=class extends Error{constructor(e){super(e);Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}};var hs=W(ya()),qc=(0,hs.default)(t=>console.warn(t)),Wc=(0,hs.default)(t=>console.warn(t)),Et=class extends Error{constructor(e,n,i){super(e);Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=n;let s;"headers"in i&&typeof i.headers!="undefined"&&(s=i.headers),"response"in i&&(this.response=i.response,s=i.response.headers);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),r.url=r.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=r,Object.defineProperty(this,"code",{get(){return qc(new oi("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),n}}),Object.defineProperty(this,"headers",{get(){return Wc(new oi("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")),s||{}}})}};var Kc="6.2.8";function zc(t){return t.arrayBuffer()}function wa(t){let e=t.request&&t.request.log?t.request.log:console;(ai(t.body)||Array.isArray(t.body))&&(t.body=JSON.stringify(t.body));let n={},i,s;return(t.request&&t.request.fetch||globalThis.fetch||Fa.default)(t.url,Object.assign({method:t.method,body:t.body,headers:t.headers,redirect:t.redirect,...t.body&&{duplex:"half"}},t.request)).then(async a=>{s=a.url,i=a.status;for(let o of a.headers)n[o[0]]=o[1];if("deprecation"in n){let o=n.link&&n.link.match(/<([^>]+)>; rel="deprecation"/),u=o&&o.pop();e.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${n.sunset}${u?`. See ${u}`:""}`)}if(!(i===204||i===205)){if(t.method==="HEAD"){if(i<400)return;throw new Et(a.statusText,i,{response:{url:s,status:i,headers:n,data:void 0},request:t})}if(i===304)throw new Et("Not modified",i,{response:{url:s,status:i,headers:n,data:await fs(a)},request:t});if(i>=400){let o=await fs(a);throw new Et(Zc(o),i,{response:{url:s,status:i,headers:n,data:o},request:t})}return fs(a)}}).then(a=>({status:i,url:s,headers:n,data:a})).catch(a=>{throw a instanceof Et||a.name==="AbortError"?a:new Et(a.message,500,{request:t})})}async function fs(t){let e=t.headers.get("content-type");return/application\/json/.test(e)?t.json():!e||/^text\/|charset=utf-8$/.test(e)?t.text():zc(t)}function Zc(t){return typeof t=="string"?t:"message"in t?Array.isArray(t.errors)?`${t.message}: ${t.errors.map(JSON.stringify).join(", ")}`:t.message:`Unknown error: ${JSON.stringify(t)}`}function ps(t,e){let n=t.defaults(e);return Object.assign(function(s,r){let a=n.merge(s,r);if(!a.request||!a.request.hook)return wa(n.parse(a));let o=(u,c)=>wa(n.parse(n.merge(u,c)));return Object.assign(o,{endpoint:n,defaults:ps.bind(null,n)}),a.request.hook(o,a)},{endpoint:n,defaults:ps.bind(null,n)})}var wn=ps(da,{headers:{"user-agent":`octokit-request.js/${Kc} ${ct()}`}});var Yc="5.0.6";function Jc(t){return`Request failed due to following response errors: -`+t.errors.map(e=>` - ${e.message}`).join(` -`)}var Qc=class extends Error{constructor(t,e,n){super(Jc(n));this.request=t,this.headers=e,this.response=n,this.name="GraphqlResponseError",this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Xc=["method","baseUrl","url","headers","request","query","mediaType"],ed=["query","method","url"],Ea=/\/api\/v3\/?$/;function td(t,e,n){if(n){if(typeof e=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let a in n)if(!!ed.includes(a))return Promise.reject(new Error(`[@octokit/graphql] "${a}" cannot be used as variable name`))}let i=typeof e=="string"?Object.assign({query:e},n):e,s=Object.keys(i).reduce((a,o)=>Xc.includes(o)?(a[o]=i[o],a):(a.variables||(a.variables={}),a.variables[o]=i[o],a),{}),r=i.baseUrl||t.endpoint.DEFAULTS.baseUrl;return Ea.test(r)&&(s.url=r.replace(Ea,"/api/graphql")),t(s).then(a=>{if(a.data.errors){let o={};for(let u of Object.keys(a.headers))o[u]=a.headers[u];throw new Qc(s,o,a.data)}return a.data.data})}function ms(t,e){let n=t.defaults(e);return Object.assign((s,r)=>td(n,s,r),{defaults:ms.bind(null,n),endpoint:n.endpoint})}var Qp=ms(wn,{headers:{"user-agent":`octokit-graphql.js/${Yc} ${ct()}`},method:"POST",url:"/graphql"});function Ca(t){return ms(t,{method:"POST",url:"/graphql"})}var nd=/^v1\./,id=/^ghs_/,sd=/^ghu_/;async function rd(t){let e=t.split(/\./).length===3,n=nd.test(t)||id.test(t),i=sd.test(t);return{type:"token",token:t,tokenType:e?"app":n?"installation":i?"user-to-server":"oauth"}}function ad(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}async function od(t,e,n,i){let s=e.endpoint.merge(n,i);return s.headers.authorization=ad(t),e(s)}var va=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(rd.bind(null,e),{hook:od.bind(null,e)})};var ka="4.2.4",En=class{static defaults(t){return class extends this{constructor(...n){let i=n[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugin(...t){var e;let n=this.plugins;return e=class extends this{},e.plugins=n.concat(t.filter(s=>!n.includes(s))),e}constructor(t={}){let e=new xa.Collection,n={baseUrl:wn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:e.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=[t.userAgent,`octokit-core.js/${ka} ${ct()}`].filter(Boolean).join(" "),t.baseUrl&&(n.baseUrl=t.baseUrl),t.previews&&(n.mediaType.previews=t.previews),t.timeZone&&(n.headers["time-zone"]=t.timeZone),this.request=wn.defaults(n),this.graphql=Ca(this.request).defaults(n),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},t.log),this.hook=e,t.authStrategy){let{authStrategy:s,...r}=t,a=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},t.auth));e.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=va(t.auth);e.wrap("request",s.hook),this.auth=s}this.constructor.plugins.forEach(s=>{Object.assign(this,s(this,t))})}};En.VERSION=ka;En.plugins=[];var ud={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}},Cn=class{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||ud,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),i=0;i{this.observers[i]=this.observers[i]||[],this.observers[i].push(n)}),this}off(e,n){if(!!this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(i=>i!==n)}}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s{a(...i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[e,...i])})}};function xn(){let t,e,n=new Promise((i,s)=>{t=i,e=s});return n.resolve=t,n.reject=e,n}function Sa(t){return t==null?"":""+t}function ld(t,e,n){t.forEach(i=>{e[i]&&(n[i]=e[i])})}function gs(t,e,n){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function s(){return!t||typeof t=="string"}let r=typeof e!="string"?[].concat(e):e.split(".");for(;r.length>1;){if(s())return{};let a=i(r.shift());!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={}}return s()?{}:{obj:t,k:i(r.shift())}}function Ta(t,e,n){let{obj:i,k:s}=gs(t,e,Object);i[s]=n}function cd(t,e,n,i){let{obj:s,k:r}=gs(t,e,Object);s[r]=s[r]||[],i&&(s[r]=s[r].concat(n)),i||s[r].push(n)}function li(t,e){let{obj:n,k:i}=gs(t,e);if(!!n)return n[i]}function dd(t,e,n){let i=li(t,n);return i!==void 0?i:li(e,n)}function Aa(t,e,n){for(let i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?typeof t[i]=="string"||t[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?n&&(t[i]=e[i]):Aa(t[i],e[i],n):t[i]=e[i]);return t}function qt(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var hd={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function fd(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>hd[e]):t}var pd=[" ",",","?","!",";"];function md(t,e,n){e=e||"",n=n||"";let i=pd.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(i.length===0)return!0;let s=new RegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`),r=!s.test(t);if(!r){let a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(r=!0)}return r}function ci(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];let i=e.split(n),s=t;for(let r=0;rr+a;)a++,o=i.slice(r,r+a).join(n),u=s[o];if(u===void 0)return;if(u===null)return null;if(e.endsWith(o)){if(typeof u=="string")return u;if(o&&typeof u[o]=="string")return u[o]}let c=i.slice(r+a).join(n);return c?ci(u,c,n):void 0}s=s[i[r]]}return s}function di(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}var Ds=class extends vn{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super();this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,n];i&&typeof i!="string"&&(o=o.concat(i)),i&&typeof i=="string"&&(o=o.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(o=e.split("."));let u=li(this.data,o);return u||!a||typeof i!="string"?u:ci(this.data&&this.data[e]&&this.data[e][n],i,r)}addResource(e,n,i,s){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=[e,n];i&&(o=o.concat(a?i.split(a):i)),e.indexOf(".")>-1&&(o=e.split("."),s=n,n=o[1]),this.addNamespaces(n),Ta(this.data,o,s),r.silent||this.emit("added",e,n,i,s)}addResources(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let r in i)(typeof i[r]=="string"||Object.prototype.toString.apply(i[r])==="[object Array]")&&this.addResource(e,n,r,i[r],{silent:!0});s.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,s,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),s=i,i=n,n=o[1]),this.addNamespaces(n);let u=li(this.data,o)||{};s?Aa(u,i,r):u={...u,...i},Ta(this.data,o,u),a.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}},Pa={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,s){return t.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,n,i,s))}),e}},Ra={},kn=class extends vn{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super();ld(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ke.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let i=this.resolve(e,n);return i&&i.res!==void 0}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");let s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,r=n.ns||this.options.defaultNS||[],a=i&&e.indexOf(i)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!md(e,i,s);if(a&&!o){let u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:r};let c=e.split(i);(i!==s||i===s&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(s)}return typeof r=="string"&&(r=[r]),{key:e,namespaces:r}}translate(e,n,i){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);let s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],n),u=o[o.length-1],c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){let b=n.nsSeparator||this.options.nsSeparator;return s?{res:`${u}${b}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${b}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a}let f=this.resolve(e,n),p=f&&f.res,F=f&&f.usedKey||a,w=f&&f.exactUsedKey||a,k=Object.prototype.toString.apply(p),E=["[object Number]","[object Function]","[object RegExp]"],V=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject;if(L&&p&&(typeof p!="string"&&typeof p!="boolean"&&typeof p!="number")&&E.indexOf(k)<0&&!(typeof V=="string"&&k==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(F,p,{...n,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(f.res=b,f.usedParams=this.getUsedParamsDetails(n),f):b}if(r){let b=k==="[object Array]",v=b?[]:{},M=b?w:F;for(let x in p)if(Object.prototype.hasOwnProperty.call(p,x)){let $=`${M}${r}${x}`;v[x]=this.translate($,{...n,joinArrays:!1,ns:o}),v[x]===$&&(v[x]=p[x])}p=v}}else if(L&&typeof V=="string"&&k==="[object Array]")p=p.join(V),p&&(p=this.extendTranslation(p,e,n,i));else{let b=!1,v=!1,M=n.count!==void 0&&typeof n.count!="string",x=kn.hasDefaultValue(n),$=M?this.pluralResolver.getSuffix(c,n.count,n):"",I=n.ordinal&&M?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",K=n[`defaultValue${$}`]||n[`defaultValue${I}`]||n.defaultValue;!this.isValidLookup(p)&&x&&(b=!0,p=K),this.isValidLookup(p)||(v=!0,p=a);let ce=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&v?void 0:p,Fe=x&&K!==p&&this.options.updateMissing;if(v||b||Fe){if(this.logger.log(Fe?"updateKey":"missingKey",c,u,a,Fe?K:p),r){let te=this.resolve(a,{...n,keySeparator:!1});te&&te.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let X=[],de=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&de&&de[0])for(let te=0;te{let qe=x&&ne!==p?ne:ce;this.options.missingKeyHandler?this.options.missingKeyHandler(te,u,ke,qe,Fe,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(te,u,ke,qe,Fe,n),this.emit("missingKey",te,u,ke,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?X.forEach(te=>{this.pluralResolver.getSuffixes(te,n).forEach(ke=>{Ce([te],a+ke,n[`defaultValue${ke}`]||K)})}):Ce(X,a,K))}p=this.extendTranslation(p,e,n,f,i),v&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${u}:${a}`),(v||b)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,b?p:void 0):p=this.options.parseMissingKeyHandler(p))}return s?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(e,n,i,s,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});let c=typeof e=="string"&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(c){let p=e.match(this.interpolator.nestingRegexp);d=p&&p.length}let f=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,i.lng||this.language,i),c){let p=e.match(this.interpolator.nestingRegexp),F=p&&p.length;d1&&arguments[1]!==void 0?arguments[1]:{},i,s,r,a,o;return typeof e=="string"&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(i))return;let c=this.extractFromKey(u,n),d=c.key;s=d;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));let p=n.count!==void 0&&typeof n.count!="string",F=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",k=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(E=>{this.isValidLookup(i)||(o=E,!Ra[`${k[0]}-${E}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(Ra[`${k[0]}-${E}`]=!0,this.logger.warn(`key "${s}" for languages "${k.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(V=>{if(this.isValidLookup(i))return;a=V;let L=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(L,d,V,E,n);else{let b;p&&(b=this.pluralResolver.getSuffix(V,n.count,n));let v=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(L.push(d+b),n.ordinal&&b.indexOf(M)===0&&L.push(d+b.replace(M,this.options.pluralSeparator)),F&&L.push(d+v)),w){let x=`${d}${this.options.contextSeparator}${n.context}`;L.push(x),p&&(L.push(x+b),n.ordinal&&b.indexOf(M)===0&&L.push(x+b.replace(M,this.options.pluralSeparator)),F&&L.push(x+v))}}let G;for(;G=L.pop();)this.isValidLookup(i)||(r=G,i=this.getResource(V,E,G,n))}))})}),{res:i,usedKey:s,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,i,s):this.resourceStore.getResource(e,n,i,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&typeof e.replace!="string",s=i?e.replace:e;if(i&&typeof e.count!="undefined"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(let r of n)delete s[r]}return s}static hasDefaultValue(e){let n="defaultValue";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}};function bs(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ys=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ke.create("languageUtils")}getScriptPartFromCode(e){if(e=di(e),!e||e.indexOf("-")<0)return null;let n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=di(e),!e||e.indexOf("-")<0)return e;let n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){let n=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map(s=>s.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=bs(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=bs(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=bs(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;let s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;let s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(r=>{if(r===s)return r;if(!(r.indexOf("-")<0&&s.indexOf("-")<0)&&r.indexOf(s)===0)return r})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){let i=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],r=a=>{!a||(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):typeof e=="string"&&r(this.formatLanguageCode(e)),i.forEach(a=>{s.indexOf(a)<0&&r(this.formatLanguageCode(a))}),s}},gd=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Dd={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},bd=["v1","v2","v3"],yd=["v4"],Oa={zero:0,one:1,two:2,few:3,many:4,other:5};function Fd(){let t={};return gd.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:Dd[e.fc]}})}),t}var Na=class{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=Ke.create("pluralResolver"),(!this.options.compatibilityJSON||yd.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Fd()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(di(e),{type:n.ordinal?"ordinal":"cardinal"})}catch(i){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(e,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((s,r)=>Oa[s]-Oa[r]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):i.numbers.map(s=>this.getSuffix(e,s,n)):[]}getSuffix(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.getRule(e,i);return s?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){let i=e.noAbs?e.plurals(n):e.plurals(Math.abs(n)),s=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));let r=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!bd.includes(this.options.compatibilityJSON)}};function Ba(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=dd(t,e,n);return!r&&s&&typeof n=="string"&&(r=ci(t,n,i),r===void 0&&(r=ci(e,n,i))),r}var La=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let n=e.interpolation;this.escape=n.escape!==void 0?n.escape:fd,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?qt(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?qt(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?qt(n.nestingPrefix):n.nestingPrefixEscaped||qt("$t("),this.nestingSuffix=n.nestingSuffix?qt(n.nestingSuffix):n.nestingSuffixEscaped||qt(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");let n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");let i=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(i,"g")}interpolate(e,n,i,s){let r,a,o,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(w){return w.replace(/\$/g,"$$$$")}let d=w=>{if(w.indexOf(this.formatSeparator)<0){let L=Ba(n,u,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(L,void 0,i,{...s,...n,interpolationkey:w}):L}let k=w.split(this.formatSeparator),E=k.shift().trim(),V=k.join(this.formatSeparator).trim();return this.format(Ba(n,u,E,this.options.keySeparator,this.options.ignoreJSONStructure),V,i,{...s,...n,interpolationkey:E})};this.resetRegExp();let f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>c(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?c(this.escape(w)):c(w)}].forEach(w=>{for(o=0;r=w.regex.exec(e);){let k=r[1].trim();if(a=d(k),a===void 0)if(typeof f=="function"){let V=f(e,r,s);a=typeof V=="string"?V:""}else if(s&&Object.prototype.hasOwnProperty.call(s,k))a="";else if(p){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${k} for interpolating ${e}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=Sa(a));let E=w.safeValue(a);if(e=e.replace(r[0],E),p?(w.regex.lastIndex+=a.length,w.regex.lastIndex-=r[0].length):w.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,a;function o(u,c){let d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;let f=u.split(new RegExp(`${d}[ ]*{`)),p=`{${f[1]}`;u=f[0],p=this.interpolate(p,a);let F=p.match(/'/g),w=p.match(/"/g);(F&&F.length%2==0&&!w||w.length%2!=0)&&(p=p.replace(/'/g,'"'));try{a=JSON.parse(p),c&&(a={...c,...a})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,k),`${u}${d}${p}`}return delete a.defaultValue,u}for(;s=this.nestingRegexp.exec(e);){let u=[];a={...i},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){let d=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=d.shift(),u=d,c=!0}if(r=n(o.call(this,s[1].trim(),a),a),r&&s[0]===e&&typeof r!="string")return r;typeof r!="string"&&(r=Sa(r)),r||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),r=""),c&&(r=u.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:s[1].trim()}),r.trim())),e=e.replace(s[0],r),this.regexp.lastIndex=0}return e}};function wd(t){let e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){let i=t.split("(");e=i[0].toLowerCase().trim();let s=i[1].substring(0,i[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(!a)return;let[o,...u]=a.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=c),c==="false"&&(n[o.trim()]=!1),c==="true"&&(n[o.trim()]=!0),isNaN(c)||(n[o.trim()]=parseInt(c,10))})}return{formatName:e,formatOptions:n}}function Wt(t){let e={};return function(i,s,r){let a=s+JSON.stringify(r),o=e[a];return o||(o=t(di(s),r),e[a]=o),o(i)}}var Ma=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("formatter"),this.options=e,this.formats={number:Wt((n,i)=>{let s=new Intl.NumberFormat(n,{...i});return r=>s.format(r)}),currency:Wt((n,i)=>{let s=new Intl.NumberFormat(n,{...i,style:"currency"});return r=>s.format(r)}),datetime:Wt((n,i)=>{let s=new Intl.DateTimeFormat(n,{...i});return r=>s.format(r)}),relativetime:Wt((n,i)=>{let s=new Intl.RelativeTimeFormat(n,{...i});return r=>s.format(r,i.range||"day")}),list:Wt((n,i)=>{let s=new Intl.ListFormat(n,{...i});return r=>s.format(r)})},this.init(e)}init(e){let i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Wt(n)}format(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((o,u)=>{let{formatName:c,formatOptions:d}=wd(u);if(this.formats[c]){let f=o;try{let p=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},F=p.locale||p.lng||s.locale||s.lng||i;f=this.formats[c](o,F,{...d,...s,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${c}`);return o},e)}};function Ed(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var Ia=class extends vn{constructor(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super();this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=Ke.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,s.backend,s)}queueLoad(e,n,i,s){let r={},a={},o={},u={};return e.forEach(c=>{let d=!0;n.forEach(f=>{let p=`${c}|${f}`;!i.reload&&this.store.hasResourceBundle(c,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?a[p]===void 0&&(a[p]=!0):(this.state[p]=1,d=!1,a[p]===void 0&&(a[p]=!0),r[p]===void 0&&(r[p]=!0),u[f]===void 0&&(u[f]=!0)))}),d||(o[c]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(u)}}loaded(e,n,i){let s=e.split("|"),r=s[0],a=s[1];n&&this.emit("failedLoading",r,a,n),i&&this.store.addResourceBundle(r,a,i),this.state[e]=n?-1:2;let o={};this.queue.forEach(u=>{cd(u.loaded,[r],a),Ed(u,e),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{o[c]||(o[c]={});let d=u.loaded[c];d.length&&d.forEach(f=>{o[c][f]===void 0&&(o[c][f]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.done)}read(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:s,wait:r,callback:a});return}this.readingCalls++;let o=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){let f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&d&&s{this.read.call(this,e,n,i,s+1,r*2,a)},r);return}a(c,d)},u=this.backend[i].bind(this.backend);if(u.length===2){try{let c=u(e,n);c&&typeof c.then=="function"?c.then(d=>o(null,d)).catch(o):o(null,c)}catch(c){o(c)}return}return u(e,n,o)}prepareLoading(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);let r=this.queueLoad(e,n,i,s);if(!r.toLoad.length)return r.pending.length||s(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=e.split("|"),s=i[0],r=i[1];this.read(s,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${r} for language ${s} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${r} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,n,i,s,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend&&this.backend.create){let u={...a,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,n,i,s,u):d=c(e,n,i,s),d&&typeof d.then=="function"?d.then(f=>o(null,f)).catch(o):o(null,d)}catch(d){o(d)}else c(e,n,i,s,o,u)}!e||!e[0]||this.store.addResource(e[0],n,i,s)}}};function $a(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let n={};if(typeof e[1]=="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){let i=e[3]||e[2];Object.keys(i).forEach(s=>{n[s]=i[s]})}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Va(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function hi(){}function Cd(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var Kt=class extends vn{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;super();if(this.options=Va(e),this.services={},this.logger=Ke,this.modules={external:[]},Cd(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(i=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));let s=$a();this.options={...s,...this.options,...Va(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function r(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Ke.init(r(this.modules.logger),this.options):Ke.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl!="undefined"&&(d=Ma);let f=new ys(this.options);this.store=new Ds(this.options.resources,this.options);let p=this.services;p.logger=Ke,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new Na(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=r(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new La(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new Ia(r(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(F){for(var w=arguments.length,k=new Array(w>1?w-1:0),E=1;E1?w-1:0),E=1;E{F.init&&F.init(this)})}if(this.format=this.options.interpolation.format,i||(i=hi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});let u=xn(),c=()=>{let d=(f,p)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(p),i(f,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),u}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hi,s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();let r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&r.indexOf(c)<0&&r.push(c)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(o)})}else i(null)}reloadResources(e,n,i){let s=xn();return e||(e=this.languages),n||(n=this.options.ns),i||(i=hi),this.services.backendConnector.reload(e,n,r=>{s.resolve(),i(r)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Pa.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,n){var i=this;this.isLanguageChangingTo=e;let s=xn();this.emit("languageChanging",e);let r=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve(function(){return i.t(...arguments)}),n&&n(u,function(){return i.t(...arguments)})},o=u=>{!e&&!u&&this.services.languageDetector&&(u=[]);let c=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,i){var s=this;let r=function(a,o){let u;if(typeof o!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),f=2;f`${u.keyPrefix}${p}${w}`):F=u.keyPrefix?`${u.keyPrefix}${p}${a}`:a,s.t(F,u)};return typeof e=="string"?r.lng=e:r.lngs=e,r.ns=n,r.keyPrefix=i,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let i=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;let a=(o,u)=>{let c=this.services.backendConnector.state[`${o}|${u}`];return c===-1||c===2};if(n.precheck){let o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,e)&&(!s||a(r,e)))}loadNamespaces(e,n){let i=xn();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),n&&n(s)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){let i=xn();typeof e=="string"&&(e=[e]);let s=this.options.preload||[],r=e.filter(a=>s.indexOf(a)<0);return r.length?(this.options.preload=s.concat(r),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services&&this.services.languageUtils||new ys($a());return n.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Kt(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hi,i=e.forkResourceStore;i&&delete e.forkResourceStore;let s={...this.options,...e,isClone:!0},r=new Kt(s);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},i&&(r.store=new Ds(this.store.data,s),r.services.resourceStore=r.store),r.translator=new kn(r.services,s),r.translator.on("*",function(o){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d{if(typeof t=="object"&&t!==null){if(typeof Object.getPrototypeOf=="function"){let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}return Object.prototype.toString.call(t)==="[object Object]"}return!1},ze=(...t)=>t.reduce((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach(i=>{["__proto__","constructor","prototype"].includes(i)||(Array.isArray(e[i])&&Array.isArray(n[i])?e[i]=ze.options.mergeArrays?ze.options.uniqueArrayItems?Array.from(new Set(e[i].concat(n[i]))):[...e[i],...n[i]]:n[i]:Ga(e[i])&&Ga(n[i])?e[i]=ze(e[i],n[i]):e[i]=n[i]===void 0?ze.options.allowUndefinedOverrides?n[i]:e[i]:n[i])}),e},{}),Fs={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};ze.options=Fs;ze.withOptions=(t,...e)=>{ze.options=Object.assign(Object.assign({},Fs),t);let n=ze(...e);return ze.options=Fs,n};var ja=ze;var Po=W(require("obsidian"));var $e=W(require("obsidian"));var me=W(require("obsidian"));var xe;(function(n){n.path="path",n.title="title"})(xe||(xe={}));var ue;(function(a){a.github="github-configuration",a.upload="upload-configuration",a.text="text-conversion",a.embed="embed-configuration",a.plugin="plugin-settings",a.help="help"})(ue||(ue={}));var q;(function(i){i.yaml="yaml",i.obsidian="obsidian",i.fixed="fixed"})(q||(q={}));var Pe;(function(n){n.free="Github Free/Pro/Team (default)",n.entreprise="Enterprise"})(Pe||(Pe={}));var dt="%configDir%/plugins/%pluginID%/env",ws={github:{user:"",repo:"",branch:"main",automaticallyMergePR:!0,tokenPath:dt,api:{tiersForApi:Pe.free,hostname:""},workflow:{commitMessage:"[PUBLISHER] Merge",name:""},otherRepo:[],verifiedRepo:!1,rateLimit:0},upload:{behavior:q.fixed,defaultName:"",rootFolder:"",yamlFolderKey:"",frontmatterTitle:{enable:!1,key:"title"},replaceTitle:[],replacePath:[],autoclean:{enable:!1,excluded:[]},folderNote:{enable:!1,rename:"index.md",addTitle:{enable:!1,key:"title"}},metadataExtractorPath:""},conversion:{hardbreak:!1,dataview:!0,censorText:[],tags:{inline:!1,exclude:[],fields:[]},links:{internal:!1,unshared:!1,wiki:!1,slugify:!1}},embed:{attachments:!0,overrideAttachments:[],keySendFile:[],notes:!1,folder:"",convertEmbedToLinks:"keep",charConvert:"->"},plugin:{shareKey:"share",fileMenu:!1,editorMenu:!1,excludedFolder:[],copyLink:{enable:!1,links:"",removePart:[],addCmd:!1},noticeError:!1,displayModalRepoEditing:!1}},ht=/^\/(.*)\/[igmsuy]*$/;var Ct=W(require("obsidian"));var Ha=W(require("obsidian"));function fi(t,e,n){var r,a;let i={convertWiki:e.conversion.links.wiki,attachment:e.embed.attachments,embed:e.embed.notes,links:!0,removeEmbed:e.embed.convertEmbedToLinks,charEmbedLinks:e.embed.charConvert,dataview:e.conversion.dataview,hardbreak:e.conversion.hardbreak,unshared:e.conversion.links.unshared,convertInternalLinks:e.conversion.links.internal};return(n?(r=n.shareAll)==null?void 0:r.enable:(a=e.plugin.shareAll)==null?void 0:a.enable)&&(i.unshared=!0),t&&(t.links!==void 0&&(typeof t.links=="object"?(t.links.convert!==void 0&&(i.links=t.links.convert),t.links.internals!==void 0&&(i.convertInternalLinks=t.links.internals),t.links.mdlinks!==void 0&&(i.convertWiki=t.links.mdlinks),t.links.nonShared!==void 0&&(i.unshared=t.links.nonShared)):i.links=t.links),t.embed!==void 0&&(typeof t.embed=="object"?(t.embed.send!==void 0&&(i.embed=t.embed.send),t.embed.remove!==void 0&&(i.removeEmbed=Ua(t.embed.remove)),t.embed.char!==void 0&&(i.charEmbedLinks=t.embed.char)):i.embed=t.embed),t.attachment!==void 0&&(typeof t.attachment=="object"?(t.attachment.send!==void 0&&(i.attachment=t.attachment.send),t.attachment.folder!==void 0&&(i.attachmentLinks=t.attachment.folder)):i.attachment=t.attachment),t.attachmentLinks!==void 0&&(i.attachmentLinks=(0,Ha.normalizePath)(t.attachmentLinks.toString().replace(/\/$/,""))),t.mdlinks!==void 0&&(i.convertWiki=t.mdlinks),t.removeEmbed!==void 0&&(i.removeEmbed=Ua(t.removeEmbed)),t.dataview!==void 0&&(i.dataview=t.dataview),t.hardbreak!==void 0&&(i.hardbreak=t.hardbreak),t.internals!==void 0&&(i.convertInternalLinks=t.internals),t.nonShared!==void 0&&(i.unshared=t.nonShared)),i}function Ua(t){return t==="true"?"keep":t==="false"?"remove":t==="links"?"links":t==="bake"||t==="include"?"bake":"keep"}function J(t,e,n){var a;let i=e!=null?e:t.github;if(n&&typeof n.shortRepo=="string"&&n.shortRepo!=="default"){let o=n.shortRepo.toLowerCase(),c=t.github.otherRepo.find(d=>d.smartKey.toLowerCase()===o);i=c!=null?c:i}let s={branch:i.branch,repo:i.repo,owner:i.user,autoclean:t.upload.autoclean.enable,workflowName:i.workflow.name,commitMsg:i.workflow.commitMessage,automaticallyMergePR:i.automaticallyMergePR,verifiedRepo:(a=i.verifiedRepo)!=null?a:!1};if(t.upload.behavior===q.fixed&&(s.autoclean=!1),!n||n.multipleRepo===void 0&&n.repo===void 0&&n.shortRepo===void 0)return s;let r=null;if(n.multipleRepo){let o=vd(n,s);return o.length===1?o[0]:o}else if(n.repo)if(typeof n.repo=="object")n.repo.branch!==void 0&&(s.branch=n.repo.branch),n.repo.repo!==void 0&&(s.repo=n.repo.repo),n.repo.owner!==void 0&&(s.owner=n.repo.owner),n.repo.autoclean!==void 0&&(s.autoclean=n.repo.autoclean,r=!0);else{let o=n.repo.split("/");r=o.length>4?!0:null,s=_a(o,s)}else if(n.shortRepo instanceof Array)return xd(n,t.github.otherRepo,s);return n.autoclean!==void 0&&r===null&&(s.autoclean=n.autoclean),s}function vd(t,e){let n=[];if(t.multipleRepo instanceof Array&&t.multipleRepo.length>0)for(let i of t.multipleRepo)if(typeof i=="object"){let s={branch:e.branch,repo:e.repo,owner:e.owner,autoclean:!1,automaticallyMergePR:e.automaticallyMergePR,workflowName:e.workflowName,commitMsg:e.commitMsg};i.branch!==void 0&&(s.branch=i.branch),i.repo!==void 0&&(s.repo=i.repo),i.owner!==void 0&&(s.owner=i.owner),i.autoclean!==void 0&&(s.autoclean=i.autoclean),n.push(s)}else{let s=i.split("/"),r={branch:e.branch,repo:e.repo,owner:e.owner,autoclean:!1,automaticallyMergePR:e.automaticallyMergePR,workflowName:e.workflowName,commitMsg:e.commitMsg};n.push(_a(s,r))}return n.filter((i,s,r)=>r.findIndex(a=>a.repo===i.repo&&a.owner===i.owner&&a.branch===i.branch&&a.autoclean===i.autoclean)===s)}function xd(t,e,n){if(t.shortRepo instanceof Array){let i=[];for(let s of t.shortRepo){let r=s.toLowerCase();if(r==="default")i.push(n);else{let a=e.filter(o=>o.smartKey.toLowerCase()===r)[0];a&&i.push({branch:a.branch,repo:a.repo,owner:a.user,autoclean:n.autoclean,automaticallyMergePR:a.automaticallyMergePR,workflowName:a.workflow.name,commitMsg:a.workflow.commitMessage})}}return i}return n}function _a(t,e){let n={branch:e.branch,repo:e.repo,owner:e.owner,autoclean:!1,automaticallyMergePR:e.automaticallyMergePR,workflowName:e.workflowName,commitMsg:e.commitMsg};return t.length>=4&&(n.branch=t[2],n.repo=t[1],n.owner=t[0],n.autoclean=t[3]==="true"),t.length===3?(n.branch=t[2],n.repo=t[1],n.owner=t[0]):t.length===2?(n.repo=t[1],n.owner=t[0]):t.length===1&&(n.repo=t[0]),n}function Es(t,e){let n=e.upload.yamlFolderKey,i=t&&t[n]!==void 0?t[n]:e.upload.defaultName;return i instanceof Array?i.join("/"):i}function qa(t,e,n){var r,a,o;if(e.frontmatter.general.unshared)return!0;if((a=(r=e.repository)==null?void 0:r.shareAll)==null?void 0:a.enable){let u=e.repository.shareAll.excludedFileName;return!n.basename.startsWith(u)}if(!t||Cs(e.settings,n))return!1;let s=((o=e.repository)==null?void 0:o.shareKey)||e.settings.plugin.shareKey;return R({settings:e.settings},"shareKey",s,"frontmatter",t[s]),t[s]==null||t[s]===void 0||["false","0","no"].includes(t[s].toString().toLowerCase())?!1:["true","1","yes"].includes(t[s].toString().toLowerCase())}function pi(t,e){var i;let n=t.github.otherRepo;if(((i=t.plugin.shareAll)==null?void 0:i.enable)&&!e)return ft(t);if(!e)return null;for(let s of n)if(e[s.shareKey])return s;return R({settings:t},"No other repo found, using default repo"),ft(t)}function he(t,e,n,i){var r,a;if(!n||n.extension!=="md")return!1;let s=e.github.otherRepo.filter(o=>{var u;return(u=o.shareAll)==null?void 0:u.enable});if(!((r=e.plugin.shareAll)==null?void 0:r.enable)&&s.length===0){let o=i?i.shareKey:e.plugin.shareKey;if(t==null||!t[o]||t[o]==null||Cs(e,n)||t[o]===void 0||["false","0","no"].includes(t[o].toString().toLowerCase()))return!1;let u=t[o].toString().toLowerCase();return["true","1","yes"].includes(u)}else if(((a=e.plugin.shareAll)==null?void 0:a.enable)||s.length>0){let o=s.map(u=>u.shareAll.excludedFileName);if(o.push(e.plugin.shareAll.excludedFileName),o.some(u=>!n.basename.startsWith(u))&&!Cs(e,n))return!0}return!1}function Cs(t,e){let n=t.plugin.excludedFolder;for(let i of n){let s=i.match(ht),r=s?new RegExp(s[1],s[2]):null;if(r&&r.test(e.path)||e.path.contains(i.trim()))return!0}return!1}function Wa(t,e){var r;let n=[];((r=e.plugin.shareAll)==null?void 0:r.enable)&&n.push("share");let i=e.github.otherRepo.filter(a=>a.shareAll);if(i.length>0)for(let a of i)n.push(a.smartKey);if(!t)return n;let s=e.github.otherRepo.map(a=>a.shareKey);s.push(e.plugin.shareKey);for(let a of s)t[a]&&n.push(a);return n}function we(t){return t.match(/(png|jpe?g|gif|bmp|svg|mp[34]|web[mp]|wav|m4a|ogg|3gp|flac|ogv|mov|mkv|pdf)$/i)}function mi(t,e){t=t instanceof Array?t:[t],e=e instanceof Array?e:[e];let n=(i,s)=>i.owner===s.owner&&i.repo===s.repo&&i.branch===s.branch;for(let i of e)for(let s of t)if(n(i,s))return!0;for(let i of t)for(let s of e)if(n(i,s))return!0;return!1}function gi(t,e,n=!1){return m(this,null,function*(){t=Array.isArray(t)?t:[t];let i=[];if((yield e.loadToken()).length===0){i.push(!0);let a=l.t("common.ghToken");n||new Ct.Notice(l.t("error.isEmpty",{what:a}))}else for(let a of t)if(a.repo.length===0){i.push(!0);let o=l.t("common.repository");n||new Ct.Notice(l.t("error.isEmpty",{what:o}))}else if(a.owner.length===0){i.push(!0);let o=l.t("error.whatEmpty.owner");n||new Ct.Notice(l.t("error.isEmpty",{what:o}))}else if(a.branch.length===0){i.push(!0);let o=l.t("error.whatEmpty.branch");n||new Ct.Notice(l.t("error.isEmpty",{what:o}))}else i.push(!1);return!i.every(a=>a===!0)})}function Ka(t){let e=t.convertWiki,n=t.attachment,i=t.embed,s=t.links;return!e&&s&&n&&i&&!t.removeEmbed}function Ze(t,e=null,n,i=!1){return m(this,null,function*(){var a;let s=t.settings,r=t.plugin.app.metadataCache;try{let o=n?(a=r.getFileCache(n))==null?void 0:a.frontmatter:void 0,u=J(s,e,o);if(yield gi(u,t.plugin,i))return yield t.checkRepository(u,i),!0}catch(o){return _({settings:s,e:!0},o),!1}return!1})}function vt(t,e,n=1){return m(this,null,function*(){let i=t.settings;try{let s=!1;if(e instanceof Array?s=e.every(a=>a.verifiedRepo):e.verifiedRepo&&(s=!0),s&&i.github.rateLimit>0)return!0;if(yield gi(e,t.plugin))return yield t.checkRepository(e,!0),i.github.rateLimit===0||n>20?(yield Ye(t.octokit,i,!1,n))>0:!0}catch(s){return _({settings:i,e:!0},s),!1}return!1})}function ft(t){return{smartKey:"default",user:t.github.user,repo:t.github.repo,branch:t.github.branch,automaticallyMergePR:t.github.automaticallyMergePR,verifiedRepo:t.github.verifiedRepo,api:{tiersForApi:t.github.api.tiersForApi,hostname:t.github.api.hostname},workflow:{commitMessage:t.github.workflow.commitMessage,name:t.github.workflow.name},createShortcuts:!1,shareKey:t.plugin.shareKey.length>0?t.plugin.shareKey:"share",copyLink:{links:t.plugin.copyLink.links,removePart:t.plugin.copyLink.removePart}}}function Ye(t,e,n=!1,i=1){return m(this,null,function*(){let s=yield t.request("GET /rate_limit"),r=s.data.resources.core.remaining,a=s.data.resources.core.reset,u=new Date(a*1e3).toLocaleTimeString();return r<=i?(new Ct.Notice(l.t("commands.checkValidity.rateLimit.limited",{resetTime:u})),0):(n?new Ct.Notice(l.t("commands.checkValidity.rateLimit.notLimited",{remaining:r,resetTime:u})):_({settings:e},l.t("commands.checkValidity.rateLimit.notLimited",{remaining:r,resetTime:u})),r)})}function za(t,e){return e.embed.overrideAttachments.filter(i=>{let s=i.path.match(ht),r=s?new RegExp(s[1],s[2]):null;return i.forcePush&&((r==null?void 0:r.test(t.path))||t.path===i.path||i.path.contains("{{all}}"))}).length!==0}function Za(t){if(t.settings.upload.folderNote.enable){let n=t.settings.upload.folderNote.rename;return t.filepath.split("/").pop()===n}return!1}var Ya=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\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DEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var kd=Object.hasOwnProperty,Sn=class{constructor(){this.occurrences,this.reset()}slug(e,n){let i=this,s=Sd(e,n===!0),r=s;for(;kd.call(i.occurrences,s);)i.occurrences[r]++,s=r+"-"+i.occurrences[r];return i.occurrences[s]=0,s}reset(){this.occurrences=Object.create(null)}};function Sd(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(Ya,"").replace(/ /g,"-"))}function Di(t,e,n,i,s){let r=e.convertWiki,a=e.attachment,o=e.links;if(Ka(e))return t;let u=/!?\[\[.*?\]\]/g,c=t.match(u);if(c){let d=/(\[\[).*?([\]|])/;for(let f of c){let p=f.match(d),F=f.startsWith("!")?"!":"",w=f.startsWith("!");if(p){let k=f,E=p[0].replaceAll("[","").replaceAll("|","").replaceAll("]","").replaceAll("\\",""),V=p[0].replaceAll("[","").replaceAll("|","").replaceAll("]","").replaceAll("\\","").replaceAll("../","").replaceAll("./","").replace(/#.*/,""),L=n.find(G=>G.linkFrom.replace(/#.*/,"")===V);if(L&&!vs(L,s)){let G;L.linked.extension!=="md"?G=L.altText?L.altText:"":(G=L.altText?L.altText:L.linked.basename,G=G.replace("#"," > ").replace(/ > \^\w*/,""));let b=(e.removeEmbed==="remove"||e.removeEmbed==="bake")&&w&&L.linked.extension==="md";if(w&&L.linked.extension==="md"&&e.removeEmbed==="links"&&(F=`${e.charEmbedLinks} `,k=k.replace("!",F)),r){let v=f.match(/(\|).*(]])/),M=E.split("/"),x=Xa(v,M,E.split(".").at(-1),E);x=x.replace("#"," > ").replace(/ > \^\w*/,""),k=Qa(E,F,x,i)}else{let v=f.match(/(\|).*(]])/);k=Ja(v,k)}L.linked.extension==="md"&&!o&&!w&&(k=G),(!a&&we(L.linked.extension)||b)&&(k=""),t=zt(t,f,k,i,!0)}else if(!E.startsWith("http")&&!eo(E,s)){let G=f.match(/(\|).*(]])/),b=E.split("/"),v=Xa(G,b,E.split(".").at(-1),E);v=v.replace("#"," > ").replace(/ > \^\w*/,"");let M=!we(E.trim())&&e.removeEmbed==="remove"&&w;w&&e.removeEmbed==="links"&&!we(E.trim())&&(F=e.charEmbedLinks+" ",k=k.replace("!",F)),r?k=Qa(E,F,v,i):k=Ja(G,k),!we(E.trim())&&!o&&!w&&(k=v),(!a&&we(E.trim())||M)&&(k=""),t=zt(t,f,k,i,!0)}}}}return t}function Ja(t,e){if(!t){let n=e.match(/\[{2}(.*)\]{2}/),i=n?n[1].replace("#"," > ").replace(/ > \^\w*/,""):"";return e.replace(/\[{2}(.*)\]{2}/,`[[$1|${i}]]`)}return e}function Qa(t,e,n,i){let s=we(t.trim())?t.trim():t.replace(/#.*/,"").trim()+".md",r=t.match(/(#.*)/)?t.match(/(#.*)/)[0].replaceAll(" ","%20"):"",a=encodeURI(s);if(i.conversion.links.slugify){let o=new Sn;r=t.match(/(#.*)/)?o.slug(t.match(/(#.*)/)[0]):"",o.reset(),r.length>0&&(r=`#${r}`)}return`${e}[${n}](${a}${r})`}function Td(t,e){return t.match(/\[{2}.*\]{2}/)&&!t.match(/(\|).*(]])/)?t.replace("|","").replace("]]",`|${e.altText}]]`):t}function Te(t){return t.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}function bi(t,e,n,i,s,r){return m(this,null,function*(){let a=r.frontmatter.general,o=r.settings;if(!a.convertInternalLinks)return t;for(let u of e){if(vs(u,s))continue;let c=yield yi(n,u,s,i,r);c=c.replace(".md","");let d=u.anchor?u.anchor:"",f=Te(u.linkFrom.replace(d,"")).replaceAll(" ","%20")+d.replace("^","\\^");f=f.replaceAll(" ","%20");let p=Te(u.linkFrom),F=new RegExp(`(\\[{2}${p}(\\\\?\\|.*?)?\\]{2})|(\\[.*?\\]\\((${p}|${f})\\))`,"g"),w=t.match(F);if(w)for(let k of w){let E=new RegExp(`((${p})|(${f}))`),V=c;u.anchor&&(c=c.replace(/#.*/,""),V+=u.anchor);let L=k.replace(E,V);if(k.match(/\[.*\]\(.*\)/)){if(u.linked.extension==="md"){let b=new Sn;d=o.conversion.links.slugify?b.slug(d):d,b.reset(),d.length>0&&(d=`#${d}`),c=`${c.replaceAll(" ","%20")}.md${d}`,c=!c.match(/(#.*)/)&&!c.endsWith(".md")?`${c}.md`:c}L=`[${k.match(/\[(.*)\]/)[1]}](${c})`}L=Td(L,u),t=zt(t,k,L,o,!0)}}return t})}function Xa(t,e,n,i){return t?t[0].replace("]]","").replace("|",""):n==="md"?e.length>1?e[e.length-1]:e[0]:i.split("/").at(-1)}function xs(t,e){let n=e;if(!e){let i=t.match(/\/([gimy]+)$/);n=i?Array.from(new Set(i[1].split(""))).join(""):""}return new RegExp(t.replace(/\/(.+)\/.*/,"$1"),n)}function Fi(t,e,n){if(!e.conversion.censorText)return t;let i=n?e.conversion.censorText.filter(s=>s.after):e.conversion.censorText.filter(s=>!s.after);for(let s of i)if(s.entry.trim().length>0){let r=s.entry,a=s.replace;if(r.match(/^\/.+\/[gimy]*$/)){let o=xs(r,s.flags);s.inCodeBlocks?t=t.replace(o,a):t=zt(t,o,a,e)}else s.inCodeBlocks?t=t.replace(r,a):t=zt(t,r,a,e)}return t}function zt(t,e,n,i,s){let r,a;return e instanceof RegExp?(r="```[\\s\\S]*?```|`[^`]*`|",s&&(r+="\\\\?!?"),r+=e.source,a=new RegExp(r,`g${e.flags}`)):(r="```[\\s\\S]*?```|`[^`]*`|\\\\?!?",s&&(r+="\\\\?!?"),r+=Te(e),a=new RegExp(r,"g")),t.replace(a,o=>{if(o.match(/`[^`]*`/)||o.match(/```[\s\S]*?```/))return o;if(s&&o.match(/^\\/))return o;try{let u=JSON.parse(`"${n}"`);return o.replace(e,u)}catch(u){return R({settings:i,e:!0},u),o.replace(e,n)}})}function vs(t,e){if(e)for(let n in e){let i=`[[${t.linkFrom}]]`;if(e[n]===i)return!0}return!1}function eo(t,e){if(e){for(let n in e)if(e[n]===`[[${t}]]`)return!0}return!1}function yi(t,e,n,i,s){return m(this,null,function*(){let{metadataCache:r}=i,a=s.settings,o=s.repository,u=Je(t,a,o,i),c=r.getFileCache(e.linked).frontmatter,d=J(a,o,c),f=mi(s.frontmatter.repo,d),p=qa(c,s,e.linked);if(R({settings:a},`Shared: ${p} for ${e.linked.path}`),e.linked.extension==="md"&&(!f||!p))return e.destinationFilePath?e.destinationFilePath:e.linked.basename;if(e.linked.path===t.path)return Je(e.linked,a,o,i).split("/").at(-1);let F=e.linked.extension==="md"?Je(e.linked,a,o,i):Zt(e.linked,a,fi(n,a,o)),w=u.split("/"),k=F.split("/"),E=(M,x)=>{let $=0;for(;M[$]===x[$];)$++;return M.slice($)},V=E(w,k),L=E(k,w),b=function(M){let x=[];for(let $ of M)$!=M.at(-1)&&x.push("..");return x}(V);b.length===0&&b.push(".");let v=b.concat(L).join("/");return v.trim()==="."||v.trim()===""?Je(e.linked,a,o,i).split("/").at(-1):v})}function Ad(t,e,n,i){let s=n.upload.folderNote.rename,a=`${t.parent?`/${t.parent.path}/`:"/"}${rt(i,n)}`;if(!n.upload.folderNote.enable)return a;let o=t.parent?t.parent.name:"";if(i.replace(".md","")===o)return`/${t.parent.path}/${s}`;let u=e.getAbstractFileByPath(t.path.replace(".md",""));return u&&u instanceof me.TFolder?`/${u.path}/${s}`:a}function Pd(t,e,n,i){var u;i=Ad(t,n,e,i);let r=(e.upload.defaultName.length>0?e.upload.defaultName:"")+i,a=r.split("/").slice(0,-1).join("/"),o=(u=r.split("/").at(-1))!=null?u:"";return a=Tn(a,e),a.trim().length===0?o:`${a}/${o}`.replace(/^\//,"")}function Rd(t,e,n){let i=Es(e,n);R({settings:n},`Category: ${i}`);let s=i.split("/"),r=i.endsWith("/")?s.at(-2):s.at(-1);return n.upload.folderNote.enable&&t.replace(".md","").toLowerCase()===(r==null?void 0:r.toLowerCase())?n.upload.folderNote.rename:rt(t,n)}function Od(t,e,n){let i=t.upload,s=Es(e,t),r=Rd(n,e,t),a=i.rootFolder.length>0&&!s.includes(i.rootFolder)?`${i.rootFolder}/`:"";if(s.trim().length===0)return r;let o=Tn(a+s,t);return o.trim().length===0?r:`${o}/${r}`.replace(/^\//,"")}function rt(t,e){var s,r,a;let n=e.upload;if(t===n.folderNote.rename&&n.folderNote.enable||n.replaceTitle.length===0)return t;let i=(r=(s=t.match(/\.[0-9a-z]+$/i))==null?void 0:s.at(-1))!=null?r:"";t=t.replace(i,"");for(let o of n.replaceTitle)if(((a=o.regex)==null?void 0:a.trim().length)>0){let u=o.regex,c=o.replacement;if(u.match(/\/.+\//)){let d=xs(u);t=t.replace(d,c)}else t=t.replaceAll(u,c)}return`${t}${i}`}function Tn(t,e){let n=e.upload;if(n.behavior===q.fixed||n.replacePath.length===0)return t;for(let i of n.replacePath)if(i.regex.trim().length>0){let s=i.regex,r=i.replacement;if(s.match(/\/.+\//)){let a=s.match(/\/([gimy]+)$/),o=a?Array.from(new Set(a[1].split(""))).join(""):"",u=new RegExp(s.replace(/\/(.+)\/.*/,"$1"),o);t=t.replace(u,r)}else t=t.replaceAll(s,r)}return t}function An(t,e,n){let i=e.name;return t&&n.upload.frontmatterTitle.enable&&t[n.upload.frontmatterTitle.key]&&t[n.upload.frontmatterTitle.key]!==i?`${t[n.upload.frontmatterTitle.key]}.md`:i}function Je(t,e,n,i){var a;let{vault:s,metadataCache:r}=i;if(t.extension==="md"){let o=(a=r.getCache(t.path))==null?void 0:a.frontmatter,u=An(o,t,e),c=rt(u,e);if(!he(o,e,t,n))return(0,me.normalizePath)(u);if(o==null?void 0:o.path){let d=o.path instanceof Array?o.path.join("/"):o.path;return d==""||d=="/"?(0,me.normalizePath)(c):(0,me.normalizePath)(`${d}/${c}`)}else return e.upload.behavior===q.yaml?(0,me.normalizePath)(Od(e,o,u)):e.upload.behavior===q.obsidian?(0,me.normalizePath)(Pd(t,e,s,u)):e.upload.defaultName.length>0?(0,me.normalizePath)(`${e.upload.defaultName}/${c}`):(0,me.normalizePath)(c)}return t.path}function Zt(t,e,n){let i=Nd(t,e,n);return i=Tn(i,e),rt(i,e)}function Nd(t,e,n){if(!n||!n.attachmentLinks){if(e.embed.useObsidianFolder)return e.upload.behavior===q.yaml?e.upload.rootFolder.length>0?(0,me.normalizePath)(`${e.upload.rootFolder}/${t.path}`):t.path:e.upload.defaultName.length>0?(0,me.normalizePath)(`${e.upload.defaultName}/${t.path}`):t.path;let i=e.embed.folder,s=e.embed.overrideAttachments.filter(r=>{let a=r.path.match(ht),o=a?new RegExp(a[1],a[2]):void 0;return((o==null?void 0:o.test(t.path))||t.path===r.path||r.path.contains("{{all}}"))&&!r.destination.contains("{{default}}")});if(s.length>0){let r=t.path;for(let a of s){let o=a.path.match(ht),u=o?new RegExp(o[1],o[2]):null,c=a.destination.replace("{{name}}",t.name);r=u?(0,me.normalizePath)(r.replace(u,c)):(0,me.normalizePath)(r.replace(a.path,c))}return R({settings:e},`Overridden path for ${t.name} : ${r}`),r}else return i.length>0?(0,me.normalizePath)(`${i}/${t.name}`):e.upload.defaultName.length>0?(0,me.normalizePath)(`${e.upload.defaultName}/${t.name}`):t.path}else if(n==null?void 0:n.attachmentLinks)return(0,me.normalizePath)(`${n.attachmentLinks}/${t.name}`);return t.path}var ks='',wi='',Pn='',Ss='',xt='';function _(t,...e){var o;let{settings:n,e:i}=t;if((o=n.plugin)==null?void 0:o.noticeError){new $e.Notice(e.join(" "));return}let s=to();s.contains("logs")&&(s=to(!0));let r=new Date().toISOString().slice(11,23),a=t.logs?`DEV LOGS [${r}] ${s}: -`:`[GitHub Publisher](${s}): -`;i?console.error(a,...e):console.log(a,...e)}function Rn(t,e,n){if(!$e.Platform.isMobile)return;let i=document.createDocumentFragment();return i.createEl("span",{text:n,cls:["obsidian-publisher",t,"icons"]}).innerHTML=e,i.createEl("span",{cls:["obsidian-publisher",t,"notification"]}).innerHTML=n,new $e.Notice(i,0)}function to(t){var i;let e=t?4:3,n=(i=new Error().stack)==null?void 0:i.split(` -`)[e].trim();return n=n==null?void 0:n.substring(n.indexOf("at ")+3,n.lastIndexOf(" (")),n=n==null?void 0:n.replace("Object.callback",""),n=n||"main",n=n==="eval"?"main":n,n}function R(t,...e){var i;let n=t.settings;t.logs=!0,((i=n.plugin)==null?void 0:i.dev)&&_(t,...e)}function Ts(t,e,n){let i={added:[],edited:[],deleted:[],unpublished:[],notDeleted:[]};return t.forEach(s=>{s.isUpdated?i.edited.push(s.file):i.added.push(s.file)}),i.unpublished=n,e&&(i.deleted=e.deleted,i.notDeleted=e.undeleted),i}function As(t,e){return m(this,null,function*(){if($e.Platform.isMobile||!t.plugins.enabledPlugins.has("metadata-extractor")||e.upload.metadataExtractorPath.length===0)return null;let n={allExceptMdFile:null,metadataFile:null,tagsFile:null},i=`${t.vault.configDir}/plugins/metadata-extractor`,s=t.plugins.plugins["metadata-extractor"];return s&&s.settings?(s.settings.allExceptMdFile.length>0&&(n.allExceptMdFile=i+"/"+s.settings.allExceptMdFile),s.settings.metadataFile.length>0&&(n.metadataFile=i+"/"+s.settings.metadataFile),s.settings.tagFile.length>0&&(n.tagsFile=i+"/"+s.settings.tagFile),n):null})}function Ps(t){let e=t.match(/\/*$/);return e&&e[0].length!=1?t.replace(/\/*$/,"")+"/":t}function Yt(t,e,n,i){return m(this,null,function*(){var F;let s=e.repo,r=e.frontmatter,a=s?s.copyLink:n.plugin.copyLink,o=s||n.github;if(!n.plugin.copyLink.enable)return;let u=Je(t,n,s,i),c=a.links;c.length===0&&(c=r instanceof Array?`https://${o.user}.github.io/${n.github.repo}/`:`https://${r.owner}.github.io/${r.repo}/`);let d=i.metadataCache.getFileCache(t).frontmatter,f=a.removePart;if(d&&(d.baselink!==void 0?(c=d.baselink,f=[]):d.copylink&&typeof d.copylink=="object"&&(c=d.copylink.base,f=(F=d.copylink.remove)!=null?F:[])),c=Ps(c),f.length>0)for(let w of f)w.length>0&&(u=u.replace(w.trim(),""));u=Ps(u);let p=Ps(encodeURI(c+u));yield navigator.clipboard.writeText(p)})}function Rs(t,e,n,i){return m(this,null,function*(){i=Array.isArray(i)?i:[i];for(let s of i)yield Bd(t,e,n,s)})}function Bd(t,e,n,i){return m(this,null,function*(){let s=e instanceof $e.TFile?`"${e.basename}"`:e,r=document.createDocumentFragment(),a;if(e instanceof String?a=l.t("informations.successfulPublish",{nbNotes:s,repo:i}):(R({settings:n},"file published :",s),a=l.t("informations.successPublishOneNote",{file:s,repo:i})),r.createEl("span",{text:a,cls:["obsidian-publisher","success","icons"]}).innerHTML=wi,r.createEl("span",{cls:["obsidian-publisher","success","notification"]}).innerHTML=a,n.github.workflow.name.length>0){let o=document.createDocumentFragment();o.createEl("span",{text:l.t("informations.successfulPublish",{nbNotes:s,repo:i}),cls:["obsidian-publisher","wait","icons"]}).innerHTML=Pn;let u=`${l.t("informations.sendMessage",{nbNotes:s,repo:i})}.
${l.t("informations.waitingWorkflow")}`;o.createEl("span",{cls:["obsidian-publisher","wait","notification"]}).innerHTML=u,new $e.Notice(o),(yield t.workflowGestion(i))&&new $e.Notice(r,0)}else new $e.Notice(r,0)})}function no(t){let e=JSON.stringify(t,(n,i)=>typeof i=="string"?i.trim().toLowerCase():i);return JSON.parse(e)}function Jt(t,e){let n=t.app.vault;return e||(e=dt),e=e.replace("%configDir%",n.configDir),e=e.replace("%pluginID%",t.manifest.id),e}var fe=W(require("obsidian"));var io="3.7.5",Ld=io,Md=typeof atob=="function",Id=typeof btoa=="function",Qt=typeof Buffer=="function",so=typeof TextDecoder=="function"?new TextDecoder:void 0,ro=typeof TextEncoder=="function"?new TextEncoder:void 0,$d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",On=Array.prototype.slice.call($d),Ei=(t=>{let e={};return t.forEach((n,i)=>e[n]=i),e})(On),Vd=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ge=String.fromCharCode.bind(String),ao=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),oo=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),uo=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),lo=t=>{let e,n,i,s,r="",a=t.length%3;for(let o=0;o255||(i=t.charCodeAt(o++))>255||(s=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|i<<8|s,r+=On[e>>18&63]+On[e>>12&63]+On[e>>6&63]+On[e&63]}return a?r.slice(0,a-3)+"===".substring(a):r},Os=Id?t=>btoa(t):Qt?t=>Buffer.from(t,"binary").toString("base64"):lo,Ns=Qt?t=>Buffer.from(t).toString("base64"):t=>{let e=4096,n=[];for(let i=0,s=t.length;ie?oo(Ns(t)):Ns(t),Gd=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?ge(192|e>>>6)+ge(128|e&63):ge(224|e>>>12&15)+ge(128|e>>>6&63)+ge(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return ge(240|e>>>18&7)+ge(128|e>>>12&63)+ge(128|e>>>6&63)+ge(128|e&63)}},jd=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,co=t=>t.replace(jd,Gd),ho=Qt?t=>Buffer.from(t,"utf8").toString("base64"):ro?t=>Ns(ro.encode(t)):t=>Os(co(t)),Xt=(t,e=!1)=>e?oo(ho(t)):ho(t),fo=t=>Xt(t,!0),Hd=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Ud=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return ge((n>>>10)+55296)+ge((n&1023)+56320);case 3:return ge((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return ge((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},po=t=>t.replace(Hd,Ud),mo=t=>{if(t=t.replace(/\s+/g,""),!Vd.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n="",i,s;for(let r=0;r>16&255):s===64?ge(e>>16&255,e>>8&255):ge(e>>16&255,e>>8&255,e&255);return n},Bs=Md?t=>atob(uo(t)):Qt?t=>Buffer.from(t,"base64").toString("binary"):mo,go=Qt?t=>ao(Buffer.from(t,"base64")):t=>ao(Bs(t).split("").map(e=>e.charCodeAt(0))),Do=t=>go(bo(t)),_d=Qt?t=>Buffer.from(t,"base64").toString("utf8"):so?t=>so.decode(go(t)):t=>po(Bs(t)),bo=t=>uo(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),Ls=t=>_d(bo(t)),qd=t=>{if(typeof t!="string")return!1;let e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},yo=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),Fo=function(){let t=(e,n)=>Object.defineProperty(String.prototype,e,yo(n));t("fromBase64",function(){return Ls(this)}),t("toBase64",function(e){return Xt(this,e)}),t("toBase64URI",function(){return Xt(this,!0)}),t("toBase64URL",function(){return Xt(this,!0)}),t("toUint8Array",function(){return Do(this)})},wo=function(){let t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,yo(n));t("toBase64",function(e){return Ci(this,e)}),t("toBase64URI",function(){return Ci(this,!0)}),t("toBase64URL",function(){return Ci(this,!0)})},Wd=()=>{Fo(),wo()},vi={version:io,VERSION:Ld,atob:Bs,atobPolyfill:mo,btoa:Os,btoaPolyfill:lo,fromBase64:Ls,toBase64:Xt,encode:Xt,encodeURI:fo,encodeURL:fo,utob:co,btou:po,decode:Ls,isValid:qd,fromUint8Array:Ci,toUint8Array:Do,extendString:Fo,extendUint8Array:wo,extendBuiltins:Wd};var Nn=W(require("obsidian"));function Bn(t=!1,e,n,i){return m(this,null,function*(){let s=Array.isArray(i.frontmatter)?i.frontmatter:[i.frontmatter],r=[];for(let a of s){let o={frontmatter:a,repo:i.repo};r.push(yield Kd(t,e,n,o))}return r[0]})}function Kd(t=!1,e,n,i){return m(this,null,function*(){let s=i.frontmatter;if(!s.autoclean)return{success:!1,deleted:[],undeleted:[]};let r=yield n.getAllFileFromRepo(e,s),a=n.settings,o=n.octokit,u=yield Zd(r,a);if((a.github.rateLimit===0||u.length>a.github.rateLimit)&&(yield Ye(o,a,!1,u.length))===0)return{success:!1,deleted:[],undeleted:[]};if(!u){let E="";return a.upload.defaultName.length>0&&(a.upload.defaultName.length>0?E=l.t("deletion.defaultFolder"):a.upload.behavior===q.yaml&&a.upload.rootFolder.length===0&&(E=l.t("deletion.rootFolder"))),t||new Nn.Notice("Error : "+E),{success:!1,deleted:[],undeleted:[]}}let d=n.getAllFileWithPath(i.repo).map(E=>({converted:E.converted,repo:E.repoFrontmatter})),f=0,p=0,F={deleted:[],undeleted:[],success:!1};for(let E of u){let V=d.some(b=>b.converted===E.file),L=E.file.trim().endsWith(".md")?!d.some(b=>b.converted===E.file&&JSON.stringify(b.repo)==JSON.stringify(s)):!1;if(V?L:!0){let b=E.file.contains(a.upload.folderNote.rename)?yield Jd(o,a,E.file,s):!1;try{b||(_({settings:a},`trying to delete file : ${E.file} from ${s.owner}/${s.repo}`),(yield o.request("DELETE /repos/{owner}/{repo}/contents/{path}",{owner:s.owner,repo:s.repo,path:E.file,message:`DELETE FILE : ${E.file}`,sha:E.sha,branch:e})).status===200?(f++,F.deleted.push(E.file)):(p++,F.undeleted.push(E.file)))}catch(v){v instanceof DOMException||R({settings:a,e:!0},v)}}}let w=l.t("deletion.noFile"),k="";return f>0&&(w=l.t("deletion.success",{nb:f.toString()})),p>0&&(k=l.t("deletion.failed",{nb:p.toString()})),t||new Nn.Notice(w+k),F.success=p===0,F})}function zd(t,e){let n=e.upload.autoclean.excluded;if(n.length>0)for(let i of n){let s=i.match(ht),r=s?new RegExp(s[1],s[2]):null;if(r&&r.test(t))return!0;if(t.trim().includes(i.trim())&&i.length>0)return!0}return!1}function Zd(t,e){return m(this,null,function*(){let n=[];for(let i of t){let s=e.upload.behavior,r=e.upload.rootFolder,a=e.upload.defaultName,o=e.embed.folder;if(s===q.yaml&&r.length===0||a.length===0||s===q.fixed)return[];(i.file.includes(a)||s===q.yaml&&i.file.includes(r)||o.length>0&&i.file.includes(o))&&!zd(i.file,e)&&(we(i.file)||i.file.match("md$"))&&n.push(i)}return n})}function Yd(t){let e=t.split("---")[1],n=(0,Nn.parseYaml)(e);return no(n)}function Jd(t,e,n,i){return m(this,null,function*(){try{let s=yield t.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:i.owner,repo:i.repo,path:n});if(s.status===200){let r=vi.decode(s.data.content),a=Yd(r);return a.index==="true"||a.delete==="false"||!a.share}}catch(s){if(!(s instanceof DOMException))return _({settings:e,e:!0},s),!1}return!1})}var Eo=W(require("obsidian")),Ln=class extends Eo.Modal{constructor(e,n){super(e);this.listChanged=n}displayListOfFile(e,n){if(!e.length)return;let i=n.createEl("ul");e.forEach(s=>{var u;let r="\u2753",a=(u=s.split(".").pop())!=null?u:"";["md"].includes(a)?r="\u{1F5D2}\uFE0F":[".png",".jpg",".jpeg",".gif",".svg",".webp"].includes(`.${a}`)?r="\u{1F5BC}\uFE0F":[".mp3",".wav",".ogg",".flac",".aac"].includes(`.${a}`)?r="\u{1F3B5}":[".mp4",".avi",".mov",".mkv",".webm"].includes(`.${a}`)?r="\u{1F3A5}":[".pdf"].includes(`.${a}`)&&(r="\u{1F4C4}");let o=i.createEl("li");o.createEl("span",{text:r,cls:"emoji"}),o.createEl("code",{text:s,cls:"code-title"})})}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","list-changed"]),e.createEl("h2",{text:l.t("modals.listChangedFiles.title"),cls:"success"}),Object.keys(this.listChanged).contains("edited")?(this.listChanged=this.listChanged,e.createEl("h3",{text:`\u{1F4E4} ${l.t("modals.listChangedFiles.added")}`}),this.displayListOfFile(this.listChanged.added,e),e.createEl("h3",{text:`\u2712\uFE0F ${l.t("modals.listChangedFiles.edited")}`}),this.displayListOfFile(this.listChanged.edited,e),e.createEl("h3",{text:`\u{1F5D1}\uFE0F ${l.t("modals.listChangedFiles.deleted")}`}),this.displayListOfFile(this.listChanged.deleted,e),e.createEl("h2",{text:`\u274C ${l.t("modals.listChangedFiles.error")}`,cls:"error"}),e.createEl("h3",{text:`\u{1F4E4} ${l.t("modals.listChangedFiles.unpublished")}`}),this.displayListOfFile(this.listChanged.unpublished,e),e.createEl("h3",{text:`\u267B\uFE0F ${l.t("modals.listChangedFiles.notDeleted")}`}),this.displayListOfFile(this.listChanged.notDeleted,e)):(this.listChanged=this.listChanged,e.createEl("h3",{text:`\u{1F5D1}\uFE0F ${l.t("modals.listChangedFiles.deleted")}`}),this.displayListOfFile(this.listChanged.deleted,e),e.createEl("h3",{text:`\u274C ${l.t("modals.listChangedFiles.error")}`,cls:"error"}),e.createEl("h3",{text:`\u267B\uFE0F ${l.t("modals.listChangedFiles.notDeleted")}`}),this.displayListOfFile(this.listChanged.undeleted,e))}onClose(){let{contentEl:e}=this;e.empty()}};var Mn=class{constructor(e,n,i=!1){this.attachment=!1;this.statusBarItem=e,this.counter=0,this.numberOfNotesToPublish=n,this.attachment=i;let s=this.attachment?l.t("common.attachments"):l.t("common.files"),r=l.t("statusBar.markedForSharing",{nb:this.numberOfNotesToPublish,type:s});this.icon=this.statusBarItem.createEl("span",{cls:["obsidian-publisher","icons"]}),this.statusBarItem.addClass("found-attachments"),this.icon.innerHTML=Ss,this.status=this.statusBarItem.createEl("span",{text:`${r}`}),this.status.addClass("found-attachments"),this.noticeMobile=Rn("wait",Ss,r)}increment(){var i;let e=this.attachment?l.t("common.attachments"):l.t("common.files"),n=l.t("statusBar.sharing",{type:e.toLowerCase()});this.icon.innerHTML=Pn,this.status.setText(l.t("statusBar.counter",{msg:n,counter:++this.counter,nb:this.numberOfNotesToPublish})),this.statusBarItem.addClass("sharing"),this.statusBarItem.removeClass("found-attachments"),((i=this.noticeMobile)==null?void 0:i.noticeEl.children[0].classList.contains("load"))||(setTimeout(()=>{var s;(s=this.noticeMobile)==null||s.hide()},4e3),this.noticeMobile=Rn("load",Pn,n))}finish(e){var i;let n=this.attachment?l.t("statusBar.success",{action:l.t("common.shared"),type:l.t("common.attachments")}):l.t("statusBar.success",{action:l.t("common.published"),type:l.t("common.files")});this.icon.innerHTML=wi,this.status.setText(l.t("statusBar.counter",{msg:n,counter:this.counter,nb:this.numberOfNotesToPublish})),this.statusBarItem.addClass("success"),this.statusBarItem.removeClass("sharing"),(i=this.noticeMobile)==null||i.hide(),setTimeout(()=>{this.statusBarItem.remove()},e),setTimeout(()=>{var s;(s=this.noticeMobile)==null||s.hide()},e-4e3)}error(){var e;this.statusBarItem.addClass("error"),this.statusBarItem.removeClass("sharing"),this.statusBarItem.removeClass("found-attachments"),this.icon.innerHTML=xt,this.status.innerHTML=l.t("error.errorPublish"),(e=this.noticeMobile)==null||e.hide(),setTimeout(()=>{this.statusBarItem.remove()},8e3),setTimeout(()=>{var n;(n=this.noticeMobile)==null||n.hide()},4e3)}};function kt(t,e,n,i,s,r=!0){return m(this,null,function*(){let a=new Mn(e,s.length),o=i.frontmatter;try{let u=0,c=[],d=[];if(s.length>0){let f=s.map(E=>E.name);if(r){if(!vt(t,o,s.length))return!1;yield t.newBranch(o)}for(let E of s)try{a.increment();let V=yield t.publish(E,!1,i);V&&d.push(...V.uploaded)}catch(V){u++,c.push(E.name),new fe.Notice(l.t("error.unablePublishNote",{file:E.name})),R({settings:t.settings,e:!0},V)}a.finish(8e3);let p=`${f.length-u} notes`,F=yield Bn(!0,n,t,i),w=t.settings;if(w.upload.metadataExtractorPath.length>0&&fe.Platform.isDesktop){let E=yield As(t.plugin.app,w);E&&(yield t.uploadMetadataExtractorFiles(E,o))}if(yield t.updateRepository(o)){if(yield Rs(t,p,w,o),w.plugin.displayModalRepoEditing){let E=Ts(d,F,c);new Ln(t.plugin.app,E).open()}}else{let E=document.createDocumentFragment();E.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=xt,E.createSpan({cls:["error","obsidian-publisher","notification"]}).innerHTML=l.t("error.errorPublish",{repo:o}),new fe.Notice(E)}}}catch(u){R({settings:t.settings,e:!0},u);let c=document.createDocumentFragment();c.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=xt,c.createSpan({cls:["error","obsidian-publisher","notification"],text:l.t("error.unablePublishMultiNotes")}),a.error()}})}function xi(t,e,n){return m(this,null,function*(){try{if(new fe.Notice(l.t("informations.startingClean",{repo:n.frontmatter})),!vt(t,n.frontmatter))return!1;yield t.newBranch(n.frontmatter);let s=yield Bn(!1,e,t,n);yield t.updateRepository(n.frontmatter),t.settings.plugin.displayModalRepoEditing&&new Ln(t.plugin.app,s).open()}catch(i){_({settings:t.settings,e:!0},i)}})}function Qe(t,e,n,i=null,s){return m(this,null,function*(){var u,c;let r=e.settings,a=e.plugin.app,o=a.metadataCache;try{let d=(u=o.getFileCache(n))==null?void 0:u.frontmatter,f=J(r,i,d),p=yield vt(e,f),F={frontmatter:f,repo:i};if(!p)return!1;yield e.newBranch(f);let w=yield e.publish(n,!0,F,[],!0);if(w){if(r.upload.metadataExtractorPath.length>0&&fe.Platform.isDesktop){let E=yield As(a,r);E&&(yield e.uploadMetadataExtractorFiles(E,f))}if(yield e.updateRepository(f)){if(yield Rs(e,s,r,f),yield Yt(n,F,r,a),r.plugin.displayModalRepoEditing){let E=Ts(w.uploaded,w.deleted,w.error);new Ln(a,E).open()}}else{let E=document.createDocumentFragment();E.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=xt,E.createSpan({cls:["error","obsidian-publisher","notification"]}).innerHTML=l.t("error.errorPublish",{repo:f}),new fe.Notice(E)}}}catch(d){if(!(d instanceof DOMException)){R({settings:r,e:!0},d);let f=document.createDocumentFragment();f.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=xt,f.createSpan({cls:["error","obsidian-publisher","notification"]}).innerHTML=l.t("error.errorPublish",{repo:J(r,i,(c=o.getFileCache(n))==null?void 0:c.frontmatter)}),new fe.Notice(f)}}})}function Co(t,e,n){return m(this,null,function*(){let i=t.plugin;new fe.Notice(l.t("informations.scanningRepo"));let s=t.getAllFileWithPath(n.repo),r=yield t.getAllFileFromRepo(n.frontmatter.branch,n.frontmatter),a=t.getNewFiles(s,r);if(a.length>0){new fe.Notice(l.t("informations.foundNoteToSend",{nbNotes:a.length}));let o=i.addStatusBarItem();if(!vt(t,n.frontmatter,a.length))return!1;yield t.newBranch(n.frontmatter),yield kt(t,o,e,n,a,!1);return}new fe.Notice(l.t("informations.noNewNote"))})}function vo(t,e,n){return m(this,null,function*(){let i=t.plugin;new fe.Notice(l.t("informations.scanningRepo"));let s=t.getAllFileWithPath(n.repo),r=yield t.getAllFileFromRepo(n.frontmatter.branch,n.frontmatter),a=t.getNewFiles(s,r),o=yield t.getEditedFiles(s,r,a);if(o.length>0){new fe.Notice(l.t("informations.foundNoteToSend",{nbNotes:o.length}));let u=i.addStatusBarItem();if(!vt(t,n.frontmatter,o.length))return!1;yield t.newBranch(n.frontmatter),yield kt(t,u,e,n,o,!1);return}new fe.Notice(l.t("informations.noNewNote"))})}function xo(t,e,n){return m(this,null,function*(){let i=n.repo,s=n.frontmatter;new fe.Notice(l.t("informations.scanningRepo"));let r=t.getAllFileWithPath(i),a=yield t.getAllFileFromRepo(s.branch,s),o=[],u=yield t.getEditedFiles(r,a,o);if(u.length>0){new fe.Notice(l.t("informations.foundNoteToSend",{nbNotes:u.length}));let c=t.plugin.addStatusBarItem();if(!vt(t,s,u.length))return!1;yield t.newBranch(s),yield kt(t,c,e,n,u,!1);return}new fe.Notice(l.t("informations.noNewNote"))})}var In=W(require("obsidian"));function ko(t,e){return m(this,null,function*(){var s;let n=e.app.workspace.getActiveFile(),i=n?(s=e.app.metadataCache.getFileCache(n))==null?void 0:s.frontmatter:null;if(n&&i&&he(i,e.settings,n,t)){let r={frontmatter:J(e.settings,t,i),repo:t};yield Yt(n,r,e.settings,e.app),new In.Notice(l.t("commands.copyLink.onActivation"));return}new In.Notice(l.t("commands.runOtherRepo.noFile"))})}function So(t,e,n){return m(this,null,function*(){var r;let i=t.app.workspace.getActiveFile(),s=i?(r=t.app.metadataCache.getFileCache(i))==null?void 0:r.frontmatter:null;i&&s&&he(s,t.settings,i,e)?yield Qe(n,yield t.reloadOctokit(),i,e):new In.Notice(l.t("commands.runOtherRepo.noFile"))})}function To(t,e,n){return m(this,null,function*(){let i=J(t.settings,e),s=yield t.reloadOctokit();yield xi(s,n,{frontmatter:i,repo:e})})}function ki(t,e,n){return m(this,null,function*(){let i=t.addStatusBarItem(),s=yield t.reloadOctokit(),r=s.getSharedFiles(e),a={frontmatter:J(t.settings,e),repo:e};yield kt(s,i,n,a,r,!0)})}function Si(t,e,n){return m(this,null,function*(){let i=yield t.reloadOctokit();yield Co(i,e,{frontmatter:J(t.settings,n),repo:n})})}function Ao(t,e,n){return m(this,null,function*(){let i=t.app.workspace.getActiveFile();i?yield Ze(yield t.reloadOctokit(),n,i):new In.Notice("No file is active")})}function Ti(t,e,n=null){return m(this,null,function*(){let i=yield t.reloadOctokit();yield vo(i,e,{frontmatter:J(t.settings,n),repo:n})})}function Ai(t,e,n){return m(this,null,function*(){let i=yield n.reloadOctokit();yield xo(i,t,{frontmatter:J(n.settings,e),repo:e})})}function Ro(t,e){return m(this,null,function*(){let n=t?`publisher-copy-link-K${t.smartKey}`:"publisher-copy-link",i=l.t("common.repository"),s=l.t("commands.copyLink.title");return s=t?`${s} (${i} : ${t.smartKey})`:s,{id:n,name:s,hotkeys:[],checkCallback:r=>{var u;let a=e.app.workspace.getActiveFile(),o=a?(u=e.app.metadataCache.getFileCache(a))==null?void 0:u.frontmatter:null;if(a&&o&&he(o,e.settings,a,t)){if(!r){let c={frontmatter:J(e.settings,t,o),repo:t};Yt(a,c,e.settings,e.app),new Po.Notice(l.t("commands.copyLink.onActivation"))}return!0}return!1}}})}function Oo(t,e,n){return m(this,null,function*(){let i=e?`publisher-delete-clean-K${e.smartKey}`:"publisher-delete-clean",s=l.t("commands.publisherDeleteClean"),r=l.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,hotkeys:[],callback:()=>m(this,null,function*(){R({settings:t.settings},"Enabling purge command");let a={frontmatter:J(t.settings,e),repo:e},o=yield t.reloadOctokit();yield xi(o,n,a)})}})}function No(t,e,n){return m(this,null,function*(){let i=t?`publisher-one-K${t.smartKey}`:"publisher-one",s=l.t("commands.shareActiveFile"),r=l.t("common.repository");return s=t?`${s} (${r} : ${t.smartKey})`:s,{id:i,name:s,hotkeys:[],checkCallback:a=>m(this,null,function*(){var c;let o=e.app.workspace.getActiveFile(),u=o?(c=e.app.metadataCache.getFileCache(o))==null?void 0:c.frontmatter:null;return o&&u&&he(u,e.settings,o,t)?(a||Qe(n,yield e.reloadOctokit(),o,t,o.basename),!0):!1})}})}function Bo(t,e,n){return m(this,null,function*(){let i=e?`publisher-publish-all-K${e.smartKey}`:"publisher-publish-all",s=l.t("commands.uploadAllNotes"),r=l.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield ki(t,e,n)})}})}function Lo(t,e,n){return m(this,null,function*(){let i=e?`publisher-upload-new-K${e.smartKey}`:"publisher-upload-new",s=l.t("commands.uploadNewNotes"),r=l.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield Si(t,n,e)})}})}function Mo(t,e,n){return m(this,null,function*(){let i=e?`publisher-upload-all-edited-new-K${e.smartKey}`:"publisher-upload-all-edited-new",s=l.t("commands.uploadAllNewEditedNote"),r=l.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield Ti(t,n,e)})}})}function Io(t,e,n){return m(this,null,function*(){let i=t?`publisher-upload-edited-K${t.smartKey}`:"publisher-upload-edited",s=l.t("commands.uploadAllEditedNote"),r=l.t("common.repository");return s=t?`${s} (${r} : ${t.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield Ai(e,t,n)})}})}function $o(t,e){return m(this,null,function*(){let n=e?`check-plugin-repo-validy-K${e.smartKey}`:"check-plugin-repo-validy",i=l.t("commands.checkValidity.title"),s=l.t("common.repository");return i=e?`${i} (${s} : ${e.smartKey})`:i,{id:n,name:i,checkCallback:r=>m(this,null,function*(){return t.app.workspace.getActiveFile()?(r||(yield Ze(yield t.reloadOctokit(),e,t.app.workspace.getActiveFile())),!0):!1})}})}var St=W(require("obsidian"));var Pi=W(require("obsidian"));var Ms=class extends Pi.FuzzySuggestModal{constructor(e,n,i){super(e);this.plugin=n,this.branchName=i}getItems(){return this.plugin.settings.github.otherRepo}getItemText(e){return e.smartKey}onChooseItem(e,n){new Vo(this.plugin.app,this.plugin,this.branchName,e).open()}},Ri=class extends Pi.FuzzySuggestModal{constructor(e,n,i=null,s,r,a,o){super(e);this.plugin=n,this.branchName=s,this.keyToFind=i,this.onSubmit=o,this.fileName=a,this.type=r}getItems(){var i,s,r;let e=[],n=ft(this.plugin.settings);return this.type==="file"&&(((i=this.plugin.settings.plugin.shareAll)==null?void 0:i.enable)&&!((r=this.fileName)==null?void 0:r.startsWith((s=this.plugin.settings.plugin.shareAll)==null?void 0:s.excludedFileName))&&e.push(n),this.keyToFind&&(e=e.concat(this.plugin.settings.github.otherRepo.filter(a=>a.shareKey==this.keyToFind)),this.keyToFind===n.shareKey&&e.push(n))),e=e.concat(this.plugin.settings.github.otherRepo.filter(a=>{var o,u,c;return((o=a.shareAll)==null?void 0:o.enable)&&!((c=this.fileName)==null?void 0:c.startsWith((u=a.shareAll)==null?void 0:u.excludedFileName))})),e.push(n),e=[...new Set(e)],e.length===0?this.plugin.settings.github.otherRepo:e}getItemText(e){return e.smartKey}onChooseItem(e,n){this.onSubmit(e)}},Vo=class extends Pi.FuzzySuggestModal{constructor(e,n,i,s){super(e);this.plugin=n,this.branchName=i,this.repo=s}getItems(){let e=[{commands:"shareAllMarkedNotes",name:l.t("commands.uploadAllNotes")},{commands:"shareOneNote",name:l.t("commands.shareActiveFile")},{commands:"shareNewNote",name:l.t("commands.uploadNewNotes")},{commands:"shareAllEditedNotes",name:l.t("commands.uploadAllNewEditedNote")},{commands:"shareOnlyEdited",name:l.t("commands.uploadAllEditedNote")},{commands:"checkRepositoryValidity",name:l.t("commands.checkValidity.title")}];return this.plugin.settings.plugin.copyLink&&e.push({commands:"createLink",name:l.t("commands.copyLink.title")}),this.plugin.settings.upload.autoclean.enable&&this.plugin.settings.upload.behavior!==q.fixed&&e.push({commands:"deleteUnsharedDeletedNotes",name:l.t("commands.publisherDeleteClean")}),e}getItemText(e){return e.name}onChooseItem(e,n){switch(e.commands){case"shareAllMarkedNotes":ki(this.plugin,this.repo,this.branchName);break;case"deleteUnsharedDeletedNotes":To(this.plugin,this.repo,this.branchName);break;case"shareNewNote":Si(this.plugin,this.branchName,this.repo);break;case"shareAllEditedNotes":Ti(this.plugin,this.branchName,this.repo);break;case"shareOnlyEdited":Ai(this.branchName,this.repo,this.plugin);break;case"shareOneNote":So(this.plugin,this.repo,this.branchName);break;case"createLink":ko(this.repo,this.plugin);break;case"checkRepositoryValidity":Ao(this.plugin,this.branchName,this.repo);break}R({settings:this.plugin.settings},`run command ${e.commands}`)}};function Oi(t,e,n,i){return m(this,null,function*(){let s=yield t.reloadOctokit(),r=t.addStatusBarItem(),a={frontmatter:J(t.settings,i,void 0),repo:i};yield kt(s,r,n,a,s.getSharedFileOfFolder(e,i),!0)})}function Qd(t,e,n,i,s){let r=St.Platform.isDesktop?e.setSubmenu():s;r.addItem(o=>{o.setTitle(l.t("commands.shareViewFiles.multiple.on",{smartKey:l.t("common.default").toUpperCase(),doc:n.name})).setIcon("folder-up").onClick(()=>m(this,null,function*(){let u=pi(t.settings,void 0);yield Oi(t,n,i,u)}))});let a=t.settings.github.otherRepo.filter(o=>o.createShortcuts);return a.length>0&&a.forEach(o=>{r.addItem(u=>{u.setTitle(l.t("commands.shareViewFiles.multiple.on",{smartKey:o.smartKey.toUpperCase(),doc:n.name})).setIcon("folder-up").onClick(()=>m(this,null,function*(){yield Oi(t,n,i,o)}))})}),r.addItem(o=>{o.setTitle(l.t("commands.shareViewFiles.multiple.other")).setIcon("folder-symlink").onClick(()=>m(this,null,function*(){new Ri(t.app,t,null,i,"folder",null,u=>m(this,null,function*(){yield Oi(t,n,i,u)})).open()}))}),r}function Is(t,e,n,i){let s=e instanceof St.TFile?t.app.metadataCache.getFileCache(e).frontmatter:void 0,r=pi(t.settings,s),a=Wa(s,t.settings);if(he(s,t.settings,e,r)&&t.settings.plugin.fileMenu){let o=J(t.settings,r,s);i.addItem(u=>{var d,f;if(a.length>1||o instanceof Array&&o.length>1){St.Platform.isDesktop?u.setTitle("Github Publisher").setIcon("upload-cloud"):(i.addSeparator(),u.setIsLabel(!0)),Xd(t,u,e,n,r,i);return}let c=t.getTitleFieldForCommand(e,(d=t.app.metadataCache.getFileCache(e))==null?void 0:d.frontmatter).replace(".md","");if(!s||!s[t.settings.plugin.shareKey]){let p=t.settings.github.otherRepo.find(F=>{var w;return(w=F.shareAll)==null?void 0:w.enable});p?r=p:((f=t.settings.plugin.shareAll)==null?void 0:f.enable)&&(r=ft(t.settings))}else s[t.settings.plugin.shareKey]&&(r=ft(t.settings));u.setTitle(l.t("commands.shareViewFiles.multiple.on",{doc:c,smartKey:(r==null?void 0:r.smartKey.toUpperCase())||l.t("common.default").toUpperCase()})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(n,yield t.reloadOctokit(),e,r,c)}))})}}function Xd(t,e,n,i,s,r){var f;let a=(f=t.app.metadataCache.getFileCache(n))==null?void 0:f.frontmatter,o=t.getTitleFieldForCommand(n,a).replace(".md",""),u=St.Platform.isDesktop?e.setSubmenu():r,c=J(t.settings,s,a);c=c instanceof Array?c:[c],((s==null?void 0:s.shareKey)===t.settings.plugin.shareKey||(a==null?void 0:a[t.settings.plugin.shareKey]))&&(!(a==null?void 0:a.repo)||!(a==null?void 0:a.multipleRepo))&&u.addItem(p=>{p.setTitle(l.t("commands.shareViewFiles.multiple.on",{smartKey:l.t("common.default").toUpperCase(),doc:o})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,ft(t.settings),o)}))});let d=t.settings.github.otherRepo.filter(p=>p.createShortcuts);return d.length>0&&d.forEach(p=>{(p.shareKey===(s==null?void 0:s.shareKey)||(a==null?void 0:a[p.shareKey]))&&u.addItem(F=>{F.setTitle(l.t("commands.shareViewFiles.multiple.on",{smartKey:p.smartKey.toUpperCase(),doc:o})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,p,o)}))})}),c.length>1&&c.forEach(p=>{u.addItem(F=>{F.setTitle(l.t("commands.shareViewFiles.multiple.on",{smartKey:p.repo.toUpperCase(),doc:o})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,s,o)}))})}),u.addItem(p=>{p.setTitle(l.t("commands.shareViewFiles.multiple.other")).setIcon("file-input").onClick(()=>m(this,null,function*(){new Ri(t.app,t,s==null?void 0:s.shareKey,i,"file",n.basename,F=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,F,o)})).open()}))}),u}function Go(t,e,n,i){return m(this,null,function*(){t.addItem(s=>{var a,o;if(((o=(a=i.settings.github)==null?void 0:a.otherRepo)==null?void 0:o.length)>0){St.Platform.isDesktop?(s.setTitle("Github Publisher"),s.setIcon("upload-cloud")):(t.addSeparator(),s.setIsLabel(!0)),Qd(i,s,e,n,t);return}s.setSection("action"),s.setTitle(l.t("commands.shareViewFiles.multiple.on",{smartKey:l.t("common.default").toUpperCase(),doc:e.name})).setIcon("folder-up").onClick(()=>m(this,null,function*(){let u=pi(i.settings,void 0);yield Oi(i,e,n,u)}))})})}var ut=W(require("obsidian"));var hn=W(require("obsidian")),Bl=W(ts());var Nt=W(require("obsidian"));var dn=W(require("obsidian"));var Ot=W(require("obsidian")),kl=W(ts());function Sl(t,e,n,i,s,r){return m(this,null,function*(){let a=t,o=/```dataview\s(.+?)```/gsm,u=(0,kl.getAPI)();if(!u)return a;let c=t.matchAll(o),d=u.settings.dataviewJsKeyword,f=new RegExp(`\`\`\`${Te(d)}\\s(.+?)\`\`\``,"gsm"),p=t.matchAll(f),F=u.settings.inlineQueryPrefix,w=new RegExp(`\`${Te(F)}(.+?)\``,"gsm"),k=t.matchAll(w),E=u.settings.inlineJsQueryPrefix,V=new RegExp(`\`${Te(E)}(.+?)\``,"gsm"),L=t.matchAll(V);if(!c&&!k&&!p&&!L)return R({settings:r.settings},"No dataview queries found"),a;let G=l.t("error.dataview");for(let b of c)try{let v=b[0],M=b[1],{isInsideCallout:x,finalQuery:$}=ap(M),I=Yn(yield u.tryQueryMarkdown($,e),r.frontmatter.general);x&&(I=op(I)),a=a.replace(v,I)}catch(v){return R({settings:r.settings,e:!0},v),_({settings:r.settings},G),b[0]}for(let b of p)try{let v=b[0],M=b[1],x=createEl("div"),$=new Ot.Component;yield u.executeJs(M,x,$,e),$.load();let I=Yn(x.innerHTML,r.frontmatter.general);a=a.replace(v,I)}catch(v){return R({settings:r.settings,e:!0},v),_({settings:r.settings},G),b[0]}for(let b of k)try{let v=b[0],M=b[1].trim(),x=u.evaluateInline(M,e);x.successful?(x=x,a=a.replace(v,Yn(x.value,r.frontmatter.general))):a=a.replace(v,Yn(u.settings.renderNullAs,r.frontmatter.general))}catch(v){return R({settings:r.settings,e:!0},v),_({settings:r.settings},G),b[0]}for(let b of L)try{let v=b[0],x=` - const query = ${b[1].trim()}; - dv.paragraph(query); - `,$=createEl("div"),I=new Ot.Component;yield u.executeJs(x,$,I,e),I.load();let K=Yn((0,Ot.htmlToMarkdown)($.innerHTML),r.frontmatter.general);a=a.replace(v,K)}catch(v){return R({settings:r.settings,e:!0},v),_({settings:r.settings},G),b[0]}return yield sp(a,i,s,n,r)})}function Yn(t,e){let n=t==null?void 0:t.toString();return e.dataview&&t&&n?n:""}function sp(t,e,n,i,s){return m(this,null,function*(){let r=rp(t,s.settings,i.vault);return t=yield bi(t,r,n,i,e,s),Di(t,s.frontmatter.general,r,s.settings,e)})}function rp(t,e,n){if(!e.conversion.dataview)return[];let i=/\[\[(.*?)\]\]/gim,s=t.matchAll(i),r=[];if(!s)return[];if(s)for(let a of s){let o=a[1].replace(/(.*)\\?\|/i,""),u=a[1].replace(/\\?\|(.*)/,""),c=n.getAbstractFileByPath(u)instanceof Ot.TFile?n.getAbstractFileByPath(u):null;c&&r.push({linked:c,linkFrom:u,altText:o,type:"link"})}return r}function ap(t){let e=!1,n=t.split(` -`),i=[];for(let r of n)r.startsWith(">")?(e=!0,i.push(r.substring(1).trim())):i.push(r);let s=t;return e&&(s=i.join(` -`)),{isInsideCallout:e,finalQuery:s}}function op(t){let e=t.split(` -`);return" "+e.join(` -> `)}var ns=W(require("obsidian")),Tl=W(ts());function up(t,e){return e?t.trim().replace(/(\r?\n)/g,`$1${e}`):t}function lp(t){return t.replace(/^[ \t]*(?:[-*+]|[0-9]+[.)]) +/,"")}function cp(t){let e=t.match(/^([ \t]*)/);return e?t.replace(new RegExp(`^${e[0].replace(/\\/g,"\\$&")}`,"gm"),""):t}function lr(t){return t.replace(/ +\^[^ \n\r]+$/gm,"")}function dp(t){return t&&t.replace(/^---[\s\S]+?\r?\n---(?:\r?\n\s*|$)/,"")}function hp(t){return lr(dp(t))}function fp(t,e,n){if(e.type==="block"&&e.list&&n.listItems){let r=e.list,a=new Set([r.position.start.line]),o=r.position.start.offset-r.position.start.col,u=r.position.end.offset,c=!1;for(let d of n.listItems){if(r===d){c=!0;continue}else if(!c)continue;if(!a.has(d.parent))break;a.add(d.position.start.line),u=d.position.end.offset}return lr(cp(t.substring(o,u)))}let i=e.start.offset,s=e.end?e.end.offset:t.length;return lr(t.substring(i,s))}function cr(t,e,n,i,s,r){return m(this,null,function*(){var k;let{vault:a,metadataCache:o}=n,u=yield a.cachedRead(t),c=o.getFileCache(t);if(!c)return u;let d=s?(0,ns.resolveSubpath)(c,s):null;d&&(u=fp(u,d,c));let f=c.embeds;if(!f||f.length===0)return u;let p=[...f];p.sort((E,V)=>E.position.start.offset-V.position.start.offset);let F=new Set(e);F.add(t);let w=0;for(let E of p){let{path:V,subpath:L}=(0,ns.parseLinktext)(E.link),G=o.getFirstLinkpathDest(V,t.path);if(G===null||(G==null?void 0:G.extension)!=="md")continue;let b=E.position.start.offset+w,v=E.position.end.offset+w,M=v-b,x=u.substring(0,b),$=u.substring(v),I=X=>m(this,null,function*(){var de,Ce,te,ke;if((de=i.settings.embed.bake)==null?void 0:de.textAfter){let ne=yield Al((Ce=i.settings.embed.bake)==null?void 0:Ce.textAfter,i,G,t,n,r);ne=Pl(ne,G,n,i.settings);let qe=X.match(/[\s\n]/g)?"":` -`;X=`${X}${qe}${ne}`}if((te=i.settings.embed.bake)==null?void 0:te.textBefore){let ne=yield Al((ke=i.settings.embed.bake)==null?void 0:ke.textBefore,i,G,t,n,r);ne=Pl(ne,G,n,i.settings),X=`${ne} -${X}`}u=x+X+$,w+=X.length-M}),K=(k=o.getFileCache(G))==null?void 0:k.frontmatter,Ne=he(K,i.settings,G,i.repository),ce=x.match(/(?:^|\n)([ \t]*)(?:[-*+]|[0-9]+[.)]) +$/);if(F.has(G)||!Ne)continue;let Fe=hp(yield cr(G,F,n,i,L,r));yield I(ce?up(lp(Fe),ce[1]):Fe)}return u})}function Al(t,e,n,i,s,r){return m(this,null,function*(){var u;let a=(u=s.metadataCache.getFileCache(n))==null?void 0:u.frontmatter;if(!a)return t;let o=r.find(c=>c.linked===n);if(!o)return t;if(e.frontmatter.general.convertInternalLinks){let c=yield yi(i,o,a,s,e);return t.replace(/\{{2}url\}{2}/gmi,c)}return t.replace(/\{{2}url\}{2}/gmi,o.linked.path)})}function Pl(t,e,n,i){var o;let s=e.basename,r=(o=n.metadataCache.getFileCache(e))==null?void 0:o.frontmatter;if(!r)return t.replace(/\{{2}title\}{2}/gmi,s);let a=rt(An(r,e,i),i).replace(".md","");return t.replace(/\{{2}title\}{2}/gmi,a)}function Rl(t,e,n,i){return m(this,null,function*(){if(e.conversion.tags.fields.length===0||!i.plugins.enabledPlugins.has("dataview"))return t;let s=(0,Tl.getAPI)();if(!s)return t;let r=s.page(n.path);if(!r)return t;let a=[];for(let o of e.conversion.tags.fields){let u=r[o];if(u)if(u.constructor.name==="Link"){u=u;let c=Ol(u,e);c&&a.push(c)}else if(u instanceof Array)for(let c of u){let d=c;c&&c.constructor.name==="Link"?(d=Ol(c,e),d&&a.push(d)):d&&!e.conversion.tags.exclude.includes(d.toString())&&a.push(d.toString())}else e.conversion.tags.exclude.includes(u.toString())||a.push(u.toString())}return a.length>0?dr(t,a.filter(Boolean),e):t})}function Ol(t,e){let i=(r=>/([^/\\.]*)(\..*)?$/.exec(r)[1])(t.path).toString(),s=t.display?t.display.toString():i;return!e.conversion.tags.exclude.includes(s)&&!e.conversion.tags.fields.includes(i)?s:null}function pp(t,e,n){try{return t=t.replace(/^\s*\\\s*$/gim,"
"),n.hardbreak&&(t=t.replace(/\n/gm,` -`)),t}catch(i){return _({settings:e,e:!0},i),t}}function mp(t,e,n){if(n.tag)try{t=[...new Set([...t,...n.tag.map(i=>i.replaceAll("/","_"))])],delete n.tag}catch(i){_({settings:e,e:!0},i)}if(n.tags)try{n.tags=[...new Set([...n.tags.map(i=>i.replaceAll("/","_")),...t])]}catch(i){_({settings:e,e:!0},i)}else n.tags=t;return n}function dr(t,e,n,i){let s=t.split("---")[1],r=(0,dn.parseYaml)(s);e.length>0&&(r=mp(e,n,r)),i&&(r=gp(r,i.properties,i.file));let a=(0,dn.stringifyYaml)(r),o=t.split("---").slice(2).join("---");return`--- -${a}--- -${o}`}function gp(t,e,n){let i=e.settings.upload.folderNote.addTitle;return i&&!t[i.key]&&Za(e)&&i.enable&&(t[i.key]=n.basename),t}function Dp(t,e,n,i){var u;if(!t.conversion.tags.inline)return[];let s=(u=n.getFileCache(e))==null?void 0:u.tags,r=s?s.map(c=>c.tag.replace("#","").replaceAll("/","_")):[],a=(0,dn.parseFrontMatterTags)(i),o=a?a.map(c=>c.replace("#","").replaceAll("/","_")):[];return[...new Set([...r,...o])]}function bp(t,e,n,i,s,r){return m(this,null,function*(){let a=Dp(t,e,n,i);return dr(s,a,t,{properties:r,file:e})})}function Nl(t,e,n,i,s,r,a){return m(this,null,function*(){return a.frontmatter.general.removeEmbed==="bake"&&(t=yield cr(e,new Set,n,a,null,s)),t=Fi(t,a.settings,!1),t=yield bp(a.settings,e,r.app.metadataCache,i,t,a),t=yield bi(t,s,e,n,i,a),t=Di(t,a.frontmatter.general,s,a.settings,i),t=yield Sl(t,e.path,r.app,i,e,a),t=yield Rl(t,a.settings,e,r.app),t=pp(t,a.settings,a.frontmatter.general),Fi(t,a.settings,!0)})}var is=class{constructor(e,n){this.vault=n.app.vault,this.metadataCache=n.app.metadataCache,this.settings=n.settings,this.octokit=e,this.plugin=n,this.branchName=n.branchName}statusBarForEmbed(e,n,i,s){return m(this,null,function*(){let r=[],a=[];if(e.length>0){let o=this.plugin.addStatusBarItem(),u=new Mn(o,e.length,!0),c=s.frontmatter.repo,d={frontmatter:s.frontmatter.repo,repo:s.repository};try{for(let f of e)try{if(!n.includes(f)){if(f.extension==="md"&&i){let p=yield this.publish(f,!1,d,n,!0);p&&r.push(...p.uploaded)}else if(we(f.extension)&&s.frontmatter.general.attachment){let p=yield this.uploadImage(f,s);n.push(f),p&&r.push(p)}}u.increment()}catch(p){new Nt.Notice(l.t("error.unablePublishNote",{file:f.name})),a.push(f.name),R({settings:this.settings,e:!0},p)}u.finish(8e3)}catch(f){R({settings:this.settings,e:!0},f),new Nt.Notice(l.t("error.errorPublish",{repo:c})),u.error()}}return{fileHistory:n,uploaded:r,error:a}})}publish(a){return m(this,arguments,function*(e,n=!1,i,s=[],r=!1){var d;let o=new Jn(this.octokit,this.plugin),u=(d=this.metadataCache.getFileCache(e))==null?void 0:d.frontmatter,c=gi(J(this.settings,i.repo,u),this.plugin);if(!he(u,this.settings,e,i.repo)||s.includes(e)||!mi(J(this.settings,i.repo,u),i.frontmatter)||!c)return!1;try{R({settings:this.settings},`Publishing file: ${e.path}`),s.push(e);let f=fi(u,this.settings,i.repo),p=o.getSharedEmbed(e,f);p=yield o.getMetadataLinks(e,p,u,f);let F=o.getLinkedByEmbedding(e),w=yield this.vault.cachedRead(e),k={settings:this.settings,frontmatter:{general:f,repo:i.frontmatter},repository:i.repo,filepath:Je(e,this.settings,i.repo,this.plugin.app)};w=yield Nl(w,e,this.plugin.app,u,F,this.plugin,k);let E=k.filepath,V=Array.isArray(i.frontmatter)?i.frontmatter:[i.frontmatter],L="";for(let x of V)L+=`[${x.owner}/${x.repo}/${x.branch}] `;let G=`Publishing ${e.name} to ${L}`;R({settings:this.settings},G);let b=[],v=[],M=[];for(let x of V){let $={settings:this.settings,frontmatter:{general:f,repo:x},repository:k.repository,filepath:k.filepath},I=yield this.uploadOnMultipleRepo(e,w,E,p,s,r,o,n,$);b.push(I.deleted),v.push(I.uploaded),M.push(...I.error)}return{deleted:b[0],uploaded:v[0],error:M}}catch(f){return R({settings:this.settings,e:!0},f),!1}})}uploadOnMultipleRepo(e,n,i,s,r,a,o,u,c){return m(this,null,function*(){let d=this.plugin.addStatusBarItem();d.createEl("span",{cls:["obsidian-publisher","loading","icons"]}).innerHTML=ks,d.createEl("span",{text:l.t("statusBar.loading"),cls:["obsidian-publisher","loading","icons"]}),s=yield this.cleanLinkedImageIfAlreadyInRepo(s,c);let f=c.frontmatter.repo;_({settings:this.settings},`Upload ${e.name}:${i} on ${f.owner}/${f.repo}:${this.branchName}`);let p=Rn("wait",ks,l.t("statusBar.loading")),F={success:!1,deleted:[],undeleted:[]};d.remove(),p==null||p.hide();let w=yield this.uploadText(n,i,e.name,f);if(!w)return{deleted:F,uploaded:[],error:[`Error while uploading ${e.name} to ${f.owner}/${f.repo}/${f.branch}`]};R({settings:this.settings},`length: ${s.length}`,s);let k=yield this.statusBarForEmbed(s,r,a,c),E=k.uploaded;return E.push(w),u&&f.autoclean&&(F=yield Bn(!0,this.branchName,o,{frontmatter:f,repo:c.repository})),{deleted:F,uploaded:E,error:k.error}})}upload(e,n,i="",s){return m(this,null,function*(){if(!s.repo)throw new Nt.Notice("Config error : You need to define a github repo in the plugin settings"),{};if(!s.owner)throw new Nt.Notice("Config error : You need to define your github username in the plugin settings"),{};let r=this.octokit,a=`PUSH NOTE : ${i}`;we(n)&&(i=n.split("/")[n.split("/").length-1],a=`PUSH ATTACHMENT : ${i}`);let o={owner:s.owner,repo:s.repo,path:n,message:`Adding ${i}`,content:e,sha:"",branch:this.branchName},u={isUpdated:!1,file:i};try{let c=yield r.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:s.owner,repo:s.repo,path:n,ref:this.branchName});c.status===200&&c.data.type==="file"&&(o.sha=c.data.sha,u.isUpdated=!0)}catch(c){_({settings:this.settings},l.t("error.normal"))}return o.message=a,yield r.request("PUT /repos/{owner}/{repo}/contents/{path}",o),u})}uploadImage(e,n){return m(this,null,function*(){let i=yield this.vault.readBinary(e),s=(0,Nt.arrayBufferToBase64)(i),r=Zt(e,this.settings,n.frontmatter.general);return yield this.upload(s,r,"",n.frontmatter.repo)})}uploadText(e,n,i="",s){return m(this,null,function*(){try{let r=vi.encode(e).toString();return yield this.upload(r,n,i,s)}catch(r){_({settings:this.settings,e:!0},r);return}})}uploadMetadataExtractorFiles(e,n){return m(this,null,function*(){if(e){for(let i of Object.values(e))if(i){let s=yield this.vault.adapter.read(i),r=this.settings.upload.metadataExtractorPath+"/"+i.split("/").pop();n=Array.isArray(n)?n:[n];for(let a of n)yield this.uploadText(s,r,i.split("/").pop(),a)}}})}workflowGestion(e){return m(this,null,function*(){let n=!1;if(e.workflowName.length===0)return!1;let i=this.octokit;for(yield i.request("POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",{owner:e.owner,repo:e.repo,workflow_id:e.workflowName,ref:e.branch});!n;){yield sleep(1e4);let s=yield i.request("GET /repos/{owner}/{repo}/actions/runs",{owner:e.owner,repo:e.repo});if(s.data.workflow_runs.length>0){let r=s.data.workflow_runs.find(a=>a.name===e.workflowName.replace(".yml","").replace(".yaml",""));if(r&&r.status==="completed")return n=!0,!0}}return!1})}cleanLinkedImageIfAlreadyInRepo(e,n){return m(this,null,function*(){var s,r,a;let i=[];for(let o of e)if(we(o.name)){let u=Zt(o,this.settings,n.frontmatter.general),c=n.frontmatter;try{if(za(o,this.settings)){i.push(o);continue}if((yield this.octokit.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:c.repo.owner,repo:c.repo.repo,path:u,ref:this.branchName})).status===200){let f=yield this.octokit.request("GET /repos/{owner}/{repo}/commits",{owner:c.repo.owner,repo:c.repo.repo,path:u,sha:this.branchName});if(f.status===200){let F=(a=(r=(s=f.data[0])==null?void 0:s.commit)==null?void 0:r.committer)==null?void 0:a.date,w=F?new Date(F):void 0,k=new Date(o.stat.mtime);w&&k>w||!w?i.push(o):R({settings:this.settings},l.t("error.alreadyExists",{file:o.name}))}}}catch(d){i.push(o)}}else i.push(o);return i})}};var Jn=class extends is{constructor(e,n){super(e,n)}getSharedFiles(e){var s;let n=this.vault.getMarkdownFiles(),i=[];for(let r of n)try{let a=(s=this.metadataCache.getCache(r.path))==null?void 0:s.frontmatter;he(a,this.settings,r,e)&&i.push(r)}catch(a){R({settings:this.settings,e:!0},a)}return i}getSharedFileOfFolder(e,n){var s;let i=[];for(let r of e.children)if(r instanceof hn.TFolder)i.push(...this.getSharedFileOfFolder(r,n));else try{let a=(s=this.metadataCache.getCache(r.path))==null?void 0:s.frontmatter;he(a,this.settings,r,n)&&i.push(r)}catch(a){R({settings:this.settings,e:!0},a)}return R({settings:this.settings},i),i}getAllFileWithPath(e){var s;let n=this.vault.getFiles(),i=[];for(let r of n)if(we(r.extension)){let a=Zt(r,this.settings,null);i.push({converted:a,real:r.path})}else if(r.extension=="md"){let a=(s=this.metadataCache.getCache(r.path))==null?void 0:s.frontmatter;if(he(a,this.settings,r,e)){let o=Je(r,this.settings,e,this.plugin.app);i.push({converted:o,real:r.path,repoFrontmatter:J(this.settings,e,a)})}}return i}getLinkedByEmbedding(e){var s,r;let n=this.getLinkedFiles(e),i=(s=this.metadataCache.getFileCache(e))==null?void 0:s.embeds;if(i!=null)for(let a of i)try{let o=this.metadataCache.getFirstLinkpathDest(a.link.replace(/#.*/,""),e.path);if(o!==null){let u=a.displayText!==o.path.replace(".md","")?a.displayText:o.basename,c;if(this.settings.upload.frontmatterTitle.enable){let f=(r=this.metadataCache.getCache(o.path))==null?void 0:r.frontmatter;(f==null?void 0:f[this.settings.upload.frontmatterTitle.key])&&(c=f[this.settings.upload.frontmatterTitle.key],u===o.basename&&(u=c))}let d={linked:o,linkFrom:a.link,altText:u,destinationFilePath:c,type:"embed",position:{start:a.position.start.offset,end:a.position.end.offset}};a.link.includes("#")&&(d.anchor=`#${a.link.split("#")[1]}`),n.push(d)}}catch(o){R({settings:this.settings},o)}return[...new Set(n)]}getLinkedFiles(e){var s,r;let n=(s=this.metadataCache.getCache(e.path))==null?void 0:s.links,i=[];if(n!=null){for(let a of n)try{let o=this.metadataCache.getFirstLinkpathDest(a.link.replace(/#.*/,""),e.path);if(o){let u=a.original.match(/\[.*\]\(.*\)/)?a.original.match(/\[(.*)\]/)[1]:a.displayText!==o.path.replace(".md","")?a.displayText:o.basename,c;if(this.settings.upload.frontmatterTitle.enable){let f=(r=this.metadataCache.getCache(o.path))==null?void 0:r.frontmatter;f&&f[this.settings.upload.frontmatterTitle.key]&&(c=f[this.settings.upload.frontmatterTitle.key],u===o.basename&&(u=c))}let d={linked:o,linkFrom:a.link,altText:u,destinationFilePath:c,type:"link"};a.link.includes("#")&&(d.anchor=`#${a.link.split("#")[1]}`),i.push(d)}}catch(o){R({settings:this.settings,e:!0},`Error with this links : ${a.link}`,o)}return[...new Set(i)]}return[]}getSharedEmbed(e,n){var r;let i=(r=this.metadataCache.getCache(e.path))==null?void 0:r.embeds,s=[];if(i!=null){for(let a of i)try{let o=this.metadataCache.getFirstLinkpathDest(a.link.replace(/#(.*)/,""),e.path);o&&s.push(this.imageSharedOrNote(o,n))}catch(o){R({settings:this.settings,e:!0},`Error with this file : ${a.displayText}`,o)}return[...new Set(s)].filter(a=>a!==null)}return[]}getLastEditedTimeRepo(e){return m(this,null,function*(){let i=(yield this.octokit.request("GET /repos/{owner}/{repo}/commits",{owner:this.settings.github.user,repo:this.settings.github.repo,path:e.file})).data[0];return!i||!i.commit||!i.commit.committer||!i.commit.committer.date?null:new Date(i.commit.committer.date)})}getAllFileFromRepo(e,n){return m(this,null,function*(){let i=[];try{let s=yield this.octokit.request("GET /repos/{owner}/{repo}/git/trees/{tree_sha}",{owner:n.owner,repo:n.repo,tree_sha:e,recursive:"true"});if(s.status===200){let r=s.data.tree;for(let a of r){if(!a.path||!a.sha)continue;let o=u=>/([^/\\.]*)(\..*)?$/.exec(u)[1];a.type==="blob"&&o(a.path).length>0&&i.push({file:a.path,sha:a.sha})}}}catch(s){R({settings:this.settings,e:!0},s)}return i})}getNewFiles(e,n){let i=[];for(let s of e)if(!n.some(r=>r.file===s.converted.trim())){let r=this.vault.getAbstractFileByPath(s.real.trim());r&&r instanceof hn.TFile&&r.extension==="md"&&i.push(r)}return i}getImageByPath(e,n,i){n.constructor.name==="Link"&&(n=n.path),e.constructor.name==="Link"&&(e=e.path);let s=this.metadataCache.getFirstLinkpathDest(n,e);if(s)return this.imageSharedOrNote(s,i)}imageSharedOrNote(e,n){let i=n.attachment,s=n.embed;if(we(e.extension)&&i||s&&e.extension==="md")return e}getMetadataLinks(e,n,i,s){return m(this,null,function*(){var r,a;for(let o of this.settings.embed.keySendFile){let u=(r=this.metadataCache.getFileCache(e))==null?void 0:r.frontmatterLinks,c=[];u&&u.forEach(d=>{let f=new RegExp(`${o}(\\.\\d+)?`,"g");d.key.match(f)&&c.push(d.link)});for(let d of c){let f=(a=this.metadataCache.getFirstLinkpathDest(d,e.path))!=null?a:this.vault.getAbstractFileByPath(d);f instanceof hn.TFile&&!n.includes(f)&&n.push(this.imageSharedOrNote(f,s))}}if(n=[...new Set(n)].filter(o=>o!=null),R({settings:this.settings},n),this.plugin.app.plugins.enabledPlugins.has("dataview")){let o=(0,Bl.getAPI)();if(!o)return n;let u=o.page(e.path);if(!u)return n;for(let c of this.settings.embed.keySendFile){let d=u[c];if(d!=null)if(d.constructor.name==="Array")for(let f of d){let p=this.getImageByPath(e.path,f,s);p&&n.push(p)}else{let f=this.getImageByPath(e.path,d.toString(),s);f&&n.push(f)}}}return[...new Set(n)].filter(o=>o!=null)})}getEditedFiles(e,n,i){return m(this,null,function*(){for(let s of e)if(n.some(r=>r.file===s.converted.trim())){let r=n.find(u=>u.file===s.converted.trim());if(!r)continue;let a=yield this.getLastEditedTimeRepo(r),o=this.vault.getAbstractFileByPath(s.real.trim());if(o&&o instanceof hn.TFile&&o.extension==="md"){let u=new Date(o.stat.mtime);a&&u>a&&(R({settings:this.settings},`edited file : ${o.path} / ${u} vs ${a}`),i.push(o))}}return i})}};var hr=class extends Jn{constructor(e,n){super(e,n)}newBranch(e){return m(this,null,function*(){e=Array.isArray(e)?e:[e];for(let n of e)yield this.newBranchOnRepo(n)})}newBranchOnRepo(e){return m(this,null,function*(){let i=(yield this.octokit.request("GET /repos/{owner}/{repo}/branches",{owner:e.owner,repo:e.repo})).data.find(s=>s.name===e.branch);if(!i)return!1;try{let s=i.commit.sha,r=yield this.octokit.request("POST /repos/{owner}/{repo}/git/refs",{owner:e.owner,repo:e.repo,ref:`refs/heads/${this.branchName}`,sha:s});return _({settings:this.settings},l.t("publish.branch.success",{branchStatus:r.status,repo:e})),r.status===201}catch(s){try{R({settings:this.settings,e:!0},s);let a=(yield this.octokit.request("GET /repos/{owner}/{repo}/branches",{owner:e.owner,repo:e.repo})).data.find(o=>o.name===this.branchName);return _({settings:this.settings},l.t("publish.branch.alreadyExists",{branchName:this.branchName,repo:e})),!!a}catch(r){return _({settings:this.settings,e:!0},r),!1}}})}pullRequestOnRepo(e){return m(this,null,function*(){var n;try{return(yield this.octokit.request("POST /repos/{owner}/{repo}/pulls",{owner:e.owner,repo:e.repo,title:l.t("publish.branch.prMessage",{branchName:this.branchName}),body:"",head:this.branchName,base:e.branch})).data.number}catch(i){R({settings:this.settings,e:!0},i);try{return((n=(yield this.octokit.request("GET /repos/{owner}/{repo}/pulls",{owner:e.owner,repo:e.repo,state:"open"})).data[0])==null?void 0:n.number)||0}catch(s){return _({settings:this.settings,e:!0},l.t("publish.branch.error",{error:s,repo:e})),0}}})}deleteBranchOnRepo(e){return m(this,null,function*(){try{return(yield this.octokit.request("DELETE /repos/{owner}/{repo}/git/refs/heads/"+this.branchName,{owner:e.owner,repo:e.repo})).status===200}catch(n){return R({settings:this.settings,e:!0},n),!1}})}mergePullRequestOnRepo(e,n){return m(this,null,function*(){let i=n.commitMsg||n.commitMsg.trim().length>0?`${n.commitMsg} #${e}`:`[PUBLISHER] Merge #${e}`;try{return(yield this.octokit.request("PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge",{owner:n.owner,repo:n.repo,pull_number:e,commit_title:i,merge_method:"squash"})).status===200}catch(s){return _({settings:this.settings,e:!0},s),new ut.Notice(l.t("error.mergeconflic")),!1}})}updateRepository(e){return m(this,null,function*(){e=Array.isArray(e)?e:[e];let n=[];for(let i of e)n.push(yield this.updateRepositoryOnOne(i));return!n.every(i=>i===!1)})}updateRepositoryOnOne(e){return m(this,null,function*(){try{let n=yield this.pullRequestOnRepo(e);return e.automaticallyMergePR&&n!==0?(yield this.mergePullRequestOnRepo(n,e))?(yield this.deleteBranchOnRepo(e),!0):!1:!0}catch(n){return R({settings:this.settings,e:!0},n),new ut.Notice(l.t("error.errorConfig",{repo:e})),!1}})}checkRepository(e,n=!0){return m(this,null,function*(){e=Array.isArray(e)?e:[e];for(let i of e)try{(yield this.octokit.request("GET /repos/{owner}/{repo}",{owner:i.owner,repo:i.repo}).catch(r=>{r.status===404?new ut.Notice(l.t("commands.checkValidity.inRepo.error404",{repo:i})):r.status===403?new ut.Notice(l.t("commands.checkValidity.inRepo.error403",{repo:i})):r.status===301&&new ut.Notice(l.t("commands.checkValidity.inRepo.error301",{repo:i}))})).status===200&&(_({settings:this.settings},l.t("commands.checkValidity.repoExistsTestBranch",{repo:i})),(yield this.octokit.request("GET /repos/{owner}/{repo}/branches/{branch}",{owner:i.owner,repo:i.repo,branch:i.branch}).catch(a=>{a.status===404?new ut.Notice(l.t("commands.checkValidity.inBranch.error404",{repo:i})):a.status===403&&new ut.Notice(l.t("commands.checkValidity.inBranch.error403",{repo:i}))})).status===200&&!n&&new ut.Notice(l.t("commands.checkValidity.success",{repo:i})))}catch(s){R({settings:this.settings,e:!0},s);break}})}};var mr=W(require("obsidian"));var fr={};us(fr,{commands:()=>Ll,common:()=>Ml,default:()=>yp,deletion:()=>Il,error:()=>$l,informations:()=>Vl,modals:()=>Gl,publish:()=>jl,regex:()=>Hl,settings:()=>Ul,statusBar:()=>_l});var Ll={checkValidity:{inBranch:{error403:"Error 403: {{- repo.owner}}/{{- repo.repo}} was moved permanently (from {{- repo.branch}}).",error404:"Error 404: The branch {{- repo.branch}} was not found in {{- repo.owner}}/{{- repo.repo}}."},inRepo:{error301:"Error 301: {{- repo.owner}}/{{- repo.repo}} was moved permanently.",error403:"Error 403: this action is forbidden for {{- repo.owner}}/{{- repo.repo}}.",error404:"Error 404: {{- repo.owner}}/{{- repo.repo}}: is not found."},rateLimit:{command:"Check the rate limit of the GitHub API",limited:"You have reached the rate limit of the GitHub API. The limit will be reset at {{- resetTime}}.",notLimited:"You are not rate limited. You can make {{- remaining}} requests before the limit is reset at {{- resetTime}}."},repoExistsTestBranch:"Repository {{- repo.owner}}/{{- repo.repo}} exists. Now testing the {{- repo.branch}} branch.",success:"{{- repo.owner}}/{{- repo.repo}} seems to be valid!",title:"Test the connection to the configured repository"},copyLink:{onActivation:"Link copied to your clipboard",title:"Create a link to this note"},publisherDeleteClean:"Purge depublished and deleted files",runOtherRepo:{noFile:"No file is active or the file is not shared",title:"Run command for a repository"},shareActiveFile:"Upload single current active note",shareViewFiles:{multiple:{on:"Upload {{- doc}} to {{- smartKey }}",other:"Upload to\u2026"}},uploadAllEditedNote:"Refresh all published notes",uploadAllNewEditedNote:"Refresh published and upload new notes",uploadAllNotes:"Upload all shared notes",uploadNewNotes:"Upload unpublished notes"},Ml={add:"Add {{- things}}",after:"After",attachments:"Attachments",before:"Before",cancel:"Cancel",close:"Close",default:"default",defaultName:"default folder",delete:"Delete {{- things}}",edit:"Edit {{- things}}",error:"Error",files:"Files",ghToken:"GitHub token",here:"here",or:"or",path:{file:"File name",folder:"Folder path",full:"Filepath"},published:"published",regex:"regex",rename:"Renamed key(s)...",repository:"Repository",rootFolder:"root folder",save:"Save",shared:"shared",text:"text",warning:"Warning"},Il={defaultFolder:"You need a default folder name in the settings to use this command.",failed:"Failed to delete {{- nb}} files.",noFile:"No files have been deleted.",rootFolder:"You need to configure a root folder in the settings to use this command.",success:"Successfully deleted {{- nb}} files."},$l={alreadyExists:"{{- file}} already exists.",autoClean:"Since {{- what}} is empty, auto-cleaning is disabled.",dataview:"Unable to render dataview query. Please update the dataview plugin to the last version.",errorConfig:"Error configuring {{- repo.owner}}/{{- repo.repo}}. Please check your settings.",errorPublish:"Error during upload to {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}",isEmpty:"{{- what}} is empty.",mergeconflic:"Pull-request is not mergeable, you need to do it manually.",normal:"The 404 error is normal ! It means that the file does not exist yet. Don't worry \u2764\uFE0F.","reading-token-file":"Error: the path seems incorrect.",unablePublishMultiNotes:"Unable to upload multiple notes, something went wrong.",unablePublishNote:"Unable to upload note {{- file}}, skipping it",whatEmpty:{branch:"Branch",owner:"Owner"}},Vl={foundNoteToSend:"Found {{- nbNotes}} new notes to send",migrating:{fileReplace:"Migration of filename replace to the new format...",normalFormat:"Migrating settings...",oldSettings:"Migration of old settings to new settings format...",subFolder:"Adding replacing subfolder to the folderpath replacement..."},noNewNote:"No new notes to upload.",scanningRepo:"Scanning the repository, may take a while...",sendMessage:"Upload {{- nbNotes}} notes to {{- repo.owner}}/{{- repo.repo}}",startingClean:"Starting cleaning {{- repo.owner}}/{{- repo.repo}}",successPublishOneNote:"Successfully uploaded {{- file}} to {{- repo.owner}}/{{- repo.repo}}",successfulPublish:"Successfully uploaded {{- nbNotes}} to {{- repo.owner}}/{{- repo.repo}}",waitingWorkflow:"Now, waiting for the workflow to be completed..."},Gl={export:{copy:"Copy to clipboard",desc:"Export settings to clipboard or a file.",download:"Download",title:"Export settings"},import:{desc:"Import settings from text or a file. Note : this will overwrite your current settings (except for username, repo name and token).",error:{isEmpty:"the configuration is empty.",span:"Error importing configuration: "},importFromFile:"Import from file",paste:"Paste configuration here...",presets:{desc:'Load presets from the repository "plugin-presets"',title:"Presets"},title:"Import settings"},listChangedFiles:{added:"Added",deleted:"Deleted",edited:"Edited",error:"Errors",notDeleted:"Cannot be deleted",title:"List of files edited in the repository",unpublished:"Cannot be published"}},jl={branch:{alreadyExists:"Branch already exists ({{- branchName}} on {{- repo.owner}}/{{- repo.repo}} - Using it.",error:"Error with {{- repo.owner}}/{{- repo.repo}}: {{- error}}",prMessage:"Pull-Request [{{- branchName}}] from Obsidian",success:"Branch successfully created (status: {{- branchStatus}}) on {{- repo.owner}}/{{- repo.repo}}"}},Hl={entry:"Value to replace",replace:"Replacement"},Ul={conversion:{dataview:{desc:"Convert dataview to markdown.",title:"Dataview"},desc:"Theses option won't change the content of the file in your Obsidian Vault, but will change the content of the file in GitHub.",hardBreak:{desc:"Add a markdown hard line break (double whitespace) after each line.",title:"Markdown hard line break"},links:{desc:"Put `links: false` in the frontmatter of a note to prevent links to it to be converted and keep the alt text (or filename)",folderNote:{desc:"Rename files to a specified name (default: index.md) if it has the same name as their parent folder/category (also works if the note is outside of the folder).",title:"Folder note"},internals:{desc:"Convert internal links to their counterpart in the repository, with relative path.",shareAll:'Includes all links for the "share all" settings, as it impossible without frontmatter to know the sharing state of a file.',title:"Internals links"},nonShared:{desc:"Same option as internals, but for notes that are not yet published. Disabled, only the filename will be conserved.",title:"Convert internal links pointing to unpublished notes"},slugify:{desc:"Standardize the slug of anchor links (pointing to heading title). Transform the slug into all lower case. Replace space with hyphen. Applicable only for anchor links in markdown link syntax.",title:"Sluglify anchor in markdown links"},title:"Links",wikilinks:{desc:"Convert Wikilinks to MDlinks, without changing the contents.",title:"[[Wikilinks]] to [MDlinks](links)"}},sectionTitle:"Main text",tags:{desc:"This will convert any properties or dataview inline field into properties tags. Separate fields with a comma.",exclude:{desc:"This will exclude value from being converted. Separate fields with a comma.",placeholder:"Field value",title:"Exclude value from conversion"},inlineTags:{desc:'Add your inline tags in your properties tags field and converting nested tags with replacing "/" with "_"',title:"Inline tags"},title:"Convert properties/dataview fields into tags"},title:"Content"},embed:{attachment:"Attachments",bake:{text:"Allow you to add text before and after each embed, for example adding HTML or stylize the block with markdown.",textAfter:{title:"Text after the block"},textBefore:{title:"Text before the block"},title:"Include embed settings",variable:{desc:"It is possible to use the following variable:",title:": note embedded title",url:": path to the embedded note"},warning:"If you use HTML, depending of your host settings, the markdown will broke."},char:{desc:"Character(s) to add before the link.",title:"Embed characters"},defaultImageFolder:{desc:"To use a folder different from default",title:"Default attachment folder"},forcePush:{all:"Use {{all}} to change the destination of all attachments (and/or force them to be sent).",default:"Use {{default}} to use the default destination path.",desc:"The following extensions will always be published, regardless of the last sending date.",info:"By default, attachments are only sent if they have been modified since they were last sent, or if they do not exist in the repository.",separateByComma:`Separate extensions with commas. -You can use regex by enclosing it with "/", like /regex/. Use {{all}} to force all attachments to be sent.`,title:"Force attachments to be sent"},imagePath:{desc:"Use the obsidian folder structure or configure a default folder below",title:"Structure"},links:{desc:"Allow to edit the links of the embeds, removing entirely the citation, or transform to a simple link",dp:{bake:"Include embed contents",keep:"No change",links:"Transform to link",remove:"Remove link completely"},title:"Change embed markup"},notes:"Embed notes",overrides:{desc:"Allow to send an attachment into a specific path and force push attachments.",modal:{dest:"Destination",path:"Path or extension",title:"Override attachments path"}},title:"Attachment & embeds ",transferImage:{title:"Transfer attachments"},transferMetaFile:{desc:"Set the names of the metadata field you want to use to send files. Separate fields with a comma. Dataview inline field are supported.",title:"Send files using a metadata field"},transferNotes:{desc:"Send embedded notes in a shared file to GitHub. Only shared files will be send!",title:"Transfer embedded notes"}},github:{apiType:{desc:"Choose between the GitHub API or the GitHub Enterprise API (only GitHub Enterprise users \u2014 Advanced user!).",dropdown:{enterprise:"Enterprise",free:"Free/Pro/Team (default)"},hostname:{desc:"The hostname of your GitHub Enterprise instance.",title:"GitHub Enterprise Hostname"},title:"API Type"},automaticallyMergePR:"Automatically merge pull requests",branch:{desc:'If you use a different branch than "main"',title:"Main branch"},ghToken:{button:{configDir:": The configuration folder of Obsidian",default:"By default, it will be in:",description:"You can edit the file path where the token will be stored.",pluginID:": The plugin ID",tooltip:"Modify the path of the file containing the token",variables:"You can use the following variables:"},desc:"A GitHub token with repository permission. You can generate it ",error:"The token mustn't be empty!"},repoName:{desc:"The name of the repository where you store your blog.",placeholder:"mkdocs-template",title:"Repository name"},smartRepo:{button:"Manage more repository",modals:{default:'The name "default" is reserved for your primary configuration.',desc:'These "other repositories" allow you to use all the commands on the repositories added below.',duplicate:"Smartkey must be unique!",empty:"Smartkeys cannot be empty",frontmatterInfo:'Using the "shortRepo" properties key with the "smartKey" also allows you to use this repository in a file without having to write its path.',newRepo:"a new repository",otherConfig:"Other settings",shortcuts:{desc:"Add all commands for this repository in the command palette",title:"Shortcuts"},title:"Manage others repositories"}},testConnection:"Test connection",title:"GitHub config",username:{desc:"The username or organization hosting the repo in GitHub",title:"GitHub username"}},githubWorkflow:{autoCleanUp:{desc:"Remove depublished files (stopped sharing or deleted) from GitHub",title:"Auto clean up"},excludedFiles:{desc:'If you want to exclude some folder or file from the autoclean, add them here. You can use regex by surrounding the string with "/". Separate files with a comma.',title:"Excluded files and folder"},githubAction:{desc:'If you want to activate a GitHub action when the plugin push the file, set the name of the file (in your .github/worfklows folder). Only workflow with the "workflow_dispatch" event will be triggered.',title:"GitHub action name"},prRequest:{desc:"The message send when the pull-request is merged. Will always followed by the pull-request number.",error:"You can't use an empty string here!",title:"Commit message"},useMetadataExtractor:{desc:"Send the files generated by the metadata-extractor plugin in this folder.",title:"Metadata-extractor files"}},help:{frontmatter:{attachment:{folder:"Change the default folder for the attachments",send:"Send all attachments to GitHub"},autoclean:"Disable or enable autocleaning",baselink:{desc:"Change the base link for the copy link command. Also disable the link replacer part. Can be used as an properties object with the name ",remove:"Remove part of the link. It must be a list!"},convert:{enableOrDisable:"Enable or disable the conversion of links. Disabling this will remove the",syntax:"syntax, while keeping the file name or the alternative text."},dataview:"Convert dataview queries to markdown.",desc:"Moreover, there are some properties keys that can be useful for your workflow. The code below show the default settings, but feel free to change it to your needs in each notes!",embed:{char:'Add a character(s) before the embedded links. Used only if you set "remove" to "links".',remove:{bake:"Include the content of the embed (support blocks, heading and entire file)",desc:"Modify the aspect of the embedded files link. Can take the followed value:",keep:"Leave as in Obsidian",links:'Convert to links (delete or edit the "!")',remove:"Delete the citation completely and leave an empty line"},send:"Send embedded note to GitHub"},hardBreak:"Convert all linebreaks to markdown \xABhard break\xBB.",internals:"Convert internals links to their counterpart in the website, with relative path. Disabled, the plugin will keep the internal link as is.",mdlinks:"Convert all [[wikilinks]] to [markdown](links)",nonShared:"Convert internal links pointing to a unshared file to their counterpart in the website, with relative path. Disabled, the plugin will keep the filename.",path:"You can override all path settings using this key. The path will be relative to the root of your repository.",repo:{branch:"Branch of the repo",desc:"Change the default repo for the note.",owner:"Owner of the repo"},share:{other:"You could also use another shareKey based on the key set in \xAB Manage other repo \xBB. It allows you to separate your different repository. If the main and secondaries key are used, the main repo will be used.",title:"This key is used to share a note with the plugin."},shortRepo:"Allow to use one of the repo set in other repo settings.",title:"Property key cheatsheet",titleKey:"Change the title of the note."},multiRepoHelp:{desc:"If you want to send your notes to multiple repository, you can use the ",desc2:"key in your properties. The value of this key must be a list of repository. Each repository must have the following keys ",exampleDesc:"The code below show an example based on your settings.",title:"Send to multiple repository"},title:"Help",usefulLinks:{discussion:"Discussion",documentation:"Documentation",issue:"Issue",links:"https://obsidian-publisher.netlify.app/",title:"Useful links"}},overrides:{},plugin:{copyLink:{baselink:{desc:"The base link of your website. By default : https://username.github.io/repo/",title:"Base link"},command:{desc:"Add a command to copy the link of the note (need reloading the plugin to take effect)"},desc:"Send a link to your note in your clipboard",linkPathRemover:{desc:"Delete this part of the links created. Separate with a comma if several values are to be deleted.",title:"Deleting part of the link"},title:"Copy link"},dev:{desc:"Advanced user only. Will display as notice according to the previous setting.",title:"Display developper logs"},editorMenu:{desc:"Add a sharing command in the right-click menu",title:"Editor menu"},embedEditRepo:{desc:"Display a modal how the new version differs",title:"Show what files are edited, added, or deleted after uploaded"},excludedFolder:{desc:"Never publish file in these folders, regardless of the share key. Read the docs for more info.",title:"Excluded folders"},fileMenu:{desc:"Add a sharing command in the file menu",title:"File menu"},head:{copyLinks:"Link building & copy",log:"Logs",menu:"Menu",other:"Others",share:"Sharing config"},logNoticeHeader:{desc:"On mobile, it can be hard to debug the plugin. Enable this option to log every error in a Notice.",title:"Notice every error"},saveTab:{desc:"Allows you to reopen the settings on the previously used tab",title:"Save tab"},shareKey:{all:{desc:"Share all files regardless of the state of the share key of the notes",title:"Share all files"},desc:"The YAML frontmatter key to publish your file on the website. Default is `share`.",excludedFileName:{title:"Exclude files with names starting with ..."},otherRepo:"You can also define a share key to separate with others, without using the shortRepo key.",title:"Share key"},title:"Plugin settings"},regexReplacing:{empty:"Replacement can be empty to remove the whole string.",emptyRegex:"The value to replace cannot be empty",forbiddenValue:"The {{- what}} cannont contain the character: {{- forbiddenChar}}",inCodeBlocks:{runIn:"Runned in code-blocks",runOut:"Not runned in the code blocks"},invalidRegex:"An error has occurred: {{- e}}",modal:{desc:'Replace text in the file with the given value. Enclose the text with "//" to use regex.',force:"Force push",keywords:"Keywords",name:"Use {{name}} to use the filename.",title:{all:"Folder path & filename replacer",only:"Replace filename",text:"Text replacer"}},momentReplaceRegex:"Run replacement {{- moment}} the other plugin conversion (dataview, internals links...)",warningPath:'Warning! Using the character "/" will edit the path, be careful with this option.'},upload:{defaultFolder:{desc:"Set the default reception folder. Leave it empty to use the root of the repository.",other:"Use this folder as root within the repository (each path will be prepend by it)",placeholder:"docs",title:"Default folder"},folderBehavior:{desc:"Choose the file tree in the repository, with using a property key, a fixed folder or your Obsidian file tree.",fixedFolder:"Fixed Folder",obsidianPath:"Obsidian Path",title:"File tree in repository",yaml:"Property key"},folderNote:{addTitle:{key:'Use a key other than "title"',title:'Automatically add the "title" key with the file name'}},frontmatterKey:{desc:"Set the key where to get the folder's value.",placeholder:"category",title:"Property key"},regexFilePathTitle:{desc:'If the text is between "//", it will be used as a regex. Otherwise, it will be used as a string.',title:{FolderPathTitle:"Apply edit on the folder path or the filename (automatically)",titleOnly:"Apply edit on the filename (automatically)"}},rootFolder:{desc:"Append this path to the folder set by the properties key",other:"Use this folder as root within the repository (each path will be prepend by it).",title:"Root folder"},title:"File paths",useFrontmatterTitle:{desc:'Use a property value to generate the filename. By default, "title" is used. ',title:"Set the key where to get the value of the filename"}}},_l={counter:"{{- msg}}: {{- counter}}/{{- nb}}",loading:"Loading...",markedForSharing:"{{- nb}} {{- type}} marked for sharing",sharing:"Sharing {{- type}}",success:"{{- type}} {{- action}}"},yp={commands:Ll,common:Ml,deletion:Il,error:$l,informations:Vl,modals:Gl,publish:jl,regex:Hl,settings:Ul,statusBar:_l};var pr={};us(pr,{commands:()=>ql,common:()=>Wl,default:()=>Fp,deletion:()=>Kl,error:()=>zl,informations:()=>Zl,modals:()=>Yl,publish:()=>Jl,regex:()=>Ql,settings:()=>Xl,statusBar:()=>ec});var ql={checkValidity:{inBranch:{error403:"Erreur 403: {{- repo.owner}}/{{- repo.repo}} a \xE9t\xE9 d\xE9plac\xE9 de mani\xE8re permanente (depuis {{- branchInfo}}",error404:"Erreur 404 : La branche {{- repo.branch}} est introuvable depuis {{- repo.owner}}/{{- repo.repo}}"},inRepo:{error301:"Erreur 301 : {{- repo.owner}}/{{- repo.repo}} a \xE9t\xE9 d\xE9plac\xE9 de mani\xE8re permanente",error403:"Erreur 403 : Cette action est interdite pour {{- repo.owner}}/{{- repo.repo}}",error404:"Erreur 404 : {{- repo.owner}}/{{- repo.repo}} est introuvable"},rateLimit:{command:"V\xE9rifier la limite de requ\xEAtes de l'API GitHub",limited:"Vous avez atteint la limite de requ\xEAtes Github. La limite sera r\xE9initialis\xE9e \xE0 {{- resetTime}}. minutes.",notLimited:"Vous n'\xEAtes pas limit\xE9 par Github. Vous pouvez encore faire {{- remaining}} requ\xEAtes, et la limite sera r\xE9initialis\xE9e \xE0 {{- resetTime}}."},repoExistsTestBranch:"Le d\xE9p\xF4t {{- repo.owner}}/{{- repo.repo}} existe. Maintenant, nous allons tester la branche {{- repo.branch}}",success:"{{- repo.owner}}/{{- repo.repo}} semble valide !",title:"Tester la connexion au d\xE9p\xF4t configur\xE9"},copyLink:{onActivation:"Lien copi\xE9 dans le presse-papier !",title:"Cr\xE9er un lien vers cette note"},publisherDeleteClean:"Purger les fichiers d\xE9publi\xE9s et supprim\xE9s",runOtherRepo:{noFile:"Aucun fichier actif, ou le fichier n'est pas partag\xE9.",title:"Lancer une commande pour un d\xE9p\xF4t"},shareActiveFile:"Transf\xE9rer la note active",shareViewFiles:{multiple:{on:"Transf\xE9rer {{- doc}} vers {{- smartKey }}",other:"Transf\xE9rer vers\u2026"}},uploadAllEditedNote:"Rafra\xEEchir toutes les notes publi\xE9es",uploadAllNewEditedNote:"Rafra\xEEchir les notes publi\xE9es et transf\xE9rer les nouvelles notes",uploadAllNotes:"Transf\xE9rer toutes les notes",uploadNewNotes:"Transf\xE9rer les nouvelles notes"},Wl={add:"Ajouter {{- things}}",after:"Apr\xE8s",attachments:"Pi\xE8ces-jointes",before:"Avant",cancel:"Annuler",close:"Fermer",default:"d\xE9faut",defaultName:"dossier par d\xE9faut",delete:"Supprimer {{- things}}",edit:"\xC9diter {{- things}}",error:"Erreur",files:"Fichiers",ghToken:"Token GitHub",here:"ici",or:"ou",path:{file:"Nom du fichier",folder:"Chemin du dossier",full:"Chemin du fichier"},published:"publi\xE9s",regex:"regex",rename:"Cl\xE9(s) renomm\xE9e(s)...",repository:"D\xE9p\xF4t",rootFolder:"dossier racine",save:"Sauvegarder",shared:"partag\xE9es",text:"texte",warning:"Attention"},Kl={defaultFolder:"Vous avez besoin d'un dossier par d\xE9faut dans les param\xE8tres pour utiliser cette commande.",failed:"\xC9chec de la suppression de {{- nb}} notes.",noFile:"Aucun fichier n'a \xE9t\xE9 supprim\xE9.",rootFolder:"Vous devez configurer un dossier racine dans les param\xE8tres pour utiliser cette commande.",success:"Suppression r\xE9ussie de {{- nb}} fichiers."},zl={alreadyExists:"{{- file}} existe d\xE9j\xE0.",autoClean:"Le {{- what}} \xE9tant vide, l'auto-nettoyage est d\xE9sactiv\xE9e.",dataview:"Impossible de convertir la requ\xEAte Dataview. Veuillez mettre \xE0 jour le module Dataview \xE0 la derni\xE8re version;",errorConfig:"Erreur de configuration pour {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}. Merci de v\xE9rifier vos param\xE8tres.",errorPublish:"Erreur lors de la publication sur {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}",isEmpty:"{{- what}} est vide.",mergeconflic:"La Pull-Request n'est pas fusionnable, vous avez besoin de le faire manuellement.",normal:"L'erreur 404 est normale ! Elle signifie que le fichier n'existe pas encore. Ne vous inqui\xE9tez pas \u2764\uFE0F.","reading-token-file":"Erreur : Le chemin est incorrect.",unablePublishMultiNotes:"Impossible de transf\xE9rer plusieurs notes, quelque chose s'est mal pass\xE9.",unablePublishNote:"Impossible de transf\xE9rer {{- file}}, le fichier a \xE9t\xE9 ignor\xE9.",whatEmpty:{branch:"Branch",owner:"Propri\xE9taire"}},Zl={foundNoteToSend:"Trouv\xE9 {{- nbNotes}} nouvelles notes \xE0 transf\xE9rer.",migrating:{fileReplace:"Migration du remplacement du nom du fichier au nouveau format...",normalFormat:"Migration des param\xE8tres...",oldSettings:"Migration des anciens param\xE8tres au nouveau format...",subFolder:"Ajout du remplacement du sous-dossier au remplacement de chemin de fichier..."},noNewNote:"Aucune note \xE0 transf\xE9rer.",scanningRepo:"Scan du d\xE9p\xF4t, veuillez patienter...",sendMessage:"Transfert de {{- nbNotes}} notes vers {{- repo.owner}}/{{- repo.repo}}",startingClean:"D\xE9but du nettoyage de {{- repo.owner}}/{{- repo.repo}}",successPublishOneNote:"Transfert r\xE9ussi de {{- file}} vers {{- repo.owner}}/{{- repo.repo}}",successfulPublish:"Transfert r\xE9ussi de {{- nbNotes}} notes vers {{- repo.owner}}/{{- repo.repo}}",waitingWorkflow:"Maintenant, attente de la fin du workflow..."},Yl={export:{copy:"Copier vers le presse-papier",desc:"Exporter les param\xE8tres vers un fichier ou dans le presse-papier.",download:"T\xE9l\xE9charger",title:"Exporter les param\xE8tres"},import:{desc:"Importer des param\xE8tres depuis un fichier ou un texte. Cela \xE9crasera vos param\xE8tres actuels (sauf le nom du d\xE9p\xF4t, le nom d'utilisateur et votre token)",error:{isEmpty:"la configuration est vide",span:"Erreur lors de l'importation de la configuration :"},importFromFile:"Import depuis le fichier",paste:"Coller la configuration ici...",presets:{desc:'Charger des pr\xE9-r\xE9glages du d\xE9p\xF4t "plugin-presets"',title:"Pr\xE9-r\xE9glages"},title:"Importer des param\xE8tres"},listChangedFiles:{added:"Ajout\xE9",deleted:"Supprim\xE9",edited:"Modifi\xE9",error:"Erreurs",notDeleted:"Impossible \xE0 supprimer",title:"Liste des fichiers \xE9dit\xE9s sur le d\xE9p\xF4t",unpublished:"Impossible \xE0 publier"}},Jl={branch:{alreadyExists:"La branche {{- branchName}} sur {{- repo.owner}}/{{- repo.repo}} existe d\xE9j\xE0 - Utilisation de celle-ci.",error:"Erreur avec {{- repo.owner}}/{{- repo.repo}} : {{- error}}",prMessage:"Pull-Request [{{- branchName}}] depuis Obsidian",success:"La branche a \xE9t\xE9 cr\xE9e avec succ\xE8s (status: {{- branchStatus}} sur {{- repo.owner}}/{{- repo.repo}})"}},Ql={entry:"Valeur \xE0 remplacer",replace:"Remplacement"},Xl={conversion:{dataview:{desc:"Convertir les requ\xEAtes Dataview en markdown.",title:"Dataview"},desc:"Ces options ne changent pas le contenu du fichier dans votre coffre Obsidian, mais changeront le contenu du fichier publi\xE9 sur GitHub.",hardBreak:{desc:"Ajoutez un retour \xE0 la ligne Markdown (double espace) apr\xE8s chaque ligne.",title:"Saut de ligne strict"},links:{desc:'Vous pouvez emp\xEAcher la conversion des liens et conserver le texte alt (ou le nom du fichier) en utilisant la cl\xE9 de propri\xE9t\xE9s "links" avec la valeur "false".',folderNote:{desc:`Renommer les fichiers en un nom sp\xE9cifique (d\xE9faut : "index.md") s'il porte le m\xEAme nom que leur dossier/cat\xE9gorie parent (fonctionne aussi si la note est \xE0 l'ext\xE9rieur du dossier).`,title:"Folder Note"},internals:{desc:"Convertir les liens internes pointant vers les notes publi\xE9es vers leur homologue dans le d\xE9p\xF4t, sous forme de chemin relatif.",shareAll:`Inclut tous les liens pour les param\xE8tres "partager tout", car il est impossible sans frontmatter de conna\xEEtre l'\xE9tat de partage d'un fichier.`,title:"Liens internes"},nonShared:{desc:"L'option pr\xE9c\xE9dente, mais appliqu\xE9es aux liens internes pointant vers des notes non-publi\xE9es. D\xE9sactiv\xE9, seul le nom du fichier sera conserv\xE9.",title:"Conversion des liens internes pointant vers des notes non-publi\xE9es"},slugify:{desc:"Normaliser le lien (slug) des liens d'ancrage (pointant vers le titre de la rubrique). Transforme le texte en minuscules. Remplace l'espace par un tiret. Applicable uniquement aux liens d'ancrage dans la syntaxe de lien markdown.",title:"Slugifier l'ancre des liens markdown"},title:"Liens",wikilinks:{desc:"Conversion des liens wikilinks en liens Markdown, sans en modifier le contenu.",title:"Convertir [[WikiLinks]] en [liens](Markdown)"}},sectionTitle:"Texte principal",tags:{desc:"Ceci convertira tous les champs des propri\xE9t\xE9s/dataview en tags. S\xE9parez les champs par une virgule.",exclude:{desc:"Exclusion de champs de la conversion. S\xE9parer les valeurs par une virgule.",placeholder:"Valeur du chemin",title:"Exclusion de tags"},inlineTags:{desc:'Ajoute vos inlines tags dans votre bloc propri\xE9t\xE9s et converti les tags imbriqu\xE9s en rempla\xE7ant "/" par "_".',title:"Inlines tags"},title:"Convertir des champs dataview ou propri\xE9t\xE9s en tags"},title:"Contenu"},embed:{attachment:"Pi\xE8ces-jointes",bake:{text:"Permet d'ajouter du texte avant et apr\xE8s chaque int\xE9gration, par exemple en ajoutant du HTML ou en stylisant le bloc avec du markdown.",textAfter:{title:"Texte apr\xE8s le block"},textBefore:{title:"Texte \xE0 ajouter avant le block"},title:"Param\xE8tres pour l'inclusion des embeds",variable:{desc:"Il est possible d'utiliser les variables suivantes :",title:" : Titre de la note inclue",url:" : Chemin vers la note inclue"},warning:"Si vous utilisez du HTML, selon les param\xE8tres de votre h\xE9bergeur, le Markdown sera cass\xE9."},char:{desc:"Caract\xE8re(s) \xE0 ajouter devant le lien.",title:"Caract\xE8re d'embed"},defaultImageFolder:{desc:"Pour utiliser un dossier diff\xE9rent de celui par d\xE9faut pour les pi\xE8ces-jointes.",title:"Dossier de pi\xE8ces-jointes par d\xE9faut"},forcePush:{all:"Utiliser {{all}} pour modifier la destination de toutes les pi\xE8ces jointes (et/ou forcer leur envoie).",default:"Utiliser {{default}} pour utiliser le chemin de destination par d\xE9faut.",desc:"Les extensions suivantes seront toujours publi\xE9es, quelque soit la derni\xE8re date d'envoi.",info:"Par d\xE9faut, les pi\xE8ces-jointes ne sont envoy\xE9s que si elles ont \xE9t\xE9 modifi\xE9es depuis leur dernier envoi, ou si elles n'existent pas dans le d\xE9p\xF4t.",title:"Forcer l'envoi des pi\xE8ces-jointes"},imagePath:{desc:"Utilisez la structure de dossier Obsidian ou configurer un dossier par d\xE9faut ci-dessous",title:"Structure"},links:{desc:"Permet d'\xE9diter les liens des embeds, en supprimant enti\xE8rement la citation, ou en la transformant en un simple lien.",dp:{bake:"Inclure le contenu des embeds",keep:"Pas de changement",links:"Transformer en lien simple",remove:"Supprimer le lien compl\xE8tement"},title:"Changer les balises d'embed"},notes:"Note (Markdown)",overrides:{desc:"Permet d'envoyer une pi\xE8ce jointe dans un chemin sp\xE9cifique et de forcer les pi\xE8ces jointes \xE0 \xEAtre pouss\xE9es.",modal:{dest:"Destination",path:"Chemin ou extension",title:"Remplacer le chemin des pi\xE8ces jointes"}},title:"Pi\xE8ces-jointes & Embeds",transferImage:{title:"Envoyer les pi\xE8ces-jointes int\xE9gr\xE9es dans un fichier dans le d\xE9p\xF4t."},transferMetaFile:{desc:"Permet d'envoyer des fichiers en utilisant une cl\xE9 propri\xE9t\xE9s/dataview. S\xE9parer les champs par une virgule.",title:"Envoyer des fichiers en utilisant une cl\xE9 propri\xE9t\xE9s/dataview"},transferNotes:{desc:"Envoyer les notes int\xE9gr\xE9es dans un fichier publi\xE9 dans le d\xE9p\xF4t. Seul les fichiers publi\xE9s seront envoy\xE9s !",title:"Transf\xE9rer les notes int\xE9gr\xE9es"}},github:{apiType:{desc:"Choisir entre l'API GitHub ou l'API pour GitHub Entreprise (uniquement pour les utilisateurs de GitHub Enterprise \u2014 Utilisateur avanc\xE9 !).",dropdown:{enterprise:"Entreprise",free:"Free/Pro/Team (d\xE9faut)"},hostname:{desc:"Le nom de l'instance Github de votre entreprise.",title:"Instance Github Entreprise"},title:"Type d'API"},automaticallyMergePR:"Fusionner automatiquement les pull-request",branch:{desc:'Dans le cas o\xF9 vous souhaitez utiliser une branche diff\xE9rente de "main".',title:"Branche principale"},ghToken:{button:{configDir:" : Le dossier de configuration d'Obsidian",default:"Par d\xE9faut, il sera dans :",description:"Vous pouvez \xE9diter le chemin du fichier dans lequel sera stock\xE9 le token.",pluginID:" : L'ID du plugin",tooltip:"Modifier le chemin du fichier contenant le token",variables:"Vous pouvez utiliser les variables suivantes :"},desc:"Un token GitHub avec autorisation de d\xE9p\xF4t. Vous pouvez le g\xE9n\xE9rer ",error:"Le token ne doit pas \xEAtre vide !"},repoName:{desc:"Le nom du d\xE9p\xF4t dans lequel vos fichiers seront transf\xE9r\xE9s.",placeholder:"mkdocs-template",title:"Nom du d\xE9p\xF4t"},smartRepo:{button:"G\xE9rer plus de d\xE9p\xF4t",modals:{default:'Le nom "default" est r\xE9serv\xE9 pour votre configuration principale.',desc:`Ces "autres d\xE9p\xF4ts" vous permettent d'utiliser toutes les commandes sur les d\xE9p\xF4ts ajout\xE9s ci-dessous.`,duplicate:"Les smartKey doivent \xEAtre uniques !",empty:"Les smartkeys ne peuvent pas \xEAtre vide",frontmatterInfo:`L'utilisation de la cl\xE9 propri\xE9t\xE9 "shortRepo" avec la "smartKey" permet \xE9galement d'utiliser ce d\xE9p\xF4t dans un fichier sans avoir \xE0 \xE9crire son chemin.`,newRepo:"un nouveau d\xE9p\xF4t",otherConfig:"Autres param\xE8tres",shortcuts:{desc:"Ajoute toutes les commandes de ce d\xE9p\xF4t dans la palette de commandes",title:"Raccourci"},title:"G\xE9rer d'autres d\xE9p\xF4ts"}},testConnection:"Tester la connexion",title:"Configuration GitHub",username:{desc:"Votre username sur GitHub.",title:"Nom d'utilisateur GitHub"}},githubWorkflow:{autoCleanUp:{desc:"Si le plugin doit supprimer de votre d\xE9p\xF4t les fichiers d\xE9publi\xE9s (arr\xEAt du partage ou suppression).",title:"Auto-nettoyage"},excludedFiles:{desc:"Si vous voulez exclure certains dossier ou fichier du nettoyage automatique, d\xE9finissez leur chemin. Les regex sont accept\xE9es en les encadrant par des slashs. S\xE9parer les valeurs par une virgule.",title:"fichiers et dossier exclus"},githubAction:{desc:"Si vous souhaitez activer une action GitHub lorsque le plugin push les fichiers dans le d\xE9p\xF4t, il vous faut indiquer le nom du fichier issus du dossier .github/workflows/. Seules les actions activ\xE9es par un workflow_dispatch sont activ\xE9es.",title:"Nom de l'action GitHub"},prRequest:{desc:"Le message envoy\xE9 lorsque la pull-request est fusionn\xE9e. Sera toujours suivi par le num\xE9ro de la pull-request.",error:"Vous ne pouvez pas utiliser une valeur vide pour le message de commit.",title:"Message de commit"},useMetadataExtractor:{desc:"Envoyer les fichiers g\xE9n\xE9r\xE9s par metadata-extractor dans ce dossier.",title:"Fichier de metadata-extractor"}},help:{frontmatter:{attachment:{folder:"Change le dossier par d\xE9faut pour les pi\xE8ces-jointes.",send:"Envoie toutes les pi\xE8ces-jointes dans le d\xE9p\xF4t GitHub."},autoclean:"D\xE9sactive ou active le nettoyage automatique du d\xE9p\xF4t GitHub.",baselink:{desc:"Change le lien de base pour la commande de copie de lien. D\xE9sactive aussi la suppression de partie de lien. Peut \xEAtre utilis\xE9e en tant qu'objet sous le nom de ",remove:"Supprime les parties de lien. \xC0 mettre sous forme de liste !"},convert:{enableOrDisable:"Active ou d\xE9sactive la conversion des liens. En d\xE9sactivant cette option, vous supprimez les",syntax:"syntaxes, tout en gardant le nom du fichier ou son text alternatif."},dataview:"Convertit les requ\xEAtes dataview en markdown.",desc:"Il existe quelques cl\xE9s de propri\xE9t\xE9s qui peuvent vous \xEAtes utile. Le code ci-dessous montre les param\xE8tres par d\xE9faut, mais n'h\xE9sitez pas \xE0 le modifier selon vos besoins pour chaque note !",embed:{char:'Ajoutez un ou plusieurs caract\xE8res avant les liens. Utiliser uniquement si vous avez fix\xE9 "remove" \xE0 "links".',remove:{bake:"Inclure le contenu des embeds (blocs de support, titre et fichier entier)",desc:"Modifie l'aspect des liens des notes incorpor\xE9es. Peut prendre les valeurs suivantes :",keep:"Laisse comme dans Obsidian",links:"Convertit le lien vers la note incorpor\xE9e en lien simple",remove:"Supprime le lien compl\xE8tement et laisse une ligne vide"},send:"Envoie les notes int\xE9gr\xE9es de la note publi\xE9es dans le d\xE9p\xF4t. Seules les notes partag\xE9es seront envoy\xE9es !"},hardBreak:'Convertit tous les sauts de lignes en "hard break" markdown.',internals:"Convertit les liens internes vers leur homologue du d\xE9p\xF4t, sous forme de liens relatifs. D\xE9sactiv\xE9s, les liens seront conserv\xE9s tels quels.",mdlinks:"Convertir tous les liens [[wikilinks]] en [liens](Markdown)",nonShared:"Convertit les liens internes pointant vers une notes non publi\xE9es vers son futur homologue. D\xE9sactiv\xE9, le plugin conservera le nom du fichier ou son texte alternatif.",path:"Vous pouvez \xE9craser tous les param\xE8tres de chemins en utilisant cette cl\xE9. Le chemin sera cr\xE9\xE9e \xE0 partir de la racine du d\xE9p\xF4t.",repo:{branch:"Nom de la branche",desc:"Changer le d\xE9p\xF4t GitHub pour cette note",owner:"Pseudo GitHub du propri\xE9taire du d\xE9p\xF4t"},share:{other:"Vous pouvez \xE9galement utiliser une autre shareKey bas\xE9e sur la cl\xE9 d\xE9finie dans \xAB G\xE9rer plus de d\xE9p\xF4t \xBB. Cela vous permet de s\xE9parer vos diff\xE9rents d\xE9p\xF4ts. Si vous utilisez les cl\xE9s principales et secondaires, le d\xE9p\xF4t principal sera utilis\xE9.",title:"La cl\xE9 utilis\xE9e pour partager une note"},shortRepo:"Autorise l'utilisation de l'un des d\xE9p\xF4ts d\xE9finis dans les param\xE8tres",title:"Aide-m\xE9moire des propri\xE9t\xE9s",titleKey:"Change le titre de la note"},multiRepoHelp:{desc:"Si vous souhaitez envoyer vos notes dans plusieurs d\xE9p\xF4t en m\xEAme temps, vous pouvez utiliser la cl\xE9 ",desc2:"dans vos propri\xE9t\xE9s. La valeur de cette cl\xE9 doit \xEAtre une liste. Chaque d\xE9p\xF4t doit avoir les cl\xE9s suivantes :",exampleDesc:"Le code ci-dessous montre un exemple bas\xE9 sur vos param\xE8tres.",title:"Envoie dans plusieurs d\xE9p\xF4t"},title:"Aide",usefulLinks:{discussion:"Discussion",documentation:"Documentation (en anglais)",issue:"Issue",links:"https://obsidian-publisher.netlify.app",title:"Liens utiles"}},overrides:{},plugin:{copyLink:{baselink:{desc:'Permet de cr\xE9er un lien dans le presse-papier avec cette base. Par d\xE9faut : "https://username.github.io/repo/"',title:"Lien du d\xE9p\xF4t/blog"},command:{desc:"Ajouter une commande permettant de copier le lien de la note publi\xE9e dans le presse-papier (n\xE9cessite de recharger le plugin pour prendre effet)"},desc:"Envoie d'un lien vers la note publi\xE9es dans votre presse-papier.",linkPathRemover:{desc:"Supprimer cette partie des liens cr\xE9\xE9s. S\xE9parer par une virgule si plusieurs valeurs doivent \xEAtre supprim\xE9es.",title:"Suppression d'une partie du lien"},title:"Copie de lien"},dev:{desc:'Utilisateur avanc\xE9 seulement. Affichera sous forme de "Notice" selon le param\xE8tre pr\xE9c\xE9dents.',title:"Affiche les logs d\xE9veloppeurs"},editorMenu:{desc:"Ajouter une commande de partage dans le menu du clic droit.",title:'Menu "Edition"'},embedEditRepo:{desc:"Permet d'afficher la liste des fichiers \xE9diter, ajout\xE9, supprim\xE9... Du d\xE9p\xF4t principal (dans un modal).",title:"Afficher les \xE9ditions sur le d\xE9p\xF4t"},excludedFolder:{desc:`Les fichiers dans ses dossiers ne seront jamais publi\xE9s, quelle que soit l'\xE9tat de la cl\xE9 de partage. S\xE9parez les noms de dossier par une virgule. Les regex sont support\xE9s en les encadrant par "//"`,title:"Dossiers exclus"},fileMenu:{desc:'Ajouter une commande de partage dans le menu "Fichier"',title:'Menu "Fichier"'},head:{copyLinks:"Cr\xE9ation et copie de liens",log:"Logs",menu:"Menu",other:"Autres",share:"Partage & cl\xE9 de partage"},logNoticeHeader:{desc:"Sur mobile, il peut \xEAtre difficile de debug le module. Activer cette option pour notifier toutes les erreurs via une notification Obsidian.",title:"Notifier toutes les erreurs"},saveTab:{desc:"Permet de rouvrir les param\xE8tres sur l'onglet pr\xE9c\xE9demment utilis\xE9",title:"Sauvegarder l'onglet"},shareKey:{all:{desc:"Autoriser le partage de tous les fichiers et ignorer l'\xE9tat de la cl\xE9 de partage",title:"Partager tous les fichiers sans cl\xE9 de partage"},desc:"Cl\xE9 de partage",excludedFileName:{title:"Exclure les fichiers dont le nom commence par ..."},otherRepo:"Vous pouvez \xE9galement d\xE9finir une cl\xE9 de partage pour s\xE9parer avec des autres, sans utiliser la cl\xE9 shortRepo.",title:"La cl\xE9 de propri\xE9t\xE9 pour publier la note sur le d\xE9p\xF4t."},title:"Param\xE8tres du plugin"},regexReplacing:{empty:"Le remplacement peut \xEAtre vide pour supprimer l'ensemble de la cha\xEEne de caract\xE8re.",emptyRegex:"La valeur \xE0 remplacer ne peut pas \xEAtre vide",forbiddenValue:"Le {{- what}} ne peut contenir le caract\xE8re : {{- forbiddenChar}}.",inCodeBlocks:{runIn:"Lanc\xE9 dans les bloc de code",runOut:"N'est pas lanc\xE9 dans les bloc de codes"},invalidRegex:"Une erreur est survenue : {{- e}}",modal:{desc:'Replace des textes dans le fichier par la valeur donn\xE9e. Vous pouvez encadrer le texte \xE0 remplacer avec "//" pour utiliser un regex.',force:"Forcer l'envoi",keywords:"Mots cl\xE9s",name:"Utiliser {{name}} pour utiliser le nom du fichier.",title:{all:"Remplacement du nom ou du chemin du fichier",only:"Remplacement du titre uniquement",text:"Remplacement de texte"}},momentReplaceRegex:"Ex\xE9cuter le remplacement {{- moment}} les autres conversions (dataview, liens internes...)",warningPath:'Attention ! Utiliser le caract\xE8re "/" modifiera le chemin du fichier. Veuillez faire attention avec cette option.'},upload:{defaultFolder:{desc:"D\xE9finir le dossier de r\xE9ception par d\xE9faut. Laisser vide pour utiliser la racine du d\xE9p\xF4t.",placeholder:"docs",title:"Dossier par d\xE9faut"},folderBehavior:{desc:"Choisir la hi\xE9rarchie des dossiers dans le d\xE9p\xF4t, en se basant sur une cl\xE9 frontmatter, un dossier fixe ou la hi\xE9rarchie des dossiers dans Obsidian.",fixedFolder:"Dossier fix\xE9",obsidianPath:"Chemin Obsidian",title:"Hi\xE9rarchie des dossiers",yaml:"Valeur d'une cl\xE9 de propri\xE9t\xE9"},folderNote:{addTitle:{key:'Utiliser une autre cl\xE9 que "title"',title:'Ajouter automatiquement la cl\xE9 "title" avec le nom du fichier'}},frontmatterKey:{desc:"D\xE9finir le nom de la cl\xE9 o\xF9 obtenir le dossier",placeholder:"category",title:"Cl\xE9 de propri\xE9t\xE9"},regexFilePathTitle:{desc:'Si le texte est entre "//", il sera interpr\xE9t\xE9 comme une expression r\xE9guli\xE8re. Sinon, il sera interpr\xE9t\xE9 comme du texte brut.',title:{FolderPathTitle:"\xC9diter le titre et le chemin du dossier (automatiquement)",titleOnly:"\xC9diter le titre (automatiquement)"}},rootFolder:{desc:"Ajouter ce chemin au dossier d\xE9finit par la cl\xE9 de propri\xE9t\xE9.",other:"Utilisez ce dossier comme racine dans le r\xE9f\xE9rentiel (chaque chemin sera pr\xE9c\xE9d\xE9 de ce nom).",title:"Dossier racine"},title:"Chemins des fichiers",useFrontmatterTitle:{desc:'Utiliser un champ des propri\xE9t\xE9s pour g\xE9n\xE9rer le nom du fichier. Par d\xE9faut, "title" est utilis\xE9.',title:"Utiliser une cl\xE9 de propri\xE9t\xE9 pour d\xE9finir le titre"}}},ec={counter:"{{- msg}} : {{- counter}}/{{- nb}}",loading:"Chargement en cours...",markedForSharing:"{{- nb}} {{- type}} \xE0 partager",sharing:"Partage de {{- type}}",success:"{{- type}} {{- action}}"},Fp={commands:ql,common:Wl,deletion:Kl,error:zl,informations:Zl,modals:Yl,publish:Jl,regex:Ql,settings:Xl,statusBar:ec};var gr={en:{translation:fr},fr:{translation:pr}},Dr=Object.keys(gr).find(t=>t==mr.moment.locale())?mr.moment.locale():"en";var N=W(require("obsidian"));var br=W(require("obsidian"));function U(t,e,n=!0){return n&&e.createEl("br"),e.createEl("span",{text:t,cls:["token","key","atrule"]})}function Ie(t,e){let n=t?"true":"false";return e.createEl("span",{text:n,cls:["token","boolean","important"]})}function wp(t,e){return e.createEl("span",{text:t,cls:["token","comment"]})}function ye(t,e){return e.createEl("span",{text:t,cls:["token","string"]})}function Ep(t,e){if(t.upload.behavior===q.yaml){let n=t.upload.defaultName.length>0?`${t.upload.defaultName}`:"/";return{rule:U(t.upload.yamlFolderKey.length>0?`${t.upload.yamlFolderKey}: `:"category: ",e),token:ye((0,br.normalizePath)(n),e)}}}function tc(t){let e=document.createDocumentFragment(),n=t.upload.defaultName.length>0?`${t.upload.defaultName}`:"/",i=`${n}/file.md`;t.upload.behavior===q.yaml&&(i=`${t.upload.rootFolder.length>0?t.upload.rootFolder:""}/${n}/file.md`),i=(0,br.normalizePath)(Tn(i,t)),U(`${t.plugin.shareKey}: `,e,!1),Ie(!0,e),Ep(t,e),U("path: ",e),ye(i,e),wp(" #given as an example path",e),U("links: ",e),U(" mdlinks: ",e),Ie(t.conversion.links.wiki,e),U(" convert: ",e),Ie(!0,e),U(" internals: ",e),Ie(t.conversion.links.internal,e),U(" nonShared: ",e),Ie(t.conversion.links.unshared,e),U("embed: ",e),U(" send: ",e),Ie(t.embed.notes,e),U(" remove: ",e),ye(t.embed.convertEmbedToLinks,e),U(" char: ",e),ye(t.embed.charConvert,e),U("attachment: ",e),U(" send: ",e),Ie(t.embed.attachments,e),U(" folder: ",e),ye(t.embed.folder,e),U("dataview: ",e),Ie(t.conversion.dataview,e),U("hardBreak: ",e),Ie(t.conversion.hardbreak,e),t.github.otherRepo.length>0&&(U("shortRepo: ",e),ye(t.github.otherRepo[0].smartKey.length>0?t.github.otherRepo[0].smartKey:"smartkey",e)),U("repo: ",e),U(" owner: ",e),ye(t.github.user,e),U(" repo: ",e),ye(t.github.repo,e),U(" branch: ",e),ye(t.github.branch,e),U(" autoclean: ",e),Ie(t.upload.autoclean.enable,e),U("copylink: ",e),U(" base: ",e),ye(t.plugin.copyLink.links.length>0?t.plugin.copyLink.links:`https://${t.github.repo}.github.io/${t.github.repo}`,e);let s=t.plugin.copyLink.removePart.map(r=>`"${r}"`).join(", ");return s.length>0&&(U(" remove: ",e),ye(s,e)),e}function nc(t){let e=document.createDocumentFragment();return e.createEl("ul",void 0,n=>{n.createEl("li",void 0,i=>{i.createEl("code",{text:`${t.plugin.shareKey}:`,cls:"code-title"}),i.createEl("span",{text:`${l.t("settings.help.frontmatter.share.title")}`}),i.createEl("ul",void 0,s=>{s.createEl("span",{text:l.t("settings.help.frontmatter.share.other")})})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"path:",cls:"code-title"}),i.createEl("span",{text:` ${l.t("settings.help.frontmatter.path")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"links:",cls:"code-title"})}),n.createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"mdlinks"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.mdlinks")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"convert"}),s.createEl("span",void 0,r=>{r.createEl("span",{text:`: ${l.t("settings.help.frontmatter.convert.enableOrDisable")} `}),r.createEl("code",{text:" [[link]] "}),r.createEl("span",{text:l.t("common.or")}),r.createEl("code",{text:" [](link) "}),r.createEl("span",{text:l.t("settings.help.frontmatter.convert.syntax")})})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"internals"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.internals")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"nonShared"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.nonShared")}`})})}),n.createEl("li",{text:"embed:",cls:"code code-title"}),n.createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"send"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.send")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"remove"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.remove.desc")}`}),s.createEl("ul",void 0,r=>{r.createEl("li",void 0,a=>{a.createEl("code",{text:"remove | true"}),a.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.remove.remove")}`})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"keep | false"}),a.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.remove.keep")}`})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"links"}),a.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.remove.links")}`})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"bake"}),a.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.remove.bake")}`})})})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"char"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.embed.char")}`})})}),n.createEl("li",{text:"attachment:",cls:"code code-title"}),n.createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"send"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.attachment.send")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"folder"}),s.createEl("span",{text:`: ${l.t("settings.help.frontmatter.attachment.folder")}`})})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"dataview",cls:"code-title"}),i.createEl("span",{text:`: ${l.t("settings.help.frontmatter.dataview")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"hardbreak",cls:"code-title"}),i.createEl("span",{text:`: ${l.t("settings.help.frontmatter.hardBreak")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"shortRepo",cls:"code-title"}),i.createEl("span",{text:`: ${l.t("settings.help.frontmatter.shortRepo")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"repo",cls:"code-title"}),i.createEl("span",{text:`: ${l.t("settings.help.frontmatter.repo.desc")}`}),i.createEl("ul",void 0,s=>{s.createEl("li",void 0,r=>{r.createEl("code",{text:"owner"}),r.createEl("span",{text:`: ${l.t("settings.help.frontmatter.repo.owner")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"repo"}),r.createEl("span",{text:`: ${l.t("settings.github.repoName.title")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"branch"}),r.createEl("span",{text:`: ${l.t("settings.help.frontmatter.repo.branch")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"autoclean"}),r.createEl("span",{text:`: ${l.t("settings.help.frontmatter.autoclean")}`})})})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:`${t.upload.frontmatterTitle.key}`,cls:"code-title"}),i.createEl("span",{text:`: ${l.t("settings.help.frontmatter.titleKey")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"baseLink",cls:"code-title"}),i.createEl("span",{text:`: ${l.t("settings.help.frontmatter.baselink.desc")}`}),i.createEl("code",{text:"copylink:",cls:"code-title"}),i.createEl("ul",void 0,s=>{s.createEl("li",void 0,r=>{r.createEl("code",{text:"base"}),r.createEl("span",{text:`: ${l.t("settings.plugin.copyLink.baselink.title")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"remove"}),r.createEl("span",{text:`: ${l.t("settings.help.frontmatter.baselink.remove")}`})})})})}),e}function ic(){let t=document.createDocumentFragment();return t.createEl("ul",void 0,e=>{e.createEl("li",void 0,n=>{n.createEl("a",{text:l.t("settings.help.usefulLinks.documentation"),href:l.t("settings.help.usefulLinks.links")})}),e.createEl("li",void 0,n=>{n.createEl("a",{text:l.t("common.repository"),href:"https://github.com/ObsidianPublisher/obsidian-github-publisher"})}),e.createEl("li",void 0,n=>{n.createEl("a",{text:l.t("settings.help.usefulLinks.issue"),href:"https://github.com/ObsidianPublisher/obsidian-github-publisher/issues"})}),e.createEl("li",void 0,n=>{n.createEl("a",{text:l.t("settings.help.usefulLinks.discussion"),href:"https://github.com/ObsidianPublisher/obsidian-github-publisher/discussions"})})}),t}function sc(t){let e=document.createDocumentFragment();e.createEl("p",void 0,i=>{i.createEl("span",{text:l.t("settings.help.multiRepoHelp.desc")}),i.createEl("code",{text:"multipleRepo"}),i.createEl("span",{text:` ${l.t("settings.help.multiRepoHelp.desc2")}:`}),i.createEl("ul",void 0,s=>{s.createEl("li",{text:"owner"}).addClass("code"),s.createEl("li",{text:"repo"}).addClass("code"),s.createEl("li",{text:"branch"}).addClass("code"),s.createEl("li",{text:"autoclean"}).addClass("code")}),i.createEl("span",{text:l.t("settings.help.multiRepoHelp.exampleDesc")})});let n=document.createDocumentFragment();return U("multipleRepo: ",n,!1),U(" - owner: ",n),ye(t.github.user,n),U(" repo: ",n),ye(t.github.repo,n),U(" branch: ",n),ye(t.github.branch,n),U(" autoclean: ",n),Ie(!1,n),U(" - owner: ",n),ye(t.github.user,n),U(" repo: ",n),ye("my_second_blog",n),U(" branch: ",n),ye("master",n),U(" autoclean: ",n),Ie(!1,n),e.createEl("pre",{cls:"language-yaml"}).createEl("code",{text:n,cls:"language-yaml"}),e}function rc(){let t=document.createDocumentFragment();return t.createEl("p",void 0,e=>{e.createEl("a",void 0,n=>{n.createEl("img",void 0,i=>{i.setAttr("src","https://storage.ko-fi.com/cdn/kofi2.png?v=3"),i.setAttr("alt","Buy Me A Coffee"),i.setAttr("style","height: 60px !important;width: 217px !important;")}),n.setAttr("href","https://ko-fi.com/lisandra_dev")}),e.setAttr("style","text-align: center;")}),t}function ss(t,e,n){return m(this,null,function*(){e.settings.plugin.migrated&&!n||(yield Tp(e,t),yield Cp(e),yield vp(e),yield xp(e),yield kp(e),yield Bt(e),yield Sp(e),e.settings.plugin.migrated=!0,yield e.saveSettings())})}function Cp(t){return m(this,null,function*(){t.settings.upload.replaceTitle instanceof Array||(R({settings:t.settings},l.t("informations.migrating.fileReplace")),t.settings.upload.replaceTitle=[t.settings.upload.replaceTitle],yield t.saveSettings())})}function vp(t){return m(this,null,function*(){t.settings.upload.subFolder&&!t.settings.upload.replacePath.find(e=>e.regex==="/"+t.settings.upload.subFolder)&&(R({settings:t.settings},l.t("informations.migrating.subFolder")),t.settings.upload.subFolder.length>0&&t.settings.upload.replacePath.push({regex:"/"+t.settings.upload.subFolder,replacement:"",type:xe.path}),delete t.settings.upload.subFolder,yield t.saveSettings())})}function xp(t){return m(this,null,function*(){for(let e of t.settings.conversion.censorText)e.flags&&(e.entry="/"+e.entry+"/"+e.flags,delete e.flags,yield t.saveSettings())})}function kp(t){return m(this,null,function*(){if(R({settings:t.settings},"Migrating workflow"),!t.settings.github.worflow)return;let e=t.settings.github.worflow;t.settings.github.workflow={name:e.workflowName,commitMessage:e.customCommitMsg},delete t.settings.github.worflow,yield t.saveSettings()})}function Bt(t,e){return m(this,null,function*(){R({settings:t.settings},"migrating token");let n=Jt(t,t.settings.github.tokenPath);if(t.settings.github.token&&!e&&(R({settings:t.settings},`Moving the GitHub Token in the file : ${n}`),e=t.settings.github.token,delete t.settings.github.token,yield t.saveSettings()),e!==void 0)if(R({settings:t.settings},`Moving the GitHub Token in the file : ${n}`),n.endsWith(".json")){let i={GITHUB_PUBLISHER_TOKEN:e};yield t.app.vault.adapter.write(n,JSON.stringify(i))}else{let i=`GITHUB_TOKEN=${e}`;yield t.app.vault.adapter.write(n,i)}})}function Sp(t){return m(this,null,function*(){var n,i,s,r,a,o;R({settings:t.settings},"Configuring other repositories");let e=(i=(n=t.settings.github)==null?void 0:n.otherRepo)!=null?i:[];for(let u of e){let c={name:(r=(s=t.settings.github.worflow)==null?void 0:s.workflowName)!=null?r:t.settings.github.workflow.name,commitMessage:(o=(a=t.settings.github.worflow)==null?void 0:a.customCommitMsg)!=null?o:t.settings.github.workflow.commitMessage};if(u.workflow||(u.workflow=c,yield t.saveSettings()),u.worflow){let d=u.worflow;d.workflowName&&(u.workflow.name=d.workflowName),d.customCommitMsg&&(u.workflow.commitMessage=d.customCommitMsg),delete u.worflow,yield t.saveSettings()}u.copyLink||(u.copyLink={links:"",removePart:[]},yield t.saveSettings())}})}function Tp(t,e){return m(this,null,function*(){var i,s;if(!Object.keys(e).includes("editorMenu"))return;R({settings:t.settings},l.t("informations.migrating.oldSettings")),t.settings={github:{user:e.githubName?e.githubName:t.settings.github.user?t.settings.github.user:"",repo:e.githubRepo?e.githubRepo:t.settings.github.repo?t.settings.github.repo:"",branch:e.githubBranch,automaticallyMergePR:e.automaticallyMergePR,tokenPath:dt,api:{tiersForApi:e.tiersForApi,hostname:e.hostname},workflow:{name:e.workflowName,commitMessage:(s=(i=e.customCommitMsg)!=null?i:t.settings.github.workflow.commitMessage)!=null?s:"[PUBLISHER] MERGE"},otherRepo:[],rateLimit:0,verifiedRepo:!1},upload:{behavior:e.downloadedFolder,defaultName:e.folderDefaultName,rootFolder:e.rootFolder,yamlFolderKey:e.yamlFolderKey,frontmatterTitle:{enable:e.useFrontmatterTitle,key:e.frontmatterTitleKey},replaceTitle:[{regex:e.frontmatterTitleRegex,replacement:e.frontmatterTitleReplacement,type:xe.title}],replacePath:[{regex:e.subFolder,replacement:"",type:xe.path}],autoclean:{enable:e.autoCleanUp,excluded:e.autoCleanUpExcluded},folderNote:{enable:e.folderNote,rename:e.folderNoteRename,addTitle:{enable:e.folderNote,key:e.frontmatterTitleKey}},metadataExtractorPath:e.metadataExtractorPath},conversion:{hardbreak:e.hardBreak,dataview:e.migrateDataview,censorText:e.censorText,tags:{inline:e.inlineTags,exclude:e.excludeDataviewValue,fields:e.dataviewFields},links:{internal:e.migrateForGithub,unshared:e.migrateInternalNonShared,wiki:e.migrateWikiLinks,slugify:!1}},embed:{forcePushAttachments:[],attachments:e.embedImage,keySendFile:e.metadataFileFields,notes:e.embedNotes,folder:e.defaultImageFolder,charConvert:"->",convertEmbedToLinks:"keep"},plugin:{shareKey:e.shareKey,fileMenu:e.fileMenu,editorMenu:e.editorMenu,excludedFolder:e.excludedFolder,copyLink:{enable:e.copyLink,links:e.mainLink,removePart:e.linkRemover.split(/[,\n]\W*/).map(r=>r.trim()),addCmd:!1},noticeError:e.logNotice,displayModalRepoEditing:!1}};let n=e.GhToken?e.GhToken:t.settings.github.token?t.settings.github.token:"";yield Bt(t,n),yield t.saveSettings()})}var le=W(require("obsidian"));function yr(t){return JSON.parse(JSON.stringify(t))}var Fr=class extends le.Modal{constructor(e,n,i,s){super(e);this.plugin=n,this.settingsPage=i,this.settingsTab=s}censorRepositoryData(e){return m(this,null,function*(){R({settings:e},"original settings:",e),this.plugin.settings.plugin=e.plugin,this.plugin.settings.github.repo=e.github.repo,this.plugin.settings.github.user=e.github.user,this.plugin.settings.github.otherRepo=e.github.otherRepo,yield this.plugin.saveSettings()})}onOpen(){let{contentEl:e}=this;new le.Setting(e).setName(l.t("modals.import.title")).setDesc(l.t("modals.import.desc")),new le.Setting(e).then(n=>{let i=createSpan({cls:"github-publisher-import-error",text:l.t("modals.import.error.span")});n.nameEl.appendChild(i);let s=a=>m(this,null,function*(){if(a)try{let o=JSON.parse(a);if(Object.keys(o).includes("editorMenu"))yield ss(o,this.plugin,!0),R({settings:this.plugin.settings},l.t("informations.migrating.oldSettings"));else{R({settings:this.plugin.settings},l.t("informations.migrating.normalFormat")),o=o;let u=yr(this.plugin.settings);o.upload.replaceTitle instanceof Array||(o.upload.replaceTitle=[o.upload.replaceTitle]);for(let[c,d]of Object.entries(o))this.plugin.settings[c]=d;yield this.censorRepositoryData(u),yield this.plugin.saveSettings()}this.close()}catch(o){i.addClass("active"),i.setText(`${l.t("modals.import.error.span")}${o}`)}else i.addClass("active"),i.setText(`${l.t("modals.import.error.span")}: ${l.t("modals.import.error.isEmpty")}`)});n.controlEl.createEl("input",{cls:"github-publisher-import-input",attr:{id:"github-publisher-import-input",name:"github-publisher-import-input",type:"file",accept:".json"}},a=>{a.addEventListener("change",o=>{let u=new FileReader;u.onload=c=>m(this,null,function*(){yield s(c.target.result.toString().trim())}),u.readAsText(o.target.files[0])})}),n.controlEl.createEl("label",{cls:"github-publisher-import-label",text:l.t("modals.import.importFromFile"),attr:{for:"github-publisher-import-input"}}),new le.TextAreaComponent(e).setPlaceholder(l.t("modals.import.paste")).then(a=>{new le.ButtonComponent(e).setButtonText(l.t("common.save")).onClick(()=>m(this,null,function*(){yield s(a.getValue().trim())})).buttonEl.addClass("github-publisher-import-save-button")}).inputEl.addClass("github-publisher-import-textarea")})}onClose(){var i;let{contentEl:e}=this;e.empty(),this.settingsPage.empty();let n=((i=this.plugin.settings.tabsID)!=null?i:document.querySelector(".settings-tab.settings-tab-active"))?document.querySelector(".settings-tab.settings-tab-active .settings-tab-name").innerText:l.t("settings.github.title");switch(n=n.trim(),n){case l.t("settings.github.title"):this.settingsTab.renderGithubConfiguration();break;case l.t("settings.upload.title"):this.settingsTab.renderUploadConfiguration();break;case l.t("settings.conversion.title"):this.settingsTab.renderTextConversion();break;case l.t("settings.embed.title"):this.settingsTab.renderEmbedConfiguration();break;case l.t("settings.plugin.title"):this.settingsTab.renderPluginSettings();break;case l.t("settings.help.title"):this.settingsTab.renderHelp();break}}},wr=class extends le.Modal{constructor(e,n){super(e);this.plugin=n}censorGithubSettingsData(e){let n=Object(e),{github:i}=n;return n.tabsID&&delete n.tabsID,i&&(delete i.repo,delete i.user,delete i.otherRepo,delete i.rateLimit),delete n.plugin,n}onOpen(){let{contentEl:e,modalEl:n}=this;n.addClass("modal-github-publisher"),new le.Setting(e).setName(l.t("modals.export.title")).setDesc(l.t("modals.export.desc")).then(i=>{let s=this.censorGithubSettingsData(yr(this.plugin.settings)),r=JSON.stringify(s,null,2);i.controlEl.createEl("a",{cls:"github-publisher-copy",text:l.t("modals.export.copy"),href:"#"},a=>{new le.TextAreaComponent(e).setValue(r).then(u=>{a.addEventListener("click",c=>{c.preventDefault(),u.inputEl.select(),u.inputEl.setSelectionRange(0,99999),document.execCommand("copy"),a.addClass("success"),setTimeout(()=>{a.parentNode&&a.removeClass("success")},2e3)})}).inputEl.addClass("github-publisher-export-textarea")}),le.Platform.isDesktop?i.controlEl.createEl("a",{cls:"github-publisher-download",text:l.t("modals.export.download"),attr:{download:"github-publisher.json",href:`data:application/json;charset=utf-8,${encodeURIComponent(r)}`}}):le.Platform.isMobile&&i.addButton(a=>a.setButtonText(l.t("modals.export.download")).onClick(()=>{this.app.vault.adapter.write(`${this.app.vault.configDir}/plugins/obsidian-mkdocs-publisher/._tempSettings.json`,r),this.app.openWithDefaultApp(`${this.app.vault.configDir}/plugins/obsidian-mkdocs-publisher/._tempSettings.json`)}))})}onClose(){try{this.app.vault.adapter.trashSystem(`${this.app.vault.configDir}/plugins/obsidian-mkdocs-publisher/._tempSettings.json`)}catch(n){R({settings:this.plugin.settings},"Error while deleting temporary file",n)}let{contentEl:e}=this;e.empty()}},Er=class extends le.FuzzySuggestModal{constructor(e,n,i,s,r){super(e);this.plugin=n,this.presetList=i,this.octokit=s,this.page=r,this.settings=n.settings}getItems(){return this.presetList}getItemText(e){return e.name}onChooseItem(e,n){let i=e.settings;R({settings:i},"onChooseItem");try{let s=yr(this.plugin.settings);i.upload.replaceTitle instanceof Array||(i.upload.replaceTitle=[i.upload.replaceTitle]);for(let[r,a]of Object.entries(i))this.settings[r]=a;this.settings.plugin=s.plugin,this.settings.github.repo=s.github.repo,this.settings.github.user=s.github.user,this.settings.github.otherRepo=s.github.otherRepo,this.settings.github.rateLimit=s.github.rateLimit,this.settings.tabsID=s.tabsID,this.plugin.saveSettings(),this.page.renderSettingsPage("github-configuration")}catch(s){new le.Notice(l.t("modals.import.error.span")+s),_({settings:this.settings},"onChooseItem",s)}}};function ac(t,e){return m(this,null,function*(){let n=yield t.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:"ObsidianPublisher",repo:"plugin-presets",path:"presets"}),i=[];if(!Array.isArray(n.data))return i;R({settings:e.settings},"LoadAllPreset",n);for(let s of n.data)if(s.name.endsWith(".json")){let r=s.name.replace(".json","");i.push({name:r,settings:yield Ap(s.path,t,e)})}return i})}function Ap(t,e,n){return m(this,null,function*(){var r;let i=yield e.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:"ObsidianPublisher",repo:"plugin-presets",path:t});if(!((r=i.data)==null?void 0:r.content))return n.settings;let s=atob(i.data.content);return JSON.parse(s)})}var Z=W(require("obsidian"));var Cr=class extends Z.Modal{constructor(e,n,i,s,r,a){super(e);this.settings=n,this.repository=r,this.plugin=s,this.onSubmit=a,this.branchName=i}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","manage-repo","add"]),e.createEl("h2",{text:l.t("settings.github.smartRepo.modals.title")}),e.createEl("p",{text:l.t("settings.github.smartRepo.modals.desc")}),e.createEl("p",{text:l.t("settings.github.smartRepo.modals.frontmatterInfo")}),e.createEl("p",{text:l.t("settings.plugin.shareKey.otherRepo")});let n={smartKey:"smartkey",user:this.settings.github.user,repo:this.settings.github.repo,branch:this.settings.github.branch,automaticallyMergePR:this.settings.github.automaticallyMergePR,api:{tiersForApi:this.settings.github.api.tiersForApi,hostname:this.settings.github.api.hostname},workflow:{commitMessage:this.settings.github.workflow.commitMessage,name:""},createShortcuts:!1,shareKey:this.settings.plugin.shareKey,copyLink:{links:this.settings.plugin.copyLink.links,removePart:[]}};new Z.Setting(e).setClass("max-width").setClass("display-none").addButton(i=>{i.setButtonText(l.t("common.add",{things:l.t("settings.github.smartRepo.modals.newRepo").toLowerCase()})).onClick(()=>{this.repository.push(n),this.onOpen()})});for(let i of this.repository){let s=new Z.Setting(e).setClass("max-width").setClass("display-none").addText(r=>{r.setPlaceholder("smartKey").setValue(i.smartKey).onChange(a=>{i.smartKey=a.toLowerCase(),s.controlEl.setAttribute("smartKey",a.toLowerCase())})}).addExtraButton(r=>{r.setIcon("trash").onClick(()=>{this.repository.splice(this.repository.indexOf(i),1),this.onOpen()})}).addExtraButton(r=>{r.setIcon("pencil").onClick(()=>{new oc(this.app,i,this.plugin,this.branchName,a=>{this.repository[this.repository.indexOf(i)]=a}).open()})})}new Z.Setting(e).addButton(i=>{i.setButtonText(l.t("common.save")).onClick(()=>{let s=this.foundError(),r=s.repo.length>0?this.containerEl.querySelector(`[smartkey="${s.repo}"] input`):e.querySelector('[placeholder="smartKey"] input');s.type==="None"&&(r==null||r.classList.remove("error"),this.onSubmit(this.repository),this.close()),r==null||r.classList.add("error"),s.type==="duplicate"?new Z.Notice(l.t("settings.github.smartRepo.modals.duplicate")):s.type==="default"?new Z.Notice(l.t("settings.github.smartRepo.modals.default")):s.type==="empty"&&new Z.Notice(l.t("settings.github.smartRepo.modals.empty"))})})}foundError(){for(let e of this.repository){if(this.plugin.settings.github.otherRepo.filter(n=>n.smartKey===e.smartKey).length>1)return{repo:e.smartKey,type:"duplicate"};if(e.smartKey==="default")return{repo:e.smartKey,type:"default"};if(e.smartKey.length===0)return{repo:"",type:"empty"}}return{repo:"",type:"None"}}onClose(){let{contentEl:e}=this,n=this.foundError();if(n.type==="empty"){let i=this.repository.filter(s=>s.smartKey===n.repo);for(let s=0;ss.smartKey===n.repo);for(let s=0;ss.smartKey===n.repo);for(let s of i){let r=Math.random().toString(36).substring(2,8);s.smartKey=`${s.smartKey}-${r}`}new Z.Notice(`${l.t("settings.github.smartRepo.modals.default")} ${l.t("common.rename")}`)}this.onSubmit(this.repository),e.empty()}},oc=class extends Z.Modal{constructor(e,n,i,s,r){super(e);this.repository=n,this.onSubmit=r,this.branchName=s,this.plugin=i}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","manage-repo"]),e.createEl("h2",{text:l.t("common.edit",{things:this.repository.smartKey})}),new Z.Setting(e).setName(l.t("settings.github.apiType.title")).setDesc(l.t("settings.github.apiType.desc")).addDropdown(n=>{n.addOption(Pe.free,l.t("settings.github.apiType.dropdown.free")).addOption(Pe.entreprise,l.t("settings.github.apiType.dropdown.enterprise")).setValue(this.repository.api.tiersForApi).onChange(i=>{this.repository.api.tiersForApi=i,this.onOpen()})}),this.repository.api.tiersForApi===Pe.entreprise&&new Z.Setting(e).setName(l.t("settings.github.apiType.hostname.title")).setDesc(l.t("settings.github.apiType.hostname.desc")).addText(n=>n.setPlaceholder("https://github.mycompany.com").setValue(this.repository.api.hostname).onChange(i=>m(this,null,function*(){this.repository.api.hostname=i.trim()}))),new Z.Setting(e).setName(l.t("settings.github.username.title")).setDesc(l.t("settings.github.username.desc")).addText(n=>n.setPlaceholder(l.t("settings.github.username.title")).setValue(this.repository.user).onChange(i=>m(this,null,function*(){this.repository.user=i.trim()}))),new Z.Setting(e).setName(l.t("settings.github.repoName.title")).setDesc(l.t("settings.github.repoName.desc")).addText(n=>n.setPlaceholder(l.t("settings.github.repoName.placeholder")).setValue(this.repository.repo).onChange(i=>m(this,null,function*(){this.repository.repo=i.trim()}))),new Z.Setting(e).setName(l.t("settings.github.branch.title")).setDesc(l.t("settings.github.branch.desc")).addText(n=>n.setPlaceholder("main").setValue(this.repository.branch).onChange(i=>m(this,null,function*(){this.repository.branch=i.trim()}))),new Z.Setting(e).setName(l.t("settings.github.automaticallyMergePR")).addToggle(n=>n.setValue(this.repository.automaticallyMergePR).onChange(i=>m(this,null,function*(){this.repository.automaticallyMergePR=i}))),new Z.Setting(e).setClass("github-publisher-no-display").addButton(n=>n.setButtonText(l.t("settings.github.testConnection")).setClass("connect").onClick(()=>m(this,null,function*(){let i=yield this.plugin.reloadOctokit();this.repository.verifiedRepo=yield Ze(i,this.repository,null),this.plugin.settings.github.rateLimit=yield Ye(i.octokit,this.plugin.settings)}))),new Z.Setting(e).setName(l.t("settings.github.smartRepo.modals.shortcuts.title")).setDesc(l.t("settings.github.smartRepo.modals.shortcuts.desc")).addToggle(n=>n.setValue(this.repository.createShortcuts).onChange(i=>m(this,null,function*(){this.repository.createShortcuts=i}))),e.createEl("h3",{text:"GitHub Workflow"}),new Z.Setting(e).setName(l.t("settings.githubWorkflow.prRequest.title")).setDesc(l.t("settings.githubWorkflow.prRequest.desc")).addText(n=>n.setPlaceholder("[PUBLISHER] MERGE").setValue(this.repository.workflow.commitMessage).onChange(i=>m(this,null,function*(){i.trim().length===0&&(i="[PUBLISHER] MERGE",new Z.Notice(l.t("settings.githubWorkflow.prRequest.error"))),this.repository.workflow.commitMessage=i}))),new Z.Setting(e).setName(l.t("settings.githubWorkflow.githubAction.title")).setDesc(l.t("settings.githubWorkflow.githubAction.desc")).addText(n=>{n.setPlaceholder("ci").setValue(this.repository.workflow.name).onChange(i=>m(this,null,function*(){if(i.length>0){i=i.trim();let s=[".yml",".yaml"];s.some(r=>i.endsWith(r))||(i+=s[0])}this.repository.workflow.name=i}))}),e.createEl("h3",{text:l.t("settings.github.smartRepo.modals.otherConfig")}),new Z.Setting(e).setName(l.t("settings.plugin.shareKey.all.title")).setDesc(l.t("settings.plugin.shareKey.all.desc")).addToggle(n=>{var i,s;return n.setValue((s=(i=this.repository.shareAll)==null?void 0:i.enable)!=null?s:!1).onChange(r=>m(this,null,function*(){var a,o;this.repository.shareAll={enable:r,excludedFileName:(o=(a=this.plugin.settings.plugin.shareAll)==null?void 0:a.excludedFileName)!=null?o:"DRAFT"},this.onOpen()}))}),!this.repository.shareAll||!this.repository.shareAll.enable?new Z.Setting(e).setName(l.t("settings.plugin.shareKey.title")).setDesc(l.t("settings.plugin.shareKey.desc")).addText(n=>n.setPlaceholder("share").setValue(this.repository.shareKey).onChange(i=>m(this,null,function*(){this.repository.shareKey=i.trim(),yield this.plugin.saveSettings()}))):new Z.Setting(e).setName(l.t("settings.plugin.shareKey.excludedFileName.title")).addText(n=>{var i,s,r,a;return n.setPlaceholder("DRAFT").setValue((a=(r=(i=this.repository.shareAll)==null?void 0:i.excludedFileName)!=null?r:(s=this.plugin.settings.plugin.shareAll)==null?void 0:s.excludedFileName)!=null?a:"DRAFT").onChange(o=>m(this,null,function*(){this.repository.shareAll.excludedFileName=o.trim()}))}),this.plugin.settings.plugin.copyLink.enable&&(new Z.Setting(e).setName(l.t("settings.plugin.copyLink.baselink.title")).setDesc(l.t("settings.plugin.copyLink.baselink.desc")).addText(n=>n.setPlaceholder(this.plugin.settings.plugin.copyLink.links).setValue(this.repository.copyLink.links).onChange(i=>m(this,null,function*(){this.repository.copyLink.links=i.trim()}))),new Z.Setting(e).setName(l.t("settings.plugin.copyLink.linkPathRemover.title")).setDesc(l.t("settings.plugin.copyLink.linkPathRemover.desc")).addText(n=>{n.setPlaceholder("docs").setValue(this.repository.copyLink.removePart.join(", ")).onChange(i=>m(this,null,function*(){this.repository.copyLink.removePart=i.split(/[,\n]\s*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))})),new Z.Setting(e).addButton(n=>n.setButtonText(l.t("common.save")).onClick(()=>m(this,null,function*(){this.onSubmit(this.repository),this.close()})))}onClose(){let{contentEl:e}=this;e.empty(),this.onSubmit(this.repository)}};var re=W(require("obsidian"));function fn(t){try{return new RegExp(t),{error:null,isValid:!0}}catch(e){return{error:e,isValid:!1}}}var vr=class extends re.Modal{constructor(e,n,i,s){super(e);this.allOverrides=i,this.settings=n,this.onSubmit=s}forbiddenValue(e){if(fn(e).isValid){if(e.match(/[\\><:"|?*]/)&&!e.match(/^\/(.*)\/[gmisuvdy]*$/))return new re.Notice(l.t("settings.regexReplacing.forbiddenValue",{what:l.t("common.path.folder"),forbiddenChar:e.match(/[\\><:"|?*]/)[0]})),{value:"",isForbidden:!0}}else{let n=fn(e).error;return new re.Notice(l.t("settings.regexReplacing.invalidRegex",{e:n})),{value:"",isForbidden:!0}}return{value:e,isForbidden:!1}}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","regex","file-path-name"]),e.createEl("h2",{text:l.t("settings.embed.overrides.modal.title")}),e.createEl("p",{text:l.t("settings.regexReplacing.modal.desc")}),e.createEl("h3",{text:l.t("settings.regexReplacing.modal.keywords")});let n=e.createEl("ul",{cls:"keywords"});n.createEl("li",{text:l.t("settings.embed.forcePush.all")}),n.createEl("li",{text:l.t("settings.embed.forcePush.default")}),n.createEl("li",{text:l.t("settings.regexReplacing.modal.name")}),e.createEl("h3",{text:l.t("settings.regexReplacing.modal.force")}),e.createEl("p",{text:l.t("settings.embed.forcePush.info")}),this.settings.embed.overrideAttachments||(this.settings.embed.overrideAttachments=[]);for(let i of this.allOverrides){let s=new re.Setting(e).setClass("entry").addText(r=>{r.setPlaceholder(l.t("settings.embed.overrides.modal.path")).setValue(i.path).onChange(a=>{i.path=a,s.controlEl.setAttribute("value",a)})}).addText(r=>{r.setPlaceholder(l.t("settings.embed.overrides.modal.dest")).setValue(i.destination).onChange(a=>{i.destination=a,s.controlEl.setAttribute("replace",a)})}).addToggle(r=>{r.setTooltip(l.t("settings.embed.forcePush.title")).setValue(i.forcePush).onChange(a=>{i.forcePush=a})});s.controlEl.setAttribute("value",i.path),s.controlEl.setAttribute("replace",i.destination),s.addExtraButton(r=>{r.setIcon("trash").onClick(()=>{this.allOverrides.splice(this.allOverrides.indexOf(i),1),this.onOpen()})})}new re.Setting(e).addButton(i=>{i.setIcon("plus").onClick(()=>{this.allOverrides.push({path:"",destination:"",forcePush:!1}),this.onOpen()})}).addButton(i=>{i.setButtonText(l.t("common.save")).onClick(()=>{let s=[];this.allOverrides.forEach(r=>{let a=this.forbiddenValue(r.path),o=this.forbiddenValue(r.destination);if(s.push(a.isForbidden),s.push(o.isForbidden),a.isForbidden||o.isForbidden){r.path=a.value,r.destination=o.value;let u=e.querySelector(`[value="${Te(r.path)}"] input`),c=e.querySelector(`[replace="${Te(r.destination)}"] input`);u==null||u.classList.add("error"),c==null||c.classList.add("error")}}),s.includes(!0)||(this.onSubmit(this.allOverrides),this.close())})})}onClose(){let{contentEl:e}=this;e.empty()}},xr=class extends re.Modal{constructor(e,n,i,s){super(e);this.allRegex=i,this.settings=n,this.onSubmit=s}classValue(e){this.settings.upload.replacePath=e.filter(n=>n.type===xe.path),this.settings.upload.replaceTitle=e.filter(n=>n.type===xe.title)}forbiddenValue(e,n){let i=/\/(.*)(\\[dwstrnvfb0cxup])(.*)\//i,s=n===xe.path?l.t("common.path.folder"):l.t("common.path.file");s=s.toLowerCase();let r=!1;if(e=="/")new re.Notice(l.t("settings.regexReplacing.forbiddenValue",{what:s,forbiddenChar:e})),e="",r=!0;else if(fn(e).isValid)e.match(/[><:"|?*]|(\\\/)|(^\w+\/\w+)|(\\)/)&&n===xe.title&&!e.match(i)?(new re.Notice(l.t("settings.regexReplacing.forbiddenValue",{what:s,forbiddenChar:e.match(/[><:"|?*]|(\\\/)|(^\w+\/\w+)|(\\)/)[0]})),e="",r=!0):n===xe.path&&(e.match(/[\\><:"|?*]/)&&!e.match(/^\/(.*)\/[gmisuvdy]*$/)?(new re.Notice(l.t("settings.regexReplacing.forbiddenValue",{what:s,forbiddenChar:e.match(/[\\><:"|?*]/)[0]})),e="",r=!0):e.match(/(^\w+\/\w+)|(\\\/)/)&&!e.match(i)&&new re.Notice(l.t("settings.regexReplacing.warningPath")));else{let a=fn(e).error;new re.Notice(l.t("settings.regexReplacing.invalidRegex",{e:a})),r=!0}return{value:e,isForbidden:r}}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","regex","file-path-name"]),this.settings.upload.behavior===q.fixed?e.createEl("h2",{text:l.t("settings.regexReplacing.modal.title.only")}):e.createEl("h2",{text:l.t("settings.regexReplacing.modal.title.all")}),this.settings.upload.replacePath?this.settings.upload.replaceTitle||(this.settings.upload.replaceTitle=[]):this.settings.upload.replacePath=[],this.settings.upload.replacePath.forEach(n=>{n.type||(n.type=xe.path)}),this.settings.upload.replaceTitle.forEach(n=>{n.type||(n.type=xe.title)});for(let n of this.allRegex){let i=new re.Setting(e).setClass("entry").addText(s=>{s.setPlaceholder(l.t("regex.entry")).setValue(n.regex).onChange(r=>{n.regex=r,i.controlEl.setAttribute("value",r)})}).addText(s=>{s.setPlaceholder(l.t("regex.replace")).setValue(n.replacement).onChange(r=>{n.replacement=r,i.controlEl.setAttribute("replace",r)})});i.controlEl.setAttribute("value",n.regex),i.controlEl.setAttribute("replace",n.replacement),this.settings.upload.behavior!==q.fixed?i.addDropdown(s=>{s.addOption("path",l.t("common.path.folder")).addOption("title",l.t("common.path.file")).setValue(n.type).onChange(r=>{n.type=r})}):i.addButton(s=>{s.buttonEl.classList.add("disabled"),s.setButtonText(l.t("common.path.file"))}),i.addExtraButton(s=>{s.setIcon("trash").onClick(()=>{this.allRegex.splice(this.allRegex.indexOf(n),1),this.onOpen()})})}new re.Setting(e).addButton(n=>{n.setIcon("plus").onClick(()=>{this.allRegex.push({regex:"",replacement:"",type:xe.title}),this.onOpen()})}).addButton(n=>{n.setButtonText(l.t("common.save")).onClick(()=>{let i=[];this.allRegex.forEach(s=>{s.regex||(s.regex=""),s.replacement||(s.replacement="");let r=this.forbiddenValue(s.regex,s.type);s.regex.length===0&&(new re.Notice(l.t("settings.regexReplacing.emptyRegex")),r.isForbidden=!0,r.value="");let a=this.forbiddenValue(s.replacement,s.type);if(i.push(r.isForbidden),i.push(a.isForbidden),r.isForbidden||a.isForbidden){s.regex=r.value,s.replacement=a.value;let o=e.querySelector(`[value="${Te(s.regex)}"] input`),u=e.querySelector(`[replace="${Te(s.replacement)}"] input`);o==null||o.classList.add("error"),u==null||u.classList.add("error")}}),i.includes(!0)||(this.onSubmit(this.allRegex),this.close())})})}onClose(){let{contentEl:e}=this;e.empty()}},kr=class extends re.Modal{constructor(e,n,i){super(e);this.settings=n,this.onSubmit=i}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","regex","on-contents"]),e.createEl("p",{text:l.t("settings.regexReplacing.modal.title.text")}).createEl("p",{text:l.t("settings.regexReplacing.modal.desc")}).createEl("p",{text:l.t("settings.regexReplacing.empty")});for(let n of this.settings.conversion.censorText){let i=n.after?"arrow-down":"arrow-up",s=(n==null?void 0:n.inCodeBlocks)?"code":"scan",r=n.after?l.t("common.after").toLowerCase():l.t("common.before").toLowerCase(),a=l.t("settings.regexReplacing.momentReplaceRegex",{moment:r}),o=l.t("settings.regexReplacing.inCodeBlocks.runIn");n.inCodeBlocks||(o=l.t("settings.regexReplacing.inCodeBlocks.runOut"));let u=new re.Setting(e).setClass("entry").addText(c=>{c.setPlaceholder(l.t("regex.entry")).setValue(n.entry).onChange(d=>m(this,null,function*(){n.entry=d,u.controlEl.setAttribute("value",d)}))}).addText(c=>{c.setPlaceholder(l.t("regex.replace")).setValue(n.replace).onChange(d=>m(this,null,function*(){n.replace=d}))}).addExtraButton(c=>{c.setIcon("trash").setTooltip(l.t("common.delete",{things:"Regex"})).onClick(()=>m(this,null,function*(){this.settings.conversion.censorText.splice(this.settings.conversion.censorText.indexOf(n),1),this.onOpen()}))}).addExtraButton(c=>{c.setTooltip(a).setIcon(i).onClick(()=>m(this,null,function*(){n.after=!n.after,this.onOpen()}))}).addExtraButton(c=>{c.setTooltip(o).setIcon(s).onClick(()=>m(this,null,function*(){n.inCodeBlocks=!n.inCodeBlocks,this.onOpen()}))});u.controlEl.setAttribute("value",n.entry)}new re.Setting(e).addButton(n=>{n.setIcon("plus").setTooltip(l.t("common.add",{things:"Regex"})).onClick(()=>m(this,null,function*(){let i={entry:"",replace:"",flags:"",after:!1};this.settings.conversion.censorText.push(i),this.onOpen()}))}).addButton(n=>{n.setButtonText(l.t("common.save")).onClick(()=>{let i=[];for(let s of this.settings.conversion.censorText)if(!fn(s.entry).isValid){new re.Notice(l.t("settings.regexReplacing.invalidRegex",{e:fn(s.entry).error}));let r=e.querySelector(`[value="${Te(s.entry)}"] input`);r==null||r.classList.add("error"),i.push(!1)}i.includes(!1)||(this.onSubmit(this.settings),this.close())})})}onClose(){let{contentEl:e}=this;e.empty()}};var Lt=W(require("obsidian"));var Sr=class extends Lt.Modal{constructor(e,n,i){super(e);this.plugin=n,this.token=i,this.tokenPath=""}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","token-path"]);let n=Jt(this.plugin,dt),i=e.createEl("p",void 0,r=>{r.appendText(l.t("settings.github.ghToken.button.description")),r.createDiv({text:l.t("settings.github.ghToken.button.default")}).createEl("code",{text:` ${n}`},o=>{o.classList.add("cm-inline-code"),o.style.fontFamily="var(--font-monospace)"})});i.createEl("br"),i.createEl("p",{text:l.t("settings.github.ghToken.button.variables")}),i.createEl("ul",void 0,r=>{r.createEl("li",void 0,a=>{a.createEl("code",{text:"%configDir%"},o=>{o.classList.add("cm-inline-code"),o.style.fontFamily="var(--font-monospace)"}),a.createEl("span",void 0,o=>{o.appendText(`${l.t("settings.github.ghToken.button.configDir")} (`),o.createEl("code",{text:this.app.vault.configDir},u=>{u.classList.add("cm-inline-code"),u.style.fontFamily="var(--font-monospace)"}),o.appendText(")")})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"%pluginID%"},o=>{o.classList.add("cm-inline-code"),o.style.fontFamily="var(--font-monospace)"}),a.createEl("span",void 0,o=>{o.appendText(`${l.t("settings.github.ghToken.button.pluginID")} (`),o.createEl("code",{text:this.plugin.manifest.id},u=>{u.classList.add("cm-inline-code"),u.style.fontFamily="var(--font-monospace)"}),o.appendText(")")})})});let s=new Lt.Setting(e).setClass("display-none").setClass("max-width").addText(r=>{var o;let a=(o=this.plugin.settings.github.tokenPath)!=null?o:n;r.setPlaceholder(n).setValue(a).onChange(u=>m(this,null,function*(){let c=u.trim();c.length===0&&(c=n),this.plugin.settings.github.tokenPath=c,this.tokenPath=c}))});new Lt.Setting(e).addButton(r=>{r.setButtonText(l.t("common.save")).onClick(()=>m(this,null,function*(){try{yield this.plugin.saveSettings(),yield Bt(this.plugin,this.token),this.close()}catch(a){s.controlEl.querySelector("input").style.border="1px solid red",new Lt.Notice(l.t("error.reading-token-file")),this.tokenPath="error",R({settings:this.plugin.settings,e:!0},a)}}))})}onClose(){return m(this,null,function*(){let{contentEl:e}=this;e.empty(),this.tokenPath==="error"&&(this.plugin.settings.github.tokenPath=dt,yield this.plugin.saveSettings(),yield Bt(this.plugin,this.token))})}};var Tr=W(require("obsidian"));function pn(t){for(let[e,n]of Object.entries(t))e!="components"&&n.show()}function Qn(t){for(let[e,n]of Object.entries(t))e!="components"&&n.hide()}function uc(t,e,n,i){let s=t.upload;s.behavior===q.yaml?(pn(e),pn(n),pn(i)):(Qn(e),Qn(n),s.behavior===q.obsidian?pn(i):Qn(i))}function Ar(t,e,n,i="defaultName",s){return m(this,null,function*(){let r=n.settings.upload,a=i==="rootFolder"?l.t("common.rootFolder"):l.t("common.defaultName");t.length===0&&r.defaultName&&(r.autoclean.enable&&new Tr.Notice(l.t("error.autoClean",{what:a})),r.autoclean.enable=!1,yield n.saveSettings(),e.setDisabled(!0),e.components[0].toggleEl.classList.remove("is-enabled"),s.renderSettingsPage(ue.upload)),t.length===0&&r.behavior!==q.yaml&&(r.autoclean.enable&&new Tr.Notice(l.t("error.autoClean",{what:l.t("common.defaultName")})),r.autoclean.enable=!1,e.setDisabled(!0),e.components[0].toggleEl.classList.remove("is-enabled"),s.renderSettingsPage(ue.upload)),e.setDisabled(!1),r.autoclean.enable&&e.components[0].toggleEl.classList.add("is-enabled")})}function Pr(t,e,n,i,s){return m(this,null,function*(){let r=s.settings.upload;i===q.yaml?(pn(t),pn(e)):(r.defaultName.length>0&&(n.setDisabled(!1),r.autoclean.enable&&n.components[0].toggleEl.classList.add("is-enabled")),Qn(t),Qn(e))})}function lc(t,e,n){let i=n.settings.upload;t?(e.setDisabled(!0),e.components[0].toggleEl.classList.remove("is-enabled"),i.autoclean.enable=!1,n.saveSettings().then()):(e.setDisabled(!1),i.autoclean.enable&&e.components[0].toggleEl.classList.add("is-enabled"))}var Rr=class extends N.PluginSettingTab{constructor(e,n,i){super(e,n);this.plugin=n,this.branchName=i,this.settings=n.settings}display(){var a;let{containerEl:e}=this;e.empty(),e.addClass("github-publisher");let n=ue.github,i=(a=this.settings.tabsID)!=null?a:n;this.settings.plugin.saveTabId!==void 0&&!this.settings.plugin.saveTabId&&(this.settings.tabsID=n,i=n,this.plugin.saveSettings());let s={"github-configuration":{name:l.t("settings.github.title"),icon:"cloud"},"upload-configuration":{name:l.t("settings.upload.title"),icon:"upload"},"text-conversion":{name:l.t("settings.conversion.title"),icon:"file-text"},"embed-configuration":{name:l.t("settings.embed.title"),icon:"link"},"plugin-settings":{name:l.t("settings.plugin.title"),icon:"gear"},help:{name:l.t("settings.help.title"),icon:"info"}};new N.Setting(e).setClass("import-export").addButton(o=>{o.setButtonText(l.t("modals.export.title")).onClick(()=>{new wr(this.app,this.plugin).open()})}).addButton(o=>{o.setButtonText(l.t("modals.import.title")).onClick(()=>{new Fr(this.app,this.plugin,this.settingsPage,this).open()})}).addButton(o=>{o.setButtonText(l.t("modals.import.presets.title")).setTooltip(l.t("modals.import.presets.desc")).onClick(()=>m(this,null,function*(){let u=yield this.plugin.reloadOctokit(),c=yield ac(u.octokit,this.plugin);new Er(this.app,this.plugin,c,u.octokit,this).open()}))});let r=e.createEl("nav",{cls:"settings-tab-bar"});for(let[o,u]of Object.entries(s)){let c=r.createEl("div",{cls:"settings-tab"}),d=c.createEl("div",{cls:"settings-tab-icon"});(0,N.setIcon)(d,u.icon),c.createEl("div",{cls:"settings-tab-name",text:u.name}),o===i&&c.addClass("settings-tab-active"),c.addEventListener("click",()=>m(this,null,function*(){for(let f of r.children)f.removeClass("settings-tab-active");c.addClass("settings-tab-active"),this.renderSettingsPage(o)}))}this.settingsPage=e.createEl("div",{cls:"settings-tab-page"}),this.renderSettingsPage(i)}renderSettingsPage(e){return m(this,null,function*(){switch((this.settings.plugin.saveTabId||this.settings.plugin.saveTabId===void 0)&&(this.settings.tabsID=e,yield this.plugin.saveSettings()),this.settingsPage.empty(),e){case"github-configuration":this.renderGithubConfiguration();break;case"upload-configuration":this.renderUploadConfiguration();break;case"text-conversion":this.renderTextConversion();break;case"embed-configuration":this.renderEmbedConfiguration();break;case"plugin-settings":this.renderPluginSettings();break;case"help":this.renderHelp();break}})}renderGithubConfiguration(){let e=this.settings.github;new N.Setting(this.settingsPage).setName(l.t("settings.github.apiType.title")).setDesc(l.t("settings.github.apiType.desc")).addDropdown(s=>{s.addOption(Pe.free,l.t("settings.github.apiType.dropdown.free")).addOption(Pe.entreprise,l.t("settings.github.apiType.dropdown.enterprise")).setValue(e.api.tiersForApi).onChange(r=>m(this,null,function*(){e.api.tiersForApi=r,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.github)}))}),e.api.tiersForApi===Pe.entreprise&&new N.Setting(this.settingsPage).setName(l.t("settings.github.apiType.hostname.title")).setDesc(l.t("settings.github.apiType.hostname.desc")).addText(s=>s.setPlaceholder("https://github.mycompany.com").setValue(e.api.hostname).onChange(r=>m(this,null,function*(){e.api.hostname=r.trim(),yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.github.username.title")).setDesc(l.t("settings.github.username.desc")).addText(s=>s.setPlaceholder(l.t("settings.github.username.title")).setValue(e.user).onChange(r=>m(this,null,function*(){e.user=r.trim(),yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.github.repoName.title")).setDesc(l.t("settings.github.repoName.desc")).addText(s=>s.setPlaceholder(l.t("settings.github.repoName.placeholder")).setValue(e.repo).onChange(r=>m(this,null,function*(){e.repo=r.trim(),yield this.plugin.saveSettings()})));let n=document.createDocumentFragment();n.createEl("span",void 0,s=>{s.innerText=l.t("settings.github.ghToken.desc"),s.createEl("a",void 0,r=>{r.innerText=`${l.t("common.here")}.`,r.href="https://github.com/settings/tokens/new?scopes=repo,workflow"})});let i=new N.Setting(this.settingsPage).setName(l.t("common.ghToken")).setDesc(n).addText(s=>m(this,null,function*(){let r=yield this.plugin.loadToken();s.setPlaceholder("ghp_15457498545647987987112184").setValue(r).onChange(a=>m(this,null,function*(){a.trim().length===0?(i.controlEl.addClass("error"),new N.Notice(l.t("settings.github.ghToken.error"))):(i.controlEl.removeClass("error"),yield Bt(this.plugin,a.trim())),yield this.plugin.saveSettings()}))})).addExtraButton(s=>{s.setIcon("edit").setTooltip(l.t("settings.github.ghToken.button.tooltip")).onClick(()=>m(this,null,function*(){let r=yield this.plugin.loadToken();new Sr(this.app,this.plugin,r).open(),yield this.plugin.saveSettings()}))});new N.Setting(this.settingsPage).setName(l.t("settings.github.branch.title")).setDesc(l.t("settings.github.branch.desc")).addText(s=>s.setPlaceholder("main").setValue(e.branch).onChange(r=>m(this,null,function*(){e.branch=r.trim(),yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.github.automaticallyMergePR")).addToggle(s=>s.setValue(e.automaticallyMergePR).onChange(r=>m(this,null,function*(){e.automaticallyMergePR=r,yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setClass("no-display").addButton(s=>s.setButtonText(l.t("settings.github.testConnection")).setClass("connect-button").onClick(()=>m(this,null,function*(){let r=yield this.plugin.reloadOctokit();this.settings.github.verifiedRepo=yield Ze(r,null,null),this.settings.github.rateLimit=yield Ye(r.octokit,this.settings),yield this.plugin.saveSettings()}))).addButton(s=>s.setButtonText(l.t("settings.github.smartRepo.button")).onClick(()=>m(this,null,function*(){var a,o;let r=this.copy((o=(a=this.settings.github)==null?void 0:a.otherRepo)!=null?o:[]);new Cr(this.app,this.settings,this.branchName,this.plugin,r,u=>m(this,null,function*(){this.settings.github.otherRepo=u,yield this.plugin.saveSettings(),this.plugin.reloadCommands()})).open()}))),this.settingsPage.createEl("h3",{text:"Github Workflow"}),new N.Setting(this.settingsPage).setName(l.t("settings.githubWorkflow.prRequest.title")).setDesc(l.t("settings.githubWorkflow.prRequest.desc")).addText(s=>s.setPlaceholder("[PUBLISHER] MERGE").setValue(e.workflow.commitMessage).onChange(r=>m(this,null,function*(){r.trim().length===0&&(r="[PUBLISHER] MERGE",new N.Notice(l.t("settings.githubWorkflow.prRequest.error"))),e.workflow.commitMessage=r,yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.githubWorkflow.githubAction.title")).setDesc(l.t("settings.githubWorkflow.githubAction.desc")).addText(s=>{s.setPlaceholder("ci").setValue(e.workflow.name).onChange(r=>m(this,null,function*(){if(r.length>0){r=r.trim();let a=[".yml",".yaml"];a.some(o=>r.endsWith(o))||(r+=a[0])}e.workflow.name=r,yield this.plugin.saveSettings()}))})}renderUploadConfiguration(){let e=this.settings.upload;new N.Setting(this.settingsPage).setName(l.t("settings.upload.folderBehavior.title")).setDesc(l.t("settings.upload.folderBehavior.desc")).addDropdown(d=>{d.addOptions({fixed:l.t("settings.upload.folderBehavior.fixedFolder"),yaml:l.t("settings.upload.folderBehavior.yaml"),obsidian:l.t("settings.upload.folderBehavior.obsidianPath")}).setValue(e.behavior).onChange(f=>m(this,null,function*(){e.behavior=f,yield Pr(i,s,c,f,this.plugin),yield this.plugin.saveSettings(),this.renderSettingsPage(ue.upload)}))});let n=e.behavior===q.yaml?{desc:l.t("settings.upload.defaultFolder.desc"),title:l.t("settings.upload.defaultFolder.title")}:{desc:l.t("settings.upload.rootFolder.other"),title:l.t("settings.upload.rootFolder.title")};new N.Setting(this.settingsPage).setName(n.title).setDesc(n.desc).addText(d=>{d.setPlaceholder(l.t("settings.upload.defaultFolder.placeholder")).setValue(e.defaultName).onChange(f=>m(this,null,function*(){e.defaultName=f.replace(/\/$/,""),yield Ar(f,c,this.plugin,"defaultName",this),yield this.plugin.saveSettings()}))});let i=new N.Setting(this.settingsPage).setName(l.t("settings.upload.frontmatterKey.title")).setDesc(l.t("settings.upload.frontmatterKey.desc")).addText(d=>{d.setPlaceholder(l.t("settings.upload.frontmatterKey.placeholder")).setValue(e.yamlFolderKey).onChange(f=>m(this,null,function*(){e.yamlFolderKey=f.trim(),yield this.plugin.saveSettings()}))}),s=new N.Setting(this.settingsPage).setName(l.t("settings.upload.rootFolder.title")).setDesc(l.t("settings.upload.rootFolder.desc")).addText(d=>{d.setPlaceholder("docs").setValue(e.rootFolder).onChange(f=>m(this,null,function*(){e.rootFolder=f.replace(/\/$/,""),yield Ar(f,c,this.plugin,"rootFolder",this),yield this.plugin.saveSettings()}))}),r=new N.Setting(this.settingsPage).setName(l.t("settings.upload.useFrontmatterTitle.title")).setDesc(l.t("settings.upload.useFrontmatterTitle.desc")).setClass("title").addToggle(d=>{d.setValue(e.frontmatterTitle.enable).onChange(f=>m(this,null,function*(){e.frontmatterTitle.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.upload)}))});e.frontmatterTitle.enable&&r.addText(d=>{d.setPlaceholder("title").setValue(e.frontmatterTitle.key).onChange(f=>m(this,null,function*(){e.frontmatterTitle.key=f.trim(),yield this.plugin.saveSettings()}))});let a=e.behavior===q.fixed?l.t("settings.upload.regexFilePathTitle.title.titleOnly"):l.t("settings.upload.regexFilePathTitle.title.FolderPathTitle");new N.Setting(this.settingsPage).setName(a).setDesc(l.t("settings.upload.regexFilePathTitle.desc")).addButton(d=>{d.setIcon("pencil").onClick(()=>m(this,null,function*(){let f=e.replaceTitle;e.behavior!==q.fixed&&(f=f.concat(e.replacePath)),new xr(this.app,this.settings,this.copy(f),p=>m(this,null,function*(){e.replacePath=p.filter(F=>F.type==="path"),e.replaceTitle=p.filter(F=>F.type==="title"),yield this.plugin.saveSettings()})).open()}))});let o=new N.Setting(this.settingsPage).setName(l.t("settings.conversion.links.folderNote.title")).setDesc(l.t("settings.conversion.links.folderNote.desc")).addToggle(d=>{d.setValue(e.folderNote.enable).onChange(f=>m(this,null,function*(){e.folderNote.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.upload)}))});e.folderNote.enable&&(o.addText(d=>{d.setPlaceholder("folderNote").setValue(e.folderNote.rename).onChange(f=>m(this,null,function*(){e.folderNote.rename=f,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.upload.folderNote.addTitle.title")).addToggle(d=>{d.setValue(e.folderNote.addTitle.enable).onChange(f=>m(this,null,function*(){e.folderNote.addTitle.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.upload)}))}),e.folderNote.addTitle.enable&&new N.Setting(this.settingsPage).setName(l.t("settings.upload.folderNote.addTitle.key")).addText(d=>{d.setPlaceholder("title").setValue(e.folderNote.addTitle.key).onChange(f=>m(this,null,function*(){e.folderNote.addTitle.key=f,yield this.plugin.saveSettings()}))})),uc(this.settings,i,s,o),this.app.plugins.manifests["metadata-extractor"]&&new N.Setting(this.settingsPage).setName(l.t("settings.githubWorkflow.useMetadataExtractor.title")).setDesc(l.t("settings.githubWorkflow.useMetadataExtractor.desc")).addText(d=>{d.setPlaceholder("docs/_assets/metadata").setValue(e.metadataExtractorPath).onChange(f=>m(this,null,function*(){e.metadataExtractorPath=f.trim(),yield this.plugin.saveSettings()}))});let u=e.behavior===q.yaml&&e.rootFolder.length===0||e.defaultName.length===0,c=new N.Setting(this.settingsPage).setName(l.t("settings.githubWorkflow.autoCleanUp.title")).setDesc(l.t("settings.githubWorkflow.autoCleanUp.desc")).setDisabled(u).addToggle(d=>{d.setValue(e.autoclean.enable).onChange(f=>m(this,null,function*(){e.autoclean.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.upload),this.plugin.cleanOldCommands(),yield this.plugin.chargeAllCommands(null,this.plugin)}))});e.autoclean.enable&&!u&&new N.Setting(this.settingsPage).setName(l.t("settings.githubWorkflow.excludedFiles.title")).setDesc(l.t("settings.githubWorkflow.excludedFiles.desc")).addTextArea(d=>{d.setPlaceholder("docs/assets/js, docs/assets/logo, /\\.js$/").setValue(e.autoclean.excluded.join(", ")).onChange(f=>m(this,null,function*(){e.autoclean.excluded=f.split(/[,\n]\W*/).map(p=>p.trim()).filter(p=>p.length>0),yield this.plugin.saveSettings()}))}),lc(u,c,this.plugin),Pr(i,s,c,e.behavior,this.plugin)}renderTextConversion(){var i,s;let e=this.settings.conversion;this.settingsPage.createEl("p",{text:l.t("settings.conversion.desc")}),this.settingsPage.createEl("h5",{text:l.t("settings.conversion.links.title")}),this.settingsPage.createEl("p",{text:l.t("settings.conversion.links.desc")});let n=((i=this.settings.plugin.shareAll)==null?void 0:i.enable)?` ${l.t("settings.conversion.links.internals.shareAll")}`:"";new N.Setting(this.settingsPage).setName(l.t("settings.conversion.links.internals.title")).setDesc(l.t("settings.conversion.links.internals.desc")+n).addToggle(r=>{r.setValue(e.links.internal).onChange(a=>m(this,null,function*(){var o;e.links.internal=a,((o=this.settings.plugin.shareAll)==null?void 0:o.enable)&&(e.links.unshared=!0),yield this.plugin.saveSettings(),this.renderSettingsPage("text-conversion")}))}),e.links.internal&&!((s=this.settings.plugin.shareAll)==null?void 0:s.enable)&&new N.Setting(this.settingsPage).setName(l.t("settings.conversion.links.nonShared.title")).setDesc(l.t("settings.conversion.links.nonShared.desc")).addToggle(r=>{r.setValue(e.links.unshared).onChange(a=>m(this,null,function*(){e.links.unshared=a,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.conversion.links.wikilinks.title")).setDesc(l.t("settings.conversion.links.wikilinks.desc")).addToggle(r=>{r.setValue(e.links.wiki).onChange(a=>m(this,null,function*(){e.links.wiki=a,yield this.plugin.saveSettings(),this.renderSettingsPage("text-conversion")}))}),(e.links.wiki||e.links.internal)&&new N.Setting(this.settingsPage).setName(l.t("settings.conversion.links.slugify.title")).setDesc(l.t("settings.conversion.links.slugify.desc")).addToggle(r=>{r.setValue(e.links.slugify).onChange(a=>m(this,null,function*(){e.links.slugify=a,yield this.plugin.saveSettings()}))}),this.settingsPage.createEl("h5",{text:l.t("settings.conversion.sectionTitle")}),new N.Setting(this.settingsPage).setName(l.t("settings.conversion.hardBreak.title")).setDesc(l.t("settings.conversion.hardBreak.desc")).addToggle(r=>{r.setValue(e.hardbreak).onChange(a=>m(this,null,function*(){e.hardbreak=a,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.conversion.dataview.title")).setDesc(l.t("settings.conversion.dataview.desc")).addToggle(r=>{r.setValue(e.dataview).onChange(a=>m(this,null,function*(){e.dataview=a,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.regexReplacing.modal.title.text")).setDesc(l.t("settings.regexReplacing.modal.desc")).addButton(r=>{r.setIcon("pencil").onClick(()=>m(this,null,function*(){new kr(this.app,this.copy(this.settings),a=>m(this,null,function*(){this.settings.conversion.censorText=a.conversion.censorText,yield this.plugin.saveSettings()})).open()}))}),this.settingsPage.createEl("h5",{text:"Tags"}),new N.Setting(this.settingsPage).setName(l.t("settings.conversion.tags.inlineTags.title")).setDesc(l.t("settings.conversion.tags.inlineTags.desc")).addToggle(r=>{r.setValue(e.tags.inline).onChange(a=>m(this,null,function*(){e.tags.inline=a,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.conversion.tags.title")).setDesc(l.t("settings.conversion.tags.desc")).addTextArea(r=>{r.inputEl.addClass("mid-height"),r.setPlaceholder("field_name").setValue(e.tags.fields.join(",")).onChange(a=>m(this,null,function*(){e.tags.fields=a.split(/[,\n]\W*/).map(o=>o.trim()).filter(o=>o.length>0),yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.conversion.tags.exclude.title")).setDesc(l.t("settings.conversion.tags.exclude.desc")).addTextArea(r=>{r.setPlaceholder(l.t("settings.conversion.tags.exclude.placeholder")).setValue(e.tags.exclude.join(",")).onChange(a=>m(this,null,function*(){e.tags.exclude=a.split(/[,\n]\W*/).map(o=>o.trim()).filter(o=>o.length>0),yield this.plugin.saveSettings()}))})}renderEmbedConfiguration(){return m(this,null,function*(){this.settingsPage.empty(),this.settingsPage.createEl("h5",{text:l.t("settings.embed.attachment"),cls:"center"});let e=this.settings.embed;new N.Setting(this.settingsPage).setName(l.t("settings.embed.transferImage.title")).addToggle(n=>{n.setValue(e.attachments).onChange(i=>m(this,null,function*(){e.attachments=i,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.embed)}))}),e.attachments&&(new N.Setting(this.settingsPage).setName(l.t("settings.embed.imagePath.title")).setDesc(l.t("settings.embed.imagePath.desc")).addToggle(n=>{var i;n.setValue((i=e.useObsidianFolder)!=null?i:!1).onChange(s=>m(this,null,function*(){e.useObsidianFolder=s,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.embed)}))}),e.useObsidianFolder||new N.Setting(this.settingsPage).setName(l.t("settings.embed.defaultImageFolder.title")).setDesc(l.t("settings.embed.defaultImageFolder.desc")).addText(n=>{n.setPlaceholder("docs/images").setValue(e.folder).onChange(i=>m(this,null,function*(){e.folder=i.replace(/\/$/,""),yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.embed.overrides.modal.title")).setDesc(l.t("settings.embed.overrides.desc")).addButton(n=>{n.setIcon("pencil").onClick(()=>m(this,null,function*(){new vr(this.app,this.settings,this.copy(e.overrideAttachments),i=>m(this,null,function*(){e.overrideAttachments=i,yield this.plugin.saveSettings()})).open()}))})),new N.Setting(this.settingsPage).setName(l.t("settings.embed.transferMetaFile.title")).setDesc(l.t("settings.embed.transferMetaFile.desc")).addTextArea(n=>{n.setPlaceholder("banner").setValue(e.keySendFile.join(", ")).onChange(i=>m(this,null,function*(){e.keySendFile=i.split(/[,\n]\W*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))}),this.settingsPage.createEl("h5",{text:l.t("settings.embed.notes"),cls:"center"}),new N.Setting(this.settingsPage).setName(l.t("settings.embed.transferNotes.title")).setDesc(l.t("settings.embed.transferNotes.desc")).addToggle(n=>{n.setValue(e.notes).onChange(i=>m(this,null,function*(){e.notes=i,yield this.plugin.saveSettings(),yield this.renderEmbedConfiguration()}))}),e.notes&&(new N.Setting(this.settingsPage).setName(l.t("settings.embed.links.title")).setDesc(l.t("settings.embed.links.desc")).addDropdown(n=>{var i;n.addOption("keep",l.t("settings.embed.links.dp.keep")).addOption("remove",l.t("settings.embed.links.dp.remove")).addOption("links",l.t("settings.embed.links.dp.links")).addOption("bake",l.t("settings.embed.links.dp.bake")).setValue((i=e.convertEmbedToLinks)!=null?i:"keep").onChange(s=>m(this,null,function*(){e.convertEmbedToLinks=s,yield this.plugin.saveSettings(),yield this.renderEmbedConfiguration()}))}),e.convertEmbedToLinks==="links"?new N.Setting(this.settingsPage).setName(l.t("settings.embed.char.title")).setDesc(l.t("settings.embed.char.desc")).addText(n=>{var i;n.setPlaceholder("->").setValue((i=e.charConvert)!=null?i:"->").onChange(s=>m(this,null,function*(){e.charConvert=s,yield this.plugin.saveSettings()}))}):e.convertEmbedToLinks==="bake"&&(e.bake||(e.bake={textBefore:"",textAfter:""},yield this.plugin.saveSettings()),yield this.plugin.saveSettings(),this.settingsPage.createEl("h5",{text:l.t("settings.embed.bake.title"),cls:"border-bottom"}),this.settingsPage.createEl("p",{text:l.t("settings.embed.bake.text")}),this.settingsPage.createEl("p",void 0,n=>{n.createEl("span",{text:l.t("settings.embed.bake.variable.desc"),cls:["bake"]}).createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"{{title}}"}),s.createEl("span",{text:l.t("settings.embed.bake.variable.title")})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"{{url}}"}),s.createEl("span",{text:l.t("settings.embed.bake.variable.url")})})})}),this.settingsPage.createEl("p",{text:`\u26A0\uFE0F ${l.t("settings.embed.bake.warning")}`,cls:["warning","embed"]}),new N.Setting(this.settingsPage).setName(l.t("settings.embed.bake.textBefore.title")).addTextArea(n=>{var i,s;n.setValue((s=(i=e.bake)==null?void 0:i.textBefore)!=null?s:"").onChange(r=>m(this,null,function*(){e.bake.textBefore=r,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.embed.bake.textAfter.title")).addTextArea(n=>{var i,s;n.setValue((s=(i=e.bake)==null?void 0:i.textAfter)!=null?s:"").onChange(r=>m(this,null,function*(){e.bake.textAfter=r,yield this.plugin.saveSettings()}))})))})}renderPluginSettings(){let e=this.settings.plugin;this.settingsPage.createEl("h3",{text:l.t("settings.plugin.head.share")}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.shareKey.all.title")).setDesc(l.t("settings.plugin.shareKey.all.desc")).addToggle(n=>{var i,s;return n.setValue((s=(i=e.shareAll)==null?void 0:i.enable)!=null?s:!1).onChange(r=>m(this,null,function*(){var a,o;e.shareAll={enable:r,excludedFileName:(o=(a=e.shareAll)==null?void 0:a.excludedFileName)!=null?o:"DRAFT"},r&&(this.settings.conversion.links.internal=!0),yield this.plugin.saveSettings(),this.renderSettingsPage(ue.plugin)}))}),!e.shareAll||!e.shareAll.enable?new N.Setting(this.settingsPage).setName(l.t("settings.plugin.shareKey.title")).setDesc(l.t("settings.plugin.shareKey.desc")).addText(n=>n.setPlaceholder("share").setValue(e.shareKey).onChange(i=>m(this,null,function*(){e.shareKey=i.trim(),yield this.plugin.saveSettings()}))):new N.Setting(this.settingsPage).setName(l.t("settings.plugin.shareKey.excludedFileName.title")).addText(n=>{var i,s;return n.setPlaceholder("DRAFT").setValue((s=(i=e.shareAll)==null?void 0:i.excludedFileName)!=null?s:"DRAFT").onChange(r=>m(this,null,function*(){e.shareAll.excludedFileName=r.trim(),yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.excludedFolder.title")).setDesc(l.t("settings.plugin.excludedFolder.desc")).addTextArea(n=>n.setPlaceholder("_assets, Archive, /^_(.*)/gi").setValue(e.excludedFolder.join(", ")).onChange(i=>m(this,null,function*(){e.excludedFolder=i.split(/[,\n]\W*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))),this.settingsPage.createEl("h3",{text:l.t("settings.plugin.head.menu")}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.fileMenu.title")).setDesc(l.t("settings.plugin.fileMenu.desc")).addToggle(n=>n.setValue(e.fileMenu).onChange(i=>m(this,null,function*(){e.fileMenu=i,yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.editorMenu.title")).setDesc(l.t("settings.plugin.editorMenu.desc")).addToggle(n=>n.setValue(e.editorMenu).onChange(i=>m(this,null,function*(){e.editorMenu=i,yield this.plugin.saveSettings()}))),this.settingsPage.createEl("h3",{text:l.t("settings.plugin.head.copyLinks")}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.copyLink.title")).setDesc(l.t("settings.plugin.copyLink.desc")).addToggle(n=>n.setValue(e.copyLink.enable).onChange(i=>m(this,null,function*(){e.copyLink.enable=i,yield this.plugin.saveSettings(),this.renderSettingsPage(ue.plugin)}))),e.copyLink.enable&&(new N.Setting(this.settingsPage).setName(l.t("settings.plugin.copyLink.baselink.title")).setDesc(l.t("settings.plugin.copyLink.baselink.desc")).addText(n=>{n.setPlaceholder("my_blog.com").setValue(e.copyLink.links).onChange(i=>m(this,null,function*(){e.copyLink.links=i,yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.copyLink.linkPathRemover.title")).setDesc(l.t("settings.plugin.copyLink.linkPathRemover.desc")).addText(n=>{n.setPlaceholder("docs").setValue(e.copyLink.removePart.join(", ")).onChange(i=>m(this,null,function*(){e.copyLink.removePart=i.split(/[,\n]\s*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.copyLink.command.desc")).addToggle(n=>n.setValue(e.copyLink.addCmd).onChange(i=>m(this,null,function*(){e.copyLink.addCmd=i,yield this.plugin.saveSettings()})))),this.settingsPage.createEl("h3",{text:l.t("settings.plugin.head.other")}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.embedEditRepo.title")).setDesc(l.t("settings.plugin.embedEditRepo.desc")).addToggle(n=>n.setValue(e.displayModalRepoEditing).onChange(i=>m(this,null,function*(){e.displayModalRepoEditing=i,yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.saveTab.title")).setDesc(l.t("settings.plugin.saveTab.desc")).addToggle(n=>{var i;return n.setValue((i=e.saveTabId)!=null?i:!0).onChange(s=>m(this,null,function*(){e.saveTabId=s,this.settings.tabsID=s?ue.plugin:ue.github,yield this.plugin.saveSettings()}))}),this.settingsPage.createEl("h4",{text:l.t("settings.plugin.head.log")}),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.logNoticeHeader.title")).setDesc(l.t("settings.plugin.logNoticeHeader.desc")).addToggle(n=>n.setValue(e.noticeError).onChange(i=>m(this,null,function*(){e.noticeError=i,yield this.plugin.saveSettings()}))),new N.Setting(this.settingsPage).setName(l.t("settings.plugin.dev.title")).setDesc(l.t("settings.plugin.dev.desc")).addToggle(n=>{var i;return n.setValue((i=e.dev)!=null?i:!1).onChange(s=>m(this,null,function*(){e.dev=s,yield this.plugin.saveSettings()}))})}renderHelp(){this.settingsPage.createEl("h2",{text:l.t("settings.help.usefulLinks.title")}),this.settingsPage.appendChild(ic()),this.settingsPage.createEl("hr"),this.settingsPage.createEl("h2",{text:l.t("settings.help.frontmatter.title")}),this.settingsPage.createEl("p",{text:l.t("settings.help.frontmatter.desc")}),this.settingsPage.createEl("pre",{cls:"language-yaml"}).createEl("code",{text:tc(this.settings),cls:"language-yaml"}),this.settingsPage.appendChild(nc(this.settings)),this.settingsPage.createEl("h2",{text:l.t("settings.help.multiRepoHelp.title")}),this.settingsPage.appendChild(sc(this.settings)),this.settingsPage.appendChild(rc())}copy(e){return JSON.parse(JSON.stringify(e))}};var Or=class extends mn.Plugin{constructor(){super(...arguments);this.branchName=""}getTitleFieldForCommand(e,n){return rt(An(n,e,this.settings),this.settings)}chargeAllCommands(e,n){return m(this,null,function*(){n.settings.plugin.copyLink.addCmd&&this.addCommand(yield Ro(e,this)),this.addCommand(yield No(e,this,this.branchName)),n.settings.upload.autoclean.enable&&(R({settings:this.settings},"Adding purge command"),this.addCommand(yield Oo(this,e,this.branchName))),this.addCommand(yield Bo(this,e,this.branchName)),this.addCommand(yield Lo(this,e,this.branchName)),this.addCommand(yield Mo(this,e,this.branchName)),this.addCommand(yield Io(e,this.branchName,this)),this.addCommand(yield $o(this,e))})}cleanSpecificCommands(e){let n=this.app.commands.listCommands();for(let i of n)if(i.id.startsWith("obsidian-mkdocs-publisher")){let s=i.id.replace("obsidian-mkdocs-publisher:","").split("-"),r=s[s.length-1];r.startsWith("K")&&e.smartKey===r.replace("K","")&&this.app.commands.removeCommand(i.id)}}cleanOldCommands(){var i,s;let e=(s=(i=this.settings.github)==null?void 0:i.otherRepo)!=null?s:[],n=this.app.commands.listCommands();for(let r of n)if(r.id.startsWith("obsidian-mkdocs-publisher")){let a=r.id.replace("obsidian-mkdocs-publisher:",""),o=a.split("-")[a.split("-").length-1];o.startsWith("K")&&e.findIndex(c=>c.smartKey===o.replace("K",""))===-1&&this.app.commands.removeCommand(r.id),this.settings.upload.autoclean.enable||a==="publisher-delete-clean"&&(R({settings:this.settings},"Removing purge/clean commands"),this.app.commands.removeCommand(r.id))}}reloadCommands(){return m(this,null,function*(){var n,i;R({settings:this.settings},"Reloading commands");let e=(i=(n=this.settings.github)==null?void 0:n.otherRepo)!=null?i:[];this.cleanOldCommands();for(let s of e)s.createShortcuts?yield this.chargeAllCommands(s,this):this.cleanSpecificCommands(s)})}loadToken(){return m(this,null,function*(){let e=Jt(this,this.settings.github.tokenPath);if(!(yield this.app.vault.adapter.exists(`${e}`)))return"";try{let i=yield this.app.vault.adapter.read(`${e}`);if(e.endsWith(".json"))return JSON.parse(i).GITHUB_PUBLISHER_TOKEN;if(i)return i.split("=")[1]}catch(i){return _({settings:this.settings,e:!0},i),""}return""})}reloadOctokit(){return m(this,null,function*(){let e,n=this.settings.github.api,i=yield this.loadToken();return n.tiersForApi===Pe.entreprise&&n.hostname.length>0?e=new En({baseUrl:`${n.hostname}/api/v3`,auth:i}):e=new En({auth:i}),new hr(e,this)})}onload(){return m(this,null,function*(){console.info(`[GITHUB PUBLISHER] v.${this.manifest.version} (lang: ${Dr}) loaded`),yield this.loadSettings(),yield l.init({lng:Dr,fallbackLng:"en",resources:gr,returnNull:!1});let e=this.settings;if(yield ss(e,this),this.branchName=this.app.vault.getName().replaceAll(" ","-").replaceAll(".","-")+"-"+new Date().toLocaleDateString("en-US").replace(/\//g,"-"),this.addSettingTab(new Rr(this.app,this,this.branchName)),!this.settings.github.verifiedRepo&&(yield this.loadToken())!==""){let i=yield this.reloadOctokit();this.settings.github.verifiedRepo=yield Ze(i,null,null,!0),this.settings.github.rateLimit=yield Ye(i.octokit,this.settings,!1),yield this.saveSettings()}this.registerEvent(this.app.workspace.on("file-menu",(i,s)=>{this.settings.plugin.fileMenu&&s instanceof mn.TFolder?Go(i,s,this.branchName,this):s instanceof mn.TFile&&Is(this,s,this.branchName,i)})),this.registerEvent(this.app.workspace.on("editor-menu",(i,s,r)=>{r.file&&Is(this,r.file,this.branchName,i)})),yield this.chargeAllCommands(null,this),this.addCommand({id:"check-rate-limit",name:l.t("commands.checkValidity.rateLimit.command"),callback:()=>m(this,null,function*(){let i=yield this.reloadOctokit();this.settings.github.rateLimit=yield Ye(i.octokit,this.settings),yield this.saveSettings()})}),this.settings.github.otherRepo.length>0&&this.addCommand({id:"run-cmd-for-repo",name:l.t("commands.runOtherRepo.title"),callback:()=>m(this,null,function*(){new Ms(this.app,this,this.branchName).open()})});let n=this.settings.github.otherRepo.filter(i=>i.createShortcuts);for(let i of n)yield this.chargeAllCommands(i,this)})}onunload(){console.info("[Github Publisher] unloaded")}loadSettings(){return m(this,null,function*(){let e=yield this.loadData();try{this.settings=ja(ws,e)}catch(n){console.warn("[Github Publisher] Error while deep merging settings, using default loading method"),this.settings=Object.assign({},ws,yield this.loadData())}})}saveSettings(){return m(this,null,function*(){yield this.saveData(this.settings)})}};0&&(module.exports={}); -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ -/** - * The majority of the code was taken from obsidian-easy-bake - * @credit mgmeyers - * @source https://github.com/mgmeyers/obsidian-easy-bake - * @license GPL-3.0 - * Each function is modified to fit the needs of this plugin, but citation are done in the code for each function - */ +/* +THIS IS A GENERATED/BUNDLED FILE BY ROLLUP +if you want to view the source visit the plugins github repository +*/ + +'use strict'; + +var obsidian = require('obsidian'); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function getActiveView(app) { + const activeView = app.workspace.getActiveViewOfType(obsidian.MarkdownView); + return activeView !== null && activeView !== void 0 ? activeView : undefined; +} +function isViewActive(app) { + const activeView = getActiveView(app); + if (activeView && activeView.file) + return true; + return false; +} +function getViewMetadata(app) { + const activeView = getActiveView(app); + if (activeView && activeView.file) { + const data = app.metadataCache.getFileCache(activeView.file) || {}; + return data; + } + return undefined; +} +function getViewInfo(app) { + const activeView = getActiveView(app); + const data = getViewMetadata(app); + const editor = activeView ? activeView.editor : undefined; + if (activeView && data && editor) { + return { + activeView, data, editor + }; + } + return undefined; +} + +const roman_map = { + M: 1000, + CM: 900, + D: 500, + CD: 400, + C: 100, + XC: 90, + L: 50, + XL: 40, + X: 10, + IX: 9, + V: 5, + IV: 4, + I: 1 +}; + +const allChars = Object.keys(roman_map); +const allNumerals = Object.values(roman_map); +const romanPattern = + /^(M{1,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|C?D|D?C{1,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|X?L|L?X{1,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|I?V|V?I{1,3}))$/; + +const romanize = (decimal) => { + if ( + decimal <= 0 || + typeof decimal !== 'number' || + Math.floor(decimal) !== decimal + ) { + throw new Error('requires an unsigned integer') + } + if (decimal >= 4000) { + throw new Error('requires max value of less than 3999 or less') + } + let roman = ''; + for (let i = 0; i < allChars.length; i++) { + while (decimal >= allNumerals[i]) { + decimal -= allNumerals[i]; + roman += allChars[i]; + } + } + return roman +}; + +const deromanize = (romanStr) => { + if (typeof romanStr !== 'string') { + throw new Error('requires a string') + } + if (!romanPattern.test(romanStr)) { + throw new Error('requires valid roman numeral string') + } + let romanString = romanStr.toUpperCase(); + let arabic = 0; + let iteration = romanString.length; + while (iteration--) { + let cumulative = roman_map[romanString[iteration]]; + if (cumulative < roman_map[romanString[iteration + 1]]) { + arabic -= cumulative; + } else { + arabic += cumulative; + } + } + return arabic +}; + +var romans = { + deromanize, + romanize, + allChars, + allNumerals +}; + +// Validates the string using a regex to ensure is is a valid arabic numbering value +function isValidArabicNumberingValueString(s) { + const regex = /^[0-9]+$/; + return regex.test(s); +} +// Validates the string using a regex to ensure is is a valid alphabet numbering value +function isValidAlphabetNumberingValueString(s) { + const regex = /^[A-Z]$/; + return regex.test(s); +} +// Validates the string using a regex to ensure is is a valid roman numbering value +function isValidRomanNumberingValueString(s) { + const regex = /^[0IVXLCDM]+$/; // This includes zero for zeroth testing + return regex.test(s); +} +function printableNumberingToken(t) { + switch (t.style) { + case '1': + return t.value.toString(); + case 'A': + return t.value; + case 'I': + return t.value; + } +} +function zerothNumberingTokenInStyle(style) { + switch (style) { + case '1': + return { style: '1', value: 0 }; + case 'A': + return { style: 'A', value: 'Z' }; + case 'I': + return { style: 'I', value: '0' }; + } +} +function firstNumberingTokenInStyle(style) { + switch (style) { + case '1': + return { style: '1', value: 1 }; + case 'A': + return { style: 'A', value: 'A' }; + case 'I': + return { style: 'I', value: 'I' }; + } +} +function nextNumberingToken(t) { + switch (t.style) { + case '1': + return { style: '1', value: t.value + 1 }; + case 'A': + if (t.value === 'Z') + return { style: 'A', value: 'A' }; + else + return { style: 'A', value: String.fromCharCode(t.value.charCodeAt(0) + 1) }; + case 'I': + if (t.value === '0') + return { style: 'I', value: 'I' }; + else + return { style: 'I', value: romans.romanize(romans.deromanize(t.value) + 1) }; + } +} +function previousNumberingToken(t) { + switch (t.style) { + case '1': + return { style: '1', value: t.value - 1 }; + case 'A': + if (t.value === 'A') + return { style: 'A', value: 'Z' }; + else + return { style: 'A', value: String.fromCharCode(t.value.charCodeAt(0) - 1) }; + case 'I': + if (t.value === 'I') + return { style: 'I', value: '0' }; + else + return { style: 'I', value: romans.romanize(romans.deromanize(t.value) - 1) }; + } +} +function makeNumberingString(numberingStack) { + let numberingString = ''; + for (let i = 0; i < numberingStack.length; i++) { + if (i === 0) { + numberingString += ' '; + } + else { + numberingString += '.'; + } + numberingString += printableNumberingToken(numberingStack[i]); + } + return numberingString; +} +function startAtOrZerothInStyle(startAtSettingString, style) { + if (startAtSettingString === '') + return zerothNumberingTokenInStyle(style); + let firstNumberingTokenFromSetting; + switch (style) { + case '1': + if (!isValidArabicNumberingValueString(startAtSettingString)) + return zerothNumberingTokenInStyle(style); + firstNumberingTokenFromSetting = { style: '1', value: parseInt(startAtSettingString) }; + break; + case 'A': + if (!isValidAlphabetNumberingValueString(startAtSettingString)) + return zerothNumberingTokenInStyle(style); + firstNumberingTokenFromSetting = { style: 'A', value: startAtSettingString }; + break; + case 'I': + if (!isValidRomanNumberingValueString(startAtSettingString)) + return zerothNumberingTokenInStyle(style); + firstNumberingTokenFromSetting = { style: 'I', value: startAtSettingString }; + break; + } + // Convert the first numbering token to a zeroth numbering token + return previousNumberingToken(firstNumberingTokenFromSetting); +} + +const DEFAULT_SETTINGS = { + skipTopLevel: false, + firstLevel: 1, + maxLevel: 6, + styleLevel1: '1', + styleLevelOther: '1', + auto: false, + separator: '', + contents: '', + skipHeadings: '', + startAt: '', + off: false +}; +function isValidNumberingStyleString(s) { + if (s === 'A' || s === '1' || s === 'I') + return true; + return false; +} +function isValidNumberingValueString(s) { + if (s === '' || isValidArabicNumberingValueString(s) || isValidAlphabetNumberingValueString(s) || isValidRomanNumberingValueString(s)) + return true; + return false; +} +function isValidFlag(f) { + if (f === true || f === false) + return true; + return false; +} +function isValidFirstOrMaxLevel(x) { + if (typeof x === 'number' && x >= 1 && x <= 6) + return true; + return false; +} +function isValidSeparator(x) { + return typeof x === 'string' && + (x === '' || + x === ':' || x === ' :' || + x === '.' || x === ' .' || + x === '-' || x === ' -' || + x === '—' || x === ' —' || /* em-dash */ + x === ')' || x === ' )'); +} +function isValidBlockIdSetting(x) { + if (typeof x === 'string' && (x === '' || x.startsWith('^'))) + return true; + return false; +} +function isNonEmptyBlockId(x) { + if (x.length > 2 && x.startsWith('^')) + return true; + return false; +} + +function createSupportFlagsFromSettings(styleLevel1, styleLevelOther) { + return { + alphabet: styleLevel1 === 'A' || styleLevelOther === 'A', + roman: styleLevel1 === 'I' || styleLevelOther === 'I' + }; +} +// Get the regex for the header string, based on the support flags. The generated regex is used to find the range of the header prefix. +// The regex is generated dynamically, because the regex is different depending on the support flags. +function getRegexForHeaderString(flags) { + if (flags.alphabet && flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.|[A-Z]\.|[IVXLCDM]+\.)*([0-9]+|[A-Z]|[IVXLCDM]+)?( )?[)—:.-]?( )+/g; + } + else if (!flags.alphabet && flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.|[IVXLCDM]+\.)*([0-9]+|[IVXLCDM]+)?( )?[)—:.-]?( )+/g; + } + else if (flags.alphabet && !flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.|[A-Z]\.)*([0-9]+|[A-Z])?( )?[)—:.-]?( )+/g; + } + else if (!flags.alphabet && !flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.)*([0-9]+)?( )?[)—:.-]?( )+/g; + } + throw new Error('Unexpected combination of support flags'); +} +// Find the range of the heading prefix, including the space after any numbering, but not the heading text +function findRangeInHeaderString(lineText, lineNumber, flags) { + const regex = getRegexForHeaderString(flags); + if (!lineText) + return undefined; + const matches = lineText.match(regex); + if (matches && matches.length !== 1) { + // eslint-disable-next-line no-console + console.log("Unexpected heading format: '" + lineText + "'"); + return undefined; + } + const match = matches ? matches[0] : ''; + const from = { + line: lineNumber, + ch: 0 + }; + const to = { + line: lineNumber, + ch: match.length + }; + return { from, to }; +} +function updateSettingsFromFrontMatterFormatPart(part, settings) { + // Parse the separator + let partWithoutSeparator = part; + const potentialTwoCharSeparator = part.slice(-2); + if (isValidSeparator(potentialTwoCharSeparator)) { + settings.separator = potentialTwoCharSeparator; + partWithoutSeparator = part.slice(0, -2); + } + else { + const potentialOneCharSeparator = part.slice(-1); + if (isValidSeparator(potentialOneCharSeparator)) { + settings.separator = potentialOneCharSeparator; + partWithoutSeparator = part.slice(0, -1); + } + else { + settings.separator = ''; + } + } + // Parse the numbering style + const descriptors = partWithoutSeparator.split('.'); + let firstNumberedDescriptor = 0; + // Handle the case where the first descriptor is an underscore + if (descriptors.length > 1 && descriptors[0] === '_') { + // The first descriptor is an instruction to skip top levels, so skip them + settings.skipTopLevel = true; + firstNumberedDescriptor = 1; + } + else { + settings.skipTopLevel = false; + } + if (descriptors.length - firstNumberedDescriptor >= 2) { + const styleLevel1 = descriptors[firstNumberedDescriptor]; + if (isValidNumberingStyleString(styleLevel1)) { + settings.styleLevel1 = styleLevel1; + } + const styleLevelOther = descriptors[firstNumberedDescriptor + 1]; + if (isValidNumberingStyleString(styleLevelOther)) { + settings.styleLevelOther = styleLevelOther; + } + } + return settings; +} + +const AUTO_PART_KEY = 'auto'; +const FIRST_LEVEL_PART_KEY = 'first-level'; +const MAX_LEVEL_PART_KEY = 'max'; +const CONTENTS_PART_KEY = 'contents'; +const SKIP_PART_KEY = 'skip'; +const START_AT_PART_KEY = 'start-at'; +const OFF_PART_KEY = 'off'; +function parseCompactFrontMatterSettings(fm) { + const entry = obsidian.parseFrontMatterEntry(fm, 'number headings'); + if (entry) { + const entryString = String(entry); + const parts = entryString.split(','); + let settings = Object.assign({}, DEFAULT_SETTINGS); + for (const part of parts) { + const trimmedPart = part.trim(); + if (trimmedPart.length === 0) + continue; + if (trimmedPart === OFF_PART_KEY) { + // Parse off part + settings.off = true; + } + else if (trimmedPart === AUTO_PART_KEY) { + // Parse auto numbering part + settings.auto = true; + } + else if (trimmedPart.startsWith(FIRST_LEVEL_PART_KEY)) { + // Parse first level part + const nstring = trimmedPart.substring(FIRST_LEVEL_PART_KEY.length + 1); + const n = parseInt(nstring); + if (isValidFirstOrMaxLevel(n)) { + settings.firstLevel = n; + } + } + else if (trimmedPart.startsWith(MAX_LEVEL_PART_KEY)) { + // Parse max level part + const nstring = trimmedPart.substring(MAX_LEVEL_PART_KEY.length + 1); + const n = parseInt(nstring); + if (isValidFirstOrMaxLevel(n)) { + settings.maxLevel = n; + } + } + else if (trimmedPart.startsWith(START_AT_PART_KEY)) { + // Parse "start at" part + const value = trimmedPart.substring(START_AT_PART_KEY.length + 1); + if (isValidNumberingValueString(value)) { + settings.startAt = value; + } + } + else if (trimmedPart.startsWith(CONTENTS_PART_KEY)) { + if (trimmedPart.length <= CONTENTS_PART_KEY.length + 1) + continue; + // Parse contents heading part + const tocHeadingBlockIdName = trimmedPart.substring(CONTENTS_PART_KEY.length + 1); + if (isValidBlockIdSetting(tocHeadingBlockIdName)) { + settings.contents = tocHeadingBlockIdName; + } + } + else if (trimmedPart.startsWith(SKIP_PART_KEY)) { + if (trimmedPart.length <= SKIP_PART_KEY.length + 1) + continue; + // Parse skip heading part + const skipHeadingBlockIdName = trimmedPart.substring(SKIP_PART_KEY.length + 1); + if (isValidBlockIdSetting(skipHeadingBlockIdName)) { + settings.skipHeadings = skipHeadingBlockIdName; + } + } + else { + // Parse formatting part + settings = updateSettingsFromFrontMatterFormatPart(trimmedPart, settings); + } + } + return settings; + } + return undefined; +} +const getFrontMatterSettingsOrAlternative = ({ frontmatter }, alternativeSettings) => { + var _a, _b, _c, _d, _e; + if (frontmatter !== undefined) { + const decompactedSettings = parseCompactFrontMatterSettings(frontmatter); + if (decompactedSettings !== undefined) + return decompactedSettings; + // NOTE: Everything below is for backwards compatibility only + const skipTopLevelEntry = (_a = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-skip-top-level')) !== null && _a !== void 0 ? _a : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-skip-top-level'); + const skipTopLevel = isValidFlag(skipTopLevelEntry) ? skipTopLevelEntry : alternativeSettings.skipTopLevel; + const maxLevelEntry = (_b = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-max-level')) !== null && _b !== void 0 ? _b : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-max-level'); + const maxLevel = isValidFirstOrMaxLevel(maxLevelEntry) ? maxLevelEntry : alternativeSettings.maxLevel; + const styleLevel1Entry = String((_c = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-style-level-1')) !== null && _c !== void 0 ? _c : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-style-level-1')); + const styleLevel1 = isValidNumberingStyleString(styleLevel1Entry) ? styleLevel1Entry : alternativeSettings.styleLevel1; + const styleLevelOtherEntry = String((_d = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-style-level-other')) !== null && _d !== void 0 ? _d : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-style-level-other')); + const styleLevelOther = isValidNumberingStyleString(styleLevelOtherEntry) ? styleLevelOtherEntry : alternativeSettings.styleLevelOther; + const autoEntry = (_e = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-auto')) !== null && _e !== void 0 ? _e : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-auto'); + const auto = isValidFlag(autoEntry) ? autoEntry : alternativeSettings.auto; + return Object.assign(Object.assign({}, alternativeSettings), { skipTopLevel, maxLevel, styleLevel1, styleLevelOther, auto }); + } + else { + return alternativeSettings; + } +}; +function settingsToCompactFrontMatterValue(settings) { + if (settings.off) + return OFF_PART_KEY; + const autoPart = settings.auto ? 'auto, ' : ''; + const firstLevelPart = `first-level ${settings.firstLevel}, `; + const maxPart = `max ${settings.maxLevel}, `; + const contentsPart = settings.contents && settings.contents.length > 0 ? `contents ${settings.contents}, ` : ''; + const skipHeadingsPart = settings.skipHeadings && settings.skipHeadings.length > 0 ? `skip ${settings.skipHeadings}, ` : ''; + const skipTopLevelString = settings.skipTopLevel ? '_.' : ''; + const stylePart = `${skipTopLevelString}${settings.styleLevel1}.${settings.styleLevelOther}${settings.separator}`; + const startAtPart = settings.startAt !== '' ? `start-at ${settings.startAt}, ` : ''; + return autoPart + firstLevelPart + maxPart + contentsPart + skipHeadingsPart + startAtPart + stylePart; +} +const saveSettingsToFrontMatter = (fileManager, file, settings) => { + fileManager.processFrontMatter(file, frontmatter => { + const v = settingsToCompactFrontMatterValue(settings); + frontmatter['number headings'] = v; + }); +}; + +class NumberingDoneModal extends obsidian.Modal { + constructor(app, config) { + super(app); + this.config = config; + } + onOpen() { + const { contentEl, titleEl } = this; + titleEl.setText('Number Headings - Successfully Completed'); + contentEl.createEl('div', { text: this.config.message }); + contentEl.createEl('pre', { text: this.config.preformattedMessage }); + contentEl.createEl('div', { text: "Do you want to save these settings in the document's front matter?", cls: 'number-headings-question' }); + const containerForButtons = contentEl.createEl('div', { cls: 'number-headings-button-container' }); + const noButton = containerForButtons.createEl('button', {}); + noButton.setText('No'); + noButton.onClickEvent((ev) => { + this.close(); + return ev; + }); + const yesButton = containerForButtons.createEl('button', {}); + yesButton.setText('Yes, save settings in document'); + yesButton.onClickEvent((ev) => { + this.config.saveSettingsCallback(false); + this.close(); + return ev; + }); + const yesAndAutoButton = containerForButtons.createEl('button', {}); + yesAndAutoButton.setText('Yes, save settings in document, and automatically number'); + yesAndAutoButton.onClickEvent((ev) => { + this.config.saveSettingsCallback(true); + this.close(); + return ev; + }); + } + onClose() { + const { contentEl, titleEl } = this; + contentEl.empty(); + titleEl.empty(); + } +} +function showNumberingDoneMessage(app, settings) { + const saveSettingsCallback = (shouldAddAutoFlag) => { + const tweakedSettings = Object.assign({}, settings); + if (shouldAddAutoFlag) + tweakedSettings.auto = true; + const file = app.workspace.getActiveFile(); + if (file) { + saveSettingsToFrontMatter(app.fileManager, file, tweakedSettings); + } + }; + const config = { + message: `Successfully updated all heading numbers in the document, using the settings below. + See settings panel to change how headings are numbered, or use front matter + (see settings panel).`, + preformattedMessage: `Skip top heading level: ${settings.skipTopLevel} +First heading level: ${settings.firstLevel} +Start numbering first heading at: ${settings.startAt} +Maximum heading level: ${settings.maxLevel} +Style for level 1 headings: ${settings.styleLevel1} +Style for lower level headings (below level 1): ${settings.styleLevelOther} +Separator: ${settings.separator} +Table of Contents Anchor: ${settings.contents} +Skip Headings Anchor: ${settings.skipHeadings}`, + saveSettingsCallback + }; + const leaf = app.workspace.activeLeaf; + if (leaf) { + new NumberingDoneModal(app, config).open(); + } +} + +const TOC_LIST_ITEM_BULLET = '-'; +function makeHeadingHashString(editor, heading) { + const regex = /^\s{0,4}#+/g; + const headingLineString = editor.getLine(heading.position.start.line); + if (!headingLineString) + return undefined; + const matches = headingLineString.match(regex); + if (!matches) + return undefined; + if (matches.length !== 1) { + // eslint-disable-next-line no-console + console.log("Unexpected heading format: '" + headingLineString + "'"); + return undefined; + } + const match = matches[0]; + return match.trimLeft(); +} +function findHeadingPrefixRange(editor, heading, flags) { + const lineNumber = heading.position.start.line; + const lineText = editor.getLine(lineNumber); + return findRangeInHeaderString(lineText, lineNumber, flags); +} +function cleanHeadingTextForToc(htext) { + if (htext.contains('^')) { + const x = htext.split('^'); + if (x.length > 1) { + return x[0].trim(); + } + } + return htext.trim(); +} +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function createTocEntry(h, settings, initialHeadingLevel) { + const text = h.heading; + const cleanText = cleanHeadingTextForToc(text); + let bulletIndent = ''; + const startLevel = initialHeadingLevel; + for (let i = startLevel; i < h.level; i++) { + bulletIndent += '\t'; + } + const entryLink = `[[#${text}|${cleanText}]]`; + return bulletIndent + TOC_LIST_ITEM_BULLET + ' ' + entryLink; +} +// Replace a range, but only if there is a change in text, to prevent poluting the undo stack +function replaceRangeEconomically(editor, changes, range, text) { + const previousText = editor.getRange(range.from, range.to); + if (previousText !== text) { + changes.push({ + text: text, + from: range.from, + to: range.to + }); + } +} +const updateHeadingNumbering = (viewInfo, settings) => { + var _a; + if (!viewInfo) + return; + const headings = (_a = viewInfo.data.headings) !== null && _a !== void 0 ? _a : []; + const editor = viewInfo.editor; + const supportFlags = createSupportFlagsFromSettings(settings.styleLevel1, settings.styleLevelOther); + let previousLevel = 1; + let numberingStack = [startAtOrZerothInStyle(settings.startAt, settings.styleLevel1)]; + if (settings.firstLevel > 1) { + previousLevel = settings.firstLevel; + } + else if (settings.skipTopLevel) { + previousLevel = 2; + } + const changes = []; + for (const heading of headings) { + // Update the numbering stack based on the level and previous level + const level = heading.level; + // Handle skipped & ignored levels. + if ((settings.firstLevel > level) || (settings.skipTopLevel && level === 1)) { + // Resets the numbering when a level is skipped. + // Note: This leaves headings as they are, allowing people to have numbers at the start of + // ignored headings. + numberingStack = [startAtOrZerothInStyle(settings.startAt, settings.styleLevel1)]; + if (settings.firstLevel > 1) { + previousLevel = settings.firstLevel; + } + else if (settings.skipTopLevel) { + previousLevel = 2; + } + continue; + } + // Handle skipped headings + if (settings.skipHeadings.length > 0) { + if (heading.heading.endsWith(settings.skipHeadings)) { + continue; + } + } + // Adjust numbering stack + if (level === previousLevel) { + const x = numberingStack.pop(); + if (x !== undefined) { + numberingStack.push(nextNumberingToken(x)); + } + } + else if (level < previousLevel) { + for (let i = previousLevel; i > level; i--) { + numberingStack.pop(); + } + const x = numberingStack.pop(); + if (x !== undefined) { + numberingStack.push(nextNumberingToken(x)); + } + } + else if (level > previousLevel) { + for (let i = previousLevel; i < level; i++) { + numberingStack.push(firstNumberingTokenInStyle(settings.styleLevelOther)); + } + } + // Set the previous level to this level for the next iteration + previousLevel = level; + if (level > settings.maxLevel) { + // If we are above the max level, just don't number it + continue; + } + // Find the range to replace, and then do it + const prefixRange = findHeadingPrefixRange(editor, heading, supportFlags); + if (prefixRange === undefined) + return; + const headingHashString = makeHeadingHashString(editor, heading); + if (headingHashString === undefined) + return; + const prefixString = makeNumberingString(numberingStack); + replaceRangeEconomically(editor, changes, prefixRange, headingHashString + prefixString + settings.separator + ' '); + } + // Execute the transaction to make all the changes at once + if (changes.length > 0) { + // eslint-disable-next-line no-console + console.log('Number Headings Plugin: Applying headings numbering changes:', changes.length); + editor.transaction({ + changes: changes + }); + } +}; +const updateTableOfContents = (viewInfo, settings) => { + var _a; + if (!viewInfo) + return; + const headings = (_a = viewInfo.data.headings) !== null && _a !== void 0 ? _a : []; + const editor = viewInfo.editor; + if (!isNonEmptyBlockId(settings.contents)) + return; + let tocHeading; + let tocBuilder = '\n'; + const changes = []; + // In case headings start above level 1, we don't want to indent the bullets too much + let initialHeadingLevel = 1; + if (headings.length > 0) { + initialHeadingLevel = headings[0].level; + } + for (const heading of headings) { + // ORDERING: Important to find the TOC heading before skipping skipped headings, since that is for numbering + // Find the TOC heading + if (heading.heading.endsWith(settings.contents)) { + tocHeading = heading; + } + /* This code lets us skip TOC lines for skipped headings, but doesn't work well with first-level setting + if ((settings.skipTopLevel && heading.level === 1) || (heading.level > settings.maxLevel)) { + continue + } + */ + const tocEntry = createTocEntry(heading, settings, initialHeadingLevel); + tocBuilder += tocEntry + '\n'; + } + // Insert the generated table of contents + if (tocHeading) { + const from = { + line: tocHeading.position.start.line + 1, + ch: 0 + }; + // Find the end of the TOC section + const startingLine = tocHeading.position.start.line + 1; + let endingLine = startingLine; + let foundList = false; + const lastLineInEditor = editor.lastLine(); + for (;; endingLine++) { + const line = editor.getLine(endingLine); + if (line === undefined || endingLine > lastLineInEditor) { + // Reached end of file, insert at the start of the TOC section + endingLine = startingLine; + break; + } + const trimmedLineText = line.trimStart(); + if (foundList) { + if (!trimmedLineText.startsWith(TOC_LIST_ITEM_BULLET)) + break; + if (trimmedLineText.startsWith('#')) + break; + } + else { + if (trimmedLineText.startsWith(TOC_LIST_ITEM_BULLET)) { + foundList = true; + } + else if (trimmedLineText.startsWith('#')) { + // Reached the next heading without finding existing TOC list, insert at the start of the TOC section + endingLine = startingLine; + break; + } + else { + continue; + } + } + } + if (tocBuilder === '\n') { + tocBuilder = ''; + } + const to = { + line: endingLine, + ch: 0 + }; + const range = { from, to }; + replaceRangeEconomically(editor, changes, range, tocBuilder); + } + // Execute the transaction to make all the changes at once + if (changes.length > 0) { + // eslint-disable-next-line no-console + console.log('Number Headings Plugin: Applying table of contents changes:', changes.length); + editor.transaction({ + changes: changes + }); + } +}; +const removeHeadingNumbering = (viewInfo) => { + var _a; + if (!viewInfo) + return; + const headings = (_a = viewInfo.data.headings) !== null && _a !== void 0 ? _a : []; + const editor = viewInfo.editor; + const changes = []; + for (const heading of headings) { + const prefixRange = findHeadingPrefixRange(editor, heading, { alphabet: true, roman: true }); + if (prefixRange === undefined) + return; + const headingHashString = makeHeadingHashString(editor, heading); + if (headingHashString === undefined) + return; + replaceRangeEconomically(editor, changes, prefixRange, headingHashString + ' '); + } + if (changes.length > 0) { + editor.transaction({ + changes: changes + }); + } +}; + +class NumberHeadingsPluginSettingTab extends obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl('h2', { text: 'Number Headings - Settings' }); + containerEl.createEl('div', { text: 'To add numbering to your document, bring up the command window (on Mac, type CMD+P), and then type "Number Headings" to see a list of available commands.' }); + containerEl.createEl('br', {}); + containerEl.createEl('div', { text: 'If the document has front matter defined with the below settings, the project-wide settings defined on this screen will be ignored. You can define front matter like this:' }); + containerEl.createEl('pre', { + text: ` --- + alias: + - Example Alias + tags: + - example-tag + number headings: first-level 1, start-at 2, max 6, 1.1, auto, contents ^toc + ---` + }); + containerEl.createEl('div', { + text: ` + The 'number headings' front matter key is used to store numbering settings specific to the file. There are four possible options + in the value to the right of the colon, separated by commas. + ` + }); + const ul = containerEl.createEl('ul', {}); + const li0 = ul.createEl('li', {}); + li0.createEl('b', { text: 'Automatic numbering' }); + li0.createEl('span', { text: ': If \'auto\' appears, the document will be automatically numbered.' }); + const li1 = ul.createEl('li', {}); + li1.createEl('b', { text: 'First level to number' }); + li1.createEl('span', { text: ': If \'first-level 2\' appears, the numbering will start at the second level' }); + const li2 = ul.createEl('li', {}); + li2.createEl('b', { text: 'Start numbering first heading at' }); + li2.createEl('span', { text: ': If \'start-at C\' appears, the numbering of the first level will start at C, instead of A' }); + const li3 = ul.createEl('li', {}); + li3.createEl('b', { text: 'Maximum level to number' }); + li3.createEl('span', { text: ': If \'max 6\' appears, the headings above level 6 will be skipped.' }); + const li4 = ul.createEl('li', {}); + li4.createEl('b', { text: 'Table of contents anchor' }); + li4.createEl('span', { text: ': If \'contents ^toc\' appears, the heading that ends with the anchor ^toc will have a table of contents inserted beneath it.' }); + const li41 = ul.createEl('li', {}); + li41.createEl('b', { text: 'Skip headings anchor' }); + li41.createEl('span', { text: ': If \'skip ^skipped\' appears, the heading that ends with the anchor ^skipped will not be numbered.' }); + const li5 = ul.createEl('li', {}); + li5.createEl('b', { text: 'Numbering style' }); + li5.createEl('span', { + text: `: + A style text like '1.1', 'A.1', or '_.1.1' tells the plugin how to format the headings. + If a style string ends with '.' (a dot), ':' (a colon), '-' (a dash), '—' (an emdash), or ')' (a right parenthesis), the heading numbers will be separated from the heading title + with that symbol.` + }); + const ul3 = li5.createEl('ul', {}); + ul3.createEl('li', { + text: ` + For example, '1.1' means both top level and other headings will be numbered starting from '1'. + ` + }); + ul3.createEl('li', { + text: ` + For example, 'A.1' means top level headings will be numbered starting from 'A'. + ` + }); + ul3.createEl('li', { + text: ` + For example, '_.A.1' means top level headings will NOT be numbered, but the next levels will be numbered with letters and numbers. + ` + }); + ul3.createEl('li', { + text: ` + For example, '1.1:' means headings will look like '## 2.4: Example Heading' + ` + }); + ul3.createEl('li', { + text: ` + For example, 'A.1-' means headings will look like '## B.5- Example Heading' + ` + }); + ul3.createEl('li', { + text: ` + For example, 'I.A —' means headings will look like '## IV.A — Example Heading' (with Roman numerals) + ` + }); + const li100 = ul.createEl('li', {}); + li100.createEl('b', { text: 'Numbering off' }); + li100.createEl('span', { text: ': If \'off\' appears, the document will not be numbered.' }); + new obsidian.Setting(containerEl) + .setName('Skip top heading level') + .setDesc('If selected, numbering will not be applied to the top heading level.') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.skipTopLevel) + .setTooltip('Skip top heading level') + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.skipTopLevel = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('First heading level') + .setDesc('First heading level to number.') + .addSlider(slider => slider + .setLimits(1, 6, 1) + .setValue(this.plugin.settings.firstLevel) + .setDynamicTooltip() + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.firstLevel = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Start numbering at') + .setDesc('Start numbering the first heading level from this value.') + .addText(text => text + .setValue(this.plugin.settings.startAt) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.startAt = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Maximum heading level') + .setDesc('Maximum heading level to number.') + .addSlider(slider => slider + .setLimits(1, 6, 1) + .setValue(this.plugin.settings.maxLevel) + .setDynamicTooltip() + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.maxLevel = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Style for level 1 headings') + .setDesc('Defines the numbering style for level one headings. Valid values are 1 (for numbers) or A (for capital letters) or I (for Roman numerals).') + .addText(text => text + .setValue(this.plugin.settings.styleLevel1) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.styleLevel1 = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Style for lower level headings (below level 1)') + .setDesc('Defines the numbering style for headings below level one. Valid values are 1 (for numbers) or A (for capital letters) or I (for Roman numerals).') + .addText(text => text + .setValue(this.plugin.settings.styleLevelOther) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.styleLevelOther = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Automatic numbering') + .setDesc('Turns on automatic numbering of documents.') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.auto) + .setTooltip('Turn on automatic numbering') + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.auto = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Separator style') + .setDesc('Defines the separator style between the heading number and the heading text. Valid values are : (colon) or . (dot) or - (dash) or — (emdash) or ) (a right parenthesis). You can also leave it blank for no separator, or have a space before the separator.') + .addText(text => text + .setValue(this.plugin.settings.separator) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.separator = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Table of Contents Anchor') + .setDesc('Anchor which labels the header where a table of contents should be inserted. The anchor should be added at the end of a header. For example, ^toc.') + .addText(text => text + .setValue(this.plugin.settings.contents) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.contents = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Skip Headings Anchor') + .setDesc('Anchor which labels the headers that should not be numbered. The anchor should be added at the end of a header. For example, ^skipped.') + .addText(text => text + .setValue(this.plugin.settings.skipHeadings) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.skipHeadings = value; + yield this.plugin.saveSettings(); + }))); + } +} +class NumberHeadingsPlugin extends obsidian.Plugin { + onload() { + return __awaiter(this, void 0, void 0, function* () { + // eslint-disable-next-line no-console + console.info('Loading Number Headings Plugin, version ' + this.manifest.version); + yield this.loadSettings(); + this.addCommand({ + id: 'number-headings-with-options', + name: 'Number all headings in document (and show options)', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + if (viewInfo) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + if (settings.off) + return false; + updateHeadingNumbering(viewInfo, settings); + setTimeout(() => { + // HACK: This must happen after a timeout so that there is time for the editor transaction to complete + const postNumberingViewInfo = getViewInfo(this.app); + updateTableOfContents(postNumberingViewInfo, settings); + }, 3000); + showNumberingDoneMessage(this.app, settings); + } + return false; + } + }); + this.addCommand({ + id: 'number-headings', + name: 'Number all headings in document', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + if (viewInfo) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + if (settings.off) + return false; + updateHeadingNumbering(viewInfo, settings); + setTimeout(() => { + // HACK: This must happen after a timeout so that there is time for the editor transaction to complete + const postNumberingViewInfo = getViewInfo(this.app); + updateTableOfContents(postNumberingViewInfo, settings); + }, 3000); + // NOTE: The line below is intentionally commented out, since this command is the same as + // the above command, except for this line + // showNumberingDoneMessage(this.app, settings, viewInfo) + } + return false; + } + }); + this.addCommand({ + id: 'remove-number-headings', + name: 'Remove numbering from all headings in document', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + removeHeadingNumbering(viewInfo); + return true; + } + }); + this.addCommand({ + id: 'save-settings-to-front-matter', + name: 'Save settings to front matter', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + const file = this.app.workspace.getActiveFile(); + if (viewInfo && file) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + saveSettingsToFrontMatter(this.app.fileManager, file, settings); + } + return false; + } + }); + this.addSettingTab(new NumberHeadingsPluginSettingTab(this.app, this)); + this.registerInterval(window.setInterval(() => { + const viewInfo = getViewInfo(this.app); + if (viewInfo) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + if (settings.off) + return; + if (settings.auto) { + updateHeadingNumbering(viewInfo, settings); + setTimeout(() => { + // HACK: This must happen after a timeout so that there is time for the editor transaction to complete + const postNumberingViewInfo = getViewInfo(this.app); + updateTableOfContents(postNumberingViewInfo, settings); + }, 3000); + // eslint-disable-next-line no-console + console.log('Number Headings Plugin: Automatically numbered document'); + } + } + }, 10 * 1000)); + }); + } + loadSettings() { + return __awaiter(this, void 0, void 0, function* () { + this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); + }); + } + saveSettings() { + return __awaiter(this, void 0, void 0, function* () { + yield this.saveData(this.settings); + }); + } +} + +module.exports = NumberHeadingsPlugin; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzNi5qcyIsInNyYy9hY3RpdmVWaWV3SGVscGVycy50cyIsIm5vZGVfbW9kdWxlcy9yb21hbnMvcm9tYW5zLmpzIiwic3JjL251bWJlcmluZ1Rva2Vucy50cyIsInNyYy9zZXR0aW5nc1R5cGVzLnRzIiwic3JjL3RleHRQcm9jZXNzaW5nLnRzIiwic3JjL2Zyb250TWF0dGVyLnRzIiwic3JjL21lc3NhZ2VzLnRzIiwic3JjL251bWJlcmluZy50cyIsInNyYy9tYWluLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcclxuQ29weXJpZ2h0IChjKSBNaWNyb3NvZnQgQ29ycG9yYXRpb24uXHJcblxyXG5QZXJtaXNzaW9uIHRvIHVzZSwgY29weSwgbW9kaWZ5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nRzW2ldO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkpIHRbcF0gPSBzW3BdO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdDtcclxuICAgIH1cclxuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19yZXN0KHMsIGUpIHtcclxuICAgIHZhciB0ID0ge307XHJcbiAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkgJiYgZS5pbmRleE9mKHApIDwgMClcclxuICAgICAgICB0W3BdID0gc1twXTtcclxuICAgIGlmIChzICE9IG51bGwgJiYgdHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMgPT09IFwiZnVuY3Rpb25cIilcclxuICAgICAgICBmb3IgKHZhciBpID0gMCwgcCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMocyk7IGkgPCBwLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKSlcclxuICAgICAgICAgICAgICAgIHRbcFtpXV0gPSBzW3BbaV1dO1xyXG4gICAgICAgIH1cclxuICAgIHJldHVybiB0O1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19kZWNvcmF0ZShkZWNvcmF0b3JzLCB0YXJnZXQsIGtleSwgZGVzYykge1xyXG4gICAgdmFyIGMgPSBhcmd1bWVudHMubGVuZ3RoLCByID0gYyA8IDMgPyB0YXJnZXQgOiBkZXNjID09PSBudWxsID8gZGVzYyA9IE9iamVjdC5nZXRPd25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HQgPSBvcDsgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDQ6IF8ubGFiZWwrKzsgcmV0dXJuIHsgdmFsdWU6IG9wWzFdLCBkb25lOiBmYWxzZSB9O1xyXG4gICAgICAgICAgICAgICAgY2FzZSA1OiBfLmxhYmVsKys7IHkgPSBvcFsxXTsgb3AgPSBbMF07IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA3OiBvcCA9IF8ub3BzLnBvcCgpOyBfLnRyeXMucG9wKCk7IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICBpZiAoISh0ID0gXy50cnlzLCB0ID0gdC5sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDMgJiYgKCF0IHx8IChvcFsxXSA+IHRbMF0gJiYgb3BbMV0gPCB0WzNdKSkpIHsgXy5sYWJlbCA9IG9wWzFdOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcFswXSA9PT0gNiAmJiBfLmxhYmVsIDwgdFsxXSkgeyBfLmxhYmVsID0gdFsxXTsgdCA9IG9wOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ICYmIF8ubGFiZWwgPCB0WzJdKSB7IF8ubGFiZWwgPSB0WzJdOyBfLm9wcy5wdXNoKG9wKTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodFsyXSkgXy5vcHMucG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBvcCA9IGJvZHkuY2FsbCh0aGlzQXJnLCBfKTtcclxuICAgICAgICB9I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xDQUFBO3lCQUN2RCxFQUFFLElBQUksQ0FBQyxDQUFBOztBQUVSLHdCQUFBLE9BQU8sQ0FBQyxHQUFHLENBQUMseURBQXlELENBQUMsQ0FBQTtBQUN2RSxxQkFBQTtBQUNGLGlCQUFBO0FBQ0gsYUFBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsQ0FBQyxDQUFBO1NBQ2YsQ0FBQSxDQUFBO0FBQUEsS0FBQTtJQUVLLFlBQVksR0FBQTs7QUFDaEIsWUFBQSxJQUFJLENBQUMsUUFBUSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLGdCQUFnQixFQUFFLE1BQU0sSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUE7U0FDM0UsQ0FBQSxDQUFBO0FBQUEsS0FBQTtJQUVLLFlBQVksR0FBQTs7WUFDaEIsTUFBTSxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQTtTQUNuQyxDQUFBLENBQUE7QUFBQSxLQUFBO0FBQ0Y7Ozs7In0= diff --git a/docs/_obsidian/.obsidian/workspace.json b/docs/_obsidian/.obsidian/workspace.json index ccf106c..afd4ed9 100644 --- a/docs/_obsidian/.obsidian/workspace.json +++ b/docs/_obsidian/.obsidian/workspace.json @@ -148,9 +148,9 @@ }, "active": "95a82c972e21e604", "lastOpenFiles": [ - "calculation-method/calculation-method.md", - "calculation-method/appendix-a.md", "index.md", + "calculation-method/appendix-a.md", + "calculation-method/calculation-method.md", "calculation-method", "Welcome.md", "create a link.md" diff --git a/docs/_obsidian/calculation-method/calculation-method.md b/docs/_obsidian/calculation-method/calculation-method.md index 41dbec6..cbaa98e 100644 --- a/docs/_obsidian/calculation-method/calculation-method.md +++ b/docs/_obsidian/calculation-method/calculation-method.md @@ -32,14 +32,14 @@ $η_{H,gn}$ — безрозмірний коефіцієнт використа $$Q_{H,ht}=Q_{tr}+Q_{ve}, \tag{2}$$ де $Q_{tr}$ — сумарна теплопередача трансмісією, Вт·год, визначена згідно з розділом [[#1.1 Теплопередача трансмісією]], -$Q_{tr}$ — сумарна теплопередача вентиляцією, Вт·год, визначена згідно з розділом [[#1-2 Теплопередача вентиляцією]]. +$Q_{tr}$ — сумарна теплопередача вентиляцією, Вт·год, визначена згідно з розділом [[#1.2 Теплопередача вентиляцією]]. Сумарні теплові надходження, $Q_{H,gn}$, Вт·год, для кожного місяця визначають за формулою: $$Q_{H,gn}=Q_{int}+Q_{sol}, \tag{3}$$ -де $Q_{int}$ — сума внутрішніх теплонадходжень протягом кожного місяця, Вт·год, визначена згідно [[#1-3 Внутрішні теплонадходження]], -$Q_{sol}$ — сума сонячних теплонадходжень протягом кожного місяця, Вт·год, визначена згідно з розділом [[#1-4 Сонячні теплонадходження]]. +де $Q_{int}$ — сума внутрішніх теплонадходжень протягом кожного місяця, Вт·год, визначена згідно [[#1.3 Внутрішні теплонадходження]], +$Q_{sol}$ — сума сонячних теплонадходжень протягом кожного місяця, Вт·год, визначена згідно з розділом [[#1.4 Сонячні теплонадходження]]. ### 1.1 Теплопередача трансмісією @@ -47,12 +47,12 @@ $Q_{sol}$ — сума сонячних теплонадходжень прот $$Q_{tr}=H_{tr,adj}(θ_{int,set,H}-θ_e)t,\tag{4}$$ -де $H_{tr,adj}$ — загальний коефіцієнт теплопередачі трансмісією зони, Вт/К, встановлений для різниці температур всередині-ззовні, визначений згідно з [1.2.1](#121-узагальнені-коефіцієнти-теплопередачі-трансмісією); -$θ_{int,set,H}$ — розрахункова (задана) внутрішня скоригована температура будівлі під час опалення, ℃, визначена згідно з [таблицею 1](#таблиця-1-значення-скоригованої-температури). -$θ_e$ — середньомісячна температура зовнішнього середовища, ℃, визначена згідно з [додатком А](appendix-a.md); -$t$ — тривалість місяця, для якого проводять розрахунок, год, визначена згідно з [таблицею 2](#таблиця-2-щомісячна-тривалість-часових-інтервалів). +де $H_{tr,adj}$ — загальний коефіцієнт теплопередачі трансмісією зони, Вт/К, встановлений для різниці температур всередині-ззовні, визначений згідно з [[#1.1.3 Узагальнені коефіцієнти теплопередачі трансмісією]]; +$θ_{int,set,H}$ — розрахункова (задана) внутрішня скоригована температура будівлі під час опалення, ℃, визначена згідно з [[#1.1.1 Значення скоригованої температури]]. +$θ_e$ — середньомісячна температура зовнішнього середовища, ℃, визначена згідно з [[appendix-a|додатком А]]; +$t$ — тривалість місяця, для якого проводять розрахунок, год, визначена згідно з [[#1.1.2 Щомісячна тривалість часових інтервалів]]. -#### 1-1-1 Значення скоригованої температури +#### 1.1.1 Значення скоригованої температури | Призначення будівлі | Скоригована температура опалення, ℃ | | :------------------------------------------------------ | :---------------------------------: | @@ -69,7 +69,7 @@ $t$ — тривалість місяця, для якого проводять | Будівлі культурно-розважальних установ | 19 | | Інші види будівель | 19 | -#### 1-1-2 Щомісячна тривалість часових інтервалів +#### 1.1.2 Щомісячна тривалість часових інтервалів | Період | Кількість діб | Кількість годин | | :------- | :-----------: | :-------------: | @@ -87,7 +87,7 @@ $t$ — тривалість місяця, для якого проводять | Грудень | 31 | 744 | | Рік | 365 | 8760 | -#### 1-1-3 Узагальнені коефіцієнти теплопередачі трансмісією +#### 1.1.3 Узагальнені коефіцієнти теплопередачі трансмісією Сумарне значення узагальненого коефіцієнта теплопередачі трансмісією $H_{tr,adj}$, BT/K, розраховують за формулою: @@ -111,21 +111,21 @@ $H_U$ — узагальнений коефіцієнт теплопередач $$H_X=b_{tr,x}∑_iA_iU_i,\tag{6}$$ де $A_i$ — площа $i$-гo елемента теплоізоляційної оболонки будівлі виміряна за внутрішніми розмірами, включно з площею внутрішніх дверних та віконних укосів, м²; -$U_i$ — приведений коефіцієнт теплопередачі $i$-го елемента теплоізоляційної оболонки будівлі, Вт/(м²·K), що визначають згідно з [1.2.1.2](#1212-приведений-коефіцієнт-теплопередачі); +$U_i$ — приведений коефіцієнт теплопередачі $i$-го елемента теплоізоляційної оболонки будівлі, Вт/(м²·K), що визначають згідно з [[#1.1.3.2.1 Приведений коефіцієнт теплопередачі]]; $b_{tr,x}$ — поправковий коефіцієнт, що становить: - $b_{tr,x}=1$ — під час розрахунків $H_D$ та $H_g$; -- $b_{tr,x}≠1$ — під час розрахунків $H_U$, значення потрібно визначити згідно [1.2.1.1](#1211-поправковий-коефіцієнт-b_trx). +- $b_{tr,x}≠1$ — під час розрахунків $H_U$, значення потрібно визначити згідно [[#1.1.3.1 Поправковий коефіцієнт $b_{tr,x}$]]. > [!NOTE] > Поправковий коефіцієнт $b_{tr,x}$ коригує коефіцієнт $H_X$ замість різниці температур. -##### 1-1-3-1 Поправковий коефіцієнт $b_{tr,x}$ +##### 1.1.3.1 Поправковий коефіцієнт $b_{tr,x}$ Коригування узагальненого коефіцієнта теплопередачі враховують поправковим коефіцієнтом $b_{tr,x}=b_U$ що базується на температурі суміжного некондиціонованого об'єму/суміжного приміщення оранжерейного типу. Згідно з п. 8.2.2.3.9 ДСТУ 9190:2022[^2] якщо збирання повних потрібних вхідних даних є занадто трудомістким тa економічно недоцільним, а також для наявних будівель допустимо використовувати значення поправкового коефіцієнта $b_U$, наведені в [таблиці 3](#таблиця-3-значення-поправкового-коефіцієнта-b_u). -##### 1-1-3-2 Значення поправкового коефіцієнта $b_U$ +##### 1.1.3.2 Значення поправкового коефіцієнта $b_U$ | Тип некондиціонованого об'єму | $b_U$ для опалювального періоду | | :------------------------------------------------------------------------------------------------------- | :-----------------------------: | @@ -143,15 +143,15 @@ $b_{tr,x}$ — поправковий коефіцієнт, що станови | Засклена лоджія наявних будівель
- задовільний стан огородження;
- незадовільний стан огородження |
0,7
0,85 | | Засклений балкон наявних будівель
- задовільний стан огородження;
- незадовільний стан огородження |
0,8
0,9 | -###### 1-1-3-2-1 Приведений коефіцієнт теплопередачі +###### 1.1.3.2.1 Приведений коефіцієнт теплопередачі Приведений коефіцієнт теплопередачі $i$-го елемента оболонки будівлі для світлопрозорих конструкції та дверей визначають за формулою: -### 1-2 Теплопередача вентиляцією +### 1.2 Теплопередача вентиляцією -### 1-3 Внутрішні теплонадходження +### 1.3 Внутрішні теплонадходження -### 1-4 Сонячні теплонадходження +### 1.4 Сонячні теплонадходження ## 2 Іменування змінних diff --git a/docs/_obsidian/index.md b/docs/_obsidian/index.md index 061bf3e..4fb1aa4 100644 --- a/docs/_obsidian/index.md +++ b/docs/_obsidian/index.md @@ -11,4 +11,4 @@ nav_order: "1" # Методика розрахунку -Визначення орієнтовного енергоспоживання будівлі виконується за методикою що бере за основу методику розрахунку енергетичного сертифікату будівлі, та описана у розділі [Методика визначення енергоспоживання](./calculation-method.md). +Визначення орієнтовного енергоспоживання будівлі виконується за методикою що бере за основу методику розрахунку енергетичного сертифікату будівлі, та описана у розділі [[calculation-method|методика розрахунку]].