varre=Object.defineProperty;varCe=Object.getOwnPropertyDescriptor;varTe=Object.getOwnPropertyNames;varFe=Object.prototype.hasOwnProperty;varSe=(m,t)=>{for(vareint)re(m,e,{get:t[e],enumerable:!0})},xe=(m,t,e,n)=>{if(t&&typeoft=="object"||typeoft=="function")for(letiofTe(t))!Fe.call(m,i)&&i!==e&&re(m,i,{get:()=>t[i],enumerable:!(n=Ce(t,i))||n.enumerable});returnm};varIe=m=>xe(re({},"__esModule",{value:!0}),m);varLe={};Se(Le,{default:()=>se});module.exports=Ie(Le);varbe=require("obsidian");varA=require("obsidian");varJ=class{constructor(){this.values=newMap}put(t,e){this.values.set(t,e)}get(t,e){varn;return(n=this.values.get(t))!=null?n:e}getFirst(t,e){for(letn=0;n<t.length;n++){leti=t[n];if(this.containsKey(i))returnthis.get(i,e)}returne}containsKey(t){returnthis.values.has(t)}getKeys(){returnArray.from(this.values.keys())}removeKey(t){returnthis.values.delete(t)}clear(){this.values.clear()}};varoe=require("obsidian"),V=class{staticgetFilePathWithNewExtension(t,e){return(0,oe.normalizePath)(t.parent.path+"/"+t.basename+"."+e)}staticgetFilePathExcludingExtension(t){return(0,oe.normalizePath)(t.parent.path+"/"+t.basename)}};vard=class{staticsetActive(t){d.isActive=t,d.isActive||this.clear()}staticsetAutoExpire(t){d.baseMinutesToExpire=t!=null?t:0,d.updateExpiryTime()}staticsetLevel(t){d.level!=t&&(d.allLevels.contains(t)&&(d.level=t),d.level=d.LevelFilename,this.clear())}staticupdateExpiryTime(){d.baseMinutesToExpire==0||d.baseMinutesToExpire==null?d.expiryTime=null:d.expiryTime=Date.now()+d.baseMinutesToExpire*1e3*60}staticputByFile(t,e){if(!d.isActive)return;letn=d.getFileCacheKey(e);this.cache.put(n,t),d.updateExpiryTime()}staticgetByFile(t){if(!d.isActive)returnd.blankPasswordAndHint;this.clearIfExpired(),d.updateExpiryTime();lete=d.getFileCacheKey(t);returnthis.cache.get(e,d.blankPasswordAndHint)}staticputByPath(t,e){if(!d.isActive)return;letn=d.getPathCacheKey(e);this.cache.put(n,t),d.updateExpiryTime()}staticgetByPath(t){if(!d.isActive)returnd.blankPasswordAndHint;this.clearIfExpired(),d.updateExpiryTime();lete=d.getPathCacheKey(t);returnthis.cache.get(e,d.blankPasswordAndHint)}staticgetPathCacheKey(t){lete=t.split("/").slice(0,-1).join("/");switch(d.level){cased.LevelParentPath:returne;default:returnt}}staticgetFileCacheKey(t){switch(d.level){cased.LevelParentPath:returnt.parent.path;default:returnV.getFilePathExcludingExtension(t)}}staticclearIfExpired(){d.expiryTime!=null&&(Date.now()<d.expiryTime||this.clear())}staticclearForFile(t){lete=d.getFileCacheKey(t);this.cache.removeKey(e)}staticclearForPath(t){lete=d.getPathCacheKey(t);this.cache.removeKey(e)}staticclear(){this.cache.clear()}},h=d;h.isActive=!0,h.blankPasswordAndHint={password:"",hint:""},h.cache=newJ,h.baseMinutesToExpire=0,h.expiryTime=null,h.LevelFilename="filename",h.LevelParentPath="parentPath",h.allLevels=[d.LevelFilename,d.LevelParentPath],h.level=d.LevelFilename;var_=classextendsA.PluginSettingTab{constructor(e,n,i,s){super(e,n);this.plugin=n,this.settings=i,this.features=s}display(){let{containerEl:e}=this;e.empty(),e.createEl("h1",{text:"Settings for Meld Encrypt"}),newA.Setting(e).setHeading().setName("Common Settings"),newA.Setting(e).setName("Confirm password?").setDesc("Confirm password when encrypting. (Recommended)").addToggle(r=>{r.setValue(this.settings.confirmPassword).onChange(asynco=>{this.settings.confirmPassword=o,awaitthis.plugin.saveSettings()})});letn=()=>{if(!this.settings.rememberPassword){i.settingEl.hide(),s.settingEl.hide();return}i.settingEl.show(),s.settingEl.show();letr=this.settings.rememberPasswordTimeout,o=`For ${r} minutes`;r==0&&(o="Until Obsidian is closed"),i.setName(`Remember Password (${o})`)};newA.Setting(e).setName("Remember password?").setDesc("Remember the last used passwords when encrypting or decrypting. Passwords are remembered until they timeout or Obsidian is closed").addToggle(r=>{r.setValue(this.settings.rememberPassword).onChange(asynco=>{this.settings.rememberPassword=o,awaitthis.plugin.saveSettings(),h.setActive(this.sett