text: var superLocal=function(){"use strict";return{settings:{dbPrefix:"db",dataFieldName:"data",separator:"_",saveType:"relaxed"},prefixRegex:function(){return new RegExp(this.settings.dbPrefix,"g")},createdRegex:function(){return new RegExp("created","g")},modifiedRegex:function(){return new RegExp("modified","g")},datafieldRegex:function(){return new RegExp(this.settings.dataFieldName,"g")},capable:function(){try{const n="ls";return localStorage.setItem(n,n),localStorage.removeItem(n),!0}catch(n){return!1}},findNewest:function(){var t=0,i=0;const n=Object.keys(localStorage),r=n.length;for(let u=0;u<r;u++)if(this.prefixRegex().test(n[u])&&this.modifiedRegex().test(n[u])){const r=n[u].replace(this.settings.dbPrefix+this.settings.separator,"").replace(this.settings.separator+"modified",""),f=localStorage[this.settings.dbPrefix+this.settings.separator+r+this.settings.separator+"modified"];f>t&&(i=r,t=f)}return i},findOldest:function(){var t=0,i=0;const n=Object.keys(localStorage),r=n.length;for(let u=0;u<r;u++)if(this.prefixRegex().test(n[u])&&this.modifiedRegex().test(n[u])){const r=n[u].replace(this.settings.dbPrefix+this.settings.separator,"").replace(this.settings.separator+"modified",""),f=localStorage[this.settings.dbPrefix+this.settings.separator+r+this.settings.separator+"modified"];(f<t||t===0)&&(i=r,t=f)}return i},findSmallest:function(){var t=0,i=0;const n=Object.keys(localStorage),r=n.length;for(let u=0;u<r;u++)if(this.prefixRegex().test(n[u])&&this.datafieldRegex().test(n[u])){const r=n[u].replace(this.settings.dbPrefix+this.settings.separator,"").replace(this.settings.separator+"modified",""),f=localStorage[this.settings.dbPrefix+this.settings.separator+r+this.settings.separator+this.settings.dataFieldName].length;(f<t||t===0)&&(i=r,t=f)}return i},findBiggest:function(){var t=0,i=0;const n=Object.keys(localStorage),r=n.length;for(let u=0;u<r;u++)if(this.prefixRegex().test(n[u])&&this.datafieldRegex().test(n[u])){const r=n[u].replace(this.settings.dbPrefix+this.settings.separator,"").replace(this.settings.separator+"modified",""),f=localStorage[this.settings.dbPrefix+this.settings.separator+r+this.settings.separator+this.settings.dataFieldName].length;f>t&&(i=r,t=f)}return i},fetch:function(n){const i={};var t;if(n==="newest")t=this.findNewest();else if(n==="oldest")t=this.findOldest();else if(n==="smallest")t=this.findSmallest();else if(n==="biggest")t=this.findBiggest();else if(isNaN(n))t=n;else return!1;const r=this.settings.dbPrefix+this.settings.separator+t+this.settings.separator;return i.uID=t,i[this.settings.dataFieldName]=localStorage[r+this.settings.dataFieldName],i.created=localStorage[r+"created"],i.modified=localStorage[r+"modified"],i},remove:function(n){const t=this.settings.dbPrefix+this.settings.separator+n+this.settings.separator;localStorage.removeItem(t+this.settings.dataFieldName);localStorage.removeItem(t+"created");localStorage.removeItem(t+"modified")},clearAll:function(){localStorage.clear()},listAllCreated:function(){const n=Object.keys(localStorage),i=n.length,t={};for(let r=0;r<i;r++)if(this.prefixRegex().test(n[r])&&this.createdRegex().test(n[r])){const i=n[r].replace(this.settings.dbPrefix+this.settings.separator,"").replace(this.settings.separator+"created","");t[i]=localStorage[this.settings.dbPrefix+this.settings.separator+i+this.settings.separator+"created"]}return t},listAllModified:function(){const n=Object.keys(localStorage),i=n.length,t={};for(let r=0;r<i;r++)if(this.prefixRegex().test(n[r])&&this.modifiedRegex().test(n[r])){const i=n[r].replace(this.settings.dbPrefix+this.settings.separator,"").replace(this.settings.separator+"modified","");t[i]=localStorage[this.settings.dbPrefix+this.settings.separator+i+this.settings.separator+"modified"]}return t},save:function(n,t,i){if(this.capable()===!0){let u;const r=this.settings.dbPrefix+this.settings.separator+n+this.settings.separator;u=typeof i!="undefined"?i:Math.floor((new Date).getTime()/1e3);try{return localStorage.setItem(r+this.settings.dataFieldName,t),localStorage.setItem(r+"modified",u),typeof localStorage[r+"created"]=="undefined"&&localStorage.setItem(r+"created",u),!0}catch(r){return this.remove(n),this.settings.saveType==="greedy"&&(this.remove(this.findOldest()),this.save(n,t,i)),!1}}}}}();