diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..be452b6 Binary files /dev/null and b/.DS_Store differ diff --git a/content/.DS_Store b/content/.DS_Store new file mode 100644 index 0000000..306231d Binary files /dev/null and b/content/.DS_Store differ diff --git a/content/notes/.DS_Store b/content/notes/.DS_Store new file mode 100644 index 0000000..d5b8150 Binary files /dev/null and b/content/notes/.DS_Store differ diff --git a/content/notes/.obsidian/.DS_Store b/content/notes/.obsidian/.DS_Store new file mode 100644 index 0000000..9872521 Binary files /dev/null and b/content/notes/.obsidian/.DS_Store differ diff --git a/content/notes/.obsidian/community-plugins.json b/content/notes/.obsidian/community-plugins.json index 2203720..bd7ffe0 100644 --- a/content/notes/.obsidian/community-plugins.json +++ b/content/notes/.obsidian/community-plugins.json @@ -3,6 +3,5 @@ "obsidian-linter", "table-editor-obsidian", "obsidian-languagetool-plugin", - "obsidian-local-images-plus", - "obsidian-bulk-rename-plugin" + "homepage" ] \ No newline at end of file diff --git a/content/notes/.obsidian/graph.json b/content/notes/.obsidian/graph.json index c879de5..9fe3444 100644 --- a/content/notes/.obsidian/graph.json +++ b/content/notes/.obsidian/graph.json @@ -32,6 +32,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 0.12668834340524918, + "scale": 0.4275731589927159, "close": true } \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/.DS_Store b/content/notes/.obsidian/plugins/.DS_Store new file mode 100644 index 0000000..6029eba Binary files /dev/null and b/content/notes/.obsidian/plugins/.DS_Store differ diff --git a/content/notes/.obsidian/plugins/homepage/data.json b/content/notes/.obsidian/plugins/homepage/data.json new file mode 100644 index 0000000..bfac8ca --- /dev/null +++ b/content/notes/.obsidian/plugins/homepage/data.json @@ -0,0 +1,23 @@ +{ + "version": 4, + "homepages": { + "Main Homepage": { + "value": "index/index", + "kind": "File", + "openOnStartup": true, + "openMode": "Replace all open notes", + "manualOpenMode": "Keep open notes", + "view": "Default view", + "revertView": true, + "openWhenEmpty": true, + "refreshDataview": false, + "autoCreate": false, + "autoScroll": false, + "pin": false, + "commands": [], + "alwaysApply": false, + "hideReleaseNotes": false + } + }, + "separateMobile": false +} \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/homepage/main.js b/content/notes/.obsidian/plugins/homepage/main.js new file mode 100644 index 0000000..e612e3e --- /dev/null +++ b/content/notes/.obsidian/plugins/homepage/main.js @@ -0,0 +1,4 @@ +"use strict";var Be=Object.create;var B=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var qe=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),Ge=(a,t)=>{for(var e in t)B(a,e,{get:t[e],enumerable:!0})},we=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ke(t))!ze.call(a,i)&&i!==e&&B(a,i,{get:()=>t[i],enumerable:!(n=Ue(t,i))||n.enumerable});return a};var $e=(a,t,e)=>(e=a!=null?Be(je(a)):{},we(t||!a||!a.__esModule?B(e,"default",{value:a,enumerable:!0}):e,a)),Qe=a=>we(B({},"__esModule",{value:!0}),a);var Re=qe(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var g=require("obsidian"),ie="YYYY-MM-DD",oe="gggg-[W]ww",Pe="YYYY-MM",Te="YYYY-[Q]Q",De="YYYY";function x(a){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[a]?.enabled}function L(){try{let{internalPlugins:a,plugins:t}=window.app;if(x("daily")){let{format:o,folder:s,template:d}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||ie,folder:s?.trim()||"",template:d?.trim()||""}}let{folder:e,format:n,template:i}=a.getPluginById("daily-notes")?.instance?.options||{};return{format:n||ie,folder:e?.trim()||"",template:i?.trim()||""}}catch(a){console.info("No custom daily note settings found!",a)}}function O(){try{let a=window.app.plugins,t=a.getPlugin("calendar")?.options,e=a.getPlugin("periodic-notes")?.settings?.weekly;if(x("weekly"))return{format:e.format||oe,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let n=t||{};return{format:n.weeklyNoteFormat||oe,folder:n.weeklyNoteFolder?.trim()||"",template:n.weeklyNoteTemplate?.trim()||""}}catch(a){console.info("No custom weekly note settings found!",a)}}function C(){let a=window.app.plugins;try{let t=x("monthly")&&a.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||Pe,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function H(){let a=window.app.plugins;try{let t=x("quarterly")&&a.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||Te,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function R(){let a=window.app.plugins;try{let t=x("yearly")&&a.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||De,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Fe(...a){let t=[];for(let n=0,i=a.length;n{let ee=n(),te=a.clone().set({hour:ee.get("hour"),minute:ee.get("minute"),second:ee.get("second")});return F&&te.add(parseInt(v,10),w),f?te.format(f.substring(1).trim()):te.format(o)}).replace(/{{\s*yesterday\s*}}/gi,a.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,a.clone().add(1,"d").format(o)));return t.foldManager.save(p,m),p}catch(p){console.error(`Failed to create file: '${l}'`,p),new g.Notice("Unable to create new file.")}}function nt(a,t){return t[k(a,"day")]??null}function at(){let{vault:a}=window.app,{folder:t}=L(),e=a.getAbstractFileByPath(g.normalizePath(t));if(!e)throw new se("Failed to find daily notes folder");let n={};return g.Vault.recurseChildren(e,i=>{if(i instanceof g.TFile){let o=A(i,"day");if(o){let s=k(o,"day");n[s]=i}}}),n}var re=class extends Error{};function it(){let{moment:a}=window,t=a.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function ot(a){return it().indexOf(a.toLowerCase())}async function Me(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=O(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*title\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(l,p,P)=>{let T=ot(p);return a.weekday(T).format(P.trim())}));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function st(a,t){return t[k(a,"week")]??null}function rt(){let a={};if(!Le())return a;let{vault:t}=window.app,{folder:e}=O(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new re("Failed to find weekly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"week");if(o){let s=k(o,"week");a[s]=i}}}),a}var le=class extends Error{};async function xe(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=C(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,d));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function lt(a,t){return t[k(a,"month")]??null}function dt(){let a={};if(!Oe())return a;let{vault:t}=window.app,{folder:e}=C(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new le("Failed to find monthly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"month");if(o){let s=k(o,"month");a[s]=i}}}),a}var de=class extends Error{};async function ct(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=H(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,d));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function pt(a,t){return t[k(a,"quarter")]??null}function ut(){let a={};if(!Ce())return a;let{vault:t}=window.app,{folder:e}=H(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new de("Failed to find quarterly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"quarter");if(o){let s=k(o,"quarter");a[s]=i}}}),a}var ce=class extends Error{};async function gt(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=R(),[o,s]=await S(e),d=a.format(n),m=await I(i,d);try{let c=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(l,p,P,T,F,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(T,10),F),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,d).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,d));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${m}'`,c),new g.Notice("Unable to create new file.")}}function mt(a,t){return t[k(a,"year")]??null}function ht(){let a={};if(!He())return a;let{vault:t}=window.app,{folder:e}=R(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new ce("Failed to find yearly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=A(i,"year");if(o){let s=k(o,"year");a[s]=i}}}),a}function ft(){let{app:a}=window,t=a.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=a.plugins.getPlugin("periodic-notes");return e&&e.settings?.daily?.enabled}function Le(){let{app:a}=window;if(a.plugins.getPlugin("calendar"))return!0;let t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.weekly?.enabled}function Oe(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.monthly?.enabled}function Ce(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.quarterly?.enabled}function He(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.yearly?.enabled}function wt(a){let t={day:L,week:O,month:C,quarter:H,year:R}[a];return t()}function yt(a,t){return{day:Ae,month:xe,week:Me}[a](t)}r.DEFAULT_DAILY_NOTE_FORMAT=ie;r.DEFAULT_MONTHLY_NOTE_FORMAT=Pe;r.DEFAULT_QUARTERLY_NOTE_FORMAT=Te;r.DEFAULT_WEEKLY_NOTE_FORMAT=oe;r.DEFAULT_YEARLY_NOTE_FORMAT=De;r.appHasDailyNotesPluginLoaded=ft;r.appHasMonthlyNotesPluginLoaded=Oe;r.appHasQuarterlyNotesPluginLoaded=Ce;r.appHasWeeklyNotesPluginLoaded=Le;r.appHasYearlyNotesPluginLoaded=He;r.createDailyNote=Ae;r.createMonthlyNote=xe;r.createPeriodicNote=yt;r.createQuarterlyNote=ct;r.createWeeklyNote=Me;r.createYearlyNote=gt;r.getAllDailyNotes=at;r.getAllMonthlyNotes=dt;r.getAllQuarterlyNotes=ut;r.getAllWeeklyNotes=rt;r.getAllYearlyNotes=ht;r.getDailyNote=nt;r.getDailyNoteSettings=L;r.getDateFromFile=A;r.getDateFromPath=tt;r.getDateUID=k;r.getMonthlyNote=lt;r.getMonthlyNoteSettings=C;r.getPeriodicNoteSettings=wt;r.getQuarterlyNote=pt;r.getQuarterlyNoteSettings=H;r.getTemplateInfo=S;r.getWeeklyNote=st;r.getWeeklyNoteSettings=O;r.getYearlyNote=mt;r.getYearlyNoteSettings=R});var kt={};Ge(kt,{default:()=>X});module.exports=Qe(kt);var N=require("obsidian");var b=require("obsidian");var Ie=require("obsidian");var E=require("obsidian");function D(a){return a?a.extension=="md"?a.path.slice(0,-3):a.path:""}function ye(a){return a.split("/").slice(-1)[0].contains(".")?a:`${a}.md`}function ne(a,t=void 0){let e=a.vault.getFiles();if(t){let n=a.vault.getFolderByPath(t);if(!n)return;e=ve(n)}if(e.filter(n=>["md","canvas"].contains(n.extension)),e.length){let n=Math.floor(Math.random()*e.length);return D(e[n])}}function ve(a){let t=[];for(let e of a.children)e instanceof E.TFolder?t.push(...ve(e)):t.push(e);return t}function be(a){return a.workspace.getActiveViewOfType(E.View)?.getViewType()=="empty"}function ae(a,t){return a.localeCompare(t,void 0,{sensitivity:"accent"})===0}function U(a){return new Promise(t=>setTimeout(t,a))}async function Ne(a){let t=a.workspace.getLayout();t.main={id:"5324373015726ba8",type:"split",children:[{id:"4509724f8bf84da7",type:"tabs",children:[{id:"e7a7b303c61786dc",type:"leaf",state:{type:"empty",state:{},icon:"lucide-file",title:"New tab"}}]}],direction:"vertical"},t.active="e7a7b303c61786dc",await a.workspace.changeLayout(t),E.Platform.isMobile&&(a.workspace.rightSplit?.updateInfo(),Je(a))}function Je(a){let t=a.internalPlugins.plugins.sync?.instance;t&&a.workspace.onLayoutReady(()=>{t.statusIconEl=a.workspace.rightSplit.addHeaderButton("sync-small",t.openStatusIconMenu.bind(t)),t.statusIconEl.addEventListener("contextmenu",t.openStatusIconMenu.bind(t)),t.statusIconEl.addClass("sync-status-icon")})}function ke(a){let t=a.internalPlugins.plugins.sync,e=[new Promise(n=>{let i=async()=>{n(),a.workspace.off("layout-change",i)};a.workspace.on("layout-change",i)})];return t.enabled&&t.instance.syncing&&e.push(new Promise(n=>{let i=async()=>{n(),t.instance.off("status-change",i)};t.instance.on("status-change",i)})),Promise.race([Promise.all(e),new Promise(n=>setTimeout(n,1500))])}var u=$e(Re()),pe={["Daily Note"]:{noun:"day",adjective:"daily",create:u.createDailyNote,get:u.getDailyNote,getAll:u.getAllDailyNotes},["Weekly Note"]:{noun:"week",adjective:"weekly",create:u.createWeeklyNote,get:u.getWeeklyNote,getAll:u.getAllWeeklyNotes},["Monthly Note"]:{noun:"month",adjective:"monthly",create:u.createMonthlyNote,get:u.getMonthlyNote,getAll:u.getAllMonthlyNotes},["Yearly Note"]:{noun:"year",adjective:"yearly",create:u.createYearlyNote,get:u.getYearlyNote,getAll:u.getAllYearlyNotes}},K=["Daily Note","Weekly Note","Monthly Note","Yearly Note"],_e="Date-dependent file",ue="Date-dependent notes in Homepage have been removed. Set your Homepage as a Periodic or Daily Note instead.";async function We(a,t){let e=t.communityPlugins["periodic-notes"],n=pe[a],i=(0,Ie.moment)().startOf(n.noun),o;if(Ye(e)){let s=n.getAll();Object.keys(s).length?o=n.get(i,s)||await n.create(i):o=await n.create(i),o||(o=n.get(i,s))}else e.cache.initialize(),o=e.getPeriodicNote(n.noun,i)||await e.createPeriodicNote(n.noun,i);return D(o)}function Ve(a,t){if(a=="Daily Note"&&t.internalPlugins["daily-notes"]?.enabled)return!0;let e=t.communityPlugins["periodic-notes"];if(!e)return!1;if(Ye(e)){let n=pe[a].adjective;return e.settings[n]?.enabled}else{let n=pe[a].noun;return e?.calendarSetManager?.getActiveSet()[n]?.enabled}}function j(a){let t=a.internalPlugins["daily-notes"];return t?.enabled&&t?.instance.options.autorun}function Ye(a){return(a?.manifest.version||"0").startsWith("0")}var y=require("obsidian");var h=require("obsidian");var z=class extends h.AbstractInputSuggest{getSuggestions(e){let n=this.app.vault.getAllLoadedFiles(),i=[],o=e.toLowerCase();return n.forEach(s=>{s instanceof h.TFile&&["md","canvas"].contains(s.extension)&&s.path.toLowerCase().contains(o)&&i.push(s)}),i}renderSuggestion(e,n){e.extension=="md"?n.setText(D(e)):(n.setText(e.path.slice(0,-7)),n.insertAdjacentHTML("beforeend",''))}selectSuggestion(e){this.textInputEl.value=D(e),this.textInputEl.trigger("input"),this.close()}},q=class extends h.AbstractInputSuggest{getSuggestions(e){let n=e.toLowerCase();return this.app.vault.getAllFolders().filter(i=>i.path.toLowerCase().contains(n))}renderSuggestion(e,n){n.setText(e.path)}selectSuggestion(e){this.textInputEl.value=e.path,this.textInputEl.trigger("input"),this.close()}},G=class extends h.AbstractInputSuggest{getSuggestions(e){let n=Object.keys(this.app.internalPlugins.plugins.workspaces?.instance.workspaces),i=e.toLowerCase();return n.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,n){n.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},$=class{constructor(t){this.app=t.plugin.app,this.homepage=t.plugin.homepage,this.tab=t,this.container=t.containerEl.createDiv({cls:"nv-command-box"}),this.dropzone=document.createElement("div"),this.dropzone.className="nv-command-pill nv-dropzone",this.dropzone.addEventListener("dragenter",e=>e.preventDefault()),this.dropzone.addEventListener("dragover",e=>e.preventDefault()),this.dropzone.addEventListener("drop",()=>this.terminateDrag()),this.update()}update(){this.container.innerHTML="",this.activeDrag=null,this.activeCommand=null;for(let t of this.homepage.data.commands){let e=this.app.commands.findCommand(t.id),n=this.container.createDiv({cls:"nv-command-pill",attr:{draggable:!0}});n.addEventListener("dragstart",o=>{o.dataTransfer.effectAllowed="move",this.activeCommand=this.homepage.data.commands.splice(this.indexOf(n),1)[0],this.activeDrag=n,this.dropzone.style.width=`${n.clientWidth}px`,this.dropzone.style.height=`${n.clientHeight}px`}),n.addEventListener("dragover",o=>this.moveDropzone(n,o)),n.addEventListener("drop",o=>o.preventDefault()),n.addEventListener("dragend",()=>this.terminateDrag()),n.createSpan({cls:"nv-command-text",text:e?.name??t.id});let i=new h.ButtonComponent(n).setIcon("route").setClass("clickable-icon").setClass("nv-command-period").onClick(o=>this.showMenu(t,o,i));t.period!="Both"&&(i.setClass("nv-command-selected"),i.setIcon(""),i.buttonEl.createSpan({text:t.period})),new h.ButtonComponent(n).setIcon("trash-2").setClass("clickable-icon").setClass("nv-command-delete").onClick(()=>this.delete(t)),e||(n.classList.add("nv-command-invalid"),n.prepend((0,h.getIcon)("ban")),(0,h.setTooltip)(n,"This command can't be found, so it won't be executed. It may belong to a disabled plugin.",{delay:.001}))}new h.ButtonComponent(this.container).setClass("nv-command-add-button").setButtonText("Add...").onClick(()=>{new ge(this.tab).open()})}delete(t){this.homepage.data.commands.remove(t),this.homepage.save(),this.update()}showMenu(t,e,n){let i=new h.Menu;for(let s of Object.values(Q))i.addItem(d=>{d.setTitle(s),d.setChecked(t.period==s),d.onClick(()=>{t.period=s,this.homepage.save(),this.update()})});let o=n.buttonEl.getBoundingClientRect();i.showAtPosition({x:o.x-22,y:o.y+o.height+8})}indexOf(t){return Array.from(this.container.children).indexOf(t)}moveDropzone(t,e){if(!this.activeDrag)return;this.activeDrag.hidden=!0;let n=t.getBoundingClientRect();e.xawait this.copyDebugInfo()})}sanitiseNote(e){return e===null||e.match(/^\s*$/)!==null?null:(0,y.normalizePath)(e)}display(){let e=this.plugin.homepage.data.kind=="Workspace",n=this.plugin.homepage.data.kind,i=j(this.plugin),o=!1,s=z;n=="Random in folder"?s=q:e&&(s=G),this.containerEl.empty(),this.elements={};let d=new y.Setting(this.containerEl).setName("Homepage").addDropdown(async l=>{for(let p of Object.values(_)){if(!this.plugin.hasRequiredPlugin(p))if(p==this.plugin.homepage.data.kind)o=!0;else{l.selectEl.createEl("option",{text:p,attr:{disabled:!0}});continue}l.addOption(p,p)}l.setValue(this.plugin.homepage.data.kind),l.onChange(async p=>{this.plugin.homepage.data.kind=p,p=="Random file"&&(this.plugin.homepage.data.value=""),await this.plugin.homepage.save(),this.display()})});d.settingEl.id="nv-main-setting";let m=d.settingEl.createEl("article",{text:vt[n],attr:{id:"nv-desc"}});o&&m.createDiv({text:"The plugin required for this homepage type isn't available.",cls:"mod-warning"}),fe.includes(n)?d.addText(l=>{l.setDisabled(!0)}):d.addText(l=>{new s(this.app,l.inputEl),l.setPlaceholder(M.value),l.setValue(M.value==this.plugin.homepage.data.value?"":this.plugin.homepage.data.value),l.onChange(async p=>{this.plugin.homepage.data.value=this.sanitiseNote(p)||M.value,await this.plugin.homepage.save()})}),this.addToggle("Open on startup","When launching Obsidian, open the homepage.","openOnStartup",l=>this.display()),i&&(this.elements.openOnStartup.descEl.createDiv({text:`This setting has been disabled, as it isn't compatible with Daily Notes' "Open daily note on startup" functionality. To use it, disable the Daily Notes setting.`,attr:{class:"mod-warning"}}),this.disableSetting("openOnStartup")),this.addToggle("Open when empty","When there are no tabs open, open the homepage.","openWhenEmpty"),this.addToggle("Use when opening normally","Use homepage settings when opening it normally, such as from a link or the file browser.","alwaysApply");let c=new y.Setting(this.containerEl).setName("Separate mobile homepage").setDesc("For mobile devices, store the homepage and its settings separately.").addToggle(l=>l.setValue(this.plugin.settings.separateMobile).onChange(async p=>{this.plugin.settings.separateMobile=p,this.plugin.homepage=this.plugin.getHomepage(),await this.plugin.saveSettings(),this.display()}));if(this.plugin.settings.separateMobile){let l=y.Platform.isMobile?"desktop":"mobile",p=document.createElement("div");c.setClass("nv-mobile-setting"),p.className="mod-warning nv-mobile-info",p.innerHTML=`Mobile settings are stored separately. Therefore, changes to other settings will not affect + ${l} devices. To edit ${l} settings, use a ${l} device.`,c.settingEl.append(p)}this.addHeading("Commands","commandsHeading"),this.containerEl.createDiv({cls:"nv-command-desc setting-item-description",text:"Select commands that will be executed when opening the homepage."}),this.commandBox=new $(this),this.addHeading("Vault environment","vaultHeading"),this.addDropdown("Opening method","Determine how extant tabs and views are affected on startup.","openMode",Z),this.addDropdown("Manual opening method","Determine how extant tabs and views are affected when opening with commands or the ribbon button.","manualOpenMode",Z),this.addToggle("Pin","Pin the homepage when opening.","pin"),this.addToggle("Hide release notes","Never display release notes when Obsidian updates.","hideReleaseNotes"),this.addToggle("Auto-create","When the homepage doesn't exist, create a note with its name.","autoCreate"),this.elements.autoCreate.descEl.createDiv({text:"If this vault is synced using unofficial services, this may lead to content being overwritten.",cls:"mod-warning"}),this.addHeading("Opened view","paneHeading"),this.addDropdown("Homepage view","Choose what view to open the homepage in.","view",he),this.addToggle("Revert view on close","When navigating away from the homepage, restore the default view.","revertView"),this.addToggle("Auto-scroll","When opening the homepage, scroll to the bottom and focus on the last line.","autoScroll"),"dataview"in this.plugin.communityPlugins&&(this.addToggle("Refresh Dataview","Always attempt to reload Dataview views when opening the homepage.","refreshDataview"),this.elements.refreshDataview.descEl.createDiv({text:"Requires Dataview auto-refresh to be enabled.",attr:{class:"mod-warning"}})),y.Platform.isMobile||new y.ButtonComponent(this.containerEl).setButtonText("Copy debug info").setClass("nv-debug-button").onClick(async()=>await this.copyDebugInfo()),(e||n==="Nothing")&&this.disableSettings("openWhenEmpty","alwaysApply","vaultHeading","openMode","manualOpenMode","autoCreate","pin"),(e||["Nothing","Graph view"].includes(n))&&this.disableSettings("paneHeading","view","revertView","autoScroll","refreshDataview"),(!this.plugin.homepage.data.openOnStartup||i)&&this.disableSetting("openMode"),K.includes(this.plugin.homepage.data.kind)&&this.disableSetting("autoCreate")}disableSetting(e){this.elements[e]?.settingEl.setAttribute("nv-greyed","")}disableSettings(...e){e.forEach(n=>this.disableSetting(n))}addHeading(e,n){let i=new y.Setting(this.containerEl).setHeading().setName(e);this.elements[n]=i}addDropdown(e,n,i,o,s){let d=new y.Setting(this.containerEl).setName(e).setDesc(n).addDropdown(async m=>{for(let c of Object.values(o))m.addOption(c,c);m.setValue(this.plugin.homepage.data[i]),m.onChange(async c=>{this.plugin.homepage.data[i]=c,await this.plugin.homepage.save(),s&&s(c)})});return this.elements[i]=d,d}addToggle(e,n,i,o){let s=new y.Setting(this.containerEl).setName(e).setDesc(n).addToggle(d=>d.setValue(this.plugin.homepage.data[i]).onChange(async m=>{this.plugin.homepage.data[i]=m,await this.plugin.homepage.save(),o&&o(m)}));return this.elements[i]=s,s}async copyDebugInfo(){let e=this.app.vault.config,n={...this.settings,_defaultViewMode:e.defaultViewMode||"default",_livePreview:e.livePreview!==void 0?e.livePreview:"default",_focusNewTab:e.focusNewTab!==void 0?e.focusNewTab:"default",_plugins:Object.keys(this.plugin.communityPlugins),_internalPlugins:Object.values(this.plugin.internalPlugins).flatMap(i=>i.enabled?[i.instance.id]:[]),_obsidianVersion:window.electron?.ipcRenderer.sendSync("version")||"unknown"};await navigator.clipboard.writeText(JSON.stringify(n)),new y.Notice("Copied homepage debug information to clipboard")}};var bt=["markdown","canvas","kanban"],V="Main Homepage",Y="Mobile Homepage",Z=(n=>(n.ReplaceAll="Replace all open notes",n.ReplaceLast="Replace last note",n.Retain="Keep open notes",n))(Z||{}),he=(i=>(i.Default="Default view",i.Reading="Reading view",i.Source="Editing view (Source)",i.LivePreview="Editing view (Live Preview)",i))(he||{}),_=(l=>(l.File="File",l.Workspace="Workspace",l.Random="Random file",l.RandomFolder="Random in folder",l.Graph="Graph view",l.None="Nothing",l.DailyNote="Daily Note",l.WeeklyNote="Weekly Note",l.MonthlyNote="Monthly Note",l.YearlyNote="Yearly Note",l))(_||{}),Q=(n=>(n.Both="Both",n.Startup="Startup only",n.Manual="Manual only",n))(Q||{}),fe=["Random file","Graph view","Nothing",...K],W=class{constructor(t,e){this.lastView=void 0;this.openedViews=new WeakMap;this.name=t,this.plugin=e,this.app=e.app;let n=this.plugin.settings.homepages[t];n?this.data=Object.assign({},M,n):(this.plugin.settings.homepages[t]={...M},this.data=this.plugin.settings.homepages[t])}async open(t=!1){if(!this.plugin.hasRequiredPlugin(this.data.kind)){new b.Notice("Homepage cannot be opened due to plugin unavailablity.");return}if(this.data.kind==="Workspace")await this.launchWorkspace();else if(this.data.kind!=="Nothing"){let n=this.plugin.loaded?this.data.manualOpenMode:this.data.openMode;t&&(n="Keep open notes"),await this.launchLeaf(n)}if(this.data.commands.length<1)return;let e=this.plugin.loaded?"Startup only":"Manual only";await ke(this.app);for(let{id:n,period:i}of this.data.commands)i!==e&&this.app.commands.executeCommandById(n)}async launchWorkspace(){let t=this.plugin.internalPlugins.workspaces?.instance;if(!(this.data.value in t.workspaces)){new b.Notice(`Cannot find the workspace "${this.data.value}" to use as the homepage.`);return}t.loadWorkspace(this.data.value),await U(100)}async launchLeaf(t){let e;if(this.computedValue=await this.computeValue(),this.plugin.executing=!0,!(j(this.plugin)&&!this.plugin.loaded)){if(t!=="Replace all open notes"){let n=this.getOpened();if(n.length>0){this.app.workspace.setActiveLeaf(n[0]),await this.configure(n[0]);return}else t=="Keep open notes"&&be(this.app)&&(t="Replace last note")}t!=="Keep open notes"&&this.app.workspace.getActiveViewOfType(b.View)?.leaf.setPinned(!1),t==="Replace all open notes"&&(this.app.workspace?.floatingSplit?.children&&(await U(0),this.app.workspace.floatingSplit.children.forEach(n=>n.win.close())),await Ne(this.app),await U(0)),this.data.kind==="Graph view"?e=await this.launchGraph(t):e=await this.launchNote(t),e&&await this.configure(e)}}async launchGraph(t){if(t==="Keep open notes"){let e=this.app.workspace.getLeaf("tab");this.app.workspace.setActiveLeaf(e)}return this.app.commands.executeCommandById("graph:open"),this.app.workspace.getActiveViewOfType(b.View)?.leaf}async launchNote(t){let e=this.app.metadataCache.getFirstLinkpathDest(this.computedValue,"/");if(!e){if(!this.data.autoCreate){new b.Notice(`Homepage "${this.computedValue}" does not exist.`);return}e=await this.app.vault.create(ye(this.computedValue),"")}let n=await this.app.vault.cachedRead(e),i=this.app.workspace.getLeaf(t=="Keep open notes");return await i.openFile(e),this.app.workspace.setActiveLeaf(i),n!==await this.app.vault.read(e)&&await this.app.vault.modify(e,n),i}async configure(t){this.plugin.executing=!1;let e=t.view;if(!(e instanceof b.MarkdownView)){this.data.pin&&e.leaf.setPinned(!0),this.configurePlugins();return}let n=e.getState();if(this.data.revertView&&(this.lastView=new WeakRef(e)),this.data.autoScroll){let i=e.editor.lineCount();n.mode=="preview"?e.previewMode.applyScroll(i-4):(e.editor.setCursor(i),e.editor.focus())}if(this.data.pin&&e.leaf.setPinned(!0),this.data.view!=="Default view"){switch(this.data.view){case"Editing view (Live Preview)":case"Editing view (Source)":n.mode="source",n.source=this.data.view!="Editing view (Live Preview)";break;case"Reading view":n.mode="preview";break}await e.leaf.setViewState({type:"markdown",state:n})}this.configurePlugins()}configurePlugins(){this.plugin.loaded&&this.data.refreshDataview&&this.plugin.communityPlugins.dataview?.index.touch(),this.plugin.communityPlugins["obsidian-file-color"]?.generateColorStyles()}getOpened(){return this.data.kind=="Graph view"?this.app.workspace.getLeavesOfType("graph"):bt.flatMap(e=>this.app.workspace.getLeavesOfType(e)).filter(e=>{let n=e.view.getState().file;return ae(n.endsWith("md")?n.slice(0,-3):n,this.computedValue)})}async computeValue(){let t=this.data.value,e;switch(this.data.kind){case"Random file":e=ne(this.app),e&&(t=e);break;case"Random in folder":e=ne(this.app,t),e&&(t=e);break;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":t=await We(this.data.kind,this.plugin);break}return t}async save(){this.plugin.settings.homepages[this.name]=this.data,await this.plugin.saveSettings()}async setToActiveFile(){this.data.value=D(this.app.workspace.getActiveFile()),await this.save(),new b.Notice(`The homepage has been changed to "${this.data.value}".`)}canSetToFile(){return this.app.workspace.getActiveFile()!==null&&!fe.includes(this.data.kind)}async revertView(){if(this.lastView==null||this.data.view=="Default view")return;let t=this.lastView.deref();if(!t||ae(D(t.file),this.computedValue))return;let e=t.getState(),n=this.app.vault.config,i=n.defaultViewMode||"source",o=n.livePreview!==void 0?!n.livePreview:!1;t.leaf.getViewState().type=="markdown"&&(i!=e.mode||o!=e.source)&&(e.mode=i,e.source=o,await t.leaf.setViewState({type:"markdown",state:e,active:!0})),this.lastView=void 0}async openWhenEmpty(){if(!this.plugin.loaded||this.plugin.executing)return;let t=this.app.workspace.getActiveViewOfType(b.View)?.leaf;t?.getViewState().type!=="empty"||t.parentSplit.children.length!=1||await this.open(!0)}async apply(){let t=this.app.workspace.getActiveViewOfType(b.FileView);if(!t)return;let e=D(t.file);this.openedViews.get(t)!==e&&(this.openedViews.set(t,e),e===await this.computeValue()&&this.plugin.loaded&&!this.plugin.executing&&await this.configure(t.leaf))}};var Nt='',X=class extends N.Plugin{constructor(){super(...arguments);this.newRelease=!1;this.loaded=!1;this.executing=!1;this.onLayoutChange=async()=>{this.homepage.data.revertView&&await this.homepage.revertView(),this.homepage.data.openWhenEmpty&&await this.homepage.openWhenEmpty(),this.homepage.data.alwaysApply&&await this.homepage.apply()};this.hideInterstitial=()=>{this.interstitial?.detach(),window.removeEventListener("error",this.hideInterstitial)}}async onload(){let e=this.app.workspace.layoutReady;e||this.showInterstitial(),this.patchReleaseNotes(),this.settings=await this.loadSettings(),this.internalPlugins=this.app.internalPlugins.plugins,this.communityPlugins=this.app.plugins.plugins,this.homepage=this.getHomepage(),this.app.workspace.onLayoutReady(async()=>{let n=this.homepage.data.openOnStartup&&!e&&!await this.hasUrlParams();this.patchNewTabPage(),n&&await this.homepage.open(),this.loaded=!0,this.unpatchReleaseNotes(),this.hideInterstitial()}),(0,N.addIcon)("homepage",Nt),this.addRibbonIcon("homepage","Open homepage",n=>this.homepage.open(n.button==1||n.button==2||N.Keymap.isModifier(n,"Mod"))).setAttribute("id","nv-homepage-icon"),this.registerEvent(this.app.workspace.on("layout-change",this.onLayoutChange)),this.addSettingTab(new J(this.app,this)),this.addCommand({id:"open-homepage",name:"Open homepage",callback:()=>this.homepage.open()}),this.addCommand({id:"set-to-active-file",name:"Set to active file",checkCallback:n=>{if(n)return this.homepage.canSetToFile();this.homepage.setToActiveFile()}})}async onunload(){this.app.workspace.off("layout-change",this.onLayoutChange),this.unpatchNewTabPage()}getHomepage(){return this.settings.separateMobile&&N.Platform.isMobile?(Y in this.settings.homepages||(this.settings.homepages[Y]={...this.settings.homepages?.[V]},this.settings.homepages[Y].commands=[...this.settings.homepages?.[V]?.commands]),new W(Y,this)):new W(V,this)}async loadSettings(){let e=await this.loadData();return e?.version!==4?e?this.upgradeSettings(e):Object.assign({},me):e}async saveSettings(){await this.saveData(this.settings)}showInterstitial(){this.interstitial=createDiv({cls:"nv-homepage-interstitial"}),document.body.append(this.interstitial),window.addEventListener("error",this.hideInterstitial)}async hasUrlParams(){let e,n;if(N.Platform.isMobile){let i=await window.Capacitor.Plugins.App.getLaunchUrl();if(!i)return!1;let o=new URL(i.url);n=Array.from(o.searchParams.keys()),e=o.hostname}else if(window.OBS_ACT)n=Object.keys(window.OBS_ACT),e=window.OBS_ACT.action;else return!1;return["open","advanced-uri"].includes(e)&&["file","filepath","workspace"].some(i=>n.includes(i))}hasRequiredPlugin(e){switch(e){case"Workspace":return this.internalPlugins.workspaces?.enabled;case"Graph view":return this.internalPlugins.graph?.enabled;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":return Ve(e,this);default:return!0}}patchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.nvOrig_checkForNewTab=e.checkForNewTab,e.checkForNewTab=async n=>{if(!(this&&this.executing))return await e.nvOrig_checkForNewTab(n)})}unpatchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.checkForNewTab=e._checkForNewTab)}patchReleaseNotes(){this.app.nvOrig_showReleaseNotes=this.app.showReleaseNotes,this.app.showReleaseNotes=()=>this.newRelease=!0}unpatchReleaseNotes(){this.newRelease&&!this.homepage.data.hideReleaseNotes&&this.app.nvOrig_showReleaseNotes(),this.app.showReleaseNotes=this.app.nvOrig_showReleaseNotes}upgradeSettings(e){if(e.version==3){let i=e,o=!1;for(let s of Object.values(i.homepages))s.commands=s.commands.map(d=>({id:d,period:"Both"})),s.kind==_e&&(o=!0,s.kind="Daily Note");return o&&new N.Notice(ue),i.version=4,this.saveData(i),i}let n=Object.assign({},me);return e.workspaceEnabled?(e.value=e.workspace,e.kind="Workspace"):e.momentFormat?(e.kind="Daily Note",new N.Notice(ue)):(e.value=e.defaultNote,e.kind="File"),e.commands=[],delete e.workspace,delete e.momentFormat,delete e.defaultNote,delete e.useMoment,delete e.workspaceEnabled,n.homepages[V]=e,this.saveData(n),n}}; + +/* nosourcemap */ \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/homepage/manifest.json b/content/notes/.obsidian/plugins/homepage/manifest.json new file mode 100644 index 0000000..1fd2495 --- /dev/null +++ b/content/notes/.obsidian/plugins/homepage/manifest.json @@ -0,0 +1,13 @@ +{ + "id": "homepage", + "name": "Homepage", + "version": "4.1", + "minAppVersion": "1.4.10", + "description": "Open a specified note, canvas, or workspace on startup, or set it for quick access later.", + "author": "novov", + "authorUrl": "https://novov.me", + "isDesktopOnly": false, + "fundingUrl": { + "Ko-fi": "https://ko-fi.com/novov" + } +} diff --git a/content/notes/.obsidian/plugins/homepage/styles.css b/content/notes/.obsidian/plugins/homepage/styles.css new file mode 100644 index 0000000..4f36ca3 --- /dev/null +++ b/content/notes/.obsidian/plugins/homepage/styles.css @@ -0,0 +1,238 @@ +.nv-homepage-interstitial { + position: absolute; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + background: var(--background-primary); + z-index: 9999; + animation: 0.02s ease-in 0.5s forwards nv-interstitial-destroy; + pointer-events: none; +} + +@keyframes nv-interstitial-destroy { + from { opacity: 1; } + to { opacity: 0; } +} + +.setting-item[nv-greyed] { + opacity: .5; + pointer-events: none !important; +} + +#nv-main-setting { + flex-wrap: wrap; + margin-bottom: 30px; +} + +#nv-main-setting .setting-item-control { + padding-top: var(--size-4-2); + flex-basis: 100%; + align-items: stretch; +} + +#nv-main-setting .setting-item-control input, #nv-main-setting .setting-item-control select { + font-size: var(--font-ui-medium); + font-weight: 600; +} + +#nv-main-setting .setting-item-control select { + padding: var(--size-4-3) var(--size-4-4); + padding-right: var(--size-4-8); + height: auto; +} + +#nv-main-setting .setting-item-control input { + flex-grow: 1; + padding: var(--size-4-5) var(--size-4-4); +} + +#nv-main-setting .setting-item-control input[disabled] { + opacity: 0.3; +} + +#nv-main-setting #nv-desc, #nv-main-setting #nv-info { + flex-basis: 100%; +} + +#nv-main-setting #nv-desc { + font-weight: 500; + color: var(--text-normal); + font-size: var(--font-ui-small); + padding: 10px 0 0; +} + +#nv-main-setting #nv-desc.mod-warning { + color: var(--text-error); +} + +#nv-main-setting #nv-desc code { + font-family: var(--font-monospace); + font-size: var(--font-smaller); + border-radius: var(--radius-s); +} + +#nv-main-setting #nv-desc small { + display: block; + font-weight: 400; + color: var(--text-muted); + font-size: calc(var(--font-ui-smaller) * 0.9); + padding: 5px 0 0; +} + +.nv-mobile-setting { + flex-wrap: wrap; + row-gap: var(--size-2-2); +} + +.nv-mobile-setting .nv-mobile-info { + font-size: var(--font-ui-smaller); + width: 100%; + margin-right: var(--size-4-18); +} + +.nv-command-desc { + padding: 1.2em 0 0; + border-top: 1px solid var(--background-modifier-border); +} + +.nv-command-box { + margin: 1em 0 1.75em; + display: flex; + flex-wrap: wrap; + gap: 12px; + align-items: center; +} + +.nv-command-pill { + background-color: var(--background-secondary); + border: 1px solid var(--background-modifier-border-hover); + border-radius: var(--radius-s); + font-size: var(--font-ui-small); + padding: var(--size-2-1) var(--size-2-2) var(--size-2-1) var(--size-2-3) ; +} + +.nv-command-pill.nv-command-invalid { + color: var(--text-faint); +} + +.nv-command-pill button { + display: inline-block; + padding: 0; + margin: 0 0 0 3px; + vertical-align: bottom; +} + +.nv-command-pill button:first-of-type { + margin-left: var(--size-4-2); +} + +.nv-command-pill button.nv-command-selected { + margin-left: var(--size-2-2); + padding: 0 var(--size-2-1); +} + +.nv-command-pill button.nv-command-selected span { + color: var(--text-accent); + display: inline-block; + font-size: 0.9em; + vertical-align: top; + position: relative; + top: -1px; +} + +.nv-command-pill > .svg-icon, .nv-command-pill button .svg-icon { + height: 1em; + width: 1em; +} + +.nv-command-pill > .svg-icon { + vertical-align: text-bottom; + position: relative; + margin: 0 var(--size-2-1) 0 0; +} + +.nv-command-pill.nv-dragging { + background-color: transparent; +} + +.nv-command-add-button { + font-size: var(--font-ui-small); + padding: var(--size-2-2) var(--size-4-2); + height: auto; +} + +#nv-main-setting + .setting-item, .nv-command-desc + .setting-item { + padding-top: 20px; + border-top: none !important; +} + +.nv-debug-button { + margin: 3em 0 -0.2em; + font-size: var(--font-ui-smaller); + padding: 0; + height: auto; + float: right; + box-shadow: none !important; + background: none !important; + color: var(--text-accent); + font-weight: 600; + cursor: pointer; +} + +.nv-debug-button:hover, .nv-debug-button:active { + text-decoration: underline; +} + +.is-phone #nv-main-setting .setting-item-control { + flex-wrap: wrap; + justify-content: flex-start; +} + +.is-phone #nv-main-setting .setting-item-control select { + width: auto; + max-width: auto; +} + +.is-phone .nv-mobile-setting { + row-gap: var(--size-4-2); +} + +.is-phone .nv-mobile-setting .setting-item-info { + max-width: calc(100% - 100px); +} + +.is-phone .nv-mobile-setting { + row-gap: var(--size-4-2); +} + +.is-phone .nv-mobile-setting .setting-item-info { + max-width: calc(100% - 100px); +} + +.is-phone .nv-command-pill { + width: 100%; + border: none; + background: none; + padding: 0 0 var(--size-4-2); + display: flex; + gap: var(--size-4-4); + align-items: baseline; +} + +.is-phone .nv-command-pill .nv-command-text { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; +} + +.is-phone .nv-command-pill, .is-phone .nv-command-add-button { + font-size: var(--font-ui-medium); + justify-content: space-between; +} + +.is-phone .nv-command-pill button { + line-height: var(--font-ui-medium); + height: 100%; + margin: 0 !important; +} diff --git a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/data.json b/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/data.json deleted file mode 100644 index f93824f..0000000 --- a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "folderName": "temp", - "fileNames": [], - "existingSymbol": "", - "replacePattern": "", - "regExpState": { - "regExp": "", - "flags": [], - "withRegExpForReplaceSymbols": false - }, - "tags": [], - "viewType": "folder" -} \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/main.js b/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/main.js deleted file mode 100644 index b486176..0000000 --- a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/main.js +++ /dev/null @@ -1,9163 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ - -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/core-js-pure/internals/global.js -var require_global = __commonJS({ - "node_modules/core-js-pure/internals/global.js"(exports, module2) { - var check = function(it) { - return it && it.Math == Math && it; - }; - module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || function() { - return this; - }() || Function("return this")(); - } -}); - -// node_modules/core-js-pure/internals/fails.js -var require_fails = __commonJS({ - "node_modules/core-js-pure/internals/fails.js"(exports, module2) { - module2.exports = function(exec) { - try { - return !!exec(); - } catch (error) { - return true; - } - }; - } -}); - -// node_modules/core-js-pure/internals/function-bind-native.js -var require_function_bind_native = __commonJS({ - "node_modules/core-js-pure/internals/function-bind-native.js"(exports, module2) { - var fails = require_fails(); - module2.exports = !fails(function() { - var test = function() { - }.bind(); - return typeof test != "function" || test.hasOwnProperty("prototype"); - }); - } -}); - -// node_modules/core-js-pure/internals/function-apply.js -var require_function_apply = __commonJS({ - "node_modules/core-js-pure/internals/function-apply.js"(exports, module2) { - var NATIVE_BIND = require_function_bind_native(); - var FunctionPrototype = Function.prototype; - var apply = FunctionPrototype.apply; - var call = FunctionPrototype.call; - module2.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() { - return call.apply(apply, arguments); - }); - } -}); - -// node_modules/core-js-pure/internals/function-uncurry-this.js -var require_function_uncurry_this = __commonJS({ - "node_modules/core-js-pure/internals/function-uncurry-this.js"(exports, module2) { - var NATIVE_BIND = require_function_bind_native(); - var FunctionPrototype = Function.prototype; - var bind = FunctionPrototype.bind; - var call = FunctionPrototype.call; - var uncurryThis = NATIVE_BIND && bind.bind(call, call); - module2.exports = NATIVE_BIND ? function(fn2) { - return fn2 && uncurryThis(fn2); - } : function(fn2) { - return fn2 && function() { - return call.apply(fn2, arguments); - }; - }; - } -}); - -// node_modules/core-js-pure/internals/is-callable.js -var require_is_callable = __commonJS({ - "node_modules/core-js-pure/internals/is-callable.js"(exports, module2) { - module2.exports = function(argument) { - return typeof argument == "function"; - }; - } -}); - -// node_modules/core-js-pure/internals/descriptors.js -var require_descriptors = __commonJS({ - "node_modules/core-js-pure/internals/descriptors.js"(exports, module2) { - var fails = require_fails(); - module2.exports = !fails(function() { - return Object.defineProperty({}, 1, { get: function() { - return 7; - } })[1] != 7; - }); - } -}); - -// node_modules/core-js-pure/internals/function-call.js -var require_function_call = __commonJS({ - "node_modules/core-js-pure/internals/function-call.js"(exports, module2) { - var NATIVE_BIND = require_function_bind_native(); - var call = Function.prototype.call; - module2.exports = NATIVE_BIND ? call.bind(call) : function() { - return call.apply(call, arguments); - }; - } -}); - -// node_modules/core-js-pure/internals/object-property-is-enumerable.js -var require_object_property_is_enumerable = __commonJS({ - "node_modules/core-js-pure/internals/object-property-is-enumerable.js"(exports) { - "use strict"; - var $propertyIsEnumerable = {}.propertyIsEnumerable; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); - exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } : $propertyIsEnumerable; - } -}); - -// node_modules/core-js-pure/internals/create-property-descriptor.js -var require_create_property_descriptor = __commonJS({ - "node_modules/core-js-pure/internals/create-property-descriptor.js"(exports, module2) { - module2.exports = function(bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value - }; - }; - } -}); - -// node_modules/core-js-pure/internals/classof-raw.js -var require_classof_raw = __commonJS({ - "node_modules/core-js-pure/internals/classof-raw.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var toString = uncurryThis({}.toString); - var stringSlice = uncurryThis("".slice); - module2.exports = function(it) { - return stringSlice(toString(it), 8, -1); - }; - } -}); - -// node_modules/core-js-pure/internals/indexed-object.js -var require_indexed_object = __commonJS({ - "node_modules/core-js-pure/internals/indexed-object.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var fails = require_fails(); - var classof = require_classof_raw(); - var $Object = Object; - var split = uncurryThis("".split); - module2.exports = fails(function() { - return !$Object("z").propertyIsEnumerable(0); - }) ? function(it) { - return classof(it) == "String" ? split(it, "") : $Object(it); - } : $Object; - } -}); - -// node_modules/core-js-pure/internals/is-null-or-undefined.js -var require_is_null_or_undefined = __commonJS({ - "node_modules/core-js-pure/internals/is-null-or-undefined.js"(exports, module2) { - module2.exports = function(it) { - return it === null || it === void 0; - }; - } -}); - -// node_modules/core-js-pure/internals/require-object-coercible.js -var require_require_object_coercible = __commonJS({ - "node_modules/core-js-pure/internals/require-object-coercible.js"(exports, module2) { - var isNullOrUndefined = require_is_null_or_undefined(); - var $TypeError = TypeError; - module2.exports = function(it) { - if (isNullOrUndefined(it)) - throw $TypeError("Can't call method on " + it); - return it; - }; - } -}); - -// node_modules/core-js-pure/internals/to-indexed-object.js -var require_to_indexed_object = __commonJS({ - "node_modules/core-js-pure/internals/to-indexed-object.js"(exports, module2) { - var IndexedObject = require_indexed_object(); - var requireObjectCoercible = require_require_object_coercible(); - module2.exports = function(it) { - return IndexedObject(requireObjectCoercible(it)); - }; - } -}); - -// node_modules/core-js-pure/internals/is-object.js -var require_is_object = __commonJS({ - "node_modules/core-js-pure/internals/is-object.js"(exports, module2) { - var isCallable = require_is_callable(); - var documentAll = typeof document == "object" && document.all; - var SPECIAL_DOCUMENT_ALL = typeof documentAll == "undefined" && documentAll !== void 0; - module2.exports = SPECIAL_DOCUMENT_ALL ? function(it) { - return typeof it == "object" ? it !== null : isCallable(it) || it === documentAll; - } : function(it) { - return typeof it == "object" ? it !== null : isCallable(it); - }; - } -}); - -// node_modules/core-js-pure/internals/path.js -var require_path = __commonJS({ - "node_modules/core-js-pure/internals/path.js"(exports, module2) { - module2.exports = {}; - } -}); - -// node_modules/core-js-pure/internals/get-built-in.js -var require_get_built_in = __commonJS({ - "node_modules/core-js-pure/internals/get-built-in.js"(exports, module2) { - var path = require_path(); - var global2 = require_global(); - var isCallable = require_is_callable(); - var aFunction = function(variable) { - return isCallable(variable) ? variable : void 0; - }; - module2.exports = function(namespace, method) { - return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global2[namespace]) : path[namespace] && path[namespace][method] || global2[namespace] && global2[namespace][method]; - }; - } -}); - -// node_modules/core-js-pure/internals/object-is-prototype-of.js -var require_object_is_prototype_of = __commonJS({ - "node_modules/core-js-pure/internals/object-is-prototype-of.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - module2.exports = uncurryThis({}.isPrototypeOf); - } -}); - -// node_modules/core-js-pure/internals/engine-user-agent.js -var require_engine_user_agent = __commonJS({ - "node_modules/core-js-pure/internals/engine-user-agent.js"(exports, module2) { - var getBuiltIn = require_get_built_in(); - module2.exports = getBuiltIn("navigator", "userAgent") || ""; - } -}); - -// node_modules/core-js-pure/internals/engine-v8-version.js -var require_engine_v8_version = __commonJS({ - "node_modules/core-js-pure/internals/engine-v8-version.js"(exports, module2) { - var global2 = require_global(); - var userAgent = require_engine_user_agent(); - var process2 = global2.process; - var Deno = global2.Deno; - var versions = process2 && process2.versions || Deno && Deno.version; - var v8 = versions && versions.v8; - var match; - var version; - if (v8) { - match = v8.split("."); - version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); - } - if (!version && userAgent) { - match = userAgent.match(/Edge\/(\d+)/); - if (!match || match[1] >= 74) { - match = userAgent.match(/Chrome\/(\d+)/); - if (match) - version = +match[1]; - } - } - module2.exports = version; - } -}); - -// node_modules/core-js-pure/internals/symbol-constructor-detection.js -var require_symbol_constructor_detection = __commonJS({ - "node_modules/core-js-pure/internals/symbol-constructor-detection.js"(exports, module2) { - var V8_VERSION = require_engine_v8_version(); - var fails = require_fails(); - module2.exports = !!Object.getOwnPropertySymbols && !fails(function() { - var symbol = Symbol(); - return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41; - }); - } -}); - -// node_modules/core-js-pure/internals/use-symbol-as-uid.js -var require_use_symbol_as_uid = __commonJS({ - "node_modules/core-js-pure/internals/use-symbol-as-uid.js"(exports, module2) { - var NATIVE_SYMBOL = require_symbol_constructor_detection(); - module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol"; - } -}); - -// node_modules/core-js-pure/internals/is-symbol.js -var require_is_symbol = __commonJS({ - "node_modules/core-js-pure/internals/is-symbol.js"(exports, module2) { - var getBuiltIn = require_get_built_in(); - var isCallable = require_is_callable(); - var isPrototypeOf = require_object_is_prototype_of(); - var USE_SYMBOL_AS_UID = require_use_symbol_as_uid(); - var $Object = Object; - module2.exports = USE_SYMBOL_AS_UID ? function(it) { - return typeof it == "symbol"; - } : function(it) { - var $Symbol = getBuiltIn("Symbol"); - return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); - }; - } -}); - -// node_modules/core-js-pure/internals/try-to-string.js -var require_try_to_string = __commonJS({ - "node_modules/core-js-pure/internals/try-to-string.js"(exports, module2) { - var $String = String; - module2.exports = function(argument) { - try { - return $String(argument); - } catch (error) { - return "Object"; - } - }; - } -}); - -// node_modules/core-js-pure/internals/a-callable.js -var require_a_callable = __commonJS({ - "node_modules/core-js-pure/internals/a-callable.js"(exports, module2) { - var isCallable = require_is_callable(); - var tryToString = require_try_to_string(); - var $TypeError = TypeError; - module2.exports = function(argument) { - if (isCallable(argument)) - return argument; - throw $TypeError(tryToString(argument) + " is not a function"); - }; - } -}); - -// node_modules/core-js-pure/internals/get-method.js -var require_get_method = __commonJS({ - "node_modules/core-js-pure/internals/get-method.js"(exports, module2) { - var aCallable = require_a_callable(); - var isNullOrUndefined = require_is_null_or_undefined(); - module2.exports = function(V, P) { - var func = V[P]; - return isNullOrUndefined(func) ? void 0 : aCallable(func); - }; - } -}); - -// node_modules/core-js-pure/internals/ordinary-to-primitive.js -var require_ordinary_to_primitive = __commonJS({ - "node_modules/core-js-pure/internals/ordinary-to-primitive.js"(exports, module2) { - var call = require_function_call(); - var isCallable = require_is_callable(); - var isObject = require_is_object(); - var $TypeError = TypeError; - module2.exports = function(input, pref) { - var fn2, val; - if (pref === "string" && isCallable(fn2 = input.toString) && !isObject(val = call(fn2, input))) - return val; - if (isCallable(fn2 = input.valueOf) && !isObject(val = call(fn2, input))) - return val; - if (pref !== "string" && isCallable(fn2 = input.toString) && !isObject(val = call(fn2, input))) - return val; - throw $TypeError("Can't convert object to primitive value"); - }; - } -}); - -// node_modules/core-js-pure/internals/is-pure.js -var require_is_pure = __commonJS({ - "node_modules/core-js-pure/internals/is-pure.js"(exports, module2) { - module2.exports = true; - } -}); - -// node_modules/core-js-pure/internals/define-global-property.js -var require_define_global_property = __commonJS({ - "node_modules/core-js-pure/internals/define-global-property.js"(exports, module2) { - var global2 = require_global(); - var defineProperty = Object.defineProperty; - module2.exports = function(key, value) { - try { - defineProperty(global2, key, { value, configurable: true, writable: true }); - } catch (error) { - global2[key] = value; - } - return value; - }; - } -}); - -// node_modules/core-js-pure/internals/shared-store.js -var require_shared_store = __commonJS({ - "node_modules/core-js-pure/internals/shared-store.js"(exports, module2) { - var global2 = require_global(); - var defineGlobalProperty = require_define_global_property(); - var SHARED = "__core-js_shared__"; - var store = global2[SHARED] || defineGlobalProperty(SHARED, {}); - module2.exports = store; - } -}); - -// node_modules/core-js-pure/internals/shared.js -var require_shared = __commonJS({ - "node_modules/core-js-pure/internals/shared.js"(exports, module2) { - var IS_PURE = require_is_pure(); - var store = require_shared_store(); - (module2.exports = function(key, value) { - return store[key] || (store[key] = value !== void 0 ? value : {}); - })("versions", []).push({ - version: "3.25.1", - mode: IS_PURE ? "pure" : "global", - copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)", - license: "https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE", - source: "https://github.com/zloirock/core-js" - }); - } -}); - -// node_modules/core-js-pure/internals/to-object.js -var require_to_object = __commonJS({ - "node_modules/core-js-pure/internals/to-object.js"(exports, module2) { - var requireObjectCoercible = require_require_object_coercible(); - var $Object = Object; - module2.exports = function(argument) { - return $Object(requireObjectCoercible(argument)); - }; - } -}); - -// node_modules/core-js-pure/internals/has-own-property.js -var require_has_own_property = __commonJS({ - "node_modules/core-js-pure/internals/has-own-property.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var toObject = require_to_object(); - var hasOwnProperty = uncurryThis({}.hasOwnProperty); - module2.exports = Object.hasOwn || function hasOwn(it, key) { - return hasOwnProperty(toObject(it), key); - }; - } -}); - -// node_modules/core-js-pure/internals/uid.js -var require_uid = __commonJS({ - "node_modules/core-js-pure/internals/uid.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var id = 0; - var postfix = Math.random(); - var toString = uncurryThis(1 .toString); - module2.exports = function(key) { - return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36); - }; - } -}); - -// node_modules/core-js-pure/internals/well-known-symbol.js -var require_well_known_symbol = __commonJS({ - "node_modules/core-js-pure/internals/well-known-symbol.js"(exports, module2) { - var global2 = require_global(); - var shared = require_shared(); - var hasOwn = require_has_own_property(); - var uid = require_uid(); - var NATIVE_SYMBOL = require_symbol_constructor_detection(); - var USE_SYMBOL_AS_UID = require_use_symbol_as_uid(); - var WellKnownSymbolsStore = shared("wks"); - var Symbol2 = global2.Symbol; - var symbolFor = Symbol2 && Symbol2["for"]; - var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid; - module2.exports = function(name) { - if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) { - var description = "Symbol." + name; - if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) { - WellKnownSymbolsStore[name] = Symbol2[name]; - } else if (USE_SYMBOL_AS_UID && symbolFor) { - WellKnownSymbolsStore[name] = symbolFor(description); - } else { - WellKnownSymbolsStore[name] = createWellKnownSymbol(description); - } - } - return WellKnownSymbolsStore[name]; - }; - } -}); - -// node_modules/core-js-pure/internals/to-primitive.js -var require_to_primitive = __commonJS({ - "node_modules/core-js-pure/internals/to-primitive.js"(exports, module2) { - var call = require_function_call(); - var isObject = require_is_object(); - var isSymbol = require_is_symbol(); - var getMethod = require_get_method(); - var ordinaryToPrimitive = require_ordinary_to_primitive(); - var wellKnownSymbol = require_well_known_symbol(); - var $TypeError = TypeError; - var TO_PRIMITIVE = wellKnownSymbol("toPrimitive"); - module2.exports = function(input, pref) { - if (!isObject(input) || isSymbol(input)) - return input; - var exoticToPrim = getMethod(input, TO_PRIMITIVE); - var result; - if (exoticToPrim) { - if (pref === void 0) - pref = "default"; - result = call(exoticToPrim, input, pref); - if (!isObject(result) || isSymbol(result)) - return result; - throw $TypeError("Can't convert object to primitive value"); - } - if (pref === void 0) - pref = "number"; - return ordinaryToPrimitive(input, pref); - }; - } -}); - -// node_modules/core-js-pure/internals/to-property-key.js -var require_to_property_key = __commonJS({ - "node_modules/core-js-pure/internals/to-property-key.js"(exports, module2) { - var toPrimitive = require_to_primitive(); - var isSymbol = require_is_symbol(); - module2.exports = function(argument) { - var key = toPrimitive(argument, "string"); - return isSymbol(key) ? key : key + ""; - }; - } -}); - -// node_modules/core-js-pure/internals/document-create-element.js -var require_document_create_element = __commonJS({ - "node_modules/core-js-pure/internals/document-create-element.js"(exports, module2) { - var global2 = require_global(); - var isObject = require_is_object(); - var document2 = global2.document; - var EXISTS = isObject(document2) && isObject(document2.createElement); - module2.exports = function(it) { - return EXISTS ? document2.createElement(it) : {}; - }; - } -}); - -// node_modules/core-js-pure/internals/ie8-dom-define.js -var require_ie8_dom_define = __commonJS({ - "node_modules/core-js-pure/internals/ie8-dom-define.js"(exports, module2) { - var DESCRIPTORS = require_descriptors(); - var fails = require_fails(); - var createElement = require_document_create_element(); - module2.exports = !DESCRIPTORS && !fails(function() { - return Object.defineProperty(createElement("div"), "a", { - get: function() { - return 7; - } - }).a != 7; - }); - } -}); - -// node_modules/core-js-pure/internals/object-get-own-property-descriptor.js -var require_object_get_own_property_descriptor = __commonJS({ - "node_modules/core-js-pure/internals/object-get-own-property-descriptor.js"(exports) { - var DESCRIPTORS = require_descriptors(); - var call = require_function_call(); - var propertyIsEnumerableModule = require_object_property_is_enumerable(); - var createPropertyDescriptor = require_create_property_descriptor(); - var toIndexedObject = require_to_indexed_object(); - var toPropertyKey = require_to_property_key(); - var hasOwn = require_has_own_property(); - var IE8_DOM_DEFINE = require_ie8_dom_define(); - var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPropertyKey(P); - if (IE8_DOM_DEFINE) - try { - return $getOwnPropertyDescriptor(O, P); - } catch (error) { - } - if (hasOwn(O, P)) - return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); - }; - } -}); - -// node_modules/core-js-pure/internals/is-forced.js -var require_is_forced = __commonJS({ - "node_modules/core-js-pure/internals/is-forced.js"(exports, module2) { - var fails = require_fails(); - var isCallable = require_is_callable(); - var replacement = /#|\.prototype\./; - var isForced = function(feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; - }; - var normalize = isForced.normalize = function(string) { - return String(string).replace(replacement, ".").toLowerCase(); - }; - var data = isForced.data = {}; - var NATIVE = isForced.NATIVE = "N"; - var POLYFILL = isForced.POLYFILL = "P"; - module2.exports = isForced; - } -}); - -// node_modules/core-js-pure/internals/function-bind-context.js -var require_function_bind_context = __commonJS({ - "node_modules/core-js-pure/internals/function-bind-context.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var aCallable = require_a_callable(); - var NATIVE_BIND = require_function_bind_native(); - var bind = uncurryThis(uncurryThis.bind); - module2.exports = function(fn2, that) { - aCallable(fn2); - return that === void 0 ? fn2 : NATIVE_BIND ? bind(fn2, that) : function() { - return fn2.apply(that, arguments); - }; - }; - } -}); - -// node_modules/core-js-pure/internals/v8-prototype-define-bug.js -var require_v8_prototype_define_bug = __commonJS({ - "node_modules/core-js-pure/internals/v8-prototype-define-bug.js"(exports, module2) { - var DESCRIPTORS = require_descriptors(); - var fails = require_fails(); - module2.exports = DESCRIPTORS && fails(function() { - return Object.defineProperty(function() { - }, "prototype", { - value: 42, - writable: false - }).prototype != 42; - }); - } -}); - -// node_modules/core-js-pure/internals/an-object.js -var require_an_object = __commonJS({ - "node_modules/core-js-pure/internals/an-object.js"(exports, module2) { - var isObject = require_is_object(); - var $String = String; - var $TypeError = TypeError; - module2.exports = function(argument) { - if (isObject(argument)) - return argument; - throw $TypeError($String(argument) + " is not an object"); - }; - } -}); - -// node_modules/core-js-pure/internals/object-define-property.js -var require_object_define_property = __commonJS({ - "node_modules/core-js-pure/internals/object-define-property.js"(exports) { - var DESCRIPTORS = require_descriptors(); - var IE8_DOM_DEFINE = require_ie8_dom_define(); - var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug(); - var anObject = require_an_object(); - var toPropertyKey = require_to_property_key(); - var $TypeError = TypeError; - var $defineProperty = Object.defineProperty; - var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var ENUMERABLE = "enumerable"; - var CONFIGURABLE = "configurable"; - var WRITABLE = "writable"; - exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { - anObject(O); - P = toPropertyKey(P); - anObject(Attributes); - if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { - var current = $getOwnPropertyDescriptor(O, P); - if (current && current[WRITABLE]) { - O[P] = Attributes.value; - Attributes = { - configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], - enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], - writable: false - }; - } - } - return $defineProperty(O, P, Attributes); - } : $defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPropertyKey(P); - anObject(Attributes); - if (IE8_DOM_DEFINE) - try { - return $defineProperty(O, P, Attributes); - } catch (error) { - } - if ("get" in Attributes || "set" in Attributes) - throw $TypeError("Accessors not supported"); - if ("value" in Attributes) - O[P] = Attributes.value; - return O; - }; - } -}); - -// node_modules/core-js-pure/internals/create-non-enumerable-property.js -var require_create_non_enumerable_property = __commonJS({ - "node_modules/core-js-pure/internals/create-non-enumerable-property.js"(exports, module2) { - var DESCRIPTORS = require_descriptors(); - var definePropertyModule = require_object_define_property(); - var createPropertyDescriptor = require_create_property_descriptor(); - module2.exports = DESCRIPTORS ? function(object, key, value) { - return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); - } : function(object, key, value) { - object[key] = value; - return object; - }; - } -}); - -// node_modules/core-js-pure/internals/export.js -var require_export = __commonJS({ - "node_modules/core-js-pure/internals/export.js"(exports, module2) { - "use strict"; - var global2 = require_global(); - var apply = require_function_apply(); - var uncurryThis = require_function_uncurry_this(); - var isCallable = require_is_callable(); - var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f; - var isForced = require_is_forced(); - var path = require_path(); - var bind = require_function_bind_context(); - var createNonEnumerableProperty = require_create_non_enumerable_property(); - var hasOwn = require_has_own_property(); - var wrapConstructor = function(NativeConstructor) { - var Wrapper = function(a, b, c) { - if (this instanceof Wrapper) { - switch (arguments.length) { - case 0: - return new NativeConstructor(); - case 1: - return new NativeConstructor(a); - case 2: - return new NativeConstructor(a, b); - } - return new NativeConstructor(a, b, c); - } - return apply(NativeConstructor, this, arguments); - }; - Wrapper.prototype = NativeConstructor.prototype; - return Wrapper; - }; - module2.exports = function(options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var PROTO = options.proto; - var nativeSource = GLOBAL ? global2 : STATIC ? global2[TARGET] : (global2[TARGET] || {}).prototype; - var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET]; - var targetPrototype = target.prototype; - var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; - var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; - for (key in source) { - FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced); - USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key); - targetProperty = target[key]; - if (USE_NATIVE) - if (options.dontCallGetSet) { - descriptor = getOwnPropertyDescriptor(nativeSource, key); - nativeProperty = descriptor && descriptor.value; - } else - nativeProperty = nativeSource[key]; - sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key]; - if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) - continue; - if (options.bind && USE_NATIVE) - resultProperty = bind(sourceProperty, global2); - else if (options.wrap && USE_NATIVE) - resultProperty = wrapConstructor(sourceProperty); - else if (PROTO && isCallable(sourceProperty)) - resultProperty = uncurryThis(sourceProperty); - else - resultProperty = sourceProperty; - if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) { - createNonEnumerableProperty(resultProperty, "sham", true); - } - createNonEnumerableProperty(target, key, resultProperty); - if (PROTO) { - VIRTUAL_PROTOTYPE = TARGET + "Prototype"; - if (!hasOwn(path, VIRTUAL_PROTOTYPE)) { - createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {}); - } - createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty); - if (options.real && targetPrototype && !targetPrototype[key]) { - createNonEnumerableProperty(targetPrototype, key, sourceProperty); - } - } - } - }; - } -}); - -// node_modules/core-js-pure/modules/es.object.define-property.js -var require_es_object_define_property = __commonJS({ - "node_modules/core-js-pure/modules/es.object.define-property.js"() { - var $ = require_export(); - var DESCRIPTORS = require_descriptors(); - var defineProperty = require_object_define_property().f; - $({ target: "Object", stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, { - defineProperty - }); - } -}); - -// node_modules/core-js-pure/es/object/define-property.js -var require_define_property = __commonJS({ - "node_modules/core-js-pure/es/object/define-property.js"(exports, module2) { - require_es_object_define_property(); - var path = require_path(); - var Object2 = path.Object; - var defineProperty = module2.exports = function defineProperty2(it, key, desc) { - return Object2.defineProperty(it, key, desc); - }; - if (Object2.defineProperty.sham) - defineProperty.sham = true; - } -}); - -// node_modules/core-js-pure/stable/object/define-property.js -var require_define_property2 = __commonJS({ - "node_modules/core-js-pure/stable/object/define-property.js"(exports, module2) { - var parent = require_define_property(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js -var require_define_property3 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js"(exports, module2) { - module2.exports = require_define_property2(); - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js -var require_interopRequireDefault = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js"(exports, module2) { - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - } - module2.exports = _interopRequireDefault, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/core-js-pure/internals/is-array.js -var require_is_array = __commonJS({ - "node_modules/core-js-pure/internals/is-array.js"(exports, module2) { - var classof = require_classof_raw(); - module2.exports = Array.isArray || function isArray(argument) { - return classof(argument) == "Array"; - }; - } -}); - -// node_modules/core-js-pure/internals/to-string-tag-support.js -var require_to_string_tag_support = __commonJS({ - "node_modules/core-js-pure/internals/to-string-tag-support.js"(exports, module2) { - var wellKnownSymbol = require_well_known_symbol(); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var test = {}; - test[TO_STRING_TAG] = "z"; - module2.exports = String(test) === "[object z]"; - } -}); - -// node_modules/core-js-pure/internals/classof.js -var require_classof = __commonJS({ - "node_modules/core-js-pure/internals/classof.js"(exports, module2) { - var TO_STRING_TAG_SUPPORT = require_to_string_tag_support(); - var isCallable = require_is_callable(); - var classofRaw = require_classof_raw(); - var wellKnownSymbol = require_well_known_symbol(); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var $Object = Object; - var CORRECT_ARGUMENTS = classofRaw(function() { - return arguments; - }()) == "Arguments"; - var tryGet = function(it, key) { - try { - return it[key]; - } catch (error) { - } - }; - module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) { - var O, tag, result; - return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result; - }; - } -}); - -// node_modules/core-js-pure/internals/inspect-source.js -var require_inspect_source = __commonJS({ - "node_modules/core-js-pure/internals/inspect-source.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var isCallable = require_is_callable(); - var store = require_shared_store(); - var functionToString = uncurryThis(Function.toString); - if (!isCallable(store.inspectSource)) { - store.inspectSource = function(it) { - return functionToString(it); - }; - } - module2.exports = store.inspectSource; - } -}); - -// node_modules/core-js-pure/internals/is-constructor.js -var require_is_constructor = __commonJS({ - "node_modules/core-js-pure/internals/is-constructor.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var fails = require_fails(); - var isCallable = require_is_callable(); - var classof = require_classof(); - var getBuiltIn = require_get_built_in(); - var inspectSource = require_inspect_source(); - var noop = function() { - }; - var empty = []; - var construct = getBuiltIn("Reflect", "construct"); - var constructorRegExp = /^\s*(?:class|function)\b/; - var exec = uncurryThis(constructorRegExp.exec); - var INCORRECT_TO_STRING = !constructorRegExp.exec(noop); - var isConstructorModern = function isConstructor(argument) { - if (!isCallable(argument)) - return false; - try { - construct(noop, empty, argument); - return true; - } catch (error) { - return false; - } - }; - var isConstructorLegacy = function isConstructor(argument) { - if (!isCallable(argument)) - return false; - switch (classof(argument)) { - case "AsyncFunction": - case "GeneratorFunction": - case "AsyncGeneratorFunction": - return false; - } - try { - return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); - } catch (error) { - return true; - } - }; - isConstructorLegacy.sham = true; - module2.exports = !construct || fails(function() { - var called; - return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() { - called = true; - }) || called; - }) ? isConstructorLegacy : isConstructorModern; - } -}); - -// node_modules/core-js-pure/internals/math-trunc.js -var require_math_trunc = __commonJS({ - "node_modules/core-js-pure/internals/math-trunc.js"(exports, module2) { - var ceil = Math.ceil; - var floor = Math.floor; - module2.exports = Math.trunc || function trunc(x) { - var n = +x; - return (n > 0 ? floor : ceil)(n); - }; - } -}); - -// node_modules/core-js-pure/internals/to-integer-or-infinity.js -var require_to_integer_or_infinity = __commonJS({ - "node_modules/core-js-pure/internals/to-integer-or-infinity.js"(exports, module2) { - var trunc = require_math_trunc(); - module2.exports = function(argument) { - var number = +argument; - return number !== number || number === 0 ? 0 : trunc(number); - }; - } -}); - -// node_modules/core-js-pure/internals/to-absolute-index.js -var require_to_absolute_index = __commonJS({ - "node_modules/core-js-pure/internals/to-absolute-index.js"(exports, module2) { - var toIntegerOrInfinity = require_to_integer_or_infinity(); - var max2 = Math.max; - var min2 = Math.min; - module2.exports = function(index, length) { - var integer = toIntegerOrInfinity(index); - return integer < 0 ? max2(integer + length, 0) : min2(integer, length); - }; - } -}); - -// node_modules/core-js-pure/internals/to-length.js -var require_to_length = __commonJS({ - "node_modules/core-js-pure/internals/to-length.js"(exports, module2) { - var toIntegerOrInfinity = require_to_integer_or_infinity(); - var min2 = Math.min; - module2.exports = function(argument) { - return argument > 0 ? min2(toIntegerOrInfinity(argument), 9007199254740991) : 0; - }; - } -}); - -// node_modules/core-js-pure/internals/length-of-array-like.js -var require_length_of_array_like = __commonJS({ - "node_modules/core-js-pure/internals/length-of-array-like.js"(exports, module2) { - var toLength = require_to_length(); - module2.exports = function(obj) { - return toLength(obj.length); - }; - } -}); - -// node_modules/core-js-pure/internals/create-property.js -var require_create_property = __commonJS({ - "node_modules/core-js-pure/internals/create-property.js"(exports, module2) { - "use strict"; - var toPropertyKey = require_to_property_key(); - var definePropertyModule = require_object_define_property(); - var createPropertyDescriptor = require_create_property_descriptor(); - module2.exports = function(object, key, value) { - var propertyKey = toPropertyKey(key); - if (propertyKey in object) - definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else - object[propertyKey] = value; - }; - } -}); - -// node_modules/core-js-pure/internals/array-method-has-species-support.js -var require_array_method_has_species_support = __commonJS({ - "node_modules/core-js-pure/internals/array-method-has-species-support.js"(exports, module2) { - var fails = require_fails(); - var wellKnownSymbol = require_well_known_symbol(); - var V8_VERSION = require_engine_v8_version(); - var SPECIES = wellKnownSymbol("species"); - module2.exports = function(METHOD_NAME) { - return V8_VERSION >= 51 || !fails(function() { - var array = []; - var constructor = array.constructor = {}; - constructor[SPECIES] = function() { - return { foo: 1 }; - }; - return array[METHOD_NAME](Boolean).foo !== 1; - }); - }; - } -}); - -// node_modules/core-js-pure/internals/array-slice.js -var require_array_slice = __commonJS({ - "node_modules/core-js-pure/internals/array-slice.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - module2.exports = uncurryThis([].slice); - } -}); - -// node_modules/core-js-pure/modules/es.array.slice.js -var require_es_array_slice = __commonJS({ - "node_modules/core-js-pure/modules/es.array.slice.js"() { - "use strict"; - var $ = require_export(); - var isArray = require_is_array(); - var isConstructor = require_is_constructor(); - var isObject = require_is_object(); - var toAbsoluteIndex = require_to_absolute_index(); - var lengthOfArrayLike = require_length_of_array_like(); - var toIndexedObject = require_to_indexed_object(); - var createProperty = require_create_property(); - var wellKnownSymbol = require_well_known_symbol(); - var arrayMethodHasSpeciesSupport = require_array_method_has_species_support(); - var nativeSlice = require_array_slice(); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice"); - var SPECIES = wellKnownSymbol("species"); - var $Array = Array; - var max2 = Math.max; - $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, { - slice: function slice(start2, end2) { - var O = toIndexedObject(this); - var length = lengthOfArrayLike(O); - var k = toAbsoluteIndex(start2, length); - var fin = toAbsoluteIndex(end2 === void 0 ? length : end2, length); - var Constructor, result, n; - if (isArray(O)) { - Constructor = O.constructor; - if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) { - Constructor = void 0; - } else if (isObject(Constructor)) { - Constructor = Constructor[SPECIES]; - if (Constructor === null) - Constructor = void 0; - } - if (Constructor === $Array || Constructor === void 0) { - return nativeSlice(O, k, fin); - } - } - result = new (Constructor === void 0 ? $Array : Constructor)(max2(fin - k, 0)); - for (n = 0; k < fin; k++, n++) - if (k in O) - createProperty(result, n, O[k]); - result.length = n; - return result; - } - }); - } -}); - -// node_modules/core-js-pure/internals/entry-virtual.js -var require_entry_virtual = __commonJS({ - "node_modules/core-js-pure/internals/entry-virtual.js"(exports, module2) { - var path = require_path(); - module2.exports = function(CONSTRUCTOR) { - return path[CONSTRUCTOR + "Prototype"]; - }; - } -}); - -// node_modules/core-js-pure/es/array/virtual/slice.js -var require_slice = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/slice.js"(exports, module2) { - require_es_array_slice(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").slice; - } -}); - -// node_modules/core-js-pure/es/instance/slice.js -var require_slice2 = __commonJS({ - "node_modules/core-js-pure/es/instance/slice.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_slice(); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - var own = it.slice; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice ? method : own; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/slice.js -var require_slice3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/slice.js"(exports, module2) { - var parent = require_slice2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js -var require_slice4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js"(exports, module2) { - module2.exports = require_slice3(); - } -}); - -// node_modules/core-js-pure/internals/to-string.js -var require_to_string = __commonJS({ - "node_modules/core-js-pure/internals/to-string.js"(exports, module2) { - var classof = require_classof(); - var $String = String; - module2.exports = function(argument) { - if (classof(argument) === "Symbol") - throw TypeError("Cannot convert a Symbol value to a string"); - return $String(argument); - }; - } -}); - -// node_modules/core-js-pure/internals/string-multibyte.js -var require_string_multibyte = __commonJS({ - "node_modules/core-js-pure/internals/string-multibyte.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var toIntegerOrInfinity = require_to_integer_or_infinity(); - var toString = require_to_string(); - var requireObjectCoercible = require_require_object_coercible(); - var charAt = uncurryThis("".charAt); - var charCodeAt = uncurryThis("".charCodeAt); - var stringSlice = uncurryThis("".slice); - var createMethod = function(CONVERT_TO_STRING) { - return function($this, pos) { - var S = toString(requireObjectCoercible($this)); - var position = toIntegerOrInfinity(pos); - var size = S.length; - var first, second; - if (position < 0 || position >= size) - return CONVERT_TO_STRING ? "" : void 0; - first = charCodeAt(S, position); - return first < 55296 || first > 56319 || position + 1 === size || (second = charCodeAt(S, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536; - }; - }; - module2.exports = { - codeAt: createMethod(false), - charAt: createMethod(true) - }; - } -}); - -// node_modules/core-js-pure/internals/weak-map-basic-detection.js -var require_weak_map_basic_detection = __commonJS({ - "node_modules/core-js-pure/internals/weak-map-basic-detection.js"(exports, module2) { - var global2 = require_global(); - var isCallable = require_is_callable(); - var WeakMap = global2.WeakMap; - module2.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); - } -}); - -// node_modules/core-js-pure/internals/shared-key.js -var require_shared_key = __commonJS({ - "node_modules/core-js-pure/internals/shared-key.js"(exports, module2) { - var shared = require_shared(); - var uid = require_uid(); - var keys = shared("keys"); - module2.exports = function(key) { - return keys[key] || (keys[key] = uid(key)); - }; - } -}); - -// node_modules/core-js-pure/internals/hidden-keys.js -var require_hidden_keys = __commonJS({ - "node_modules/core-js-pure/internals/hidden-keys.js"(exports, module2) { - module2.exports = {}; - } -}); - -// node_modules/core-js-pure/internals/internal-state.js -var require_internal_state = __commonJS({ - "node_modules/core-js-pure/internals/internal-state.js"(exports, module2) { - var NATIVE_WEAK_MAP = require_weak_map_basic_detection(); - var global2 = require_global(); - var uncurryThis = require_function_uncurry_this(); - var isObject = require_is_object(); - var createNonEnumerableProperty = require_create_non_enumerable_property(); - var hasOwn = require_has_own_property(); - var shared = require_shared_store(); - var sharedKey = require_shared_key(); - var hiddenKeys = require_hidden_keys(); - var OBJECT_ALREADY_INITIALIZED = "Object already initialized"; - var TypeError2 = global2.TypeError; - var WeakMap = global2.WeakMap; - var set; - var get; - var has; - var enforce = function(it) { - return has(it) ? get(it) : set(it, {}); - }; - var getterFor = function(TYPE) { - return function(it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError2("Incompatible receiver, " + TYPE + " required"); - } - return state; - }; - }; - if (NATIVE_WEAK_MAP || shared.state) { - store = shared.state || (shared.state = new WeakMap()); - wmget = uncurryThis(store.get); - wmhas = uncurryThis(store.has); - wmset = uncurryThis(store.set); - set = function(it, metadata) { - if (wmhas(store, it)) - throw TypeError2(OBJECT_ALREADY_INITIALIZED); - metadata.facade = it; - wmset(store, it, metadata); - return metadata; - }; - get = function(it) { - return wmget(store, it) || {}; - }; - has = function(it) { - return wmhas(store, it); - }; - } else { - STATE = sharedKey("state"); - hiddenKeys[STATE] = true; - set = function(it, metadata) { - if (hasOwn(it, STATE)) - throw TypeError2(OBJECT_ALREADY_INITIALIZED); - metadata.facade = it; - createNonEnumerableProperty(it, STATE, metadata); - return metadata; - }; - get = function(it) { - return hasOwn(it, STATE) ? it[STATE] : {}; - }; - has = function(it) { - return hasOwn(it, STATE); - }; - } - var store; - var wmget; - var wmhas; - var wmset; - var STATE; - module2.exports = { - set, - get, - has, - enforce, - getterFor - }; - } -}); - -// node_modules/core-js-pure/internals/function-name.js -var require_function_name = __commonJS({ - "node_modules/core-js-pure/internals/function-name.js"(exports, module2) { - var DESCRIPTORS = require_descriptors(); - var hasOwn = require_has_own_property(); - var FunctionPrototype = Function.prototype; - var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; - var EXISTS = hasOwn(FunctionPrototype, "name"); - var PROPER = EXISTS && function something() { - }.name === "something"; - var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable); - module2.exports = { - EXISTS, - PROPER, - CONFIGURABLE - }; - } -}); - -// node_modules/core-js-pure/internals/array-includes.js -var require_array_includes = __commonJS({ - "node_modules/core-js-pure/internals/array-includes.js"(exports, module2) { - var toIndexedObject = require_to_indexed_object(); - var toAbsoluteIndex = require_to_absolute_index(); - var lengthOfArrayLike = require_length_of_array_like(); - var createMethod = function(IS_INCLUDES) { - return function($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = lengthOfArrayLike(O); - var index = toAbsoluteIndex(fromIndex, length); - var value; - if (IS_INCLUDES && el != el) - while (length > index) { - value = O[index++]; - if (value != value) - return true; - } - else - for (; length > index; index++) { - if ((IS_INCLUDES || index in O) && O[index] === el) - return IS_INCLUDES || index || 0; - } - return !IS_INCLUDES && -1; - }; - }; - module2.exports = { - includes: createMethod(true), - indexOf: createMethod(false) - }; - } -}); - -// node_modules/core-js-pure/internals/object-keys-internal.js -var require_object_keys_internal = __commonJS({ - "node_modules/core-js-pure/internals/object-keys-internal.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var hasOwn = require_has_own_property(); - var toIndexedObject = require_to_indexed_object(); - var indexOf = require_array_includes().indexOf; - var hiddenKeys = require_hidden_keys(); - var push = uncurryThis([].push); - module2.exports = function(object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - for (key in O) - !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); - while (names.length > i) - if (hasOwn(O, key = names[i++])) { - ~indexOf(result, key) || push(result, key); - } - return result; - }; - } -}); - -// node_modules/core-js-pure/internals/enum-bug-keys.js -var require_enum_bug_keys = __commonJS({ - "node_modules/core-js-pure/internals/enum-bug-keys.js"(exports, module2) { - module2.exports = [ - "constructor", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "toLocaleString", - "toString", - "valueOf" - ]; - } -}); - -// node_modules/core-js-pure/internals/object-keys.js -var require_object_keys = __commonJS({ - "node_modules/core-js-pure/internals/object-keys.js"(exports, module2) { - var internalObjectKeys = require_object_keys_internal(); - var enumBugKeys = require_enum_bug_keys(); - module2.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); - }; - } -}); - -// node_modules/core-js-pure/internals/object-define-properties.js -var require_object_define_properties = __commonJS({ - "node_modules/core-js-pure/internals/object-define-properties.js"(exports) { - var DESCRIPTORS = require_descriptors(); - var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug(); - var definePropertyModule = require_object_define_property(); - var anObject = require_an_object(); - var toIndexedObject = require_to_indexed_object(); - var objectKeys = require_object_keys(); - exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var props = toIndexedObject(Properties); - var keys = objectKeys(Properties); - var length = keys.length; - var index = 0; - var key; - while (length > index) - definePropertyModule.f(O, key = keys[index++], props[key]); - return O; - }; - } -}); - -// node_modules/core-js-pure/internals/html.js -var require_html = __commonJS({ - "node_modules/core-js-pure/internals/html.js"(exports, module2) { - var getBuiltIn = require_get_built_in(); - module2.exports = getBuiltIn("document", "documentElement"); - } -}); - -// node_modules/core-js-pure/internals/object-create.js -var require_object_create = __commonJS({ - "node_modules/core-js-pure/internals/object-create.js"(exports, module2) { - var anObject = require_an_object(); - var definePropertiesModule = require_object_define_properties(); - var enumBugKeys = require_enum_bug_keys(); - var hiddenKeys = require_hidden_keys(); - var html = require_html(); - var documentCreateElement = require_document_create_element(); - var sharedKey = require_shared_key(); - var GT = ">"; - var LT = "<"; - var PROTOTYPE = "prototype"; - var SCRIPT = "script"; - var IE_PROTO = sharedKey("IE_PROTO"); - var EmptyConstructor = function() { - }; - var scriptTag = function(content) { - return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT; - }; - var NullProtoObjectViaActiveX = function(activeXDocument2) { - activeXDocument2.write(scriptTag("")); - activeXDocument2.close(); - var temp = activeXDocument2.parentWindow.Object; - activeXDocument2 = null; - return temp; - }; - var NullProtoObjectViaIFrame = function() { - var iframe = documentCreateElement("iframe"); - var JS = "java" + SCRIPT + ":"; - var iframeDocument; - iframe.style.display = "none"; - html.appendChild(iframe); - iframe.src = String(JS); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(scriptTag("document.F=Object")); - iframeDocument.close(); - return iframeDocument.F; - }; - var activeXDocument; - var NullProtoObject = function() { - try { - activeXDocument = new ActiveXObject("htmlfile"); - } catch (error) { - } - NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); - var length = enumBugKeys.length; - while (length--) - delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return NullProtoObject(); - }; - hiddenKeys[IE_PROTO] = true; - module2.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - EmptyConstructor[PROTOTYPE] = anObject(O); - result = new EmptyConstructor(); - EmptyConstructor[PROTOTYPE] = null; - result[IE_PROTO] = O; - } else - result = NullProtoObject(); - return Properties === void 0 ? result : definePropertiesModule.f(result, Properties); - }; - } -}); - -// node_modules/core-js-pure/internals/correct-prototype-getter.js -var require_correct_prototype_getter = __commonJS({ - "node_modules/core-js-pure/internals/correct-prototype-getter.js"(exports, module2) { - var fails = require_fails(); - module2.exports = !fails(function() { - function F() { - } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - } -}); - -// node_modules/core-js-pure/internals/object-get-prototype-of.js -var require_object_get_prototype_of = __commonJS({ - "node_modules/core-js-pure/internals/object-get-prototype-of.js"(exports, module2) { - var hasOwn = require_has_own_property(); - var isCallable = require_is_callable(); - var toObject = require_to_object(); - var sharedKey = require_shared_key(); - var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter(); - var IE_PROTO = sharedKey("IE_PROTO"); - var $Object = Object; - var ObjectPrototype = $Object.prototype; - module2.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O) { - var object = toObject(O); - if (hasOwn(object, IE_PROTO)) - return object[IE_PROTO]; - var constructor = object.constructor; - if (isCallable(constructor) && object instanceof constructor) { - return constructor.prototype; - } - return object instanceof $Object ? ObjectPrototype : null; - }; - } -}); - -// node_modules/core-js-pure/internals/define-built-in.js -var require_define_built_in = __commonJS({ - "node_modules/core-js-pure/internals/define-built-in.js"(exports, module2) { - var createNonEnumerableProperty = require_create_non_enumerable_property(); - module2.exports = function(target, key, value, options) { - if (options && options.enumerable) - target[key] = value; - else - createNonEnumerableProperty(target, key, value); - return target; - }; - } -}); - -// node_modules/core-js-pure/internals/iterators-core.js -var require_iterators_core = __commonJS({ - "node_modules/core-js-pure/internals/iterators-core.js"(exports, module2) { - "use strict"; - var fails = require_fails(); - var isCallable = require_is_callable(); - var isObject = require_is_object(); - var create = require_object_create(); - var getPrototypeOf = require_object_get_prototype_of(); - var defineBuiltIn = require_define_built_in(); - var wellKnownSymbol = require_well_known_symbol(); - var IS_PURE = require_is_pure(); - var ITERATOR = wellKnownSymbol("iterator"); - var BUGGY_SAFARI_ITERATORS = false; - var IteratorPrototype; - var PrototypeOfArrayIteratorPrototype; - var arrayIterator; - if ([].keys) { - arrayIterator = [].keys(); - if (!("next" in arrayIterator)) - BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) - IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } - } - var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function() { - var test = {}; - return IteratorPrototype[ITERATOR].call(test) !== test; - }); - if (NEW_ITERATOR_PROTOTYPE) - IteratorPrototype = {}; - else if (IS_PURE) - IteratorPrototype = create(IteratorPrototype); - if (!isCallable(IteratorPrototype[ITERATOR])) { - defineBuiltIn(IteratorPrototype, ITERATOR, function() { - return this; - }); - } - module2.exports = { - IteratorPrototype, - BUGGY_SAFARI_ITERATORS - }; - } -}); - -// node_modules/core-js-pure/internals/object-to-string.js -var require_object_to_string = __commonJS({ - "node_modules/core-js-pure/internals/object-to-string.js"(exports, module2) { - "use strict"; - var TO_STRING_TAG_SUPPORT = require_to_string_tag_support(); - var classof = require_classof(); - module2.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { - return "[object " + classof(this) + "]"; - }; - } -}); - -// node_modules/core-js-pure/internals/set-to-string-tag.js -var require_set_to_string_tag = __commonJS({ - "node_modules/core-js-pure/internals/set-to-string-tag.js"(exports, module2) { - var TO_STRING_TAG_SUPPORT = require_to_string_tag_support(); - var defineProperty = require_object_define_property().f; - var createNonEnumerableProperty = require_create_non_enumerable_property(); - var hasOwn = require_has_own_property(); - var toString = require_object_to_string(); - var wellKnownSymbol = require_well_known_symbol(); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - module2.exports = function(it, TAG, STATIC, SET_METHOD) { - if (it) { - var target = STATIC ? it : it.prototype; - if (!hasOwn(target, TO_STRING_TAG)) { - defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); - } - if (SET_METHOD && !TO_STRING_TAG_SUPPORT) { - createNonEnumerableProperty(target, "toString", toString); - } - } - }; - } -}); - -// node_modules/core-js-pure/internals/iterators.js -var require_iterators = __commonJS({ - "node_modules/core-js-pure/internals/iterators.js"(exports, module2) { - module2.exports = {}; - } -}); - -// node_modules/core-js-pure/internals/iterator-create-constructor.js -var require_iterator_create_constructor = __commonJS({ - "node_modules/core-js-pure/internals/iterator-create-constructor.js"(exports, module2) { - "use strict"; - var IteratorPrototype = require_iterators_core().IteratorPrototype; - var create = require_object_create(); - var createPropertyDescriptor = require_create_property_descriptor(); - var setToStringTag = require_set_to_string_tag(); - var Iterators = require_iterators(); - var returnThis = function() { - return this; - }; - module2.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { - var TO_STRING_TAG = NAME + " Iterator"; - IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; - }; - } -}); - -// node_modules/core-js-pure/internals/a-possible-prototype.js -var require_a_possible_prototype = __commonJS({ - "node_modules/core-js-pure/internals/a-possible-prototype.js"(exports, module2) { - var isCallable = require_is_callable(); - var $String = String; - var $TypeError = TypeError; - module2.exports = function(argument) { - if (typeof argument == "object" || isCallable(argument)) - return argument; - throw $TypeError("Can't set " + $String(argument) + " as a prototype"); - }; - } -}); - -// node_modules/core-js-pure/internals/object-set-prototype-of.js -var require_object_set_prototype_of = __commonJS({ - "node_modules/core-js-pure/internals/object-set-prototype-of.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var anObject = require_an_object(); - var aPossiblePrototype = require_a_possible_prototype(); - module2.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() { - var CORRECT_SETTER = false; - var test = {}; - var setter; - try { - setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set); - setter(test, []); - CORRECT_SETTER = test instanceof Array; - } catch (error) { - } - return function setPrototypeOf(O, proto) { - anObject(O); - aPossiblePrototype(proto); - if (CORRECT_SETTER) - setter(O, proto); - else - O.__proto__ = proto; - return O; - }; - }() : void 0); - } -}); - -// node_modules/core-js-pure/internals/iterator-define.js -var require_iterator_define = __commonJS({ - "node_modules/core-js-pure/internals/iterator-define.js"(exports, module2) { - "use strict"; - var $ = require_export(); - var call = require_function_call(); - var IS_PURE = require_is_pure(); - var FunctionName = require_function_name(); - var isCallable = require_is_callable(); - var createIteratorConstructor = require_iterator_create_constructor(); - var getPrototypeOf = require_object_get_prototype_of(); - var setPrototypeOf = require_object_set_prototype_of(); - var setToStringTag = require_set_to_string_tag(); - var createNonEnumerableProperty = require_create_non_enumerable_property(); - var defineBuiltIn = require_define_built_in(); - var wellKnownSymbol = require_well_known_symbol(); - var Iterators = require_iterators(); - var IteratorsCore = require_iterators_core(); - var PROPER_FUNCTION_NAME = FunctionName.PROPER; - var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; - var IteratorPrototype = IteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR = wellKnownSymbol("iterator"); - var KEYS = "keys"; - var VALUES = "values"; - var ENTRIES = "entries"; - var returnThis = function() { - return this; - }; - module2.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function(KIND) { - if (KIND === DEFAULT && defaultIterator) - return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) - return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: - return function keys() { - return new IteratorConstructor(this, KIND); - }; - case VALUES: - return function values() { - return new IteratorConstructor(this, KIND); - }; - case ENTRIES: - return function entries() { - return new IteratorConstructor(this, KIND); - }; - } - return function() { - return new IteratorConstructor(this); - }; - }; - var TO_STRING_TAG = NAME + " Iterator"; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { - if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { - defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); - } - } - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) - Iterators[TO_STRING_TAG] = returnThis; - } - } - if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { - createNonEnumerableProperty(IterablePrototype, "name", VALUES); - } else { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { - return call(nativeIterator, this); - }; - } - } - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) - for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - defineBuiltIn(IterablePrototype, KEY, methods[KEY]); - } - } - else - $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); - } - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); - } - Iterators[NAME] = defaultIterator; - return methods; - }; - } -}); - -// node_modules/core-js-pure/internals/create-iter-result-object.js -var require_create_iter_result_object = __commonJS({ - "node_modules/core-js-pure/internals/create-iter-result-object.js"(exports, module2) { - module2.exports = function(value, done) { - return { value, done }; - }; - } -}); - -// node_modules/core-js-pure/modules/es.string.iterator.js -var require_es_string_iterator = __commonJS({ - "node_modules/core-js-pure/modules/es.string.iterator.js"() { - "use strict"; - var charAt = require_string_multibyte().charAt; - var toString = require_to_string(); - var InternalStateModule = require_internal_state(); - var defineIterator = require_iterator_define(); - var createIterResultObject = require_create_iter_result_object(); - var STRING_ITERATOR = "String Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - defineIterator(String, "String", function(iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: toString(iterated), - index: 0 - }); - }, function next() { - var state = getInternalState(this); - var string = state.string; - var index = state.index; - var point; - if (index >= string.length) - return createIterResultObject(void 0, true); - point = charAt(string, index); - state.index += point.length; - return createIterResultObject(point, false); - }); - } -}); - -// node_modules/core-js-pure/internals/iterator-close.js -var require_iterator_close = __commonJS({ - "node_modules/core-js-pure/internals/iterator-close.js"(exports, module2) { - var call = require_function_call(); - var anObject = require_an_object(); - var getMethod = require_get_method(); - module2.exports = function(iterator, kind, value) { - var innerResult, innerError; - anObject(iterator); - try { - innerResult = getMethod(iterator, "return"); - if (!innerResult) { - if (kind === "throw") - throw value; - return value; - } - innerResult = call(innerResult, iterator); - } catch (error) { - innerError = true; - innerResult = error; - } - if (kind === "throw") - throw value; - if (innerError) - throw innerResult; - anObject(innerResult); - return value; - }; - } -}); - -// node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js -var require_call_with_safe_iteration_closing = __commonJS({ - "node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js"(exports, module2) { - var anObject = require_an_object(); - var iteratorClose = require_iterator_close(); - module2.exports = function(iterator, fn2, value, ENTRIES) { - try { - return ENTRIES ? fn2(anObject(value)[0], value[1]) : fn2(value); - } catch (error) { - iteratorClose(iterator, "throw", error); - } - }; - } -}); - -// node_modules/core-js-pure/internals/is-array-iterator-method.js -var require_is_array_iterator_method = __commonJS({ - "node_modules/core-js-pure/internals/is-array-iterator-method.js"(exports, module2) { - var wellKnownSymbol = require_well_known_symbol(); - var Iterators = require_iterators(); - var ITERATOR = wellKnownSymbol("iterator"); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); - }; - } -}); - -// node_modules/core-js-pure/internals/get-iterator-method.js -var require_get_iterator_method = __commonJS({ - "node_modules/core-js-pure/internals/get-iterator-method.js"(exports, module2) { - var classof = require_classof(); - var getMethod = require_get_method(); - var isNullOrUndefined = require_is_null_or_undefined(); - var Iterators = require_iterators(); - var wellKnownSymbol = require_well_known_symbol(); - var ITERATOR = wellKnownSymbol("iterator"); - module2.exports = function(it) { - if (!isNullOrUndefined(it)) - return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)]; - }; - } -}); - -// node_modules/core-js-pure/internals/get-iterator.js -var require_get_iterator = __commonJS({ - "node_modules/core-js-pure/internals/get-iterator.js"(exports, module2) { - var call = require_function_call(); - var aCallable = require_a_callable(); - var anObject = require_an_object(); - var tryToString = require_try_to_string(); - var getIteratorMethod = require_get_iterator_method(); - var $TypeError = TypeError; - module2.exports = function(argument, usingIterator) { - var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; - if (aCallable(iteratorMethod)) - return anObject(call(iteratorMethod, argument)); - throw $TypeError(tryToString(argument) + " is not iterable"); - }; - } -}); - -// node_modules/core-js-pure/internals/array-from.js -var require_array_from = __commonJS({ - "node_modules/core-js-pure/internals/array-from.js"(exports, module2) { - "use strict"; - var bind = require_function_bind_context(); - var call = require_function_call(); - var toObject = require_to_object(); - var callWithSafeIterationClosing = require_call_with_safe_iteration_closing(); - var isArrayIteratorMethod = require_is_array_iterator_method(); - var isConstructor = require_is_constructor(); - var lengthOfArrayLike = require_length_of_array_like(); - var createProperty = require_create_property(); - var getIterator = require_get_iterator(); - var getIteratorMethod = require_get_iterator_method(); - var $Array = Array; - module2.exports = function from(arrayLike) { - var O = toObject(arrayLike); - var IS_CONSTRUCTOR = isConstructor(this); - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : void 0; - var mapping = mapfn !== void 0; - if (mapping) - mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0); - var iteratorMethod = getIteratorMethod(O); - var index = 0; - var length, result, step, iterator, next, value; - if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = getIterator(O, iteratorMethod); - next = iterator.next; - result = IS_CONSTRUCTOR ? new this() : []; - for (; !(step = call(next, iterator)).done; index++) { - value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; - createProperty(result, index, value); - } - } else { - length = lengthOfArrayLike(O); - result = IS_CONSTRUCTOR ? new this(length) : $Array(length); - for (; length > index; index++) { - value = mapping ? mapfn(O[index], index) : O[index]; - createProperty(result, index, value); - } - } - result.length = index; - return result; - }; - } -}); - -// node_modules/core-js-pure/internals/check-correctness-of-iteration.js -var require_check_correctness_of_iteration = __commonJS({ - "node_modules/core-js-pure/internals/check-correctness-of-iteration.js"(exports, module2) { - var wellKnownSymbol = require_well_known_symbol(); - var ITERATOR = wellKnownSymbol("iterator"); - var SAFE_CLOSING = false; - try { - called = 0; - iteratorWithReturn = { - next: function() { - return { done: !!called++ }; - }, - "return": function() { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR] = function() { - return this; - }; - Array.from(iteratorWithReturn, function() { - throw 2; - }); - } catch (error) { - } - var called; - var iteratorWithReturn; - module2.exports = function(exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) - return false; - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR] = function() { - return { - next: function() { - return { done: ITERATION_SUPPORT = true }; - } - }; - }; - exec(object); - } catch (error) { - } - return ITERATION_SUPPORT; - }; - } -}); - -// node_modules/core-js-pure/modules/es.array.from.js -var require_es_array_from = __commonJS({ - "node_modules/core-js-pure/modules/es.array.from.js"() { - var $ = require_export(); - var from = require_array_from(); - var checkCorrectnessOfIteration = require_check_correctness_of_iteration(); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { - Array.from(iterable); - }); - $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { - from - }); - } -}); - -// node_modules/core-js-pure/es/array/from.js -var require_from = __commonJS({ - "node_modules/core-js-pure/es/array/from.js"(exports, module2) { - require_es_string_iterator(); - require_es_array_from(); - var path = require_path(); - module2.exports = path.Array.from; - } -}); - -// node_modules/core-js-pure/stable/array/from.js -var require_from2 = __commonJS({ - "node_modules/core-js-pure/stable/array/from.js"(exports, module2) { - var parent = require_from(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/array/from.js -var require_from3 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/array/from.js"(exports, module2) { - module2.exports = require_from2(); - } -}); - -// node_modules/core-js-pure/internals/does-not-exceed-safe-integer.js -var require_does_not_exceed_safe_integer = __commonJS({ - "node_modules/core-js-pure/internals/does-not-exceed-safe-integer.js"(exports, module2) { - var $TypeError = TypeError; - var MAX_SAFE_INTEGER = 9007199254740991; - module2.exports = function(it) { - if (it > MAX_SAFE_INTEGER) - throw $TypeError("Maximum allowed index exceeded"); - return it; - }; - } -}); - -// node_modules/core-js-pure/internals/array-species-constructor.js -var require_array_species_constructor = __commonJS({ - "node_modules/core-js-pure/internals/array-species-constructor.js"(exports, module2) { - var isArray = require_is_array(); - var isConstructor = require_is_constructor(); - var isObject = require_is_object(); - var wellKnownSymbol = require_well_known_symbol(); - var SPECIES = wellKnownSymbol("species"); - var $Array = Array; - module2.exports = function(originalArray) { - var C; - if (isArray(originalArray)) { - C = originalArray.constructor; - if (isConstructor(C) && (C === $Array || isArray(C.prototype))) - C = void 0; - else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) - C = void 0; - } - } - return C === void 0 ? $Array : C; - }; - } -}); - -// node_modules/core-js-pure/internals/array-species-create.js -var require_array_species_create = __commonJS({ - "node_modules/core-js-pure/internals/array-species-create.js"(exports, module2) { - var arraySpeciesConstructor = require_array_species_constructor(); - module2.exports = function(originalArray, length) { - return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); - }; - } -}); - -// node_modules/core-js-pure/modules/es.array.concat.js -var require_es_array_concat = __commonJS({ - "node_modules/core-js-pure/modules/es.array.concat.js"() { - "use strict"; - var $ = require_export(); - var fails = require_fails(); - var isArray = require_is_array(); - var isObject = require_is_object(); - var toObject = require_to_object(); - var lengthOfArrayLike = require_length_of_array_like(); - var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer(); - var createProperty = require_create_property(); - var arraySpeciesCreate = require_array_species_create(); - var arrayMethodHasSpeciesSupport = require_array_method_has_species_support(); - var wellKnownSymbol = require_well_known_symbol(); - var V8_VERSION = require_engine_v8_version(); - var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable"); - var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function() { - var array = []; - array[IS_CONCAT_SPREADABLE] = false; - return array.concat()[0] !== array; - }); - var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat"); - var isConcatSpreadable = function(O) { - if (!isObject(O)) - return false; - var spreadable = O[IS_CONCAT_SPREADABLE]; - return spreadable !== void 0 ? !!spreadable : isArray(O); - }; - var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; - $({ target: "Array", proto: true, arity: 1, forced: FORCED }, { - concat: function concat(arg) { - var O = toObject(this); - var A = arraySpeciesCreate(O, 0); - var n = 0; - var i, k, length, len, E; - for (i = -1, length = arguments.length; i < length; i++) { - E = i === -1 ? O : arguments[i]; - if (isConcatSpreadable(E)) { - len = lengthOfArrayLike(E); - doesNotExceedSafeInteger(n + len); - for (k = 0; k < len; k++, n++) - if (k in E) - createProperty(A, n, E[k]); - } else { - doesNotExceedSafeInteger(n + 1); - createProperty(A, n++, E); - } - } - A.length = n; - return A; - } - }); - } -}); - -// node_modules/core-js-pure/modules/es.object.to-string.js -var require_es_object_to_string = __commonJS({ - "node_modules/core-js-pure/modules/es.object.to-string.js"() { - } -}); - -// node_modules/core-js-pure/internals/object-get-own-property-names.js -var require_object_get_own_property_names = __commonJS({ - "node_modules/core-js-pure/internals/object-get-own-property-names.js"(exports) { - var internalObjectKeys = require_object_keys_internal(); - var enumBugKeys = require_enum_bug_keys(); - var hiddenKeys = enumBugKeys.concat("length", "prototype"); - exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); - }; - } -}); - -// node_modules/core-js-pure/internals/array-slice-simple.js -var require_array_slice_simple = __commonJS({ - "node_modules/core-js-pure/internals/array-slice-simple.js"(exports, module2) { - var toAbsoluteIndex = require_to_absolute_index(); - var lengthOfArrayLike = require_length_of_array_like(); - var createProperty = require_create_property(); - var $Array = Array; - var max2 = Math.max; - module2.exports = function(O, start2, end2) { - var length = lengthOfArrayLike(O); - var k = toAbsoluteIndex(start2, length); - var fin = toAbsoluteIndex(end2 === void 0 ? length : end2, length); - var result = $Array(max2(fin - k, 0)); - for (var n = 0; k < fin; k++, n++) - createProperty(result, n, O[k]); - result.length = n; - return result; - }; - } -}); - -// node_modules/core-js-pure/internals/object-get-own-property-names-external.js -var require_object_get_own_property_names_external = __commonJS({ - "node_modules/core-js-pure/internals/object-get-own-property-names-external.js"(exports, module2) { - var classof = require_classof_raw(); - var toIndexedObject = require_to_indexed_object(); - var $getOwnPropertyNames = require_object_get_own_property_names().f; - var arraySlice = require_array_slice_simple(); - var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; - var getWindowNames = function(it) { - try { - return $getOwnPropertyNames(it); - } catch (error) { - return arraySlice(windowNames); - } - }; - module2.exports.f = function getOwnPropertyNames(it) { - return windowNames && classof(it) == "Window" ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); - }; - } -}); - -// node_modules/core-js-pure/internals/object-get-own-property-symbols.js -var require_object_get_own_property_symbols = __commonJS({ - "node_modules/core-js-pure/internals/object-get-own-property-symbols.js"(exports) { - exports.f = Object.getOwnPropertySymbols; - } -}); - -// node_modules/core-js-pure/internals/well-known-symbol-wrapped.js -var require_well_known_symbol_wrapped = __commonJS({ - "node_modules/core-js-pure/internals/well-known-symbol-wrapped.js"(exports) { - var wellKnownSymbol = require_well_known_symbol(); - exports.f = wellKnownSymbol; - } -}); - -// node_modules/core-js-pure/internals/well-known-symbol-define.js -var require_well_known_symbol_define = __commonJS({ - "node_modules/core-js-pure/internals/well-known-symbol-define.js"(exports, module2) { - var path = require_path(); - var hasOwn = require_has_own_property(); - var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped(); - var defineProperty = require_object_define_property().f; - module2.exports = function(NAME) { - var Symbol2 = path.Symbol || (path.Symbol = {}); - if (!hasOwn(Symbol2, NAME)) - defineProperty(Symbol2, NAME, { - value: wrappedWellKnownSymbolModule.f(NAME) - }); - }; - } -}); - -// node_modules/core-js-pure/internals/symbol-define-to-primitive.js -var require_symbol_define_to_primitive = __commonJS({ - "node_modules/core-js-pure/internals/symbol-define-to-primitive.js"(exports, module2) { - var call = require_function_call(); - var getBuiltIn = require_get_built_in(); - var wellKnownSymbol = require_well_known_symbol(); - var defineBuiltIn = require_define_built_in(); - module2.exports = function() { - var Symbol2 = getBuiltIn("Symbol"); - var SymbolPrototype = Symbol2 && Symbol2.prototype; - var valueOf = SymbolPrototype && SymbolPrototype.valueOf; - var TO_PRIMITIVE = wellKnownSymbol("toPrimitive"); - if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { - defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function(hint) { - return call(valueOf, this); - }, { arity: 1 }); - } - }; - } -}); - -// node_modules/core-js-pure/internals/array-iteration.js -var require_array_iteration = __commonJS({ - "node_modules/core-js-pure/internals/array-iteration.js"(exports, module2) { - var bind = require_function_bind_context(); - var uncurryThis = require_function_uncurry_this(); - var IndexedObject = require_indexed_object(); - var toObject = require_to_object(); - var lengthOfArrayLike = require_length_of_array_like(); - var arraySpeciesCreate = require_array_species_create(); - var push = uncurryThis([].push); - var createMethod = function(TYPE) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var IS_FILTER_REJECT = TYPE == 7; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - return function($this, callbackfn, that, specificCreate) { - var O = toObject($this); - var self2 = IndexedObject(O); - var boundFunction = bind(callbackfn, that); - var length = lengthOfArrayLike(self2); - var index = 0; - var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : void 0; - var value, result; - for (; length > index; index++) - if (NO_HOLES || index in self2) { - value = self2[index]; - result = boundFunction(value, index, O); - if (TYPE) { - if (IS_MAP) - target[index] = result; - else if (result) - switch (TYPE) { - case 3: - return true; - case 5: - return value; - case 6: - return index; - case 2: - push(target, value); - } - else - switch (TYPE) { - case 4: - return false; - case 7: - push(target, value); - } - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; - }; - }; - module2.exports = { - forEach: createMethod(0), - map: createMethod(1), - filter: createMethod(2), - some: createMethod(3), - every: createMethod(4), - find: createMethod(5), - findIndex: createMethod(6), - filterReject: createMethod(7) - }; - } -}); - -// node_modules/core-js-pure/modules/es.symbol.constructor.js -var require_es_symbol_constructor = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.constructor.js"() { - "use strict"; - var $ = require_export(); - var global2 = require_global(); - var call = require_function_call(); - var uncurryThis = require_function_uncurry_this(); - var IS_PURE = require_is_pure(); - var DESCRIPTORS = require_descriptors(); - var NATIVE_SYMBOL = require_symbol_constructor_detection(); - var fails = require_fails(); - var hasOwn = require_has_own_property(); - var isPrototypeOf = require_object_is_prototype_of(); - var anObject = require_an_object(); - var toIndexedObject = require_to_indexed_object(); - var toPropertyKey = require_to_property_key(); - var $toString = require_to_string(); - var createPropertyDescriptor = require_create_property_descriptor(); - var nativeObjectCreate = require_object_create(); - var objectKeys = require_object_keys(); - var getOwnPropertyNamesModule = require_object_get_own_property_names(); - var getOwnPropertyNamesExternal = require_object_get_own_property_names_external(); - var getOwnPropertySymbolsModule = require_object_get_own_property_symbols(); - var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor(); - var definePropertyModule = require_object_define_property(); - var definePropertiesModule = require_object_define_properties(); - var propertyIsEnumerableModule = require_object_property_is_enumerable(); - var defineBuiltIn = require_define_built_in(); - var shared = require_shared(); - var sharedKey = require_shared_key(); - var hiddenKeys = require_hidden_keys(); - var uid = require_uid(); - var wellKnownSymbol = require_well_known_symbol(); - var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped(); - var defineWellKnownSymbol = require_well_known_symbol_define(); - var defineSymbolToPrimitive = require_symbol_define_to_primitive(); - var setToStringTag = require_set_to_string_tag(); - var InternalStateModule = require_internal_state(); - var $forEach = require_array_iteration().forEach; - var HIDDEN = sharedKey("hidden"); - var SYMBOL = "Symbol"; - var PROTOTYPE = "prototype"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(SYMBOL); - var ObjectPrototype = Object[PROTOTYPE]; - var $Symbol = global2.Symbol; - var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; - var TypeError2 = global2.TypeError; - var QObject = global2.QObject; - var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - var nativeDefineProperty = definePropertyModule.f; - var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; - var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; - var push = uncurryThis([].push); - var AllSymbols = shared("symbols"); - var ObjectPrototypeSymbols = shared("op-symbols"); - var WellKnownSymbolsStore = shared("wks"); - var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - var setSymbolDescriptor = DESCRIPTORS && fails(function() { - return nativeObjectCreate(nativeDefineProperty({}, "a", { - get: function() { - return nativeDefineProperty(this, "a", { value: 7 }).a; - } - })).a != 7; - }) ? function(O, P, Attributes) { - var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); - if (ObjectPrototypeDescriptor) - delete ObjectPrototype[P]; - nativeDefineProperty(O, P, Attributes); - if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { - nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); - } - } : nativeDefineProperty; - var wrap = function(tag, description) { - var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); - setInternalState(symbol, { - type: SYMBOL, - tag, - description - }); - if (!DESCRIPTORS) - symbol.description = description; - return symbol; - }; - var $defineProperty = function defineProperty(O, P, Attributes) { - if (O === ObjectPrototype) - $defineProperty(ObjectPrototypeSymbols, P, Attributes); - anObject(O); - var key = toPropertyKey(P); - anObject(Attributes); - if (hasOwn(AllSymbols, key)) { - if (!Attributes.enumerable) { - if (!hasOwn(O, HIDDEN)) - nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); - O[HIDDEN][key] = true; - } else { - if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) - O[HIDDEN][key] = false; - Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); - } - return setSymbolDescriptor(O, key, Attributes); - } - return nativeDefineProperty(O, key, Attributes); - }; - var $defineProperties = function defineProperties(O, Properties) { - anObject(O); - var properties = toIndexedObject(Properties); - var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); - $forEach(keys, function(key) { - if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) - $defineProperty(O, key, properties[key]); - }); - return O; - }; - var $create = function create(O, Properties) { - return Properties === void 0 ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); - }; - var $propertyIsEnumerable = function propertyIsEnumerable(V) { - var P = toPropertyKey(V); - var enumerable = call(nativePropertyIsEnumerable, this, P); - if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) - return false; - return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; - }; - var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { - var it = toIndexedObject(O); - var key = toPropertyKey(P); - if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) - return; - var descriptor = nativeGetOwnPropertyDescriptor(it, key); - if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { - descriptor.enumerable = true; - } - return descriptor; - }; - var $getOwnPropertyNames = function getOwnPropertyNames(O) { - var names = nativeGetOwnPropertyNames(toIndexedObject(O)); - var result = []; - $forEach(names, function(key) { - if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) - push(result, key); - }); - return result; - }; - var $getOwnPropertySymbols = function(O) { - var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; - var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); - var result = []; - $forEach(names, function(key) { - if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) { - push(result, AllSymbols[key]); - } - }); - return result; - }; - if (!NATIVE_SYMBOL) { - $Symbol = function Symbol2() { - if (isPrototypeOf(SymbolPrototype, this)) - throw TypeError2("Symbol is not a constructor"); - var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString(arguments[0]); - var tag = uid(description); - var setter = function(value) { - if (this === ObjectPrototype) - call(setter, ObjectPrototypeSymbols, value); - if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) - this[HIDDEN][tag] = false; - setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); - }; - if (DESCRIPTORS && USE_SETTER) - setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); - return wrap(tag, description); - }; - SymbolPrototype = $Symbol[PROTOTYPE]; - defineBuiltIn(SymbolPrototype, "toString", function toString() { - return getInternalState(this).tag; - }); - defineBuiltIn($Symbol, "withoutSetter", function(description) { - return wrap(uid(description), description); - }); - propertyIsEnumerableModule.f = $propertyIsEnumerable; - definePropertyModule.f = $defineProperty; - definePropertiesModule.f = $defineProperties; - getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; - getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; - getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; - wrappedWellKnownSymbolModule.f = function(name) { - return wrap(wellKnownSymbol(name), name); - }; - if (DESCRIPTORS) { - nativeDefineProperty(SymbolPrototype, "description", { - configurable: true, - get: function description() { - return getInternalState(this).description; - } - }); - if (!IS_PURE) { - defineBuiltIn(ObjectPrototype, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true }); - } - } - } - $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { - Symbol: $Symbol - }); - $forEach(objectKeys(WellKnownSymbolsStore), function(name) { - defineWellKnownSymbol(name); - }); - $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { - useSetter: function() { - USE_SETTER = true; - }, - useSimple: function() { - USE_SETTER = false; - } - }); - $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { - create: $create, - defineProperty: $defineProperty, - defineProperties: $defineProperties, - getOwnPropertyDescriptor: $getOwnPropertyDescriptor - }); - $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, { - getOwnPropertyNames: $getOwnPropertyNames - }); - defineSymbolToPrimitive(); - setToStringTag($Symbol, SYMBOL); - hiddenKeys[HIDDEN] = true; - } -}); - -// node_modules/core-js-pure/internals/symbol-registry-detection.js -var require_symbol_registry_detection = __commonJS({ - "node_modules/core-js-pure/internals/symbol-registry-detection.js"(exports, module2) { - var NATIVE_SYMBOL = require_symbol_constructor_detection(); - module2.exports = NATIVE_SYMBOL && !!Symbol["for"] && !!Symbol.keyFor; - } -}); - -// node_modules/core-js-pure/modules/es.symbol.for.js -var require_es_symbol_for = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.for.js"() { - var $ = require_export(); - var getBuiltIn = require_get_built_in(); - var hasOwn = require_has_own_property(); - var toString = require_to_string(); - var shared = require_shared(); - var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection(); - var StringToSymbolRegistry = shared("string-to-symbol-registry"); - var SymbolToStringRegistry = shared("symbol-to-string-registry"); - $({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { - "for": function(key) { - var string = toString(key); - if (hasOwn(StringToSymbolRegistry, string)) - return StringToSymbolRegistry[string]; - var symbol = getBuiltIn("Symbol")(string); - StringToSymbolRegistry[string] = symbol; - SymbolToStringRegistry[symbol] = string; - return symbol; - } - }); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.key-for.js -var require_es_symbol_key_for = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.key-for.js"() { - var $ = require_export(); - var hasOwn = require_has_own_property(); - var isSymbol = require_is_symbol(); - var tryToString = require_try_to_string(); - var shared = require_shared(); - var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection(); - var SymbolToStringRegistry = shared("symbol-to-string-registry"); - $({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) - throw TypeError(tryToString(sym) + " is not a symbol"); - if (hasOwn(SymbolToStringRegistry, sym)) - return SymbolToStringRegistry[sym]; - } - }); - } -}); - -// node_modules/core-js-pure/modules/es.json.stringify.js -var require_es_json_stringify = __commonJS({ - "node_modules/core-js-pure/modules/es.json.stringify.js"() { - var $ = require_export(); - var getBuiltIn = require_get_built_in(); - var apply = require_function_apply(); - var call = require_function_call(); - var uncurryThis = require_function_uncurry_this(); - var fails = require_fails(); - var isArray = require_is_array(); - var isCallable = require_is_callable(); - var isObject = require_is_object(); - var isSymbol = require_is_symbol(); - var arraySlice = require_array_slice(); - var NATIVE_SYMBOL = require_symbol_constructor_detection(); - var $stringify = getBuiltIn("JSON", "stringify"); - var exec = uncurryThis(/./.exec); - var charAt = uncurryThis("".charAt); - var charCodeAt = uncurryThis("".charCodeAt); - var replace = uncurryThis("".replace); - var numberToString = uncurryThis(1 .toString); - var tester = /[\uD800-\uDFFF]/g; - var low = /^[\uD800-\uDBFF]$/; - var hi = /^[\uDC00-\uDFFF]$/; - var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() { - var symbol = getBuiltIn("Symbol")(); - return $stringify([symbol]) != "[null]" || $stringify({ a: symbol }) != "{}" || $stringify(Object(symbol)) != "{}"; - }); - var ILL_FORMED_UNICODE = fails(function() { - return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"'; - }); - var stringifyWithSymbolsFix = function(it, replacer) { - var args = arraySlice(arguments); - var $replacer = replacer; - if (!isObject(replacer) && it === void 0 || isSymbol(it)) - return; - if (!isArray(replacer)) - replacer = function(key, value) { - if (isCallable($replacer)) - value = call($replacer, this, key, value); - if (!isSymbol(value)) - return value; - }; - args[1] = replacer; - return apply($stringify, null, args); - }; - var fixIllFormed = function(match, offset2, string) { - var prev = charAt(string, offset2 - 1); - var next = charAt(string, offset2 + 1); - if (exec(low, match) && !exec(hi, next) || exec(hi, match) && !exec(low, prev)) { - return "\\u" + numberToString(charCodeAt(match, 0), 16); - } - return match; - }; - if ($stringify) { - $({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { - stringify: function stringify(it, replacer, space) { - var args = arraySlice(arguments); - var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args); - return ILL_FORMED_UNICODE && typeof result == "string" ? replace(result, tester, fixIllFormed) : result; - } - }); - } - } -}); - -// node_modules/core-js-pure/modules/es.object.get-own-property-symbols.js -var require_es_object_get_own_property_symbols = __commonJS({ - "node_modules/core-js-pure/modules/es.object.get-own-property-symbols.js"() { - var $ = require_export(); - var NATIVE_SYMBOL = require_symbol_constructor_detection(); - var fails = require_fails(); - var getOwnPropertySymbolsModule = require_object_get_own_property_symbols(); - var toObject = require_to_object(); - var FORCED = !NATIVE_SYMBOL || fails(function() { - getOwnPropertySymbolsModule.f(1); - }); - $({ target: "Object", stat: true, forced: FORCED }, { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : []; - } - }); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.js -var require_es_symbol = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.js"() { - require_es_symbol_constructor(); - require_es_symbol_for(); - require_es_symbol_key_for(); - require_es_json_stringify(); - require_es_object_get_own_property_symbols(); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.async-iterator.js -var require_es_symbol_async_iterator = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.async-iterator.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("asyncIterator"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.description.js -var require_es_symbol_description = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.description.js"() { - } -}); - -// node_modules/core-js-pure/modules/es.symbol.has-instance.js -var require_es_symbol_has_instance = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.has-instance.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("hasInstance"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.is-concat-spreadable.js -var require_es_symbol_is_concat_spreadable = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.is-concat-spreadable.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("isConcatSpreadable"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.iterator.js -var require_es_symbol_iterator = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.iterator.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("iterator"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.match.js -var require_es_symbol_match = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.match.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("match"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.match-all.js -var require_es_symbol_match_all = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.match-all.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("matchAll"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.replace.js -var require_es_symbol_replace = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.replace.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("replace"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.search.js -var require_es_symbol_search = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.search.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("search"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.species.js -var require_es_symbol_species = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.species.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("species"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.split.js -var require_es_symbol_split = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.split.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("split"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.to-primitive.js -var require_es_symbol_to_primitive = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.to-primitive.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - var defineSymbolToPrimitive = require_symbol_define_to_primitive(); - defineWellKnownSymbol("toPrimitive"); - defineSymbolToPrimitive(); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.to-string-tag.js -var require_es_symbol_to_string_tag = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.to-string-tag.js"() { - var getBuiltIn = require_get_built_in(); - var defineWellKnownSymbol = require_well_known_symbol_define(); - var setToStringTag = require_set_to_string_tag(); - defineWellKnownSymbol("toStringTag"); - setToStringTag(getBuiltIn("Symbol"), "Symbol"); - } -}); - -// node_modules/core-js-pure/modules/es.symbol.unscopables.js -var require_es_symbol_unscopables = __commonJS({ - "node_modules/core-js-pure/modules/es.symbol.unscopables.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("unscopables"); - } -}); - -// node_modules/core-js-pure/modules/es.json.to-string-tag.js -var require_es_json_to_string_tag = __commonJS({ - "node_modules/core-js-pure/modules/es.json.to-string-tag.js"() { - var global2 = require_global(); - var setToStringTag = require_set_to_string_tag(); - setToStringTag(global2.JSON, "JSON", true); - } -}); - -// node_modules/core-js-pure/modules/es.math.to-string-tag.js -var require_es_math_to_string_tag = __commonJS({ - "node_modules/core-js-pure/modules/es.math.to-string-tag.js"() { - } -}); - -// node_modules/core-js-pure/modules/es.reflect.to-string-tag.js -var require_es_reflect_to_string_tag = __commonJS({ - "node_modules/core-js-pure/modules/es.reflect.to-string-tag.js"() { - } -}); - -// node_modules/core-js-pure/es/symbol/index.js -var require_symbol = __commonJS({ - "node_modules/core-js-pure/es/symbol/index.js"(exports, module2) { - require_es_array_concat(); - require_es_object_to_string(); - require_es_symbol(); - require_es_symbol_async_iterator(); - require_es_symbol_description(); - require_es_symbol_has_instance(); - require_es_symbol_is_concat_spreadable(); - require_es_symbol_iterator(); - require_es_symbol_match(); - require_es_symbol_match_all(); - require_es_symbol_replace(); - require_es_symbol_search(); - require_es_symbol_species(); - require_es_symbol_split(); - require_es_symbol_to_primitive(); - require_es_symbol_to_string_tag(); - require_es_symbol_unscopables(); - require_es_json_to_string_tag(); - require_es_math_to_string_tag(); - require_es_reflect_to_string_tag(); - var path = require_path(); - module2.exports = path.Symbol; - } -}); - -// node_modules/core-js-pure/internals/add-to-unscopables.js -var require_add_to_unscopables = __commonJS({ - "node_modules/core-js-pure/internals/add-to-unscopables.js"(exports, module2) { - module2.exports = function() { - }; - } -}); - -// node_modules/core-js-pure/modules/es.array.iterator.js -var require_es_array_iterator = __commonJS({ - "node_modules/core-js-pure/modules/es.array.iterator.js"(exports, module2) { - "use strict"; - var toIndexedObject = require_to_indexed_object(); - var addToUnscopables = require_add_to_unscopables(); - var Iterators = require_iterators(); - var InternalStateModule = require_internal_state(); - var defineProperty = require_object_define_property().f; - var defineIterator = require_iterator_define(); - var createIterResultObject = require_create_iter_result_object(); - var IS_PURE = require_is_pure(); - var DESCRIPTORS = require_descriptors(); - var ARRAY_ITERATOR = "Array Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); - module2.exports = defineIterator(Array, "Array", function(iterated, kind) { - setInternalState(this, { - type: ARRAY_ITERATOR, - target: toIndexedObject(iterated), - index: 0, - kind - }); - }, function() { - var state = getInternalState(this); - var target = state.target; - var kind = state.kind; - var index = state.index++; - if (!target || index >= target.length) { - state.target = void 0; - return createIterResultObject(void 0, true); - } - if (kind == "keys") - return createIterResultObject(index, false); - if (kind == "values") - return createIterResultObject(target[index], false); - return createIterResultObject([index, target[index]], false); - }, "values"); - var values = Iterators.Arguments = Iterators.Array; - addToUnscopables("keys"); - addToUnscopables("values"); - addToUnscopables("entries"); - if (!IS_PURE && DESCRIPTORS && values.name !== "values") - try { - defineProperty(values, "name", { value: "values" }); - } catch (error) { - } - } -}); - -// node_modules/core-js-pure/internals/dom-iterables.js -var require_dom_iterables = __commonJS({ - "node_modules/core-js-pure/internals/dom-iterables.js"(exports, module2) { - module2.exports = { - CSSRuleList: 0, - CSSStyleDeclaration: 0, - CSSValueList: 0, - ClientRectList: 0, - DOMRectList: 0, - DOMStringList: 0, - DOMTokenList: 1, - DataTransferItemList: 0, - FileList: 0, - HTMLAllCollection: 0, - HTMLCollection: 0, - HTMLFormElement: 0, - HTMLSelectElement: 0, - MediaList: 0, - MimeTypeArray: 0, - NamedNodeMap: 0, - NodeList: 1, - PaintRequestList: 0, - Plugin: 0, - PluginArray: 0, - SVGLengthList: 0, - SVGNumberList: 0, - SVGPathSegList: 0, - SVGPointList: 0, - SVGStringList: 0, - SVGTransformList: 0, - SourceBufferList: 0, - StyleSheetList: 0, - TextTrackCueList: 0, - TextTrackList: 0, - TouchList: 0 - }; - } -}); - -// node_modules/core-js-pure/modules/web.dom-collections.iterator.js -var require_web_dom_collections_iterator = __commonJS({ - "node_modules/core-js-pure/modules/web.dom-collections.iterator.js"() { - require_es_array_iterator(); - var DOMIterables = require_dom_iterables(); - var global2 = require_global(); - var classof = require_classof(); - var createNonEnumerableProperty = require_create_non_enumerable_property(); - var Iterators = require_iterators(); - var wellKnownSymbol = require_well_known_symbol(); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - for (COLLECTION_NAME in DOMIterables) { - Collection = global2[COLLECTION_NAME]; - CollectionPrototype = Collection && Collection.prototype; - if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) { - createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); - } - Iterators[COLLECTION_NAME] = Iterators.Array; - } - var Collection; - var CollectionPrototype; - var COLLECTION_NAME; - } -}); - -// node_modules/core-js-pure/stable/symbol/index.js -var require_symbol2 = __commonJS({ - "node_modules/core-js-pure/stable/symbol/index.js"(exports, module2) { - var parent = require_symbol(); - require_web_dom_collections_iterator(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js -var require_symbol3 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js"(exports, module2) { - module2.exports = require_symbol2(); - } -}); - -// node_modules/core-js-pure/es/get-iterator-method.js -var require_get_iterator_method2 = __commonJS({ - "node_modules/core-js-pure/es/get-iterator-method.js"(exports, module2) { - require_es_array_iterator(); - require_es_string_iterator(); - var getIteratorMethod = require_get_iterator_method(); - module2.exports = getIteratorMethod; - } -}); - -// node_modules/core-js-pure/stable/get-iterator-method.js -var require_get_iterator_method3 = __commonJS({ - "node_modules/core-js-pure/stable/get-iterator-method.js"(exports, module2) { - var parent = require_get_iterator_method2(); - require_web_dom_collections_iterator(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/actual/get-iterator-method.js -var require_get_iterator_method4 = __commonJS({ - "node_modules/core-js-pure/actual/get-iterator-method.js"(exports, module2) { - var parent = require_get_iterator_method3(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/full/get-iterator-method.js -var require_get_iterator_method5 = __commonJS({ - "node_modules/core-js-pure/full/get-iterator-method.js"(exports, module2) { - var parent = require_get_iterator_method4(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/features/get-iterator-method.js -var require_get_iterator_method6 = __commonJS({ - "node_modules/core-js-pure/features/get-iterator-method.js"(exports, module2) { - module2.exports = require_get_iterator_method5(); - } -}); - -// node_modules/@babel/runtime-corejs3/core-js/get-iterator-method.js -var require_get_iterator_method7 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js/get-iterator-method.js"(exports, module2) { - module2.exports = require_get_iterator_method6(); - } -}); - -// node_modules/core-js-pure/modules/es.array.is-array.js -var require_es_array_is_array = __commonJS({ - "node_modules/core-js-pure/modules/es.array.is-array.js"() { - var $ = require_export(); - var isArray = require_is_array(); - $({ target: "Array", stat: true }, { - isArray - }); - } -}); - -// node_modules/core-js-pure/es/array/is-array.js -var require_is_array2 = __commonJS({ - "node_modules/core-js-pure/es/array/is-array.js"(exports, module2) { - require_es_array_is_array(); - var path = require_path(); - module2.exports = path.Array.isArray; - } -}); - -// node_modules/core-js-pure/stable/array/is-array.js -var require_is_array3 = __commonJS({ - "node_modules/core-js-pure/stable/array/is-array.js"(exports, module2) { - var parent = require_is_array2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js -var require_is_array4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js"(exports, module2) { - module2.exports = require_is_array3(); - } -}); - -// node_modules/core-js-pure/actual/array/is-array.js -var require_is_array5 = __commonJS({ - "node_modules/core-js-pure/actual/array/is-array.js"(exports, module2) { - var parent = require_is_array3(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/full/array/is-array.js -var require_is_array6 = __commonJS({ - "node_modules/core-js-pure/full/array/is-array.js"(exports, module2) { - var parent = require_is_array5(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/features/array/is-array.js -var require_is_array7 = __commonJS({ - "node_modules/core-js-pure/features/array/is-array.js"(exports, module2) { - module2.exports = require_is_array6(); - } -}); - -// node_modules/@babel/runtime-corejs3/core-js/array/is-array.js -var require_is_array8 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js/array/is-array.js"(exports, module2) { - module2.exports = require_is_array7(); - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/arrayWithHoles.js -var require_arrayWithHoles = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/arrayWithHoles.js"(exports, module2) { - var _Array$isArray = require_is_array8(); - function _arrayWithHoles(arr) { - if (_Array$isArray(arr)) - return arr; - } - module2.exports = _arrayWithHoles, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/core-js-pure/actual/symbol/index.js -var require_symbol4 = __commonJS({ - "node_modules/core-js-pure/actual/symbol/index.js"(exports, module2) { - var parent = require_symbol2(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.async-dispose.js -var require_esnext_symbol_async_dispose = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.async-dispose.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("asyncDispose"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.dispose.js -var require_esnext_symbol_dispose = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.dispose.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("dispose"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.matcher.js -var require_esnext_symbol_matcher = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.matcher.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("matcher"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.metadata-key.js -var require_esnext_symbol_metadata_key = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.metadata-key.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("metadataKey"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.observable.js -var require_esnext_symbol_observable = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.observable.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("observable"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.metadata.js -var require_esnext_symbol_metadata = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.metadata.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("metadata"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.pattern-match.js -var require_esnext_symbol_pattern_match = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.pattern-match.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("patternMatch"); - } -}); - -// node_modules/core-js-pure/modules/esnext.symbol.replace-all.js -var require_esnext_symbol_replace_all = __commonJS({ - "node_modules/core-js-pure/modules/esnext.symbol.replace-all.js"() { - var defineWellKnownSymbol = require_well_known_symbol_define(); - defineWellKnownSymbol("replaceAll"); - } -}); - -// node_modules/core-js-pure/full/symbol/index.js -var require_symbol5 = __commonJS({ - "node_modules/core-js-pure/full/symbol/index.js"(exports, module2) { - var parent = require_symbol4(); - require_esnext_symbol_async_dispose(); - require_esnext_symbol_dispose(); - require_esnext_symbol_matcher(); - require_esnext_symbol_metadata_key(); - require_esnext_symbol_observable(); - require_esnext_symbol_metadata(); - require_esnext_symbol_pattern_match(); - require_esnext_symbol_replace_all(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/features/symbol/index.js -var require_symbol6 = __commonJS({ - "node_modules/core-js-pure/features/symbol/index.js"(exports, module2) { - module2.exports = require_symbol5(); - } -}); - -// node_modules/@babel/runtime-corejs3/core-js/symbol.js -var require_symbol7 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js/symbol.js"(exports, module2) { - module2.exports = require_symbol6(); - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/iterableToArrayLimit.js -var require_iterableToArrayLimit = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/iterableToArrayLimit.js"(exports, module2) { - var _Symbol = require_symbol7(); - var _getIteratorMethod = require_get_iterator_method7(); - function _iterableToArrayLimit(arr, i) { - var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"]; - if (_i == null) - return; - var _arr = []; - var _n = true; - var _d = false; - var _s, _e; - try { - for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - module2.exports = _iterableToArrayLimit, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/core-js-pure/actual/instance/slice.js -var require_slice5 = __commonJS({ - "node_modules/core-js-pure/actual/instance/slice.js"(exports, module2) { - var parent = require_slice3(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/full/instance/slice.js -var require_slice6 = __commonJS({ - "node_modules/core-js-pure/full/instance/slice.js"(exports, module2) { - var parent = require_slice5(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/features/instance/slice.js -var require_slice7 = __commonJS({ - "node_modules/core-js-pure/features/instance/slice.js"(exports, module2) { - module2.exports = require_slice6(); - } -}); - -// node_modules/@babel/runtime-corejs3/core-js/instance/slice.js -var require_slice8 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js/instance/slice.js"(exports, module2) { - module2.exports = require_slice7(); - } -}); - -// node_modules/core-js-pure/actual/array/from.js -var require_from4 = __commonJS({ - "node_modules/core-js-pure/actual/array/from.js"(exports, module2) { - var parent = require_from2(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/full/array/from.js -var require_from5 = __commonJS({ - "node_modules/core-js-pure/full/array/from.js"(exports, module2) { - var parent = require_from4(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/features/array/from.js -var require_from6 = __commonJS({ - "node_modules/core-js-pure/features/array/from.js"(exports, module2) { - module2.exports = require_from5(); - } -}); - -// node_modules/@babel/runtime-corejs3/core-js/array/from.js -var require_from7 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js/array/from.js"(exports, module2) { - module2.exports = require_from6(); - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/arrayLikeToArray.js -var require_arrayLikeToArray = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/arrayLikeToArray.js"(exports, module2) { - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - module2.exports = _arrayLikeToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/unsupportedIterableToArray.js -var require_unsupportedIterableToArray = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/unsupportedIterableToArray.js"(exports, module2) { - var _sliceInstanceProperty = require_slice8(); - var _Array$from = require_from7(); - var arrayLikeToArray = require_arrayLikeToArray(); - function _unsupportedIterableToArray(o, minLen) { - var _context; - if (!o) - return; - if (typeof o === "string") - return arrayLikeToArray(o, minLen); - var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return _Array$from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return arrayLikeToArray(o, minLen); - } - module2.exports = _unsupportedIterableToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/nonIterableRest.js -var require_nonIterableRest = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/nonIterableRest.js"(exports, module2) { - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - module2.exports = _nonIterableRest, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js -var require_slicedToArray = __commonJS({ - "node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js"(exports, module2) { - var arrayWithHoles = require_arrayWithHoles(); - var iterableToArrayLimit = require_iterableToArrayLimit(); - var unsupportedIterableToArray = require_unsupportedIterableToArray(); - var nonIterableRest = require_nonIterableRest(); - function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); - } - module2.exports = _slicedToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports; - } -}); - -// node_modules/core-js-pure/modules/es.regexp.flags.js -var require_es_regexp_flags = __commonJS({ - "node_modules/core-js-pure/modules/es.regexp.flags.js"() { - } -}); - -// node_modules/core-js-pure/internals/regexp-flags.js -var require_regexp_flags = __commonJS({ - "node_modules/core-js-pure/internals/regexp-flags.js"(exports, module2) { - "use strict"; - var anObject = require_an_object(); - module2.exports = function() { - var that = anObject(this); - var result = ""; - if (that.hasIndices) - result += "d"; - if (that.global) - result += "g"; - if (that.ignoreCase) - result += "i"; - if (that.multiline) - result += "m"; - if (that.dotAll) - result += "s"; - if (that.unicode) - result += "u"; - if (that.unicodeSets) - result += "v"; - if (that.sticky) - result += "y"; - return result; - }; - } -}); - -// node_modules/core-js-pure/internals/regexp-get-flags.js -var require_regexp_get_flags = __commonJS({ - "node_modules/core-js-pure/internals/regexp-get-flags.js"(exports, module2) { - var call = require_function_call(); - var hasOwn = require_has_own_property(); - var isPrototypeOf = require_object_is_prototype_of(); - var regExpFlags = require_regexp_flags(); - var RegExpPrototype = RegExp.prototype; - module2.exports = function(R) { - var flags = R.flags; - return flags === void 0 && !("flags" in RegExpPrototype) && !hasOwn(R, "flags") && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; - }; - } -}); - -// node_modules/core-js-pure/es/regexp/flags.js -var require_flags = __commonJS({ - "node_modules/core-js-pure/es/regexp/flags.js"(exports, module2) { - require_es_regexp_flags(); - var getRegExpFlags = require_regexp_get_flags(); - module2.exports = getRegExpFlags; - } -}); - -// node_modules/core-js-pure/es/instance/flags.js -var require_flags2 = __commonJS({ - "node_modules/core-js-pure/es/instance/flags.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var flags = require_flags(); - var RegExpPrototype = RegExp.prototype; - module2.exports = function(it) { - return it === RegExpPrototype || isPrototypeOf(RegExpPrototype, it) ? flags(it) : it.flags; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/flags.js -var require_flags3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/flags.js"(exports, module2) { - var parent = require_flags2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/flags.js -var require_flags4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/flags.js"(exports, module2) { - module2.exports = require_flags3(); - } -}); - -// node_modules/core-js-pure/internals/delete-property-or-throw.js -var require_delete_property_or_throw = __commonJS({ - "node_modules/core-js-pure/internals/delete-property-or-throw.js"(exports, module2) { - "use strict"; - var tryToString = require_try_to_string(); - var $TypeError = TypeError; - module2.exports = function(O, P) { - if (!delete O[P]) - throw $TypeError("Cannot delete property " + tryToString(P) + " of " + tryToString(O)); - }; - } -}); - -// node_modules/core-js-pure/internals/array-sort.js -var require_array_sort = __commonJS({ - "node_modules/core-js-pure/internals/array-sort.js"(exports, module2) { - var arraySlice = require_array_slice_simple(); - var floor = Math.floor; - var mergeSort = function(array, comparefn) { - var length = array.length; - var middle = floor(length / 2); - return length < 8 ? insertionSort(array, comparefn) : merge( - array, - mergeSort(arraySlice(array, 0, middle), comparefn), - mergeSort(arraySlice(array, middle), comparefn), - comparefn - ); - }; - var insertionSort = function(array, comparefn) { - var length = array.length; - var i = 1; - var element, j; - while (i < length) { - j = i; - element = array[i]; - while (j && comparefn(array[j - 1], element) > 0) { - array[j] = array[--j]; - } - if (j !== i++) - array[j] = element; - } - return array; - }; - var merge = function(array, left2, right2, comparefn) { - var llength = left2.length; - var rlength = right2.length; - var lindex = 0; - var rindex = 0; - while (lindex < llength || rindex < rlength) { - array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left2[lindex], right2[rindex]) <= 0 ? left2[lindex++] : right2[rindex++] : lindex < llength ? left2[lindex++] : right2[rindex++]; - } - return array; - }; - module2.exports = mergeSort; - } -}); - -// node_modules/core-js-pure/internals/array-method-is-strict.js -var require_array_method_is_strict = __commonJS({ - "node_modules/core-js-pure/internals/array-method-is-strict.js"(exports, module2) { - "use strict"; - var fails = require_fails(); - module2.exports = function(METHOD_NAME, argument) { - var method = [][METHOD_NAME]; - return !!method && fails(function() { - method.call(null, argument || function() { - return 1; - }, 1); - }); - }; - } -}); - -// node_modules/core-js-pure/internals/engine-ff-version.js -var require_engine_ff_version = __commonJS({ - "node_modules/core-js-pure/internals/engine-ff-version.js"(exports, module2) { - var userAgent = require_engine_user_agent(); - var firefox = userAgent.match(/firefox\/(\d+)/i); - module2.exports = !!firefox && +firefox[1]; - } -}); - -// node_modules/core-js-pure/internals/engine-is-ie-or-edge.js -var require_engine_is_ie_or_edge = __commonJS({ - "node_modules/core-js-pure/internals/engine-is-ie-or-edge.js"(exports, module2) { - var UA = require_engine_user_agent(); - module2.exports = /MSIE|Trident/.test(UA); - } -}); - -// node_modules/core-js-pure/internals/engine-webkit-version.js -var require_engine_webkit_version = __commonJS({ - "node_modules/core-js-pure/internals/engine-webkit-version.js"(exports, module2) { - var userAgent = require_engine_user_agent(); - var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); - module2.exports = !!webkit && +webkit[1]; - } -}); - -// node_modules/core-js-pure/modules/es.array.sort.js -var require_es_array_sort = __commonJS({ - "node_modules/core-js-pure/modules/es.array.sort.js"() { - "use strict"; - var $ = require_export(); - var uncurryThis = require_function_uncurry_this(); - var aCallable = require_a_callable(); - var toObject = require_to_object(); - var lengthOfArrayLike = require_length_of_array_like(); - var deletePropertyOrThrow = require_delete_property_or_throw(); - var toString = require_to_string(); - var fails = require_fails(); - var internalSort = require_array_sort(); - var arrayMethodIsStrict = require_array_method_is_strict(); - var FF = require_engine_ff_version(); - var IE_OR_EDGE = require_engine_is_ie_or_edge(); - var V8 = require_engine_v8_version(); - var WEBKIT = require_engine_webkit_version(); - var test = []; - var nativeSort = uncurryThis(test.sort); - var push = uncurryThis(test.push); - var FAILS_ON_UNDEFINED = fails(function() { - test.sort(void 0); - }); - var FAILS_ON_NULL = fails(function() { - test.sort(null); - }); - var STRICT_METHOD = arrayMethodIsStrict("sort"); - var STABLE_SORT = !fails(function() { - if (V8) - return V8 < 70; - if (FF && FF > 3) - return; - if (IE_OR_EDGE) - return true; - if (WEBKIT) - return WEBKIT < 603; - var result = ""; - var code, chr, value, index; - for (code = 65; code < 76; code++) { - chr = String.fromCharCode(code); - switch (code) { - case 66: - case 69: - case 70: - case 72: - value = 3; - break; - case 68: - case 71: - value = 4; - break; - default: - value = 2; - } - for (index = 0; index < 47; index++) { - test.push({ k: chr + index, v: value }); - } - } - test.sort(function(a, b) { - return b.v - a.v; - }); - for (index = 0; index < test.length; index++) { - chr = test[index].k.charAt(0); - if (result.charAt(result.length - 1) !== chr) - result += chr; - } - return result !== "DGBEFHACIJK"; - }); - var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT; - var getSortCompare = function(comparefn) { - return function(x, y) { - if (y === void 0) - return -1; - if (x === void 0) - return 1; - if (comparefn !== void 0) - return +comparefn(x, y) || 0; - return toString(x) > toString(y) ? 1 : -1; - }; - }; - $({ target: "Array", proto: true, forced: FORCED }, { - sort: function sort(comparefn) { - if (comparefn !== void 0) - aCallable(comparefn); - var array = toObject(this); - if (STABLE_SORT) - return comparefn === void 0 ? nativeSort(array) : nativeSort(array, comparefn); - var items = []; - var arrayLength = lengthOfArrayLike(array); - var itemsLength, index; - for (index = 0; index < arrayLength; index++) { - if (index in array) - push(items, array[index]); - } - internalSort(items, getSortCompare(comparefn)); - itemsLength = lengthOfArrayLike(items); - index = 0; - while (index < itemsLength) - array[index] = items[index++]; - while (index < arrayLength) - deletePropertyOrThrow(array, index++); - return array; - } - }); - } -}); - -// node_modules/core-js-pure/es/array/virtual/sort.js -var require_sort = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/sort.js"(exports, module2) { - require_es_array_sort(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").sort; - } -}); - -// node_modules/core-js-pure/es/instance/sort.js -var require_sort2 = __commonJS({ - "node_modules/core-js-pure/es/instance/sort.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_sort(); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - var own = it.sort; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.sort ? method : own; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/sort.js -var require_sort3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/sort.js"(exports, module2) { - var parent = require_sort2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js -var require_sort4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js"(exports, module2) { - module2.exports = require_sort3(); - } -}); - -// node_modules/core-js-pure/internals/whitespaces.js -var require_whitespaces = __commonJS({ - "node_modules/core-js-pure/internals/whitespaces.js"(exports, module2) { - module2.exports = " \n\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"; - } -}); - -// node_modules/core-js-pure/internals/string-trim.js -var require_string_trim = __commonJS({ - "node_modules/core-js-pure/internals/string-trim.js"(exports, module2) { - var uncurryThis = require_function_uncurry_this(); - var requireObjectCoercible = require_require_object_coercible(); - var toString = require_to_string(); - var whitespaces = require_whitespaces(); - var replace = uncurryThis("".replace); - var whitespace = "[" + whitespaces + "]"; - var ltrim = RegExp("^" + whitespace + whitespace + "*"); - var rtrim = RegExp(whitespace + whitespace + "*$"); - var createMethod = function(TYPE) { - return function($this) { - var string = toString(requireObjectCoercible($this)); - if (TYPE & 1) - string = replace(string, ltrim, ""); - if (TYPE & 2) - string = replace(string, rtrim, ""); - return string; - }; - }; - module2.exports = { - start: createMethod(1), - end: createMethod(2), - trim: createMethod(3) - }; - } -}); - -// node_modules/core-js-pure/internals/number-parse-int.js -var require_number_parse_int = __commonJS({ - "node_modules/core-js-pure/internals/number-parse-int.js"(exports, module2) { - var global2 = require_global(); - var fails = require_fails(); - var uncurryThis = require_function_uncurry_this(); - var toString = require_to_string(); - var trim = require_string_trim().trim; - var whitespaces = require_whitespaces(); - var $parseInt = global2.parseInt; - var Symbol2 = global2.Symbol; - var ITERATOR = Symbol2 && Symbol2.iterator; - var hex = /^[+-]?0x/i; - var exec = uncurryThis(hex.exec); - var FORCED = $parseInt(whitespaces + "08") !== 8 || $parseInt(whitespaces + "0x16") !== 22 || ITERATOR && !fails(function() { - $parseInt(Object(ITERATOR)); - }); - module2.exports = FORCED ? function parseInt2(string, radix) { - var S = trim(toString(string)); - return $parseInt(S, radix >>> 0 || (exec(hex, S) ? 16 : 10)); - } : $parseInt; - } -}); - -// node_modules/core-js-pure/modules/es.parse-int.js -var require_es_parse_int = __commonJS({ - "node_modules/core-js-pure/modules/es.parse-int.js"() { - var $ = require_export(); - var $parseInt = require_number_parse_int(); - $({ global: true, forced: parseInt != $parseInt }, { - parseInt: $parseInt - }); - } -}); - -// node_modules/core-js-pure/es/parse-int.js -var require_parse_int = __commonJS({ - "node_modules/core-js-pure/es/parse-int.js"(exports, module2) { - require_es_parse_int(); - var path = require_path(); - module2.exports = path.parseInt; - } -}); - -// node_modules/core-js-pure/stable/parse-int.js -var require_parse_int2 = __commonJS({ - "node_modules/core-js-pure/stable/parse-int.js"(exports, module2) { - var parent = require_parse_int(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.js -var require_parse_int3 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.js"(exports, module2) { - module2.exports = require_parse_int2(); - } -}); - -// node_modules/core-js-pure/modules/es.array.index-of.js -var require_es_array_index_of = __commonJS({ - "node_modules/core-js-pure/modules/es.array.index-of.js"() { - "use strict"; - var $ = require_export(); - var uncurryThis = require_function_uncurry_this(); - var $indexOf = require_array_includes().indexOf; - var arrayMethodIsStrict = require_array_method_is_strict(); - var nativeIndexOf = uncurryThis([].indexOf); - var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0; - var STRICT_METHOD = arrayMethodIsStrict("indexOf"); - $({ target: "Array", proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, { - indexOf: function indexOf(searchElement) { - var fromIndex = arguments.length > 1 ? arguments[1] : void 0; - return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex); - } - }); - } -}); - -// node_modules/core-js-pure/es/array/virtual/index-of.js -var require_index_of = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/index-of.js"(exports, module2) { - require_es_array_index_of(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").indexOf; - } -}); - -// node_modules/core-js-pure/es/instance/index-of.js -var require_index_of2 = __commonJS({ - "node_modules/core-js-pure/es/instance/index-of.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_index_of(); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - var own = it.indexOf; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf ? method : own; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/index-of.js -var require_index_of3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/index-of.js"(exports, module2) { - var parent = require_index_of2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js -var require_index_of4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js"(exports, module2) { - module2.exports = require_index_of3(); - } -}); - -// node_modules/core-js-pure/internals/array-for-each.js -var require_array_for_each = __commonJS({ - "node_modules/core-js-pure/internals/array-for-each.js"(exports, module2) { - "use strict"; - var $forEach = require_array_iteration().forEach; - var arrayMethodIsStrict = require_array_method_is_strict(); - var STRICT_METHOD = arrayMethodIsStrict("forEach"); - module2.exports = !STRICT_METHOD ? function forEach(callbackfn) { - return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0); - } : [].forEach; - } -}); - -// node_modules/core-js-pure/modules/es.array.for-each.js -var require_es_array_for_each = __commonJS({ - "node_modules/core-js-pure/modules/es.array.for-each.js"() { - "use strict"; - var $ = require_export(); - var forEach = require_array_for_each(); - $({ target: "Array", proto: true, forced: [].forEach != forEach }, { - forEach - }); - } -}); - -// node_modules/core-js-pure/es/array/virtual/for-each.js -var require_for_each = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/for-each.js"(exports, module2) { - require_es_array_for_each(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").forEach; - } -}); - -// node_modules/core-js-pure/stable/array/virtual/for-each.js -var require_for_each2 = __commonJS({ - "node_modules/core-js-pure/stable/array/virtual/for-each.js"(exports, module2) { - var parent = require_for_each(); - module2.exports = parent; - } -}); - -// node_modules/core-js-pure/stable/instance/for-each.js -var require_for_each3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/for-each.js"(exports, module2) { - require_web_dom_collections_iterator(); - var classof = require_classof(); - var hasOwn = require_has_own_property(); - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_for_each2(); - var ArrayPrototype = Array.prototype; - var DOMIterables = { - DOMTokenList: true, - NodeList: true - }; - module2.exports = function(it) { - var own = it.forEach; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.forEach || hasOwn(DOMIterables, classof(it)) ? method : own; - }; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js -var require_for_each4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js"(exports, module2) { - module2.exports = require_for_each3(); - } -}); - -// node_modules/core-js-pure/modules/es.object.create.js -var require_es_object_create = __commonJS({ - "node_modules/core-js-pure/modules/es.object.create.js"() { - var $ = require_export(); - var DESCRIPTORS = require_descriptors(); - var create = require_object_create(); - $({ target: "Object", stat: true, sham: !DESCRIPTORS }, { - create - }); - } -}); - -// node_modules/core-js-pure/es/object/create.js -var require_create = __commonJS({ - "node_modules/core-js-pure/es/object/create.js"(exports, module2) { - require_es_object_create(); - var path = require_path(); - var Object2 = path.Object; - module2.exports = function create(P, D) { - return Object2.create(P, D); - }; - } -}); - -// node_modules/core-js-pure/stable/object/create.js -var require_create2 = __commonJS({ - "node_modules/core-js-pure/stable/object/create.js"(exports, module2) { - var parent = require_create(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js -var require_create3 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js"(exports, module2) { - module2.exports = require_create2(); - } -}); - -// node_modules/core-js-pure/es/array/virtual/concat.js -var require_concat = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/concat.js"(exports, module2) { - require_es_array_concat(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").concat; - } -}); - -// node_modules/core-js-pure/es/instance/concat.js -var require_concat2 = __commonJS({ - "node_modules/core-js-pure/es/instance/concat.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_concat(); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - var own = it.concat; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat ? method : own; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/concat.js -var require_concat3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/concat.js"(exports, module2) { - var parent = require_concat2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js -var require_concat4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js"(exports, module2) { - module2.exports = require_concat3(); - } -}); - -// node_modules/xregexp/lib/xregexp.js -var require_xregexp = __commonJS({ - "node_modules/xregexp/lib/xregexp.js"(exports, module2) { - "use strict"; - var _sliceInstanceProperty2 = require_slice4(); - var _Array$from = require_from3(); - var _Symbol = require_symbol3(); - var _getIteratorMethod = require_get_iterator_method7(); - var _Array$isArray = require_is_array4(); - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _slicedToArray2 = _interopRequireDefault(require_slicedToArray()); - var _flags = _interopRequireDefault(require_flags4()); - var _sort = _interopRequireDefault(require_sort4()); - var _slice = _interopRequireDefault(require_slice4()); - var _parseInt2 = _interopRequireDefault(require_parse_int3()); - var _indexOf = _interopRequireDefault(require_index_of4()); - var _forEach = _interopRequireDefault(require_for_each4()); - var _create = _interopRequireDefault(require_create3()); - var _concat = _interopRequireDefault(require_concat4()); - function _createForOfIteratorHelper(o, allowArrayLike) { - var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; - if (!it) { - if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) - o = it; - var i = 0; - var F = function F2() { - }; - return { s: F, n: function n() { - if (i >= o.length) - return { done: true }; - return { done: false, value: o[i++] }; - }, e: function e(_e) { - throw _e; - }, f: F }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var normalCompletion = true, didErr = false, err; - return { s: function s() { - it = it.call(o); - }, n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; - }, e: function e(_e2) { - didErr = true; - err = _e2; - }, f: function f() { - try { - if (!normalCompletion && it["return"] != null) - it["return"](); - } finally { - if (didErr) - throw err; - } - } }; - } - function _unsupportedIterableToArray(o, minLen) { - var _context9; - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = _sliceInstanceProperty2(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return _Array$from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - var REGEX_DATA = "xregexp"; - var features = { - astral: false, - namespacing: true - }; - var fixed = {}; - var regexCache = {}; - var patternCache = {}; - var tokens = []; - var defaultScope = "default"; - var classScope = "class"; - var nativeTokens = { - "default": /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, - "class": /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ - }; - var replacementToken = /\$(?:\{([^\}]+)\}|<([^>]+)>|(\d\d?|[\s\S]?))/g; - var correctExecNpcg = /()??/.exec("")[1] === void 0; - var hasFlagsProp = (0, _flags["default"])(/x/) !== void 0; - function hasNativeFlag(flag) { - var isSupported = true; - try { - new RegExp("", flag); - if (flag === "y") { - var gy = function() { - return "gy"; - }(); - var incompleteY = ".a".replace(new RegExp("a", gy), ".") === ".."; - if (incompleteY) { - isSupported = false; - } - } - } catch (exception) { - isSupported = false; - } - return isSupported; - } - var hasNativeD = hasNativeFlag("d"); - var hasNativeS = hasNativeFlag("s"); - var hasNativeU = hasNativeFlag("u"); - var hasNativeY = hasNativeFlag("y"); - var registeredFlags = { - d: hasNativeD, - g: true, - i: true, - m: true, - s: hasNativeS, - u: hasNativeU, - y: hasNativeY - }; - var nonnativeFlags = hasNativeS ? /[^dgimsuy]+/g : /[^dgimuy]+/g; - function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { - var _context; - regex[REGEX_DATA] = { - captureNames - }; - if (isInternalOnly) { - return regex; - } - if (regex.__proto__) { - regex.__proto__ = XRegExp3.prototype; - } else { - for (var p in XRegExp3.prototype) { - regex[p] = XRegExp3.prototype[p]; - } - } - regex[REGEX_DATA].source = xSource; - regex[REGEX_DATA].flags = xFlags ? (0, _sort["default"])(_context = xFlags.split("")).call(_context).join("") : xFlags; - return regex; - } - function clipDuplicates(str) { - return str.replace(/([\s\S])(?=[\s\S]*\1)/g, ""); - } - function copyRegex(regex, options) { - var _context2; - if (!XRegExp3.isRegExp(regex)) { - throw new TypeError("Type RegExp expected"); - } - var xData = regex[REGEX_DATA] || {}; - var flags = getNativeFlags(regex); - var flagsToAdd = ""; - var flagsToRemove = ""; - var xregexpSource = null; - var xregexpFlags = null; - options = options || {}; - if (options.removeG) { - flagsToRemove += "g"; - } - if (options.removeY) { - flagsToRemove += "y"; - } - if (flagsToRemove) { - flags = flags.replace(new RegExp("[".concat(flagsToRemove, "]+"), "g"), ""); - } - if (options.addG) { - flagsToAdd += "g"; - } - if (options.addY) { - flagsToAdd += "y"; - } - if (flagsToAdd) { - flags = clipDuplicates(flags + flagsToAdd); - } - if (!options.isInternalOnly) { - if (xData.source !== void 0) { - xregexpSource = xData.source; - } - if ((0, _flags["default"])(xData) != null) { - xregexpFlags = flagsToAdd ? clipDuplicates((0, _flags["default"])(xData) + flagsToAdd) : (0, _flags["default"])(xData); - } - } - regex = augment(new RegExp(options.source || regex.source, flags), hasNamedCapture(regex) ? (0, _slice["default"])(_context2 = xData.captureNames).call(_context2, 0) : null, xregexpSource, xregexpFlags, options.isInternalOnly); - return regex; - } - function dec(hex2) { - return (0, _parseInt2["default"])(hex2, 16); - } - function getContextualTokenSeparator(match, scope, flags) { - var matchEndPos = match.index + match[0].length; - var precedingChar = match.input[match.index - 1]; - var followingChar = match.input[matchEndPos]; - if (/^[()|]$/.test(precedingChar) || /^[()|]$/.test(followingChar) || match.index === 0 || matchEndPos === match.input.length || /\(\?(?:[:=!]|<[=!])$/.test(match.input.substring(match.index - 4, match.index)) || isQuantifierNext(match.input, matchEndPos, flags)) { - return ""; - } - return "(?:)"; - } - function getNativeFlags(regex) { - return hasFlagsProp ? (0, _flags["default"])(regex) : /\/([a-z]*)$/i.exec(RegExp.prototype.toString.call(regex))[1]; - } - function hasNamedCapture(regex) { - return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); - } - function hex(dec2) { - return (0, _parseInt2["default"])(dec2, 10).toString(16); - } - function isQuantifierNext(pattern, pos, flags) { - var inlineCommentPattern = "\\(\\?#[^)]*\\)"; - var lineCommentPattern = "#[^#\\n]*"; - var quantifierPattern = "[?*+]|{\\d+(?:,\\d*)?}"; - var regex = (0, _indexOf["default"])(flags).call(flags, "x") !== -1 ? /^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/; - return regex.test((0, _slice["default"])(pattern).call(pattern, pos)); - } - function isType(value, type) { - return Object.prototype.toString.call(value) === "[object ".concat(type, "]"); - } - function nullThrows(value) { - if (value == null) { - throw new TypeError("Cannot convert null or undefined to object"); - } - return value; - } - function pad4(str) { - while (str.length < 4) { - str = "0".concat(str); - } - return str; - } - function prepareFlags(pattern, flags) { - if (clipDuplicates(flags) !== flags) { - throw new SyntaxError("Invalid duplicate regex flag ".concat(flags)); - } - pattern = pattern.replace(/^\(\?([\w$]+)\)/, function($0, $1) { - if (/[dgy]/.test($1)) { - throw new SyntaxError("Cannot use flags dgy in mode modifier ".concat($0)); - } - flags = clipDuplicates(flags + $1); - return ""; - }); - var _iterator = _createForOfIteratorHelper(flags), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var flag = _step.value; - if (!registeredFlags[flag]) { - throw new SyntaxError("Unknown regex flag ".concat(flag)); - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - return { - pattern, - flags - }; - } - function prepareOptions(value) { - var options = {}; - if (isType(value, "String")) { - (0, _forEach["default"])(XRegExp3).call(XRegExp3, value, /[^\s,]+/, function(match) { - options[match] = true; - }); - return options; - } - return value; - } - function registerFlag(flag) { - if (!/^[\w$]$/.test(flag)) { - throw new Error("Flag must be a single character A-Za-z0-9_$"); - } - registeredFlags[flag] = true; - } - function runTokens(pattern, flags, pos, scope, context) { - var i = tokens.length; - var leadChar = pattern[pos]; - var result = null; - var match; - var t; - while (i--) { - t = tokens[i]; - if (t.leadChar && t.leadChar !== leadChar || t.scope !== scope && t.scope !== "all" || t.flag && !((0, _indexOf["default"])(flags).call(flags, t.flag) !== -1)) { - continue; - } - match = XRegExp3.exec(pattern, t.regex, pos, "sticky"); - if (match) { - result = { - matchLength: match[0].length, - output: t.handler.call(context, match, scope, flags), - reparse: t.reparse - }; - break; - } - } - return result; - } - function setAstral(on) { - features.astral = on; - } - function setNamespacing(on) { - features.namespacing = on; - } - function XRegExp3(pattern, flags) { - if (XRegExp3.isRegExp(pattern)) { - if (flags !== void 0) { - throw new TypeError("Cannot supply flags when copying a RegExp"); - } - return copyRegex(pattern); - } - pattern = pattern === void 0 ? "" : String(pattern); - flags = flags === void 0 ? "" : String(flags); - if (XRegExp3.isInstalled("astral") && !((0, _indexOf["default"])(flags).call(flags, "A") !== -1)) { - flags += "A"; - } - if (!patternCache[pattern]) { - patternCache[pattern] = {}; - } - if (!patternCache[pattern][flags]) { - var context = { - hasNamedCapture: false, - captureNames: [] - }; - var scope = defaultScope; - var output = ""; - var pos = 0; - var result; - var applied = prepareFlags(pattern, flags); - var appliedPattern = applied.pattern; - var appliedFlags = (0, _flags["default"])(applied); - while (pos < appliedPattern.length) { - do { - result = runTokens(appliedPattern, appliedFlags, pos, scope, context); - if (result && result.reparse) { - appliedPattern = (0, _slice["default"])(appliedPattern).call(appliedPattern, 0, pos) + result.output + (0, _slice["default"])(appliedPattern).call(appliedPattern, pos + result.matchLength); - } - } while (result && result.reparse); - if (result) { - output += result.output; - pos += result.matchLength || 1; - } else { - var _XRegExp$exec = XRegExp3.exec(appliedPattern, nativeTokens[scope], pos, "sticky"), _XRegExp$exec2 = (0, _slicedToArray2["default"])(_XRegExp$exec, 1), token = _XRegExp$exec2[0]; - output += token; - pos += token.length; - if (token === "[" && scope === defaultScope) { - scope = classScope; - } else if (token === "]" && scope === classScope) { - scope = defaultScope; - } - } - } - patternCache[pattern][flags] = { - pattern: output.replace(/(?:\(\?:\))+/g, "(?:)"), - flags: appliedFlags.replace(nonnativeFlags, ""), - captures: context.hasNamedCapture ? context.captureNames : null - }; - } - var generated = patternCache[pattern][flags]; - return augment(new RegExp(generated.pattern, (0, _flags["default"])(generated)), generated.captures, pattern, flags); - } - XRegExp3.prototype = /(?:)/; - XRegExp3.version = "5.1.1"; - XRegExp3._clipDuplicates = clipDuplicates; - XRegExp3._hasNativeFlag = hasNativeFlag; - XRegExp3._dec = dec; - XRegExp3._hex = hex; - XRegExp3._pad4 = pad4; - XRegExp3.addToken = function(regex, handler, options) { - options = options || {}; - var _options = options, optionalFlags = _options.optionalFlags; - if (options.flag) { - registerFlag(options.flag); - } - if (optionalFlags) { - optionalFlags = optionalFlags.split(""); - var _iterator2 = _createForOfIteratorHelper(optionalFlags), _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) { - var flag = _step2.value; - registerFlag(flag); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - tokens.push({ - regex: copyRegex(regex, { - addG: true, - addY: hasNativeY, - isInternalOnly: true - }), - handler, - scope: options.scope || defaultScope, - flag: options.flag, - reparse: options.reparse, - leadChar: options.leadChar - }); - XRegExp3.cache.flush("patterns"); - }; - XRegExp3.cache = function(pattern, flags) { - if (!regexCache[pattern]) { - regexCache[pattern] = {}; - } - return regexCache[pattern][flags] || (regexCache[pattern][flags] = XRegExp3(pattern, flags)); - }; - XRegExp3.cache.flush = function(cacheName) { - if (cacheName === "patterns") { - patternCache = {}; - } else { - regexCache = {}; - } - }; - XRegExp3.escape = function(str) { - return String(nullThrows(str)).replace(/[\\\[\]{}()*+?.^$|]/g, "\\$&").replace(/[\s#\-,]/g, function(match) { - return "\\u".concat(pad4(hex(match.charCodeAt(0)))); - }); - }; - XRegExp3.exec = function(str, regex, pos, sticky) { - var cacheKey = "g"; - var addY = false; - var fakeY = false; - var match; - addY = hasNativeY && !!(sticky || regex.sticky && sticky !== false); - if (addY) { - cacheKey += "y"; - } else if (sticky) { - fakeY = true; - cacheKey += "FakeY"; - } - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: true, - addY, - source: fakeY ? "".concat(regex.source, "|()") : void 0, - removeY: sticky === false, - isInternalOnly: true - })); - pos = pos || 0; - r2.lastIndex = pos; - match = fixed.exec.call(r2, str); - if (fakeY && match && match.pop() === "") { - match = null; - } - if (regex.global) { - regex.lastIndex = match ? r2.lastIndex : 0; - } - return match; - }; - XRegExp3.forEach = function(str, regex, callback) { - var pos = 0; - var i = -1; - var match; - while (match = XRegExp3.exec(str, regex, pos)) { - callback(match, ++i, str, regex); - pos = match.index + (match[0].length || 1); - } - }; - XRegExp3.globalize = function(regex) { - return copyRegex(regex, { - addG: true - }); - }; - XRegExp3.install = function(options) { - options = prepareOptions(options); - if (!features.astral && options.astral) { - setAstral(true); - } - if (!features.namespacing && options.namespacing) { - setNamespacing(true); - } - }; - XRegExp3.isInstalled = function(feature) { - return !!features[feature]; - }; - XRegExp3.isRegExp = function(value) { - return Object.prototype.toString.call(value) === "[object RegExp]"; - }; - XRegExp3.match = function(str, regex, scope) { - var global2 = regex.global && scope !== "one" || scope === "all"; - var cacheKey = (global2 ? "g" : "") + (regex.sticky ? "y" : "") || "noGY"; - regex[REGEX_DATA] = regex[REGEX_DATA] || {}; - var r2 = regex[REGEX_DATA][cacheKey] || (regex[REGEX_DATA][cacheKey] = copyRegex(regex, { - addG: !!global2, - removeG: scope === "one", - isInternalOnly: true - })); - var result = String(nullThrows(str)).match(r2); - if (regex.global) { - regex.lastIndex = scope === "one" && result ? result.index + result[0].length : 0; - } - return global2 ? result || [] : result && result[0]; - }; - XRegExp3.matchChain = function(str, chain) { - return function recurseChain(values, level) { - var item = chain[level].regex ? chain[level] : { - regex: chain[level] - }; - var matches = []; - function addMatch(match) { - if (item.backref) { - var ERR_UNDEFINED_GROUP = "Backreference to undefined group: ".concat(item.backref); - var isNamedBackref = isNaN(item.backref); - if (isNamedBackref && XRegExp3.isInstalled("namespacing")) { - if (!(match.groups && item.backref in match.groups)) { - throw new ReferenceError(ERR_UNDEFINED_GROUP); - } - } else if (!match.hasOwnProperty(item.backref)) { - throw new ReferenceError(ERR_UNDEFINED_GROUP); - } - var backrefValue = isNamedBackref && XRegExp3.isInstalled("namespacing") ? match.groups[item.backref] : match[item.backref]; - matches.push(backrefValue || ""); - } else { - matches.push(match[0]); - } - } - var _iterator3 = _createForOfIteratorHelper(values), _step3; - try { - for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) { - var value = _step3.value; - (0, _forEach["default"])(XRegExp3).call(XRegExp3, value, item.regex, addMatch); - } - } catch (err) { - _iterator3.e(err); - } finally { - _iterator3.f(); - } - return level === chain.length - 1 || !matches.length ? matches : recurseChain(matches, level + 1); - }([str], 0); - }; - XRegExp3.replace = function(str, search, replacement, scope) { - var isRegex = XRegExp3.isRegExp(search); - var global2 = search.global && scope !== "one" || scope === "all"; - var cacheKey = (global2 ? "g" : "") + (search.sticky ? "y" : "") || "noGY"; - var s2 = search; - if (isRegex) { - search[REGEX_DATA] = search[REGEX_DATA] || {}; - s2 = search[REGEX_DATA][cacheKey] || (search[REGEX_DATA][cacheKey] = copyRegex(search, { - addG: !!global2, - removeG: scope === "one", - isInternalOnly: true - })); - } else if (global2) { - s2 = new RegExp(XRegExp3.escape(String(search)), "g"); - } - var result = fixed.replace.call(nullThrows(str), s2, replacement); - if (isRegex && search.global) { - search.lastIndex = 0; - } - return result; - }; - XRegExp3.replaceEach = function(str, replacements) { - var _iterator4 = _createForOfIteratorHelper(replacements), _step4; - try { - for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) { - var r = _step4.value; - str = XRegExp3.replace(str, r[0], r[1], r[2]); - } - } catch (err) { - _iterator4.e(err); - } finally { - _iterator4.f(); - } - return str; - }; - XRegExp3.split = function(str, separator, limit) { - return fixed.split.call(nullThrows(str), separator, limit); - }; - XRegExp3.test = function(str, regex, pos, sticky) { - return !!XRegExp3.exec(str, regex, pos, sticky); - }; - XRegExp3.uninstall = function(options) { - options = prepareOptions(options); - if (features.astral && options.astral) { - setAstral(false); - } - if (features.namespacing && options.namespacing) { - setNamespacing(false); - } - }; - XRegExp3.union = function(patterns, flags, options) { - options = options || {}; - var conjunction = options.conjunction || "or"; - var numCaptures = 0; - var numPriorCaptures; - var captureNames; - function rewrite(match, paren, backref) { - var name = captureNames[numCaptures - numPriorCaptures]; - if (paren) { - ++numCaptures; - if (name) { - return "(?<".concat(name, ">"); - } - } else if (backref) { - return "\\".concat(+backref + numPriorCaptures); - } - return match; - } - if (!(isType(patterns, "Array") && patterns.length)) { - throw new TypeError("Must provide a nonempty array of patterns to merge"); - } - var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - var output = []; - var _iterator5 = _createForOfIteratorHelper(patterns), _step5; - try { - for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) { - var pattern = _step5.value; - if (XRegExp3.isRegExp(pattern)) { - numPriorCaptures = numCaptures; - captureNames = pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames || []; - output.push(XRegExp3(pattern.source).source.replace(parts, rewrite)); - } else { - output.push(XRegExp3.escape(pattern)); - } - } - } catch (err) { - _iterator5.e(err); - } finally { - _iterator5.f(); - } - var separator = conjunction === "none" ? "" : "|"; - return XRegExp3(output.join(separator), flags); - }; - fixed.exec = function(str) { - var origLastIndex = this.lastIndex; - var match = RegExp.prototype.exec.apply(this, arguments); - if (match) { - if (!correctExecNpcg && match.length > 1 && (0, _indexOf["default"])(match).call(match, "") !== -1) { - var _context3; - var r2 = copyRegex(this, { - removeG: true, - isInternalOnly: true - }); - (0, _slice["default"])(_context3 = String(str)).call(_context3, match.index).replace(r2, function() { - var len = arguments.length; - for (var i2 = 1; i2 < len - 2; ++i2) { - if ((i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2]) === void 0) { - match[i2] = void 0; - } - } - }); - } - if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { - var groupsObject = match; - if (XRegExp3.isInstalled("namespacing")) { - match.groups = (0, _create["default"])(null); - groupsObject = match.groups; - } - for (var i = 1; i < match.length; ++i) { - var name = this[REGEX_DATA].captureNames[i - 1]; - if (name) { - groupsObject[name] = match[i]; - } - } - } else if (!match.groups && XRegExp3.isInstalled("namespacing")) { - match.groups = void 0; - } - if (this.global && !match[0].length && this.lastIndex > match.index) { - this.lastIndex = match.index; - } - } - if (!this.global) { - this.lastIndex = origLastIndex; - } - return match; - }; - fixed.test = function(str) { - return !!fixed.exec.call(this, str); - }; - fixed.match = function(regex) { - if (!XRegExp3.isRegExp(regex)) { - regex = new RegExp(regex); - } else if (regex.global) { - var result = String.prototype.match.apply(this, arguments); - regex.lastIndex = 0; - return result; - } - return fixed.exec.call(regex, nullThrows(this)); - }; - fixed.replace = function(search, replacement) { - var isRegex = XRegExp3.isRegExp(search); - var origLastIndex; - var captureNames; - var result; - if (isRegex) { - if (search[REGEX_DATA]) { - captureNames = search[REGEX_DATA].captureNames; - } - origLastIndex = search.lastIndex; - } else { - search += ""; - } - if (isType(replacement, "Function")) { - result = String(this).replace(search, function() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - if (captureNames) { - var groupsObject; - if (XRegExp3.isInstalled("namespacing")) { - groupsObject = (0, _create["default"])(null); - args.push(groupsObject); - } else { - args[0] = new String(args[0]); - groupsObject = args[0]; - } - for (var i = 0; i < captureNames.length; ++i) { - if (captureNames[i]) { - groupsObject[captureNames[i]] = args[i + 1]; - } - } - } - return replacement.apply(void 0, args); - }); - } else { - result = String(nullThrows(this)).replace(search, function() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return String(replacement).replace(replacementToken, replacer); - function replacer($0, bracketed, angled, dollarToken) { - bracketed = bracketed || angled; - var numNonCaptureArgs = isType(args[args.length - 1], "Object") ? 4 : 3; - var numCaptures = args.length - numNonCaptureArgs; - if (bracketed) { - if (/^\d+$/.test(bracketed)) { - var _n = +bracketed; - if (_n <= numCaptures) { - return args[_n] || ""; - } - } - var n = captureNames ? (0, _indexOf["default"])(captureNames).call(captureNames, bracketed) : -1; - if (n < 0) { - throw new SyntaxError("Backreference to undefined group ".concat($0)); - } - return args[n + 1] || ""; - } - if (dollarToken === "" || dollarToken === " ") { - throw new SyntaxError("Invalid token ".concat($0)); - } - if (dollarToken === "&" || +dollarToken === 0) { - return args[0]; - } - if (dollarToken === "$") { - return "$"; - } - if (dollarToken === "`") { - var _context4; - return (0, _slice["default"])(_context4 = args[args.length - 1]).call(_context4, 0, args[args.length - 2]); - } - if (dollarToken === "'") { - var _context5; - return (0, _slice["default"])(_context5 = args[args.length - 1]).call(_context5, args[args.length - 2] + args[0].length); - } - dollarToken = +dollarToken; - if (!isNaN(dollarToken)) { - if (dollarToken > numCaptures) { - throw new SyntaxError("Backreference to undefined group ".concat($0)); - } - return args[dollarToken] || ""; - } - throw new SyntaxError("Invalid token ".concat($0)); - } - }); - } - if (isRegex) { - if (search.global) { - search.lastIndex = 0; - } else { - search.lastIndex = origLastIndex; - } - } - return result; - }; - fixed.split = function(separator, limit) { - if (!XRegExp3.isRegExp(separator)) { - return String.prototype.split.apply(this, arguments); - } - var str = String(this); - var output = []; - var origLastIndex = separator.lastIndex; - var lastLastIndex = 0; - var lastLength; - limit = (limit === void 0 ? -1 : limit) >>> 0; - (0, _forEach["default"])(XRegExp3).call(XRegExp3, str, separator, function(match) { - if (match.index + match[0].length > lastLastIndex) { - output.push((0, _slice["default"])(str).call(str, lastLastIndex, match.index)); - if (match.length > 1 && match.index < str.length) { - Array.prototype.push.apply(output, (0, _slice["default"])(match).call(match, 1)); - } - lastLength = match[0].length; - lastLastIndex = match.index + lastLength; - } - }); - if (lastLastIndex === str.length) { - if (!separator.test("") || lastLength) { - output.push(""); - } - } else { - output.push((0, _slice["default"])(str).call(str, lastLastIndex)); - } - separator.lastIndex = origLastIndex; - return output.length > limit ? (0, _slice["default"])(output).call(output, 0, limit) : output; - }; - XRegExp3.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, function(match, scope) { - if (match[1] === "B" && scope === defaultScope) { - return match[0]; - } - throw new SyntaxError("Invalid escape ".concat(match[0])); - }, { - scope: "all", - leadChar: "\\" - }); - XRegExp3.addToken(/\\u{([\dA-Fa-f]+)}/, function(match, scope, flags) { - var code = dec(match[1]); - if (code > 1114111) { - throw new SyntaxError("Invalid Unicode code point ".concat(match[0])); - } - if (code <= 65535) { - return "\\u".concat(pad4(hex(code))); - } - if (hasNativeU && (0, _indexOf["default"])(flags).call(flags, "u") !== -1) { - return match[0]; - } - throw new SyntaxError("Cannot use Unicode code point above \\u{FFFF} without flag u"); - }, { - scope: "all", - leadChar: "\\" - }); - XRegExp3.addToken(/\(\?#[^)]*\)/, getContextualTokenSeparator, { - leadChar: "(" - }); - XRegExp3.addToken(/\s+|#[^\n]*\n?/, getContextualTokenSeparator, { - flag: "x" - }); - if (!hasNativeS) { - XRegExp3.addToken(/\./, function() { - return "[\\s\\S]"; - }, { - flag: "s", - leadChar: "." - }); - } - XRegExp3.addToken(/\\k<([^>]+)>/, function(match) { - var _context6, _context7; - var index = isNaN(match[1]) ? (0, _indexOf["default"])(_context6 = this.captureNames).call(_context6, match[1]) + 1 : +match[1]; - var endIndex = match.index + match[0].length; - if (!index || index > this.captureNames.length) { - throw new SyntaxError("Backreference to undefined group ".concat(match[0])); - } - return (0, _concat["default"])(_context7 = "\\".concat(index)).call(_context7, endIndex === match.input.length || isNaN(match.input[endIndex]) ? "" : "(?:)"); - }, { - leadChar: "\\" - }); - XRegExp3.addToken(/\\(\d+)/, function(match, scope) { - if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && match[1] !== "0") { - throw new SyntaxError("Cannot use octal escape or backreference to undefined group ".concat(match[0])); - } - return match[0]; - }, { - scope: "all", - leadChar: "\\" - }); - XRegExp3.addToken(/\(\?P?<((?:[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u0870-\u0887\u0889-\u088E\u0898-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1715\u171F-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B4C\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDF70-\uDF85\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC75\uDC7F-\uDCBA\uDCC2\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39\uDF40-\uDF46]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAE\uDEC0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF])*)>/, function(match) { - var _context8; - if (!XRegExp3.isInstalled("namespacing") && (match[1] === "length" || match[1] === "__proto__")) { - throw new SyntaxError("Cannot use reserved word as capture name ".concat(match[0])); - } - if ((0, _indexOf["default"])(_context8 = this.captureNames).call(_context8, match[1]) !== -1) { - throw new SyntaxError("Cannot use same name for multiple groups ".concat(match[0])); - } - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return "("; - }, { - leadChar: "(" - }); - XRegExp3.addToken(/\((?!\?)/, function(match, scope, flags) { - if ((0, _indexOf["default"])(flags).call(flags, "n") !== -1) { - return "(?:"; - } - this.captureNames.push(null); - return "("; - }, { - optionalFlags: "n", - leadChar: "(" - }); - var _default = XRegExp3; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/core-js-pure/internals/array-reduce.js -var require_array_reduce = __commonJS({ - "node_modules/core-js-pure/internals/array-reduce.js"(exports, module2) { - var aCallable = require_a_callable(); - var toObject = require_to_object(); - var IndexedObject = require_indexed_object(); - var lengthOfArrayLike = require_length_of_array_like(); - var $TypeError = TypeError; - var createMethod = function(IS_RIGHT) { - return function(that, callbackfn, argumentsLength, memo) { - aCallable(callbackfn); - var O = toObject(that); - var self2 = IndexedObject(O); - var length = lengthOfArrayLike(O); - var index = IS_RIGHT ? length - 1 : 0; - var i = IS_RIGHT ? -1 : 1; - if (argumentsLength < 2) - while (true) { - if (index in self2) { - memo = self2[index]; - index += i; - break; - } - index += i; - if (IS_RIGHT ? index < 0 : length <= index) { - throw $TypeError("Reduce of empty array with no initial value"); - } - } - for (; IS_RIGHT ? index >= 0 : length > index; index += i) - if (index in self2) { - memo = callbackfn(memo, self2[index], index, O); - } - return memo; - }; - }; - module2.exports = { - left: createMethod(false), - right: createMethod(true) - }; - } -}); - -// node_modules/core-js-pure/internals/engine-is-node.js -var require_engine_is_node = __commonJS({ - "node_modules/core-js-pure/internals/engine-is-node.js"(exports, module2) { - var classof = require_classof_raw(); - var global2 = require_global(); - module2.exports = classof(global2.process) == "process"; - } -}); - -// node_modules/core-js-pure/modules/es.array.reduce.js -var require_es_array_reduce = __commonJS({ - "node_modules/core-js-pure/modules/es.array.reduce.js"() { - "use strict"; - var $ = require_export(); - var $reduce = require_array_reduce().left; - var arrayMethodIsStrict = require_array_method_is_strict(); - var CHROME_VERSION = require_engine_v8_version(); - var IS_NODE = require_engine_is_node(); - var STRICT_METHOD = arrayMethodIsStrict("reduce"); - var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; - $({ target: "Array", proto: true, forced: !STRICT_METHOD || CHROME_BUG }, { - reduce: function reduce(callbackfn) { - var length = arguments.length; - return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : void 0); - } - }); - } -}); - -// node_modules/core-js-pure/es/array/virtual/reduce.js -var require_reduce = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/reduce.js"(exports, module2) { - require_es_array_reduce(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").reduce; - } -}); - -// node_modules/core-js-pure/es/instance/reduce.js -var require_reduce2 = __commonJS({ - "node_modules/core-js-pure/es/instance/reduce.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_reduce(); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - var own = it.reduce; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.reduce ? method : own; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/reduce.js -var require_reduce3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/reduce.js"(exports, module2) { - var parent = require_reduce2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js -var require_reduce4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js"(exports, module2) { - module2.exports = require_reduce3(); - } -}); - -// node_modules/core-js-pure/modules/es.array.map.js -var require_es_array_map = __commonJS({ - "node_modules/core-js-pure/modules/es.array.map.js"() { - "use strict"; - var $ = require_export(); - var $map = require_array_iteration().map; - var arrayMethodHasSpeciesSupport = require_array_method_has_species_support(); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map"); - $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, { - map: function map(callbackfn) { - return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0); - } - }); - } -}); - -// node_modules/core-js-pure/es/array/virtual/map.js -var require_map = __commonJS({ - "node_modules/core-js-pure/es/array/virtual/map.js"(exports, module2) { - require_es_array_map(); - var entryVirtual = require_entry_virtual(); - module2.exports = entryVirtual("Array").map; - } -}); - -// node_modules/core-js-pure/es/instance/map.js -var require_map2 = __commonJS({ - "node_modules/core-js-pure/es/instance/map.js"(exports, module2) { - var isPrototypeOf = require_object_is_prototype_of(); - var method = require_map(); - var ArrayPrototype = Array.prototype; - module2.exports = function(it) { - var own = it.map; - return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map ? method : own; - }; - } -}); - -// node_modules/core-js-pure/stable/instance/map.js -var require_map3 = __commonJS({ - "node_modules/core-js-pure/stable/instance/map.js"(exports, module2) { - var parent = require_map2(); - module2.exports = parent; - } -}); - -// node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js -var require_map4 = __commonJS({ - "node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js"(exports, module2) { - module2.exports = require_map3(); - } -}); - -// node_modules/xregexp/lib/addons/build.js -var require_build = __commonJS({ - "node_modules/xregexp/lib/addons/build.js"(exports, module2) { - "use strict"; - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _reduce = _interopRequireDefault(require_reduce4()); - var _map = _interopRequireDefault(require_map4()); - var _indexOf = _interopRequireDefault(require_index_of4()); - var _concat = _interopRequireDefault(require_concat4()); - var _default = function _default2(XRegExp3) { - var REGEX_DATA = "xregexp"; - var subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; - var parts = XRegExp3.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], "g", { - conjunction: "or" - }); - function deanchor(pattern) { - var leadingAnchor = /^(?:\(\?:\))*\^/; - var trailingAnchor = /\$(?:\(\?:\))*$/; - if (leadingAnchor.test(pattern) && trailingAnchor.test(pattern) && trailingAnchor.test(pattern.replace(/\\[\s\S]/g, ""))) { - return pattern.replace(leadingAnchor, "").replace(trailingAnchor, ""); - } - return pattern; - } - function asXRegExp(value, addFlagX) { - var flags = addFlagX ? "x" : ""; - return XRegExp3.isRegExp(value) ? value[REGEX_DATA] && value[REGEX_DATA].captureNames ? value : XRegExp3(value.source, flags) : XRegExp3(value, flags); - } - function interpolate(substitution) { - return substitution instanceof RegExp ? substitution : XRegExp3.escape(substitution); - } - function reduceToSubpatternsObject(subpatterns, interpolated, subpatternIndex) { - subpatterns["subpattern".concat(subpatternIndex)] = interpolated; - return subpatterns; - } - function embedSubpatternAfter(raw, subpatternIndex, rawLiterals) { - var hasSubpattern = subpatternIndex < rawLiterals.length - 1; - return raw + (hasSubpattern ? "{{subpattern".concat(subpatternIndex, "}}") : ""); - } - XRegExp3.tag = function(flags) { - return function(literals) { - var _context, _context2; - for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - substitutions[_key - 1] = arguments[_key]; - } - var subpatterns = (0, _reduce["default"])(_context = (0, _map["default"])(substitutions).call(substitutions, interpolate)).call(_context, reduceToSubpatternsObject, {}); - var pattern = (0, _map["default"])(_context2 = literals.raw).call(_context2, embedSubpatternAfter).join(""); - return XRegExp3.build(pattern, subpatterns, flags); - }; - }; - XRegExp3.build = function(pattern, subs, flags) { - flags = flags || ""; - var addFlagX = (0, _indexOf["default"])(flags).call(flags, "x") !== -1; - var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern); - if (inlineFlags) { - flags = XRegExp3._clipDuplicates(flags + inlineFlags[1]); - } - var data = {}; - for (var p in subs) { - if (subs.hasOwnProperty(p)) { - var sub = asXRegExp(subs[p], addFlagX); - data[p] = { - pattern: deanchor(sub.source), - names: sub[REGEX_DATA].captureNames || [] - }; - } - } - var patternAsRegex = asXRegExp(pattern, addFlagX); - var numCaps = 0; - var numPriorCaps; - var numOuterCaps = 0; - var outerCapsMap = [0]; - var outerCapNames = patternAsRegex[REGEX_DATA].captureNames || []; - var output = patternAsRegex.source.replace(parts, function($0, $1, $2, $3, $4) { - var subName = $1 || $2; - var capName; - var intro; - var localCapIndex; - if (subName) { - var _context3; - if (!data.hasOwnProperty(subName)) { - throw new ReferenceError("Undefined property ".concat($0)); - } - if ($1) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - intro = "(?<".concat(capName || subName, ">"); - } else { - intro = "(?:"; - } - numPriorCaps = numCaps; - var rewrittenSubpattern = data[subName].pattern.replace(subParts, function(match, paren, backref) { - if (paren) { - capName = data[subName].names[numCaps - numPriorCaps]; - ++numCaps; - if (capName) { - return "(?<".concat(capName, ">"); - } - } else if (backref) { - localCapIndex = +backref - 1; - return data[subName].names[localCapIndex] ? "\\k<".concat(data[subName].names[localCapIndex], ">") : "\\".concat(+backref + numPriorCaps); - } - return match; - }); - return (0, _concat["default"])(_context3 = "".concat(intro)).call(_context3, rewrittenSubpattern, ")"); - } - if ($3) { - capName = outerCapNames[numOuterCaps]; - outerCapsMap[++numOuterCaps] = ++numCaps; - if (capName) { - return "(?<".concat(capName, ">"); - } - } else if ($4) { - localCapIndex = +$4 - 1; - return outerCapNames[localCapIndex] ? "\\k<".concat(outerCapNames[localCapIndex], ">") : "\\".concat(outerCapsMap[+$4]); - } - return $0; - }); - return XRegExp3(output, flags); - }; - }; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/xregexp/lib/addons/matchrecursive.js -var require_matchrecursive = __commonJS({ - "node_modules/xregexp/lib/addons/matchrecursive.js"(exports, module2) { - "use strict"; - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _indexOf = _interopRequireDefault(require_index_of4()); - var _concat = _interopRequireDefault(require_concat4()); - var _slice = _interopRequireDefault(require_slice4()); - var _default = function _default2(XRegExp3) { - function row(name, value, start2, end2) { - return { - name, - value, - start: start2, - end: end2 - }; - } - XRegExp3.matchRecursive = function(str, left2, right2, flags, options) { - flags = flags || ""; - options = options || {}; - var global2 = (0, _indexOf["default"])(flags).call(flags, "g") !== -1; - var sticky = (0, _indexOf["default"])(flags).call(flags, "y") !== -1; - var basicFlags = flags.replace(/y/g, ""); - left2 = XRegExp3(left2, basicFlags); - right2 = XRegExp3(right2, basicFlags); - var esc; - var _options = options, escapeChar = _options.escapeChar; - if (escapeChar) { - var _context, _context2; - if (escapeChar.length > 1) { - throw new Error("Cannot use more than one escape character"); - } - escapeChar = XRegExp3.escape(escapeChar); - esc = new RegExp( - (0, _concat["default"])(_context = (0, _concat["default"])(_context2 = "(?:".concat(escapeChar, "[\\S\\s]|(?:(?!")).call( - _context2, - XRegExp3.union([left2, right2], "", { - conjunction: "or" - }).source, - ")[^" - )).call(_context, escapeChar, "])+)+"), - flags.replace(XRegExp3._hasNativeFlag("s") ? /[^imsu]/g : /[^imu]/g, "") - ); - } - var openTokens = 0; - var delimStart = 0; - var delimEnd = 0; - var lastOuterEnd = 0; - var outerStart; - var innerStart; - var leftMatch; - var rightMatch; - var vN = options.valueNames; - var output = []; - while (true) { - if (escapeChar) { - delimEnd += (XRegExp3.exec(str, esc, delimEnd, "sticky") || [""])[0].length; - } - leftMatch = XRegExp3.exec(str, left2, delimEnd); - rightMatch = XRegExp3.exec(str, right2, delimEnd); - if (leftMatch && rightMatch) { - if (leftMatch.index <= rightMatch.index) { - rightMatch = null; - } else { - leftMatch = null; - } - } - if (leftMatch || rightMatch) { - delimStart = (leftMatch || rightMatch).index; - delimEnd = delimStart + (leftMatch || rightMatch)[0].length; - } else if (!openTokens) { - break; - } - if (sticky && !openTokens && delimStart > lastOuterEnd) { - break; - } - if (leftMatch) { - if (!openTokens) { - outerStart = delimStart; - innerStart = delimEnd; - } - openTokens += 1; - } else if (rightMatch && openTokens) { - openTokens -= 1; - if (!openTokens) { - if (vN) { - if (vN[0] && outerStart > lastOuterEnd) { - output.push(row(vN[0], (0, _slice["default"])(str).call(str, lastOuterEnd, outerStart), lastOuterEnd, outerStart)); - } - if (vN[1]) { - output.push(row(vN[1], (0, _slice["default"])(str).call(str, outerStart, innerStart), outerStart, innerStart)); - } - if (vN[2]) { - output.push(row(vN[2], (0, _slice["default"])(str).call(str, innerStart, delimStart), innerStart, delimStart)); - } - if (vN[3]) { - output.push(row(vN[3], (0, _slice["default"])(str).call(str, delimStart, delimEnd), delimStart, delimEnd)); - } - } else { - output.push((0, _slice["default"])(str).call(str, innerStart, delimStart)); - } - lastOuterEnd = delimEnd; - if (!global2) { - break; - } - } - } else { - var unbalanced = options.unbalanced || "error"; - if (unbalanced === "skip" || unbalanced === "skip-lazy") { - if (rightMatch) { - rightMatch = null; - } else { - if (unbalanced === "skip") { - var outerStartDelimLength = XRegExp3.exec(str, left2, outerStart, "sticky")[0].length; - delimEnd = outerStart + (outerStartDelimLength || 1); - } else { - delimEnd = outerStart + 1; - } - openTokens = 0; - } - } else if (unbalanced === "error") { - var _context3; - var delimSide = rightMatch ? "right" : "left"; - var errorPos = rightMatch ? delimStart : outerStart; - throw new Error((0, _concat["default"])(_context3 = "Unbalanced ".concat(delimSide, " delimiter found in string at position ")).call(_context3, errorPos)); - } else { - throw new Error("Unsupported value for unbalanced: ".concat(unbalanced)); - } - } - if (delimStart === delimEnd) { - delimEnd += 1; - } - } - if (global2 && output.length > 0 && !sticky && vN && vN[0] && str.length > lastOuterEnd) { - output.push(row(vN[0], (0, _slice["default"])(str).call(str, lastOuterEnd), lastOuterEnd, str.length)); - } - return output; - }; - }; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/xregexp/lib/addons/unicode-base.js -var require_unicode_base = __commonJS({ - "node_modules/xregexp/lib/addons/unicode-base.js"(exports, module2) { - "use strict"; - var _sliceInstanceProperty = require_slice4(); - var _Array$from = require_from3(); - var _Symbol = require_symbol3(); - var _getIteratorMethod = require_get_iterator_method7(); - var _Array$isArray = require_is_array4(); - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _slicedToArray2 = _interopRequireDefault(require_slicedToArray()); - var _forEach = _interopRequireDefault(require_for_each4()); - var _concat = _interopRequireDefault(require_concat4()); - var _indexOf = _interopRequireDefault(require_index_of4()); - function _createForOfIteratorHelper(o, allowArrayLike) { - var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; - if (!it) { - if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) - o = it; - var i = 0; - var F = function F2() { - }; - return { s: F, n: function n() { - if (i >= o.length) - return { done: true }; - return { done: false, value: o[i++] }; - }, e: function e(_e) { - throw _e; - }, f: F }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var normalCompletion = true, didErr = false, err; - return { s: function s() { - it = it.call(o); - }, n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; - }, e: function e(_e2) { - didErr = true; - err = _e2; - }, f: function f() { - try { - if (!normalCompletion && it["return"] != null) - it["return"](); - } finally { - if (didErr) - throw err; - } - } }; - } - function _unsupportedIterableToArray(o, minLen) { - var _context4; - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return _Array$from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - var _default = function _default2(XRegExp3) { - var unicode = {}; - var unicodeTypes = {}; - var dec = XRegExp3._dec; - var hex = XRegExp3._hex; - var pad4 = XRegExp3._pad4; - function normalize(name) { - return name.replace(/[- _]+/g, "").toLowerCase(); - } - function charCode(chr) { - var esc = /^\\[xu](.+)/.exec(chr); - return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === "\\" ? 1 : 0); - } - function invertBmp(range) { - var output = ""; - var lastEnd = -1; - (0, _forEach["default"])(XRegExp3).call(XRegExp3, range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function(m) { - var start2 = charCode(m[1]); - if (start2 > lastEnd + 1) { - output += "\\u".concat(pad4(hex(lastEnd + 1))); - if (start2 > lastEnd + 2) { - output += "-\\u".concat(pad4(hex(start2 - 1))); - } - } - lastEnd = charCode(m[2] || m[1]); - }); - if (lastEnd < 65535) { - output += "\\u".concat(pad4(hex(lastEnd + 1))); - if (lastEnd < 65534) { - output += "-\\uFFFF"; - } - } - return output; - } - function cacheInvertedBmp(slug) { - var prop = "b!"; - return unicode[slug][prop] || (unicode[slug][prop] = invertBmp(unicode[slug].bmp)); - } - function buildAstral(slug, isNegated) { - var item = unicode[slug]; - var combined = ""; - if (item.bmp && !item.isBmpLast) { - var _context; - combined = (0, _concat["default"])(_context = "[".concat(item.bmp, "]")).call(_context, item.astral ? "|" : ""); - } - if (item.astral) { - combined += item.astral; - } - if (item.isBmpLast && item.bmp) { - var _context2; - combined += (0, _concat["default"])(_context2 = "".concat(item.astral ? "|" : "", "[")).call(_context2, item.bmp, "]"); - } - return isNegated ? "(?:(?!".concat(combined, ")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))") : "(?:".concat(combined, ")"); - } - function cacheAstral(slug, isNegated) { - var prop = isNegated ? "a!" : "a="; - return unicode[slug][prop] || (unicode[slug][prop] = buildAstral(slug, isNegated)); - } - XRegExp3.addToken( - /\\([pP])(?:{(\^?)(?:(\w+)=)?([^}]*)}|([A-Za-z]))/, - function(match, scope, flags) { - var ERR_DOUBLE_NEG = "Invalid double negation "; - var ERR_UNKNOWN_NAME = "Unknown Unicode token "; - var ERR_UNKNOWN_REF = "Unicode token missing data "; - var ERR_ASTRAL_ONLY = "Astral mode required for Unicode token "; - var ERR_ASTRAL_IN_CLASS = "Astral mode does not support Unicode tokens within character classes"; - var _match = (0, _slicedToArray2["default"])(match, 6), fullToken = _match[0], pPrefix = _match[1], caretNegation = _match[2], typePrefix = _match[3], tokenName = _match[4], tokenSingleCharName = _match[5]; - var isNegated = pPrefix === "P" || !!caretNegation; - var isAstralMode = (0, _indexOf["default"])(flags).call(flags, "A") !== -1; - var slug = normalize(tokenSingleCharName || tokenName); - var item = unicode[slug]; - if (pPrefix === "P" && caretNegation) { - throw new SyntaxError(ERR_DOUBLE_NEG + fullToken); - } - if (!unicode.hasOwnProperty(slug)) { - throw new SyntaxError(ERR_UNKNOWN_NAME + fullToken); - } - if (typePrefix) { - if (!(unicodeTypes[typePrefix] && unicodeTypes[typePrefix][slug])) { - throw new SyntaxError(ERR_UNKNOWN_NAME + fullToken); - } - } - if (item.inverseOf) { - slug = normalize(item.inverseOf); - if (!unicode.hasOwnProperty(slug)) { - var _context3; - throw new ReferenceError((0, _concat["default"])(_context3 = "".concat(ERR_UNKNOWN_REF + fullToken, " -> ")).call(_context3, item.inverseOf)); - } - item = unicode[slug]; - isNegated = !isNegated; - } - if (!(item.bmp || isAstralMode)) { - throw new SyntaxError(ERR_ASTRAL_ONLY + fullToken); - } - if (isAstralMode) { - if (scope === "class") { - throw new SyntaxError(ERR_ASTRAL_IN_CLASS); - } - return cacheAstral(slug, isNegated); - } - return scope === "class" ? isNegated ? cacheInvertedBmp(slug) : item.bmp : "".concat((isNegated ? "[^" : "[") + item.bmp, "]"); - }, - { - scope: "all", - optionalFlags: "A", - leadChar: "\\" - } - ); - XRegExp3.addUnicodeData = function(data, typePrefix) { - var ERR_NO_NAME = "Unicode token requires name"; - var ERR_NO_DATA = "Unicode token has no character data "; - if (typePrefix) { - unicodeTypes[typePrefix] = {}; - } - var _iterator = _createForOfIteratorHelper(data), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var item = _step.value; - if (!item.name) { - throw new Error(ERR_NO_NAME); - } - if (!(item.inverseOf || item.bmp || item.astral)) { - throw new Error(ERR_NO_DATA + item.name); - } - var normalizedName = normalize(item.name); - unicode[normalizedName] = item; - if (typePrefix) { - unicodeTypes[typePrefix][normalizedName] = true; - } - if (item.alias) { - var normalizedAlias = normalize(item.alias); - unicode[normalizedAlias] = item; - if (typePrefix) { - unicodeTypes[typePrefix][normalizedAlias] = true; - } - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - XRegExp3.cache.flush("patterns"); - }; - XRegExp3._getUnicodeProperty = function(name) { - var slug = normalize(name); - return unicode[slug]; - }; - }; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/xregexp/tools/output/categories.js -var require_categories = __commonJS({ - "node_modules/xregexp/tools/output/categories.js"(exports, module2) { - module2.exports = [ - { - "name": "C", - "alias": "Other", - "isBmpLast": true, - "bmp": "\0-\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u086F\u088F-\u0897\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\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\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\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\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A\u0C3B\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C64\u0C65\u0C70-\u0C76\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDC\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u1716-\u171E\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ACF-\u1AFF\u1B4D-\u1B4F\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFB-\u1CFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C1-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31E4-\u31EF\u321F\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA82D-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB6C-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC3-\uFBD2\uFD90\uFD91\uFDC8-\uFDCE\uFDD0-\uFDEF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF", - "astral": "\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F\uDEAA\uDEAE\uDEAF\uDEB2-\uDEFF\uDF28-\uDF2F\uDF5A-\uDF6F\uDF8A-\uDFAF\uDFCC-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC76-\uDC7E\uDCBD\uDCC3-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD48-\uDD4F\uDD77-\uDD7F\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5C\uDC62-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEBA-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF47-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD47-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE5-\uDDFF\uDE48-\uDE4F\uDEA3-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFAF\uDFB1-\uDFBF\uDFF2-\uDFFE]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD832\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF3-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDEBF\uDECA-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD833[\uDC00-\uDEFF\uDF2E\uDF2F\uDF47-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDEB-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD50-\uDE8F\uDEAF-\uDEBF\uDEFA-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDD00\uDD3E-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED8-\uDEDC\uDEED-\uDEEF\uDEFD-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCB2-\uDCFF\uDE54-\uDE5F\uDE6E\uDE6F\uDE75-\uDE77\uDE7D-\uDE7F\uDE87-\uDE8F\uDEAD-\uDEAF\uDEBB-\uDEBF\uDEC6-\uDECF\uDEDA-\uDEDF\uDEE8-\uDEEF\uDEF7-\uDEFF\uDF93\uDFCB-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF39-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]" - }, - { - "name": "Cc", - "alias": "Control", - "bmp": "\0-\x7F-\x9F" - }, - { - "name": "Cf", - "alias": "Format", - "bmp": "\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB", - "astral": "\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC38]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]" - }, - { - "name": "Cn", - "alias": "Unassigned", - "bmp": "\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u05FF\u070E\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u086F\u088F\u0892-\u0897\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\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\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\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\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A\u0C3B\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C64\u0C65\u0C70-\u0C76\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDC\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u1716-\u171E\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ACF-\u1AFF\u1B4D-\u1B4F\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C89-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFB-\u1CFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20C1-\u20CF\u20F1-\u20FF\u218C-\u218F\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31E4-\u31EF\u321F\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA82D-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB6C-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC3-\uFBD2\uFD90\uFD91\uFDC8-\uFDCE\uFDD0-\uFDEF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF", - "astral": "\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE49-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD28-\uDD2F\uDD3A-\uDE5F\uDE7F\uDEAA\uDEAE\uDEAF\uDEB2-\uDEFF\uDF28-\uDF2F\uDF5A-\uDF6F\uDF8A-\uDFAF\uDFCC-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC76-\uDC7E\uDCC3-\uDCCC\uDCCE\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD48-\uDD4F\uDD77-\uDD7F\uDDE0\uDDF5-\uDDFF\uDE12\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC5C\uDC62-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE5F\uDE6D-\uDE7F\uDEBA-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF47-\uDFFF]|\uD806[\uDC3C-\uDC9F\uDCF3-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD47-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE5-\uDDFF\uDE48-\uDE4F\uDEA3-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC46-\uDC4F\uDC6D-\uDC6F\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF9-\uDFAF\uDFB1-\uDFBF\uDFF2-\uDFFE]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD832\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF3-\uDFFF]|\uD80D[\uDC2F\uDC39-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDEBF\uDECA-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE9B-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD833[\uDC00-\uDEFF\uDF2E\uDF2F\uDF47-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDEB-\uDDFF\uDE46-\uDEDF\uDEF4-\uDEFF\uDF57-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD50-\uDE8F\uDEAF-\uDEBF\uDEFA-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCB5-\uDD00\uDD3E-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED8-\uDEDC\uDEED-\uDEEF\uDEFD-\uDEFF\uDF74-\uDF7F\uDFD9-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCB2-\uDCFF\uDE54-\uDE5F\uDE6E\uDE6F\uDE75-\uDE77\uDE7D-\uDE7F\uDE87-\uDE8F\uDEAD-\uDEAF\uDEBB-\uDEBF\uDEC6-\uDECF\uDEDA-\uDEDF\uDEE8-\uDEEF\uDEF7-\uDEFF\uDF93\uDFCB-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF39-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]" - }, - { - "name": "Co", - "alias": "Private_Use", - "bmp": "\uE000-\uF8FF", - "astral": "[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]" - }, - { - "name": "Cs", - "alias": "Surrogate", - "bmp": "\uD800-\uDFFF" - }, - { - "name": "L", - "alias": "Letter", - "bmp": "A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC", - "astral": "\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]" - }, - { - "name": "LC", - "alias": "Cased_Letter", - "bmp": "A-Za-z\xB5\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BC-\u01BF\u01C4-\u0293\u0295-\u02AF\u0370-\u0373\u0376\u0377\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0560-\u0588\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FD-\u10FF\u13A0-\u13F5\u13F8-\u13FD\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C7B\u2C7E-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA640-\uA66D\uA680-\uA69B\uA722-\uA76F\uA771-\uA787\uA78B-\uA78E\uA790-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F5\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A", - "astral": "\uD801[\uDC00-\uDC4F\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC]|\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD806[\uDCA0-\uDCDF]|\uD81B[\uDE40-\uDE7F]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF09\uDF0B-\uDF1E]|\uD83A[\uDD00-\uDD43]" - }, - { - "name": "Ll", - "alias": "Lowercase_Letter", - "bmp": "a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5F\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C1\uA7C3\uA7C8\uA7CA\uA7D1\uA7D3\uA7D5\uA7D7\uA7D9\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A", - "astral": "\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD837[\uDF00-\uDF09\uDF0B-\uDF1E]|\uD83A[\uDD22-\uDD43]" - }, - { - "name": "Lm", - "alias": "Modifier_Letter", - "bmp": "\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u08C9\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F2-\uA7F4\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uAB69\uFF70\uFF9E\uFF9F", - "astral": "\uD801[\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD838[\uDD37-\uDD3D]|\u{1E94B}" - }, - { - "name": "Lo", - "alias": "Other_Letter", - "bmp": "\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C8\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC", - "astral": "\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF4A\uDF50]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\u{1DF0A}|\uD838[\uDD00-\uDD2C\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]" - }, - { - "name": "Lt", - "alias": "Titlecase_Letter", - "bmp": "\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC" - }, - { - "name": "Lu", - "alias": "Uppercase_Letter", - "bmp": "A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7D0\uA7D6\uA7D8\uA7F5\uFF21-\uFF3A", - "astral": "\uD801[\uDC00-\uDC27\uDCB0-\uDCD3\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]" - }, - { - "name": "M", - "alias": "Mark", - "bmp": "\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F", - "astral": "\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]" - }, - { - "name": "Mc", - "alias": "Spacing_Mark", - "bmp": "\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC", - "astral": "\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD30-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD65\uDD66\uDD6D-\uDD72]" - }, - { - "name": "Me", - "alias": "Enclosing_Mark", - "bmp": "\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672" - }, - { - "name": "Mn", - "alias": "Nonspacing_Mark", - "bmp": "\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F", - "astral": "\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]" - }, - { - "name": "N", - "alias": "Number", - "bmp": "0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19", - "astral": "\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]" - }, - { - "name": "Nd", - "alias": "Decimal_Number", - "bmp": "0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19", - "astral": "\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]" - }, - { - "name": "Nl", - "alias": "Letter_Number", - "bmp": "\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF", - "astral": "\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]" - }, - { - "name": "No", - "alias": "Other_Number", - "bmp": "\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D58-\u0D5E\u0D70-\u0D78\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835", - "astral": "\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD805[\uDF3A\uDF3B]|\uD806[\uDCEA-\uDCF2]|\uD807[\uDC5A-\uDC6C\uDFC0-\uDFD4]|\uD81A[\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD83A[\uDCC7-\uDCCF]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]" - }, - { - "name": "P", - "alias": "Punctuation", - "bmp": "!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65", - "astral": "\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\u{1056F}|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\u{1BC9F}|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]" - }, - { - "name": "Pc", - "alias": "Connector_Punctuation", - "bmp": "_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F" - }, - { - "name": "Pd", - "alias": "Dash_Punctuation", - "bmp": "\\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u2E5D\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D", - "astral": "\u{10EAD}" - }, - { - "name": "Pe", - "alias": "Close_Punctuation", - "bmp": "\\)\\]\\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63" - }, - { - "name": "Pf", - "alias": "Final_Punctuation", - "bmp": "\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21" - }, - { - "name": "Pi", - "alias": "Initial_Punctuation", - "bmp": "\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20" - }, - { - "name": "Po", - "alias": "Other_Punctuation", - "bmp": "!-#%-'\\*,\\.\\/:;\\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4F\u2E52-\u2E54\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65", - "astral": "\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\u{1056F}|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\u{1BC9F}|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]" - }, - { - "name": "Ps", - "alias": "Open_Punctuation", - "bmp": "\\(\\[\\{\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u2E55\u2E57\u2E59\u2E5B\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62" - }, - { - "name": "S", - "alias": "Symbol", - "bmp": "\\$\\+<->\\^`\\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD", - "astral": "\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\u{1173F}|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\u{1BC9C}|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDD-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6\uDF00-\uDF92\uDF94-\uDFCA]" - }, - { - "name": "Sc", - "alias": "Currency_Symbol", - "bmp": "\\$\xA2-\xA5\u058F\u060B\u07FE\u07FF\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20C0\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6", - "astral": "\uD807[\uDFDD-\uDFE0]|\u{1E2FF}|\u{1ECB0}" - }, - { - "name": "Sk", - "alias": "Modifier_Symbol", - "bmp": "\\^`\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u0888\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uAB6A\uAB6B\uFBB2-\uFBC2\uFF3E\uFF40\uFFE3", - "astral": "\uD83C[\uDFFB-\uDFFF]" - }, - { - "name": "Sm", - "alias": "Math_Symbol", - "bmp": "\\+<->\\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC", - "astral": "\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1]" - }, - { - "name": "So", - "alias": "Other_Symbol", - "bmp": "\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D4F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFD40-\uFD4F\uFDCF\uFDFD-\uFDFF\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD", - "astral": "\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\u{1173F}|\uD807[\uDFD5-\uDFDC\uDFE1-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\u{1BC9C}|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\u{1E14F}|\uD83B[\uDCAC\uDD2E]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFA]|\uD83D[\uDC00-\uDED7\uDEDD-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6\uDF00-\uDF92\uDF94-\uDFCA]" - }, - { - "name": "Z", - "alias": "Separator", - "bmp": " \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000" - }, - { - "name": "Zl", - "alias": "Line_Separator", - "bmp": "\u2028" - }, - { - "name": "Zp", - "alias": "Paragraph_Separator", - "bmp": "\u2029" - }, - { - "name": "Zs", - "alias": "Space_Separator", - "bmp": " \xA0\u1680\u2000-\u200A\u202F\u205F\u3000" - } - ]; - } -}); - -// node_modules/xregexp/lib/addons/unicode-categories.js -var require_unicode_categories = __commonJS({ - "node_modules/xregexp/lib/addons/unicode-categories.js"(exports, module2) { - "use strict"; - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _categories = _interopRequireDefault(require_categories()); - var _default = function _default2(XRegExp3) { - if (!XRegExp3.addUnicodeData) { - throw new ReferenceError("Unicode Base must be loaded before Unicode Categories"); - } - XRegExp3.addUnicodeData(_categories["default"]); - }; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/xregexp/tools/output/properties.js -var require_properties = __commonJS({ - "node_modules/xregexp/tools/output/properties.js"(exports, module2) { - module2.exports = [ - { - "name": "ASCII", - "bmp": "\0-\x7F" - }, - { - "name": "Alphabetic", - "bmp": "A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1713\u171F-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1ABF\u1AC0\u1ACC-\u1ACE\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4C\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C36\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA805\uA807-\uA827\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8F2-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC", - "astral": "\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC45\uDC71-\uDC75\uDC82-\uDCB8\uDCC2\uDCD0-\uDCE8\uDD00-\uDD32\uDD44-\uDD47\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2A\uDF40-\uDF46]|\uD806[\uDC00-\uDC38\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B\uDD3C\uDD3F-\uDD42\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDDF\uDDE1\uDDE3\uDDE4\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE97\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD47\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]" - }, - { - "name": "Any", - "isBmpLast": true, - "bmp": "\0-\uFFFF", - "astral": "[\uD800-\uDBFF][\uDC00-\uDFFF]" - }, - { - "name": "Default_Ignorable_Code_Point", - "bmp": "\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180F\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8", - "astral": "\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|[\uDB40-\uDB43][\uDC00-\uDFFF]" - }, - { - "name": "Lowercase", - "bmp": "a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5F\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C1\uA7C3\uA7C8\uA7CA\uA7D1\uA7D3\uA7D5\uA7D7\uA7D9\uA7F6\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A", - "astral": "\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDF80\uDF83-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD837[\uDF00-\uDF09\uDF0B-\uDF1E]|\uD83A[\uDD22-\uDD43]" - }, - { - "name": "Noncharacter_Code_Point", - "bmp": "\uFDD0-\uFDEF\uFFFE\uFFFF", - "astral": "[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]" - }, - { - "name": "Uppercase", - "bmp": "A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7D0\uA7D6\uA7D8\uA7F5\uFF21-\uFF3A", - "astral": "\uD801[\uDC00-\uDC27\uDCB0-\uDCD3\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]" - }, - { - "name": "White_Space", - "bmp": " -\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000" - } - ]; - } -}); - -// node_modules/xregexp/lib/addons/unicode-properties.js -var require_unicode_properties = __commonJS({ - "node_modules/xregexp/lib/addons/unicode-properties.js"(exports, module2) { - "use strict"; - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _properties = _interopRequireDefault(require_properties()); - var _default = function _default2(XRegExp3) { - if (!XRegExp3.addUnicodeData) { - throw new ReferenceError("Unicode Base must be loaded before Unicode Properties"); - } - var unicodeData = _properties["default"]; - unicodeData.push({ - name: "Assigned", - inverseOf: "Cn" - }); - XRegExp3.addUnicodeData(unicodeData); - }; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/xregexp/tools/output/scripts.js -var require_scripts = __commonJS({ - "node_modules/xregexp/tools/output/scripts.js"(exports, module2) { - module2.exports = [ - { - "name": "Adlam", - "astral": "\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]" - }, - { - "name": "Ahom", - "astral": "\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF46]" - }, - { - "name": "Anatolian_Hieroglyphs", - "astral": "\uD811[\uDC00-\uDE46]" - }, - { - "name": "Arabic", - "bmp": "\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u0870-\u088E\u0890\u0891\u0898-\u08E1\u08E3-\u08FF\uFB50-\uFBC2\uFBD3-\uFD3D\uFD40-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC", - "astral": "\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]" - }, - { - "name": "Armenian", - "bmp": "\u0531-\u0556\u0559-\u058A\u058D-\u058F\uFB13-\uFB17" - }, - { - "name": "Avestan", - "astral": "\uD802[\uDF00-\uDF35\uDF39-\uDF3F]" - }, - { - "name": "Balinese", - "bmp": "\u1B00-\u1B4C\u1B50-\u1B7E" - }, - { - "name": "Bamum", - "bmp": "\uA6A0-\uA6F7", - "astral": "\uD81A[\uDC00-\uDE38]" - }, - { - "name": "Bassa_Vah", - "astral": "\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]" - }, - { - "name": "Batak", - "bmp": "\u1BC0-\u1BF3\u1BFC-\u1BFF" - }, - { - "name": "Bengali", - "bmp": "\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE" - }, - { - "name": "Bhaiksuki", - "astral": "\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC45\uDC50-\uDC6C]" - }, - { - "name": "Bopomofo", - "bmp": "\u02EA\u02EB\u3105-\u312F\u31A0-\u31BF" - }, - { - "name": "Brahmi", - "astral": "\uD804[\uDC00-\uDC4D\uDC52-\uDC75\uDC7F]" - }, - { - "name": "Braille", - "bmp": "\u2800-\u28FF" - }, - { - "name": "Buginese", - "bmp": "\u1A00-\u1A1B\u1A1E\u1A1F" - }, - { - "name": "Buhid", - "bmp": "\u1740-\u1753" - }, - { - "name": "Canadian_Aboriginal", - "bmp": "\u1400-\u167F\u18B0-\u18F5", - "astral": "\uD806[\uDEB0-\uDEBF]" - }, - { - "name": "Carian", - "astral": "\uD800[\uDEA0-\uDED0]" - }, - { - "name": "Caucasian_Albanian", - "astral": "\uD801[\uDD30-\uDD63\uDD6F]" - }, - { - "name": "Chakma", - "astral": "\uD804[\uDD00-\uDD34\uDD36-\uDD47]" - }, - { - "name": "Cham", - "bmp": "\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F" - }, - { - "name": "Cherokee", - "bmp": "\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF" - }, - { - "name": "Chorasmian", - "astral": "\uD803[\uDFB0-\uDFCB]" - }, - { - "name": "Common", - "bmp": "\0-@\\[-`\\{-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0605\u060C\u061B\u061F\u0640\u06DD\u08E2\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2E00-\u2E5D\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u32FF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uAB6A\uAB6B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD", - "astral": "\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9C\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD82F[\uDCA0-\uDCA3]|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDEE0-\uDEF3\uDF00-\uDF56\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uD83B[\uDC71-\uDCB4\uDD01-\uDD3D]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDDAD\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDD-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6\uDF00-\uDF92\uDF94-\uDFCA\uDFF0-\uDFF9]|\uDB40[\uDC01\uDC20-\uDC7F]" - }, - { - "name": "Coptic", - "bmp": "\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF" - }, - { - "name": "Cuneiform", - "astral": "\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]" - }, - { - "name": "Cypriot", - "astral": "\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]" - }, - { - "name": "Cypro_Minoan", - "astral": "\uD80B[\uDF90-\uDFF2]" - }, - { - "name": "Cyrillic", - "bmp": "\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F" - }, - { - "name": "Deseret", - "astral": "\uD801[\uDC00-\uDC4F]" - }, - { - "name": "Devanagari", - "bmp": "\u0900-\u0950\u0955-\u0963\u0966-\u097F\uA8E0-\uA8FF" - }, - { - "name": "Dives_Akuru", - "astral": "\uD806[\uDD00-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD46\uDD50-\uDD59]" - }, - { - "name": "Dogra", - "astral": "\uD806[\uDC00-\uDC3B]" - }, - { - "name": "Duployan", - "astral": "\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]" - }, - { - "name": "Egyptian_Hieroglyphs", - "astral": "\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E\uDC30-\uDC38]" - }, - { - "name": "Elbasan", - "astral": "\uD801[\uDD00-\uDD27]" - }, - { - "name": "Elymaic", - "astral": "\uD803[\uDFE0-\uDFF6]" - }, - { - "name": "Ethiopic", - "bmp": "\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E", - "astral": "\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]" - }, - { - "name": "Georgian", - "bmp": "\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u1C90-\u1CBA\u1CBD-\u1CBF\u2D00-\u2D25\u2D27\u2D2D" - }, - { - "name": "Glagolitic", - "bmp": "\u2C00-\u2C5F", - "astral": "\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]" - }, - { - "name": "Gothic", - "astral": "\uD800[\uDF30-\uDF4A]" - }, - { - "name": "Grantha", - "astral": "\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]" - }, - { - "name": "Greek", - "bmp": "\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65", - "astral": "\uD800[\uDD40-\uDD8E\uDDA0]|\uD834[\uDE00-\uDE45]" - }, - { - "name": "Gujarati", - "bmp": "\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF" - }, - { - "name": "Gunjala_Gondi", - "astral": "\uD807[\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9]" - }, - { - "name": "Gurmukhi", - "bmp": "\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76" - }, - { - "name": "Han", - "bmp": "\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9", - "astral": "\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]" - }, - { - "name": "Hangul", - "bmp": "\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC" - }, - { - "name": "Hanifi_Rohingya", - "astral": "\uD803[\uDD00-\uDD27\uDD30-\uDD39]" - }, - { - "name": "Hanunoo", - "bmp": "\u1720-\u1734" - }, - { - "name": "Hatran", - "astral": "\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]" - }, - { - "name": "Hebrew", - "bmp": "\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F" - }, - { - "name": "Hiragana", - "bmp": "\u3041-\u3096\u309D-\u309F", - "astral": "\uD82C[\uDC01-\uDD1F\uDD50-\uDD52]|\u{1F200}" - }, - { - "name": "Imperial_Aramaic", - "astral": "\uD802[\uDC40-\uDC55\uDC57-\uDC5F]" - }, - { - "name": "Inherited", - "bmp": "\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951-\u0954\u1AB0-\u1ACE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D", - "astral": "\uD800[\uDDFD\uDEE0]|\u{1133B}|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uDB40[\uDD00-\uDDEF]" - }, - { - "name": "Inscriptional_Pahlavi", - "astral": "\uD802[\uDF60-\uDF72\uDF78-\uDF7F]" - }, - { - "name": "Inscriptional_Parthian", - "astral": "\uD802[\uDF40-\uDF55\uDF58-\uDF5F]" - }, - { - "name": "Javanese", - "bmp": "\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF" - }, - { - "name": "Kaithi", - "astral": "\uD804[\uDC80-\uDCC2\uDCCD]" - }, - { - "name": "Kannada", - "bmp": "\u0C80-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2" - }, - { - "name": "Katakana", - "bmp": "\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D", - "astral": "\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00\uDD20-\uDD22\uDD64-\uDD67]" - }, - { - "name": "Kayah_Li", - "bmp": "\uA900-\uA92D\uA92F" - }, - { - "name": "Kharoshthi", - "astral": "\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58]" - }, - { - "name": "Khitan_Small_Script", - "astral": "\u{16FE4}|\uD822[\uDF00-\uDFFF]|\uD823[\uDC00-\uDCD5]" - }, - { - "name": "Khmer", - "bmp": "\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF" - }, - { - "name": "Khojki", - "astral": "\uD804[\uDE00-\uDE11\uDE13-\uDE3E]" - }, - { - "name": "Khudawadi", - "astral": "\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]" - }, - { - "name": "Lao", - "bmp": "\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF" - }, - { - "name": "Latin", - "bmp": "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uAB66-\uAB69\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A", - "astral": "\uD801[\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD837[\uDF00-\uDF1E]" - }, - { - "name": "Lepcha", - "bmp": "\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F" - }, - { - "name": "Limbu", - "bmp": "\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F" - }, - { - "name": "Linear_A", - "astral": "\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]" - }, - { - "name": "Linear_B", - "astral": "\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]" - }, - { - "name": "Lisu", - "bmp": "\uA4D0-\uA4FF", - "astral": "\u{11FB0}" - }, - { - "name": "Lycian", - "astral": "\uD800[\uDE80-\uDE9C]" - }, - { - "name": "Lydian", - "astral": "\uD802[\uDD20-\uDD39\uDD3F]" - }, - { - "name": "Mahajani", - "astral": "\uD804[\uDD50-\uDD76]" - }, - { - "name": "Makasar", - "astral": "\uD807[\uDEE0-\uDEF8]" - }, - { - "name": "Malayalam", - "bmp": "\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F" - }, - { - "name": "Mandaic", - "bmp": "\u0840-\u085B\u085E" - }, - { - "name": "Manichaean", - "astral": "\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]" - }, - { - "name": "Marchen", - "astral": "\uD807[\uDC70-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]" - }, - { - "name": "Masaram_Gondi", - "astral": "\uD807[\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]" - }, - { - "name": "Medefaidrin", - "astral": "\uD81B[\uDE40-\uDE9A]" - }, - { - "name": "Meetei_Mayek", - "bmp": "\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9" - }, - { - "name": "Mende_Kikakui", - "astral": "\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]" - }, - { - "name": "Meroitic_Cursive", - "astral": "\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]" - }, - { - "name": "Meroitic_Hieroglyphs", - "astral": "\uD802[\uDD80-\uDD9F]" - }, - { - "name": "Miao", - "astral": "\uD81B[\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F]" - }, - { - "name": "Modi", - "astral": "\uD805[\uDE00-\uDE44\uDE50-\uDE59]" - }, - { - "name": "Mongolian", - "bmp": "\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA", - "astral": "\uD805[\uDE60-\uDE6C]" - }, - { - "name": "Mro", - "astral": "\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]" - }, - { - "name": "Multani", - "astral": "\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]" - }, - { - "name": "Myanmar", - "bmp": "\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F" - }, - { - "name": "Nabataean", - "astral": "\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]" - }, - { - "name": "Nandinagari", - "astral": "\uD806[\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE4]" - }, - { - "name": "New_Tai_Lue", - "bmp": "\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF" - }, - { - "name": "Newa", - "astral": "\uD805[\uDC00-\uDC5B\uDC5D-\uDC61]" - }, - { - "name": "Nko", - "bmp": "\u07C0-\u07FA\u07FD-\u07FF" - }, - { - "name": "Nushu", - "astral": "\u{16FE1}|\uD82C[\uDD70-\uDEFB]" - }, - { - "name": "Nyiakeng_Puachue_Hmong", - "astral": "\uD838[\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDD4F]" - }, - { - "name": "Ogham", - "bmp": "\u1680-\u169C" - }, - { - "name": "Ol_Chiki", - "bmp": "\u1C50-\u1C7F" - }, - { - "name": "Old_Hungarian", - "astral": "\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]" - }, - { - "name": "Old_Italic", - "astral": "\uD800[\uDF00-\uDF23\uDF2D-\uDF2F]" - }, - { - "name": "Old_North_Arabian", - "astral": "\uD802[\uDE80-\uDE9F]" - }, - { - "name": "Old_Permic", - "astral": "\uD800[\uDF50-\uDF7A]" - }, - { - "name": "Old_Persian", - "astral": "\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]" - }, - { - "name": "Old_Sogdian", - "astral": "\uD803[\uDF00-\uDF27]" - }, - { - "name": "Old_South_Arabian", - "astral": "\uD802[\uDE60-\uDE7F]" - }, - { - "name": "Old_Turkic", - "astral": "\uD803[\uDC00-\uDC48]" - }, - { - "name": "Old_Uyghur", - "astral": "\uD803[\uDF70-\uDF89]" - }, - { - "name": "Oriya", - "bmp": "\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77" - }, - { - "name": "Osage", - "astral": "\uD801[\uDCB0-\uDCD3\uDCD8-\uDCFB]" - }, - { - "name": "Osmanya", - "astral": "\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]" - }, - { - "name": "Pahawh_Hmong", - "astral": "\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]" - }, - { - "name": "Palmyrene", - "astral": "\uD802[\uDC60-\uDC7F]" - }, - { - "name": "Pau_Cin_Hau", - "astral": "\uD806[\uDEC0-\uDEF8]" - }, - { - "name": "Phags_Pa", - "bmp": "\uA840-\uA877" - }, - { - "name": "Phoenician", - "astral": "\uD802[\uDD00-\uDD1B\uDD1F]" - }, - { - "name": "Psalter_Pahlavi", - "astral": "\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]" - }, - { - "name": "Rejang", - "bmp": "\uA930-\uA953\uA95F" - }, - { - "name": "Runic", - "bmp": "\u16A0-\u16EA\u16EE-\u16F8" - }, - { - "name": "Samaritan", - "bmp": "\u0800-\u082D\u0830-\u083E" - }, - { - "name": "Saurashtra", - "bmp": "\uA880-\uA8C5\uA8CE-\uA8D9" - }, - { - "name": "Sharada", - "astral": "\uD804[\uDD80-\uDDDF]" - }, - { - "name": "Shavian", - "astral": "\uD801[\uDC50-\uDC7F]" - }, - { - "name": "Siddham", - "astral": "\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]" - }, - { - "name": "SignWriting", - "astral": "\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]" - }, - { - "name": "Sinhala", - "bmp": "\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4", - "astral": "\uD804[\uDDE1-\uDDF4]" - }, - { - "name": "Sogdian", - "astral": "\uD803[\uDF30-\uDF59]" - }, - { - "name": "Sora_Sompeng", - "astral": "\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]" - }, - { - "name": "Soyombo", - "astral": "\uD806[\uDE50-\uDEA2]" - }, - { - "name": "Sundanese", - "bmp": "\u1B80-\u1BBF\u1CC0-\u1CC7" - }, - { - "name": "Syloti_Nagri", - "bmp": "\uA800-\uA82C" - }, - { - "name": "Syriac", - "bmp": "\u0700-\u070D\u070F-\u074A\u074D-\u074F\u0860-\u086A" - }, - { - "name": "Tagalog", - "bmp": "\u1700-\u1715\u171F" - }, - { - "name": "Tagbanwa", - "bmp": "\u1760-\u176C\u176E-\u1770\u1772\u1773" - }, - { - "name": "Tai_Le", - "bmp": "\u1950-\u196D\u1970-\u1974" - }, - { - "name": "Tai_Tham", - "bmp": "\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD" - }, - { - "name": "Tai_Viet", - "bmp": "\uAA80-\uAAC2\uAADB-\uAADF" - }, - { - "name": "Takri", - "astral": "\uD805[\uDE80-\uDEB9\uDEC0-\uDEC9]" - }, - { - "name": "Tamil", - "bmp": "\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA", - "astral": "\uD807[\uDFC0-\uDFF1\uDFFF]" - }, - { - "name": "Tangsa", - "astral": "\uD81A[\uDE70-\uDEBE\uDEC0-\uDEC9]" - }, - { - "name": "Tangut", - "astral": "\u{16FE0}|[\uD81C-\uD820][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEFF]|\uD823[\uDD00-\uDD08]" - }, - { - "name": "Telugu", - "bmp": "\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C7F" - }, - { - "name": "Thaana", - "bmp": "\u0780-\u07B1" - }, - { - "name": "Thai", - "bmp": "\u0E01-\u0E3A\u0E40-\u0E5B" - }, - { - "name": "Tibetan", - "bmp": "\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA" - }, - { - "name": "Tifinagh", - "bmp": "\u2D30-\u2D67\u2D6F\u2D70\u2D7F" - }, - { - "name": "Tirhuta", - "astral": "\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]" - }, - { - "name": "Toto", - "astral": "\uD838[\uDE90-\uDEAE]" - }, - { - "name": "Ugaritic", - "astral": "\uD800[\uDF80-\uDF9D\uDF9F]" - }, - { - "name": "Vai", - "bmp": "\uA500-\uA62B" - }, - { - "name": "Vithkuqi", - "astral": "\uD801[\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC]" - }, - { - "name": "Wancho", - "astral": "\uD838[\uDEC0-\uDEF9\uDEFF]" - }, - { - "name": "Warang_Citi", - "astral": "\uD806[\uDCA0-\uDCF2\uDCFF]" - }, - { - "name": "Yezidi", - "astral": "\uD803[\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1]" - }, - { - "name": "Yi", - "bmp": "\uA000-\uA48C\uA490-\uA4C6" - }, - { - "name": "Zanabazar_Square", - "astral": "\uD806[\uDE00-\uDE47]" - } - ]; - } -}); - -// node_modules/xregexp/lib/addons/unicode-scripts.js -var require_unicode_scripts = __commonJS({ - "node_modules/xregexp/lib/addons/unicode-scripts.js"(exports, module2) { - "use strict"; - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _scripts = _interopRequireDefault(require_scripts()); - var _default = function _default2(XRegExp3) { - if (!XRegExp3.addUnicodeData) { - throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts"); - } - XRegExp3.addUnicodeData(_scripts["default"], "Script"); - }; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// node_modules/xregexp/lib/index.js -var require_lib = __commonJS({ - "node_modules/xregexp/lib/index.js"(exports, module2) { - "use strict"; - var _Object$defineProperty = require_define_property3(); - var _interopRequireDefault = require_interopRequireDefault(); - _Object$defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = void 0; - var _xregexp = _interopRequireDefault(require_xregexp()); - var _build = _interopRequireDefault(require_build()); - var _matchrecursive = _interopRequireDefault(require_matchrecursive()); - var _unicodeBase = _interopRequireDefault(require_unicode_base()); - var _unicodeCategories = _interopRequireDefault(require_unicode_categories()); - var _unicodeProperties = _interopRequireDefault(require_unicode_properties()); - var _unicodeScripts = _interopRequireDefault(require_unicode_scripts()); - (0, _build["default"])(_xregexp["default"]); - (0, _matchrecursive["default"])(_xregexp["default"]); - (0, _unicodeBase["default"])(_xregexp["default"]); - (0, _unicodeCategories["default"])(_xregexp["default"]); - (0, _unicodeProperties["default"])(_xregexp["default"]); - (0, _unicodeScripts["default"])(_xregexp["default"]); - var _default = _xregexp["default"]; - exports["default"] = _default; - module2.exports = exports.default; - } -}); - -// main.ts -var main_exports = {}; -__export(main_exports, { - BulkRenameSettingsTab: () => BulkRenameSettingsTab, - default: () => main_default -}); -module.exports = __toCommonJS(main_exports); -var import_obsidian5 = require("obsidian"); - -// src/suggestions/folderSuggest.ts -var import_obsidian2 = require("obsidian"); - -// src/suggestions/suggest.ts -var import_obsidian = require("obsidian"); - -// node_modules/@popperjs/core/lib/enums.js -var top = "top"; -var bottom = "bottom"; -var right = "right"; -var left = "left"; -var auto = "auto"; -var basePlacements = [top, bottom, right, left]; -var start = "start"; -var end = "end"; -var clippingParents = "clippingParents"; -var viewport = "viewport"; -var popper = "popper"; -var reference = "reference"; -var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { - return acc.concat([placement + "-" + start, placement + "-" + end]); -}, []); -var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { - return acc.concat([placement, placement + "-" + start, placement + "-" + end]); -}, []); -var beforeRead = "beforeRead"; -var read = "read"; -var afterRead = "afterRead"; -var beforeMain = "beforeMain"; -var main = "main"; -var afterMain = "afterMain"; -var beforeWrite = "beforeWrite"; -var write = "write"; -var afterWrite = "afterWrite"; -var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; - -// node_modules/@popperjs/core/lib/dom-utils/getNodeName.js -function getNodeName(element) { - return element ? (element.nodeName || "").toLowerCase() : null; -} - -// node_modules/@popperjs/core/lib/dom-utils/getWindow.js -function getWindow(node) { - if (node == null) { - return window; - } - if (node.toString() !== "[object Window]") { - var ownerDocument = node.ownerDocument; - return ownerDocument ? ownerDocument.defaultView || window : window; - } - return node; -} - -// node_modules/@popperjs/core/lib/dom-utils/instanceOf.js -function isElement(node) { - var OwnElement = getWindow(node).Element; - return node instanceof OwnElement || node instanceof Element; -} -function isHTMLElement(node) { - var OwnElement = getWindow(node).HTMLElement; - return node instanceof OwnElement || node instanceof HTMLElement; -} -function isShadowRoot(node) { - if (typeof ShadowRoot === "undefined") { - return false; - } - var OwnElement = getWindow(node).ShadowRoot; - return node instanceof OwnElement || node instanceof ShadowRoot; -} - -// node_modules/@popperjs/core/lib/modifiers/applyStyles.js -function applyStyles(_ref) { - var state = _ref.state; - Object.keys(state.elements).forEach(function(name) { - var style = state.styles[name] || {}; - var attributes = state.attributes[name] || {}; - var element = state.elements[name]; - if (!isHTMLElement(element) || !getNodeName(element)) { - return; - } - Object.assign(element.style, style); - Object.keys(attributes).forEach(function(name2) { - var value = attributes[name2]; - if (value === false) { - element.removeAttribute(name2); - } else { - element.setAttribute(name2, value === true ? "" : value); - } - }); - }); -} -function effect(_ref2) { - var state = _ref2.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: "0", - top: "0", - margin: "0" - }, - arrow: { - position: "absolute" - }, - reference: {} - }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); - } - return function() { - Object.keys(state.elements).forEach(function(name) { - var element = state.elements[name]; - var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); - var style = styleProperties.reduce(function(style2, property) { - style2[property] = ""; - return style2; - }, {}); - if (!isHTMLElement(element) || !getNodeName(element)) { - return; - } - Object.assign(element.style, style); - Object.keys(attributes).forEach(function(attribute) { - element.removeAttribute(attribute); - }); - }); - }; -} -var applyStyles_default = { - name: "applyStyles", - enabled: true, - phase: "write", - fn: applyStyles, - effect, - requires: ["computeStyles"] -}; - -// node_modules/@popperjs/core/lib/utils/getBasePlacement.js -function getBasePlacement(placement) { - return placement.split("-")[0]; -} - -// node_modules/@popperjs/core/lib/utils/math.js -var max = Math.max; -var min = Math.min; -var round = Math.round; - -// node_modules/@popperjs/core/lib/utils/userAgent.js -function getUAString() { - var uaData = navigator.userAgentData; - if (uaData != null && uaData.brands) { - return uaData.brands.map(function(item) { - return item.brand + "/" + item.version; - }).join(" "); - } - return navigator.userAgent; -} - -// node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js -function isLayoutViewport() { - return !/^((?!chrome|android).)*safari/i.test(getUAString()); -} - -// node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js -function getBoundingClientRect(element, includeScale, isFixedStrategy) { - if (includeScale === void 0) { - includeScale = false; - } - if (isFixedStrategy === void 0) { - isFixedStrategy = false; - } - var clientRect = element.getBoundingClientRect(); - var scaleX = 1; - var scaleY = 1; - if (includeScale && isHTMLElement(element)) { - scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; - scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; - } - var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport; - var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; - var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; - var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; - var width = clientRect.width / scaleX; - var height = clientRect.height / scaleY; - return { - width, - height, - top: y, - right: x + width, - bottom: y + height, - left: x, - x, - y - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js -function getLayoutRect(element) { - var clientRect = getBoundingClientRect(element); - var width = element.offsetWidth; - var height = element.offsetHeight; - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - return { - x: element.offsetLeft, - y: element.offsetTop, - width, - height - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/contains.js -function contains(parent, child) { - var rootNode = child.getRootNode && child.getRootNode(); - if (parent.contains(child)) { - return true; - } else if (rootNode && isShadowRoot(rootNode)) { - var next = child; - do { - if (next && parent.isSameNode(next)) { - return true; - } - next = next.parentNode || next.host; - } while (next); - } - return false; -} - -// node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js -function getComputedStyle(element) { - return getWindow(element).getComputedStyle(element); -} - -// node_modules/@popperjs/core/lib/dom-utils/isTableElement.js -function isTableElement(element) { - return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; -} - -// node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js -function getDocumentElement(element) { - return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement; -} - -// node_modules/@popperjs/core/lib/dom-utils/getParentNode.js -function getParentNode(element) { - if (getNodeName(element) === "html") { - return element; - } - return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element); -} - -// node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js -function getTrueOffsetParent(element) { - if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") { - return null; - } - return element.offsetParent; -} -function getContainingBlock(element) { - var isFirefox = /firefox/i.test(getUAString()); - var isIE = /Trident/i.test(getUAString()); - if (isIE && isHTMLElement(element)) { - var elementCss = getComputedStyle(element); - if (elementCss.position === "fixed") { - return null; - } - } - var currentNode = getParentNode(element); - if (isShadowRoot(currentNode)) { - currentNode = currentNode.host; - } - while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { - var css = getComputedStyle(currentNode); - if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { - return currentNode; - } else { - currentNode = currentNode.parentNode; - } - } - return null; -} -function getOffsetParent(element) { - var window2 = getWindow(element); - var offsetParent = getTrueOffsetParent(element); - while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") { - offsetParent = getTrueOffsetParent(offsetParent); - } - if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) { - return window2; - } - return offsetParent || getContainingBlock(element) || window2; -} - -// node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js -function getMainAxisFromPlacement(placement) { - return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; -} - -// node_modules/@popperjs/core/lib/utils/within.js -function within(min2, value, max2) { - return max(min2, min(value, max2)); -} -function withinMaxClamp(min2, value, max2) { - var v = within(min2, value, max2); - return v > max2 ? max2 : v; -} - -// node_modules/@popperjs/core/lib/utils/getFreshSideObject.js -function getFreshSideObject() { - return { - top: 0, - right: 0, - bottom: 0, - left: 0 - }; -} - -// node_modules/@popperjs/core/lib/utils/mergePaddingObject.js -function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); -} - -// node_modules/@popperjs/core/lib/utils/expandToHashMap.js -function expandToHashMap(value, keys) { - return keys.reduce(function(hashMap, key) { - hashMap[key] = value; - return hashMap; - }, {}); -} - -// node_modules/@popperjs/core/lib/modifiers/arrow.js -var toPaddingObject = function toPaddingObject2(padding, state) { - padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); -}; -function arrow(_ref) { - var _state$modifiersData$; - var state = _ref.state, name = _ref.name, options = _ref.options; - var arrowElement = state.elements.arrow; - var popperOffsets2 = state.modifiersData.popperOffsets; - var basePlacement = getBasePlacement(state.placement); - var axis = getMainAxisFromPlacement(basePlacement); - var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? "height" : "width"; - if (!arrowElement || !popperOffsets2) { - return; - } - var paddingObject = toPaddingObject(options.padding, state); - var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === "y" ? top : left; - var maxProp = axis === "y" ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; - var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; - var arrowOffsetParent = getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; - var centerToReference = endDiff / 2 - startDiff / 2; - var min2 = paddingObject[minProp]; - var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; - var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; - var offset2 = within(min2, center, max2); - var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); -} -function effect2(_ref2) { - var state = _ref2.state, options = _ref2.options; - var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; - if (arrowElement == null) { - return; - } - if (typeof arrowElement === "string") { - arrowElement = state.elements.popper.querySelector(arrowElement); - if (!arrowElement) { - return; - } - } - if (true) { - if (!isHTMLElement(arrowElement)) { - console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" ")); - } - } - if (!contains(state.elements.popper, arrowElement)) { - if (true) { - console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" ")); - } - return; - } - state.elements.arrow = arrowElement; -} -var arrow_default = { - name: "arrow", - enabled: true, - phase: "main", - fn: arrow, - effect: effect2, - requires: ["popperOffsets"], - requiresIfExists: ["preventOverflow"] -}; - -// node_modules/@popperjs/core/lib/utils/getVariation.js -function getVariation(placement) { - return placement.split("-")[1]; -} - -// node_modules/@popperjs/core/lib/modifiers/computeStyles.js -var unsetSides = { - top: "auto", - right: "auto", - bottom: "auto", - left: "auto" -}; -function roundOffsetsByDPR(_ref) { - var x = _ref.x, y = _ref.y; - var win = window; - var dpr = win.devicePixelRatio || 1; - return { - x: round(x * dpr) / dpr || 0, - y: round(y * dpr) / dpr || 0 - }; -} -function mapToStyles(_ref2) { - var _Object$assign2; - var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; - var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y; - var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ - x, - y - }) : { - x, - y - }; - x = _ref3.x; - y = _ref3.y; - var hasX = offsets.hasOwnProperty("x"); - var hasY = offsets.hasOwnProperty("y"); - var sideX = left; - var sideY = top; - var win = window; - if (adaptive) { - var offsetParent = getOffsetParent(popper2); - var heightProp = "clientHeight"; - var widthProp = "clientWidth"; - if (offsetParent === getWindow(popper2)) { - offsetParent = getDocumentElement(popper2); - if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") { - heightProp = "scrollHeight"; - widthProp = "scrollWidth"; - } - } - offsetParent = offsetParent; - if (placement === top || (placement === left || placement === right) && variation === end) { - sideY = bottom; - var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp]; - y -= offsetY - popperRect.height; - y *= gpuAcceleration ? 1 : -1; - } - if (placement === left || (placement === top || placement === bottom) && variation === end) { - sideX = right; - var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp]; - x -= offsetX - popperRect.width; - x *= gpuAcceleration ? 1 : -1; - } - } - var commonStyles = Object.assign({ - position - }, adaptive && unsetSides); - var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ - x, - y - }) : { - x, - y - }; - x = _ref4.x; - y = _ref4.y; - if (gpuAcceleration) { - var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); - } - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2)); -} -function computeStyles(_ref5) { - var state = _ref5.state, options = _ref5.options; - var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - if (true) { - var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ""; - if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) { - return transitionProperty.indexOf(property) >= 0; - })) { - console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" ")); - } - } - var commonStyles = { - placement: getBasePlacement(state.placement), - variation: getVariation(state.placement), - popper: state.elements.popper, - popperRect: state.rects.popper, - gpuAcceleration, - isFixed: state.options.strategy === "fixed" - }; - if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive, - roundOffsets - }))); - } - if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: "absolute", - adaptive: false, - roundOffsets - }))); - } - state.attributes.popper = Object.assign({}, state.attributes.popper, { - "data-popper-placement": state.placement - }); -} -var computeStyles_default = { - name: "computeStyles", - enabled: true, - phase: "beforeWrite", - fn: computeStyles, - data: {} -}; - -// node_modules/@popperjs/core/lib/modifiers/eventListeners.js -var passive = { - passive: true -}; -function effect3(_ref) { - var state = _ref.state, instance = _ref.instance, options = _ref.options; - var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; - var window2 = getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - if (scroll) { - scrollParents.forEach(function(scrollParent) { - scrollParent.addEventListener("scroll", instance.update, passive); - }); - } - if (resize) { - window2.addEventListener("resize", instance.update, passive); - } - return function() { - if (scroll) { - scrollParents.forEach(function(scrollParent) { - scrollParent.removeEventListener("scroll", instance.update, passive); - }); - } - if (resize) { - window2.removeEventListener("resize", instance.update, passive); - } - }; -} -var eventListeners_default = { - name: "eventListeners", - enabled: true, - phase: "write", - fn: function fn() { - }, - effect: effect3, - data: {} -}; - -// node_modules/@popperjs/core/lib/utils/getOppositePlacement.js -var hash = { - left: "right", - right: "left", - bottom: "top", - top: "bottom" -}; -function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, function(matched) { - return hash[matched]; - }); -} - -// node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js -var hash2 = { - start: "end", - end: "start" -}; -function getOppositeVariationPlacement(placement) { - return placement.replace(/start|end/g, function(matched) { - return hash2[matched]; - }); -} - -// node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js -function getWindowScroll(node) { - var win = getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft, - scrollTop - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js -function getWindowScrollBarX(element) { - return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; -} - -// node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js -function getViewportRect(element, strategy) { - var win = getWindow(element); - var html = getDocumentElement(element); - var visualViewport = win.visualViewport; - var width = html.clientWidth; - var height = html.clientHeight; - var x = 0; - var y = 0; - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; - var layoutViewport = isLayoutViewport(); - if (layoutViewport || !layoutViewport && strategy === "fixed") { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; - } - } - return { - width, - height, - x: x + getWindowScrollBarX(element), - y - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js -function getDocumentRect(element) { - var _element$ownerDocumen; - var html = getDocumentElement(element); - var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); - var x = -winScroll.scrollLeft + getWindowScrollBarX(element); - var y = -winScroll.scrollTop; - if (getComputedStyle(body || html).direction === "rtl") { - x += max(html.clientWidth, body ? body.clientWidth : 0) - width; - } - return { - width, - height, - x, - y - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js -function isScrollParent(element) { - var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; - return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); -} - -// node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js -function getScrollParent(node) { - if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { - return node.ownerDocument.body; - } - if (isHTMLElement(node) && isScrollParent(node)) { - return node; - } - return getScrollParent(getParentNode(node)); -} - -// node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js -function listScrollParents(element, list) { - var _element$ownerDocumen; - if (list === void 0) { - list = []; - } - var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); - var win = getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; - var updatedList = list.concat(target); - return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target))); -} - -// node_modules/@popperjs/core/lib/utils/rectToClientRect.js -function rectToClientRect(rect) { - return Object.assign({}, rect, { - left: rect.x, - top: rect.y, - right: rect.x + rect.width, - bottom: rect.y + rect.height - }); -} - -// node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js -function getInnerBoundingClientRect(element, strategy) { - var rect = getBoundingClientRect(element, false, strategy === "fixed"); - rect.top = rect.top + element.clientTop; - rect.left = rect.left + element.clientLeft; - rect.bottom = rect.top + element.clientHeight; - rect.right = rect.left + element.clientWidth; - rect.width = element.clientWidth; - rect.height = element.clientHeight; - rect.x = rect.left; - rect.y = rect.top; - return rect; -} -function getClientRectFromMixedType(element, clippingParent, strategy) { - return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); -} -function getClippingParents(element) { - var clippingParents2 = listScrollParents(getParentNode(element)); - var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0; - var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; - if (!isElement(clipperElement)) { - return []; - } - return clippingParents2.filter(function(clippingParent) { - return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; - }); -} -function getClippingRect(element, boundary, rootBoundary, strategy) { - var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary); - var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); - var firstClippingParent = clippingParents2[0]; - var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { - var rect = getClientRectFromMixedType(element, clippingParent, strategy); - accRect.top = max(rect.top, accRect.top); - accRect.right = min(rect.right, accRect.right); - accRect.bottom = min(rect.bottom, accRect.bottom); - accRect.left = max(rect.left, accRect.left); - return accRect; - }, getClientRectFromMixedType(element, firstClippingParent, strategy)); - clippingRect.width = clippingRect.right - clippingRect.left; - clippingRect.height = clippingRect.bottom - clippingRect.top; - clippingRect.x = clippingRect.left; - clippingRect.y = clippingRect.top; - return clippingRect; -} - -// node_modules/@popperjs/core/lib/utils/computeOffsets.js -function computeOffsets(_ref) { - var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement; - var basePlacement = placement ? getBasePlacement(placement) : null; - var variation = placement ? getVariation(placement) : null; - var commonX = reference2.x + reference2.width / 2 - element.width / 2; - var commonY = reference2.y + reference2.height / 2 - element.height / 2; - var offsets; - switch (basePlacement) { - case top: - offsets = { - x: commonX, - y: reference2.y - element.height - }; - break; - case bottom: - offsets = { - x: commonX, - y: reference2.y + reference2.height - }; - break; - case right: - offsets = { - x: reference2.x + reference2.width, - y: commonY - }; - break; - case left: - offsets = { - x: reference2.x - element.width, - y: commonY - }; - break; - default: - offsets = { - x: reference2.x, - y: reference2.y - }; - } - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - if (mainAxis != null) { - var len = mainAxis === "y" ? "height" : "width"; - switch (variation) { - case start: - offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2); - break; - case end: - offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2); - break; - default: - } - } - return offsets; -} - -// node_modules/@popperjs/core/lib/utils/detectOverflow.js -function detectOverflow(state, options) { - if (options === void 0) { - options = {}; - } - var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); - var altContext = elementContext === popper ? reference : popper; - var popperRect = state.rects.popper; - var element = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); - var referenceClientRect = getBoundingClientRect(state.elements.reference); - var popperOffsets2 = computeOffsets({ - reference: referenceClientRect, - element: popperRect, - strategy: "absolute", - placement - }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; - var overflowOffsets = { - top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right - }; - var offsetData = state.modifiersData.offset; - if (elementContext === popper && offsetData) { - var offset2 = offsetData[placement]; - Object.keys(overflowOffsets).forEach(function(key) { - var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; - overflowOffsets[key] += offset2[axis] * multiply; - }); - } - return overflowOffsets; -} - -// node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js -function computeAutoPlacement(state, options) { - if (options === void 0) { - options = {}; - } - var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; - var variation = getVariation(placement); - var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { - return getVariation(placement2) === variation; - }) : basePlacements; - var allowedPlacements = placements2.filter(function(placement2) { - return allowedAutoPlacements.indexOf(placement2) >= 0; - }); - if (allowedPlacements.length === 0) { - allowedPlacements = placements2; - if (true) { - console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" ")); - } - } - var overflows = allowedPlacements.reduce(function(acc, placement2) { - acc[placement2] = detectOverflow(state, { - placement: placement2, - boundary, - rootBoundary, - padding - })[getBasePlacement(placement2)]; - return acc; - }, {}); - return Object.keys(overflows).sort(function(a, b) { - return overflows[a] - overflows[b]; - }); -} - -// node_modules/@popperjs/core/lib/modifiers/flip.js -function getExpandedFallbackPlacements(placement) { - if (getBasePlacement(placement) === auto) { - return []; - } - var oppositePlacement = getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; -} -function flip(_ref) { - var state = _ref.state, options = _ref.options, name = _ref.name; - if (state.modifiersData[name]._skip) { - return; - } - var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; - var preferredPlacement = state.options.placement; - var basePlacement = getBasePlacement(preferredPlacement); - var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { - return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { - placement: placement2, - boundary, - rootBoundary, - padding, - flipVariations, - allowedAutoPlacements - }) : placement2); - }, []); - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var checksMap = /* @__PURE__ */ new Map(); - var makeFallbackChecks = true; - var firstFittingPlacement = placements2[0]; - for (var i = 0; i < placements2.length; i++) { - var placement = placements2[i]; - var _basePlacement = getBasePlacement(placement); - var isStartVariation = getVariation(placement) === start; - var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? "width" : "height"; - var overflow = detectOverflow(state, { - placement, - boundary, - rootBoundary, - altBoundary, - padding - }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; - if (referenceRect[len] > popperRect[len]) { - mainVariationSide = getOppositePlacement(mainVariationSide); - } - var altVariationSide = getOppositePlacement(mainVariationSide); - var checks = []; - if (checkMainAxis) { - checks.push(overflow[_basePlacement] <= 0); - } - if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); - } - if (checks.every(function(check) { - return check; - })) { - firstFittingPlacement = placement; - makeFallbackChecks = false; - break; - } - checksMap.set(placement, checks); - } - if (makeFallbackChecks) { - var numberOfChecks = flipVariations ? 3 : 1; - var _loop = function _loop2(_i2) { - var fittingPlacement = placements2.find(function(placement2) { - var checks2 = checksMap.get(placement2); - if (checks2) { - return checks2.slice(0, _i2).every(function(check) { - return check; - }); - } - }); - if (fittingPlacement) { - firstFittingPlacement = fittingPlacement; - return "break"; - } - }; - for (var _i = numberOfChecks; _i > 0; _i--) { - var _ret = _loop(_i); - if (_ret === "break") - break; - } - } - if (state.placement !== firstFittingPlacement) { - state.modifiersData[name]._skip = true; - state.placement = firstFittingPlacement; - state.reset = true; - } -} -var flip_default = { - name: "flip", - enabled: true, - phase: "main", - fn: flip, - requiresIfExists: ["offset"], - data: { - _skip: false - } -}; - -// node_modules/@popperjs/core/lib/modifiers/hide.js -function getSideOffsets(overflow, rect, preventedOffsets) { - if (preventedOffsets === void 0) { - preventedOffsets = { - x: 0, - y: 0 - }; - } - return { - top: overflow.top - rect.height - preventedOffsets.y, - right: overflow.right - rect.width + preventedOffsets.x, - bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x - }; -} -function isAnySideFullyClipped(overflow) { - return [top, right, bottom, left].some(function(side) { - return overflow[side] >= 0; - }); -} -function hide(_ref) { - var state = _ref.state, name = _ref.name; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var preventedOffsets = state.modifiersData.preventOverflow; - var referenceOverflow = detectOverflow(state, { - elementContext: "reference" - }); - var popperAltOverflow = detectOverflow(state, { - altBoundary: true - }); - var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); - var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); - var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); - state.modifiersData[name] = { - referenceClippingOffsets, - popperEscapeOffsets, - isReferenceHidden, - hasPopperEscaped - }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { - "data-popper-reference-hidden": isReferenceHidden, - "data-popper-escaped": hasPopperEscaped - }); -} -var hide_default = { - name: "hide", - enabled: true, - phase: "main", - requiresIfExists: ["preventOverflow"], - fn: hide -}; - -// node_modules/@popperjs/core/lib/modifiers/offset.js -function distanceAndSkiddingToXY(placement, rects, offset2) { - var basePlacement = getBasePlacement(placement); - var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; - var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { - placement - })) : offset2, skidding = _ref[0], distance = _ref[1]; - skidding = skidding || 0; - distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance - }; -} -function offset(_ref2) { - var state = _ref2.state, options = _ref2.options, name = _ref2.name; - var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; - var data = placements.reduce(function(acc, placement) { - acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); - return acc; - }, {}); - var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y; - if (state.modifiersData.popperOffsets != null) { - state.modifiersData.popperOffsets.x += x; - state.modifiersData.popperOffsets.y += y; - } - state.modifiersData[name] = data; -} -var offset_default = { - name: "offset", - enabled: true, - phase: "main", - requires: ["popperOffsets"], - fn: offset -}; - -// node_modules/@popperjs/core/lib/modifiers/popperOffsets.js -function popperOffsets(_ref) { - var state = _ref.state, name = _ref.name; - state.modifiersData[name] = computeOffsets({ - reference: state.rects.reference, - element: state.rects.popper, - strategy: "absolute", - placement: state.placement - }); -} -var popperOffsets_default = { - name: "popperOffsets", - enabled: true, - phase: "read", - fn: popperOffsets, - data: {} -}; - -// node_modules/@popperjs/core/lib/utils/getAltAxis.js -function getAltAxis(axis) { - return axis === "x" ? "y" : "x"; -} - -// node_modules/@popperjs/core/lib/modifiers/preventOverflow.js -function preventOverflow(_ref) { - var state = _ref.state, options = _ref.options, name = _ref.name; - var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; - var overflow = detectOverflow(state, { - boundary, - rootBoundary, - padding, - altBoundary - }); - var basePlacement = getBasePlacement(state.placement); - var variation = getVariation(state.placement); - var isBasePlacement = !variation; - var mainAxis = getMainAxisFromPlacement(basePlacement); - var altAxis = getAltAxis(mainAxis); - var popperOffsets2 = state.modifiersData.popperOffsets; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; - var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { - mainAxis: tetherOffsetValue, - altAxis: tetherOffsetValue - } : Object.assign({ - mainAxis: 0, - altAxis: 0 - }, tetherOffsetValue); - var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; - var data = { - x: 0, - y: 0 - }; - if (!popperOffsets2) { - return; - } - if (checkMainAxis) { - var _offsetModifierState$; - var mainSide = mainAxis === "y" ? top : left; - var altSide = mainAxis === "y" ? bottom : right; - var len = mainAxis === "y" ? "height" : "width"; - var offset2 = popperOffsets2[mainAxis]; - var min2 = offset2 + overflow[mainSide]; - var max2 = offset2 - overflow[altSide]; - var additive = tether ? -popperRect[len] / 2 : 0; - var minLen = variation === start ? referenceRect[len] : popperRect[len]; - var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; - var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 - }; - var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); - var arrowPaddingMin = arrowPaddingObject[mainSide]; - var arrowPaddingMax = arrowPaddingObject[altSide]; - var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; - var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; - var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; - var tetherMax = offset2 + maxOffset - offsetModifierValue; - var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2); - popperOffsets2[mainAxis] = preventedOffset; - data[mainAxis] = preventedOffset - offset2; - } - if (checkAltAxis) { - var _offsetModifierState$2; - var _mainSide = mainAxis === "x" ? top : left; - var _altSide = mainAxis === "x" ? bottom : right; - var _offset = popperOffsets2[altAxis]; - var _len = altAxis === "y" ? "height" : "width"; - var _min = _offset + overflow[_mainSide]; - var _max = _offset - overflow[_altSide]; - var isOriginSide = [top, left].indexOf(basePlacement) !== -1; - var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; - var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; - var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; - var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); - popperOffsets2[altAxis] = _preventedOffset; - data[altAxis] = _preventedOffset - _offset; - } - state.modifiersData[name] = data; -} -var preventOverflow_default = { - name: "preventOverflow", - enabled: true, - phase: "main", - fn: preventOverflow, - requiresIfExists: ["offset"] -}; - -// node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js -function getHTMLElementScroll(element) { - return { - scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js -function getNodeScroll(node) { - if (node === getWindow(node) || !isHTMLElement(node)) { - return getWindowScroll(node); - } else { - return getHTMLElementScroll(node); - } -} - -// node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js -function isElementScaled(element) { - var rect = element.getBoundingClientRect(); - var scaleX = round(rect.width) / element.offsetWidth || 1; - var scaleY = round(rect.height) / element.offsetHeight || 1; - return scaleX !== 1 || scaleY !== 1; -} -function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { - if (isFixed === void 0) { - isFixed = false; - } - var isOffsetParentAnElement = isHTMLElement(offsetParent); - var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); - var documentElement = getDocumentElement(offsetParent); - var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); - var scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - var offsets = { - x: 0, - y: 0 - }; - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) { - scroll = getNodeScroll(offsetParent); - } - if (isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect(offsetParent, true); - offsets.x += offsetParent.clientLeft; - offsets.y += offsetParent.clientTop; - } else if (documentElement) { - offsets.x = getWindowScrollBarX(documentElement); - } - } - return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, - width: rect.width, - height: rect.height - }; -} - -// node_modules/@popperjs/core/lib/utils/orderModifiers.js -function order(modifiers) { - var map = /* @__PURE__ */ new Map(); - var visited = /* @__PURE__ */ new Set(); - var result = []; - modifiers.forEach(function(modifier) { - map.set(modifier.name, modifier); - }); - function sort(modifier) { - visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); - requires.forEach(function(dep) { - if (!visited.has(dep)) { - var depModifier = map.get(dep); - if (depModifier) { - sort(depModifier); - } - } - }); - result.push(modifier); - } - modifiers.forEach(function(modifier) { - if (!visited.has(modifier.name)) { - sort(modifier); - } - }); - return result; -} -function orderModifiers(modifiers) { - var orderedModifiers = order(modifiers); - return modifierPhases.reduce(function(acc, phase) { - return acc.concat(orderedModifiers.filter(function(modifier) { - return modifier.phase === phase; - })); - }, []); -} - -// node_modules/@popperjs/core/lib/utils/debounce.js -function debounce(fn2) { - var pending; - return function() { - if (!pending) { - pending = new Promise(function(resolve) { - Promise.resolve().then(function() { - pending = void 0; - resolve(fn2()); - }); - }); - } - return pending; - }; -} - -// node_modules/@popperjs/core/lib/utils/format.js -function format(str) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - return [].concat(args).reduce(function(p, c) { - return p.replace(/%s/, c); - }, str); -} - -// node_modules/@popperjs/core/lib/utils/validateModifiers.js -var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; -var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; -var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"]; -function validateModifiers(modifiers) { - modifiers.forEach(function(modifier) { - [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self2) { - return self2.indexOf(value) === index; - }).forEach(function(key) { - switch (key) { - case "name": - if (typeof modifier.name !== "string") { - console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"')); - } - break; - case "enabled": - if (typeof modifier.enabled !== "boolean") { - console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"')); - } - break; - case "phase": - if (modifierPhases.indexOf(modifier.phase) < 0) { - console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"')); - } - break; - case "fn": - if (typeof modifier.fn !== "function") { - console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"')); - } - break; - case "effect": - if (modifier.effect != null && typeof modifier.effect !== "function") { - console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"')); - } - break; - case "requires": - if (modifier.requires != null && !Array.isArray(modifier.requires)) { - console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"')); - } - break; - case "requiresIfExists": - if (!Array.isArray(modifier.requiresIfExists)) { - console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"')); - } - break; - case "options": - case "data": - break; - default: - console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) { - return '"' + s + '"'; - }).join(", ") + '; but "' + key + '" was provided.'); - } - modifier.requires && modifier.requires.forEach(function(requirement) { - if (modifiers.find(function(mod) { - return mod.name === requirement; - }) == null) { - console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); - } - }); - }); - }); -} - -// node_modules/@popperjs/core/lib/utils/uniqueBy.js -function uniqueBy(arr, fn2) { - var identifiers = /* @__PURE__ */ new Set(); - return arr.filter(function(item) { - var identifier = fn2(item); - if (!identifiers.has(identifier)) { - identifiers.add(identifier); - return true; - } - }); -} - -// node_modules/@popperjs/core/lib/utils/mergeByName.js -function mergeByName(modifiers) { - var merged = modifiers.reduce(function(merged2, current) { - var existing = merged2[current.name]; - merged2[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; - return merged2; - }, {}); - return Object.keys(merged).map(function(key) { - return merged[key]; - }); -} - -// node_modules/@popperjs/core/lib/createPopper.js -var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element."; -var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash."; -var DEFAULT_OPTIONS = { - placement: "bottom", - modifiers: [], - strategy: "absolute" -}; -function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return !args.some(function(element) { - return !(element && typeof element.getBoundingClientRect === "function"); - }); -} -function popperGenerator(generatorOptions) { - if (generatorOptions === void 0) { - generatorOptions = {}; - } - var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; - return function createPopper2(reference2, popper2, options) { - if (options === void 0) { - options = defaultOptions; - } - var state = { - placement: "bottom", - orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), - modifiersData: {}, - elements: { - reference: reference2, - popper: popper2 - }, - attributes: {}, - styles: {} - }; - var effectCleanupFns = []; - var isDestroyed = false; - var instance = { - state, - setOptions: function setOptions(setOptionsAction) { - var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; - cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options2); - state.scrollParents = { - reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], - popper: listScrollParents(popper2) - }; - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); - state.orderedModifiers = orderedModifiers.filter(function(m) { - return m.enabled; - }); - if (true) { - var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) { - var name = _ref.name; - return name; - }); - validateModifiers(modifiers); - if (getBasePlacement(state.options.placement) === auto) { - var flipModifier = state.orderedModifiers.find(function(_ref2) { - var name = _ref2.name; - return name === "flip"; - }); - if (!flipModifier) { - console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" ")); - } - } - var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft; - if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) { - return parseFloat(margin); - })) { - console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" ")); - } - } - runModifierEffects(); - return instance.update(); - }, - forceUpdate: function forceUpdate() { - if (isDestroyed) { - return; - } - var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; - if (!areValidElements(reference3, popper3)) { - if (true) { - console.error(INVALID_ELEMENT_ERROR); - } - return; - } - state.rects = { - reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), - popper: getLayoutRect(popper3) - }; - state.reset = false; - state.placement = state.options.placement; - state.orderedModifiers.forEach(function(modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); - }); - var __debug_loops__ = 0; - for (var index = 0; index < state.orderedModifiers.length; index++) { - if (true) { - __debug_loops__ += 1; - if (__debug_loops__ > 100) { - console.error(INFINITE_LOOP_ERROR); - break; - } - } - if (state.reset === true) { - state.reset = false; - index = -1; - continue; - } - var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; - if (typeof fn2 === "function") { - state = fn2({ - state, - options: _options, - name, - instance - }) || state; - } - } - }, - update: debounce(function() { - return new Promise(function(resolve) { - instance.forceUpdate(); - resolve(state); - }); - }), - destroy: function destroy() { - cleanupModifierEffects(); - isDestroyed = true; - } - }; - if (!areValidElements(reference2, popper2)) { - if (true) { - console.error(INVALID_ELEMENT_ERROR); - } - return instance; - } - instance.setOptions(options).then(function(state2) { - if (!isDestroyed && options.onFirstUpdate) { - options.onFirstUpdate(state2); - } - }); - function runModifierEffects() { - state.orderedModifiers.forEach(function(_ref3) { - var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect4 = _ref3.effect; - if (typeof effect4 === "function") { - var cleanupFn = effect4({ - state, - name, - instance, - options: options2 - }); - var noopFn = function noopFn2() { - }; - effectCleanupFns.push(cleanupFn || noopFn); - } - }); - } - function cleanupModifierEffects() { - effectCleanupFns.forEach(function(fn2) { - return fn2(); - }); - effectCleanupFns = []; - } - return instance; - }; -} - -// node_modules/@popperjs/core/lib/popper.js -var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default]; -var createPopper = /* @__PURE__ */ popperGenerator({ - defaultModifiers -}); - -// src/suggestions/suggest.ts -var wrapAround = (value, size) => { - return (value % size + size) % size; -}; -var Suggest = class { - constructor(owner, containerEl, scope) { - this.owner = owner; - this.containerEl = containerEl; - containerEl.on( - "click", - ".suggestion-item", - this.onSuggestionClick.bind(this) - ); - containerEl.on( - "mousemove", - ".suggestion-item", - this.onSuggestionMouseover.bind(this) - ); - scope.register([], "ArrowUp", (event) => { - if (!event.isComposing) { - this.setSelectedItem(this.selectedItem - 1, true); - return false; - } - }); - scope.register([], "ArrowDown", (event) => { - if (!event.isComposing) { - this.setSelectedItem(this.selectedItem + 1, true); - return false; - } - }); - scope.register([], "Enter", (event) => { - if (!event.isComposing) { - this.useSelectedItem(event); - return false; - } - }); - } - onSuggestionClick(event, el) { - event.preventDefault(); - const item = this.suggestions.indexOf(el); - this.setSelectedItem(item, false); - this.useSelectedItem(event); - } - onSuggestionMouseover(_event, el) { - const item = this.suggestions.indexOf(el); - this.setSelectedItem(item, false); - } - setSuggestions(values) { - this.containerEl.empty(); - const suggestionEls = []; - values.forEach((value) => { - const suggestionEl = this.containerEl.createDiv("suggestion-item"); - this.owner.renderSuggestion(value, suggestionEl); - suggestionEls.push(suggestionEl); - }); - this.values = values; - this.suggestions = suggestionEls; - this.setSelectedItem(0, false); - } - useSelectedItem(event) { - const currentValue = this.values[this.selectedItem]; - if (currentValue) { - this.owner.selectSuggestion(currentValue, event); - } - } - setSelectedItem(selectedIndex, scrollIntoView) { - const normalizedIndex = wrapAround(selectedIndex, this.suggestions.length); - const prevSelectedSuggestion = this.suggestions[this.selectedItem]; - const selectedSuggestion = this.suggestions[normalizedIndex]; - prevSelectedSuggestion == null ? void 0 : prevSelectedSuggestion.removeClass("is-selected"); - selectedSuggestion == null ? void 0 : selectedSuggestion.addClass("is-selected"); - this.selectedItem = normalizedIndex; - if (scrollIntoView) { - selectedSuggestion.scrollIntoView(false); - } - } -}; -var TextInputSuggest = class { - constructor(app, inputEl, plugin) { - this.plugin = plugin; - this.app = app; - this.inputEl = inputEl; - this.scope = new import_obsidian.Scope(); - this.suggestEl = createDiv("suggestion-container"); - const suggestion = this.suggestEl.createDiv("suggestion"); - this.suggest = new Suggest(this, suggestion, this.scope); - this.scope.register([], "Escape", this.close.bind(this)); - this.inputEl.addEventListener("input", this.onInputChanged.bind(this)); - this.inputEl.addEventListener("focus", this.onInputChanged.bind(this)); - this.inputEl.addEventListener("blur", this.close.bind(this)); - this.suggestEl.on( - "mousedown", - ".suggestion-container", - (event) => { - event.preventDefault(); - } - ); - } - onInputChanged() { - const inputStr = this.inputEl.value; - const suggestions = this.getSuggestions(inputStr); - if (!suggestions) { - this.close(); - return; - } - if (suggestions.length > 0) { - this.suggest.setSuggestions(suggestions); - this.open(this.app.dom.appContainerEl, this.inputEl); - } else { - this.close(); - } - } - open(container, inputEl) { - this.app.keymap.pushScope(this.scope); - container.appendChild(this.suggestEl); - this.popper = createPopper(inputEl, this.suggestEl, { - placement: "bottom-start", - modifiers: [ - { - name: "sameWidth", - enabled: true, - fn: ({ state, instance }) => { - const targetWidth = `${state.rects.reference.width}px`; - if (state.styles.popper.width === targetWidth) { - return; - } - state.styles.popper.width = targetWidth; - instance.update(); - }, - phase: "beforeWrite", - requires: ["computeStyles"] - } - ] - }); - } - close() { - this.app.keymap.popScope(this.scope); - this.suggest.setSuggestions([]); - if (this.popper) - this.popper.destroy(); - this.suggestEl.detach(); - } -}; - -// src/suggestions/folderSuggest.ts -var FolderSuggest = class extends TextInputSuggest { - getSuggestions(inputStr) { - const abstractFiles = this.app.vault.getAllLoadedFiles(); - const folders = []; - const lowerCaseInputStr = inputStr.toLowerCase(); - abstractFiles.forEach((folder) => { - if (folder instanceof import_obsidian2.TFolder && folder.path.toLowerCase().contains(lowerCaseInputStr)) { - folders.push(folder); - } - }); - return folders; - } - renderSuggestion(file, el) { - el.setText(file.path); - } - selectSuggestion(file) { - this.inputEl.value = file.path; - this.inputEl.trigger("input"); - this.close(); - } -}; - -// src/components/DonateButton.ts -var renderDonateButton = (containerEl) => { - containerEl.createEl("h2", { text: "Support development" }); - const donateText = containerEl.createEl("p"); - donateText.appendChild( - createEl("span", { - text: "If you enjoy Bulk Rename, consider " - }) - ); - donateText.appendChild( - createEl("a", { - text: "buying me a coffee", - href: "https://www.buymeacoffee.com/oleglustenko" - }) - ); - donateText.appendChild( - createEl("span", { - text: ", and following me on Twitter " - }) - ); - donateText.appendChild( - createEl("a", { - text: "@oleglustenko", - href: "https://twitter.com/oleglustenko" - }) - ); - const div = containerEl.createEl("div", { - cls: "bulkrename-donation" - }); - const parser = new DOMParser(); - div.appendChild( - createDonateButton( - "https://www.buymeacoffee.com/oleglustenko", - parser.parseFromString(buyMeACoffee, "text/xml").documentElement - ) - ); -}; -var createDonateButton = (link, img) => { - const a = document.createElement("a"); - a.setAttribute("href", link); - a.addClass("bulkrename-donate-button"); - a.appendChild(img); - return a; -}; -var buyMeACoffee = ` - - - - - - - - - - - - - - - - - - - - - -`; - -// src/services/file.service.ts -var import_obsidian3 = require("obsidian"); -var import_xregexp = __toESM(require_lib()); - -// src/services/settings.service.ts -var isViewTypeFolder = (settings) => { - return settings.viewType === "folder"; -}; -var isViewTypeTags = (settings) => { - return settings.viewType === "tags"; -}; -var isViewTypeRegExp = (settings) => { - return settings.viewType === "regexp"; -}; - -// src/constants/folders.ts -var ROOT_FOLDER_NAME = "/"; - -// src/services/file.service.ts -var getFilesNamesInDirectory = (plugin) => { - return getFilesAsString(plugin.settings); -}; -var getFilesAsString = (settings) => { - let value = ""; - const { fileNames, folderName } = settings; - const shouldPrependSlash = isViewTypeFolder(settings) && folderName === ROOT_FOLDER_NAME; - fileNames.forEach((fileName, index) => { - const isLast = index + 1 === fileNames.length; - const filePath = shouldPrependSlash ? "/" + fileName.path : fileName.path; - if (isLast) { - return value += filePath; - } - value += filePath + "\r\n"; - }); - return value; -}; -var getRenderedFileNamesReplaced = (plugin) => { - const newFiles = selectFilenamesWithReplacedPath(plugin); - return getFilesAsString({ - ...plugin.settings, - fileNames: newFiles - }); -}; -var selectFilenamesWithReplacedPath = (plugin) => { - const { fileNames } = plugin.settings; - return fileNames.map((file) => { - return { - ...file, - path: replaceFilePath(plugin, file) - }; - }); -}; -var replaceFilePath = (plugin, file) => { - const pathWithoutExtension = file.path.split(".").slice(0, -1).join("."); - const { replacePattern, existingSymbol, regExpState } = plugin.settings; - if (isRootFilesSelected(plugin)) { - const newPath2 = replacePattern + pathWithoutExtension; - return `${newPath2}.${file.extension}`; - } - let regExpExistingSymbol = existingSymbol; - if (regExpState.withRegExpForReplaceSymbols) { - regExpExistingSymbol = (0, import_xregexp.default)(existingSymbol, "x"); - } - const newPath = import_xregexp.default.replace( - pathWithoutExtension, - regExpExistingSymbol, - replacePattern, - "all" - ); - return `${newPath}.${file.extension}`; -}; -var renameFilesInObsidian = async (app, plugin) => { - const { existingSymbol, fileNames } = plugin.settings; - if (!existingSymbol) { - new import_obsidian3.Notice("please fill Existing Symbol"); - return; - } - if (!fileNames.length) { - new import_obsidian3.Notice("Please check your results before rename!"); - return; - } - new import_obsidian3.Notice("renaming has been started"); - let success = true; - for (const fileName of fileNames) { - try { - await app.fileManager.renameFile( - fileName, - replaceFilePath(plugin, fileName) - ); - } catch (e) { - if (e.code === "ENOENT") { - new import_obsidian3.Notice("FILES NOT RENAMED!"); - new import_obsidian3.Notice( - "WARNING: YOU MUST CREATE FOLDER BEFORE MOVING INTO IT", - 7e3 - ); - success = false; - break; - } - } - } - success && new import_obsidian3.Notice("successfully renamed all files"); -}; -var isRootFilesSelected = (plugin) => { - const { existingSymbol, folderName } = plugin.settings; - return existingSymbol === ROOT_FOLDER_NAME && folderName === ROOT_FOLDER_NAME && isViewTypeFolder(plugin.settings); -}; - -// src/components/PreviewElement.ts -var createPreviewElement = (textContent = "=> => => =>") => { - const previewLabel = window.document.createElement("span"); - previewLabel.className = "bulk_preview_label"; - previewLabel.textContent = textContent; - return previewLabel; -}; - -// src/services/obsidian.service.ts -var import_obsidian4 = require("obsidian"); -var import_xregexp2 = __toESM(require_lib()); -var getObsidianFilesByFolderName = (app, plugin) => { - const { folderName } = plugin.settings; - const abstractFiles = app.vault.getAllLoadedFiles(); - const files = abstractFiles.filter( - (file) => file instanceof import_obsidian4.TFile && file.parent.path.includes(folderName) - ); - const filesSortedByName = sortFilesByName(files); - return filesSortedByName; -}; -var getObsidianFilesByRegExp = (app, plugin) => { - const { regExpState } = plugin.settings; - const regExp = (0, import_xregexp2.default)(regExpState.regExp, regExpState.flags.join("")); - const abstractFiles = app.vault.getAllLoadedFiles(); - const matchedFileNames = abstractFiles.filter((file) => { - if (file instanceof import_obsidian4.TFile && import_xregexp2.default.exec(file.path, regExp)) { - return true; - } - }); - const filesSortedByName = sortFilesByName(matchedFileNames); - return filesSortedByName; -}; -var getObsidianFilesWithTagName = (app, plugin) => { - const { tags } = plugin.settings; - const abstractFiles = app.vault.getAllLoadedFiles(); - const files = abstractFiles.filter((file) => { - if (!(file instanceof import_obsidian4.TFile)) { - return; - } - const fileMetadata = app.metadataCache.getFileCache(file); - if (!fileMetadata || !fileMetadata.tags) { - return; - } - const hasTagsInTheFile = fileMetadata.tags.find((fileTags) => { - return tags.includes(fileTags.tag); - }); - if (!hasTagsInTheFile) { - return; - } - return file; - }); - const filesSortedByName = sortFilesByName(files); - return filesSortedByName; -}; -var sortFilesByName = (files) => { - return files.sort((a, b) => a.name.localeCompare(b.name)); -}; - -// src/components/RenderPreviewFiles.ts -var renderPreviewFiles = (setting, plugin, state) => { - let existingFilesTextArea; - let replacedPreviewTextArea; - return setting.clear().addTextArea((text) => { - text.setPlaceholder("Here you will see files under folder location"); - text.setDisabled(true); - existingFilesTextArea = text.inputEl; - const value = getFilesNamesInDirectory(plugin); - text.setValue(value); - const previewLabel = createPreviewElement(); - text.inputEl.insertAdjacentElement("afterend", previewLabel); - text.inputEl.addClass("bulk_preview_textarea"); - text.inputEl.wrap = "soft"; - }).addTextArea((text) => { - text.setPlaceholder( - "How filenames will looks like after replacement(click preview first)" - ); - text.setDisabled(true); - replacedPreviewTextArea = text.inputEl; - const value = getRenderedFileNamesReplaced(plugin); - text.setValue(value); - text.inputEl.addClass("bulk_preview_textarea"); - text.inputEl.wrap = "soft"; - }).then((setting2) => { - syncScrolls(existingFilesTextArea, replacedPreviewTextArea, state); - }); -}; -var syncScrolls = (existingFilesArea, previewArea, state) => { - existingFilesArea.addEventListener("scroll", (event) => { - const target = event.target; - if (target.scrollTop !== state.previewScroll) { - previewArea.scrollTop = target.scrollTop; - state.previewScroll = target.scrollTop; - } - }); - previewArea.addEventListener("scroll", (event) => { - const target = event.target; - if (target.scrollTop !== state.filesScroll) { - existingFilesArea.scrollTop = target.scrollTop; - state.filesScroll = target.scrollTop; - } - }); -}; - -// src/components/RegExpBackslash.ts -var createBackslash = (textContent = "/") => { - const previewLabel = window.document.createElement("div"); - previewLabel.className = "bulk_regexp_slash"; - previewLabel.textContent = textContent; - return previewLabel; -}; - -// src/constants/RegExpFlags.ts -var REGEXP_FLAGS = [ - "g", - "i", - "m", - "u", - "y", - "n", - "s", - "x", - "A" -]; - -// src/suggestions/RegExpFlagsSuggest.ts -var RegExpFlagsSuggest = class extends TextInputSuggest { - constructor() { - super(...arguments); - this.renderSuggestion = (flag, el) => { - const { regExpState } = this.plugin.settings; - const hasFlag = regExpState.flags.includes(flag); - if (hasFlag) { - el.addClass("bulk-flag-selected"); - } else { - el.removeClass("bulk-flag-selected"); - } - el.setText(flag); - }; - this.selectSuggestion = (flag, event) => { - const { regExpState } = this.plugin.settings; - const target = event.target; - const hasFlag = regExpState.flags.includes(flag); - if (hasFlag) { - regExpState.flags = regExpState.flags.filter((existingFlag) => { - return existingFlag !== flag; - }); - } else { - regExpState.flags = [...regExpState.flags, flag]; - } - target.classList.toggle("bulk-flag-selected"); - this.inputEl.value = regExpState.flags.join(""); - this.inputEl.trigger("input"); - }; - } - getSuggestions() { - return REGEXP_FLAGS; - } -}; - -// main.ts -var DEFAULT_SETTINGS = { - folderName: "", - fileNames: [], - existingSymbol: "", - replacePattern: "", - regExpState: { - regExp: "", - flags: [], - withRegExpForReplaceSymbols: false - }, - tags: [], - viewType: "folder" -}; -var BulkRenamePlugin = class extends import_obsidian5.Plugin { - async onload() { - await this.loadSettings(); - this.addSettingTab(new BulkRenameSettingsTab(this.app, this)); - } - onunload() { - } - async loadSettings() { - this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); - } - async saveSettings() { - await this.saveData(this.settings); - } -}; -var BulkRenameSettingsTab = class extends import_obsidian5.PluginSettingTab { - constructor(app, plugin) { - super(app, plugin); - this.renderFilesAndPreview = () => { - this.containerEl.createEl("h2", { text: "Preview" }, (el) => { - el.className = "bulk_preview_header"; - }); - this.filesAndPreview = new import_obsidian5.Setting(this.containerEl); - this.totalFiles = this.containerEl.createEl("span", { - text: `Total Files: ${this.plugin.settings.fileNames.length}` - }); - this.filesAndPreview.infoEl.detach(); - this.filesAndPreview.controlEl.addClass("bulk_rename_preview"); - this.reRenderPreview(); - }; - this.reRenderPreview = () => { - this.calculateFileNames(); - renderPreviewFiles(this.filesAndPreview, this.plugin, this.state); - this.totalFiles.setText( - `Total Files: ${this.plugin.settings.fileNames.length}` - ); - }; - this.state = { - previewScroll: 0, - filesScroll: 0 - }; - this.plugin = plugin; - } - display() { - const { containerEl } = this; - containerEl.empty(); - containerEl.createEl("h1", { text: "Bulk Rename - Settings" }); - containerEl.addEventListener("keyup", (event) => { - if (event.key !== "Enter") { - return; - } - this.reRenderPreview(); - }); - this.containerEl.addClass("bulk_rename_plugin"); - this.renderTabs(); - this.renderFileLocation(); - this.renderTagNames(); - this.renderRegExpInput(); - this.renderReplaceSymbol(); - this.renderFilesAndPreview(); - this.renderRenameFiles(); - this.renderSupportDevelopment(); - } - renderTabs() { - new import_obsidian5.Setting(this.containerEl).setName("Search by: ").addButton((button) => { - button.setButtonText("Folder"); - if (isViewTypeFolder(this.plugin.settings)) { - button.setCta(); - } - button.onClick(async () => { - this.plugin.settings.viewType = "folder"; - await this.plugin.saveSettings(); - this.display(); - }); - }).addButton((button) => { - button.setButtonText("Tags"); - if (isViewTypeTags(this.plugin.settings)) { - button.setCta(); - } - button.onClick(async () => { - this.plugin.settings.viewType = "tags"; - await this.plugin.saveSettings(); - this.display(); - }); - }).addButton((button) => { - button.setButtonText("RegExp"); - if (isViewTypeRegExp(this.plugin.settings)) { - button.setCta(); - } - button.onClick(async () => { - this.plugin.settings.viewType = "regexp"; - await this.plugin.saveSettings(); - this.display(); - }); - }); - } - renderFileLocation() { - if (!isViewTypeFolder(this.plugin.settings)) { - return; - } - new import_obsidian5.Setting(this.containerEl).setName("Folder location").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl, this.plugin); - cb.setPlaceholder("Example: folder1/").setValue(this.plugin.settings.folderName).onChange((newFolder) => { - this.plugin.settings.folderName = newFolder; - this.plugin.saveSettings(); - this.getFilesByFolder(); - }); - cb.containerEl.addClass("bulk_rename"); - cb.inputEl.addClass("bulk_input"); - cb.inputEl.onblur = this.reRenderPreview; - }); - } - renderTagNames() { - if (!isViewTypeTags(this.plugin.settings)) { - return; - } - new import_obsidian5.Setting(this.containerEl).setName("Tag names ").addSearch((cb) => { - cb.inputEl.addEventListener("keydown", (event) => { - if (event.key !== "Enter") { - return; - } - const target = event.target; - this.plugin.settings.tags = target.value.replace(/ /g, "").split(","); - this.plugin.saveSettings(); - }); - cb.setPlaceholder("Example: #tag, #tag2").setValue(this.plugin.settings.tags.join(",")).onChange((newFolder) => { - this.plugin.settings.tags = newFolder.replace(/ /g, "").split(","); - this.plugin.saveSettings(); - this.getFilesByTags(); - }); - cb.containerEl.addClass("bulk_rename"); - cb.inputEl.addClass("bulk_input"); - cb.inputEl.onblur = this.reRenderPreview; - }); - } - renderRegExpInput() { - if (!isViewTypeRegExp(this.plugin.settings)) { - return; - } - const settings = new import_obsidian5.Setting(this.containerEl); - settings.infoEl.addClass("bulk_regexp_search"); - settings.setClass("bulk_regexp_container"); - settings.setName("RegExp Search").addText((cb) => { - const backslash = createBackslash("/"); - cb.inputEl.insertAdjacentElement("beforebegin", backslash); - cb.inputEl.addEventListener("keydown", (event) => { - if (event.key !== "Enter") { - return; - } - const target = event.target; - this.plugin.settings.regExpState.regExp = target.value; - this.plugin.saveSettings(); - }); - cb.setPlaceholder("Put your RegExp here").setValue(this.plugin.settings.regExpState.regExp).onChange((newFolder) => { - this.plugin.settings.regExpState.regExp = newFolder; - this.plugin.saveSettings(); - this.getFilesByRegExp(); - }); - cb.inputEl.addClass("bulk_regexp"); - cb.inputEl.onblur = this.reRenderPreview; - }).addText((cb) => { - new RegExpFlagsSuggest(this.app, cb.inputEl, this.plugin); - const backslash = createBackslash("/"); - cb.inputEl.insertAdjacentElement("beforebegin", backslash); - cb.inputEl.addEventListener("keydown", (event) => { - event.stopPropagation(); - event.stopImmediatePropagation(); - event.preventDefault(); - }); - cb.setPlaceholder("flags here").setValue(this.plugin.settings.regExpState.flags.join("")).onChange((flag) => { - this.plugin.saveSettings(); - this.getFilesByRegExp(); - this.reRenderPreview(); - }); - cb.inputEl.addClass("bulk_regexp_flags"); - }).controlEl.addClass("bulk_regexp_control"); - } - renderUseRegExpForExistingAndReplacement() { - if (!isViewTypeRegExp(this.plugin.settings)) { - return; - } - const newSettings = new import_obsidian5.Setting(this.containerEl); - newSettings.setClass("bulk_toggle"); - newSettings.setName("Use RegExp For Existing & Replacement?").setDesc( - "Only RegExp will work now, however it doesn't prevent you to pass string" - ).addToggle((toggle) => { - toggle.setValue( - this.plugin.settings.regExpState.withRegExpForReplaceSymbols - ).setTooltip("Use RegExp For Existing & Replacement?").onChange((isRegExpForNames) => { - this.plugin.settings.regExpState.withRegExpForReplaceSymbols = isRegExpForNames; - this.reRenderPreview(); - this.plugin.saveSettings(); - }); - }); - } - renderReplaceSymbol() { - const { settings } = this.plugin; - this.renderUseRegExpForExistingAndReplacement(); - const newSettings = new import_obsidian5.Setting(this.containerEl); - if (import_obsidian5.Platform.isDesktop) { - const previewLabel = createPreviewElement("Existing"); - const replacementLabel = createPreviewElement("Replacement"); - newSettings.infoEl.replaceChildren(previewLabel, replacementLabel); - newSettings.setClass("flex"); - newSettings.setClass("flex-col"); - newSettings.infoEl.addClass("bulk_info"); - } - newSettings.controlEl.addClass("replaceRenderSymbols"); - newSettings.addTextArea((textComponent) => { - textComponent.setValue(settings.existingSymbol); - textComponent.setPlaceholder("existing chars"); - textComponent.onChange((newValue) => { - settings.existingSymbol = newValue; - this.plugin.saveSettings(); - }); - textComponent.inputEl.addClass("bulk_input"); - textComponent.inputEl.onblur = this.reRenderPreview; - }); - newSettings.addTextArea((textComponent) => { - textComponent.setValue(settings.replacePattern); - textComponent.setPlaceholder("replace with"); - textComponent.onChange((newValue) => { - settings.replacePattern = newValue; - this.plugin.saveSettings(); - this.getFilesByFolder(); - }); - textComponent.inputEl.addClass("bulk_input"); - textComponent.inputEl.onblur = this.reRenderPreview; - }); - } - renderRenameFiles() { - const desc = document.createDocumentFragment(); - desc.append( - "You are going to update all files from preview section", - desc.createEl("br"), - desc.createEl("b", { - text: "Warning: " - }), - "Make sure you verified all files in preview" - ); - new import_obsidian5.Setting(this.containerEl).setDesc(desc).setName("Replace patterns").addButton((button) => { - button.setClass("bulk_button"); - button.setTooltip("Your files won't be changed"); - button.setButtonText("Preview"); - button.onClick(this.reRenderPreview); - }).addButton((button) => { - button.setClass("bulk_button"); - button.setTooltip( - "We don't have undone button yet!\r\n Do we need it?" - ); - button.setButtonText("Rename"); - button.onClick(async () => { - button.setDisabled(true); - await renameFilesInObsidian(this.app, this.plugin); - this.reRenderPreview(); - button.setDisabled(false); - }); - }); - } - renderSupportDevelopment() { - renderDonateButton(this.containerEl); - } - calculateFileNames() { - if (isViewTypeTags(this.plugin.settings)) { - this.getFilesByTags(); - return; - } - if (isViewTypeRegExp(this.plugin.settings)) { - this.getFilesByRegExp(); - return; - } - this.getFilesByFolder(); - } - getFilesByFolder() { - this.plugin.settings.fileNames = getObsidianFilesByFolderName( - this.app, - this.plugin - ); - } - getFilesByTags() { - this.plugin.settings.fileNames = getObsidianFilesWithTagName( - this.app, - this.plugin - ); - } - getFilesByRegExp() { - this.plugin.settings.fileNames = getObsidianFilesByRegExp( - this.app, - this.plugin - ); - } -}; -var main_default = BulkRenamePlugin; -/*! - * XRegExp 5.1.1 - * - * Steven Levithan (c) 2007-present MIT License - */ -/*! - * XRegExp Unicode Base 5.1.1 - * - * Steven Levithan (c) 2008-present MIT License - */ -/*! - * XRegExp Unicode Categories 5.1.1 - * - * Steven Levithan (c) 2010-present MIT License - * Unicode data by Mathias Bynens - */ -/*! - * XRegExp Unicode Properties 5.1.1 - * - * Steven Levithan (c) 2012-present MIT License - * Unicode data by Mathias Bynens - */ -/*! - * XRegExp Unicode Scripts 5.1.1 - * - * Steven Levithan (c) 2010-present MIT License - * Unicode data by Mathias Bynens - */ -/*! - * XRegExp.build 5.1.1 - * - * Steven Levithan (c) 2012-present MIT License - */ -/*! - * XRegExp.matchRecursive 5.1.1 - * - * Steven Levithan (c) 2009-present MIT License - */ - -/* nosourcemap */ \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/manifest.json b/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/manifest.json deleted file mode 100644 index b21f09f..0000000 --- a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "obsidian-bulk-rename-plugin", - "name": "Bulk Rename", - "version": "0.5.2", - "minAppVersion": "0.15.0", - "description": "Purpose of this plugin rename files based on pattern", - "author": "Oleg Lustenko", - "authorUrl": "https://obsidian.md", - "isDesktopOnly": false -} \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/styles.css b/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/styles.css deleted file mode 100644 index 0efdade..0000000 --- a/content/notes/.obsidian/plugins/obsidian-bulk-rename-plugin/styles.css +++ /dev/null @@ -1,155 +0,0 @@ -.bulk_rename_plugin { - padding-right: 1rem; -} - -.bulk_rename { - width: calc(100% - 20px); -} - -.bulk_rename_preview { - width: 80%; - height: 100%; - gap: 0; -} - -@media screen and (max-width: 983px) { - .bulk_rename_preview { - display: flex; - flex-direction: column; - max-height: 300px; - } -} - -.flex { - display: flex; -} -.flex-col { - flex-direction: column; -} - -.m-auto { - margin: auto; -} - -.bulk_info { - display: flex; - justify-content: space-between; - margin: auto; - width: 100%; -} - -.bulk_rename_preview > textarea { - height: 360px; -} - -.replaceRenderSymbols { - display: flex; - width: 100%; - padding-top: 0.5rem; -} - -.setting-item-control.replaceRenderSymbols .bulk_input { - min-height: 80px; -} - -.setting-item-control .bulk_preview_textarea { - min-width: 19em; -} - -.bulk_preview_textarea { - margin-left: 5px; - margin-right: 5px; - font-size: 14px; - width: 100%; - height: 400px; - resize: none; -} - -.bulk_button { - width: 100%; -} - -.bulk_preview_header { - margin-top: 5px; - margin-bottom: 5px; -} - -.setting-item-control .bulk_input { - width: 100%; - resize: none; - min-width: auto; -} - -.setting-item-control .bulk_input:first-child { - margin-right: 15px; -} - -.bulk_regexp_search { - padding-right: 1rem; -} - -.bulk_toggle { - border-top: none; -} - -.bulk_preview_label:first-child { - margin-right: 15px; -} - -.bulk_preview_label { - text-align: center; -} - -.bulk_regexp_container { - justify-content: space-between; -} - -.bulk_regexp_control { - background: var(--background-modifier-form-field); - border: 1px solid var(--background-modifier-border); - transition: box-shadow 0.15s ease-in-out, border 0.15s ease-in-out; - font-family: inherit; - border-radius: var(--input-radius); - outline: none; - max-width: 400px; -} - -.bulk_regexp_control:hover, -.bulk_regexp_control:focus, -.bulk_regexp_control:focus-visible { - box-shadow: 0 0 0 2px var(--background-modifier-border-hover); -} - -.bulk_regexp_control > input { - border: none; - margin: 0; - padding: 0; -} - -.bulk_regexp, -.bulk_regexp_flags { - width: 100%; -} - -.bulk_regexp:hover, -.bulk_regexp:focus, -.bulk_regexp:focus-visible .bulk_regexp_flags:hover, -.bulk_regexp_flags:focus, -.bulk_regexp_flags:focus-visible { - border: none !important; - box-shadow: none !important; -} - -.bulk_regexp_flags { - caret-color: transparent; - max-width: 80px; -} - -.bulk_regexp_slash { - font-size: 1.5em; - opacity: 0.5; -} - -.bulk-flag-selected { - background-color: lavender !important; -} diff --git a/content/notes/.obsidian/plugins/obsidian-local-images-plus/main.js b/content/notes/.obsidian/plugins/obsidian-local-images-plus/main.js deleted file mode 100644 index 7bde8c3..0000000 --- a/content/notes/.obsidian/plugins/obsidian-local-images-plus/main.js +++ /dev/null @@ -1,21405 +0,0 @@ -/* -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'); -var path = require('path'); -var fs$2 = require('fs'); -var url = require('url'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var path__default = /*#__PURE__*/_interopDefaultLegacy(path); -var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs$2); - -/****************************************************************************** -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; -}; - -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -function getAugmentedNamespace(n) { - if (n.__esModule) return n; - var f = n.default; - if (typeof f == "function") { - var a = function a () { - if (this instanceof a) { - var args = [null]; - args.push.apply(args, arguments); - var Ctor = Function.bind.apply(f, args); - return new Ctor(); - } - return f.apply(this, arguments); - }; - a.prototype = f.prototype; - } else a = {}; - Object.defineProperty(a, '__esModule', {value: true}); - Object.keys(n).forEach(function (k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function () { - return n[k]; - } - }); - }); - return a; -} - -var lib$3 = {}; - -var FsPromise = {}; - -/** - * Module convert fs functions to promise based functions - */ -Object.defineProperty(FsPromise, "__esModule", { value: true }); -FsPromise.readFile = FsPromise.writeFileSync = FsPromise.writeFile = FsPromise.read = FsPromise.open = FsPromise.close = FsPromise.stat = FsPromise.createReadStream = FsPromise.pathExists = void 0; -const fs$1 = fs__default["default"]; -FsPromise.pathExists = fs$1.existsSync; -FsPromise.createReadStream = fs$1.createReadStream; -async function stat(path) { - return new Promise((resolve, reject) => { - fs$1.stat(path, (err, stats) => { - if (err) - reject(err); - else - resolve(stats); - }); - }); -} -FsPromise.stat = stat; -async function close(fd) { - return new Promise((resolve, reject) => { - fs$1.close(fd, err => { - if (err) - reject(err); - else - resolve(); - }); - }); -} -FsPromise.close = close; -async function open(path, mode) { - return new Promise((resolve, reject) => { - fs$1.open(path, mode, (err, fd) => { - if (err) - reject(err); - else - resolve(fd); - }); - }); -} -FsPromise.open = open; -async function read(fd, buffer, offset, length, position) { - return new Promise((resolve, reject) => { - fs$1.read(fd, buffer, offset, length, position, (err, bytesRead, _buffer) => { - if (err) - reject(err); - else - resolve({ bytesRead, buffer: _buffer }); - }); - }); -} -FsPromise.read = read; -async function writeFile(path, data) { - return new Promise((resolve, reject) => { - fs$1.writeFile(path, data, err => { - if (err) - reject(err); - else - resolve(); - }); - }); -} -FsPromise.writeFile = writeFile; -function writeFileSync(path, data) { - fs$1.writeFileSync(path, data); -} -FsPromise.writeFileSync = writeFileSync; -async function readFile(path) { - return new Promise((resolve, reject) => { - fs$1.readFile(path, (err, buffer) => { - if (err) - reject(err); - else - resolve(buffer); - }); - }); -} -FsPromise.readFile = readFile; - -var core$3 = {}; - -var ReadStreamTokenizer$1 = {}; - -var AbstractTokenizer$1 = {}; - -var lib$2 = {}; - -var EndOfFileStream = {}; - -(function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.EndOfStreamError = exports.defaultMessages = void 0; - exports.defaultMessages = 'End-Of-Stream'; - /** - * Thrown on read operation of the end of file or stream has been reached - */ - class EndOfStreamError extends Error { - constructor() { - super(exports.defaultMessages); - } - } - exports.EndOfStreamError = EndOfStreamError; -} (EndOfFileStream)); - -var StreamReader = {}; - -var Deferred$1 = {}; - -Object.defineProperty(Deferred$1, "__esModule", { value: true }); -Deferred$1.Deferred = void 0; -class Deferred { - constructor() { - this.resolve = () => null; - this.reject = () => null; - this.promise = new Promise((resolve, reject) => { - this.reject = reject; - this.resolve = resolve; - }); - } -} -Deferred$1.Deferred = Deferred; - -(function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StreamReader = exports.EndOfStreamError = void 0; - const EndOfFileStream_1 = EndOfFileStream; - const Deferred_1 = Deferred$1; - var EndOfFileStream_2 = EndOfFileStream; - Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return EndOfFileStream_2.EndOfStreamError; } }); - const maxStreamReadSize = 1 * 1024 * 1024; // Maximum request length on read-stream operation - class StreamReader { - constructor(s) { - this.s = s; - /** - * Deferred used for postponed read request (as not data is yet available to read) - */ - this.deferred = null; - this.endOfStream = false; - /** - * Store peeked data - * @type {Array} - */ - this.peekQueue = []; - if (!s.read || !s.once) { - throw new Error('Expected an instance of stream.Readable'); - } - this.s.once('end', () => this.reject(new EndOfFileStream_1.EndOfStreamError())); - this.s.once('error', err => this.reject(err)); - this.s.once('close', () => this.reject(new Error('Stream closed'))); - } - /** - * Read ahead (peek) from stream. Subsequent read or peeks will return the same data - * @param uint8Array - Uint8Array (or Buffer) to store data read from stream in - * @param offset - Offset target - * @param length - Number of bytes to read - * @returns Number of bytes peeked - */ - async peek(uint8Array, offset, length) { - const bytesRead = await this.read(uint8Array, offset, length); - this.peekQueue.push(uint8Array.subarray(offset, offset + bytesRead)); // Put read data back to peek buffer - return bytesRead; - } - /** - * Read chunk from stream - * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in - * @param offset - Offset target - * @param length - Number of bytes to read - * @returns Number of bytes read - */ - async read(buffer, offset, length) { - if (length === 0) { - return 0; - } - if (this.peekQueue.length === 0 && this.endOfStream) { - throw new EndOfFileStream_1.EndOfStreamError(); - } - let remaining = length; - let bytesRead = 0; - // consume peeked data first - while (this.peekQueue.length > 0 && remaining > 0) { - const peekData = this.peekQueue.pop(); // Front of queue - if (!peekData) - throw new Error('peekData should be defined'); - const lenCopy = Math.min(peekData.length, remaining); - buffer.set(peekData.subarray(0, lenCopy), offset + bytesRead); - bytesRead += lenCopy; - remaining -= lenCopy; - if (lenCopy < peekData.length) { - // remainder back to queue - this.peekQueue.push(peekData.subarray(lenCopy)); - } - } - // continue reading from stream if required - while (remaining > 0 && !this.endOfStream) { - const reqLen = Math.min(remaining, maxStreamReadSize); - const chunkLen = await this.readFromStream(buffer, offset + bytesRead, reqLen); - bytesRead += chunkLen; - if (chunkLen < reqLen) - break; - remaining -= chunkLen; - } - return bytesRead; - } - /** - * Read chunk from stream - * @param buffer Target Uint8Array (or Buffer) to store data read from stream in - * @param offset Offset target - * @param length Number of bytes to read - * @returns Number of bytes read - */ - async readFromStream(buffer, offset, length) { - const readBuffer = this.s.read(length); - if (readBuffer) { - buffer.set(readBuffer, offset); - return readBuffer.length; - } - else { - const request = { - buffer, - offset, - length, - deferred: new Deferred_1.Deferred() - }; - this.deferred = request.deferred; - this.s.once('readable', () => { - this.readDeferred(request); - }); - return request.deferred.promise; - } - } - /** - * Process deferred read request - * @param request Deferred read request - */ - readDeferred(request) { - const readBuffer = this.s.read(request.length); - if (readBuffer) { - request.buffer.set(readBuffer, request.offset); - request.deferred.resolve(readBuffer.length); - this.deferred = null; - } - else { - this.s.once('readable', () => { - this.readDeferred(request); - }); - } - } - reject(err) { - this.endOfStream = true; - if (this.deferred) { - this.deferred.reject(err); - this.deferred = null; - } - } - } - exports.StreamReader = StreamReader; -} (StreamReader)); - -(function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StreamReader = exports.EndOfStreamError = void 0; - var EndOfFileStream_1 = EndOfFileStream; - Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return EndOfFileStream_1.EndOfStreamError; } }); - var StreamReader_1 = StreamReader; - Object.defineProperty(exports, "StreamReader", { enumerable: true, get: function () { return StreamReader_1.StreamReader; } }); -} (lib$2)); - -Object.defineProperty(AbstractTokenizer$1, "__esModule", { value: true }); -AbstractTokenizer$1.AbstractTokenizer = void 0; -const peek_readable_1$3 = lib$2; -/** - * Core tokenizer - */ -class AbstractTokenizer { - constructor(fileInfo) { - /** - * Tokenizer-stream position - */ - this.position = 0; - this.numBuffer = new Uint8Array(8); - this.fileInfo = fileInfo ? fileInfo : {}; - } - /** - * Read a token from the tokenizer-stream - * @param token - The token to read - * @param position - If provided, the desired position in the tokenizer-stream - * @returns Promise with token data - */ - async readToken(token, position = this.position) { - const uint8Array = Buffer.alloc(token.len); - const len = await this.readBuffer(uint8Array, { position }); - if (len < token.len) - throw new peek_readable_1$3.EndOfStreamError(); - return token.get(uint8Array, 0); - } - /** - * Peek a token from the tokenizer-stream. - * @param token - Token to peek from the tokenizer-stream. - * @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position. - * @returns Promise with token data - */ - async peekToken(token, position = this.position) { - const uint8Array = Buffer.alloc(token.len); - const len = await this.peekBuffer(uint8Array, { position }); - if (len < token.len) - throw new peek_readable_1$3.EndOfStreamError(); - return token.get(uint8Array, 0); - } - /** - * Read a numeric token from the stream - * @param token - Numeric token - * @returns Promise with number - */ - async readNumber(token) { - const len = await this.readBuffer(this.numBuffer, { length: token.len }); - if (len < token.len) - throw new peek_readable_1$3.EndOfStreamError(); - return token.get(this.numBuffer, 0); - } - /** - * Read a numeric token from the stream - * @param token - Numeric token - * @returns Promise with number - */ - async peekNumber(token) { - const len = await this.peekBuffer(this.numBuffer, { length: token.len }); - if (len < token.len) - throw new peek_readable_1$3.EndOfStreamError(); - return token.get(this.numBuffer, 0); - } - /** - * Ignore number of bytes, advances the pointer in under tokenizer-stream. - * @param length - Number of bytes to ignore - * @return resolves the number of bytes ignored, equals length if this available, otherwise the number of bytes available - */ - async ignore(length) { - if (this.fileInfo.size !== undefined) { - const bytesLeft = this.fileInfo.size - this.position; - if (length > bytesLeft) { - this.position += bytesLeft; - return bytesLeft; - } - } - this.position += length; - return length; - } - async close() { - // empty - } - normalizeOptions(uint8Array, options) { - if (options && options.position !== undefined && options.position < this.position) { - throw new Error('`options.position` must be equal or greater than `tokenizer.position`'); - } - if (options) { - return { - mayBeLess: options.mayBeLess === true, - offset: options.offset ? options.offset : 0, - length: options.length ? options.length : (uint8Array.length - (options.offset ? options.offset : 0)), - position: options.position ? options.position : this.position - }; - } - return { - mayBeLess: false, - offset: 0, - length: uint8Array.length, - position: this.position - }; - } -} -AbstractTokenizer$1.AbstractTokenizer = AbstractTokenizer; - -Object.defineProperty(ReadStreamTokenizer$1, "__esModule", { value: true }); -ReadStreamTokenizer$1.ReadStreamTokenizer = void 0; -const AbstractTokenizer_1$2 = AbstractTokenizer$1; -const peek_readable_1$2 = lib$2; -const maxBufferSize = 256000; -class ReadStreamTokenizer extends AbstractTokenizer_1$2.AbstractTokenizer { - constructor(stream, fileInfo) { - super(fileInfo); - this.streamReader = new peek_readable_1$2.StreamReader(stream); - } - /** - * Get file information, an HTTP-client may implement this doing a HEAD request - * @return Promise with file information - */ - async getFileInfo() { - return this.fileInfo; - } - /** - * Read buffer from tokenizer - * @param uint8Array - Target Uint8Array to fill with data read from the tokenizer-stream - * @param options - Read behaviour options - * @returns Promise with number of bytes read - */ - async readBuffer(uint8Array, options) { - const normOptions = this.normalizeOptions(uint8Array, options); - const skipBytes = normOptions.position - this.position; - if (skipBytes > 0) { - await this.ignore(skipBytes); - return this.readBuffer(uint8Array, options); - } - else if (skipBytes < 0) { - throw new Error('`options.position` must be equal or greater than `tokenizer.position`'); - } - if (normOptions.length === 0) { - return 0; - } - const bytesRead = await this.streamReader.read(uint8Array, normOptions.offset, normOptions.length); - this.position += bytesRead; - if ((!options || !options.mayBeLess) && bytesRead < normOptions.length) { - throw new peek_readable_1$2.EndOfStreamError(); - } - return bytesRead; - } - /** - * Peek (read ahead) buffer from tokenizer - * @param uint8Array - Uint8Array (or Buffer) to write data to - * @param options - Read behaviour options - * @returns Promise with number of bytes peeked - */ - async peekBuffer(uint8Array, options) { - const normOptions = this.normalizeOptions(uint8Array, options); - let bytesRead = 0; - if (normOptions.position) { - const skipBytes = normOptions.position - this.position; - if (skipBytes > 0) { - const skipBuffer = new Uint8Array(normOptions.length + skipBytes); - bytesRead = await this.peekBuffer(skipBuffer, { mayBeLess: normOptions.mayBeLess }); - uint8Array.set(skipBuffer.subarray(skipBytes), normOptions.offset); - return bytesRead - skipBytes; - } - else if (skipBytes < 0) { - throw new Error('Cannot peek from a negative offset in a stream'); - } - } - if (normOptions.length > 0) { - try { - bytesRead = await this.streamReader.peek(uint8Array, normOptions.offset, normOptions.length); - } - catch (err) { - if (options && options.mayBeLess && err instanceof peek_readable_1$2.EndOfStreamError) { - return 0; - } - throw err; - } - if ((!normOptions.mayBeLess) && bytesRead < normOptions.length) { - throw new peek_readable_1$2.EndOfStreamError(); - } - } - return bytesRead; - } - async ignore(length) { - // debug(`ignore ${this.position}...${this.position + length - 1}`); - const bufSize = Math.min(maxBufferSize, length); - const buf = new Uint8Array(bufSize); - let totBytesRead = 0; - while (totBytesRead < length) { - const remaining = length - totBytesRead; - const bytesRead = await this.readBuffer(buf, { length: Math.min(bufSize, remaining) }); - if (bytesRead < 0) { - return bytesRead; - } - totBytesRead += bytesRead; - } - return totBytesRead; - } -} -ReadStreamTokenizer$1.ReadStreamTokenizer = ReadStreamTokenizer; - -var BufferTokenizer$1 = {}; - -Object.defineProperty(BufferTokenizer$1, "__esModule", { value: true }); -BufferTokenizer$1.BufferTokenizer = void 0; -const peek_readable_1$1 = lib$2; -const AbstractTokenizer_1$1 = AbstractTokenizer$1; -class BufferTokenizer extends AbstractTokenizer_1$1.AbstractTokenizer { - /** - * Construct BufferTokenizer - * @param uint8Array - Uint8Array to tokenize - * @param fileInfo - Pass additional file information to the tokenizer - */ - constructor(uint8Array, fileInfo) { - super(fileInfo); - this.uint8Array = uint8Array; - this.fileInfo.size = this.fileInfo.size ? this.fileInfo.size : uint8Array.length; - } - /** - * Read buffer from tokenizer - * @param uint8Array - Uint8Array to tokenize - * @param options - Read behaviour options - * @returns {Promise} - */ - async readBuffer(uint8Array, options) { - if (options && options.position) { - if (options.position < this.position) { - throw new Error('`options.position` must be equal or greater than `tokenizer.position`'); - } - this.position = options.position; - } - const bytesRead = await this.peekBuffer(uint8Array, options); - this.position += bytesRead; - return bytesRead; - } - /** - * Peek (read ahead) buffer from tokenizer - * @param uint8Array - * @param options - Read behaviour options - * @returns {Promise} - */ - async peekBuffer(uint8Array, options) { - const normOptions = this.normalizeOptions(uint8Array, options); - const bytes2read = Math.min(this.uint8Array.length - normOptions.position, normOptions.length); - if ((!normOptions.mayBeLess) && bytes2read < normOptions.length) { - throw new peek_readable_1$1.EndOfStreamError(); - } - else { - uint8Array.set(this.uint8Array.subarray(normOptions.position, normOptions.position + bytes2read), normOptions.offset); - return bytes2read; - } - } - async close() { - // empty - } -} -BufferTokenizer$1.BufferTokenizer = BufferTokenizer; - -(function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromBuffer = exports.fromStream = exports.EndOfStreamError = void 0; - const ReadStreamTokenizer_1 = ReadStreamTokenizer$1; - const BufferTokenizer_1 = BufferTokenizer$1; - var peek_readable_1 = lib$2; - Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return peek_readable_1.EndOfStreamError; } }); - /** - * Construct ReadStreamTokenizer from given Stream. - * Will set fileSize, if provided given Stream has set the .path property/ - * @param stream - Read from Node.js Stream.Readable - * @param fileInfo - Pass the file information, like size and MIME-type of the corresponding stream. - * @returns ReadStreamTokenizer - */ - function fromStream(stream, fileInfo) { - fileInfo = fileInfo ? fileInfo : {}; - return new ReadStreamTokenizer_1.ReadStreamTokenizer(stream, fileInfo); - } - exports.fromStream = fromStream; - /** - * Construct ReadStreamTokenizer from given Buffer. - * @param uint8Array - Uint8Array to tokenize - * @param fileInfo - Pass additional file information to the tokenizer - * @returns BufferTokenizer - */ - function fromBuffer(uint8Array, fileInfo) { - return new BufferTokenizer_1.BufferTokenizer(uint8Array, fileInfo); - } - exports.fromBuffer = fromBuffer; -} (core$3)); - -var FileTokenizer$1 = {}; - -Object.defineProperty(FileTokenizer$1, "__esModule", { value: true }); -FileTokenizer$1.fromFile = FileTokenizer$1.FileTokenizer = void 0; -const AbstractTokenizer_1 = AbstractTokenizer$1; -const peek_readable_1 = lib$2; -const fs = FsPromise; -class FileTokenizer extends AbstractTokenizer_1.AbstractTokenizer { - constructor(fd, fileInfo) { - super(fileInfo); - this.fd = fd; - } - /** - * Read buffer from file - * @param uint8Array - Uint8Array to write result to - * @param options - Read behaviour options - * @returns Promise number of bytes read - */ - async readBuffer(uint8Array, options) { - const normOptions = this.normalizeOptions(uint8Array, options); - this.position = normOptions.position; - const res = await fs.read(this.fd, uint8Array, normOptions.offset, normOptions.length, normOptions.position); - this.position += res.bytesRead; - if (res.bytesRead < normOptions.length && (!options || !options.mayBeLess)) { - throw new peek_readable_1.EndOfStreamError(); - } - return res.bytesRead; - } - /** - * Peek buffer from file - * @param uint8Array - Uint8Array (or Buffer) to write data to - * @param options - Read behaviour options - * @returns Promise number of bytes read - */ - async peekBuffer(uint8Array, options) { - const normOptions = this.normalizeOptions(uint8Array, options); - const res = await fs.read(this.fd, uint8Array, normOptions.offset, normOptions.length, normOptions.position); - if ((!normOptions.mayBeLess) && res.bytesRead < normOptions.length) { - throw new peek_readable_1.EndOfStreamError(); - } - return res.bytesRead; - } - async close() { - return fs.close(this.fd); - } -} -FileTokenizer$1.FileTokenizer = FileTokenizer; -async function fromFile$1(sourceFilePath) { - const stat = await fs.stat(sourceFilePath); - if (!stat.isFile) { - throw new Error(`File not a file: ${sourceFilePath}`); - } - const fd = await fs.open(sourceFilePath, 'r'); - return new FileTokenizer(fd, { path: sourceFilePath, size: stat.size }); -} -FileTokenizer$1.fromFile = fromFile$1; - -(function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromStream = exports.fromBuffer = exports.EndOfStreamError = exports.fromFile = void 0; - const fs = FsPromise; - const core = core$3; - var FileTokenizer_1 = FileTokenizer$1; - Object.defineProperty(exports, "fromFile", { enumerable: true, get: function () { return FileTokenizer_1.fromFile; } }); - var core_1 = core$3; - Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return core_1.EndOfStreamError; } }); - Object.defineProperty(exports, "fromBuffer", { enumerable: true, get: function () { return core_1.fromBuffer; } }); - /** - * Construct ReadStreamTokenizer from given Stream. - * Will set fileSize, if provided given Stream has set the .path property. - * @param stream - Node.js Stream.Readable - * @param fileInfo - Pass additional file information to the tokenizer - * @returns Tokenizer - */ - async function fromStream(stream, fileInfo) { - fileInfo = fileInfo ? fileInfo : {}; - if (stream.path) { - const stat = await fs.stat(stream.path); - fileInfo.path = stream.path; - fileInfo.size = stat.size; - } - return core.fromStream(stream, fileInfo); - } - exports.fromStream = fromStream; -} (lib$3)); - -var lib$1 = {}; - -var ieee754 = {}; - -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ - -ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -}; - -ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; -}; - -(function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AnsiStringType = exports.StringType = exports.BufferType = exports.Uint8ArrayType = exports.IgnoreType = exports.Float80_LE = exports.Float80_BE = exports.Float64_LE = exports.Float64_BE = exports.Float32_LE = exports.Float32_BE = exports.Float16_LE = exports.Float16_BE = exports.INT64_BE = exports.UINT64_BE = exports.INT64_LE = exports.UINT64_LE = exports.INT32_LE = exports.INT32_BE = exports.INT24_BE = exports.INT24_LE = exports.INT16_LE = exports.INT16_BE = exports.INT8 = exports.UINT32_BE = exports.UINT32_LE = exports.UINT24_BE = exports.UINT24_LE = exports.UINT16_BE = exports.UINT16_LE = exports.UINT8 = void 0; - const ieee754$1 = ieee754; - // Primitive types - function dv(array) { - return new DataView(array.buffer, array.byteOffset); - } - /** - * 8-bit unsigned integer - */ - exports.UINT8 = { - len: 1, - get(array, offset) { - return dv(array).getUint8(offset); - }, - put(array, offset, value) { - dv(array).setUint8(offset, value); - return offset + 1; - } - }; - /** - * 16-bit unsigned integer, Little Endian byte order - */ - exports.UINT16_LE = { - len: 2, - get(array, offset) { - return dv(array).getUint16(offset, true); - }, - put(array, offset, value) { - dv(array).setUint16(offset, value, true); - return offset + 2; - } - }; - /** - * 16-bit unsigned integer, Big Endian byte order - */ - exports.UINT16_BE = { - len: 2, - get(array, offset) { - return dv(array).getUint16(offset); - }, - put(array, offset, value) { - dv(array).setUint16(offset, value); - return offset + 2; - } - }; - /** - * 24-bit unsigned integer, Little Endian byte order - */ - exports.UINT24_LE = { - len: 3, - get(array, offset) { - const dataView = dv(array); - return dataView.getUint8(offset) + (dataView.getUint16(offset + 1, true) << 8); - }, - put(array, offset, value) { - const dataView = dv(array); - dataView.setUint8(offset, value & 0xff); - dataView.setUint16(offset + 1, value >> 8, true); - return offset + 3; - } - }; - /** - * 24-bit unsigned integer, Big Endian byte order - */ - exports.UINT24_BE = { - len: 3, - get(array, offset) { - const dataView = dv(array); - return (dataView.getUint16(offset) << 8) + dataView.getUint8(offset + 2); - }, - put(array, offset, value) { - const dataView = dv(array); - dataView.setUint16(offset, value >> 8); - dataView.setUint8(offset + 2, value & 0xff); - return offset + 3; - } - }; - /** - * 32-bit unsigned integer, Little Endian byte order - */ - exports.UINT32_LE = { - len: 4, - get(array, offset) { - return dv(array).getUint32(offset, true); - }, - put(array, offset, value) { - dv(array).setUint32(offset, value, true); - return offset + 4; - } - }; - /** - * 32-bit unsigned integer, Big Endian byte order - */ - exports.UINT32_BE = { - len: 4, - get(array, offset) { - return dv(array).getUint32(offset); - }, - put(array, offset, value) { - dv(array).setUint32(offset, value); - return offset + 4; - } - }; - /** - * 8-bit signed integer - */ - exports.INT8 = { - len: 1, - get(array, offset) { - return dv(array).getInt8(offset); - }, - put(array, offset, value) { - dv(array).setInt8(offset, value); - return offset + 1; - } - }; - /** - * 16-bit signed integer, Big Endian byte order - */ - exports.INT16_BE = { - len: 2, - get(array, offset) { - return dv(array).getInt16(offset); - }, - put(array, offset, value) { - dv(array).setInt16(offset, value); - return offset + 2; - } - }; - /** - * 16-bit signed integer, Little Endian byte order - */ - exports.INT16_LE = { - len: 2, - get(array, offset) { - return dv(array).getInt16(offset, true); - }, - put(array, offset, value) { - dv(array).setInt16(offset, value, true); - return offset + 2; - } - }; - /** - * 24-bit signed integer, Little Endian byte order - */ - exports.INT24_LE = { - len: 3, - get(array, offset) { - const unsigned = exports.UINT24_LE.get(array, offset); - return unsigned > 0x7fffff ? unsigned - 0x1000000 : unsigned; - }, - put(array, offset, value) { - const dataView = dv(array); - dataView.setUint8(offset, value & 0xff); - dataView.setUint16(offset + 1, value >> 8, true); - return offset + 3; - } - }; - /** - * 24-bit signed integer, Big Endian byte order - */ - exports.INT24_BE = { - len: 3, - get(array, offset) { - const unsigned = exports.UINT24_BE.get(array, offset); - return unsigned > 0x7fffff ? unsigned - 0x1000000 : unsigned; - }, - put(array, offset, value) { - const dataView = dv(array); - dataView.setUint16(offset, value >> 8); - dataView.setUint8(offset + 2, value & 0xff); - return offset + 3; - } - }; - /** - * 32-bit signed integer, Big Endian byte order - */ - exports.INT32_BE = { - len: 4, - get(array, offset) { - return dv(array).getInt32(offset); - }, - put(array, offset, value) { - dv(array).setInt32(offset, value); - return offset + 4; - } - }; - /** - * 32-bit signed integer, Big Endian byte order - */ - exports.INT32_LE = { - len: 4, - get(array, offset) { - return dv(array).getInt32(offset, true); - }, - put(array, offset, value) { - dv(array).setInt32(offset, value, true); - return offset + 4; - } - }; - /** - * 64-bit unsigned integer, Little Endian byte order - */ - exports.UINT64_LE = { - len: 8, - get(array, offset) { - return dv(array).getBigUint64(offset, true); - }, - put(array, offset, value) { - dv(array).setBigUint64(offset, value, true); - return offset + 8; - } - }; - /** - * 64-bit signed integer, Little Endian byte order - */ - exports.INT64_LE = { - len: 8, - get(array, offset) { - return dv(array).getBigInt64(offset, true); - }, - put(array, offset, value) { - dv(array).setBigInt64(offset, value, true); - return offset + 8; - } - }; - /** - * 64-bit unsigned integer, Big Endian byte order - */ - exports.UINT64_BE = { - len: 8, - get(array, offset) { - return dv(array).getBigUint64(offset); - }, - put(array, offset, value) { - dv(array).setBigUint64(offset, value); - return offset + 8; - } - }; - /** - * 64-bit signed integer, Big Endian byte order - */ - exports.INT64_BE = { - len: 8, - get(array, offset) { - return dv(array).getBigInt64(offset); - }, - put(array, offset, value) { - dv(array).setBigInt64(offset, value); - return offset + 8; - } - }; - /** - * IEEE 754 16-bit (half precision) float, big endian - */ - exports.Float16_BE = { - len: 2, - get(dataView, offset) { - return ieee754$1.read(dataView, offset, false, 10, this.len); - }, - put(dataView, offset, value) { - ieee754$1.write(dataView, value, offset, false, 10, this.len); - return offset + this.len; - } - }; - /** - * IEEE 754 16-bit (half precision) float, little endian - */ - exports.Float16_LE = { - len: 2, - get(array, offset) { - return ieee754$1.read(array, offset, true, 10, this.len); - }, - put(array, offset, value) { - ieee754$1.write(array, value, offset, true, 10, this.len); - return offset + this.len; - } - }; - /** - * IEEE 754 32-bit (single precision) float, big endian - */ - exports.Float32_BE = { - len: 4, - get(array, offset) { - return dv(array).getFloat32(offset); - }, - put(array, offset, value) { - dv(array).setFloat32(offset, value); - return offset + 4; - } - }; - /** - * IEEE 754 32-bit (single precision) float, little endian - */ - exports.Float32_LE = { - len: 4, - get(array, offset) { - return dv(array).getFloat32(offset, true); - }, - put(array, offset, value) { - dv(array).setFloat32(offset, value, true); - return offset + 4; - } - }; - /** - * IEEE 754 64-bit (double precision) float, big endian - */ - exports.Float64_BE = { - len: 8, - get(array, offset) { - return dv(array).getFloat64(offset); - }, - put(array, offset, value) { - dv(array).setFloat64(offset, value); - return offset + 8; - } - }; - /** - * IEEE 754 64-bit (double precision) float, little endian - */ - exports.Float64_LE = { - len: 8, - get(array, offset) { - return dv(array).getFloat64(offset, true); - }, - put(array, offset, value) { - dv(array).setFloat64(offset, value, true); - return offset + 8; - } - }; - /** - * IEEE 754 80-bit (extended precision) float, big endian - */ - exports.Float80_BE = { - len: 10, - get(array, offset) { - return ieee754$1.read(array, offset, false, 63, this.len); - }, - put(array, offset, value) { - ieee754$1.write(array, value, offset, false, 63, this.len); - return offset + this.len; - } - }; - /** - * IEEE 754 80-bit (extended precision) float, little endian - */ - exports.Float80_LE = { - len: 10, - get(array, offset) { - return ieee754$1.read(array, offset, true, 63, this.len); - }, - put(array, offset, value) { - ieee754$1.write(array, value, offset, true, 63, this.len); - return offset + this.len; - } - }; - /** - * Ignore a given number of bytes - */ - class IgnoreType { - /** - * @param len number of bytes to ignore - */ - constructor(len) { - this.len = len; - } - // ToDo: don't read, but skip data - get(array, off) { - } - } - exports.IgnoreType = IgnoreType; - class Uint8ArrayType { - constructor(len) { - this.len = len; - } - get(array, offset) { - return array.subarray(offset, offset + this.len); - } - } - exports.Uint8ArrayType = Uint8ArrayType; - class BufferType { - constructor(len) { - this.len = len; - } - get(uint8Array, off) { - return Buffer.from(uint8Array.subarray(off, off + this.len)); - } - } - exports.BufferType = BufferType; - /** - * Consume a fixed number of bytes from the stream and return a string with a specified encoding. - */ - class StringType { - constructor(len, encoding) { - this.len = len; - this.encoding = encoding; - } - get(uint8Array, offset) { - return Buffer.from(uint8Array).toString(this.encoding, offset, offset + this.len); - } - } - exports.StringType = StringType; - /** - * ANSI Latin 1 String - * Using windows-1252 / ISO 8859-1 decoding - */ - class AnsiStringType { - constructor(len) { - this.len = len; - } - static decode(buffer, offset, until) { - let str = ''; - for (let i = offset; i < until; ++i) { - str += AnsiStringType.codePointToString(AnsiStringType.singleByteDecoder(buffer[i])); - } - return str; - } - static inRange(a, min, max) { - return min <= a && a <= max; - } - static codePointToString(cp) { - if (cp <= 0xFFFF) { - return String.fromCharCode(cp); - } - else { - cp -= 0x10000; - return String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00); - } - } - static singleByteDecoder(bite) { - if (AnsiStringType.inRange(bite, 0x00, 0x7F)) { - return bite; - } - const codePoint = AnsiStringType.windows1252[bite - 0x80]; - if (codePoint === null) { - throw Error('invaliding encoding'); - } - return codePoint; - } - get(buffer, offset = 0) { - return AnsiStringType.decode(buffer, offset, offset + this.len); - } - } - exports.AnsiStringType = AnsiStringType; - AnsiStringType.windows1252 = [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, - 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, - 8482, 353, 8250, 339, 157, 382, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255]; -} (lib$1)); - -var util$4 = {}; - -util$4.stringToBytes = string => [...string].map(character => character.charCodeAt(0)); - -/** -Checks whether the TAR checksum is valid. - -@param {Buffer} buffer - The TAR header `[offset ... offset + 512]`. -@param {number} offset - TAR header offset. -@returns {boolean} `true` if the TAR checksum is valid, otherwise `false`. -*/ -util$4.tarHeaderChecksumMatches = (buffer, offset = 0) => { - const readSum = parseInt(buffer.toString('utf8', 148, 154).replace(/\0.*$/, '').trim(), 8); // Read sum in header - if (isNaN(readSum)) { - return false; - } - - let sum = 8 * 0x20; // Initialize signed bit sum - - for (let i = offset; i < offset + 148; i++) { - sum += buffer[i]; - } - - for (let i = offset + 156; i < offset + 512; i++) { - sum += buffer[i]; - } - - return readSum === sum; -}; - -/** -ID3 UINT32 sync-safe tokenizer token. -28 bits (representing up to 256MB) integer, the msb is 0 to avoid "false syncsignals". -*/ -util$4.uint32SyncSafeToken = { - get: (buffer, offset) => { - return (buffer[offset + 3] & 0x7F) | ((buffer[offset + 2]) << 7) | ((buffer[offset + 1]) << 14) | ((buffer[offset]) << 21); - }, - len: 4 -}; - -var supported$1 = { - extensions: [ - 'jpg', - 'png', - 'apng', - 'gif', - 'webp', - 'flif', - 'xcf', - 'cr2', - 'cr3', - 'orf', - 'arw', - 'dng', - 'nef', - 'rw2', - 'raf', - 'tif', - 'bmp', - 'icns', - 'jxr', - 'psd', - 'indd', - 'zip', - 'tar', - 'rar', - 'gz', - 'bz2', - '7z', - 'dmg', - 'mp4', - 'mid', - 'mkv', - 'webm', - 'mov', - 'avi', - 'mpg', - 'mp2', - 'mp3', - 'm4a', - 'oga', - 'ogg', - 'ogv', - 'opus', - 'flac', - 'wav', - 'spx', - 'amr', - 'pdf', - 'epub', - 'exe', - 'swf', - 'rtf', - 'wasm', - 'woff', - 'woff2', - 'eot', - 'ttf', - 'otf', - 'ico', - 'flv', - 'ps', - 'xz', - 'sqlite', - 'nes', - 'crx', - 'xpi', - 'cab', - 'deb', - 'ar', - 'rpm', - 'Z', - 'lz', - 'cfb', - 'mxf', - 'mts', - 'blend', - 'bpg', - 'docx', - 'pptx', - 'xlsx', - '3gp', - '3g2', - 'jp2', - 'jpm', - 'jpx', - 'mj2', - 'aif', - 'qcp', - 'odt', - 'ods', - 'odp', - 'xml', - 'mobi', - 'heic', - 'cur', - 'ktx', - 'ape', - 'wv', - 'dcm', - 'ics', - 'glb', - 'pcap', - 'dsf', - 'lnk', - 'alias', - 'voc', - 'ac3', - 'm4v', - 'm4p', - 'm4b', - 'f4v', - 'f4p', - 'f4b', - 'f4a', - 'mie', - 'asf', - 'ogm', - 'ogx', - 'mpc', - 'arrow', - 'shp', - 'aac', - 'mp1', - 'it', - 's3m', - 'xm', - 'ai', - 'skp', - 'avif', - 'eps', - 'lzh', - 'pgp', - 'asar', - 'stl', - 'chm', - '3mf', - 'zst', - 'jxl', - 'vcf' - ], - mimeTypes: [ - 'image/jpeg', - 'image/png', - 'image/gif', - 'image/webp', - 'image/flif', - 'image/x-xcf', - 'image/x-canon-cr2', - 'image/x-canon-cr3', - 'image/tiff', - 'image/bmp', - 'image/vnd.ms-photo', - 'image/vnd.adobe.photoshop', - 'application/x-indesign', - 'application/epub+zip', - 'application/x-xpinstall', - 'application/vnd.oasis.opendocument.text', - 'application/vnd.oasis.opendocument.spreadsheet', - 'application/vnd.oasis.opendocument.presentation', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'application/zip', - 'application/x-tar', - 'application/x-rar-compressed', - 'application/gzip', - 'application/x-bzip2', - 'application/x-7z-compressed', - 'application/x-apple-diskimage', - 'application/x-apache-arrow', - 'video/mp4', - 'audio/midi', - 'video/x-matroska', - 'video/webm', - 'video/quicktime', - 'video/vnd.avi', - 'audio/vnd.wave', - 'audio/qcelp', - 'audio/x-ms-asf', - 'video/x-ms-asf', - 'application/vnd.ms-asf', - 'video/mpeg', - 'video/3gpp', - 'audio/mpeg', - 'audio/mp4', // RFC 4337 - 'audio/opus', - 'video/ogg', - 'audio/ogg', - 'application/ogg', - 'audio/x-flac', - 'audio/ape', - 'audio/wavpack', - 'audio/amr', - 'application/pdf', - 'application/x-msdownload', - 'application/x-shockwave-flash', - 'application/rtf', - 'application/wasm', - 'font/woff', - 'font/woff2', - 'application/vnd.ms-fontobject', - 'font/ttf', - 'font/otf', - 'image/x-icon', - 'video/x-flv', - 'application/postscript', - 'application/eps', - 'application/x-xz', - 'application/x-sqlite3', - 'application/x-nintendo-nes-rom', - 'application/x-google-chrome-extension', - 'application/vnd.ms-cab-compressed', - 'application/x-deb', - 'application/x-unix-archive', - 'application/x-rpm', - 'application/x-compress', - 'application/x-lzip', - 'application/x-cfb', - 'application/x-mie', - 'application/mxf', - 'video/mp2t', - 'application/x-blender', - 'image/bpg', - 'image/jp2', - 'image/jpx', - 'image/jpm', - 'image/mj2', - 'audio/aiff', - 'application/xml', - 'application/x-mobipocket-ebook', - 'image/heif', - 'image/heif-sequence', - 'image/heic', - 'image/heic-sequence', - 'image/icns', - 'image/ktx', - 'application/dicom', - 'audio/x-musepack', - 'text/calendar', - 'text/vcard', - 'model/gltf-binary', - 'application/vnd.tcpdump.pcap', - 'audio/x-dsf', // Non-standard - 'application/x.ms.shortcut', // Invented by us - 'application/x.apple.alias', // Invented by us - 'audio/x-voc', - 'audio/vnd.dolby.dd-raw', - 'audio/x-m4a', - 'image/apng', - 'image/x-olympus-orf', - 'image/x-sony-arw', - 'image/x-adobe-dng', - 'image/x-nikon-nef', - 'image/x-panasonic-rw2', - 'image/x-fujifilm-raf', - 'video/x-m4v', - 'video/3gpp2', - 'application/x-esri-shape', - 'audio/aac', - 'audio/x-it', - 'audio/x-s3m', - 'audio/x-xm', - 'video/MP1S', - 'video/MP2P', - 'application/vnd.sketchup.skp', - 'image/avif', - 'application/x-lzh-compressed', - 'application/pgp-encrypted', - 'application/x-asar', - 'model/stl', - 'application/vnd.ms-htmlhelp', - 'model/3mf', - 'image/jxl', - 'application/zstd' - ] -}; - -const Token = lib$1; -const strtok3$1 = core$3; -const { - stringToBytes, - tarHeaderChecksumMatches, - uint32SyncSafeToken -} = util$4; -const supported = supported$1; - -const minimumBytes = 4100; // A fair amount of file-types are detectable within this range - -async function fromStream(stream) { - const tokenizer = await strtok3$1.fromStream(stream); - try { - return await fromTokenizer(tokenizer); - } finally { - await tokenizer.close(); - } -} - -async function fromBuffer(input) { - if (!(input instanceof Uint8Array || input instanceof ArrayBuffer || Buffer.isBuffer(input))) { - throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof input}\``); - } - - const buffer = input instanceof Buffer ? input : Buffer.from(input); - - if (!(buffer && buffer.length > 1)) { - return; - } - - const tokenizer = strtok3$1.fromBuffer(buffer); - return fromTokenizer(tokenizer); -} - -function _check(buffer, headers, options) { - options = { - offset: 0, - ...options - }; - - for (const [index, header] of headers.entries()) { - // If a bitmask is set - if (options.mask) { - // If header doesn't equal `buf` with bits masked off - if (header !== (options.mask[index] & buffer[index + options.offset])) { - return false; - } - } else if (header !== buffer[index + options.offset]) { - return false; - } - } - - return true; -} - -async function fromTokenizer(tokenizer) { - try { - return _fromTokenizer(tokenizer); - } catch (error) { - if (!(error instanceof strtok3$1.EndOfStreamError)) { - throw error; - } - } -} - -async function _fromTokenizer(tokenizer) { - let buffer = Buffer.alloc(minimumBytes); - const bytesRead = 12; - const check = (header, options) => _check(buffer, header, options); - const checkString = (header, options) => check(stringToBytes(header), options); - - // Keep reading until EOF if the file size is unknown. - if (!tokenizer.fileInfo.size) { - tokenizer.fileInfo.size = Number.MAX_SAFE_INTEGER; - } - - await tokenizer.peekBuffer(buffer, {length: bytesRead, mayBeLess: true}); - - // -- 2-byte signatures -- - - if (check([0x42, 0x4D])) { - return { - ext: 'bmp', - mime: 'image/bmp' - }; - } - - if (check([0x0B, 0x77])) { - return { - ext: 'ac3', - mime: 'audio/vnd.dolby.dd-raw' - }; - } - - if (check([0x78, 0x01])) { - return { - ext: 'dmg', - mime: 'application/x-apple-diskimage' - }; - } - - if (check([0x4D, 0x5A])) { - return { - ext: 'exe', - mime: 'application/x-msdownload' - }; - } - - if (check([0x25, 0x21])) { - await tokenizer.peekBuffer(buffer, {length: 24, mayBeLess: true}); - - if (checkString('PS-Adobe-', {offset: 2}) && - checkString(' EPSF-', {offset: 14})) { - return { - ext: 'eps', - mime: 'application/eps' - }; - } - - return { - ext: 'ps', - mime: 'application/postscript' - }; - } - - if ( - check([0x1F, 0xA0]) || - check([0x1F, 0x9D]) - ) { - return { - ext: 'Z', - mime: 'application/x-compress' - }; - } - - // -- 3-byte signatures -- - - if (check([0xFF, 0xD8, 0xFF])) { - return { - ext: 'jpg', - mime: 'image/jpeg' - }; - } - - if (check([0x49, 0x49, 0xBC])) { - return { - ext: 'jxr', - mime: 'image/vnd.ms-photo' - }; - } - - if (check([0x1F, 0x8B, 0x8])) { - return { - ext: 'gz', - mime: 'application/gzip' - }; - } - - if (check([0x42, 0x5A, 0x68])) { - return { - ext: 'bz2', - mime: 'application/x-bzip2' - }; - } - - if (checkString('ID3')) { - await tokenizer.ignore(6); // Skip ID3 header until the header size - const id3HeaderLen = await tokenizer.readToken(uint32SyncSafeToken); - if (tokenizer.position + id3HeaderLen > tokenizer.fileInfo.size) { - // Guess file type based on ID3 header for backward compatibility - return { - ext: 'mp3', - mime: 'audio/mpeg' - }; - } - - await tokenizer.ignore(id3HeaderLen); - return fromTokenizer(tokenizer); // Skip ID3 header, recursion - } - - // Musepack, SV7 - if (checkString('MP+')) { - return { - ext: 'mpc', - mime: 'audio/x-musepack' - }; - } - - if ( - (buffer[0] === 0x43 || buffer[0] === 0x46) && - check([0x57, 0x53], {offset: 1}) - ) { - return { - ext: 'swf', - mime: 'application/x-shockwave-flash' - }; - } - - // -- 4-byte signatures -- - - if (check([0x47, 0x49, 0x46])) { - return { - ext: 'gif', - mime: 'image/gif' - }; - } - - if (checkString('FLIF')) { - return { - ext: 'flif', - mime: 'image/flif' - }; - } - - if (checkString('8BPS')) { - return { - ext: 'psd', - mime: 'image/vnd.adobe.photoshop' - }; - } - - if (checkString('WEBP', {offset: 8})) { - return { - ext: 'webp', - mime: 'image/webp' - }; - } - - // Musepack, SV8 - if (checkString('MPCK')) { - return { - ext: 'mpc', - mime: 'audio/x-musepack' - }; - } - - if (checkString('FORM')) { - return { - ext: 'aif', - mime: 'audio/aiff' - }; - } - - if (checkString('icns', {offset: 0})) { - return { - ext: 'icns', - mime: 'image/icns' - }; - } - - // Zip-based file formats - // Need to be before the `zip` check - if (check([0x50, 0x4B, 0x3, 0x4])) { // Local file header signature - try { - while (tokenizer.position + 30 < tokenizer.fileInfo.size) { - await tokenizer.readBuffer(buffer, {length: 30}); - - // https://en.wikipedia.org/wiki/Zip_(file_format)#File_headers - const zipHeader = { - compressedSize: buffer.readUInt32LE(18), - uncompressedSize: buffer.readUInt32LE(22), - filenameLength: buffer.readUInt16LE(26), - extraFieldLength: buffer.readUInt16LE(28) - }; - - zipHeader.filename = await tokenizer.readToken(new Token.StringType(zipHeader.filenameLength, 'utf-8')); - await tokenizer.ignore(zipHeader.extraFieldLength); - - // Assumes signed `.xpi` from addons.mozilla.org - if (zipHeader.filename === 'META-INF/mozilla.rsa') { - return { - ext: 'xpi', - mime: 'application/x-xpinstall' - }; - } - - if (zipHeader.filename.endsWith('.rels') || zipHeader.filename.endsWith('.xml')) { - const type = zipHeader.filename.split('/')[0]; - switch (type) { - case '_rels': - break; - case 'word': - return { - ext: 'docx', - mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' - }; - case 'ppt': - return { - ext: 'pptx', - mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' - }; - case 'xl': - return { - ext: 'xlsx', - mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - }; - default: - break; - } - } - - if (zipHeader.filename.startsWith('xl/')) { - return { - ext: 'xlsx', - mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - }; - } - - if (zipHeader.filename.startsWith('3D/') && zipHeader.filename.endsWith('.model')) { - return { - ext: '3mf', - mime: 'model/3mf' - }; - } - - // The docx, xlsx and pptx file types extend the Office Open XML file format: - // https://en.wikipedia.org/wiki/Office_Open_XML_file_formats - // We look for: - // - one entry named '[Content_Types].xml' or '_rels/.rels', - // - one entry indicating specific type of file. - // MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it. - if (zipHeader.filename === 'mimetype' && zipHeader.compressedSize === zipHeader.uncompressedSize) { - const mimeType = await tokenizer.readToken(new Token.StringType(zipHeader.compressedSize, 'utf-8')); - - switch (mimeType) { - case 'application/epub+zip': - return { - ext: 'epub', - mime: 'application/epub+zip' - }; - case 'application/vnd.oasis.opendocument.text': - return { - ext: 'odt', - mime: 'application/vnd.oasis.opendocument.text' - }; - case 'application/vnd.oasis.opendocument.spreadsheet': - return { - ext: 'ods', - mime: 'application/vnd.oasis.opendocument.spreadsheet' - }; - case 'application/vnd.oasis.opendocument.presentation': - return { - ext: 'odp', - mime: 'application/vnd.oasis.opendocument.presentation' - }; - default: - } - } - - // Try to find next header manually when current one is corrupted - if (zipHeader.compressedSize === 0) { - let nextHeaderIndex = -1; - - while (nextHeaderIndex < 0 && (tokenizer.position < tokenizer.fileInfo.size)) { - await tokenizer.peekBuffer(buffer, {mayBeLess: true}); - - nextHeaderIndex = buffer.indexOf('504B0304', 0, 'hex'); - // Move position to the next header if found, skip the whole buffer otherwise - await tokenizer.ignore(nextHeaderIndex >= 0 ? nextHeaderIndex : buffer.length); - } - } else { - await tokenizer.ignore(zipHeader.compressedSize); - } - } - } catch (error) { - if (!(error instanceof strtok3$1.EndOfStreamError)) { - throw error; - } - } - - return { - ext: 'zip', - mime: 'application/zip' - }; - } - - if (checkString('OggS')) { - // This is an OGG container - await tokenizer.ignore(28); - const type = Buffer.alloc(8); - await tokenizer.readBuffer(type); - - // Needs to be before `ogg` check - if (_check(type, [0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64])) { - return { - ext: 'opus', - mime: 'audio/opus' - }; - } - - // If ' theora' in header. - if (_check(type, [0x80, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61])) { - return { - ext: 'ogv', - mime: 'video/ogg' - }; - } - - // If '\x01video' in header. - if (_check(type, [0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00])) { - return { - ext: 'ogm', - mime: 'video/ogg' - }; - } - - // If ' FLAC' in header https://xiph.org/flac/faq.html - if (_check(type, [0x7F, 0x46, 0x4C, 0x41, 0x43])) { - return { - ext: 'oga', - mime: 'audio/ogg' - }; - } - - // 'Speex ' in header https://en.wikipedia.org/wiki/Speex - if (_check(type, [0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20])) { - return { - ext: 'spx', - mime: 'audio/ogg' - }; - } - - // If '\x01vorbis' in header - if (_check(type, [0x01, 0x76, 0x6F, 0x72, 0x62, 0x69, 0x73])) { - return { - ext: 'ogg', - mime: 'audio/ogg' - }; - } - - // Default OGG container https://www.iana.org/assignments/media-types/application/ogg - return { - ext: 'ogx', - mime: 'application/ogg' - }; - } - - if ( - check([0x50, 0x4B]) && - (buffer[2] === 0x3 || buffer[2] === 0x5 || buffer[2] === 0x7) && - (buffer[3] === 0x4 || buffer[3] === 0x6 || buffer[3] === 0x8) - ) { - return { - ext: 'zip', - mime: 'application/zip' - }; - } - - // - - // File Type Box (https://en.wikipedia.org/wiki/ISO_base_media_file_format) - // It's not required to be first, but it's recommended to be. Almost all ISO base media files start with `ftyp` box. - // `ftyp` box must contain a brand major identifier, which must consist of ISO 8859-1 printable characters. - // Here we check for 8859-1 printable characters (for simplicity, it's a mask which also catches one non-printable character). - if ( - checkString('ftyp', {offset: 4}) && - (buffer[8] & 0x60) !== 0x00 // Brand major, first character ASCII? - ) { - // They all can have MIME `video/mp4` except `application/mp4` special-case which is hard to detect. - // For some cases, we're specific, everything else falls to `video/mp4` with `mp4` extension. - const brandMajor = buffer.toString('binary', 8, 12).replace('\0', ' ').trim(); - switch (brandMajor) { - case 'avif': - return {ext: 'avif', mime: 'image/avif'}; - case 'mif1': - return {ext: 'heic', mime: 'image/heif'}; - case 'msf1': - return {ext: 'heic', mime: 'image/heif-sequence'}; - case 'heic': - case 'heix': - return {ext: 'heic', mime: 'image/heic'}; - case 'hevc': - case 'hevx': - return {ext: 'heic', mime: 'image/heic-sequence'}; - case 'qt': - return {ext: 'mov', mime: 'video/quicktime'}; - case 'M4V': - case 'M4VH': - case 'M4VP': - return {ext: 'm4v', mime: 'video/x-m4v'}; - case 'M4P': - return {ext: 'm4p', mime: 'video/mp4'}; - case 'M4B': - return {ext: 'm4b', mime: 'audio/mp4'}; - case 'M4A': - return {ext: 'm4a', mime: 'audio/x-m4a'}; - case 'F4V': - return {ext: 'f4v', mime: 'video/mp4'}; - case 'F4P': - return {ext: 'f4p', mime: 'video/mp4'}; - case 'F4A': - return {ext: 'f4a', mime: 'audio/mp4'}; - case 'F4B': - return {ext: 'f4b', mime: 'audio/mp4'}; - case 'crx': - return {ext: 'cr3', mime: 'image/x-canon-cr3'}; - default: - if (brandMajor.startsWith('3g')) { - if (brandMajor.startsWith('3g2')) { - return {ext: '3g2', mime: 'video/3gpp2'}; - } - - return {ext: '3gp', mime: 'video/3gpp'}; - } - - return {ext: 'mp4', mime: 'video/mp4'}; - } - } - - if (checkString('MThd')) { - return { - ext: 'mid', - mime: 'audio/midi' - }; - } - - if ( - checkString('wOFF') && - ( - check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || - checkString('OTTO', {offset: 4}) - ) - ) { - return { - ext: 'woff', - mime: 'font/woff' - }; - } - - if ( - checkString('wOF2') && - ( - check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || - checkString('OTTO', {offset: 4}) - ) - ) { - return { - ext: 'woff2', - mime: 'font/woff2' - }; - } - - if (check([0xD4, 0xC3, 0xB2, 0xA1]) || check([0xA1, 0xB2, 0xC3, 0xD4])) { - return { - ext: 'pcap', - mime: 'application/vnd.tcpdump.pcap' - }; - } - - // Sony DSD Stream File (DSF) - if (checkString('DSD ')) { - return { - ext: 'dsf', - mime: 'audio/x-dsf' // Non-standard - }; - } - - if (checkString('LZIP')) { - return { - ext: 'lz', - mime: 'application/x-lzip' - }; - } - - if (checkString('fLaC')) { - return { - ext: 'flac', - mime: 'audio/x-flac' - }; - } - - if (check([0x42, 0x50, 0x47, 0xFB])) { - return { - ext: 'bpg', - mime: 'image/bpg' - }; - } - - if (checkString('wvpk')) { - return { - ext: 'wv', - mime: 'audio/wavpack' - }; - } - - if (checkString('%PDF')) { - await tokenizer.ignore(1350); - const maxBufferSize = 10 * 1024 * 1024; - const buffer = Buffer.alloc(Math.min(maxBufferSize, tokenizer.fileInfo.size)); - await tokenizer.readBuffer(buffer, {mayBeLess: true}); - - // Check if this is an Adobe Illustrator file - if (buffer.includes(Buffer.from('AIPrivateData'))) { - return { - ext: 'ai', - mime: 'application/postscript' - }; - } - - // Assume this is just a normal PDF - return { - ext: 'pdf', - mime: 'application/pdf' - }; - } - - if (check([0x00, 0x61, 0x73, 0x6D])) { - return { - ext: 'wasm', - mime: 'application/wasm' - }; - } - - // TIFF, little-endian type - if (check([0x49, 0x49, 0x2A, 0x0])) { - if (checkString('CR', {offset: 8})) { - return { - ext: 'cr2', - mime: 'image/x-canon-cr2' - }; - } - - if (check([0x1C, 0x00, 0xFE, 0x00], {offset: 8}) || check([0x1F, 0x00, 0x0B, 0x00], {offset: 8})) { - return { - ext: 'nef', - mime: 'image/x-nikon-nef' - }; - } - - if ( - check([0x08, 0x00, 0x00, 0x00], {offset: 4}) && - (check([0x2D, 0x00, 0xFE, 0x00], {offset: 8}) || - check([0x27, 0x00, 0xFE, 0x00], {offset: 8})) - ) { - return { - ext: 'dng', - mime: 'image/x-adobe-dng' - }; - } - - buffer = Buffer.alloc(24); - await tokenizer.peekBuffer(buffer); - if ( - (check([0x10, 0xFB, 0x86, 0x01], {offset: 4}) || check([0x08, 0x00, 0x00, 0x00], {offset: 4})) && - // This pattern differentiates ARW from other TIFF-ish file types: - check([0x00, 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x01], {offset: 9}) - ) { - return { - ext: 'arw', - mime: 'image/x-sony-arw' - }; - } - - return { - ext: 'tif', - mime: 'image/tiff' - }; - } - - // TIFF, big-endian type - if (check([0x4D, 0x4D, 0x0, 0x2A])) { - return { - ext: 'tif', - mime: 'image/tiff' - }; - } - - if (checkString('MAC ')) { - return { - ext: 'ape', - mime: 'audio/ape' - }; - } - - // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska - if (check([0x1A, 0x45, 0xDF, 0xA3])) { // Root element: EBML - async function readField() { - const msb = await tokenizer.peekNumber(Token.UINT8); - let mask = 0x80; - let ic = 0; // 0 = A, 1 = B, 2 = C, 3 = D - - while ((msb & mask) === 0 && mask !== 0) { - ++ic; - mask >>= 1; - } - - const id = Buffer.alloc(ic + 1); - await tokenizer.readBuffer(id); - return id; - } - - async function readElement() { - const id = await readField(); - const lenField = await readField(); - lenField[0] ^= 0x80 >> (lenField.length - 1); - const nrLen = Math.min(6, lenField.length); // JavaScript can max read 6 bytes integer - return { - id: id.readUIntBE(0, id.length), - len: lenField.readUIntBE(lenField.length - nrLen, nrLen) - }; - } - - async function readChildren(level, children) { - while (children > 0) { - const e = await readElement(); - if (e.id === 0x4282) { - return tokenizer.readToken(new Token.StringType(e.len, 'utf-8')); // Return DocType - } - - await tokenizer.ignore(e.len); // ignore payload - --children; - } - } - - const re = await readElement(); - const docType = await readChildren(1, re.len); - - switch (docType) { - case 'webm': - return { - ext: 'webm', - mime: 'video/webm' - }; - - case 'matroska': - return { - ext: 'mkv', - mime: 'video/x-matroska' - }; - - default: - return; - } - } - - // RIFF file format which might be AVI, WAV, QCP, etc - if (check([0x52, 0x49, 0x46, 0x46])) { - if (check([0x41, 0x56, 0x49], {offset: 8})) { - return { - ext: 'avi', - mime: 'video/vnd.avi' - }; - } - - if (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) { - return { - ext: 'wav', - mime: 'audio/vnd.wave' - }; - } - - // QLCM, QCP file - if (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) { - return { - ext: 'qcp', - mime: 'audio/qcelp' - }; - } - } - - if (checkString('SQLi')) { - return { - ext: 'sqlite', - mime: 'application/x-sqlite3' - }; - } - - if (check([0x4E, 0x45, 0x53, 0x1A])) { - return { - ext: 'nes', - mime: 'application/x-nintendo-nes-rom' - }; - } - - if (checkString('Cr24')) { - return { - ext: 'crx', - mime: 'application/x-google-chrome-extension' - }; - } - - if ( - checkString('MSCF') || - checkString('ISc(') - ) { - return { - ext: 'cab', - mime: 'application/vnd.ms-cab-compressed' - }; - } - - if (check([0xED, 0xAB, 0xEE, 0xDB])) { - return { - ext: 'rpm', - mime: 'application/x-rpm' - }; - } - - if (check([0xC5, 0xD0, 0xD3, 0xC6])) { - return { - ext: 'eps', - mime: 'application/eps' - }; - } - - if (check([0x28, 0xB5, 0x2F, 0xFD])) { - return { - ext: 'zst', - mime: 'application/zstd' - }; - } - - // -- 5-byte signatures -- - - if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { - return { - ext: 'otf', - mime: 'font/otf' - }; - } - - if (checkString('#!AMR')) { - return { - ext: 'amr', - mime: 'audio/amr' - }; - } - - if (checkString('{\\rtf')) { - return { - ext: 'rtf', - mime: 'application/rtf' - }; - } - - if (check([0x46, 0x4C, 0x56, 0x01])) { - return { - ext: 'flv', - mime: 'video/x-flv' - }; - } - - if (checkString('IMPM')) { - return { - ext: 'it', - mime: 'audio/x-it' - }; - } - - if ( - checkString('-lh0-', {offset: 2}) || - checkString('-lh1-', {offset: 2}) || - checkString('-lh2-', {offset: 2}) || - checkString('-lh3-', {offset: 2}) || - checkString('-lh4-', {offset: 2}) || - checkString('-lh5-', {offset: 2}) || - checkString('-lh6-', {offset: 2}) || - checkString('-lh7-', {offset: 2}) || - checkString('-lzs-', {offset: 2}) || - checkString('-lz4-', {offset: 2}) || - checkString('-lz5-', {offset: 2}) || - checkString('-lhd-', {offset: 2}) - ) { - return { - ext: 'lzh', - mime: 'application/x-lzh-compressed' - }; - } - - // MPEG program stream (PS or MPEG-PS) - if (check([0x00, 0x00, 0x01, 0xBA])) { - // MPEG-PS, MPEG-1 Part 1 - if (check([0x21], {offset: 4, mask: [0xF1]})) { - return { - ext: 'mpg', // May also be .ps, .mpeg - mime: 'video/MP1S' - }; - } - - // MPEG-PS, MPEG-2 Part 1 - if (check([0x44], {offset: 4, mask: [0xC4]})) { - return { - ext: 'mpg', // May also be .mpg, .m2p, .vob or .sub - mime: 'video/MP2P' - }; - } - } - - if (checkString('ITSF')) { - return { - ext: 'chm', - mime: 'application/vnd.ms-htmlhelp' - }; - } - - // -- 6-byte signatures -- - - if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) { - return { - ext: 'xz', - mime: 'application/x-xz' - }; - } - - if (checkString('')) { - await tokenizer.ignore(8); - const str = await tokenizer.readToken(new Token.StringType(13, 'ascii')); - if (str === 'debian-binary') { - return { - ext: 'deb', - mime: 'application/x-deb' - }; - } - - return { - ext: 'ar', - mime: 'application/x-unix-archive' - }; - } - - // -- 8-byte signatures -- - - if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) { - // APNG format (https://wiki.mozilla.org/APNG_Specification) - // 1. Find the first IDAT (image data) chunk (49 44 41 54) - // 2. Check if there is an "acTL" chunk before the IDAT one (61 63 54 4C) - - // Offset calculated as follows: - // - 8 bytes: PNG signature - // - 4 (length) + 4 (chunk type) + 13 (chunk data) + 4 (CRC): IHDR chunk - - await tokenizer.ignore(8); // ignore PNG signature - - async function readChunkHeader() { - return { - length: await tokenizer.readToken(Token.INT32_BE), - type: await tokenizer.readToken(new Token.StringType(4, 'binary')) - }; - } - - do { - const chunk = await readChunkHeader(); - if (chunk.length < 0) { - return; // Invalid chunk length - } - - switch (chunk.type) { - case 'IDAT': - return { - ext: 'png', - mime: 'image/png' - }; - case 'acTL': - return { - ext: 'apng', - mime: 'image/apng' - }; - default: - await tokenizer.ignore(chunk.length + 4); // Ignore chunk-data + CRC - } - } while (tokenizer.position + 8 < tokenizer.fileInfo.size); - - return { - ext: 'png', - mime: 'image/png' - }; - } - - if (check([0x41, 0x52, 0x52, 0x4F, 0x57, 0x31, 0x00, 0x00])) { - return { - ext: 'arrow', - mime: 'application/x-apache-arrow' - }; - } - - if (check([0x67, 0x6C, 0x54, 0x46, 0x02, 0x00, 0x00, 0x00])) { - return { - ext: 'glb', - mime: 'model/gltf-binary' - }; - } - - // `mov` format variants - if ( - check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // `free` - check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // `mdat` MJPEG - check([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // `moov` - check([0x77, 0x69, 0x64, 0x65], {offset: 4}) // `wide` - ) { - return { - ext: 'mov', - mime: 'video/quicktime' - }; - } - - // -- 9-byte signatures -- - - if (check([0x49, 0x49, 0x52, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x18])) { - return { - ext: 'orf', - mime: 'image/x-olympus-orf' - }; - } - - if (checkString('gimp xcf ')) { - return { - ext: 'xcf', - mime: 'image/x-xcf' - }; - } - - // -- 12-byte signatures -- - - if (check([0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8])) { - return { - ext: 'rw2', - mime: 'image/x-panasonic-rw2' - }; - } - - // ASF_Header_Object first 80 bytes - if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) { - async function readHeader() { - const guid = Buffer.alloc(16); - await tokenizer.readBuffer(guid); - return { - id: guid, - size: Number(await tokenizer.readToken(Token.UINT64_LE)) - }; - } - - await tokenizer.ignore(30); - // Search for header should be in first 1KB of file. - while (tokenizer.position + 24 < tokenizer.fileInfo.size) { - const header = await readHeader(); - let payload = header.size - 24; - if (_check(header.id, [0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65])) { - // Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365) - const typeId = Buffer.alloc(16); - payload -= await tokenizer.readBuffer(typeId); - - if (_check(typeId, [0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B])) { - // Found audio: - return { - ext: 'asf', - mime: 'audio/x-ms-asf' - }; - } - - if (_check(typeId, [0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B])) { - // Found video: - return { - ext: 'asf', - mime: 'video/x-ms-asf' - }; - } - - break; - } - - await tokenizer.ignore(payload); - } - - // Default to ASF generic extension - return { - ext: 'asf', - mime: 'application/vnd.ms-asf' - }; - } - - if (check([0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A])) { - return { - ext: 'ktx', - mime: 'image/ktx' - }; - } - - if ((check([0x7E, 0x10, 0x04]) || check([0x7E, 0x18, 0x04])) && check([0x30, 0x4D, 0x49, 0x45], {offset: 4})) { - return { - ext: 'mie', - mime: 'application/x-mie' - }; - } - - if (check([0x27, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], {offset: 2})) { - return { - ext: 'shp', - mime: 'application/x-esri-shape' - }; - } - - if (check([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])) { - // JPEG-2000 family - - await tokenizer.ignore(20); - const type = await tokenizer.readToken(new Token.StringType(4, 'ascii')); - switch (type) { - case 'jp2 ': - return { - ext: 'jp2', - mime: 'image/jp2' - }; - case 'jpx ': - return { - ext: 'jpx', - mime: 'image/jpx' - }; - case 'jpm ': - return { - ext: 'jpm', - mime: 'image/jpm' - }; - case 'mjp2': - return { - ext: 'mj2', - mime: 'image/mj2' - }; - default: - return; - } - } - - if ( - check([0xFF, 0x0A]) || - check([0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x4C, 0x20, 0x0D, 0x0A, 0x87, 0x0A]) - ) { - return { - ext: 'jxl', - mime: 'image/jxl' - }; - } - - // -- Unsafe signatures -- - - if ( - check([0x0, 0x0, 0x1, 0xBA]) || - check([0x0, 0x0, 0x1, 0xB3]) - ) { - return { - ext: 'mpg', - mime: 'video/mpeg' - }; - } - - if (check([0x00, 0x01, 0x00, 0x00, 0x00])) { - return { - ext: 'ttf', - mime: 'font/ttf' - }; - } - - if (check([0x00, 0x00, 0x01, 0x00])) { - return { - ext: 'ico', - mime: 'image/x-icon' - }; - } - - if (check([0x00, 0x00, 0x02, 0x00])) { - return { - ext: 'cur', - mime: 'image/x-icon' - }; - } - - if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) { - // Detected Microsoft Compound File Binary File (MS-CFB) Format. - return { - ext: 'cfb', - mime: 'application/x-cfb' - }; - } - - // Increase sample size from 12 to 256. - await tokenizer.peekBuffer(buffer, {length: Math.min(256, tokenizer.fileInfo.size), mayBeLess: true}); - - // -- 15-byte signatures -- - - if (checkString('BEGIN:')) { - if (checkString('VCARD', {offset: 6})) { - return { - ext: 'vcf', - mime: 'text/vcard' - }; - } - - if (checkString('VCALENDAR', {offset: 6})) { - return { - ext: 'ics', - mime: 'text/calendar' - }; - } - } - - // `raf` is here just to keep all the raw image detectors together. - if (checkString('FUJIFILMCCD-RAW')) { - return { - ext: 'raf', - mime: 'image/x-fujifilm-raf' - }; - } - - if (checkString('Extended Module:')) { - return { - ext: 'xm', - mime: 'audio/x-xm' - }; - } - - if (checkString('Creative Voice File')) { - return { - ext: 'voc', - mime: 'audio/x-voc' - }; - } - - if (check([0x04, 0x00, 0x00, 0x00]) && buffer.length >= 16) { // Rough & quick check Pickle/ASAR - const jsonSize = buffer.readUInt32LE(12); - if (jsonSize > 12 && buffer.length >= jsonSize + 16) { - try { - const header = buffer.slice(16, jsonSize + 16).toString(); - const json = JSON.parse(header); - // Check if Pickle is ASAR - if (json.files) { // Final check, assuring Pickle/ASAR format - return { - ext: 'asar', - mime: 'application/x-asar' - }; - } - } catch (_) { - } - } - } - - if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) { - return { - ext: 'mxf', - mime: 'application/mxf' - }; - } - - if (checkString('SCRM', {offset: 44})) { - return { - ext: 's3m', - mime: 'audio/x-s3m' - }; - } - - if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) { - return { - ext: 'mts', - mime: 'video/mp2t' - }; - } - - if (check([0x42, 0x4F, 0x4F, 0x4B, 0x4D, 0x4F, 0x42, 0x49], {offset: 60})) { - return { - ext: 'mobi', - mime: 'application/x-mobipocket-ebook' - }; - } - - if (check([0x44, 0x49, 0x43, 0x4D], {offset: 128})) { - return { - ext: 'dcm', - mime: 'application/dicom' - }; - } - - if (check([0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46])) { - return { - ext: 'lnk', - mime: 'application/x.ms.shortcut' // Invented by us - }; - } - - if (check([0x62, 0x6F, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x00])) { - return { - ext: 'alias', - mime: 'application/x.apple.alias' // Invented by us - }; - } - - if ( - check([0x4C, 0x50], {offset: 34}) && - ( - check([0x00, 0x00, 0x01], {offset: 8}) || - check([0x01, 0x00, 0x02], {offset: 8}) || - check([0x02, 0x00, 0x02], {offset: 8}) - ) - ) { - return { - ext: 'eot', - mime: 'application/vnd.ms-fontobject' - }; - } - - if (check([0x06, 0x06, 0xED, 0xF5, 0xD8, 0x1D, 0x46, 0xE5, 0xBD, 0x31, 0xEF, 0xE7, 0xFE, 0x74, 0xB7, 0x1D])) { - return { - ext: 'indd', - mime: 'application/x-indesign' - }; - } - - // Increase sample size from 256 to 512 - await tokenizer.peekBuffer(buffer, {length: Math.min(512, tokenizer.fileInfo.size), mayBeLess: true}); - - // Requires a buffer size of 512 bytes - if (tarHeaderChecksumMatches(buffer)) { - return { - ext: 'tar', - mime: 'application/x-tar' - }; - } - - if (check([0xFF, 0xFE, 0xFF, 0x0E, 0x53, 0x00, 0x6B, 0x00, 0x65, 0x00, 0x74, 0x00, 0x63, 0x00, 0x68, 0x00, 0x55, 0x00, 0x70, 0x00, 0x20, 0x00, 0x4D, 0x00, 0x6F, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6C, 0x00])) { - return { - ext: 'skp', - mime: 'application/vnd.sketchup.skp' - }; - } - - if (checkString('-----BEGIN PGP MESSAGE-----')) { - return { - ext: 'pgp', - mime: 'application/pgp-encrypted' - }; - } - - // Check MPEG 1 or 2 Layer 3 header, or 'layer 0' for ADTS (MPEG sync-word 0xFFE) - if (buffer.length >= 2 && check([0xFF, 0xE0], {offset: 0, mask: [0xFF, 0xE0]})) { - if (check([0x10], {offset: 1, mask: [0x16]})) { - // Check for (ADTS) MPEG-2 - if (check([0x08], {offset: 1, mask: [0x08]})) { - return { - ext: 'aac', - mime: 'audio/aac' - }; - } - - // Must be (ADTS) MPEG-4 - return { - ext: 'aac', - mime: 'audio/aac' - }; - } - - // MPEG 1 or 2 Layer 3 header - // Check for MPEG layer 3 - if (check([0x02], {offset: 1, mask: [0x06]})) { - return { - ext: 'mp3', - mime: 'audio/mpeg' - }; - } - - // Check for MPEG layer 2 - if (check([0x04], {offset: 1, mask: [0x06]})) { - return { - ext: 'mp2', - mime: 'audio/mpeg' - }; - } - - // Check for MPEG layer 1 - if (check([0x06], {offset: 1, mask: [0x06]})) { - return { - ext: 'mp1', - mime: 'audio/mpeg' - }; - } - } -} - -const stream = readableStream => new Promise((resolve, reject) => { - // Using `eval` to work around issues when bundling with Webpack - const stream = eval('require')('stream'); // eslint-disable-line no-eval - - readableStream.on('error', reject); - readableStream.once('readable', async () => { - // Set up output stream - const pass = new stream.PassThrough(); - let outputStream; - if (stream.pipeline) { - outputStream = stream.pipeline(readableStream, pass, () => { - }); - } else { - outputStream = readableStream.pipe(pass); - } - - // Read the input stream and detect the filetype - const chunk = readableStream.read(minimumBytes) || readableStream.read() || Buffer.alloc(0); - try { - const fileType = await fromBuffer(chunk); - pass.fileType = fileType; - } catch (error) { - reject(error); - } - - resolve(outputStream); - }); -}); - -const fileType$1 = { - fromStream, - fromTokenizer, - fromBuffer, - stream -}; - -Object.defineProperty(fileType$1, 'extensions', { - get() { - return new Set(supported.extensions); - } -}); - -Object.defineProperty(fileType$1, 'mimeTypes', { - get() { - return new Set(supported.mimeTypes); - } -}); - -var core$2 = fileType$1; - -const strtok3 = lib$3; -const core$1 = core$2; - -async function fromFile(path) { - const tokenizer = await strtok3.fromFile(path); - try { - return await core$1.fromTokenizer(tokenizer); - } finally { - await tokenizer.close(); - } -} - -const fileType = { - fromFile -}; - -Object.assign(fileType, core$1); - -Object.defineProperty(fileType, 'extensions', { - get() { - return core$1.extensions; - } -}); - -Object.defineProperty(fileType, 'mimeTypes', { - get() { - return core$1.mimeTypes; - } -}); - -var fileType_1 = fileType; - -var isSvg$2 = {exports: {}}; - -var validator$2 = {}; - -var util$3 = {}; - -(function (exports) { - - const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; - const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; - const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'; - const regexName = new RegExp('^' + nameRegexp + '$'); - - const getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - - const isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === 'undefined'); - }; - - exports.isExist = function(v) { - return typeof v !== 'undefined'; - }; - - exports.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - - /** - * Copy all the properties of a into b. - * @param {*} target - * @param {*} a - */ - exports.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); // will return an array of own properties - const len = keys.length; //don't make it inline - for (let i = 0; i < len; i++) { - if (arrayMode === 'strict') { - target[keys[i]] = [ a[keys[i]] ]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } - }; - /* exports.merge =function (b,a){ - return Object.assign(b,a); - } */ - - exports.getValue = function(v) { - if (exports.isExist(v)) { - return v; - } else { - return ''; - } - }; - - // const fakeCall = function(a) {return a;}; - // const fakeCallNoReturn = function() {}; - - exports.isName = isName; - exports.getAllMatches = getAllMatches; - exports.nameRegexp = nameRegexp; -} (util$3)); - -const util$2 = util$3; - -const defaultOptions$2 = { - allowBooleanAttributes: false, //A tag can have attributes without any value - unpairedTags: [] -}; - -//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); -validator$2.validate = function (xmlData, options) { - options = Object.assign({}, defaultOptions$2, options); - - //xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line - //xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag - //xmlData = xmlData.replace(/()/g,"");//Remove DOCTYPE - const tags = []; - let tagFound = false; - - //indicates that the root tag has been closed (aka. depth 0 has been reached) - let reachedRoot = false; - - if (xmlData[0] === '\ufeff') { - // check for byte order mark (BOM) - xmlData = xmlData.substr(1); - } - - for (let i = 0; i < xmlData.length; i++) { - - if (xmlData[i] === '<' && xmlData[i+1] === '?') { - i+=2; - i = readPI(xmlData,i); - if (i.err) return i; - }else if (xmlData[i] === '<') { - //starting of tag - //read until you reach to '>' avoiding any '>' in attribute value - let tagStartPos = i; - i++; - - if (xmlData[i] === '!') { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === '/') { - //closing tag - closingTag = true; - i++; - } - //read tagname - let tagName = ''; - for (; i < xmlData.length && - xmlData[i] !== '>' && - xmlData[i] !== ' ' && - xmlData[i] !== '\t' && - xmlData[i] !== '\n' && - xmlData[i] !== '\r'; i++ - ) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - //console.log(tagName); - - if (tagName[tagName.length - 1] === '/') { - //self closing tag without attributes - tagName = tagName.substring(0, tagName.length - 1); - //continue; - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '"+tagName+"' is an invalid name."; - } - return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i)); - } - - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject('InvalidAttr', "Attributes for '"+tagName+"' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - - if (attrStr[attrStr.length - 1] === '/') { - //self closing tag - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - //continue; //text may presents after self closing tag - } else { - //the result from the nested function returns the position of the error within the attribute - //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute - //this gives us the absolute index in the entire xml, which we can use to find the line at last - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject('InvalidTag', - "Expected closing tag '"+otg.tagName+"' (opened in line "+openPos.line+", col "+openPos.col+") instead of closing tag '"+tagName+"'.", - getLineNumberForPosition(xmlData, tagStartPos)); - } - - //when there are no more tags, we reached the root level. - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - //the result from the nested function returns the position of the error within the attribute - //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute - //this gives us the absolute index in the entire xml, which we can use to find the line at last - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - - //if the root level has been reached before ... - if (reachedRoot === true) { - return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i)); - } else if(options.unpairedTags.indexOf(tagName) !== -1); else { - tags.push({tagName, tagStartPos}); - } - tagFound = true; - } - - //skip tag text value - //It may include comments and CDATA value - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - if (xmlData[i + 1] === '!') { - //comment or CADATA - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i+1] === '?') { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === '&') { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject('InvalidChar', "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - }else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject('InvalidXml', "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } //end of reading tag text value - if (xmlData[i] === '<') { - i--; - } - } - } else { - if ( isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject('InvalidChar', "char '"+xmlData[i]+"' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - - if (!tagFound) { - return getErrorObject('InvalidXml', 'Start tag expected.', 1); - }else if (tags.length == 1) { - return getErrorObject('InvalidTag', "Unclosed tag '"+tags[0].tagName+"'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - }else if (tags.length > 0) { - return getErrorObject('InvalidXml', "Invalid '"+ - JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\r?\n/g, '')+ - "' found.", {line: 1, col: 1}); - } - - return true; -}; - -function isWhiteSpace(char){ - return char === ' ' || char === '\t' || char === '\n' || char === '\r'; -} -/** - * Read Processing insstructions and skip - * @param {*} xmlData - * @param {*} i - */ -function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == '?' || xmlData[i] == ' ') { - //tagname - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === 'xml') { - return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') { - //check if valid attribut string - i++; - break; - } else { - continue; - } - } - } - return i; -} - -function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') { - //comment - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') { - i += 2; - break; - } - } - } else if ( - xmlData.length > i + 8 && - xmlData[i + 1] === 'D' && - xmlData[i + 2] === 'O' && - xmlData[i + 3] === 'C' && - xmlData[i + 4] === 'T' && - xmlData[i + 5] === 'Y' && - xmlData[i + 6] === 'P' && - xmlData[i + 7] === 'E' - ) { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - angleBracketsCount++; - } else if (xmlData[i] === '>') { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if ( - xmlData.length > i + 9 && - xmlData[i + 1] === '[' && - xmlData[i + 2] === 'C' && - xmlData[i + 3] === 'D' && - xmlData[i + 4] === 'A' && - xmlData[i + 5] === 'T' && - xmlData[i + 6] === 'A' && - xmlData[i + 7] === '[' - ) { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') { - i += 2; - break; - } - } - } - - return i; -} - -const doubleQuote = '"'; -const singleQuote = "'"; - -/** - * Keep reading xmlData until '<' is found outside the attribute value. - * @param {string} xmlData - * @param {number} i - */ -function readAttributeStr(xmlData, i) { - let attrStr = ''; - let startChar = ''; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === '') { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) ; else { - startChar = ''; - } - } else if (xmlData[i] === '>') { - if (startChar === '') { - tagClosed = true; - break; - } - } - attrStr += xmlData[i]; - } - if (startChar !== '') { - return false; - } - - return { - value: attrStr, - index: i, - tagClosed: tagClosed - }; -} - -/** - * Select all the attributes whether valid or invalid. - */ -const validAttrStrRegxp = new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?', 'g'); - -//attr, ="sd", a="amit's", a="sd"b="saf", ab cd="" - -function validateAttributeString(attrStr, options) { - //console.log("start:"+attrStr+":end"); - - //if(attrStr.trim().length === 0) return true; //empty string - - const matches = util$2.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - //nospace before attribute name: a="sd"b="saf" - return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' has no space in starting.", getPositionFromMatch(matches[i])) - } else if (matches[i][3] !== undefined && matches[i][4] === undefined) { - return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) { - //independent attribute: ab - return getErrorObject('InvalidAttr', "boolean attribute '"+matches[i][2]+"' is not allowed.", getPositionFromMatch(matches[i])); - } - /* else if(matches[i][6] === undefined){//attribute without value: ab= - return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}}; - } */ - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - //check for duplicate attribute. - attrNames[attrName] = 1; - } else { - return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is repeated.", getPositionFromMatch(matches[i])); - } - } - - return true; -} - -function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === 'x') { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ';') - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; -} - -function validateAmpersand(xmlData, i) { - // https://www.w3.org/TR/xml/#dt-charref - i++; - if (xmlData[i] === ';') - return -1; - if (xmlData[i] === '#') { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ';') - break; - return -1; - } - return i; -} - -function getErrorObject(code, message, lineNumber) { - return { - err: { - code: code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col, - }, - }; -} - -function validateAttrName(attrName) { - return util$2.isName(attrName); -} - -// const startsWithXML = /^xml/i; - -function validateTagName(tagname) { - return util$2.isName(tagname) /* && !tagname.match(startsWithXML) */; -} - -//this function returns the line number for the character at the given index -function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; -} - -//this function returns the position of the first character of match within attrStr -function getPositionFromMatch(match) { - return match.startIndex + match[1].length; -} - -var OptionsBuilder = {}; - -const defaultOptions$1 = { - preserveOrder: false, - attributeNamePrefix: '@_', - attributesGroupName: false, - textNodeName: '#text', - ignoreAttributes: true, - removeNSPrefix: false, // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val) { - return val; - }, - attributeValueProcessor: function(attrName, val) { - return val; - }, - stopNodes: [], //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs){ - return tagName - }, - // skipEmptyListItem: false -}; - -const buildOptions$1 = function(options) { - return Object.assign({}, defaultOptions$1, options); -}; - -OptionsBuilder.buildOptions = buildOptions$1; -OptionsBuilder.defaultOptions = defaultOptions$1; - -class XmlNode{ - constructor(tagname) { - this.tagname = tagname; - this.child = []; //nested tags, text, cdata, comments in order - this[":@"] = {}; //attributes map - } - add(key,val){ - // this.child.push( {name : key, val: val, isCdata: isCdata }); - if(key === "__proto__") key = "#__proto__"; - this.child.push( {[key]: val }); - } - addChild(node) { - if(node.tagname === "__proto__") node.tagname = "#__proto__"; - if(node[":@"] && Object.keys(node[":@"]).length > 0){ - this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] }); - }else { - this.child.push( { [node.tagname]: node.child }); - } - }; -} - -var xmlNode$1 = XmlNode; - -const util$1 = util$3; - -//TODO: handle comments -function readDocType$1(xmlData, i){ - - const entities = {}; - if( xmlData[i + 3] === 'O' && - xmlData[i + 4] === 'C' && - xmlData[i + 5] === 'T' && - xmlData[i + 6] === 'Y' && - xmlData[i + 7] === 'P' && - xmlData[i + 8] === 'E') - { - i = i+9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for(;i') { //Read tag content - if(comment){ - if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){ - comment = false; - angleBracketsCount--; - } - }else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - }else if( xmlData[i] === '['){ - hasBody = true; - }else { - exp += xmlData[i]; - } - } - if(angleBracketsCount !== 0){ - throw new Error(`Unclosed DOCTYPE`); - } - }else { - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return {entities, i}; -} - -function readEntityExp(xmlData,i){ - //External entities are not supported - // - - //Parameter entities are not supported - // - - //Internal entities are supported - // - - //read EntityName - let entityName = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) { - // if(xmlData[i] === " ") continue; - // else - entityName += xmlData[i]; - } - entityName = entityName.trim(); - if(entityName.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - - //read Entity Value - const startChar = xmlData[i++]; - let val = ""; - for (; i < xmlData.length && xmlData[i] !== startChar ; i++) { - val += xmlData[i]; - } - return [entityName, val, i]; -} - -function isComment(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === '-' && - xmlData[i+3] === '-') return true - return false -} -function isEntity(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'E' && - xmlData[i+3] === 'N' && - xmlData[i+4] === 'T' && - xmlData[i+5] === 'I' && - xmlData[i+6] === 'T' && - xmlData[i+7] === 'Y') return true - return false -} -function isElement(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'E' && - xmlData[i+3] === 'L' && - xmlData[i+4] === 'E' && - xmlData[i+5] === 'M' && - xmlData[i+6] === 'E' && - xmlData[i+7] === 'N' && - xmlData[i+8] === 'T') return true - return false -} - -function isAttlist(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'A' && - xmlData[i+3] === 'T' && - xmlData[i+4] === 'T' && - xmlData[i+5] === 'L' && - xmlData[i+6] === 'I' && - xmlData[i+7] === 'S' && - xmlData[i+8] === 'T') return true - return false -} -function isNotation(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'N' && - xmlData[i+3] === 'O' && - xmlData[i+4] === 'T' && - xmlData[i+5] === 'A' && - xmlData[i+6] === 'T' && - xmlData[i+7] === 'I' && - xmlData[i+8] === 'O' && - xmlData[i+9] === 'N') return true - return false -} - -function validateEntityName(name){ - if (util$1.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); -} - -var DocTypeReader = readDocType$1; - -const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; -const numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; -// const octRegex = /0x[a-z0-9]+/; -// const binRegex = /0x[a-z0-9]+/; - - -//polyfill -if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; -} -if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; -} - - -const consider = { - hex : true, - leadingZeros: true, - decimalPoint: "\.", - eNotation: true - //skipLike: /regex/ -}; - -function toNumber$1(str, options = {}){ - // const options = Object.assign({}, consider); - // if(opt.leadingZeros === false){ - // options.leadingZeros = false; - // }else if(opt.hex === false){ - // options.hex = false; - // } - - options = Object.assign({}, consider, options ); - if(!str || typeof str !== "string" ) return str; - - let trimmedStr = str.trim(); - // if(trimmedStr === "0.0") return 0; - // else if(trimmedStr === "+0.0") return 0; - // else if(trimmedStr === "-0.0") return -0; - - if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - // } else if (options.parseOct && octRegex.test(str)) { - // return Number.parseInt(val, 8); - // }else if (options.parseBin && binRegex.test(str)) { - // return Number.parseInt(val, 2); - }else { - //separate negative sign, leading zeros, and rest number - const match = numRegex.exec(trimmedStr); - if(match){ - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros - //trim ending zeros for floating number - - const eNotation = match[4] || match[6]; - if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; //-0123 - else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; //0123 - else {//no leading zeros or leading zeros are allowed - const num = Number(trimmedStr); - const numStr = "" + num; - if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation - if(options.eNotation) return num; - else return str; - }else if(eNotation){ //given number has enotation - if(options.eNotation) return num; - else return str; - }else if(trimmedStr.indexOf(".") !== -1){ //floating number - // const decimalPart = match[5].substr(1); - // const intPart = trimmedStr.substr(0,trimmedStr.indexOf(".")); - - - // const p = numStr.indexOf("."); - // const givenIntPart = numStr.substr(0,p); - // const givenDecPart = numStr.substr(p+1); - if(numStr === "0" && (numTrimmedByZeros === "") ) return num; //0.0 - else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000 - else if( sign && numStr === "-"+numTrimmedByZeros) return num; - else return str; - } - - if(leadingZeros){ - // if(numTrimmedByZeros === numStr){ - // if(options.leadingZeros) return num; - // else return str; - // }else return str; - if(numTrimmedByZeros === numStr) return num; - else if(sign+numTrimmedByZeros === numStr) return num; - else return str; - } - - if(trimmedStr === numStr) return num; - else if(trimmedStr === sign+numStr) return num; - // else{ - // //number with +/- sign - // trimmedStr.test(/[-+][0-9]); - - // } - return str; - } - // else if(!eNotation && trimmedStr && trimmedStr !== Number(trimmedStr) ) return str; - - }else { //non-numeric string - return str; - } - } -} - -/** - * - * @param {string} numStr without leading zeros - * @returns - */ -function trimZeros(numStr){ - if(numStr && numStr.indexOf(".") !== -1){//float - numStr = numStr.replace(/0+$/, ""); //remove ending zeros - if(numStr === ".") numStr = "0"; - else if(numStr[0] === ".") numStr = "0"+numStr; - else if(numStr[numStr.length-1] === ".") numStr = numStr.substr(0,numStr.length-1); - return numStr; - } - return numStr; -} -var strnum = toNumber$1; - -function getIgnoreAttributesFn$2(ignoreAttributes) { - if (typeof ignoreAttributes === 'function') { - return ignoreAttributes - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === 'string' && attrName === pattern) { - return true - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true - } - } - } - } - return () => false -} - -var ignoreAttributes = getIgnoreAttributesFn$2; - -///@ts-check - -const util = util$3; -const xmlNode = xmlNode$1; -const readDocType = DocTypeReader; -const toNumber = strnum; -const getIgnoreAttributesFn$1 = ignoreAttributes; - -// const regx = -// '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)' -// .replace(/NAME/g, util.nameRegexp); - -//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g"); -//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g"); - -class OrderedObjParser$1{ - constructor(options){ - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos" : { regex: /&(apos|#39|#x27);/g, val : "'"}, - "gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"}, - "lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"}, - "quot" : { regex: /&(quot|#34|#x22);/g, val : "\""}, - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"}; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent" : { regex: /&(cent|#162);/g, val: "¢" }, - "pound" : { regex: /&(pound|#163);/g, val: "£" }, - "yen" : { regex: /&(yen|#165);/g, val: "¥" }, - "euro" : { regex: /&(euro|#8364);/g, val: "€" }, - "copyright" : { regex: /&(copy|#169);/g, val: "©" }, - "reg" : { regex: /&(reg|#174);/g, val: "®" }, - "inr" : { regex: /&(inr|#8377);/g, val: "₹" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 16)) }, - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue$1; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn$1(this.options.ignoreAttributes); - } - -} - -function addExternalEntities(externalEntities){ - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&"+ent+";","g"), - val : externalEntities[ent] - }; - } -} - -/** - * @param {string} val - * @param {string} tagName - * @param {string} jPath - * @param {boolean} dontTrim - * @param {boolean} hasAttributes - * @param {boolean} isLeafNode - * @param {boolean} escapeEntities - */ -function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val !== undefined) { - if (this.options.trimValues && !dontTrim) { - val = val.trim(); - } - if(val.length > 0){ - if(!escapeEntities) val = this.replaceEntitiesValue(val); - - const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode); - if(newval === null || newval === undefined){ - //don't parse - return val; - }else if(typeof newval !== typeof val || newval !== val){ - //overwrite - return newval; - }else if(this.options.trimValues){ - return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); - }else { - const trimmedVal = val.trim(); - if(trimmedVal === val){ - return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); - }else { - return val; - } - } - } - } -} - -function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(':'); - const prefix = tagname.charAt(0) === '/' ? '/' : ''; - if (tags[0] === 'xmlns') { - return ''; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; -} - -//TODO: change regex to capture NS -//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm"); -const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm'); - -function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === 'string') { - // attrStr = attrStr.replace(/\r?\n/g, ' '); - //attrStr = attrStr || attrStr.trim(); - - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; //don't make it inline - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if(aName === "__proto__") aName = "#__proto__"; - if (oldVal !== undefined) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if(newVal === null || newVal === undefined){ - //don't parse - attrs[aName] = oldVal; - }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){ - //overwrite - attrs[aName] = newVal; - }else { - //parse - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs - } -} - -const parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line - const xmlObj = new xmlNode('!xml'); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for(let i=0; i< xmlData.length; i++){//for each char in XML data - const ch = xmlData[i]; - if(ch === '<'){ - // const nextIndex = i+1; - // const _2ndChar = xmlData[nextIndex]; - if( xmlData[i+1] === '/') {//Closing Tag - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i+2,closeIndex).trim(); - - if(this.options.removeNSPrefix){ - const colonIndex = tagName.indexOf(":"); - if(colonIndex !== -1){ - tagName = tagName.substr(colonIndex+1); - } - } - - if(this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - - if(currentNode){ - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - - //check if last tag of nested tag was unpaired tag - const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1); - if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){ - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){ - propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1); - this.tagsNodeStack.pop(); - }else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - - currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope - textData = ""; - i = closeIndex; - } else if( xmlData[i+1] === '?') { - - let tagData = readTagExp(xmlData,i, false, "?>"); - if(!tagData) throw new Error("Pi Tag is not closed."); - - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags);else { - - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - - if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - - } - - - i = tagData.closeIndex + 1; - } else if(xmlData.substr(i + 1, 3) === '!--') { - const endIndex = findClosingIndex(xmlData, "-->", i+4, "Comment is not closed."); - if(this.options.commentPropName){ - const comment = xmlData.substring(i + 4, endIndex - 2); - - textData = this.saveTextToParentTag(textData, currentNode, jPath); - - currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]); - } - i = endIndex; - } else if( xmlData.substr(i + 1, 2) === '!D') { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - }else if(xmlData.substr(i + 1, 2) === '![') { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9,closeIndex); - - textData = this.saveTextToParentTag(textData, currentNode, jPath); - - let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if(val == undefined) val = ""; - - //cdata should be set even if it is 0 length string - if(this.options.cdataPropName){ - currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]); - }else { - currentNode.add(this.options.textNodeName, val); - } - - i = closeIndex + 2; - }else {//Opening tag - let result = readTagExp(xmlData,i, this.options.removeNSPrefix); - let tagName= result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - - //save text as child node - if (currentNode && textData) { - if(currentNode.tagname !== '!xml'){ - //when nested tag is found - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - - //check if last tag was unpaired tag - const lastTag = currentNode; - if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){ - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if(tagName !== xmlObj.tagname){ - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - //self-closing tag - if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ - if(tagName[tagName.length - 1] === "/"){ //remove trailing '/' - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - }else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } - //unpaired tag - else if(this.options.unpairedTags.indexOf(tagName) !== -1){ - - i = result.closeIndex; - } - //normal tag - else { - //read until closing tag is found - const result = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if(!result) throw new Error(`Unexpected end of ${rawTagName}`); - i = result.i; - tagContent = result.tagContent; - } - - const childNode = new xmlNode(tagName); - if(tagName !== tagExp && attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if(tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - - this.addChild(currentNode, childNode, jPath); - }else { - //selfClosing tag - if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ - if(tagName[tagName.length - 1] === "/"){ //remove trailing '/' - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - }else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - - if(this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - - const childNode = new xmlNode(tagName); - if(tagName !== tagExp && attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } - //opening tag - else { - const childNode = new xmlNode( tagName); - this.tagsNodeStack.push(currentNode); - - if(tagName !== tagExp && attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - }else { - textData += xmlData[i]; - } - } - return xmlObj.child; -}; - -function addChild(currentNode, childNode, jPath){ - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if(result === false);else if(typeof result === "string"){ - childNode.tagname = result; - currentNode.addChild(childNode); - }else { - currentNode.addChild(childNode); - } -} - -const replaceEntitiesValue$1 = function(val){ - - if(this.options.processEntities){ - for(let entityName in this.docTypeEntities){ - const entity = this.docTypeEntities[entityName]; - val = val.replace( entity.regx, entity.val); - } - for(let entityName in this.lastEntities){ - const entity = this.lastEntities[entityName]; - val = val.replace( entity.regex, entity.val); - } - if(this.options.htmlEntities){ - for(let entityName in this.htmlEntities){ - const entity = this.htmlEntities[entityName]; - val = val.replace( entity.regex, entity.val); - } - } - val = val.replace( this.ampEntity.regex, this.ampEntity.val); - } - return val; -}; -function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { //store previously collected data as textNode - if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0; - - textData = this.parseTextData(textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode); - - if (textData !== undefined && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; -} - -//TODO: use jPath to simplify the logic -/** - * - * @param {string[]} stopNodes - * @param {string} jPath - * @param {string} currentTagName - */ -function isItStopNode(stopNodes, jPath, currentTagName){ - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true; - } - return false; -} - -/** - * Returns the tag Expression and where it is ending handling single-double quotes situation - * @param {string} xmlData - * @param {number} i starting index - * @returns - */ -function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){ - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = "";//reset - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if(closingChar[1]){ - if(xmlData[index + 1] === closingChar[1]){ - return { - data: tagExp, - index: index - } - } - }else { - return { - data: tagExp, - index: index - } - } - } else if (ch === '\t') { - ch = " "; - } - tagExp += ch; - } -} - -function findClosingIndex(xmlData, str, i, errMsg){ - const closingIndex = xmlData.indexOf(str, i); - if(closingIndex === -1){ - throw new Error(errMsg) - }else { - return closingIndex + str.length - 1; - } -} - -function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){ - const result = tagExpWithClosingIndex(xmlData, i+1, closingChar); - if(!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if(separatorIndex !== -1){//separate tag name and attributes expression - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - - const rawTagName = tagName; - if(removeNSPrefix){ - const colonIndex = tagName.indexOf(":"); - if(colonIndex !== -1){ - tagName = tagName.substr(colonIndex+1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } - - return { - tagName: tagName, - tagExp: tagExp, - closeIndex: closeIndex, - attrExpPresent: attrExpPresent, - rawTagName: rawTagName, - } -} -/** - * find paired tag for a stop node - * @param {string} xmlData - * @param {string} tagName - * @param {number} i - */ -function readStopNodeData(xmlData, tagName, i){ - const startIndex = i; - // Starting at 1 since we already have an open tag - let openTagCount = 1; - - for (; i < xmlData.length; i++) { - if( xmlData[i] === "<"){ - if (xmlData[i+1] === "/") {//close tag - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i+2,closeIndex).trim(); - if(closeTagName === tagName){ - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i : closeIndex - } - } - } - i=closeIndex; - } else if(xmlData[i+1] === '?') { - const closeIndex = findClosingIndex(xmlData, "?>", i+1, "StopNode is not closed."); - i=closeIndex; - } else if(xmlData.substr(i + 1, 3) === '!--') { - const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed."); - i=closeIndex; - } else if(xmlData.substr(i + 1, 2) === '![') { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i=closeIndex; - } else { - const tagData = readTagExp(xmlData, i, '>'); - - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") { - openTagCount++; - } - i=tagData.closeIndex; - } - } - } - }//end for loop -} - -function parseValue(val, shouldParse, options) { - if (shouldParse && typeof val === 'string') { - //console.log(options) - const newval = val.trim(); - if(newval === 'true' ) return true; - else if(newval === 'false' ) return false; - else return toNumber(val, options); - } else { - if (util.isExist(val)) { - return val; - } else { - return ''; - } - } -} - - -var OrderedObjParser_1 = OrderedObjParser$1; - -var node2json = {}; - -/** - * - * @param {array} node - * @param {any} options - * @returns - */ -function prettify$1(node, options){ - return compress( node, options); -} - -/** - * - * @param {array} arr - * @param {object} options - * @param {string} jPath - * @returns object - */ -function compress(arr, options, jPath){ - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName$1(tagObj); - let newJpath = ""; - if(jPath === undefined) newJpath = property; - else newJpath = jPath + "." + property; - - if(property === options.textNodeName){ - if(text === undefined) text = tagObj[property]; - else text += "" + tagObj[property]; - }else if(property === undefined){ - continue; - }else if(tagObj[property]){ - - let val = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val, options); - - if(tagObj[":@"]){ - assignAttributes( val, tagObj[":@"], newJpath, options); - }else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){ - val = val[options.textNodeName]; - }else if(Object.keys(val).length === 0){ - if(options.alwaysCreateTextNode) val[options.textNodeName] = ""; - else val = ""; - } - - if(compressedObj[property] !== undefined && compressedObj.hasOwnProperty(property)) { - if(!Array.isArray(compressedObj[property])) { - compressedObj[property] = [ compressedObj[property] ]; - } - compressedObj[property].push(val); - }else { - //TODO: if a node is not an array, then check if it should be an array - //also determine if it is a leaf node - if (options.isArray(property, newJpath, isLeaf )) { - compressedObj[property] = [val]; - }else { - compressedObj[property] = val; - } - } - } - - } - // if(text && text.length > 0) compressedObj[options.textNodeName] = text; - if(typeof text === "string"){ - if(text.length > 0) compressedObj[options.textNodeName] = text; - }else if(text !== undefined) compressedObj[options.textNodeName] = text; - return compressedObj; -} - -function propName$1(obj){ - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if(key !== ":@") return key; - } -} - -function assignAttributes(obj, attrMap, jpath, options){ - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; //don't make it inline - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [ attrMap[atrrName] ]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } -} - -function isLeafTag(obj, options){ - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - - if (propCount === 0) { - return true; - } - - if ( - propCount === 1 && - (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0) - ) { - return true; - } - - return false; -} -node2json.prettify = prettify$1; - -const { buildOptions} = OptionsBuilder; -const OrderedObjParser = OrderedObjParser_1; -const { prettify} = node2json; -const validator$1 = validator$2; - -class XMLParser$2{ - - constructor(options){ - this.externalEntities = {}; - this.options = buildOptions(options); - - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData,validationOption){ - if(typeof xmlData === "string");else if( xmlData.toString){ - xmlData = xmlData.toString(); - }else { - throw new Error("XML data is accepted in String or Bytes[] form.") - } - if( validationOption){ - if(validationOption === true) validationOption = {}; //validate with default options - - const result = validator$1.validate(xmlData, validationOption); - if (result !== true) { - throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` ) - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if(this.options.preserveOrder || orderedResult === undefined) return orderedResult; - else return prettify(orderedResult, this.options); - } - - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value){ - if(value.indexOf("&") !== -1){ - throw new Error("Entity value can't have '&'") - }else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){ - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '") - }else if(value === "&"){ - throw new Error("An entity with value '&' is not permitted"); - }else { - this.externalEntities[key] = value; - } - } -} - -var XMLParser_1 = XMLParser$2; - -const EOL = "\n"; - -/** - * - * @param {array} jArray - * @param {any} options - * @returns - */ -function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); -} - -function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if(tagName === undefined) continue; - - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; //remove extra spacing - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - - return xmlStr; -} - -function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if(!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } -} - -function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if(!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; -} - -function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; -} - -function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; -} -var orderedJs2Xml = toXml; - -//parse Empty Node as self closing node -const buildFromOrderedJs = orderedJs2Xml; -const getIgnoreAttributesFn = ignoreAttributes; - -const defaultOptions = { - attributeNamePrefix: '@_', - attributesGroupName: false, - textNodeName: '#text', - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: ' ', - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" },//it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("\'", "g"), val: "'" }, - { regex: new RegExp("\"", "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false -}; - -function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function(/*a*/) { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - - this.processTextOrObjNode = processTextOrObjNode; - - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = '>\n'; - this.newLine = '\n'; - } else { - this.indentate = function() { - return ''; - }; - this.tagEndChar = '>'; - this.newLine = ''; - } -} - -Builder.prototype.build = function(jObj) { - if(this.options.preserveOrder){ - return buildFromOrderedJs(jObj, this.options); - }else { - if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){ - jObj = { - [this.options.arrayNodeName] : jObj - }; - } - return this.j2x(jObj, 0, []).val; - } -}; - -Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ''; - let val = ''; - const jPath = ajPath.join('.'); - for (let key in jObj) { - if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === 'undefined') { - // supress undefined node only if it is not an attribute - if (this.isAttribute(key)) { - val += ''; - } - } else if (jObj[key] === null) { - // null attribute should be ignored by the attribute list, but should not cause the tag closing - if (this.isAttribute(key)) { - val += ''; - } else if (key[0] === '?') { - val += this.indentate(level) + '<' + key + '?' + this.tagEndChar; - } else { - val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - } - // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - } else if (jObj[key] instanceof Date) { - val += this.buildTextValNode(jObj[key], key, '', level); - } else if (typeof jObj[key] !== 'object') { - //premitive type - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, '' + jObj[key]); - } else if (!attr) { - //tag value - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, '' + jObj[key]); - val += this.replaceEntitiesValue(newval); - } else { - val += this.buildTextValNode(jObj[key], key, '', level); - } - } - } else if (Array.isArray(jObj[key])) { - //repeated nodes - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === 'undefined') ; else if (item === null) { - if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar; - else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - } else if (typeof item === 'object') { - if(this.options.oneListGroup){ - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - }else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, '', level); - } - } - } - if(this.options.oneListGroup){ - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val += listTagVal; - } else { - //nested node - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]); - } - } else { - val += this.processTextOrObjNode(jObj[key], key, level, ajPath); - } - } - } - return {attrStr: attrStr, val: val}; -}; - -Builder.prototype.buildAttrPairStr = function(attrName, val){ - val = this.options.attributeValueProcessor(attrName, '' + val); - val = this.replaceEntitiesValue(val); - if (this.options.suppressBooleanAttributes && val === "true") { - return ' ' + attrName; - } else return ' ' + attrName + '="' + val + '"'; -}; - -function processTextOrObjNode (object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } -} - -Builder.prototype.buildObjectNode = function(val, key, attrStr, level) { - if(val === ""){ - if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; - else { - return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - }else { - - let tagEndExp = '' + val + tagEndExp ); - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - }else { - return ( - this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar + - val + - this.indentate(level) + tagEndExp ); - } - } -}; - -Builder.prototype.closeTag = function(key){ - let closeTag = ""; - if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired - if(!this.options.suppressUnpairedNode) closeTag = "/"; - }else if(this.options.suppressEmptyNode){ //empty - closeTag = "/"; - }else { - closeTag = `>` + this.newLine; - }else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - }else if(key[0] === "?") {//PI tag - return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; - }else { - let textValue = this.options.tagValueProcessor(key, val); - textValue = this.replaceEntitiesValue(textValue); - - if( textValue === ''){ - return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; - }else { - return this.indentate(level) + '<' + key + attrStr + '>' + - textValue + - ' 0 && this.options.processEntities){ - for (let i=0; i { - if (input === undefined || input === null) { - return false; - } - - input = input.toString().trim(); - - if (input.length === 0) { - return false; - } - - // Has to be `!==` as it can also return an object with error info. - if (XMLValidator.validate(input) !== true) { - return false; - } - - let jsonObject; - const parser = new XMLParser(); - - try { - jsonObject = parser.parse(input); - } catch (_) { - return false; - } - - if (!jsonObject) { - return false; - } - - if (!('svg' in jsonObject)) { - return false; - } - - return true; -}; - -isSvg$2.exports = isSvg; -// TODO: Remove this for the next major release -isSvg$2.exports.default = isSvg; - -var isSvgExports = isSvg$2.exports; -var isSvg$1 = /*@__PURE__*/getDefaultExportFromCjs(isSvgExports); - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -var escapeStringRegexp$2 = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; - -var escapeStringRegexp$1 = escapeStringRegexp$2; - -var trimRepeated = function (str, target) { - if (typeof str !== 'string' || typeof target !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(new RegExp('(?:' + escapeStringRegexp$1(target) + '){2,}', 'g'), target); -}; - -var trimRepeated$1 = /*@__PURE__*/getDefaultExportFromCjs(trimRepeated); - -var filenameReservedRegex$1 = {exports: {}}; - -/* eslint-disable no-control-regex */ -// TODO: remove parens when Node.js 6 is targeted. Node.js 4 barfs at it. -filenameReservedRegex$1.exports = () => (/[<>:"\/\\|?*\x00-\x1F]/g); -filenameReservedRegex$1.exports.windowsNames = () => (/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i); - -var filenameReservedRegexExports = filenameReservedRegex$1.exports; -var filenameReservedRegex = /*@__PURE__*/getDefaultExportFromCjs(filenameReservedRegexExports); - -var escapeStringRegexp = escapeStringRegexp$2; - -var stripOuter = function (str, sub) { - if (typeof str !== 'string' || typeof sub !== 'string') { - throw new TypeError(); - } - - sub = escapeStringRegexp(sub); - return str.replace(new RegExp('^' + sub + '|' + sub + '$', 'g'), ''); -}; - -var stripOuter$1 = /*@__PURE__*/getDefaultExportFromCjs(stripOuter); - -// Doesn't make sense to have longer filenames -const MAX_FILENAME_LENGTH = 100; - -const reControlChars = /[\u0000-\u001F\u0080-\u009F]/g; // eslint-disable-line no-control-regex -const reRelativePath = /^\.+/; -const reTrailingPeriods = /\.+$/; - -function filenamify(string, options = {}) { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } - - const replacement = options.replacement === undefined ? '!' : options.replacement; - - if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) { - throw new Error('Replacement string cannot contain reserved filename characters'); - } - - string = string.replace(filenameReservedRegex(), replacement); - string = string.replace(reControlChars, replacement); - string = string.replace(reRelativePath, replacement); - string = string.replace(reTrailingPeriods, ''); - - if (replacement.length > 0) { - string = trimRepeated$1(string, replacement); - string = string.length > 1 ? stripOuter$1(string, replacement) : string; - } - - string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string; - string = string.slice(0, typeof options.maxLength === 'number' ? options.maxLength : MAX_FILENAME_LENGTH); - - return string; -} - -var md5$1 = {exports: {}}; - -function commonjsRequire(path) { - throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); -} - -var core = {exports: {}}; - -var _nodeResolve_empty = {}; - -var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': _nodeResolve_empty -}); - -var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); - -core.exports; - -var hasRequiredCore; - -function requireCore () { - if (hasRequiredCore) return core.exports; - hasRequiredCore = 1; - (function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(); - } - }(commonjsGlobal, function () { - - /*globals window, global, require*/ - - /** - * CryptoJS core components. - */ - var CryptoJS = CryptoJS || (function (Math, undefined$1) { - - var crypto; - - // Native crypto from window (Browser) - if (typeof window !== 'undefined' && window.crypto) { - crypto = window.crypto; - } - - // Native crypto in web worker (Browser) - if (typeof self !== 'undefined' && self.crypto) { - crypto = self.crypto; - } - - // Native crypto from worker - if (typeof globalThis !== 'undefined' && globalThis.crypto) { - crypto = globalThis.crypto; - } - - // Native (experimental IE 11) crypto from window (Browser) - if (!crypto && typeof window !== 'undefined' && window.msCrypto) { - crypto = window.msCrypto; - } - - // Native crypto from global (NodeJS) - if (!crypto && typeof commonjsGlobal !== 'undefined' && commonjsGlobal.crypto) { - crypto = commonjsGlobal.crypto; - } - - // Native crypto import via require (NodeJS) - if (!crypto && typeof commonjsRequire === 'function') { - try { - crypto = require$$0; - } catch (err) {} - } - - /* - * Cryptographically secure pseudorandom number generator - * - * As Math.random() is cryptographically not safe to use - */ - var cryptoSecureRandomInt = function () { - if (crypto) { - // Use getRandomValues method (Browser) - if (typeof crypto.getRandomValues === 'function') { - try { - return crypto.getRandomValues(new Uint32Array(1))[0]; - } catch (err) {} - } - - // Use randomBytes method (NodeJS) - if (typeof crypto.randomBytes === 'function') { - try { - return crypto.randomBytes(4).readInt32LE(); - } catch (err) {} - } - } - - throw new Error('Native crypto module could not be used to get secure random number.'); - }; - - /* - * Local polyfill of Object.create - - */ - var create = Object.create || (function () { - function F() {} - - return function (obj) { - var subtype; - - F.prototype = obj; - - subtype = new F(); - - F.prototype = null; - - return subtype; - }; - }()); - - /** - * CryptoJS namespace. - */ - var C = {}; - - /** - * Library namespace. - */ - var C_lib = C.lib = {}; - - /** - * Base object for prototypal inheritance. - */ - var Base = C_lib.Base = (function () { - - - return { - /** - * Creates a new object that inherits from this object. - * - * @param {Object} overrides Properties to copy into the new object. - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * field: 'value', - * - * method: function () { - * } - * }); - */ - extend: function (overrides) { - // Spawn - var subtype = create(this); - - // Augment - if (overrides) { - subtype.mixIn(overrides); - } - - // Create default initializer - if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { - subtype.init = function () { - subtype.$super.init.apply(this, arguments); - }; - } - - // Initializer's prototype is the subtype object - subtype.init.prototype = subtype; - - // Reference supertype - subtype.$super = this; - - return subtype; - }, - - /** - * Extends this object and runs the init method. - * Arguments to create() will be passed to init(). - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var instance = MyType.create(); - */ - create: function () { - var instance = this.extend(); - instance.init.apply(instance, arguments); - - return instance; - }, - - /** - * Initializes a newly created object. - * Override this method to add some logic when your objects are created. - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * init: function () { - * // ... - * } - * }); - */ - init: function () { - }, - - /** - * Copies properties into this object. - * - * @param {Object} properties The properties to mix in. - * - * @example - * - * MyType.mixIn({ - * field: 'value' - * }); - */ - mixIn: function (properties) { - for (var propertyName in properties) { - if (properties.hasOwnProperty(propertyName)) { - this[propertyName] = properties[propertyName]; - } - } - - // IE won't copy toString using the loop above - if (properties.hasOwnProperty('toString')) { - this.toString = properties.toString; - } - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = instance.clone(); - */ - clone: function () { - return this.init.prototype.extend(this); - } - }; - }()); - - /** - * An array of 32-bit words. - * - * @property {Array} words The array of 32-bit words. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var WordArray = C_lib.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of 32-bit words. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.create(); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined$1) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 4; - } - }, - - /** - * Converts this word array to a string. - * - * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex - * - * @return {string} The stringified word array. - * - * @example - * - * var string = wordArray + ''; - * var string = wordArray.toString(); - * var string = wordArray.toString(CryptoJS.enc.Utf8); - */ - toString: function (encoder) { - return (encoder || Hex).stringify(this); - }, - - /** - * Concatenates a word array to this word array. - * - * @param {WordArray} wordArray The word array to append. - * - * @return {WordArray} This word array. - * - * @example - * - * wordArray1.concat(wordArray2); - */ - concat: function (wordArray) { - // Shortcuts - var thisWords = this.words; - var thatWords = wordArray.words; - var thisSigBytes = this.sigBytes; - var thatSigBytes = wordArray.sigBytes; - - // Clamp excess bits - this.clamp(); - - // Concat - if (thisSigBytes % 4) { - // Copy one byte at a time - for (var i = 0; i < thatSigBytes; i++) { - var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var j = 0; j < thatSigBytes; j += 4) { - thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; - } - } - this.sigBytes += thatSigBytes; - - // Chainable - return this; - }, - - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { - // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, - - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; - - for (var i = 0; i < nBytes; i += 4) { - words.push(cryptoSecureRandomInt()); - } - - return new WordArray.init(words, nBytes); - } - }); - - /** - * Encoder namespace. - */ - var C_enc = C.enc = {}; - - /** - * Hex encoding strategy. - */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - - return hexChars.join(''); - }, - - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; - - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } - - return new WordArray.init(words, hexStrLength / 2); - } - }; - - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } - - return latin1Chars.join(''); - }, - - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; - - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } - - return new WordArray.init(words, latin1StrLength); - } - }; - - /** - * UTF-8 encoding strategy. - */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; - - /** - * Abstract buffered block algorithm template. - * - * The property blockSize must be implemented in a concrete subtype. - * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 - */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, - - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data == 'string') { - data = Utf8.parse(data); - } - - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, - - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - var processedWords; - - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; - - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } - - // Count words ready - var nWordsReady = nBlocksReady * blockSize; - - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } - - // Remove processed words - processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } - - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); - - return clone; - }, - - _minBufferSize: 0 - }); - - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), - - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, - - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-hasher logic - this._doReset(); - }, - - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); - - // Update the hash - this._process(); - - // Chainable - return this; - }, - - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } - - // Perform concrete-hasher logic - var hash = this._doFinalize(); - - return hash; - }, - - blockSize: 512/32, - - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, - - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); - - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; - - return C; - }(Math)); - - - return CryptoJS; - - })); - } (core, core.exports)); - return core.exports; -} - -md5$1.exports; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(requireCore()); - } - }(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var T = []; - - // Compute constants - (function () { - for (var i = 0; i < 64; i++) { - T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; - } - }()); - - /** - * MD5 hash algorithm. - */ - var MD5 = C_algo.MD5 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - - // Shortcuts - var H = this._hash.words; - - var M_offset_0 = M[offset + 0]; - var M_offset_1 = M[offset + 1]; - var M_offset_2 = M[offset + 2]; - var M_offset_3 = M[offset + 3]; - var M_offset_4 = M[offset + 4]; - var M_offset_5 = M[offset + 5]; - var M_offset_6 = M[offset + 6]; - var M_offset_7 = M[offset + 7]; - var M_offset_8 = M[offset + 8]; - var M_offset_9 = M[offset + 9]; - var M_offset_10 = M[offset + 10]; - var M_offset_11 = M[offset + 11]; - var M_offset_12 = M[offset + 12]; - var M_offset_13 = M[offset + 13]; - var M_offset_14 = M[offset + 14]; - var M_offset_15 = M[offset + 15]; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - - // Computation - a = FF(a, b, c, d, M_offset_0, 7, T[0]); - d = FF(d, a, b, c, M_offset_1, 12, T[1]); - c = FF(c, d, a, b, M_offset_2, 17, T[2]); - b = FF(b, c, d, a, M_offset_3, 22, T[3]); - a = FF(a, b, c, d, M_offset_4, 7, T[4]); - d = FF(d, a, b, c, M_offset_5, 12, T[5]); - c = FF(c, d, a, b, M_offset_6, 17, T[6]); - b = FF(b, c, d, a, M_offset_7, 22, T[7]); - a = FF(a, b, c, d, M_offset_8, 7, T[8]); - d = FF(d, a, b, c, M_offset_9, 12, T[9]); - c = FF(c, d, a, b, M_offset_10, 17, T[10]); - b = FF(b, c, d, a, M_offset_11, 22, T[11]); - a = FF(a, b, c, d, M_offset_12, 7, T[12]); - d = FF(d, a, b, c, M_offset_13, 12, T[13]); - c = FF(c, d, a, b, M_offset_14, 17, T[14]); - b = FF(b, c, d, a, M_offset_15, 22, T[15]); - - a = GG(a, b, c, d, M_offset_1, 5, T[16]); - d = GG(d, a, b, c, M_offset_6, 9, T[17]); - c = GG(c, d, a, b, M_offset_11, 14, T[18]); - b = GG(b, c, d, a, M_offset_0, 20, T[19]); - a = GG(a, b, c, d, M_offset_5, 5, T[20]); - d = GG(d, a, b, c, M_offset_10, 9, T[21]); - c = GG(c, d, a, b, M_offset_15, 14, T[22]); - b = GG(b, c, d, a, M_offset_4, 20, T[23]); - a = GG(a, b, c, d, M_offset_9, 5, T[24]); - d = GG(d, a, b, c, M_offset_14, 9, T[25]); - c = GG(c, d, a, b, M_offset_3, 14, T[26]); - b = GG(b, c, d, a, M_offset_8, 20, T[27]); - a = GG(a, b, c, d, M_offset_13, 5, T[28]); - d = GG(d, a, b, c, M_offset_2, 9, T[29]); - c = GG(c, d, a, b, M_offset_7, 14, T[30]); - b = GG(b, c, d, a, M_offset_12, 20, T[31]); - - a = HH(a, b, c, d, M_offset_5, 4, T[32]); - d = HH(d, a, b, c, M_offset_8, 11, T[33]); - c = HH(c, d, a, b, M_offset_11, 16, T[34]); - b = HH(b, c, d, a, M_offset_14, 23, T[35]); - a = HH(a, b, c, d, M_offset_1, 4, T[36]); - d = HH(d, a, b, c, M_offset_4, 11, T[37]); - c = HH(c, d, a, b, M_offset_7, 16, T[38]); - b = HH(b, c, d, a, M_offset_10, 23, T[39]); - a = HH(a, b, c, d, M_offset_13, 4, T[40]); - d = HH(d, a, b, c, M_offset_0, 11, T[41]); - c = HH(c, d, a, b, M_offset_3, 16, T[42]); - b = HH(b, c, d, a, M_offset_6, 23, T[43]); - a = HH(a, b, c, d, M_offset_9, 4, T[44]); - d = HH(d, a, b, c, M_offset_12, 11, T[45]); - c = HH(c, d, a, b, M_offset_15, 16, T[46]); - b = HH(b, c, d, a, M_offset_2, 23, T[47]); - - a = II(a, b, c, d, M_offset_0, 6, T[48]); - d = II(d, a, b, c, M_offset_7, 10, T[49]); - c = II(c, d, a, b, M_offset_14, 15, T[50]); - b = II(b, c, d, a, M_offset_5, 21, T[51]); - a = II(a, b, c, d, M_offset_12, 6, T[52]); - d = II(d, a, b, c, M_offset_3, 10, T[53]); - c = II(c, d, a, b, M_offset_10, 15, T[54]); - b = II(b, c, d, a, M_offset_1, 21, T[55]); - a = II(a, b, c, d, M_offset_8, 6, T[56]); - d = II(d, a, b, c, M_offset_15, 10, T[57]); - c = II(c, d, a, b, M_offset_6, 15, T[58]); - b = II(b, c, d, a, M_offset_13, 21, T[59]); - a = II(a, b, c, d, M_offset_4, 6, T[60]); - d = II(d, a, b, c, M_offset_11, 10, T[61]); - c = II(c, d, a, b, M_offset_2, 15, T[62]); - b = II(b, c, d, a, M_offset_9, 21, T[63]); - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - - var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); - var nBitsTotalL = nBitsTotal; - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( - (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | - (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) - ); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | - (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) - ); - - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 4; i++) { - // Shortcut - var H_i = H[i]; - - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - function FF(a, b, c, d, x, s, t) { - var n = a + ((b & c) | (~b & d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function GG(a, b, c, d, x, s, t) { - var n = a + ((b & d) | (c & ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function HH(a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function II(a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.MD5('message'); - * var hash = CryptoJS.MD5(wordArray); - */ - C.MD5 = Hasher._createHelper(MD5); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacMD5(message, key); - */ - C.HmacMD5 = Hasher._createHmacHelper(MD5); - }(Math)); - - - return CryptoJS.MD5; - - })); -} (md5$1, md5$1.exports)); - -var md5Exports = md5$1.exports; -var md5 = /*@__PURE__*/getDefaultExportFromCjs(md5Exports); - -const APP_TITLE = "Local Images Plus 0.16.3"; -//Option to enable debugging -let VERBOSE = false; -function setDebug(value = false) { - VERBOSE = value; -} -const SUPPORTED_OS = { "win": "win32", "unix": "linux,darwin,freebsd,openbsd" }; -const USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36'; -const MD_SEARCH_PATTERN = [ - //file link - /\!\[(?(.{0}|(?!^file\:\/)+?))\]\((?((file\:\/)[^\!]+?(\.{1}.{3,4}\) {0,1}|\)$|\)\n|\)])))/gm, - //hypertext link - ///\!\[(?(.{0}|[^\[]+?))\]\((?((http(s){0,1}).+?(\) |\..{3,4}\)|\)$|\)\n|\)\]|\)\[)))/gm, - /\!\[(?([^\]]*))\]\((?((http(s){0,1}).+?(\) |\..{3,4}\)|\)$|\)\n|\)\]|\)\[)))/gm, - //Base64 encoded data - /\!\[[^\[](?(.{0}|[^\[]+?))\]\((?((data\:.+?base64\,).+?(\) |\..{3,4}\)|\)$|\)\n|\)\]|\)\[)))/gm, - /\!\[(?(.{0}|[^\[]+?))\]\((?((http(s){0,1}|(data\:.+?base64\,)).+?\)))/gm -]; -const MD_LINK = /\http(s){0,1}.+?( {1}|\)\n)/g; -const ATT_SIZE_ACHOR = /(^(?.{1,})\|(?[0-9]{2,4})$)|(?^[0-9]{2,4}$)/gm; -// Looks like timeouts in Obsidian API are set in milliseconds -const NOTICE_TIMEOUT = 5 * 1000; -const TIMEOUT_LIKE_INFINITY = 24 * 60 * 60 * 1000; -const FORBIDDEN_SYMBOLS_FILENAME_PATTERN = /\s+/g; -const DEFAULT_SETTINGS = { - processCreated: true, - ignoredExt: "cnt|php|htm|html", - processAll: true, - useCaptions: true, - pathInTags: "fullDirPath", - downUnknown: false, - saveAttE: "obsFolder", - realTimeUpdate: true, - filesizeLimit: 0, - tryCount: 2, - realTimeUpdateInterval: 5, - addNameOfFile: true, - showNotifications: true, - includeps: "md|canvas", - includepattern: "(?.*\\.md)|(?.*\\.canvas)", - mediaRootDir: "_resources/${notename}", - disAddCom: false, - useMD5ForNewAtt: true, - removeMediaFolder: true, - removeOrphansCompl: false, - PngToJpeg: false, - PngToJpegLocal: true, - JpegQuality: 80, - DoNotCreateObsFolder: false, - DateFormat: "YYYY MM DD" -}; - -const fs2 = require('fs').promises; -//import { TIMEOUT } from "dns"; -//import fs from "fs"; -/* -https://stackoverflow.com/a/48032528/1020973 -It will be better to do it type-correct. -*/ -function showBalloon(str, show = true, timeout = NOTICE_TIMEOUT) { - return __awaiter(this, void 0, void 0, function* () { - if (show) { - new obsidian.Notice(APP_TITLE + "\r\n" + str, timeout); - } - }); -} -function displayError(error, file) { - if (file) { - showBalloon(`LocalImagesPlus: Error while handling file ${file.name}, ${error.toString()}`); - } - else { - showBalloon(error.toString()); - } - logError(`LocalImagesPlus: error: ${error}`, false); -} -function logError(str, isObj = false) { - return __awaiter(this, void 0, void 0, function* () { - if (VERBOSE) { - console.log(APP_TITLE + ": "); - if (isObj) { - console.table(str); - } - else { - console.log(str); - } - } - }); -} -function md5Sig(contentData = undefined) { - try { - var dec = new TextDecoder("utf-8"); - const arrMid = Math.round(contentData.byteLength / 2); - const chunk = 15000; - const signature = md5([ - contentData.slice(0, chunk), - contentData.slice(arrMid, arrMid + chunk), - contentData.slice(-chunk) - ].map(x => dec.decode(x)).join()).toString(); - return signature + "_MD5"; - } - catch (e) { - logError("Cannot generate md5: " + e, false); - return null; - } -} -function replaceAsync(str, regex, asyncFn) { - return __awaiter(this, void 0, void 0, function* () { - logError("replaceAsync: \r\nstr: " + str + "\r\nregex: "); - logError(regex, true); - let errorflag = false; - const promises = []; - let dictPatt = []; - let link; - let anchor; - let replp; - let caption = ""; - let filesArr = []; - let AttSize = ""; - regex.forEach((element) => { - var _a; - logError("cur regex: " + element); - const matches = str.matchAll(element); - for (const match of matches) { - logError("match: " + match); - anchor = trimAny(match.groups.anchor, [")", "(", "]", "[", " "]); - const AttSizeMatch = anchor.matchAll(ATT_SIZE_ACHOR); - for (const match of AttSizeMatch) { - AttSize = (match.groups.attsize !== undefined) ? trimAny(match.groups.attsize, [")", "(", "]", "[", " "]) : - (match.groups.attsize2 !== undefined) ? trimAny(match.groups.attsize2, [")", "(", "]", "[", " "]) : - ""; - } - link = ((_a = match.groups.link.match(MD_LINK)) !== null && _a !== void 0 ? _a : [match.groups.link])[0]; - caption = trimAny((match.groups.link.match(MD_LINK) !== null ? - (match.groups.link.split(link).length > 1 ? - match.groups.link.split(link)[1] : "") : - ""), [")", "]", "(", "[", " "]); - link = trimAny(link, [")", "(", "]", "[", " "]); - replp = trimAny(match[0], ["[", "(", "]"]); - logError("repl: " + replp + - "\r\nahc: " + anchor + - "\r\nlink: " + link + - "\r\ncaption: " + caption + - "\r\nAttSize: " + AttSize); - dictPatt[replp] = [anchor, link, caption, AttSize]; - } - }); - for (var key in dictPatt) { - const promise = asyncFn(key, dictPatt[key][0], dictPatt[key][1], dictPatt[key][2], dictPatt[key][3]); - logError(promise, true); - promises.push(promise); - } - const data = yield Promise.all(promises); - logError("Promises: "); - logError(data, true); - // return str.replace((reg: RegExp, str: String) => { - data.forEach((element) => { - if (element !== null) { - logError("el: " + element[0] + " el2: " + element[1] + element[2]); - str = str.replaceAll(element[0], element[1] + element[2]); - filesArr.push(element[1]); - } - else { - errorflag = true; - } - }); - return [str, errorflag, filesArr]; - // return str.replace( () => data.shift()); - }); -} -function isUrl(link) { - logError("IsUrl: " + link, false); - try { - return Boolean(new URL(link)); - } - catch (_) { - return false; - } -} -function base64ToBuff(data) { - return __awaiter(this, void 0, void 0, function* () { - logError("base64ToBuff: \r\n", false); - try { - const BufferData = Buffer.from(data.split("base64,")[1], 'base64'); - logError(BufferData); - return BufferData; - } - catch (e) { - logError("Cannot read base64: " + e, false); - return null; - } - }); -} -function readFromDiskB(file, count = undefined) { - return __awaiter(this, void 0, void 0, function* () { - try { - const buffer = Buffer.alloc(count); - const fd = fs__default["default"].openSync(file, "r+"); - fs__default["default"].readSync(fd, buffer, 0, buffer.length, 0); - logError(buffer); - fs__default["default"].closeSync(fd); - return buffer; - } - catch (e) { - logError("Cannot read the file: " + e, false); - return null; - } - }); -} -function readFromDisk(file) { - return __awaiter(this, void 0, void 0, function* () { - logError("readFromDisk: " + file, false); - try { - const data = yield fs2.readFile(file, null); - return Buffer.from(data); - } - catch (e) { - logError("Cannot read the file: " + e, false); - return null; - } - }); -} -function downloadImage(url) { - return __awaiter(this, void 0, void 0, function* () { - logError("Downloading: " + url, false); - const headers = { - 'method': 'GET', - 'User-Agent': USER_AGENT - }; - try { - const res = yield obsidian.requestUrl({ url: url, headers }); - logError(res, true); - return res.arrayBuffer; - } - catch (e) { - logError("Cannot download the file: " + e, false); - return null; - } - }); -} -function getFileExt(content, link) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const fileExtByLink = path__default["default"].extname(link).replace("\.", ""); - const fileExtByBuffer = (_a = (yield fileType_1.fromBuffer(content))) === null || _a === void 0 ? void 0 : _a.ext; - // if XML, probably it is SVG - if (fileExtByBuffer == "xml" || !fileExtByBuffer) { - const buffer = Buffer.from(content); - if (isSvg$1(buffer)) - return "svg"; - } - logError("fileExtByBuffer" + fileExtByBuffer); - if (fileExtByBuffer != undefined && fileExtByBuffer && fileExtByBuffer.length <= 5 && (fileExtByBuffer === null || fileExtByBuffer === void 0 ? void 0 : fileExtByBuffer.length) > 0) { - return fileExtByBuffer; - } - logError("fileExtByLink " + fileExtByLink); - if (fileExtByLink != undefined && fileExtByLink.length <= 5 && (fileExtByLink === null || fileExtByLink === void 0 ? void 0 : fileExtByLink.length) > 0) { - return fileExtByLink; - } - return "unknown"; - }); -} -//https://stackoverflow.com/questions/26156292/trim-specific-character-from-a-string -function trimAny(str, chars) { - var start = 0, end = str.length; - while (start < end && chars.indexOf(str[start]) >= 0) - ++start; - while (end > start && chars.indexOf(str[end - 1]) >= 0) - --end; - return (start > 0 || end < str.length) ? str.substring(start, end) : str; -} -function cFileName(name) { - const cleanedName = name.replace(/(\)|\(|\"|\'|\#|\]|\[|\:|\>|\<|\*|\|)/g, " "); - return cleanedName; -} -function cleanFileName(name) { - const cleanedName = filenamify(name).replace(FORBIDDEN_SYMBOLS_FILENAME_PATTERN, "_"); - return cleanedName; -} -function pathJoin(parts) { - const result = path__default["default"].join(...parts); - // it seems that obsidian do not understand paths with backslashes in Windows, so turn them into forward slashes - return result.replace(/\\/g, "/"); -} -function normalizePath(path) { - return path.replace(/\\/g, "/"); -} -function encObsURI(e) { - return e.replace(/[\\\x00\x08\x0B\x0C\x0E-\x1F ]/g, (function (e) { - return encodeURIComponent(e); - })); -} -/** - * https://github.com/mnaoumov/obsidian-dev-utils - * - * Converts a Blob object to a JPEG ArrayBuffer with the specified quality. - * - * @param blob - The Blob object to convert. - * @param jpegQuality - The quality of the JPEG image (0 to 1). - * @returns A promise that resolves to an ArrayBuffer. - */ -function blobToJpegArrayBuffer(blob, jpegQuality) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => { - const reader = new FileReader(); - reader.onloadend = () => { - const image = new Image(); - image.onload = () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('2d'); - if (!context) { - throw new Error('Could not get 2D context.'); - } - const imageWidth = image.width; - const imageHeight = image.height; - let data = ''; - canvas.width = imageWidth; - canvas.height = imageHeight; - context.fillStyle = '#fff'; - context.fillRect(0, 0, imageWidth, imageHeight); - context.save(); - context.translate(imageWidth / 2, imageHeight / 2); - context.drawImage(image, 0, 0, imageWidth, imageHeight, -imageWidth / 2, -imageHeight / 2, imageWidth, imageHeight); - context.restore(); - data = canvas.toDataURL('image/jpeg', jpegQuality); - const arrayBuffer = base64ToBuff(data); - resolve(arrayBuffer); - }; - image.src = reader.result; - }; - reader.readAsDataURL(blob); - }); - }); -} - -// Generic options -class AnalyzerOptions { - constructor(heuristic_replimit) { - this.heuristic_replimit = heuristic_replimit; - } -} - -// Abstract class -class Analyzer { - constructor(analyzerOptions) { - this.options = analyzerOptions; - } - - // Subclasser must implement - // Return boolean - isVulnerable(regExp) { - return false; - } - - // Subclass must implement - // Returns an AttackString or null - genAttackString(regExp) { - return null; - } -} - -var analyzer$2 = function(re, replimit) { - // Build an AST - let myRegExp = null; - let ast = null; - try { - // Construct a RegExp object - if (re instanceof RegExp) { - myRegExp = re; - } else if (typeof re === "string") { - myRegExp = new RegExp(re); - } else { - myRegExp = new RegExp(String(re)); - } - - // Build an AST - ast = regexpTree.parse(myRegExp); - } catch (err) { - // Invalid or unparseable input - return false; - } - - let currentStarHeight = 0; - let maxObservedStarHeight = 0; - - let repetitionCount = 0; - - regexpTree.traverse(ast, { - Repetition: { - pre({ node }) { - repetitionCount++; - - currentStarHeight++; - if (maxObservedStarHeight < currentStarHeight) { - maxObservedStarHeight = currentStarHeight; - } - }, - - post({ node }) { - currentStarHeight--; - } - } - }); - - return maxObservedStarHeight <= 1 && repetitionCount <= replimit; -}; - -analyzer$2 = { - "AnalyzerOptions": AnalyzerOptions, - "Analyzer": Analyzer, -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to translate `/./s` to `/[\0-\uFFFF]/`. - */ - -var compatDotallSTransform = { - - // Whether `u` flag present. In which case we transform to - // \u{10FFFF} instead of \uFFFF. - _hasUFlag: false, - - // Only run this plugin if we have `s` flag. - shouldRun: function shouldRun(ast) { - var shouldRun = ast.flags.includes('s'); - - if (!shouldRun) { - return false; - } - - // Strip the `s` flag. - ast.flags = ast.flags.replace('s', ''); - - // Whether we have also `u`. - this._hasUFlag = ast.flags.includes('u'); - - return true; - }, - Char: function Char(path) { - var node = path.node; - - - if (node.kind !== 'meta' || node.value !== '.') { - return; - } - - var toValue = '\\uFFFF'; - var toSymbol = '\uFFFF'; - - if (this._hasUFlag) { - toValue = '\\u{10FFFF}'; - toSymbol = '\uDBFF\uDFFF'; - } - - path.replace({ - type: 'CharacterClass', - expressions: [{ - type: 'ClassRange', - from: { - type: 'Char', - value: '\\0', - kind: 'decimal', - symbol: '\0' - }, - to: { - type: 'Char', - value: toValue, - kind: 'unicode', - symbol: toSymbol - } - }] - }); - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to translate `/(?a)\k/` to `/(a)\1/`. - */ - -var compatNamedCapturingGroupsTransform = { - // To track the names of the groups, and return them - // in the transform result state. - // - // A map from name to number: {foo: 2, bar: 4} - _groupNames: {}, - - /** - * Initialises the trasnform. - */ - init: function init() { - this._groupNames = {}; - }, - - - /** - * Returns extra state, which eventually is returned to - */ - getExtra: function getExtra() { - return this._groupNames; - }, - Group: function Group(path) { - var node = path.node; - - - if (!node.name) { - return; - } - - // Record group name. - this._groupNames[node.name] = node.number; - - delete node.name; - delete node.nameRaw; - }, - Backreference: function Backreference(path) { - var node = path.node; - - - if (node.kind !== 'name') { - return; - } - - node.kind = 'number'; - node.reference = node.number; - delete node.referenceRaw; - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to remove `x` flag `/foo/x` to `/foo/`. - * - * Note: other features of `x` flags (whitespace, comments) are - * already removed at parsing stage. - */ - -var compatXFlagTransform = { - RegExp: function RegExp(_ref) { - var node = _ref.node; - - if (node.flags.includes('x')) { - node.flags = node.flags.replace('x', ''); - } - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var transforms$1 = { - // "dotAll" `s` flag - dotAll: compatDotallSTransform, - - // Named capturing groups. - namedCapturingGroups: compatNamedCapturingGroupsTransform, - - // `x` flag - xFlag: compatXFlagTransform -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * Helper `gen` function calls node type handler. - */ - -function gen$1(node) { - return node ? generator$3[node.type](node) : ''; -} - -/** - * AST handler. - */ -var generator$3 = { - RegExp: function RegExp(node) { - return '/' + gen$1(node.body) + '/' + node.flags; - }, - Alternative: function Alternative(node) { - return (node.expressions || []).map(gen$1).join(''); - }, - Disjunction: function Disjunction(node) { - return gen$1(node.left) + '|' + gen$1(node.right); - }, - Group: function Group(node) { - var expression = gen$1(node.expression); - - if (node.capturing) { - // A named group. - if (node.name) { - return '(?<' + (node.nameRaw || node.name) + '>' + expression + ')'; - } - - return '(' + expression + ')'; - } - - return '(?:' + expression + ')'; - }, - Backreference: function Backreference(node) { - switch (node.kind) { - case 'number': - return '\\' + node.reference; - case 'name': - return '\\k<' + (node.referenceRaw || node.reference) + '>'; - default: - throw new TypeError('Unknown Backreference kind: ' + node.kind); - } - }, - Assertion: function Assertion(node) { - switch (node.kind) { - case '^': - case '$': - case '\\b': - case '\\B': - return node.kind; - - case 'Lookahead': - { - var assertion = gen$1(node.assertion); - - if (node.negative) { - return '(?!' + assertion + ')'; - } - - return '(?=' + assertion + ')'; - } - - case 'Lookbehind': - { - var _assertion = gen$1(node.assertion); - - if (node.negative) { - return '(? - */ - -var NON_BINARY_PROP_NAMES_TO_ALIASES = { - General_Category: 'gc', - Script: 'sc', - Script_Extensions: 'scx' -}; - -var NON_BINARY_ALIASES_TO_PROP_NAMES = inverseMap(NON_BINARY_PROP_NAMES_TO_ALIASES); - -var BINARY_PROP_NAMES_TO_ALIASES = { - ASCII: 'ASCII', - ASCII_Hex_Digit: 'AHex', - Alphabetic: 'Alpha', - Any: 'Any', - Assigned: 'Assigned', - Bidi_Control: 'Bidi_C', - Bidi_Mirrored: 'Bidi_M', - Case_Ignorable: 'CI', - Cased: 'Cased', - Changes_When_Casefolded: 'CWCF', - Changes_When_Casemapped: 'CWCM', - Changes_When_Lowercased: 'CWL', - Changes_When_NFKC_Casefolded: 'CWKCF', - Changes_When_Titlecased: 'CWT', - Changes_When_Uppercased: 'CWU', - Dash: 'Dash', - Default_Ignorable_Code_Point: 'DI', - Deprecated: 'Dep', - Diacritic: 'Dia', - Emoji: 'Emoji', - Emoji_Component: 'Emoji_Component', - Emoji_Modifier: 'Emoji_Modifier', - Emoji_Modifier_Base: 'Emoji_Modifier_Base', - Emoji_Presentation: 'Emoji_Presentation', - Extended_Pictographic: 'Extended_Pictographic', - Extender: 'Ext', - Grapheme_Base: 'Gr_Base', - Grapheme_Extend: 'Gr_Ext', - Hex_Digit: 'Hex', - IDS_Binary_Operator: 'IDSB', - IDS_Trinary_Operator: 'IDST', - ID_Continue: 'IDC', - ID_Start: 'IDS', - Ideographic: 'Ideo', - Join_Control: 'Join_C', - Logical_Order_Exception: 'LOE', - Lowercase: 'Lower', - Math: 'Math', - Noncharacter_Code_Point: 'NChar', - Pattern_Syntax: 'Pat_Syn', - Pattern_White_Space: 'Pat_WS', - Quotation_Mark: 'QMark', - Radical: 'Radical', - Regional_Indicator: 'RI', - Sentence_Terminal: 'STerm', - Soft_Dotted: 'SD', - Terminal_Punctuation: 'Term', - Unified_Ideograph: 'UIdeo', - Uppercase: 'Upper', - Variation_Selector: 'VS', - White_Space: 'space', - XID_Continue: 'XIDC', - XID_Start: 'XIDS' -}; - -var BINARY_ALIASES_TO_PROP_NAMES = inverseMap(BINARY_PROP_NAMES_TO_ALIASES); - -var GENERAL_CATEGORY_VALUE_TO_ALIASES = { - Cased_Letter: 'LC', - Close_Punctuation: 'Pe', - Connector_Punctuation: 'Pc', - Control: ['Cc', 'cntrl'], - Currency_Symbol: 'Sc', - Dash_Punctuation: 'Pd', - Decimal_Number: ['Nd', 'digit'], - Enclosing_Mark: 'Me', - Final_Punctuation: 'Pf', - Format: 'Cf', - Initial_Punctuation: 'Pi', - Letter: 'L', - Letter_Number: 'Nl', - Line_Separator: 'Zl', - Lowercase_Letter: 'Ll', - Mark: ['M', 'Combining_Mark'], - Math_Symbol: 'Sm', - Modifier_Letter: 'Lm', - Modifier_Symbol: 'Sk', - Nonspacing_Mark: 'Mn', - Number: 'N', - Open_Punctuation: 'Ps', - Other: 'C', - Other_Letter: 'Lo', - Other_Number: 'No', - Other_Punctuation: 'Po', - Other_Symbol: 'So', - Paragraph_Separator: 'Zp', - Private_Use: 'Co', - Punctuation: ['P', 'punct'], - Separator: 'Z', - Space_Separator: 'Zs', - Spacing_Mark: 'Mc', - Surrogate: 'Cs', - Symbol: 'S', - Titlecase_Letter: 'Lt', - Unassigned: 'Cn', - Uppercase_Letter: 'Lu' -}; - -var GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES = inverseMap(GENERAL_CATEGORY_VALUE_TO_ALIASES); - -var SCRIPT_VALUE_TO_ALIASES = { - Adlam: 'Adlm', - Ahom: 'Ahom', - Anatolian_Hieroglyphs: 'Hluw', - Arabic: 'Arab', - Armenian: 'Armn', - Avestan: 'Avst', - Balinese: 'Bali', - Bamum: 'Bamu', - Bassa_Vah: 'Bass', - Batak: 'Batk', - Bengali: 'Beng', - Bhaiksuki: 'Bhks', - Bopomofo: 'Bopo', - Brahmi: 'Brah', - Braille: 'Brai', - Buginese: 'Bugi', - Buhid: 'Buhd', - Canadian_Aboriginal: 'Cans', - Carian: 'Cari', - Caucasian_Albanian: 'Aghb', - Chakma: 'Cakm', - Cham: 'Cham', - Cherokee: 'Cher', - Common: 'Zyyy', - Coptic: ['Copt', 'Qaac'], - Cuneiform: 'Xsux', - Cypriot: 'Cprt', - Cyrillic: 'Cyrl', - Deseret: 'Dsrt', - Devanagari: 'Deva', - Dogra: 'Dogr', - Duployan: 'Dupl', - Egyptian_Hieroglyphs: 'Egyp', - Elbasan: 'Elba', - Ethiopic: 'Ethi', - Georgian: 'Geor', - Glagolitic: 'Glag', - Gothic: 'Goth', - Grantha: 'Gran', - Greek: 'Grek', - Gujarati: 'Gujr', - Gunjala_Gondi: 'Gong', - Gurmukhi: 'Guru', - Han: 'Hani', - Hangul: 'Hang', - Hanifi_Rohingya: 'Rohg', - Hanunoo: 'Hano', - Hatran: 'Hatr', - Hebrew: 'Hebr', - Hiragana: 'Hira', - Imperial_Aramaic: 'Armi', - Inherited: ['Zinh', 'Qaai'], - Inscriptional_Pahlavi: 'Phli', - Inscriptional_Parthian: 'Prti', - Javanese: 'Java', - Kaithi: 'Kthi', - Kannada: 'Knda', - Katakana: 'Kana', - Kayah_Li: 'Kali', - Kharoshthi: 'Khar', - Khmer: 'Khmr', - Khojki: 'Khoj', - Khudawadi: 'Sind', - Lao: 'Laoo', - Latin: 'Latn', - Lepcha: 'Lepc', - Limbu: 'Limb', - Linear_A: 'Lina', - Linear_B: 'Linb', - Lisu: 'Lisu', - Lycian: 'Lyci', - Lydian: 'Lydi', - Mahajani: 'Mahj', - Makasar: 'Maka', - Malayalam: 'Mlym', - Mandaic: 'Mand', - Manichaean: 'Mani', - Marchen: 'Marc', - Medefaidrin: 'Medf', - Masaram_Gondi: 'Gonm', - Meetei_Mayek: 'Mtei', - Mende_Kikakui: 'Mend', - Meroitic_Cursive: 'Merc', - Meroitic_Hieroglyphs: 'Mero', - Miao: 'Plrd', - Modi: 'Modi', - Mongolian: 'Mong', - Mro: 'Mroo', - Multani: 'Mult', - Myanmar: 'Mymr', - Nabataean: 'Nbat', - New_Tai_Lue: 'Talu', - Newa: 'Newa', - Nko: 'Nkoo', - Nushu: 'Nshu', - Ogham: 'Ogam', - Ol_Chiki: 'Olck', - Old_Hungarian: 'Hung', - Old_Italic: 'Ital', - Old_North_Arabian: 'Narb', - Old_Permic: 'Perm', - Old_Persian: 'Xpeo', - Old_Sogdian: 'Sogo', - Old_South_Arabian: 'Sarb', - Old_Turkic: 'Orkh', - Oriya: 'Orya', - Osage: 'Osge', - Osmanya: 'Osma', - Pahawh_Hmong: 'Hmng', - Palmyrene: 'Palm', - Pau_Cin_Hau: 'Pauc', - Phags_Pa: 'Phag', - Phoenician: 'Phnx', - Psalter_Pahlavi: 'Phlp', - Rejang: 'Rjng', - Runic: 'Runr', - Samaritan: 'Samr', - Saurashtra: 'Saur', - Sharada: 'Shrd', - Shavian: 'Shaw', - Siddham: 'Sidd', - SignWriting: 'Sgnw', - Sinhala: 'Sinh', - Sogdian: 'Sogd', - Sora_Sompeng: 'Sora', - Soyombo: 'Soyo', - Sundanese: 'Sund', - Syloti_Nagri: 'Sylo', - Syriac: 'Syrc', - Tagalog: 'Tglg', - Tagbanwa: 'Tagb', - Tai_Le: 'Tale', - Tai_Tham: 'Lana', - Tai_Viet: 'Tavt', - Takri: 'Takr', - Tamil: 'Taml', - Tangut: 'Tang', - Telugu: 'Telu', - Thaana: 'Thaa', - Thai: 'Thai', - Tibetan: 'Tibt', - Tifinagh: 'Tfng', - Tirhuta: 'Tirh', - Ugaritic: 'Ugar', - Vai: 'Vaii', - Warang_Citi: 'Wara', - Yi: 'Yiii', - Zanabazar_Square: 'Zanb' -}; - -var SCRIPT_VALUE_ALIASES_TO_VALUE = inverseMap(SCRIPT_VALUE_TO_ALIASES); - -function inverseMap(data) { - var inverse = {}; - - for (var name in data) { - if (!data.hasOwnProperty(name)) { - continue; - } - var value = data[name]; - if (Array.isArray(value)) { - for (var i = 0; i < value.length; i++) { - inverse[value[i]] = name; - } - } else { - inverse[value] = name; - } - } - - return inverse; -} - -function isValidName(name) { - return NON_BINARY_PROP_NAMES_TO_ALIASES.hasOwnProperty(name) || NON_BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name) || BINARY_PROP_NAMES_TO_ALIASES.hasOwnProperty(name) || BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name); -} - -function isValidValue(name, value) { - if (isGeneralCategoryName(name)) { - return isGeneralCategoryValue(value); - } - - if (isScriptCategoryName(name)) { - return isScriptCategoryValue(value); - } - - return false; -} - -function isAlias(name) { - return NON_BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name) || BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name); -} - -function isGeneralCategoryName(name) { - return name === 'General_Category' || name == 'gc'; -} - -function isScriptCategoryName(name) { - return name === 'Script' || name === 'Script_Extensions' || name === 'sc' || name === 'scx'; -} - -function isGeneralCategoryValue(value) { - return GENERAL_CATEGORY_VALUE_TO_ALIASES.hasOwnProperty(value) || GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES.hasOwnProperty(value); -} - -function isScriptCategoryValue(value) { - return SCRIPT_VALUE_TO_ALIASES.hasOwnProperty(value) || SCRIPT_VALUE_ALIASES_TO_VALUE.hasOwnProperty(value); -} - -function isBinaryPropertyName(name) { - return BINARY_PROP_NAMES_TO_ALIASES.hasOwnProperty(name) || BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name); -} - -function getCanonicalName(name) { - if (NON_BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name)) { - return NON_BINARY_ALIASES_TO_PROP_NAMES[name]; - } - - if (BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(name)) { - return BINARY_ALIASES_TO_PROP_NAMES[name]; - } - - return null; -} - -function getCanonicalValue(value) { - if (GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES.hasOwnProperty(value)) { - return GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES[value]; - } - - if (SCRIPT_VALUE_ALIASES_TO_VALUE.hasOwnProperty(value)) { - return SCRIPT_VALUE_ALIASES_TO_VALUE[value]; - } - - if (BINARY_ALIASES_TO_PROP_NAMES.hasOwnProperty(value)) { - return BINARY_ALIASES_TO_PROP_NAMES[value]; - } - - return null; -} - -var parserUnicodeProperties = { - isAlias: isAlias, - isValidName: isValidName, - isValidValue: isValidValue, - isGeneralCategoryValue: isGeneralCategoryValue, - isScriptCategoryValue: isScriptCategoryValue, - isBinaryPropertyName: isBinaryPropertyName, - getCanonicalName: getCanonicalName, - getCanonicalValue: getCanonicalValue, - - NON_BINARY_PROP_NAMES_TO_ALIASES: NON_BINARY_PROP_NAMES_TO_ALIASES, - NON_BINARY_ALIASES_TO_PROP_NAMES: NON_BINARY_ALIASES_TO_PROP_NAMES, - - BINARY_PROP_NAMES_TO_ALIASES: BINARY_PROP_NAMES_TO_ALIASES, - BINARY_ALIASES_TO_PROP_NAMES: BINARY_ALIASES_TO_PROP_NAMES, - - GENERAL_CATEGORY_VALUE_TO_ALIASES: GENERAL_CATEGORY_VALUE_TO_ALIASES, - GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES: GENERAL_CATEGORY_VALUE_ALIASES_TO_VALUES, - - SCRIPT_VALUE_TO_ALIASES: SCRIPT_VALUE_TO_ALIASES, - SCRIPT_VALUE_ALIASES_TO_VALUE: SCRIPT_VALUE_ALIASES_TO_VALUE -}; - -/** - * LR parser generated by the Syntax tool. - * - * https://www.npmjs.com/package/syntax-cli - * - * npm install -g syntax-cli - * - * syntax-cli --help - * - * To regenerate run: - * - * syntax-cli \ - * --grammar ~/path-to-grammar-file \ - * --mode \ - * --output ~/path-to-output-parser-file.js - */ - -/** - * Matched token text. - */ - -var _slicedToArray$2 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -function _toConsumableArray$8(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var yytext = void 0; - -/** - * Storage object. - */ -var yy = {}; - -/** - * Result of semantic action. - */ -var __ = void 0; - -/** - * Result location object. - */ -var __loc = void 0; - -function yyloc(start, end) { - if (!yy.options.captureLocations) { - return null; - } - - // Epsilon doesn't produce location. - if (!start || !end) { - return start || end; - } - - return { - startOffset: start.startOffset, - endOffset: end.endOffset, - startLine: start.startLine, - endLine: end.endLine, - startColumn: start.startColumn, - endColumn: end.endColumn - }; -} - -var EOF = '$'; - -/** - * List of productions (generated by Syntax tool). - */ -var productions = [[-1, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [0, 4, function (_1, _2, _3, _4, _1loc, _2loc, _3loc, _4loc) { - __loc = yyloc(_1loc, _4loc); - __ = Node({ - type: 'RegExp', - body: _2, - flags: checkFlags(_4) - }, loc(_1loc, _4loc || _3loc)); -}], [1, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [1, 0, function () { - __loc = null;__ = ''; -}], [2, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [2, 2, function (_1, _2, _1loc, _2loc) { - __loc = yyloc(_1loc, _2loc);__ = _1 + _2; -}], [3, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [4, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [4, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - // Location for empty disjunction: /|/ - var _loc = null; - - if (_2loc) { - _loc = loc(_1loc || _2loc, _3loc || _2loc); - } - __ = Node({ - type: 'Disjunction', - left: _1, - right: _3 - }, _loc); -}], [5, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - if (_1.length === 0) { - __ = null; - return; - } - - if (_1.length === 1) { - __ = Node(_1[0], __loc); - } else { - __ = Node({ - type: 'Alternative', - expressions: _1 - }, __loc); - } -}], [6, 0, function () { - __loc = null;__ = []; -}], [6, 2, function (_1, _2, _1loc, _2loc) { - __loc = yyloc(_1loc, _2loc);__ = _1.concat(_2); -}], [7, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Node(Object.assign({ type: 'Assertion' }, _1), __loc); -}], [7, 2, function (_1, _2, _1loc, _2loc) { - __loc = yyloc(_1loc, _2loc); - __ = _1; - - if (_2) { - __ = Node({ - type: 'Repetition', - expression: _1, - quantifier: _2 - }, __loc); - } -}], [8, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = { kind: '^' }; -}], [8, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = { kind: '$' }; -}], [8, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = { kind: '\\b' }; -}], [8, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = { kind: '\\B' }; -}], [8, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = { - kind: 'Lookahead', - assertion: _2 - }; -}], [8, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = { - kind: 'Lookahead', - negative: true, - assertion: _2 - }; -}], [8, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = { - kind: 'Lookbehind', - assertion: _2 - }; -}], [8, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = { - kind: 'Lookbehind', - negative: true, - assertion: _2 - }; -}], [9, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [9, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [9, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'simple', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1.slice(1), 'simple', __loc);__.escaped = true; -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'unicode', __loc);__.isSurrogatePair = true; -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'unicode', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = UnicodeProperty(_1, __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'control', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'hex', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'oct', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = GroupRefOrDecChar(_1, __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'meta', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'meta', __loc); -}], [10, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = NamedGroupRefOrChars(_1, _1loc); -}], [11, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [11, 0], [12, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [12, 2, function (_1, _2, _1loc, _2loc) { - __loc = yyloc(_1loc, _2loc); - _1.greedy = false; - __ = _1; -}], [13, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - __ = Node({ - type: 'Quantifier', - kind: _1, - greedy: true - }, __loc); -}], [13, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - __ = Node({ - type: 'Quantifier', - kind: _1, - greedy: true - }, __loc); -}], [13, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - __ = Node({ - type: 'Quantifier', - kind: _1, - greedy: true - }, __loc); -}], [13, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - var range = getRange(_1); - __ = Node({ - type: 'Quantifier', - kind: 'Range', - from: range[0], - to: range[0], - greedy: true - }, __loc); -}], [13, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - __ = Node({ - type: 'Quantifier', - kind: 'Range', - from: getRange(_1)[0], - greedy: true - }, __loc); -}], [13, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc); - var range = getRange(_1); - __ = Node({ - type: 'Quantifier', - kind: 'Range', - from: range[0], - to: range[1], - greedy: true - }, __loc); -}], [14, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [14, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [15, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - var nameRaw = String(_1); - var name = decodeUnicodeGroupName(nameRaw); - if (!yy.options.allowGroupNameDuplicates && namedGroups.hasOwnProperty(name)) { - throw new SyntaxError('Duplicate of the named group "' + name + '".'); - } - - namedGroups[name] = _1.groupNumber; - - __ = Node({ - type: 'Group', - capturing: true, - name: name, - nameRaw: nameRaw, - number: _1.groupNumber, - expression: _2 - }, __loc); -}], [15, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = Node({ - type: 'Group', - capturing: true, - number: _1.groupNumber, - expression: _2 - }, __loc); -}], [16, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = Node({ - type: 'Group', - capturing: false, - expression: _2 - }, __loc); -}], [17, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = Node({ - type: 'CharacterClass', - negative: true, - expressions: _2 - }, __loc); -}], [17, 3, function (_1, _2, _3, _1loc, _2loc, _3loc) { - __loc = yyloc(_1loc, _3loc); - __ = Node({ - type: 'CharacterClass', - expressions: _2 - }, __loc); -}], [18, 0, function () { - __loc = null;__ = []; -}], [18, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [19, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = [_1]; -}], [19, 2, function (_1, _2, _1loc, _2loc) { - __loc = yyloc(_1loc, _2loc);__ = [_1].concat(_2); -}], [19, 4, function (_1, _2, _3, _4, _1loc, _2loc, _3loc, _4loc) { - __loc = yyloc(_1loc, _4loc); - checkClassRange(_1, _3); - - __ = [Node({ - type: 'ClassRange', - from: _1, - to: _3 - }, loc(_1loc, _3loc))]; - - if (_4) { - __ = __.concat(_4); - } -}], [20, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [20, 2, function (_1, _2, _1loc, _2loc) { - __loc = yyloc(_1loc, _2loc);__ = [_1].concat(_2); -}], [20, 4, function (_1, _2, _3, _4, _1loc, _2loc, _3loc, _4loc) { - __loc = yyloc(_1loc, _4loc); - checkClassRange(_1, _3); - - __ = [Node({ - type: 'ClassRange', - from: _1, - to: _3 - }, loc(_1loc, _3loc))]; - - if (_4) { - __ = __.concat(_4); - } -}], [21, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'simple', __loc); -}], [21, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [22, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = _1; -}], [22, 1, function (_1, _1loc) { - __loc = yyloc(_1loc, _1loc);__ = Char(_1, 'meta', __loc); -}]]; - -/** - * Encoded tokens map. - */ -var tokens = { "SLASH": "23", "CHAR": "24", "BAR": "25", "BOS": "26", "EOS": "27", "ESC_b": "28", "ESC_B": "29", "POS_LA_ASSERT": "30", "R_PAREN": "31", "NEG_LA_ASSERT": "32", "POS_LB_ASSERT": "33", "NEG_LB_ASSERT": "34", "ESC_CHAR": "35", "U_CODE_SURROGATE": "36", "U_CODE": "37", "U_PROP_VALUE_EXP": "38", "CTRL_CH": "39", "HEX_CODE": "40", "OCT_CODE": "41", "DEC_CODE": "42", "META_CHAR": "43", "ANY": "44", "NAMED_GROUP_REF": "45", "Q_MARK": "46", "STAR": "47", "PLUS": "48", "RANGE_EXACT": "49", "RANGE_OPEN": "50", "RANGE_CLOSED": "51", "NAMED_CAPTURE_GROUP": "52", "L_PAREN": "53", "NON_CAPTURE_GROUP": "54", "NEG_CLASS": "55", "R_BRACKET": "56", "L_BRACKET": "57", "DASH": "58", "$": "59" }; - -/** - * Parsing table (generated by Syntax tool). - */ -var table = [{ "0": 1, "23": "s2" }, { "59": "acc" }, { "3": 3, "4": 4, "5": 5, "6": 6, "23": "r10", "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "23": "s7" }, { "23": "r6", "25": "s12" }, { "23": "r7", "25": "r7", "31": "r7" }, { "7": 14, "8": 15, "9": 16, "10": 25, "14": 27, "15": 42, "16": 43, "17": 26, "23": "r9", "24": "s28", "25": "r9", "26": "s17", "27": "s18", "28": "s19", "29": "s20", "30": "s21", "31": "r9", "32": "s22", "33": "s23", "34": "s24", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "52": "s44", "53": "s45", "54": "s46", "55": "s40", "57": "s41" }, { "1": 8, "2": 9, "24": "s10", "59": "r3" }, { "59": "r1" }, { "24": "s11", "59": "r2" }, { "24": "r4", "59": "r4" }, { "24": "r5", "59": "r5" }, { "5": 13, "6": 6, "23": "r10", "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "23": "r8", "25": "r8", "31": "r8" }, { "23": "r11", "24": "r11", "25": "r11", "26": "r11", "27": "r11", "28": "r11", "29": "r11", "30": "r11", "31": "r11", "32": "r11", "33": "r11", "34": "r11", "35": "r11", "36": "r11", "37": "r11", "38": "r11", "39": "r11", "40": "r11", "41": "r11", "42": "r11", "43": "r11", "44": "r11", "45": "r11", "52": "r11", "53": "r11", "54": "r11", "55": "r11", "57": "r11" }, { "23": "r12", "24": "r12", "25": "r12", "26": "r12", "27": "r12", "28": "r12", "29": "r12", "30": "r12", "31": "r12", "32": "r12", "33": "r12", "34": "r12", "35": "r12", "36": "r12", "37": "r12", "38": "r12", "39": "r12", "40": "r12", "41": "r12", "42": "r12", "43": "r12", "44": "r12", "45": "r12", "52": "r12", "53": "r12", "54": "r12", "55": "r12", "57": "r12" }, { "11": 47, "12": 48, "13": 49, "23": "r38", "24": "r38", "25": "r38", "26": "r38", "27": "r38", "28": "r38", "29": "r38", "30": "r38", "31": "r38", "32": "r38", "33": "r38", "34": "r38", "35": "r38", "36": "r38", "37": "r38", "38": "r38", "39": "r38", "40": "r38", "41": "r38", "42": "r38", "43": "r38", "44": "r38", "45": "r38", "46": "s52", "47": "s50", "48": "s51", "49": "s53", "50": "s54", "51": "s55", "52": "r38", "53": "r38", "54": "r38", "55": "r38", "57": "r38" }, { "23": "r14", "24": "r14", "25": "r14", "26": "r14", "27": "r14", "28": "r14", "29": "r14", "30": "r14", "31": "r14", "32": "r14", "33": "r14", "34": "r14", "35": "r14", "36": "r14", "37": "r14", "38": "r14", "39": "r14", "40": "r14", "41": "r14", "42": "r14", "43": "r14", "44": "r14", "45": "r14", "52": "r14", "53": "r14", "54": "r14", "55": "r14", "57": "r14" }, { "23": "r15", "24": "r15", "25": "r15", "26": "r15", "27": "r15", "28": "r15", "29": "r15", "30": "r15", "31": "r15", "32": "r15", "33": "r15", "34": "r15", "35": "r15", "36": "r15", "37": "r15", "38": "r15", "39": "r15", "40": "r15", "41": "r15", "42": "r15", "43": "r15", "44": "r15", "45": "r15", "52": "r15", "53": "r15", "54": "r15", "55": "r15", "57": "r15" }, { "23": "r16", "24": "r16", "25": "r16", "26": "r16", "27": "r16", "28": "r16", "29": "r16", "30": "r16", "31": "r16", "32": "r16", "33": "r16", "34": "r16", "35": "r16", "36": "r16", "37": "r16", "38": "r16", "39": "r16", "40": "r16", "41": "r16", "42": "r16", "43": "r16", "44": "r16", "45": "r16", "52": "r16", "53": "r16", "54": "r16", "55": "r16", "57": "r16" }, { "23": "r17", "24": "r17", "25": "r17", "26": "r17", "27": "r17", "28": "r17", "29": "r17", "30": "r17", "31": "r17", "32": "r17", "33": "r17", "34": "r17", "35": "r17", "36": "r17", "37": "r17", "38": "r17", "39": "r17", "40": "r17", "41": "r17", "42": "r17", "43": "r17", "44": "r17", "45": "r17", "52": "r17", "53": "r17", "54": "r17", "55": "r17", "57": "r17" }, { "4": 57, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "4": 59, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "4": 61, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "4": 63, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "23": "r22", "24": "r22", "25": "r22", "26": "r22", "27": "r22", "28": "r22", "29": "r22", "30": "r22", "31": "r22", "32": "r22", "33": "r22", "34": "r22", "35": "r22", "36": "r22", "37": "r22", "38": "r22", "39": "r22", "40": "r22", "41": "r22", "42": "r22", "43": "r22", "44": "r22", "45": "r22", "46": "r22", "47": "r22", "48": "r22", "49": "r22", "50": "r22", "51": "r22", "52": "r22", "53": "r22", "54": "r22", "55": "r22", "57": "r22" }, { "23": "r23", "24": "r23", "25": "r23", "26": "r23", "27": "r23", "28": "r23", "29": "r23", "30": "r23", "31": "r23", "32": "r23", "33": "r23", "34": "r23", "35": "r23", "36": "r23", "37": "r23", "38": "r23", "39": "r23", "40": "r23", "41": "r23", "42": "r23", "43": "r23", "44": "r23", "45": "r23", "46": "r23", "47": "r23", "48": "r23", "49": "r23", "50": "r23", "51": "r23", "52": "r23", "53": "r23", "54": "r23", "55": "r23", "57": "r23" }, { "23": "r24", "24": "r24", "25": "r24", "26": "r24", "27": "r24", "28": "r24", "29": "r24", "30": "r24", "31": "r24", "32": "r24", "33": "r24", "34": "r24", "35": "r24", "36": "r24", "37": "r24", "38": "r24", "39": "r24", "40": "r24", "41": "r24", "42": "r24", "43": "r24", "44": "r24", "45": "r24", "46": "r24", "47": "r24", "48": "r24", "49": "r24", "50": "r24", "51": "r24", "52": "r24", "53": "r24", "54": "r24", "55": "r24", "57": "r24" }, { "23": "r25", "24": "r25", "25": "r25", "26": "r25", "27": "r25", "28": "r25", "29": "r25", "30": "r25", "31": "r25", "32": "r25", "33": "r25", "34": "r25", "35": "r25", "36": "r25", "37": "r25", "38": "r25", "39": "r25", "40": "r25", "41": "r25", "42": "r25", "43": "r25", "44": "r25", "45": "r25", "46": "r25", "47": "r25", "48": "r25", "49": "r25", "50": "r25", "51": "r25", "52": "r25", "53": "r25", "54": "r25", "55": "r25", "56": "r25", "57": "r25", "58": "r25" }, { "23": "r26", "24": "r26", "25": "r26", "26": "r26", "27": "r26", "28": "r26", "29": "r26", "30": "r26", "31": "r26", "32": "r26", "33": "r26", "34": "r26", "35": "r26", "36": "r26", "37": "r26", "38": "r26", "39": "r26", "40": "r26", "41": "r26", "42": "r26", "43": "r26", "44": "r26", "45": "r26", "46": "r26", "47": "r26", "48": "r26", "49": "r26", "50": "r26", "51": "r26", "52": "r26", "53": "r26", "54": "r26", "55": "r26", "56": "r26", "57": "r26", "58": "r26" }, { "23": "r27", "24": "r27", "25": "r27", "26": "r27", "27": "r27", "28": "r27", "29": "r27", "30": "r27", "31": "r27", "32": "r27", "33": "r27", "34": "r27", "35": "r27", "36": "r27", "37": "r27", "38": "r27", "39": "r27", "40": "r27", "41": "r27", "42": "r27", "43": "r27", "44": "r27", "45": "r27", "46": "r27", "47": "r27", "48": "r27", "49": "r27", "50": "r27", "51": "r27", "52": "r27", "53": "r27", "54": "r27", "55": "r27", "56": "r27", "57": "r27", "58": "r27" }, { "23": "r28", "24": "r28", "25": "r28", "26": "r28", "27": "r28", "28": "r28", "29": "r28", "30": "r28", "31": "r28", "32": "r28", "33": "r28", "34": "r28", "35": "r28", "36": "r28", "37": "r28", "38": "r28", "39": "r28", "40": "r28", "41": "r28", "42": "r28", "43": "r28", "44": "r28", "45": "r28", "46": "r28", "47": "r28", "48": "r28", "49": "r28", "50": "r28", "51": "r28", "52": "r28", "53": "r28", "54": "r28", "55": "r28", "56": "r28", "57": "r28", "58": "r28" }, { "23": "r29", "24": "r29", "25": "r29", "26": "r29", "27": "r29", "28": "r29", "29": "r29", "30": "r29", "31": "r29", "32": "r29", "33": "r29", "34": "r29", "35": "r29", "36": "r29", "37": "r29", "38": "r29", "39": "r29", "40": "r29", "41": "r29", "42": "r29", "43": "r29", "44": "r29", "45": "r29", "46": "r29", "47": "r29", "48": "r29", "49": "r29", "50": "r29", "51": "r29", "52": "r29", "53": "r29", "54": "r29", "55": "r29", "56": "r29", "57": "r29", "58": "r29" }, { "23": "r30", "24": "r30", "25": "r30", "26": "r30", "27": "r30", "28": "r30", "29": "r30", "30": "r30", "31": "r30", "32": "r30", "33": "r30", "34": "r30", "35": "r30", "36": "r30", "37": "r30", "38": "r30", "39": "r30", "40": "r30", "41": "r30", "42": "r30", "43": "r30", "44": "r30", "45": "r30", "46": "r30", "47": "r30", "48": "r30", "49": "r30", "50": "r30", "51": "r30", "52": "r30", "53": "r30", "54": "r30", "55": "r30", "56": "r30", "57": "r30", "58": "r30" }, { "23": "r31", "24": "r31", "25": "r31", "26": "r31", "27": "r31", "28": "r31", "29": "r31", "30": "r31", "31": "r31", "32": "r31", "33": "r31", "34": "r31", "35": "r31", "36": "r31", "37": "r31", "38": "r31", "39": "r31", "40": "r31", "41": "r31", "42": "r31", "43": "r31", "44": "r31", "45": "r31", "46": "r31", "47": "r31", "48": "r31", "49": "r31", "50": "r31", "51": "r31", "52": "r31", "53": "r31", "54": "r31", "55": "r31", "56": "r31", "57": "r31", "58": "r31" }, { "23": "r32", "24": "r32", "25": "r32", "26": "r32", "27": "r32", "28": "r32", "29": "r32", "30": "r32", "31": "r32", "32": "r32", "33": "r32", "34": "r32", "35": "r32", "36": "r32", "37": "r32", "38": "r32", "39": "r32", "40": "r32", "41": "r32", "42": "r32", "43": "r32", "44": "r32", "45": "r32", "46": "r32", "47": "r32", "48": "r32", "49": "r32", "50": "r32", "51": "r32", "52": "r32", "53": "r32", "54": "r32", "55": "r32", "56": "r32", "57": "r32", "58": "r32" }, { "23": "r33", "24": "r33", "25": "r33", "26": "r33", "27": "r33", "28": "r33", "29": "r33", "30": "r33", "31": "r33", "32": "r33", "33": "r33", "34": "r33", "35": "r33", "36": "r33", "37": "r33", "38": "r33", "39": "r33", "40": "r33", "41": "r33", "42": "r33", "43": "r33", "44": "r33", "45": "r33", "46": "r33", "47": "r33", "48": "r33", "49": "r33", "50": "r33", "51": "r33", "52": "r33", "53": "r33", "54": "r33", "55": "r33", "56": "r33", "57": "r33", "58": "r33" }, { "23": "r34", "24": "r34", "25": "r34", "26": "r34", "27": "r34", "28": "r34", "29": "r34", "30": "r34", "31": "r34", "32": "r34", "33": "r34", "34": "r34", "35": "r34", "36": "r34", "37": "r34", "38": "r34", "39": "r34", "40": "r34", "41": "r34", "42": "r34", "43": "r34", "44": "r34", "45": "r34", "46": "r34", "47": "r34", "48": "r34", "49": "r34", "50": "r34", "51": "r34", "52": "r34", "53": "r34", "54": "r34", "55": "r34", "56": "r34", "57": "r34", "58": "r34" }, { "23": "r35", "24": "r35", "25": "r35", "26": "r35", "27": "r35", "28": "r35", "29": "r35", "30": "r35", "31": "r35", "32": "r35", "33": "r35", "34": "r35", "35": "r35", "36": "r35", "37": "r35", "38": "r35", "39": "r35", "40": "r35", "41": "r35", "42": "r35", "43": "r35", "44": "r35", "45": "r35", "46": "r35", "47": "r35", "48": "r35", "49": "r35", "50": "r35", "51": "r35", "52": "r35", "53": "r35", "54": "r35", "55": "r35", "56": "r35", "57": "r35", "58": "r35" }, { "23": "r36", "24": "r36", "25": "r36", "26": "r36", "27": "r36", "28": "r36", "29": "r36", "30": "r36", "31": "r36", "32": "r36", "33": "r36", "34": "r36", "35": "r36", "36": "r36", "37": "r36", "38": "r36", "39": "r36", "40": "r36", "41": "r36", "42": "r36", "43": "r36", "44": "r36", "45": "r36", "46": "r36", "47": "r36", "48": "r36", "49": "r36", "50": "r36", "51": "r36", "52": "r36", "53": "r36", "54": "r36", "55": "r36", "56": "r36", "57": "r36", "58": "r36" }, { "10": 70, "18": 65, "19": 66, "21": 67, "22": 69, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r54", "58": "s68" }, { "10": 70, "18": 83, "19": 66, "21": 67, "22": 69, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r54", "58": "s68" }, { "23": "r47", "24": "r47", "25": "r47", "26": "r47", "27": "r47", "28": "r47", "29": "r47", "30": "r47", "31": "r47", "32": "r47", "33": "r47", "34": "r47", "35": "r47", "36": "r47", "37": "r47", "38": "r47", "39": "r47", "40": "r47", "41": "r47", "42": "r47", "43": "r47", "44": "r47", "45": "r47", "46": "r47", "47": "r47", "48": "r47", "49": "r47", "50": "r47", "51": "r47", "52": "r47", "53": "r47", "54": "r47", "55": "r47", "57": "r47" }, { "23": "r48", "24": "r48", "25": "r48", "26": "r48", "27": "r48", "28": "r48", "29": "r48", "30": "r48", "31": "r48", "32": "r48", "33": "r48", "34": "r48", "35": "r48", "36": "r48", "37": "r48", "38": "r48", "39": "r48", "40": "r48", "41": "r48", "42": "r48", "43": "r48", "44": "r48", "45": "r48", "46": "r48", "47": "r48", "48": "r48", "49": "r48", "50": "r48", "51": "r48", "52": "r48", "53": "r48", "54": "r48", "55": "r48", "57": "r48" }, { "4": 85, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "4": 87, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "4": 89, "5": 5, "6": 6, "24": "r10", "25": "r10", "26": "r10", "27": "r10", "28": "r10", "29": "r10", "30": "r10", "31": "r10", "32": "r10", "33": "r10", "34": "r10", "35": "r10", "36": "r10", "37": "r10", "38": "r10", "39": "r10", "40": "r10", "41": "r10", "42": "r10", "43": "r10", "44": "r10", "45": "r10", "52": "r10", "53": "r10", "54": "r10", "55": "r10", "57": "r10" }, { "23": "r13", "24": "r13", "25": "r13", "26": "r13", "27": "r13", "28": "r13", "29": "r13", "30": "r13", "31": "r13", "32": "r13", "33": "r13", "34": "r13", "35": "r13", "36": "r13", "37": "r13", "38": "r13", "39": "r13", "40": "r13", "41": "r13", "42": "r13", "43": "r13", "44": "r13", "45": "r13", "52": "r13", "53": "r13", "54": "r13", "55": "r13", "57": "r13" }, { "23": "r37", "24": "r37", "25": "r37", "26": "r37", "27": "r37", "28": "r37", "29": "r37", "30": "r37", "31": "r37", "32": "r37", "33": "r37", "34": "r37", "35": "r37", "36": "r37", "37": "r37", "38": "r37", "39": "r37", "40": "r37", "41": "r37", "42": "r37", "43": "r37", "44": "r37", "45": "r37", "52": "r37", "53": "r37", "54": "r37", "55": "r37", "57": "r37" }, { "23": "r39", "24": "r39", "25": "r39", "26": "r39", "27": "r39", "28": "r39", "29": "r39", "30": "r39", "31": "r39", "32": "r39", "33": "r39", "34": "r39", "35": "r39", "36": "r39", "37": "r39", "38": "r39", "39": "r39", "40": "r39", "41": "r39", "42": "r39", "43": "r39", "44": "r39", "45": "r39", "46": "s56", "52": "r39", "53": "r39", "54": "r39", "55": "r39", "57": "r39" }, { "23": "r41", "24": "r41", "25": "r41", "26": "r41", "27": "r41", "28": "r41", "29": "r41", "30": "r41", "31": "r41", "32": "r41", "33": "r41", "34": "r41", "35": "r41", "36": "r41", "37": "r41", "38": "r41", "39": "r41", "40": "r41", "41": "r41", "42": "r41", "43": "r41", "44": "r41", "45": "r41", "46": "r41", "52": "r41", "53": "r41", "54": "r41", "55": "r41", "57": "r41" }, { "23": "r42", "24": "r42", "25": "r42", "26": "r42", "27": "r42", "28": "r42", "29": "r42", "30": "r42", "31": "r42", "32": "r42", "33": "r42", "34": "r42", "35": "r42", "36": "r42", "37": "r42", "38": "r42", "39": "r42", "40": "r42", "41": "r42", "42": "r42", "43": "r42", "44": "r42", "45": "r42", "46": "r42", "52": "r42", "53": "r42", "54": "r42", "55": "r42", "57": "r42" }, { "23": "r43", "24": "r43", "25": "r43", "26": "r43", "27": "r43", "28": "r43", "29": "r43", "30": "r43", "31": "r43", "32": "r43", "33": "r43", "34": "r43", "35": "r43", "36": "r43", "37": "r43", "38": "r43", "39": "r43", "40": "r43", "41": "r43", "42": "r43", "43": "r43", "44": "r43", "45": "r43", "46": "r43", "52": "r43", "53": "r43", "54": "r43", "55": "r43", "57": "r43" }, { "23": "r44", "24": "r44", "25": "r44", "26": "r44", "27": "r44", "28": "r44", "29": "r44", "30": "r44", "31": "r44", "32": "r44", "33": "r44", "34": "r44", "35": "r44", "36": "r44", "37": "r44", "38": "r44", "39": "r44", "40": "r44", "41": "r44", "42": "r44", "43": "r44", "44": "r44", "45": "r44", "46": "r44", "52": "r44", "53": "r44", "54": "r44", "55": "r44", "57": "r44" }, { "23": "r45", "24": "r45", "25": "r45", "26": "r45", "27": "r45", "28": "r45", "29": "r45", "30": "r45", "31": "r45", "32": "r45", "33": "r45", "34": "r45", "35": "r45", "36": "r45", "37": "r45", "38": "r45", "39": "r45", "40": "r45", "41": "r45", "42": "r45", "43": "r45", "44": "r45", "45": "r45", "46": "r45", "52": "r45", "53": "r45", "54": "r45", "55": "r45", "57": "r45" }, { "23": "r46", "24": "r46", "25": "r46", "26": "r46", "27": "r46", "28": "r46", "29": "r46", "30": "r46", "31": "r46", "32": "r46", "33": "r46", "34": "r46", "35": "r46", "36": "r46", "37": "r46", "38": "r46", "39": "r46", "40": "r46", "41": "r46", "42": "r46", "43": "r46", "44": "r46", "45": "r46", "46": "r46", "52": "r46", "53": "r46", "54": "r46", "55": "r46", "57": "r46" }, { "23": "r40", "24": "r40", "25": "r40", "26": "r40", "27": "r40", "28": "r40", "29": "r40", "30": "r40", "31": "r40", "32": "r40", "33": "r40", "34": "r40", "35": "r40", "36": "r40", "37": "r40", "38": "r40", "39": "r40", "40": "r40", "41": "r40", "42": "r40", "43": "r40", "44": "r40", "45": "r40", "52": "r40", "53": "r40", "54": "r40", "55": "r40", "57": "r40" }, { "25": "s12", "31": "s58" }, { "23": "r18", "24": "r18", "25": "r18", "26": "r18", "27": "r18", "28": "r18", "29": "r18", "30": "r18", "31": "r18", "32": "r18", "33": "r18", "34": "r18", "35": "r18", "36": "r18", "37": "r18", "38": "r18", "39": "r18", "40": "r18", "41": "r18", "42": "r18", "43": "r18", "44": "r18", "45": "r18", "52": "r18", "53": "r18", "54": "r18", "55": "r18", "57": "r18" }, { "25": "s12", "31": "s60" }, { "23": "r19", "24": "r19", "25": "r19", "26": "r19", "27": "r19", "28": "r19", "29": "r19", "30": "r19", "31": "r19", "32": "r19", "33": "r19", "34": "r19", "35": "r19", "36": "r19", "37": "r19", "38": "r19", "39": "r19", "40": "r19", "41": "r19", "42": "r19", "43": "r19", "44": "r19", "45": "r19", "52": "r19", "53": "r19", "54": "r19", "55": "r19", "57": "r19" }, { "25": "s12", "31": "s62" }, { "23": "r20", "24": "r20", "25": "r20", "26": "r20", "27": "r20", "28": "r20", "29": "r20", "30": "r20", "31": "r20", "32": "r20", "33": "r20", "34": "r20", "35": "r20", "36": "r20", "37": "r20", "38": "r20", "39": "r20", "40": "r20", "41": "r20", "42": "r20", "43": "r20", "44": "r20", "45": "r20", "52": "r20", "53": "r20", "54": "r20", "55": "r20", "57": "r20" }, { "25": "s12", "31": "s64" }, { "23": "r21", "24": "r21", "25": "r21", "26": "r21", "27": "r21", "28": "r21", "29": "r21", "30": "r21", "31": "r21", "32": "r21", "33": "r21", "34": "r21", "35": "r21", "36": "r21", "37": "r21", "38": "r21", "39": "r21", "40": "r21", "41": "r21", "42": "r21", "43": "r21", "44": "r21", "45": "r21", "52": "r21", "53": "r21", "54": "r21", "55": "r21", "57": "r21" }, { "56": "s72" }, { "56": "r55" }, { "10": 70, "20": 73, "21": 75, "22": 76, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r56", "58": "s74" }, { "24": "r62", "28": "r62", "35": "r62", "36": "r62", "37": "r62", "38": "r62", "39": "r62", "40": "r62", "41": "r62", "42": "r62", "43": "r62", "44": "r62", "45": "r62", "56": "r62", "58": "r62" }, { "24": "r63", "28": "r63", "35": "r63", "36": "r63", "37": "r63", "38": "r63", "39": "r63", "40": "r63", "41": "r63", "42": "r63", "43": "r63", "44": "r63", "45": "r63", "56": "r63", "58": "r63" }, { "24": "r64", "28": "r64", "35": "r64", "36": "r64", "37": "r64", "38": "r64", "39": "r64", "40": "r64", "41": "r64", "42": "r64", "43": "r64", "44": "r64", "45": "r64", "56": "r64", "58": "r64" }, { "24": "r65", "28": "r65", "35": "r65", "36": "r65", "37": "r65", "38": "r65", "39": "r65", "40": "r65", "41": "r65", "42": "r65", "43": "r65", "44": "r65", "45": "r65", "56": "r65", "58": "r65" }, { "23": "r52", "24": "r52", "25": "r52", "26": "r52", "27": "r52", "28": "r52", "29": "r52", "30": "r52", "31": "r52", "32": "r52", "33": "r52", "34": "r52", "35": "r52", "36": "r52", "37": "r52", "38": "r52", "39": "r52", "40": "r52", "41": "r52", "42": "r52", "43": "r52", "44": "r52", "45": "r52", "46": "r52", "47": "r52", "48": "r52", "49": "r52", "50": "r52", "51": "r52", "52": "r52", "53": "r52", "54": "r52", "55": "r52", "57": "r52" }, { "56": "r57" }, { "10": 70, "21": 77, "22": 69, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r62", "58": "s68" }, { "56": "r59" }, { "10": 70, "20": 79, "21": 75, "22": 76, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r63", "58": "s80" }, { "10": 70, "18": 78, "19": 66, "21": 67, "22": 69, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r54", "58": "s68" }, { "56": "r58" }, { "56": "r60" }, { "10": 70, "21": 81, "22": 69, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r62", "58": "s68" }, { "10": 70, "18": 82, "19": 66, "21": 67, "22": 69, "24": "s28", "28": "s71", "35": "s29", "36": "s30", "37": "s31", "38": "s32", "39": "s33", "40": "s34", "41": "s35", "42": "s36", "43": "s37", "44": "s38", "45": "s39", "56": "r54", "58": "s68" }, { "56": "r61" }, { "56": "s84" }, { "23": "r53", "24": "r53", "25": "r53", "26": "r53", "27": "r53", "28": "r53", "29": "r53", "30": "r53", "31": "r53", "32": "r53", "33": "r53", "34": "r53", "35": "r53", "36": "r53", "37": "r53", "38": "r53", "39": "r53", "40": "r53", "41": "r53", "42": "r53", "43": "r53", "44": "r53", "45": "r53", "46": "r53", "47": "r53", "48": "r53", "49": "r53", "50": "r53", "51": "r53", "52": "r53", "53": "r53", "54": "r53", "55": "r53", "57": "r53" }, { "25": "s12", "31": "s86" }, { "23": "r49", "24": "r49", "25": "r49", "26": "r49", "27": "r49", "28": "r49", "29": "r49", "30": "r49", "31": "r49", "32": "r49", "33": "r49", "34": "r49", "35": "r49", "36": "r49", "37": "r49", "38": "r49", "39": "r49", "40": "r49", "41": "r49", "42": "r49", "43": "r49", "44": "r49", "45": "r49", "46": "r49", "47": "r49", "48": "r49", "49": "r49", "50": "r49", "51": "r49", "52": "r49", "53": "r49", "54": "r49", "55": "r49", "57": "r49" }, { "25": "s12", "31": "s88" }, { "23": "r50", "24": "r50", "25": "r50", "26": "r50", "27": "r50", "28": "r50", "29": "r50", "30": "r50", "31": "r50", "32": "r50", "33": "r50", "34": "r50", "35": "r50", "36": "r50", "37": "r50", "38": "r50", "39": "r50", "40": "r50", "41": "r50", "42": "r50", "43": "r50", "44": "r50", "45": "r50", "46": "r50", "47": "r50", "48": "r50", "49": "r50", "50": "r50", "51": "r50", "52": "r50", "53": "r50", "54": "r50", "55": "r50", "57": "r50" }, { "25": "s12", "31": "s90" }, { "23": "r51", "24": "r51", "25": "r51", "26": "r51", "27": "r51", "28": "r51", "29": "r51", "30": "r51", "31": "r51", "32": "r51", "33": "r51", "34": "r51", "35": "r51", "36": "r51", "37": "r51", "38": "r51", "39": "r51", "40": "r51", "41": "r51", "42": "r51", "43": "r51", "44": "r51", "45": "r51", "46": "r51", "47": "r51", "48": "r51", "49": "r51", "50": "r51", "51": "r51", "52": "r51", "53": "r51", "54": "r51", "55": "r51", "57": "r51" }]; - -/** - * Parsing stack. - */ -var stack = []; - -/** - * Tokenizer instance. - */ -var tokenizer = void 0; -/** - * Generic tokenizer used by the parser in the Syntax tool. - * - * https://www.npmjs.com/package/syntax-cli - * - * See `--custom-tokinzer` to skip this generation, and use a custom one. - */ - -var lexRules = [[/^#[^\n]+/, function () {/* skip comments */}], [/^\s+/, function () {/* skip whitespace */}], [/^-/, function () { - return 'DASH'; -}], [/^\//, function () { - return 'CHAR'; -}], [/^#/, function () { - return 'CHAR'; -}], [/^\|/, function () { - return 'CHAR'; -}], [/^\./, function () { - return 'CHAR'; -}], [/^\{/, function () { - return 'CHAR'; -}], [/^\{\d+\}/, function () { - return 'RANGE_EXACT'; -}], [/^\{\d+,\}/, function () { - return 'RANGE_OPEN'; -}], [/^\{\d+,\d+\}/, function () { - return 'RANGE_CLOSED'; -}], [/^\\k<(([\u0041-\u005a\u0061-\u007a\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4-\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e81-\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5-\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a-\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c-\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\udd40-\udd74\ude80-\ude9c\udea0-\uded0\udf00-\udf1f\udf2d-\udf4a\udf50-\udf75\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf\udfd1-\udfd5]|\ud801[\udc00-\udc9d\udcb0-\udcd3\udcd8-\udcfb\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37-\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udce0-\udcf2\udcf4-\udcf5\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe-\uddbf\ude00\ude10-\ude13\ude15-\ude17\ude19-\ude35\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee4\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48\udc80-\udcb2\udcc0-\udcf2\udd00-\udd23\udf00-\udf1c\udf27\udf30-\udf45\udfe0-\udff6]|\ud804[\udc03-\udc37\udc83-\udcaf\udcd0-\udce8\udd03-\udd26\udd44\udd50-\udd72\udd76\udd83-\uddb2\uddc1-\uddc4\uddda\udddc\ude00-\ude11\ude13-\ude2b\ude80-\ude86\ude88\ude8a-\ude8d\ude8f-\ude9d\ude9f-\udea8\udeb0-\udede\udf05-\udf0c\udf0f-\udf10\udf13-\udf28\udf2a-\udf30\udf32-\udf33\udf35-\udf39\udf3d\udf50\udf5d-\udf61]|\ud805[\udc00-\udc34\udc47-\udc4a\udc5f\udc80-\udcaf\udcc4-\udcc5\udcc7\udd80-\uddae\uddd8-\udddb\ude00-\ude2f\ude44\ude80-\udeaa\udeb8\udf00-\udf1a]|\ud806[\udc00-\udc2b\udca0-\udcdf\udcff\udda0-\udda7\uddaa-\uddd0\udde1\udde3\ude00\ude0b-\ude32\ude3a\ude50\ude5c-\ude89\ude9d\udec0-\udef8]|\ud807[\udc00-\udc08\udc0a-\udc2e\udc40\udc72-\udc8f\udd00-\udd06\udd08-\udd09\udd0b-\udd30\udd46\udd60-\udd65\udd67-\udd68\udd6a-\udd89\udd98\udee0-\udef2]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38\ude40-\ude5e\uded0-\udeed\udf00-\udf2f\udf40-\udf43\udf63-\udf77\udf7d-\udf8f]|\ud81b[\ude40-\ude7f\udf00-\udf4a\udf50\udf93-\udf9f\udfe0-\udfe1\udfe3]|\ud81c[\udc00-\udfff]|\ud81d[\udc00-\udfff]|\ud81e[\udc00-\udfff]|\ud81f[\udc00-\udfff]|\ud820[\udc00-\udfff]|\ud821[\udc00-\udff7]|\ud822[\udc00-\udef2]|\ud82c[\udc00-\udd1e\udd50-\udd52\udd64-\udd67\udd70-\udefb]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e-\udc9f\udca2\udca5-\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb]|\ud838[\udd00-\udd2c\udd37-\udd3d\udd4e\udec0-\udeeb]|\ud83a[\udc00-\udcc4\udd00-\udd43\udd4b]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21-\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51-\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61-\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d\udc20-\udfff]|\ud86f[\udc00-\udfff]|\ud870[\udc00-\udfff]|\ud871[\udc00-\udfff]|\ud872[\udc00-\udfff]|\ud873[\udc00-\udea1\udeb0-\udfff]|\ud874[\udc00-\udfff]|\ud875[\udc00-\udfff]|\ud876[\udc00-\udfff]|\ud877[\udc00-\udfff]|\ud878[\udc00-\udfff]|\ud879[\udc00-\udfff]|\ud87a[\udc00-\udfe0]|\ud87e[\udc00-\ude1d])|[$_]|(\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]{1,}\}))(([\u0030-\u0039\u0041-\u005a\u005f\u0061-\u007a\u00aa\u00b5\u00b7\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376-\u0377\u037a-\u037d\u037f\u0386-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u05d0-\u05ea\u05ef-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u07fd\u0800-\u082d\u0840-\u085b\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u08d3-\u08e1\u08e3-\u0963\u0966-\u096f\u0971-\u0983\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7-\u09c8\u09cb-\u09ce\u09d7\u09dc-\u09dd\u09df-\u09e3\u09e6-\u09f1\u09fc\u09fe\u0a01-\u0a03\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a3c\u0a3e-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0af9-\u0aff\u0b01-\u0b03\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b5c-\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82-\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c00-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c58-\u0c5a\u0c60-\u0c63\u0c66-\u0c6f\u0c80-\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5-\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1-\u0cf2\u0d00-\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d54-\u0d57\u0d5f-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82-\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2-\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18-\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1369-\u1371\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772-\u1773\u1780-\u17d3\u17d7\u17dc-\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1878\u1880-\u18aa\u18b0-\u18f5\u1900-\u191e\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19da\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1ab0-\u1abd\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1cd0-\u1cd2\u1cd4-\u1cfa\u1d00-\u1df9\u1dfb-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua827\ua840-\ua873\ua880-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua8fd-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\ua9e0-\ua9fe\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabea\uabec-\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe2f\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b\udc0d-\udc26\udc28-\udc3a\udc3c-\udc3d\udc3f-\udc4d\udc50-\udc5d\udc80-\udcfa\udd40-\udd74\uddfd\ude80-\ude9c\udea0-\uded0\udee0\udf00-\udf1f\udf2d-\udf4a\udf50-\udf7a\udf80-\udf9d\udfa0-\udfc3\udfc8-\udfcf\udfd1-\udfd5]|\ud801[\udc00-\udc9d\udca0-\udca9\udcb0-\udcd3\udcd8-\udcfb\udd00-\udd27\udd30-\udd63\ude00-\udf36\udf40-\udf55\udf60-\udf67]|\ud802[\udc00-\udc05\udc08\udc0a-\udc35\udc37-\udc38\udc3c\udc3f-\udc55\udc60-\udc76\udc80-\udc9e\udce0-\udcf2\udcf4-\udcf5\udd00-\udd15\udd20-\udd39\udd80-\uddb7\uddbe-\uddbf\ude00-\ude03\ude05-\ude06\ude0c-\ude13\ude15-\ude17\ude19-\ude35\ude38-\ude3a\ude3f\ude60-\ude7c\ude80-\ude9c\udec0-\udec7\udec9-\udee6\udf00-\udf35\udf40-\udf55\udf60-\udf72\udf80-\udf91]|\ud803[\udc00-\udc48\udc80-\udcb2\udcc0-\udcf2\udd00-\udd27\udd30-\udd39\udf00-\udf1c\udf27\udf30-\udf50\udfe0-\udff6]|\ud804[\udc00-\udc46\udc66-\udc6f\udc7f-\udcba\udcd0-\udce8\udcf0-\udcf9\udd00-\udd34\udd36-\udd3f\udd44-\udd46\udd50-\udd73\udd76\udd80-\uddc4\uddc9-\uddcc\uddd0-\uddda\udddc\ude00-\ude11\ude13-\ude37\ude3e\ude80-\ude86\ude88\ude8a-\ude8d\ude8f-\ude9d\ude9f-\udea8\udeb0-\udeea\udef0-\udef9\udf00-\udf03\udf05-\udf0c\udf0f-\udf10\udf13-\udf28\udf2a-\udf30\udf32-\udf33\udf35-\udf39\udf3b-\udf44\udf47-\udf48\udf4b-\udf4d\udf50\udf57\udf5d-\udf63\udf66-\udf6c\udf70-\udf74]|\ud805[\udc00-\udc4a\udc50-\udc59\udc5e-\udc5f\udc80-\udcc5\udcc7\udcd0-\udcd9\udd80-\uddb5\uddb8-\uddc0\uddd8-\udddd\ude00-\ude40\ude44\ude50-\ude59\ude80-\udeb8\udec0-\udec9\udf00-\udf1a\udf1d-\udf2b\udf30-\udf39]|\ud806[\udc00-\udc3a\udca0-\udce9\udcff\udda0-\udda7\uddaa-\uddd7\uddda-\udde1\udde3-\udde4\ude00-\ude3e\ude47\ude50-\ude99\ude9d\udec0-\udef8]|\ud807[\udc00-\udc08\udc0a-\udc36\udc38-\udc40\udc50-\udc59\udc72-\udc8f\udc92-\udca7\udca9-\udcb6\udd00-\udd06\udd08-\udd09\udd0b-\udd36\udd3a\udd3c-\udd3d\udd3f-\udd47\udd50-\udd59\udd60-\udd65\udd67-\udd68\udd6a-\udd8e\udd90-\udd91\udd93-\udd98\udda0-\udda9\udee0-\udef6]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38\ude40-\ude5e\ude60-\ude69\uded0-\udeed\udef0-\udef4\udf00-\udf36\udf40-\udf43\udf50-\udf59\udf63-\udf77\udf7d-\udf8f]|\ud81b[\ude40-\ude7f\udf00-\udf4a\udf4f-\udf87\udf8f-\udf9f\udfe0-\udfe1\udfe3]|\ud81c[\udc00-\udfff]|\ud81d[\udc00-\udfff]|\ud81e[\udc00-\udfff]|\ud81f[\udc00-\udfff]|\ud820[\udc00-\udfff]|\ud821[\udc00-\udff7]|\ud822[\udc00-\udef2]|\ud82c[\udc00-\udd1e\udd50-\udd52\udd64-\udd67\udd70-\udefb]|\ud82f[\udc00-\udc6a\udc70-\udc7c\udc80-\udc88\udc90-\udc99\udc9d-\udc9e]|\ud834[\udd65-\udd69\udd6d-\udd72\udd7b-\udd82\udd85-\udd8b\uddaa-\uddad\ude42-\ude44]|\ud835[\udc00-\udc54\udc56-\udc9c\udc9e-\udc9f\udca2\udca5-\udca6\udca9-\udcac\udcae-\udcb9\udcbb\udcbd-\udcc3\udcc5-\udd05\udd07-\udd0a\udd0d-\udd14\udd16-\udd1c\udd1e-\udd39\udd3b-\udd3e\udd40-\udd44\udd46\udd4a-\udd50\udd52-\udea5\udea8-\udec0\udec2-\udeda\udedc-\udefa\udefc-\udf14\udf16-\udf34\udf36-\udf4e\udf50-\udf6e\udf70-\udf88\udf8a-\udfa8\udfaa-\udfc2\udfc4-\udfcb\udfce-\udfff]|\ud836[\ude00-\ude36\ude3b-\ude6c\ude75\ude84\ude9b-\ude9f\udea1-\udeaf]|\ud838[\udc00-\udc06\udc08-\udc18\udc1b-\udc21\udc23-\udc24\udc26-\udc2a\udd00-\udd2c\udd30-\udd3d\udd40-\udd49\udd4e\udec0-\udef9]|\ud83a[\udc00-\udcc4\udcd0-\udcd6\udd00-\udd4b\udd50-\udd59]|\ud83b[\ude00-\ude03\ude05-\ude1f\ude21-\ude22\ude24\ude27\ude29-\ude32\ude34-\ude37\ude39\ude3b\ude42\ude47\ude49\ude4b\ude4d-\ude4f\ude51-\ude52\ude54\ude57\ude59\ude5b\ude5d\ude5f\ude61-\ude62\ude64\ude67-\ude6a\ude6c-\ude72\ude74-\ude77\ude79-\ude7c\ude7e\ude80-\ude89\ude8b-\ude9b\udea1-\udea3\udea5-\udea9\udeab-\udebb]|\ud840[\udc00-\udfff]|\ud841[\udc00-\udfff]|\ud842[\udc00-\udfff]|\ud843[\udc00-\udfff]|\ud844[\udc00-\udfff]|\ud845[\udc00-\udfff]|\ud846[\udc00-\udfff]|\ud847[\udc00-\udfff]|\ud848[\udc00-\udfff]|\ud849[\udc00-\udfff]|\ud84a[\udc00-\udfff]|\ud84b[\udc00-\udfff]|\ud84c[\udc00-\udfff]|\ud84d[\udc00-\udfff]|\ud84e[\udc00-\udfff]|\ud84f[\udc00-\udfff]|\ud850[\udc00-\udfff]|\ud851[\udc00-\udfff]|\ud852[\udc00-\udfff]|\ud853[\udc00-\udfff]|\ud854[\udc00-\udfff]|\ud855[\udc00-\udfff]|\ud856[\udc00-\udfff]|\ud857[\udc00-\udfff]|\ud858[\udc00-\udfff]|\ud859[\udc00-\udfff]|\ud85a[\udc00-\udfff]|\ud85b[\udc00-\udfff]|\ud85c[\udc00-\udfff]|\ud85d[\udc00-\udfff]|\ud85e[\udc00-\udfff]|\ud85f[\udc00-\udfff]|\ud860[\udc00-\udfff]|\ud861[\udc00-\udfff]|\ud862[\udc00-\udfff]|\ud863[\udc00-\udfff]|\ud864[\udc00-\udfff]|\ud865[\udc00-\udfff]|\ud866[\udc00-\udfff]|\ud867[\udc00-\udfff]|\ud868[\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|\ud86a[\udc00-\udfff]|\ud86b[\udc00-\udfff]|\ud86c[\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d\udc20-\udfff]|\ud86f[\udc00-\udfff]|\ud870[\udc00-\udfff]|\ud871[\udc00-\udfff]|\ud872[\udc00-\udfff]|\ud873[\udc00-\udea1\udeb0-\udfff]|\ud874[\udc00-\udfff]|\ud875[\udc00-\udfff]|\ud876[\udc00-\udfff]|\ud877[\udc00-\udfff]|\ud878[\udc00-\udfff]|\ud879[\udc00-\udfff]|\ud87a[\udc00-\udfe0]|\ud87e[\udc00-\ude1d]|\udb40[\udd00-\uddef])|[$_]|(\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]{1,}\})|[\u200c\u200d])*>/, function () { - var groupName = yytext.slice(3, -1); - validateUnicodeGroupName(groupName, this.getCurrentState()); - return 'NAMED_GROUP_REF'; -}], [/^\\b/, function () { - return 'ESC_b'; -}], [/^\\B/, function () { - return 'ESC_B'; -}], [/^\\c[a-zA-Z]/, function () { - return 'CTRL_CH'; -}], [/^\\0\d{1,2}/, function () { - return 'OCT_CODE'; -}], [/^\\0/, function () { - return 'DEC_CODE'; -}], [/^\\\d{1,3}/, function () { - return 'DEC_CODE'; -}], [/^\\u[dD][89abAB][0-9a-fA-F]{2}\\u[dD][c-fC-F][0-9a-fA-F]{2}/, function () { - return 'U_CODE_SURROGATE'; -}], [/^\\u\{[0-9a-fA-F]{1,}\}/, function () { - return 'U_CODE'; -}], [/^\\u[0-9a-fA-F]{4}/, function () { - return 'U_CODE'; -}], [/^\\[pP]\{\w+(?:=\w+)?\}/, function () { - return 'U_PROP_VALUE_EXP'; -}], [/^\\x[0-9a-fA-F]{2}/, function () { - return 'HEX_CODE'; -}], [/^\\[tnrdDsSwWvf]/, function () { - return 'META_CHAR'; -}], [/^\\\//, function () { - return 'ESC_CHAR'; -}], [/^\\[ #]/, function () { - return 'ESC_CHAR'; -}], [/^\\[\^\$\.\*\+\?\(\)\\\[\]\{\}\|\/]/, function () { - return 'ESC_CHAR'; -}], [/^\\[^*?+\[()\\|]/, function () { - var s = this.getCurrentState(); - if (s === 'u_class' && yytext === "\\-") { - return 'ESC_CHAR'; - } else if (s === 'u' || s === 'xu' || s === 'u_class') { - throw new SyntaxError('invalid Unicode escape ' + yytext); - } - return 'ESC_CHAR'; -}], [/^\(/, function () { - return 'CHAR'; -}], [/^\)/, function () { - return 'CHAR'; -}], [/^\(\?=/, function () { - return 'POS_LA_ASSERT'; -}], [/^\(\?!/, function () { - return 'NEG_LA_ASSERT'; -}], [/^\(\?<=/, function () { - return 'POS_LB_ASSERT'; -}], [/^\(\?/, function () { - yytext = yytext.slice(3, -1); - validateUnicodeGroupName(yytext, this.getCurrentState()); - return 'NAMED_CAPTURE_GROUP'; -}], [/^\(/, function () { - return 'L_PAREN'; -}], [/^\)/, function () { - return 'R_PAREN'; -}], [/^[*?+[^$]/, function () { - return 'CHAR'; -}], [/^\\\]/, function () { - return 'ESC_CHAR'; -}], [/^\]/, function () { - this.popState();return 'R_BRACKET'; -}], [/^\^/, function () { - return 'BOS'; -}], [/^\$/, function () { - return 'EOS'; -}], [/^\*/, function () { - return 'STAR'; -}], [/^\?/, function () { - return 'Q_MARK'; -}], [/^\+/, function () { - return 'PLUS'; -}], [/^\|/, function () { - return 'BAR'; -}], [/^\./, function () { - return 'ANY'; -}], [/^\//, function () { - return 'SLASH'; -}], [/^[^*?+\[()\\|]/, function () { - return 'CHAR'; -}], [/^\[\^/, function () { - var s = this.getCurrentState();this.pushState(s === 'u' || s === 'xu' ? 'u_class' : 'class');return 'NEG_CLASS'; -}], [/^\[/, function () { - var s = this.getCurrentState();this.pushState(s === 'u' || s === 'xu' ? 'u_class' : 'class');return 'L_BRACKET'; -}]]; -var lexRulesByConditions = { "INITIAL": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 22, 23, 24, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], "u": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], "xu": [0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], "x": [0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 22, 23, 24, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], "u_class": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], "class": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51] }; - -var EOF_TOKEN = { - type: EOF, - value: '' -}; - -tokenizer = { - initString: function initString(string) { - this._string = string; - this._cursor = 0; - - this._states = ['INITIAL']; - this._tokensQueue = []; - - this._currentLine = 1; - this._currentColumn = 0; - this._currentLineBeginOffset = 0; - - /** - * Matched token location data. - */ - this._tokenStartOffset = 0; - this._tokenEndOffset = 0; - this._tokenStartLine = 1; - this._tokenEndLine = 1; - this._tokenStartColumn = 0; - this._tokenEndColumn = 0; - - return this; - }, - - - /** - * Returns tokenizer states. - */ - getStates: function getStates() { - return this._states; - }, - getCurrentState: function getCurrentState() { - return this._states[this._states.length - 1]; - }, - pushState: function pushState(state) { - this._states.push(state); - }, - begin: function begin(state) { - this.pushState(state); - }, - popState: function popState() { - if (this._states.length > 1) { - return this._states.pop(); - } - return this._states[0]; - }, - getNextToken: function getNextToken() { - // Something was queued, return it. - if (this._tokensQueue.length > 0) { - return this.onToken(this._toToken(this._tokensQueue.shift())); - } - - if (!this.hasMoreTokens()) { - return this.onToken(EOF_TOKEN); - } - - var string = this._string.slice(this._cursor); - var lexRulesForState = lexRulesByConditions[this.getCurrentState()]; - - for (var i = 0; i < lexRulesForState.length; i++) { - var lexRuleIndex = lexRulesForState[i]; - var lexRule = lexRules[lexRuleIndex]; - - var matched = this._match(string, lexRule[0]); - - // Manual handling of EOF token (the end of string). Return it - // as `EOF` symbol. - if (string === '' && matched === '') { - this._cursor++; - } - - if (matched !== null) { - yytext = matched; - yytext.length; - var token = lexRule[1].call(this); - - if (!token) { - return this.getNextToken(); - } - - // If multiple tokens are returned, save them to return - // on next `getNextToken` call. - - if (Array.isArray(token)) { - var tokensToQueue = token.slice(1); - token = token[0]; - if (tokensToQueue.length > 0) { - var _tokensQueue; - - (_tokensQueue = this._tokensQueue).unshift.apply(_tokensQueue, _toConsumableArray$8(tokensToQueue)); - } - } - - return this.onToken(this._toToken(token, yytext)); - } - } - - if (this.isEOF()) { - this._cursor++; - return EOF_TOKEN; - } - - this.throwUnexpectedToken(string[0], this._currentLine, this._currentColumn); - }, - - - /** - * Throws default "Unexpected token" exception, showing the actual - * line from the source, pointing with the ^ marker to the bad token. - * In addition, shows `line:column` location. - */ - throwUnexpectedToken: function throwUnexpectedToken(symbol, line, column) { - var lineSource = this._string.split('\n')[line - 1]; - var lineData = ''; - - if (lineSource) { - var pad = ' '.repeat(column); - lineData = '\n\n' + lineSource + '\n' + pad + '^\n'; - } - - throw new SyntaxError(lineData + 'Unexpected token: "' + symbol + '" ' + ('at ' + line + ':' + column + '.')); - }, - getCursor: function getCursor() { - return this._cursor; - }, - getCurrentLine: function getCurrentLine() { - return this._currentLine; - }, - getCurrentColumn: function getCurrentColumn() { - return this._currentColumn; - }, - _captureLocation: function _captureLocation(matched) { - var nlRe = /\n/g; - - // Absolute offsets. - this._tokenStartOffset = this._cursor; - - // Line-based locations, start. - this._tokenStartLine = this._currentLine; - this._tokenStartColumn = this._tokenStartOffset - this._currentLineBeginOffset; - - // Extract `\n` in the matched token. - var nlMatch = void 0; - while ((nlMatch = nlRe.exec(matched)) !== null) { - this._currentLine++; - this._currentLineBeginOffset = this._tokenStartOffset + nlMatch.index + 1; - } - - this._tokenEndOffset = this._cursor + matched.length; - - // Line-based locations, end. - this._tokenEndLine = this._currentLine; - this._tokenEndColumn = this._currentColumn = this._tokenEndOffset - this._currentLineBeginOffset; - }, - _toToken: function _toToken(tokenType) { - var yytext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - - return { - // Basic data. - type: tokenType, - value: yytext, - - // Location data. - startOffset: this._tokenStartOffset, - endOffset: this._tokenEndOffset, - startLine: this._tokenStartLine, - endLine: this._tokenEndLine, - startColumn: this._tokenStartColumn, - endColumn: this._tokenEndColumn - }; - }, - isEOF: function isEOF() { - return this._cursor === this._string.length; - }, - hasMoreTokens: function hasMoreTokens() { - return this._cursor <= this._string.length; - }, - _match: function _match(string, regexp) { - var matched = string.match(regexp); - if (matched) { - // Handle `\n` in the matched token to track line numbers. - this._captureLocation(matched[0]); - this._cursor += matched[0].length; - return matched[0]; - } - return null; - }, - - - /** - * Allows analyzing, and transforming token. Default implementation - * just passes the token through. - */ - onToken: function onToken(token) { - return token; - } -}; - -/** - * Expose tokenizer so it can be accessed in semantic actions. - */ -yy.lexer = tokenizer; -yy.tokenizer = tokenizer; - -/** - * Global parsing options. Some options can be shadowed per - * each `parse` call, if the optations are passed. - * - * Initalized to the `captureLocations` which is passed - * from the generator. Other options can be added at runtime. - */ -yy.options = { - captureLocations: true -}; - -/** - * Parsing module. - */ -var yyparse = { - /** - * Sets global parsing options. - */ - setOptions: function setOptions(options) { - yy.options = options; - return this; - }, - - - /** - * Returns parsing options. - */ - getOptions: function getOptions() { - return yy.options; - }, - - - /** - * Parses a string. - */ - parse: function parse(string, parseOptions) { - if (!tokenizer) { - throw new Error('Tokenizer instance wasn\'t specified.'); - } - - tokenizer.initString(string); - - /** - * If parse options are passed, override global parse options for - * this call, and later restore global options. - */ - var globalOptions = yy.options; - if (parseOptions) { - yy.options = Object.assign({}, yy.options, parseOptions); - } - - /** - * Allow callers to do setup work based on the - * parsing string, and passed options. - */ - yyparse.onParseBegin(string, tokenizer, yy.options); - - stack.length = 0; - stack.push(0); - - var token = tokenizer.getNextToken(); - var shiftedToken = null; - - do { - if (!token) { - // Restore options. - yy.options = globalOptions; - unexpectedEndOfInput(); - } - - var state = stack[stack.length - 1]; - var column = tokens[token.type]; - - if (!table[state].hasOwnProperty(column)) { - yy.options = globalOptions; - unexpectedToken(token); - } - - var entry = table[state][column]; - - // Shift action. - if (entry[0] === 's') { - var _loc2 = null; - - if (yy.options.captureLocations) { - _loc2 = { - startOffset: token.startOffset, - endOffset: token.endOffset, - startLine: token.startLine, - endLine: token.endLine, - startColumn: token.startColumn, - endColumn: token.endColumn - }; - } - - shiftedToken = this.onShift(token); - - stack.push({ symbol: tokens[shiftedToken.type], semanticValue: shiftedToken.value, loc: _loc2 }, Number(entry.slice(1))); - - token = tokenizer.getNextToken(); - } - - // Reduce action. - else if (entry[0] === 'r') { - var productionNumber = entry.slice(1); - var production = productions[productionNumber]; - var hasSemanticAction = typeof production[2] === 'function'; - var semanticValueArgs = hasSemanticAction ? [] : null; - - var locationArgs = hasSemanticAction && yy.options.captureLocations ? [] : null; - - if (production[1] !== 0) { - var rhsLength = production[1]; - while (rhsLength-- > 0) { - stack.pop(); - var stackEntry = stack.pop(); - - if (hasSemanticAction) { - semanticValueArgs.unshift(stackEntry.semanticValue); - - if (locationArgs) { - locationArgs.unshift(stackEntry.loc); - } - } - } - } - - var reduceStackEntry = { symbol: production[0] }; - - if (hasSemanticAction) { - yytext = shiftedToken ? shiftedToken.value : null; - shiftedToken ? shiftedToken.value.length : null; - - var semanticActionArgs = locationArgs !== null ? semanticValueArgs.concat(locationArgs) : semanticValueArgs; - - production[2].apply(production, _toConsumableArray$8(semanticActionArgs)); - - reduceStackEntry.semanticValue = __; - - if (locationArgs) { - reduceStackEntry.loc = __loc; - } - } - - var nextState = stack[stack.length - 1]; - var symbolToReduceWith = production[0]; - - stack.push(reduceStackEntry, table[nextState][symbolToReduceWith]); - } - - // Accept. - else if (entry === 'acc') { - stack.pop(); - var parsed = stack.pop(); - - if (stack.length !== 1 || stack[0] !== 0 || tokenizer.hasMoreTokens()) { - // Restore options. - yy.options = globalOptions; - unexpectedToken(token); - } - - if (parsed.hasOwnProperty('semanticValue')) { - yy.options = globalOptions; - yyparse.onParseEnd(parsed.semanticValue); - return parsed.semanticValue; - } - - yyparse.onParseEnd(); - - // Restore options. - yy.options = globalOptions; - return true; - } - } while (tokenizer.hasMoreTokens() || stack.length > 1); - }, - setTokenizer: function setTokenizer(customTokenizer) { - tokenizer = customTokenizer; - return yyparse; - }, - getTokenizer: function getTokenizer() { - return tokenizer; - }, - onParseBegin: function onParseBegin(string, tokenizer, options) {}, - onParseEnd: function onParseEnd(parsed) {}, - - - /** - * Allows analyzing, and transforming shifted token. Default implementation - * just passes the token through. - */ - onShift: function onShift(token) { - return token; - } -}; - -/** - * Tracks capturing groups. - */ -var capturingGroupsCount = 0; - -/** - * Tracks named groups. - */ -var namedGroups = {}; - -/** - * Parsing string. - */ -var parsingString = ''; - -yyparse.onParseBegin = function (string, lexer) { - parsingString = string; - capturingGroupsCount = 0; - namedGroups = {}; - - var lastSlash = string.lastIndexOf('/'); - var flags = string.slice(lastSlash); - - if (flags.includes('x') && flags.includes('u')) { - lexer.pushState('xu'); - } else { - if (flags.includes('x')) { - lexer.pushState('x'); - } - if (flags.includes('u')) { - lexer.pushState('u'); - } - } -}; - -/** - * On shifting `(` remember its number to used on reduce. - */ -yyparse.onShift = function (token) { - if (token.type === 'L_PAREN' || token.type === 'NAMED_CAPTURE_GROUP') { - token.value = new String(token.value); - token.value.groupNumber = ++capturingGroupsCount; - } - return token; -}; - -/** - * Extracts ranges from the range string. - */ -function getRange(text) { - var range = text.match(/\d+/g).map(Number); - - if (Number.isFinite(range[1]) && range[1] < range[0]) { - throw new SyntaxError('Numbers out of order in ' + text + ' quantifier'); - } - - return range; -} - -/** - * Checks class range - */ -function checkClassRange(from, to) { - if (from.kind === 'control' || to.kind === 'control' || !isNaN(from.codePoint) && !isNaN(to.codePoint) && from.codePoint > to.codePoint) { - throw new SyntaxError('Range ' + from.value + '-' + to.value + ' out of order in character class'); - } -} - -// ---------------------- Unicode property ------------------------------------------- - -var unicodeProperties = parserUnicodeProperties; - -/** - * Unicode property. - */ -function UnicodeProperty(matched, loc) { - var negative = matched[1] === 'P'; - var separatorIdx = matched.indexOf('='); - - var name = matched.slice(3, separatorIdx !== -1 ? separatorIdx : -1); - var value = void 0; - - // General_Category allows using only value as a shorthand. - var isShorthand = separatorIdx === -1 && unicodeProperties.isGeneralCategoryValue(name); - - // Binary propery name. - var isBinaryProperty = separatorIdx === -1 && unicodeProperties.isBinaryPropertyName(name); - - if (isShorthand) { - value = name; - name = 'General_Category'; - } else if (isBinaryProperty) { - value = name; - } else { - if (!unicodeProperties.isValidName(name)) { - throw new SyntaxError('Invalid unicode property name: ' + name + '.'); - } - - value = matched.slice(separatorIdx + 1, -1); - - if (!unicodeProperties.isValidValue(name, value)) { - throw new SyntaxError('Invalid ' + name + ' unicode property value: ' + value + '.'); - } - } - - return Node({ - type: 'UnicodeProperty', - name: name, - value: value, - negative: negative, - shorthand: isShorthand, - binary: isBinaryProperty, - canonicalName: unicodeProperties.getCanonicalName(name) || name, - canonicalValue: unicodeProperties.getCanonicalValue(value) || value - }, loc); -} - -// ---------------------------------------------------------------------------------- - - -/** - * Creates a character node. - */ -function Char(value, kind, loc) { - var symbol = void 0; - var codePoint = void 0; - - switch (kind) { - case 'decimal': - { - codePoint = Number(value.slice(1)); - symbol = String.fromCodePoint(codePoint); - break; - } - case 'oct': - { - codePoint = parseInt(value.slice(1), 8); - symbol = String.fromCodePoint(codePoint); - break; - } - case 'hex': - case 'unicode': - { - if (value.lastIndexOf('\\u') > 0) { - var _value$split$slice = value.split('\\u').slice(1), - _value$split$slice2 = _slicedToArray$2(_value$split$slice, 2), - lead = _value$split$slice2[0], - trail = _value$split$slice2[1]; - - lead = parseInt(lead, 16); - trail = parseInt(trail, 16); - codePoint = (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; - - symbol = String.fromCodePoint(codePoint); - } else { - var hex = value.slice(2).replace('{', ''); - codePoint = parseInt(hex, 16); - if (codePoint > 0x10ffff) { - throw new SyntaxError('Bad character escape sequence: ' + value); - } - - symbol = String.fromCodePoint(codePoint); - } - break; - } - case 'meta': - { - switch (value) { - case '\\t': - symbol = '\t'; - codePoint = symbol.codePointAt(0); - break; - case '\\n': - symbol = '\n'; - codePoint = symbol.codePointAt(0); - break; - case '\\r': - symbol = '\r'; - codePoint = symbol.codePointAt(0); - break; - case '\\v': - symbol = '\v'; - codePoint = symbol.codePointAt(0); - break; - case '\\f': - symbol = '\f'; - codePoint = symbol.codePointAt(0); - break; - case '\\b': - symbol = '\b'; - codePoint = symbol.codePointAt(0); - case '\\0': - symbol = '\0'; - codePoint = 0; - case '.': - symbol = '.'; - codePoint = NaN; - break; - default: - codePoint = NaN; - } - break; - } - case 'simple': - { - symbol = value; - codePoint = symbol.codePointAt(0); - break; - } - } - - return Node({ - type: 'Char', - value: value, - kind: kind, - symbol: symbol, - codePoint: codePoint - }, loc); -} - -/** - * Valid flags per current ECMAScript spec and - * stage 3+ proposals. - */ -var validFlags = 'gimsuxy'; - -/** - * Checks the flags are valid, and that - * we don't duplicate flags. - */ -function checkFlags(flags) { - var seen = new Set(); - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = flags[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var flag = _step.value; - - if (seen.has(flag) || !validFlags.includes(flag)) { - throw new SyntaxError('Invalid flags: ' + flags); - } - seen.add(flag); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return flags.split('').sort().join(''); -} - -/** - * Parses patterns like \1, \2, etc. either as a backreference - * to a group, or a deciaml char code. - */ -function GroupRefOrDecChar(text, textLoc) { - var reference = Number(text.slice(1)); - - if (reference > 0 && reference <= capturingGroupsCount) { - return Node({ - type: 'Backreference', - kind: 'number', - number: reference, - reference: reference - }, textLoc); - } - - return Char(text, 'decimal', textLoc); -} - -/** - * Unicode names. - */ -var uReStart = /^\\u[0-9a-fA-F]{4}/; // only matches start of string -var ucpReStart = /^\\u\{[0-9a-fA-F]{1,}\}/; // only matches start of string -var ucpReAnywhere = /\\u\{[0-9a-fA-F]{1,}\}/; // matches anywhere in string - -/** - * Validates Unicode group name. - */ -function validateUnicodeGroupName(name, state) { - var isUnicodeName = ucpReAnywhere.test(name); - var isUnicodeState = state === 'u' || state === 'xu' || state === 'u_class'; - - if (isUnicodeName && !isUnicodeState) { - throw new SyntaxError('invalid group Unicode name "' + name + '", use `u` flag.'); - } - - return name; -} - -// Matches the following production: https://tc39.es/ecma262/#prod-RegExpUnicodeEscapeSequence -// -// RegExpUnicodeEscapeSequence :: -// `u` LeadSurrogate `\u` TrailSurrogate # as 'leadSurrogate', 'trailSurrogate' -// `u` LeadSurrogate # as 'leadSurrogateOnly' -// `u` TrailSurrogate # as 'trailSurrogateOnly' -// `u` NonSurrogate # as 'nonSurrogate' -// `u` `{` CodePoint `}` # as 'codePoint' -// -// LeadSurrogate :: -// Hex4Digits but only if the SV of Hex4Digits is in the inclusive range 0xD800 to 0xDBFF # [dD][89aAbB][0-9a-fA-F]{2} -// -// TrailSurrogate :: -// Hex4Digits but only if the SV of Hex4Digits is in the inclusive range 0xDC00 to 0xDFFF # [dD][c-fC-F][0-9a-fA-F]{2} -// -// NonSurrogate :: -// Hex4Digits but only if the SV of Hex4Digits is not in the inclusive range 0xD800 to 0xDFFF # [0-9a-ce-fA-CE-F][0-9a-fA-F]{3}|[dD][0-7][0-9a-fA-F]{2} -// -// CodePoint :: -// HexDigits but only if MV of HexDigits ≤ 0x10FFFF # 0*(?:[0-9a-fA-F]{1,5}|10[0-9a-fA-F]{4}) -// -var uidRe = /\\u(?:([dD][89aAbB][0-9a-fA-F]{2})\\u([dD][c-fC-F][0-9a-fA-F]{2})|([dD][89aAbB][0-9a-fA-F]{2})|([dD][c-fC-F][0-9a-fA-F]{2})|([0-9a-ce-fA-CE-F][0-9a-fA-F]{3}|[dD][0-7][0-9a-fA-F]{2})|\{(0*(?:[0-9a-fA-F]{1,5}|10[0-9a-fA-F]{4}))\})/; - -function decodeUnicodeGroupName(name) { - return name.replace(new RegExp(uidRe, 'g'), function (_, leadSurrogate, trailSurrogate, leadSurrogateOnly, trailSurrogateOnly, nonSurrogate, codePoint) { - if (leadSurrogate) { - return String.fromCodePoint(parseInt(leadSurrogate, 16), parseInt(trailSurrogate, 16)); - } - if (leadSurrogateOnly) { - return String.fromCodePoint(parseInt(leadSurrogateOnly, 16)); - } - if (trailSurrogateOnly) { - // TODO: Per the spec: https://tc39.es/ecma262/#prod-RegExpUnicodeEscapeSequence - // > Each `\u` TrailSurrogate for which the choice of associated `u` LeadSurrogate is ambiguous shall be associated with the nearest possible `u` LeadSurrogate that would otherwise have no corresponding `\u` TrailSurrogate. - return String.fromCodePoint(parseInt(trailSurrogateOnly, 16)); - } - if (nonSurrogate) { - return String.fromCodePoint(parseInt(nonSurrogate, 16)); - } - if (codePoint) { - return String.fromCodePoint(parseInt(codePoint, 16)); - } - return _; - }); -} - -/** - * Extracts from `\k` pattern either a backreference - * to a named capturing group (if it presents), or parses it - * as a list of char: `\k`, `<`, `f`, etc. - */ -function NamedGroupRefOrChars(text, textLoc) { - var referenceRaw = text.slice(3, -1); - var reference = decodeUnicodeGroupName(referenceRaw); - - if (namedGroups.hasOwnProperty(reference)) { - return Node({ - type: 'Backreference', - kind: 'name', - number: namedGroups[reference], - reference: reference, - referenceRaw: referenceRaw - }, textLoc); - } - - // Else `\k` should be parsed as a list of `Char`s. - // This is really a 0.01% edge case, but we should handle it. - - var startOffset = null; - var startLine = null; - var endLine = null; - var startColumn = null; - - if (textLoc) { - startOffset = textLoc.startOffset; - startLine = textLoc.startLine; - endLine = textLoc.endLine; - startColumn = textLoc.startColumn; - } - - var charRe = /^[\w$<>]/; - var loc = void 0; - - var chars = [ - // Init to first \k, taking 2 symbols. - Char(text.slice(1, 2), 'simple', startOffset ? { - startLine: startLine, - endLine: endLine, - startColumn: startColumn, - startOffset: startOffset, - endOffset: startOffset += 2, - endColumn: startColumn += 2 - } : null)]; - - // For \k - chars[0].escaped = true; - - // Other symbols. - text = text.slice(2); - - while (text.length > 0) { - var matched = null; - - // Unicode, \u003B or \u{003B} - if ((matched = text.match(uReStart)) || (matched = text.match(ucpReStart))) { - if (startOffset) { - loc = { - startLine: startLine, - endLine: endLine, - startColumn: startColumn, - startOffset: startOffset, - endOffset: startOffset += matched[0].length, - endColumn: startColumn += matched[0].length - }; - } - chars.push(Char(matched[0], 'unicode', loc)); - text = text.slice(matched[0].length); - } - - // Simple char. - else if (matched = text.match(charRe)) { - if (startOffset) { - loc = { - startLine: startLine, - endLine: endLine, - startColumn: startColumn, - startOffset: startOffset, - endOffset: ++startOffset, - endColumn: ++startColumn - }; - } - chars.push(Char(matched[0], 'simple', loc)); - text = text.slice(1); - } - } - - return chars; -} - -/** - * Creates an AST node with a location. - */ -function Node(node, loc) { - if (yy.options.captureLocations) { - node.loc = { - source: parsingString.slice(loc.startOffset, loc.endOffset), - start: { - line: loc.startLine, - column: loc.startColumn, - offset: loc.startOffset - }, - end: { - line: loc.endLine, - column: loc.endColumn, - offset: loc.endOffset - } - }; - } - return node; -} - -/** - * Creates location node. - */ -function loc(start, end) { - if (!yy.options.captureLocations) { - return null; - } - - return { - startOffset: start.startOffset, - endOffset: end.endOffset, - startLine: start.startLine, - endLine: end.endLine, - startColumn: start.startColumn, - endColumn: end.endColumn - }; -} - -function unexpectedToken(token) { - if (token.type === EOF) { - unexpectedEndOfInput(); - } - - tokenizer.throwUnexpectedToken(token.value, token.startLine, token.startColumn); -} - -function unexpectedEndOfInput() { - parseError('Unexpected end of input.'); -} - -function parseError(message) { - throw new SyntaxError(message); -} - -var regexpTree$4 = yyparse; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var regexpTreeParser = regexpTree$4; - -/** - * Original parse function. - */ -var generatedParseFn = regexpTreeParser.parse.bind(regexpTreeParser); - -/** - * Parses a regular expression. - * - * Override original `regexpTreeParser.parse` to convert a value to a string, - * since in regexp-tree we may pass strings, and RegExp instance. - */ -regexpTreeParser.parse = function (regexp, options) { - return generatedParseFn('' + regexp, options); -}; - -// By default do not capture locations; callers may override. -regexpTreeParser.setOptions({ captureLocations: false }); - -var parser$4 = regexpTreeParser; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var _createClass$6 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck$6(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var DEFAULT_COLLECTION_PROP = 'expressions'; -var DEFAULT_SINGLE_PROP = 'expression'; - -/** - * NodePath class encapsulates a traversing node, - * its parent node, property name in the parent node, and - * an index (in case if a node is part of a collection). - * It also provides set of methods for AST manipulation. - */ - -var NodePath$3 = function () { - /** - * NodePath constructor. - * - * @param Object node - an AST node - * @param NodePath parentPath - a nullable parent path - * @param string property - property name of the node in the parent - * @param number index - index of the node in a collection. - */ - function NodePath(node) { - var parentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var property = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - - _classCallCheck$6(this, NodePath); - - this.node = node; - this.parentPath = parentPath; - this.parent = parentPath ? parentPath.node : null; - this.property = property; - this.index = index; - } - - _createClass$6(NodePath, [{ - key: '_enforceProp', - value: function _enforceProp(property) { - if (!this.node.hasOwnProperty(property)) { - throw new Error('Node of type ' + this.node.type + ' doesn\'t have "' + property + '" collection.'); - } - } - - /** - * Sets a node into a children collection or the single child. - * By default child nodes are supposed to be under `expressions` property. - * An explicit property can be passed. - * - * @param Object node - a node to set into a collection or as single child - * @param number index - index at which to set - * @param string property - name of the collection or single property - */ - - }, { - key: 'setChild', - value: function setChild(node) { - var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var property = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - - - var childPath = void 0; - if (index != null) { - if (!property) { - property = DEFAULT_COLLECTION_PROP; - } - this._enforceProp(property); - this.node[property][index] = node; - childPath = NodePath.getForNode(node, this, property, index); - } else { - if (!property) { - property = DEFAULT_SINGLE_PROP; - } - this._enforceProp(property); - this.node[property] = node; - childPath = NodePath.getForNode(node, this, property, null); - } - return childPath; - } - - /** - * Appends a node to a children collection. - * By default child nodes are supposed to be under `expressions` property. - * An explicit property can be passed. - * - * @param Object node - a node to set into a collection or as single child - * @param string property - name of the collection or single property - */ - - }, { - key: 'appendChild', - value: function appendChild(node) { - var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - - if (!property) { - property = DEFAULT_COLLECTION_PROP; - } - this._enforceProp(property); - var end = this.node[property].length; - return this.setChild(node, end, property); - } - - /** - * Inserts a node into a collection. - * By default child nodes are supposed to be under `expressions` property. - * An explicit property can be passed. - * - * @param Object node - a node to insert into a collection - * @param number index - index at which to insert - * @param string property - name of the collection property - */ - - }, { - key: 'insertChildAt', - value: function insertChildAt(node, index) { - var property = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_COLLECTION_PROP; - - this._enforceProp(property); - - this.node[property].splice(index, 0, node); - - // If we inserted a node before the traversing index, - // we should increase the later. - if (index <= NodePath.getTraversingIndex()) { - NodePath.updateTraversingIndex(+1); - } - - this._rebuildIndex(this.node, property); - } - - /** - * Removes a node. - */ - - }, { - key: 'remove', - value: function remove() { - if (this.isRemoved()) { - return; - } - NodePath.registry.delete(this.node); - - this.node = null; - - if (!this.parent) { - return; - } - - // A node is in a collection. - if (this.index !== null) { - this.parent[this.property].splice(this.index, 1); - - // If we remove a node before the traversing index, - // we should increase the later. - if (this.index <= NodePath.getTraversingIndex()) { - NodePath.updateTraversingIndex(-1); - } - - // Rebuild index. - this._rebuildIndex(this.parent, this.property); - - this.index = null; - this.property = null; - - return; - } - - // A simple node. - delete this.parent[this.property]; - this.property = null; - } - - /** - * Rebuilds child nodes index (used on remove/insert). - */ - - }, { - key: '_rebuildIndex', - value: function _rebuildIndex(parent, property) { - var parentPath = NodePath.getForNode(parent); - - for (var i = 0; i < parent[property].length; i++) { - var path = NodePath.getForNode(parent[property][i], parentPath, property, i); - path.index = i; - } - } - - /** - * Whether the path was removed. - */ - - }, { - key: 'isRemoved', - value: function isRemoved() { - return this.node === null; - } - - /** - * Replaces a node with the passed one. - */ - - }, { - key: 'replace', - value: function replace(newNode) { - NodePath.registry.delete(this.node); - - this.node = newNode; - - if (!this.parent) { - return null; - } - - // A node is in a collection. - if (this.index !== null) { - this.parent[this.property][this.index] = newNode; - } - - // A simple node. - else { - this.parent[this.property] = newNode; - } - - // Rebuild the node path for the new node. - return NodePath.getForNode(newNode, this.parentPath, this.property, this.index); - } - - /** - * Updates a node inline. - */ - - }, { - key: 'update', - value: function update(nodeProps) { - Object.assign(this.node, nodeProps); - } - - /** - * Returns parent. - */ - - }, { - key: 'getParent', - value: function getParent() { - return this.parentPath; - } - - /** - * Returns nth child. - */ - - }, { - key: 'getChild', - value: function getChild() { - var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - - if (this.node.expressions) { - return NodePath.getForNode(this.node.expressions[n], this, DEFAULT_COLLECTION_PROP, n); - } else if (this.node.expression && n == 0) { - return NodePath.getForNode(this.node.expression, this, DEFAULT_SINGLE_PROP); - } - return null; - } - - /** - * Whether a path node is syntactically equal to the passed one. - * - * NOTE: we don't rely on `source` property from the `loc` data - * (which would be the fastest comparison), since it might be unsync - * after several modifications. We use here simple `JSON.stringify` - * excluding the `loc` data. - * - * @param NodePath other - path to compare to. - * @return boolean - */ - - }, { - key: 'hasEqualSource', - value: function hasEqualSource(path) { - return JSON.stringify(this.node, jsonSkipLoc) === JSON.stringify(path.node, jsonSkipLoc); - } - - /** - * JSON-encodes a node skipping location. - */ - - }, { - key: 'jsonEncode', - value: function jsonEncode() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - format = _ref.format, - useLoc = _ref.useLoc; - - return JSON.stringify(this.node, useLoc ? null : jsonSkipLoc, format); - } - - /** - * Returns previous sibling. - */ - - }, { - key: 'getPreviousSibling', - value: function getPreviousSibling() { - if (!this.parent || this.index == null) { - return null; - } - return NodePath.getForNode(this.parent[this.property][this.index - 1], NodePath.getForNode(this.parent), this.property, this.index - 1); - } - - /** - * Returns next sibling. - */ - - }, { - key: 'getNextSibling', - value: function getNextSibling() { - if (!this.parent || this.index == null) { - return null; - } - return NodePath.getForNode(this.parent[this.property][this.index + 1], NodePath.getForNode(this.parent), this.property, this.index + 1); - } - - /** - * Returns a NodePath instance for a node. - * - * The same NodePath can be reused in several places, e.g. - * a parent node passed for all its children. - */ - - }], [{ - key: 'getForNode', - value: function getForNode(node) { - var parentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var prop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1; - - if (!node) { - return null; - } - - if (!NodePath.registry.has(node)) { - NodePath.registry.set(node, new NodePath(node, parentPath, prop, index == -1 ? null : index)); - } - - var path = NodePath.registry.get(node); - - if (parentPath !== null) { - path.parentPath = parentPath; - path.parent = path.parentPath.node; - } - - if (prop !== null) { - path.property = prop; - } - - if (index >= 0) { - path.index = index; - } - - return path; - } - - /** - * Initializes the NodePath registry. The registry is a map from - * a node to its NodePath instance. - */ - - }, { - key: 'initRegistry', - value: function initRegistry() { - if (!NodePath.registry) { - NodePath.registry = new Map(); - } - NodePath.registry.clear(); - } - - /** - * Updates index of a currently traversing collection. - */ - - }, { - key: 'updateTraversingIndex', - value: function updateTraversingIndex(dx) { - return NodePath.traversingIndexStack[NodePath.traversingIndexStack.length - 1] += dx; - } - - /** - * Returns current traversing index. - */ - - }, { - key: 'getTraversingIndex', - value: function getTraversingIndex() { - return NodePath.traversingIndexStack[NodePath.traversingIndexStack.length - 1]; - } - }]); - - return NodePath; -}(); - -NodePath$3.initRegistry(); - -/** - * Index of a currently traversing collection is stored on top of the - * `NodePath.traversingIndexStack`. Remove/insert methods can adjust - * this index. - */ -NodePath$3.traversingIndexStack = []; - -// Helper function used to skip `loc` in JSON operations. -function jsonSkipLoc(prop, value) { - if (prop === 'loc') { - return undefined; - } - return value; -} - -var nodePath = NodePath$3; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var NodePath$2 = nodePath; - -/** - * Does an actual AST traversal, using visitor pattern, - * and calling set of callbacks. - * - * Based on https://github.com/olov/ast-traverse - * - * Expects AST in Mozilla Parser API: nodes which are supposed to be - * handled should have `type` property. - * - * @param Object root - a root node to start traversal from. - * - * @param Object options - an object with set of callbacks: - * - * - `pre(node, parent, prop, index)` - a hook called on node enter - * - `post`(node, parent, prop, index) - a hook called on node exit - * - `skipProperty(prop)` - a predicated whether a property should be skipped - */ -function astTraverse(root) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var pre = options.pre; - var post = options.post; - var skipProperty = options.skipProperty; - - function visit(node, parent, prop, idx) { - if (!node || typeof node.type !== 'string') { - return; - } - - var res = undefined; - if (pre) { - res = pre(node, parent, prop, idx); - } - - if (res !== false) { - - // A node can be replaced during traversal, so we have to - // recalculate it from the parent, to avoid traversing "dead" nodes. - if (parent && parent[prop]) { - if (!isNaN(idx)) { - node = parent[prop][idx]; - } else { - node = parent[prop]; - } - } - - for (var _prop in node) { - if (node.hasOwnProperty(_prop)) { - if (skipProperty ? skipProperty(_prop, node) : _prop[0] === '$') { - continue; - } - - var child = node[_prop]; - - // Collection node. - // - // NOTE: a node (or several nodes) can be removed or inserted - // during traversal. - // - // Current traversing index is stored on top of the - // `NodePath.traversingIndexStack`. The stack is used to support - // recursive nature of the traversal. - // - // In this case `NodePath.traversingIndex` (which we use here) is - // updated in the NodePath remove/insert methods. - // - if (Array.isArray(child)) { - var index = 0; - NodePath$2.traversingIndexStack.push(index); - while (index < child.length) { - visit(child[index], node, _prop, index); - index = NodePath$2.updateTraversingIndex(+1); - } - NodePath$2.traversingIndexStack.pop(); - } - - // Simple node. - else { - visit(child, node, _prop); - } - } - } - } - - if (post) { - post(node, parent, prop, idx); - } - } - - visit(root, null); -} - -var traverse$1 = { - /** - * Traverses an AST. - * - * @param Object ast - an AST node - * - * @param Object | Array handlers: - * - * an object (or an array of objects) - * - * Each such object contains a handler function per node. - * In case of an array of handlers, they are applied in order. - * A handler may return a transformed node (or a different type). - * - * The per-node function may instead be an object with functions pre and post. - * pre is called before visiting the node, post after. - * If a handler is a function, it is treated as the pre function, with an empty post. - * - * @param Object options: - * - * a config object, specifying traversal options: - * - * `asNodes`: boolean - whether handlers should receives raw AST nodes - * (false by default), instead of a `NodePath` wrapper. Note, by default - * `NodePath` wrapper provides a set of convenient method to manipulate - * a traversing AST, and also has access to all parents list. A raw - * nodes traversal should be used in rare cases, when no `NodePath` - * features are needed. - * - * Special hooks: - * - * - `shouldRun(ast)` - a predicate determining whether the handler - * should be applied. - * - * NOTE: Multiple handlers are used as an optimization of applying all of - * them in one AST traversal pass. - */ - traverse: function traverse(ast, handlers) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { asNodes: false }; - - - if (!Array.isArray(handlers)) { - handlers = [handlers]; - } - - // Filter out handlers by result of `shouldRun`, if the method is present. - handlers = handlers.filter(function (handler) { - if (typeof handler.shouldRun !== 'function') { - return true; - } - return handler.shouldRun(ast); - }); - - NodePath$2.initRegistry(); - - // Allow handlers to initializer themselves. - handlers.forEach(function (handler) { - if (typeof handler.init === 'function') { - handler.init(ast); - } - }); - - function getPathFor(node, parent, prop, index) { - var parentPath = NodePath$2.getForNode(parent); - var nodePath = NodePath$2.getForNode(node, parentPath, prop, index); - - return nodePath; - } - - // Handle actual nodes. - astTraverse(ast, { - /** - * Handler on node enter. - */ - pre: function pre(node, parent, prop, index) { - var nodePath = void 0; - if (!options.asNodes) { - nodePath = getPathFor(node, parent, prop, index); - } - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = handlers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var handler = _step.value; - - // "Catch-all" `*` handler. - if (typeof handler['*'] === 'function') { - if (nodePath) { - // A path/node can be removed by some previous handler. - if (!nodePath.isRemoved()) { - var handlerResult = handler['*'](nodePath); - // Explicitly stop traversal. - if (handlerResult === false) { - return false; - } - } - } else { - handler['*'](node, parent, prop, index); - } - } - - // Per-node handler. - var handlerFuncPre = void 0; - if (typeof handler[node.type] === 'function') { - handlerFuncPre = handler[node.type]; - } else if (typeof handler[node.type] === 'object' && typeof handler[node.type].pre === 'function') { - handlerFuncPre = handler[node.type].pre; - } - - if (handlerFuncPre) { - if (nodePath) { - // A path/node can be removed by some previous handler. - if (!nodePath.isRemoved()) { - var _handlerResult = handlerFuncPre.call(handler, nodePath); - // Explicitly stop traversal. - if (_handlerResult === false) { - return false; - } - } - } else { - handlerFuncPre.call(handler, node, parent, prop, index); - } - } - } // Loop over handlers - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }, - // pre func - - /** - * Handler on node exit. - */ - post: function post(node, parent, prop, index) { - if (!node) { - return; - } - - var nodePath = void 0; - if (!options.asNodes) { - nodePath = getPathFor(node, parent, prop, index); - } - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = handlers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var handler = _step2.value; - - // Per-node handler. - var handlerFuncPost = void 0; - if (typeof handler[node.type] === 'object' && typeof handler[node.type].post === 'function') { - handlerFuncPost = handler[node.type].post; - } - - if (handlerFuncPost) { - if (nodePath) { - // A path/node can be removed by some previous handler. - if (!nodePath.isRemoved()) { - var handlerResult = handlerFuncPost.call(handler, nodePath); - // Explicitly stop traversal. - if (handlerResult === false) { - return false; - } - } - } else { - handlerFuncPost.call(handler, node, parent, prop, index); - } - } - } // Loop over handlers - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - }, - // post func - - /** - * Skip locations by default. - */ - skipProperty: function skipProperty(prop) { - return prop === 'loc'; - } - }); - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var _createClass$5 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var generator$2 = generator_1; -var parser$3 = parser$4; -var traverse = traverse$1; - -/** - * Transform result. - */ - -var TransformResult = function () { - /** - * Initializes a transform result for an AST. - * - * @param Object ast - an AST node - * @param mixed extra - any extra data a transform may return - */ - function TransformResult(ast) { - var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - _classCallCheck$5(this, TransformResult); - - this._ast = ast; - this._source = null; - this._string = null; - this._regexp = null; - this._extra = extra; - } - - _createClass$5(TransformResult, [{ - key: 'getAST', - value: function getAST() { - return this._ast; - } - }, { - key: 'setExtra', - value: function setExtra(extra) { - this._extra = extra; - } - }, { - key: 'getExtra', - value: function getExtra() { - return this._extra; - } - }, { - key: 'toRegExp', - value: function toRegExp() { - if (!this._regexp) { - this._regexp = new RegExp(this.getSource(), this._ast.flags); - } - return this._regexp; - } - }, { - key: 'getSource', - value: function getSource() { - if (!this._source) { - this._source = generator$2.generate(this._ast.body); - } - return this._source; - } - }, { - key: 'getFlags', - value: function getFlags() { - return this._ast.flags; - } - }, { - key: 'toString', - value: function toString() { - if (!this._string) { - this._string = generator$2.generate(this._ast); - } - return this._string; - } - }]); - - return TransformResult; -}(); - -var transform$1 = { - /** - * Expose `TransformResult`. - */ - TransformResult: TransformResult, - - /** - * Transforms a regular expression applying a set of - * transformation handlers. - * - * @param string | AST | RegExp: - * - * a regular expression in different representations: a string, - * a RegExp object, or an AST. - * - * @param Object | Array: - * - * a handler (or a list of handlers) from `traverse` API. - * - * @return TransformResult instance. - * - * Example: - * - * transform(/[a-z]/i, { - * onChar(path) { - * const {node} = path; - * - * if (...) { - * path.remove(); - * } - * } - * }); - */ - transform: function transform(regexp, handlers) { - var ast = regexp; - - if (regexp instanceof RegExp) { - regexp = '' + regexp; - } - - if (typeof regexp === 'string') { - ast = parser$3.parse(regexp, { - captureLocations: true - }); - } - - traverse.traverse(ast, handlers); - - return new TransformResult(ast); - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var compatTransforms = transforms$1; -var _transform$1 = transform$1; - -var compatTranspiler$1 = { - /** - * Translates a regexp in new syntax to equivalent regexp in old syntax. - * - * @param string|RegExp|AST - regexp - * @param Array transformsWhitelist - names of the transforms to apply - */ - transform: function transform(regexp) { - var transformsWhitelist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - - var transformToApply = transformsWhitelist.length > 0 ? transformsWhitelist : Object.keys(compatTransforms); - - var result = void 0; - - // Collect extra data per transform. - var extra = {}; - - transformToApply.forEach(function (transformName) { - - if (!compatTransforms.hasOwnProperty(transformName)) { - throw new Error('Unknown compat-transform: ' + transformName + '. ' + 'Available transforms are: ' + Object.keys(compatTransforms).join(', ')); - } - - var handler = compatTransforms[transformName]; - - result = _transform$1.transform(regexp, handler); - regexp = result.getAST(); - - // Collect `extra` transform result. - if (typeof handler.getExtra === 'function') { - extra[transformName] = handler.getExtra(); - } - }); - - // Set the final extras for all transforms. - result.setExtra(extra); - - return result; - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * Performs a deep copy of an simple object. - * Only handles scalar values, arrays and objects. - * - * @param obj Object - */ - -var clone$1 = function clone(obj) { - if (obj === null || typeof obj !== 'object') { - return obj; - } - var res = void 0; - if (Array.isArray(obj)) { - res = []; - } else { - res = {}; - } - for (var i in obj) { - res[i] = clone(obj[i]); - } - return res; -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to transform surrogate pairs into single unicode code point - * - * \ud83d\ude80 -> \u{1f680} - */ - -var charSurrogatePairToSingleUnicodeTransform = { - shouldRun: function shouldRun(ast) { - return ast.flags.includes('u'); - }, - Char: function Char(path) { - var node = path.node; - - if (node.kind !== 'unicode' || !node.isSurrogatePair || isNaN(node.codePoint)) { - return; - } - node.value = '\\u{' + node.codePoint.toString(16) + '}'; - delete node.isSurrogatePair; - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var UPPER_A_CP$1 = 'A'.codePointAt(0); -var UPPER_Z_CP$1 = 'Z'.codePointAt(0); -var LOWER_A_CP = 'a'.codePointAt(0); -var LOWER_Z_CP = 'z'.codePointAt(0); -var DIGIT_0_CP = '0'.codePointAt(0); -var DIGIT_9_CP = '9'.codePointAt(0); - -/** - * A regexp-tree plugin to transform coded chars into simple chars. - * - * \u0061 -> a - */ -var charCodeToSimpleCharTransform = { - Char: function Char(path) { - var node = path.node, - parent = path.parent; - - if (isNaN(node.codePoint) || node.kind === 'simple') { - return; - } - - if (parent.type === 'ClassRange') { - if (!isSimpleRange(parent)) { - return; - } - } - - if (!isPrintableASCIIChar(node.codePoint)) { - return; - } - - var symbol = String.fromCodePoint(node.codePoint); - var newChar = { - type: 'Char', - kind: 'simple', - value: symbol, - symbol: symbol, - codePoint: node.codePoint - }; - if (needsEscape(symbol, parent.type)) { - newChar.escaped = true; - } - path.replace(newChar); - } -}; - -/** - * Checks if a range is included either in 0-9, a-z or A-Z - * @param classRange - * @returns {boolean} - */ -function isSimpleRange(classRange) { - var from = classRange.from, - to = classRange.to; - - return from.codePoint >= DIGIT_0_CP && from.codePoint <= DIGIT_9_CP && to.codePoint >= DIGIT_0_CP && to.codePoint <= DIGIT_9_CP || from.codePoint >= UPPER_A_CP$1 && from.codePoint <= UPPER_Z_CP$1 && to.codePoint >= UPPER_A_CP$1 && to.codePoint <= UPPER_Z_CP$1 || from.codePoint >= LOWER_A_CP && from.codePoint <= LOWER_Z_CP && to.codePoint >= LOWER_A_CP && to.codePoint <= LOWER_Z_CP; -} - -/** - * Checks if a code point in the range of printable ASCII chars - * (DEL char excluded) - * @param codePoint - * @returns {boolean} - */ -function isPrintableASCIIChar(codePoint) { - return codePoint >= 0x20 && codePoint <= 0x7e; -} - -function needsEscape(symbol, parentType) { - if (parentType === 'ClassRange' || parentType === 'CharacterClass') { - return (/[\]\\^-]/.test(symbol) - ); - } - - return (/[*[()+?^$./\\|{}]/.test(symbol) - ); -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var UPPER_A_CP = 'A'.codePointAt(0); -var UPPER_Z_CP = 'Z'.codePointAt(0); -/** - * Transforms case-insensitive regexp to lowercase - * - * /AaBbÏ/i -> /aabbï/i - */ -var charCaseInsensitiveLowercaseTransform = { - _AZClassRanges: null, - _hasUFlag: false, - init: function init(ast) { - this._AZClassRanges = new Set(); - this._hasUFlag = ast.flags.includes('u'); - }, - shouldRun: function shouldRun(ast) { - return ast.flags.includes('i'); - }, - Char: function Char(path) { - var node = path.node, - parent = path.parent; - - if (isNaN(node.codePoint)) { - return; - } - - // Engine support for case-insensitive matching without the u flag - // for characters above \u1000 does not seem reliable. - if (!this._hasUFlag && node.codePoint >= 0x1000) { - return; - } - - if (parent.type === 'ClassRange') { - // The only class ranges we handle must be inside A-Z. - // After the `from` char is processed, the isAZClassRange test - // will be false, so we use a Set to keep track of parents and - // process the `to` char. - if (!this._AZClassRanges.has(parent) && !isAZClassRange(parent)) { - return; - } - this._AZClassRanges.add(parent); - } - - var lower = node.symbol.toLowerCase(); - if (lower !== node.symbol) { - node.value = displaySymbolAsValue(lower, node); - node.symbol = lower; - node.codePoint = lower.codePointAt(0); - } - } -}; - -function isAZClassRange(classRange) { - var from = classRange.from, - to = classRange.to; - // A-Z - - return from.codePoint >= UPPER_A_CP && from.codePoint <= UPPER_Z_CP && to.codePoint >= UPPER_A_CP && to.codePoint <= UPPER_Z_CP; -} - -function displaySymbolAsValue(symbol, node) { - var codePoint = symbol.codePointAt(0); - if (node.kind === 'decimal') { - return '\\' + codePoint; - } - if (node.kind === 'oct') { - return '\\0' + codePoint.toString(8); - } - if (node.kind === 'hex') { - return '\\x' + codePoint.toString(16); - } - if (node.kind === 'unicode') { - if (node.isSurrogatePair) { - var _getSurrogatePairFrom = getSurrogatePairFromCodePoint(codePoint), - lead = _getSurrogatePairFrom.lead, - trail = _getSurrogatePairFrom.trail; - - return '\\u' + '0'.repeat(4 - lead.length) + lead + '\\u' + '0'.repeat(4 - trail.length) + trail; - } else if (node.value.includes('{')) { - return '\\u{' + codePoint.toString(16) + '}'; - } else { - var code = codePoint.toString(16); - return '\\u' + '0'.repeat(4 - code.length) + code; - } - } - // simple - return symbol; -} - -/** - * Converts a code point to a surrogate pair. - * Conversion algorithm is taken from The Unicode Standard 3.0 Section 3.7 - * (https://www.unicode.org/versions/Unicode3.0.0/ch03.pdf) - * @param {number} codePoint - Between 0x10000 and 0x10ffff - * @returns {{lead: string, trail: string}} - */ -function getSurrogatePairFromCodePoint(codePoint) { - var lead = Math.floor((codePoint - 0x10000) / 0x400) + 0xd800; - var trail = (codePoint - 0x10000) % 0x400 + 0xdc00; - return { - lead: lead.toString(16), - trail: trail.toString(16) - }; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to remove duplicates from character classes. - */ - -var charClassRemoveDuplicatesTransform = { - CharacterClass: function CharacterClass(path) { - var node = path.node; - - var sources = {}; - - for (var i = 0; i < node.expressions.length; i++) { - var childPath = path.getChild(i); - var source = childPath.jsonEncode(); - - if (sources.hasOwnProperty(source)) { - childPath.remove(); - - // Since we remove the current node. - // TODO: make it simpler for users with a method. - i--; - } - - sources[source] = true; - } - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * Flattens a nested disjunction node to a list. - * - * /a|b|c|d/ - * - * {{{a, b}, c}, d} -> [a, b, c, d] - */ - -function _toConsumableArray$7(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function disjunctionToList$1(node) { - if (node.type !== 'Disjunction') { - throw new TypeError('Expected "Disjunction" node, got "' + node.type + '"'); - } - - var list = []; - - if (node.left && node.left.type === 'Disjunction') { - list.push.apply(list, _toConsumableArray$7(disjunctionToList$1(node.left)).concat([node.right])); - } else { - list.push(node.left, node.right); - } - - return list; -} - -/** - * Builds a nested disjunction node from a list. - * - * /a|b|c|d/ - * - * [a, b, c, d] -> {{{a, b}, c}, d} - */ -function listToDisjunction$1(list) { - return list.reduce(function (left, right) { - return { - type: 'Disjunction', - left: left, - right: right - }; - }); -} - -/** - * Increases a quantifier by one. - * Does not change greediness. - * * -> + - * + -> {2,} - * ? -> {1,2} - * {2} -> {3} - * {2,} -> {3,} - * {2,3} -> {3,4} - */ -function increaseQuantifierByOne$2(quantifier) { - if (quantifier.kind === '*') { - - quantifier.kind = '+'; - } else if (quantifier.kind === '+') { - - quantifier.kind = 'Range'; - quantifier.from = 2; - delete quantifier.to; - } else if (quantifier.kind === '?') { - - quantifier.kind = 'Range'; - quantifier.from = 1; - quantifier.to = 2; - } else if (quantifier.kind === 'Range') { - - quantifier.from += 1; - if (quantifier.to) { - quantifier.to += 1; - } - } -} - -var utils = { - disjunctionToList: disjunctionToList$1, - listToDisjunction: listToDisjunction$1, - increaseQuantifierByOne: increaseQuantifierByOne$2 -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var _require$8 = utils, - increaseQuantifierByOne$1 = _require$8.increaseQuantifierByOne; - -/** - * A regexp-tree plugin to merge quantifiers - * - * a+a+ -> a{2,} - * a{2}a{3} -> a{5} - * a{1,2}a{2,3} -> a{3,5} - */ - - -var quantifiersMergeTransform = { - Repetition: function Repetition(path) { - var node = path.node, - parent = path.parent; - - - if (parent.type !== 'Alternative' || !path.index) { - return; - } - - var previousSibling = path.getPreviousSibling(); - - if (!previousSibling) { - return; - } - - if (previousSibling.node.type === 'Repetition') { - if (!previousSibling.getChild().hasEqualSource(path.getChild())) { - return; - } - - var _extractFromTo = extractFromTo(previousSibling.node.quantifier), - previousSiblingFrom = _extractFromTo.from, - previousSiblingTo = _extractFromTo.to; - - var _extractFromTo2 = extractFromTo(node.quantifier), - nodeFrom = _extractFromTo2.from, - nodeTo = _extractFromTo2.to; - - // It's does not seem reliable to merge quantifiers with different greediness - // when none of both is a greedy open range - - - if (previousSibling.node.quantifier.greedy !== node.quantifier.greedy && !isGreedyOpenRange(previousSibling.node.quantifier) && !isGreedyOpenRange(node.quantifier)) { - return; - } - - // a*a* -> a* - // a*a+ -> a+ - // a+a+ -> a{2,} - // a{2}a{4} -> a{6} - // a{1,2}a{2,3} -> a{3,5} - // a{1,}a{2,} -> a{3,} - // a+a{2,} -> a{3,} - - // a??a{2,} -> a{2,} - // a*?a{2,} -> a{2,} - // a+?a{2,} -> a{3,} - - node.quantifier.kind = 'Range'; - node.quantifier.from = previousSiblingFrom + nodeFrom; - if (previousSiblingTo && nodeTo) { - node.quantifier.to = previousSiblingTo + nodeTo; - } else { - delete node.quantifier.to; - } - if (isGreedyOpenRange(previousSibling.node.quantifier) || isGreedyOpenRange(node.quantifier)) { - node.quantifier.greedy = true; - } - - previousSibling.remove(); - } else { - if (!previousSibling.hasEqualSource(path.getChild())) { - return; - } - - increaseQuantifierByOne$1(node.quantifier); - previousSibling.remove(); - } - } -}; - -function isGreedyOpenRange(quantifier) { - return quantifier.greedy && (quantifier.kind === '+' || quantifier.kind === '*' || quantifier.kind === 'Range' && !quantifier.to); -} - -function extractFromTo(quantifier) { - var from = void 0, - to = void 0; - if (quantifier.kind === '*') { - from = 0; - } else if (quantifier.kind === '+') { - from = 1; - } else if (quantifier.kind === '?') { - from = 0; - to = 1; - } else { - from = quantifier.from; - if (quantifier.to) { - to = quantifier.to; - } - } - return { from: from, to: to }; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to replace different range-based quantifiers - * with their symbol equivalents. - * - * a{0,} -> a* - * a{1,} -> a+ - * a{1} -> a - * - * NOTE: the following is automatically handled in the generator: - * - * a{3,3} -> a{3} - */ - -var quantifierRangeToSymbolTransform = { - Quantifier: function Quantifier(path) { - var node = path.node; - - - if (node.kind !== 'Range') { - return; - } - - // a{0,} -> a* - rewriteOpenZero(path); - - // a{1,} -> a+ - rewriteOpenOne(path); - - // a{1} -> a - rewriteExactOne(path); - } -}; - -function rewriteOpenZero(path) { - var node = path.node; - - - if (node.from !== 0 || node.to) { - return; - } - - node.kind = '*'; - delete node.from; -} - -function rewriteOpenOne(path) { - var node = path.node; - - - if (node.from !== 1 || node.to) { - return; - } - - node.kind = '+'; - delete node.from; -} - -function rewriteExactOne(path) { - var node = path.node; - - - if (node.from !== 1 || node.to !== 1) { - return; - } - - path.parentPath.replace(path.parentPath.node.expression); -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to simplify character classes - * spanning only one or two chars. - * - * [a-a] -> [a] - * [a-b] -> [ab] - */ - -var charClassClassrangesToCharsTransform = { - ClassRange: function ClassRange(path) { - var node = path.node; - - - if (node.from.codePoint === node.to.codePoint) { - - path.replace(node.from); - } else if (node.from.codePoint === node.to.codePoint - 1) { - - path.getParent().insertChildAt(node.to, path.index + 1); - path.replace(node.from); - } - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to replace standard character classes with - * their meta symbols equivalents. - */ - -function _toConsumableArray$6(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var charClassToMetaTransform = { - _hasIFlag: false, - _hasUFlag: false, - init: function init(ast) { - this._hasIFlag = ast.flags.includes('i'); - this._hasUFlag = ast.flags.includes('u'); - }, - CharacterClass: function CharacterClass(path) { - // [0-9] -> \d - rewriteNumberRanges(path); - - // [a-zA-Z_0-9] -> \w - rewriteWordRanges(path, this._hasIFlag, this._hasUFlag); - - // [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff] -> \s - rewriteWhitespaceRanges(path); - } -}; - -/** - * Rewrites number ranges: [0-9] -> \d - */ -function rewriteNumberRanges(path) { - var node = path.node; - - - node.expressions.forEach(function (expression, i) { - if (isFullNumberRange(expression)) { - path.getChild(i).replace({ - type: 'Char', - value: '\\d', - kind: 'meta' - }); - } - }); -} - -/** - * Rewrites word ranges: [a-zA-Z_0-9] -> \w - * Thus, the ranges may go in any order, and other symbols/ranges - * are kept untouched, e.g. [a-z_\dA-Z$] -> [\w$] - */ -function rewriteWordRanges(path, hasIFlag, hasUFlag) { - var node = path.node; - - - var numberPath = null; - var lowerCasePath = null; - var upperCasePath = null; - var underscorePath = null; - var u017fPath = null; - var u212aPath = null; - - node.expressions.forEach(function (expression, i) { - // \d - if (isMetaChar(expression, '\\d')) { - numberPath = path.getChild(i); - } - - // a-z - else if (isLowerCaseRange(expression)) { - lowerCasePath = path.getChild(i); - } - - // A-Z - else if (isUpperCaseRange(expression)) { - upperCasePath = path.getChild(i); - } - - // _ - else if (isUnderscore(expression)) { - underscorePath = path.getChild(i); - } else if (hasIFlag && hasUFlag && isCodePoint(expression, 0x017f)) { - u017fPath = path.getChild(i); - } else if (hasIFlag && hasUFlag && isCodePoint(expression, 0x212a)) { - u212aPath = path.getChild(i); - } - }); - - // If we found the whole pattern, replace it. - if (numberPath && (lowerCasePath && upperCasePath || hasIFlag && (lowerCasePath || upperCasePath)) && underscorePath && (!hasUFlag || !hasIFlag || u017fPath && u212aPath)) { - // Put \w in place of \d. - numberPath.replace({ - type: 'Char', - value: '\\w', - kind: 'meta' - }); - - // Other paths are removed. - if (lowerCasePath) { - lowerCasePath.remove(); - } - if (upperCasePath) { - upperCasePath.remove(); - } - underscorePath.remove(); - if (u017fPath) { - u017fPath.remove(); - } - if (u212aPath) { - u212aPath.remove(); - } - } -} - -/** - * Rewrites whitespace ranges: [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff] -> \s. - */ -var whitespaceRangeTests = [function (node) { - return isChar(node, ' '); -}].concat(_toConsumableArray$6(['\\f', '\\n', '\\r', '\\t', '\\v'].map(function (char) { - return function (node) { - return isMetaChar(node, char); - }; -})), _toConsumableArray$6([0x00a0, 0x1680, 0x2028, 0x2029, 0x202f, 0x205f, 0x3000, 0xfeff].map(function (codePoint) { - return function (node) { - return isCodePoint(node, codePoint); - }; -})), [function (node) { - return node.type === 'ClassRange' && isCodePoint(node.from, 0x2000) && isCodePoint(node.to, 0x200a); -}]); - -function rewriteWhitespaceRanges(path) { - var node = path.node; - - - if (node.expressions.length < whitespaceRangeTests.length || !whitespaceRangeTests.every(function (test) { - return node.expressions.some(function (expression) { - return test(expression); - }); - })) { - return; - } - - // If we found the whole pattern, replace it. - - // Put \s in place of \n. - var nNode = node.expressions.find(function (expression) { - return isMetaChar(expression, '\\n'); - }); - nNode.value = '\\s'; - nNode.symbol = undefined; - nNode.codePoint = NaN; - - // Other paths are removed. - node.expressions.map(function (expression, i) { - return whitespaceRangeTests.some(function (test) { - return test(expression); - }) ? path.getChild(i) : undefined; - }).filter(Boolean).forEach(function (path) { - return path.remove(); - }); -} - -function isFullNumberRange(node) { - return node.type === 'ClassRange' && node.from.value === '0' && node.to.value === '9'; -} - -function isChar(node, value) { - var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'simple'; - - return node.type === 'Char' && node.value === value && node.kind === kind; -} - -function isMetaChar(node, value) { - return isChar(node, value, 'meta'); -} - -function isLowerCaseRange(node) { - return node.type === 'ClassRange' && node.from.value === 'a' && node.to.value === 'z'; -} - -function isUpperCaseRange(node) { - return node.type === 'ClassRange' && node.from.value === 'A' && node.to.value === 'Z'; -} - -function isUnderscore(node) { - return node.type === 'Char' && node.value === '_' && node.kind === 'simple'; -} - -function isCodePoint(node, codePoint) { - return node.type === 'Char' && node.kind === 'unicode' && node.codePoint === codePoint; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to replace single char character classes with - * just that character. - * - * [\d] -> \d, [^\w] -> \W - */ - -var charClassToSingleCharTransform = { - CharacterClass: function CharacterClass(path) { - var node = path.node; - - - if (node.expressions.length !== 1 || !hasAppropriateSiblings$1(path) || !isAppropriateChar(node.expressions[0])) { - return; - } - - var _node$expressions$ = node.expressions[0], - value = _node$expressions$.value, - kind = _node$expressions$.kind, - escaped = _node$expressions$.escaped; - - - if (node.negative) { - // For negative can extract only meta chars like [^\w] -> \W - // cannot do for [^a] -> a (wrong). - if (!isMeta$1(value)) { - return; - } - - value = getInverseMeta(value); - } - - path.replace({ - type: 'Char', - value: value, - kind: kind, - escaped: escaped || shouldEscape(value) - }); - } -}; - -function isAppropriateChar(node) { - return node.type === 'Char' && - // We don't extract [\b] (backspace) since \b has different - // semantics (word boundary). - node.value !== '\\b'; -} - -function isMeta$1(value) { - return (/^\\[dwsDWS]$/.test(value) - ); -} - -function getInverseMeta(value) { - return (/[dws]/.test(value) ? value.toUpperCase() : value.toLowerCase() - ); -} - -function hasAppropriateSiblings$1(path) { - var parent = path.parent, - index = path.index; - - - if (parent.type !== 'Alternative') { - return true; - } - - var previousNode = parent.expressions[index - 1]; - if (previousNode == null) { - return true; - } - - // Don't optimized \1[0] to \10 - if (previousNode.type === 'Backreference' && previousNode.kind === 'number') { - return false; - } - - // Don't optimized \2[0] to \20 - if (previousNode.type === 'Char' && previousNode.kind === 'decimal') { - return false; - } - - return true; -} - -// Note: \{ and \} are always preserved to avoid `a[{]2[}]` turning -// into `a{2}`. -function shouldEscape(value) { - return (/[*[()+?$./{}|]/.test(value) - ); -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to remove unnecessary escape. - * - * \e -> e - * - * [\(] -> [(] - */ - -var charEscapeUnescapeTransform = { - _hasXFlag: false, - init: function init(ast) { - this._hasXFlag = ast.flags.includes('x'); - }, - Char: function Char(path) { - var node = path.node; - - - if (!node.escaped) { - return; - } - - if (shouldUnescape(path, this._hasXFlag)) { - delete node.escaped; - } - } -}; - -function shouldUnescape(path, hasXFlag) { - var value = path.node.value, - index = path.index, - parent = path.parent; - - // In char class (, etc are allowed. - - if (parent.type !== 'CharacterClass' && parent.type !== 'ClassRange') { - return !preservesEscape(value, index, parent, hasXFlag); - } - - return !preservesInCharClass(value, index, parent); -} - -/** - * \], \\, \^, \- - */ -function preservesInCharClass(value, index, parent) { - if (value === '^') { - // Avoid [\^a] turning into [^a] - return index === 0 && !parent.negative; - } - if (value === '-') { - // Avoid [a\-z] turning into [a-z] - return true; - } - return (/[\]\\]/.test(value) - ); -} - -function preservesEscape(value, index, parent, hasXFlag) { - if (value === '{') { - return preservesOpeningCurlyBraceEscape(index, parent); - } - - if (value === '}') { - return preservesClosingCurlyBraceEscape(index, parent); - } - - if (hasXFlag && /[ #]/.test(value)) { - return true; - } - - return (/[*[()+?^$./\\|]/.test(value) - ); -} - -function consumeNumbers(startIndex, parent, rtl) { - var i = startIndex; - var siblingNode = (rtl ? i >= 0 : i < parent.expressions.length) && parent.expressions[i]; - - while (siblingNode && siblingNode.type === 'Char' && siblingNode.kind === 'simple' && !siblingNode.escaped && /\d/.test(siblingNode.value)) { - rtl ? i-- : i++; - siblingNode = (rtl ? i >= 0 : i < parent.expressions.length) && parent.expressions[i]; - } - - return Math.abs(startIndex - i); -} - -function isSimpleChar(node, value) { - return node && node.type === 'Char' && node.kind === 'simple' && !node.escaped && node.value === value; -} - -function preservesOpeningCurlyBraceEscape(index, parent) { - // (?:\{) -> (?:{) - if (index == null) { - return false; - } - - var nbFollowingNumbers = consumeNumbers(index + 1, parent); - var i = index + nbFollowingNumbers + 1; - var nextSiblingNode = i < parent.expressions.length && parent.expressions[i]; - - if (nbFollowingNumbers) { - // Avoid \{3} turning into {3} - if (isSimpleChar(nextSiblingNode, '}')) { - return true; - } - - if (isSimpleChar(nextSiblingNode, ',')) { - nbFollowingNumbers = consumeNumbers(i + 1, parent); - i = i + nbFollowingNumbers + 1; - nextSiblingNode = i < parent.expressions.length && parent.expressions[i]; - - // Avoid \{3,} turning into {3,} - return isSimpleChar(nextSiblingNode, '}'); - } - } - return false; -} - -function preservesClosingCurlyBraceEscape(index, parent) { - // (?:\{) -> (?:{) - if (index == null) { - return false; - } - - var nbPrecedingNumbers = consumeNumbers(index - 1, parent, true); - var i = index - nbPrecedingNumbers - 1; - var previousSiblingNode = i >= 0 && parent.expressions[i]; - - // Avoid {3\} turning into {3} - if (nbPrecedingNumbers && isSimpleChar(previousSiblingNode, '{')) { - return true; - } - - if (isSimpleChar(previousSiblingNode, ',')) { - nbPrecedingNumbers = consumeNumbers(i - 1, parent, true); - i = i - nbPrecedingNumbers - 1; - previousSiblingNode = i < parent.expressions.length && parent.expressions[i]; - - // Avoid {3,\} turning into {3,} - return nbPrecedingNumbers && isSimpleChar(previousSiblingNode, '{'); - } - return false; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to merge class ranges. - * - * [a-ec] -> [a-e] - * [a-ec-e] -> [a-e] - * [\w\da-f] -> [\w] - * [abcdef] -> [a-f] - */ - -var charClassClassrangesMergeTransform = { - _hasIUFlags: false, - init: function init(ast) { - this._hasIUFlags = ast.flags.includes('i') && ast.flags.includes('u'); - }, - CharacterClass: function CharacterClass(path) { - var node = path.node; - - var expressions = node.expressions; - - var metas = []; - // Extract metas - expressions.forEach(function (expression) { - if (isMeta(expression)) { - metas.push(expression.value); - } - }); - - expressions.sort(sortCharClass); - - for (var i = 0; i < expressions.length; i++) { - var expression = expressions[i]; - if (fitsInMetas(expression, metas, this._hasIUFlags) || combinesWithPrecedingClassRange(expression, expressions[i - 1]) || combinesWithFollowingClassRange(expression, expressions[i + 1])) { - expressions.splice(i, 1); - i--; - } else { - var nbMergedChars = charCombinesWithPrecedingChars(expression, i, expressions); - expressions.splice(i - nbMergedChars + 1, nbMergedChars); - i -= nbMergedChars; - } - } - } -}; - -/** - * Sorts expressions in char class in the following order: - * - meta chars, ordered alphabetically by value - * - chars (except `control` kind) and class ranges, ordered alphabetically (`from` char is used for class ranges) - * - if ambiguous, class range comes before char - * - if ambiguous between two class ranges, orders alphabetically by `to` char - * - control chars, ordered alphabetically by value - * @param {Object} a - Left Char or ClassRange node - * @param {Object} b - Right Char or ClassRange node - * @returns {number} - */ -function sortCharClass(a, b) { - var aValue = getSortValue(a); - var bValue = getSortValue(b); - - if (aValue === bValue) { - // We want ClassRange before Char - // [bb-d] -> [b-db] - if (a.type === 'ClassRange' && b.type !== 'ClassRange') { - return -1; - } - if (b.type === 'ClassRange' && a.type !== 'ClassRange') { - return 1; - } - if (a.type === 'ClassRange' && b.type === 'ClassRange') { - return getSortValue(a.to) - getSortValue(b.to); - } - if (isMeta(a) && isMeta(b) || isControl(a) && isControl(b)) { - return a.value < b.value ? -1 : 1; - } - } - return aValue - bValue; -} - -/** - * @param {Object} expression - Char or ClassRange node - * @returns {number} - */ -function getSortValue(expression) { - if (expression.type === 'Char') { - if (expression.value === '-') { - return Infinity; - } - if (expression.kind === 'control') { - return Infinity; - } - if (expression.kind === 'meta' && isNaN(expression.codePoint)) { - return -1; - } - return expression.codePoint; - } - // ClassRange - return expression.from.codePoint; -} - -/** - * Checks if a node is a meta char from the set \d\w\s\D\W\S - * @param {Object} expression - Char or ClassRange node - * @param {?string} value - * @returns {boolean} - */ -function isMeta(expression) { - var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - return expression.type === 'Char' && expression.kind === 'meta' && (value ? expression.value === value : /^\\[dws]$/i.test(expression.value)); -} - -/** - * @param {Object} expression - Char or ClassRange node - * @returns {boolean} - */ -function isControl(expression) { - return expression.type === 'Char' && expression.kind === 'control'; -} - -/** - * @param {Object} expression - Char or ClassRange node - * @param {string[]} metas - Array of meta chars, e.g. ["\\w", "\\s"] - * @param {boolean} hasIUFlags - * @returns {boolean} - */ -function fitsInMetas(expression, metas, hasIUFlags) { - for (var i = 0; i < metas.length; i++) { - if (fitsInMeta(expression, metas[i], hasIUFlags)) { - return true; - } - } - return false; -} - -/** - * @param {Object} expression - Char or ClassRange node - * @param {string} meta - e.g. "\\w" - * @param {boolean} hasIUFlags - * @returns {boolean} - */ -function fitsInMeta(expression, meta, hasIUFlags) { - if (expression.type === 'ClassRange') { - return fitsInMeta(expression.from, meta, hasIUFlags) && fitsInMeta(expression.to, meta, hasIUFlags); - } - - // Special cases: - // \S contains \w and \d - if (meta === '\\S' && (isMeta(expression, '\\w') || isMeta(expression, '\\d'))) { - return true; - } - // \D contains \W and \s - if (meta === '\\D' && (isMeta(expression, '\\W') || isMeta(expression, '\\s'))) { - return true; - } - // \w contains \d - if (meta === '\\w' && isMeta(expression, '\\d')) { - return true; - } - // \W contains \s - if (meta === '\\W' && isMeta(expression, '\\s')) { - return true; - } - - if (expression.type !== 'Char' || isNaN(expression.codePoint)) { - return false; - } - - if (meta === '\\s') { - return fitsInMetaS(expression); - } - if (meta === '\\S') { - return !fitsInMetaS(expression); - } - if (meta === '\\d') { - return fitsInMetaD(expression); - } - if (meta === '\\D') { - return !fitsInMetaD(expression); - } - if (meta === '\\w') { - return fitsInMetaW(expression, hasIUFlags); - } - if (meta === '\\W') { - return !fitsInMetaW(expression, hasIUFlags); - } - return false; -} - -/** - * @param {Object} expression - Char node with codePoint - * @returns {boolean} - */ -function fitsInMetaS(expression) { - return expression.codePoint === 0x0009 || // \t - expression.codePoint === 0x000a || // \n - expression.codePoint === 0x000b || // \v - expression.codePoint === 0x000c || // \f - expression.codePoint === 0x000d || // \r - expression.codePoint === 0x0020 || // space - expression.codePoint === 0x00a0 || // nbsp - expression.codePoint === 0x1680 || // part of Zs - expression.codePoint >= 0x2000 && expression.codePoint <= 0x200a || // part of Zs - expression.codePoint === 0x2028 || // line separator - expression.codePoint === 0x2029 || // paragraph separator - expression.codePoint === 0x202f || // part of Zs - expression.codePoint === 0x205f || // part of Zs - expression.codePoint === 0x3000 || // part of Zs - expression.codePoint === 0xfeff; // zwnbsp -} - -/** - * @param {Object} expression - Char node with codePoint - * @returns {boolean} - */ -function fitsInMetaD(expression) { - return expression.codePoint >= 0x30 && expression.codePoint <= 0x39; // 0-9 -} - -/** - * @param {Object} expression - Char node with codePoint - * @param {boolean} hasIUFlags - * @returns {boolean} - */ -function fitsInMetaW(expression, hasIUFlags) { - return fitsInMetaD(expression) || expression.codePoint >= 0x41 && expression.codePoint <= 0x5a || // A-Z - expression.codePoint >= 0x61 && expression.codePoint <= 0x7a || // a-z - expression.value === '_' || hasIUFlags && (expression.codePoint === 0x017f || expression.codePoint === 0x212a); -} - -/** - * @param {Object} expression - Char or ClassRange node - * @param {Object} classRange - Char or ClassRange node - * @returns {boolean} - */ -function combinesWithPrecedingClassRange(expression, classRange) { - if (classRange && classRange.type === 'ClassRange') { - if (fitsInClassRange(expression, classRange)) { - // [a-gc] -> [a-g] - // [a-gc-e] -> [a-g] - return true; - } else if ( - // We only want \w chars or char codes to keep readability - isMetaWCharOrCode(expression) && classRange.to.codePoint === expression.codePoint - 1) { - // [a-de] -> [a-e] - classRange.to = expression; - return true; - } else if (expression.type === 'ClassRange' && expression.from.codePoint <= classRange.to.codePoint + 1 && expression.to.codePoint >= classRange.from.codePoint - 1) { - // [a-db-f] -> [a-f] - // [b-fa-d] -> [a-f] - // [a-cd-f] -> [a-f] - if (expression.from.codePoint < classRange.from.codePoint) { - classRange.from = expression.from; - } - if (expression.to.codePoint > classRange.to.codePoint) { - classRange.to = expression.to; - } - return true; - } - } - return false; -} - -/** - * @param {Object} expression - Char or ClassRange node - * @param {Object} classRange - Char or ClassRange node - * @returns {boolean} - */ -function combinesWithFollowingClassRange(expression, classRange) { - if (classRange && classRange.type === 'ClassRange') { - // Considering the elements were ordered alphabetically, - // there is only one case to handle - // [ab-e] -> [a-e] - if ( - // We only want \w chars or char codes to keep readability - isMetaWCharOrCode(expression) && classRange.from.codePoint === expression.codePoint + 1) { - classRange.from = expression; - return true; - } - } - - return false; -} - -/** - * @param {Object} expression - Char or ClassRange node - * @param {Object} classRange - ClassRange node - * @returns {boolean} - */ -function fitsInClassRange(expression, classRange) { - if (expression.type === 'Char' && isNaN(expression.codePoint)) { - return false; - } - if (expression.type === 'ClassRange') { - return fitsInClassRange(expression.from, classRange) && fitsInClassRange(expression.to, classRange); - } - return expression.codePoint >= classRange.from.codePoint && expression.codePoint <= classRange.to.codePoint; -} - -/** - * @param {Object} expression - Char or ClassRange node - * @param {Number} index - * @param {Object[]} expressions - expressions in CharClass - * @returns {number} - Number of characters combined with expression - */ -function charCombinesWithPrecedingChars(expression, index, expressions) { - // We only want \w chars or char codes to keep readability - if (!isMetaWCharOrCode(expression)) { - return 0; - } - var nbMergedChars = 0; - while (index > 0) { - var currentExpression = expressions[index]; - var precedingExpresion = expressions[index - 1]; - if (isMetaWCharOrCode(precedingExpresion) && precedingExpresion.codePoint === currentExpression.codePoint - 1) { - nbMergedChars++; - index--; - } else { - break; - } - } - - if (nbMergedChars > 1) { - expressions[index] = { - type: 'ClassRange', - from: expressions[index], - to: expression - }; - return nbMergedChars; - } - return 0; -} - -function isMetaWCharOrCode(expression) { - return expression && expression.type === 'Char' && !isNaN(expression.codePoint) && (fitsInMetaW(expression, false) || expression.kind === 'unicode' || expression.kind === 'hex' || expression.kind === 'oct' || expression.kind === 'decimal'); -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var NodePath$1 = nodePath; - -var _require$7 = utils, - disjunctionToList = _require$7.disjunctionToList, - listToDisjunction = _require$7.listToDisjunction; - -/** - * Removes duplicates from a disjunction sequence: - * - * /(ab|bc|ab)+(xy|xy)+/ -> /(ab|bc)+(xy)+/ - */ - - -var disjunctionRemoveDuplicatesTransform = { - Disjunction: function Disjunction(path) { - var node = path.node; - - // Make unique nodes. - - var uniqueNodesMap = {}; - - var parts = disjunctionToList(node).filter(function (part) { - var encoded = part ? NodePath$1.getForNode(part).jsonEncode() : 'null'; - - // Already recorded this part, filter out. - if (uniqueNodesMap.hasOwnProperty(encoded)) { - return false; - } - - uniqueNodesMap[encoded] = part; - return true; - }); - - // Replace with the optimized disjunction. - path.replace(listToDisjunction(parts)); - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to replace single char group disjunction to char group - * - * a|b|c -> [abc] - * [12]|3|4 -> [1234] - * (a|b|c) -> ([abc]) - * (?:a|b|c) -> [abc] - */ - -var groupSingleCharsToCharClass = { - Disjunction: function Disjunction(path) { - var node = path.node, - parent = path.parent; - - - if (!handlers[parent.type]) { - return; - } - - var charset = new Map(); - - if (!shouldProcess(node, charset) || !charset.size) { - return; - } - - var characterClass = { - type: 'CharacterClass', - expressions: Array.from(charset.keys()).sort().map(function (key) { - return charset.get(key); - }) - }; - - handlers[parent.type](path.getParent(), characterClass); - } -}; - -var handlers = { - RegExp: function RegExp(path, characterClass) { - var node = path.node; - - - node.body = characterClass; - }, - Group: function Group(path, characterClass) { - var node = path.node; - - - if (node.capturing) { - node.expression = characterClass; - } else { - path.replace(characterClass); - } - } -}; - -function shouldProcess(expression, charset) { - if (!expression) { - // Abort on empty disjunction part - return false; - } - - var type = expression.type; - - - if (type === 'Disjunction') { - var left = expression.left, - right = expression.right; - - - return shouldProcess(left, charset) && shouldProcess(right, charset); - } else if (type === 'Char') { - if (expression.kind === 'meta' && expression.symbol === '.') { - return false; - } - - var value = expression.value; - - - charset.set(value, expression); - - return true; - } else if (type === 'CharacterClass' && !expression.negative) { - return expression.expressions.every(function (expression) { - return shouldProcess(expression, charset); - }); - } - - return false; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to remove non-capturing empty groups. - * - * /(?:)a/ -> /a/ - * /a|(?:)/ -> /a|/ - */ - -var removeEmptyGroupTransform = { - Group: function Group(path) { - var node = path.node, - parent = path.parent; - - var childPath = path.getChild(); - - if (node.capturing || childPath) { - return; - } - - if (parent.type === 'Repetition') { - - path.getParent().replace(node); - } else if (parent.type !== 'RegExp') { - - path.remove(); - } - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A regexp-tree plugin to remove unnecessary groups. - * - * /(?:a)/ -> /a/ - */ - -function _toConsumableArray$5(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var ungroupTransform = { - Group: function Group(path) { - var node = path.node, - parent = path.parent; - - var childPath = path.getChild(); - - if (node.capturing || !childPath) { - return; - } - - // Don't optimize \1(?:0) to \10 - if (!hasAppropriateSiblings(path)) { - return; - } - - // Don't optimize /a(?:b|c)/ to /ab|c/ - // but /(?:b|c)/ to /b|c/ is ok - if (childPath.node.type === 'Disjunction' && parent.type !== 'RegExp') { - return; - } - - // Don't optimize /(?:ab)+/ to /ab+/ - // but /(?:a)+/ to /a+/ is ok - // and /(?:[a-d])+/ to /[a-d]+/ is ok too - if (parent.type === 'Repetition' && childPath.node.type !== 'Char' && childPath.node.type !== 'CharacterClass') { - return; - } - - if (childPath.node.type === 'Alternative') { - var parentPath = path.getParent(); - if (parentPath.node.type === 'Alternative') { - // /abc(?:def)ghi/ When (?:def) is ungrouped its content must be merged with parent alternative - - parentPath.replace({ - type: 'Alternative', - expressions: [].concat(_toConsumableArray$5(parent.expressions.slice(0, path.index)), _toConsumableArray$5(childPath.node.expressions), _toConsumableArray$5(parent.expressions.slice(path.index + 1))) - }); - } - } else { - path.replace(childPath.node); - } - } -}; - -function hasAppropriateSiblings(path) { - var parent = path.parent, - index = path.index; - - - if (parent.type !== 'Alternative') { - return true; - } - - var previousNode = parent.expressions[index - 1]; - if (previousNode == null) { - return true; - } - - // Don't optimized \1(?:0) to \10 - if (previousNode.type === 'Backreference' && previousNode.kind === 'number') { - return false; - } - - // Don't optimized \2(?:0) to \20 - if (previousNode.type === 'Char' && previousNode.kind === 'decimal') { - return false; - } - - return true; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -function _toConsumableArray$4(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var NodePath = nodePath; - -var _require$6 = utils, - increaseQuantifierByOne = _require$6.increaseQuantifierByOne; - -/** - * A regexp-tree plugin to combine repeating patterns. - * - * /^abcabcabc/ -> /^abc{3}/ - * /^(?:abc){2}abc/ -> /^(?:abc){3}/ - * /^abc(?:abc){2}/ -> /^(?:abc){3}/ - */ - -var combineRepeatingPatternsTransform = { - Alternative: function Alternative(path) { - var node = path.node; - - // We can skip the first child - - var index = 1; - while (index < node.expressions.length) { - var child = path.getChild(index); - index = Math.max(1, combineRepeatingPatternLeft(path, child, index)); - - if (index >= node.expressions.length) { - break; - } - - child = path.getChild(index); - index = Math.max(1, combineWithPreviousRepetition(path, child, index)); - - if (index >= node.expressions.length) { - break; - } - - child = path.getChild(index); - index = Math.max(1, combineRepetitionWithPrevious(path, child, index)); - - index++; - } - } -}; - -// abcabc -> (?:abc){2} -function combineRepeatingPatternLeft(alternative, child, index) { - var node = alternative.node; - - - var nbPossibleLengths = Math.ceil(index / 2); - var i = 0; - - while (i < nbPossibleLengths) { - var startIndex = index - 2 * i - 1; - var right = void 0, - left = void 0; - - if (i === 0) { - right = child; - left = alternative.getChild(startIndex); - } else { - right = NodePath.getForNode({ - type: 'Alternative', - expressions: [].concat(_toConsumableArray$4(node.expressions.slice(index - i, index)), [child.node]) - }); - - left = NodePath.getForNode({ - type: 'Alternative', - expressions: [].concat(_toConsumableArray$4(node.expressions.slice(startIndex, index - i))) - }); - } - - if (right.hasEqualSource(left)) { - for (var j = 0; j < 2 * i + 1; j++) { - alternative.getChild(startIndex).remove(); - } - - child.replace({ - type: 'Repetition', - expression: i === 0 && right.node.type !== 'Repetition' ? right.node : { - type: 'Group', - capturing: false, - expression: right.node - }, - quantifier: { - type: 'Quantifier', - kind: 'Range', - from: 2, - to: 2, - greedy: true - } - }); - return startIndex; - } - - i++; - } - - return index; -} - -// (?:abc){2}abc -> (?:abc){3} -function combineWithPreviousRepetition(alternative, child, index) { - var node = alternative.node; - - - var i = 0; - while (i < index) { - var previousChild = alternative.getChild(i); - - if (previousChild.node.type === 'Repetition' && previousChild.node.quantifier.greedy) { - var left = previousChild.getChild(); - var right = void 0; - - if (left.node.type === 'Group' && !left.node.capturing) { - left = left.getChild(); - } - - if (i + 1 === index) { - right = child; - if (right.node.type === 'Group' && !right.node.capturing) { - right = right.getChild(); - } - } else { - right = NodePath.getForNode({ - type: 'Alternative', - expressions: [].concat(_toConsumableArray$4(node.expressions.slice(i + 1, index + 1))) - }); - } - - if (left.hasEqualSource(right)) { - for (var j = i; j < index; j++) { - alternative.getChild(i + 1).remove(); - } - - increaseQuantifierByOne(previousChild.node.quantifier); - - return i; - } - } - - i++; - } - return index; -} - -// abc(?:abc){2} -> (?:abc){3} -function combineRepetitionWithPrevious(alternative, child, index) { - var node = alternative.node; - - - if (child.node.type === 'Repetition' && child.node.quantifier.greedy) { - var right = child.getChild(); - var left = void 0; - - if (right.node.type === 'Group' && !right.node.capturing) { - right = right.getChild(); - } - - var rightLength = void 0; - if (right.node.type === 'Alternative') { - rightLength = right.node.expressions.length; - left = NodePath.getForNode({ - type: 'Alternative', - expressions: [].concat(_toConsumableArray$4(node.expressions.slice(index - rightLength, index))) - }); - } else { - rightLength = 1; - left = alternative.getChild(index - 1); - if (left.node.type === 'Group' && !left.node.capturing) { - left = left.getChild(); - } - } - - if (left.hasEqualSource(right)) { - for (var j = index - rightLength; j < index; j++) { - alternative.getChild(index - rightLength).remove(); - } - - increaseQuantifierByOne(child.node.quantifier); - - return index - rightLength; - } - } - return index; -} - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var transforms = new Map([ -// \ud83d\ude80 -> \u{1f680} -['charSurrogatePairToSingleUnicode', charSurrogatePairToSingleUnicodeTransform], - -// \u0061 -> a -['charCodeToSimpleChar', charCodeToSimpleCharTransform], - -// /Aa/i -> /aa/i -['charCaseInsensitiveLowerCaseTransform', charCaseInsensitiveLowercaseTransform], - -// [\d\d] -> [\d] -['charClassRemoveDuplicates', charClassRemoveDuplicatesTransform], - -// a{1,2}a{2,3} -> a{3,5} -['quantifiersMerge', quantifiersMergeTransform], - -// a{1,} -> a+, a{3,3} -> a{3}, a{1} -> a -['quantifierRangeToSymbol', quantifierRangeToSymbolTransform], - -// [a-a] -> [a], [a-b] -> [ab] -['charClassClassrangesToChars', charClassClassrangesToCharsTransform], - -// [0-9] -> [\d] -['charClassToMeta', charClassToMetaTransform], - -// [\d] -> \d, [^\w] -> \W -['charClassToSingleChar', charClassToSingleCharTransform], - -// \e -> e -['charEscapeUnescape', charEscapeUnescapeTransform], - -// [a-de-f] -> [a-f] -['charClassClassrangesMerge', charClassClassrangesMergeTransform], - -// (ab|ab) -> (ab) -['disjunctionRemoveDuplicates', disjunctionRemoveDuplicatesTransform], - -// (a|b|c) -> [abc] -['groupSingleCharsToCharClass', groupSingleCharsToCharClass], - -// (?:)a -> a -['removeEmptyGroup', removeEmptyGroupTransform], - -// (?:a) -> a -['ungroup', ungroupTransform], - -// abcabcabc -> (?:abc){3} -['combineRepeatingPatterns', combineRepeatingPatternsTransform]]); - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var clone = clone$1; -var parser$2 = parser$4; -var transform = transform$1; -var optimizationTransforms = transforms; - -var optimizer$1 = { - /** - * Optimizer transforms a regular expression into an optimized version, - * replacing some sub-expressions with their idiomatic patterns. - * - * @param string | RegExp | AST - a regexp to optimize. - * - * @return TransformResult - an optimized regexp. - * - * Example: - * - * /[a-zA-Z_0-9][a-zA-Z_0-9]*\e{1,}/ - * - * Optimized to: - * - * /\w+e+/ - */ - optimize: function optimize(regexp) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$whitelist = _ref.whitelist, - whitelist = _ref$whitelist === undefined ? [] : _ref$whitelist, - _ref$blacklist = _ref.blacklist, - blacklist = _ref$blacklist === undefined ? [] : _ref$blacklist; - - var transformsRaw = whitelist.length > 0 ? whitelist : Array.from(optimizationTransforms.keys()); - - var transformToApply = transformsRaw.filter(function (transform) { - return !blacklist.includes(transform); - }); - - var ast = regexp; - if (regexp instanceof RegExp) { - regexp = '' + regexp; - } - - if (typeof regexp === 'string') { - ast = parser$2.parse(regexp); - } - - var result = new transform.TransformResult(ast); - var prevResultString = void 0; - - do { - // Get a copy of the current state here so - // we can compare it with the state at the - // end of the loop. - prevResultString = result.toString(); - ast = clone(result.getAST()); - - transformToApply.forEach(function (transformName) { - if (!optimizationTransforms.has(transformName)) { - throw new Error('Unknown optimization-transform: ' + transformName + '. ' + 'Available transforms are: ' + Array.from(optimizationTransforms.keys()).join(', ')); - } - - var transformer = optimizationTransforms.get(transformName); - - // Don't override result just yet since we - // might want to rollback the transform - var newResult = transform.transform(ast, transformer); - - if (newResult.toString() !== result.toString()) { - if (newResult.toString().length <= result.toString().length) { - result = newResult; - } else { - // Result has changed but is not shorter: - // restore ast to its previous state. - - ast = clone(result.getAST()); - } - } - }); - - // Keep running the optimizer until it stops - // making any change to the regexp. - } while (result.toString() !== prevResultString); - - return result; - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * Epsilon, the empty string. - */ - -var EPSILON$3 = 'ε'; - -/** - * Epsilon-closure. - */ -var EPSILON_CLOSURE$2 = EPSILON$3 + '*'; - -var specialSymbols = { - EPSILON: EPSILON$3, - EPSILON_CLOSURE: EPSILON_CLOSURE$2 -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var _slicedToArray$1 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass$4 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _toConsumableArray$3(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _require$5 = specialSymbols, - EPSILON$2 = _require$5.EPSILON, - EPSILON_CLOSURE$1 = _require$5.EPSILON_CLOSURE; - -/** - * NFA fragment. - * - * NFA sub-fragments can be combined to a larger NFAs building - * the resulting machine. Combining the fragments is done by patching - * edges of the in- and out-states. - * - * 2-states implementation, `in`, and `out`. Eventually all transitions - * go to the same `out`, which can further be connected via ε-transition - * with other fragment. - */ - - -var NFA$2 = function () { - function NFA(inState, outState) { - _classCallCheck$4(this, NFA); - - this.in = inState; - this.out = outState; - } - - /** - * Tries to recognize a string based on this NFA fragment. - */ - - - _createClass$4(NFA, [{ - key: 'matches', - value: function matches(string) { - return this.in.matches(string); - } - - /** - * Returns an alphabet for this NFA. - */ - - }, { - key: 'getAlphabet', - value: function getAlphabet() { - if (!this._alphabet) { - this._alphabet = new Set(); - var table = this.getTransitionTable(); - for (var state in table) { - var transitions = table[state]; - for (var symbol in transitions) { - if (symbol !== EPSILON_CLOSURE$1) { - this._alphabet.add(symbol); - } - } - } - } - return this._alphabet; - } - - /** - * Returns set of accepting states. - */ - - }, { - key: 'getAcceptingStates', - value: function getAcceptingStates() { - if (!this._acceptingStates) { - // States are determined during table construction. - this.getTransitionTable(); - } - return this._acceptingStates; - } - - /** - * Returns accepting state numbers. - */ - - }, { - key: 'getAcceptingStateNumbers', - value: function getAcceptingStateNumbers() { - if (!this._acceptingStateNumbers) { - this._acceptingStateNumbers = new Set(); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = this.getAcceptingStates()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var acceptingState = _step.value; - - this._acceptingStateNumbers.add(acceptingState.number); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - return this._acceptingStateNumbers; - } - - /** - * Builds and returns transition table. - */ - - }, { - key: 'getTransitionTable', - value: function getTransitionTable() { - var _this = this; - - if (!this._transitionTable) { - this._transitionTable = {}; - this._acceptingStates = new Set(); - - var visited = new Set(); - var symbols = new Set(); - - var visitState = function visitState(state) { - if (visited.has(state)) { - return; - } - - visited.add(state); - state.number = visited.size; - _this._transitionTable[state.number] = {}; - - if (state.accepting) { - _this._acceptingStates.add(state); - } - - var transitions = state.getTransitions(); - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = transitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var _ref = _step2.value; - - var _ref2 = _slicedToArray$1(_ref, 2); - - var symbol = _ref2[0]; - var symbolTransitions = _ref2[1]; - - var combinedState = []; - symbols.add(symbol); - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = symbolTransitions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var nextState = _step3.value; - - visitState(nextState); - combinedState.push(nextState.number); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - _this._transitionTable[state.number][symbol] = combinedState; - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - }; - - // Traverse the graph starting from the `in`. - visitState(this.in); - - // Append epsilon-closure column. - visited.forEach(function (state) { - delete _this._transitionTable[state.number][EPSILON$2]; - _this._transitionTable[state.number][EPSILON_CLOSURE$1] = [].concat(_toConsumableArray$3(state.getEpsilonClosure())).map(function (s) { - return s.number; - }); - }); - } - - return this._transitionTable; - } - }]); - - return NFA; -}(); - -var nfa = NFA$2; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -// DFA minization. - -/** - * Map from state to current set it goes. - */ - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } - -function _toConsumableArray$2(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var currentTransitionMap = null; - -/** - * Takes a DFA, and returns a minimized version of it - * compressing some states to groups (using standard, 0-, 1-, - * 2-, ... N-equivalence algorithm). - */ -function minimize(dfa) { - var table = dfa.getTransitionTable(); - var allStates = Object.keys(table); - var alphabet = dfa.getAlphabet(); - var accepting = dfa.getAcceptingStateNumbers(); - - currentTransitionMap = {}; - - var nonAccepting = new Set(); - - allStates.forEach(function (state) { - state = Number(state); - var isAccepting = accepting.has(state); - - if (isAccepting) { - currentTransitionMap[state] = accepting; - } else { - nonAccepting.add(state); - currentTransitionMap[state] = nonAccepting; - } - }); - - // --------------------------------------------------------------------------- - // Step 1: build equivalent sets. - - // All [1..N] equivalent sets. - var all = [ - // 0-equivalent sets. - [nonAccepting, accepting].filter(function (set) { - return set.size > 0; - })]; - - var current = void 0; - var previous = void 0; - - // Top of the stack is the current list of sets to analyze. - current = all[all.length - 1]; - - // Previous set (to check whether we need to stop). - previous = all[all.length - 2]; - - // Until we'll not have the same N and N-1 equivalent rows. - - var _loop = function _loop() { - var newTransitionMap = {}; - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = current[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var _set = _step3.value; - - // Handled states for this set. - var handledStates = {}; - - var _set2 = _toArray(_set), - first = _set2[0], - rest = _set2.slice(1); - - handledStates[first] = new Set([first]); - - // Have to compare each from the rest states with - // the already handled states, and see if they are equivalent. - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - - try { - restSets: for (var _iterator4 = rest[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var state = _step4.value; - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - - try { - for (var _iterator5 = Object.keys(handledStates)[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var handledState = _step5.value; - - // This and some previously handled state are equivalent -- - // just append this state to the same set. - if (areEquivalent(state, handledState, table, alphabet)) { - handledStates[handledState].add(state); - handledStates[state] = handledStates[handledState]; - continue restSets; - } - } - // Else, this state is not equivalent to any of the - // handled states -- allocate a new set for it. - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - - handledStates[state] = new Set([state]); - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - - // Add these handled states to all states map. - - - Object.assign(newTransitionMap, handledStates); - } - - // Update current transition map for the handled row. - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - currentTransitionMap = newTransitionMap; - - var newSets = new Set(Object.keys(newTransitionMap).map(function (state) { - return newTransitionMap[state]; - })); - - all.push([].concat(_toConsumableArray$2(newSets))); - - // Top of the stack is the current. - current = all[all.length - 1]; - - // Previous set. - previous = all[all.length - 2]; - }; - - while (!sameRow(current, previous)) { - _loop(); - } - - // --------------------------------------------------------------------------- - // Step 2: build minimized table from the equivalent sets. - - // Remap state numbers from sets to index-based. - var remaped = new Map(); - var idx = 1; - current.forEach(function (set) { - return remaped.set(set, idx++); - }); - - // Build the minimized table from the calculated equivalent sets. - var minimizedTable = {}; - - var minimizedAcceptingStates = new Set(); - - var updateAcceptingStates = function updateAcceptingStates(set, idx) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = set[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var state = _step.value; - - if (accepting.has(state)) { - minimizedAcceptingStates.add(idx); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }; - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = remaped.entries()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var _ref = _step2.value; - - var _ref2 = _slicedToArray(_ref, 2); - - var set = _ref2[0]; - var _idx = _ref2[1]; - - minimizedTable[_idx] = {}; - var _iteratorNormalCompletion6 = true; - var _didIteratorError6 = false; - var _iteratorError6 = undefined; - - try { - for (var _iterator6 = alphabet[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { - var symbol = _step6.value; - - updateAcceptingStates(set, _idx); - - // Determine original transition for this symbol from the set. - var originalTransition = void 0; - var _iteratorNormalCompletion7 = true; - var _didIteratorError7 = false; - var _iteratorError7 = undefined; - - try { - for (var _iterator7 = set[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { - var originalState = _step7.value; - - originalTransition = table[originalState][symbol]; - if (originalTransition) { - break; - } - } - } catch (err) { - _didIteratorError7 = true; - _iteratorError7 = err; - } finally { - try { - if (!_iteratorNormalCompletion7 && _iterator7.return) { - _iterator7.return(); - } - } finally { - if (_didIteratorError7) { - throw _iteratorError7; - } - } - } - - if (originalTransition) { - minimizedTable[_idx][symbol] = remaped.get(currentTransitionMap[originalTransition]); - } - } - } catch (err) { - _didIteratorError6 = true; - _iteratorError6 = err; - } finally { - try { - if (!_iteratorNormalCompletion6 && _iterator6.return) { - _iterator6.return(); - } - } finally { - if (_didIteratorError6) { - throw _iteratorError6; - } - } - } - } - - // Update the table, and accepting states on the original DFA. - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - dfa.setTransitionTable(minimizedTable); - dfa.setAcceptingStateNumbers(minimizedAcceptingStates); - - return dfa; -} - -function sameRow(r1, r2) { - if (!r2) { - return false; - } - - if (r1.length !== r2.length) { - return false; - } - - for (var i = 0; i < r1.length; i++) { - var s1 = r1[i]; - var s2 = r2[i]; - - if (s1.size !== s2.size) { - return false; - } - - if ([].concat(_toConsumableArray$2(s1)).sort().join(',') !== [].concat(_toConsumableArray$2(s2)).sort().join(',')) { - return false; - } - } - - return true; -} - -/** - * Checks whether two states are N-equivalent, i.e. whether they go - * to the same set on a symbol. - */ -function areEquivalent(s1, s2, table, alphabet) { - var _iteratorNormalCompletion8 = true; - var _didIteratorError8 = false; - var _iteratorError8 = undefined; - - try { - for (var _iterator8 = alphabet[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { - var symbol = _step8.value; - - if (!goToSameSet(s1, s2, table, symbol)) { - return false; - } - } - } catch (err) { - _didIteratorError8 = true; - _iteratorError8 = err; - } finally { - try { - if (!_iteratorNormalCompletion8 && _iterator8.return) { - _iterator8.return(); - } - } finally { - if (_didIteratorError8) { - throw _iteratorError8; - } - } - } - - return true; -} - -/** - * Checks whether states go to the same set. - */ -function goToSameSet(s1, s2, table, symbol) { - if (!currentTransitionMap[s1] || !currentTransitionMap[s2]) { - return false; - } - - var originalTransitionS1 = table[s1][symbol]; - var originalTransitionS2 = table[s2][symbol]; - - // If no actual transition on this symbol, treat it as positive. - if (!originalTransitionS1 && !originalTransitionS2) { - return true; - } - - // Otherwise, check if they are in the same sets. - return currentTransitionMap[s1].has(originalTransitionS1) && currentTransitionMap[s2].has(originalTransitionS2); -} - -var dfaMinimizer = { - minimize: minimize -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var _createClass$3 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var DFAMinimizer = dfaMinimizer; - -var _require$4 = specialSymbols, - EPSILON_CLOSURE = _require$4.EPSILON_CLOSURE; - -/** - * DFA is build by converting from NFA (subset construction). - */ - - -var DFA$1 = function () { - function DFA(nfa) { - _classCallCheck$3(this, DFA); - - this._nfa = nfa; - } - - /** - * Minimizes DFA. - */ - - - _createClass$3(DFA, [{ - key: 'minimize', - value: function minimize() { - this.getTransitionTable(); - - this._originalAcceptingStateNumbers = this._acceptingStateNumbers; - this._originalTransitionTable = this._transitionTable; - - DFAMinimizer.minimize(this); - } - - /** - * Returns alphabet for this DFA. - */ - - }, { - key: 'getAlphabet', - value: function getAlphabet() { - return this._nfa.getAlphabet(); - } - - /** - * Returns accepting states. - */ - - }, { - key: 'getAcceptingStateNumbers', - value: function getAcceptingStateNumbers() { - if (!this._acceptingStateNumbers) { - // Accepting states are determined during table construction. - this.getTransitionTable(); - } - - return this._acceptingStateNumbers; - } - - /** - * Returns original accepting states. - */ - - }, { - key: 'getOriginaAcceptingStateNumbers', - value: function getOriginaAcceptingStateNumbers() { - if (!this._originalAcceptingStateNumbers) { - // Accepting states are determined during table construction. - this.getTransitionTable(); - } - - return this._originalAcceptingStateNumbers; - } - - /** - * Sets transition table. - */ - - }, { - key: 'setTransitionTable', - value: function setTransitionTable(table) { - this._transitionTable = table; - } - - /** - * Sets accepting states. - */ - - }, { - key: 'setAcceptingStateNumbers', - value: function setAcceptingStateNumbers(stateNumbers) { - this._acceptingStateNumbers = stateNumbers; - } - - /** - * DFA transition table is built from NFA table. - */ - - }, { - key: 'getTransitionTable', - value: function getTransitionTable() { - var _this = this; - - if (this._transitionTable) { - return this._transitionTable; - } - - // Calculate from NFA transition table. - var nfaTable = this._nfa.getTransitionTable(); - var nfaStates = Object.keys(nfaTable); - - this._acceptingStateNumbers = new Set(); - - // Start state of DFA is E(S[nfa]) - var startState = nfaTable[nfaStates[0]][EPSILON_CLOSURE]; - - // Init the worklist (states which should be in the DFA). - var worklist = [startState]; - - var alphabet = this.getAlphabet(); - var nfaAcceptingStates = this._nfa.getAcceptingStateNumbers(); - - var dfaTable = {}; - - // Determine whether the combined DFA state is accepting. - var updateAcceptingStates = function updateAcceptingStates(states) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = nfaAcceptingStates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var nfaAcceptingState = _step.value; - - // If any of the states from NFA is accepting, DFA's - // state is accepting as well. - if (states.indexOf(nfaAcceptingState) !== -1) { - _this._acceptingStateNumbers.add(states.join(',')); - break; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }; - - while (worklist.length > 0) { - var states = worklist.shift(); - var dfaStateLabel = states.join(','); - dfaTable[dfaStateLabel] = {}; - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = alphabet[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var symbol = _step2.value; - - var onSymbol = []; - - // Determine whether the combined state is accepting. - updateAcceptingStates(states); - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = states[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var state = _step3.value; - - var nfaStatesOnSymbol = nfaTable[state][symbol]; - if (!nfaStatesOnSymbol) { - continue; - } - - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - - try { - for (var _iterator4 = nfaStatesOnSymbol[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var nfaStateOnSymbol = _step4.value; - - if (!nfaTable[nfaStateOnSymbol]) { - continue; - } - onSymbol.push.apply(onSymbol, _toConsumableArray$1(nfaTable[nfaStateOnSymbol][EPSILON_CLOSURE])); - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - var dfaStatesOnSymbolSet = new Set(onSymbol); - var dfaStatesOnSymbol = [].concat(_toConsumableArray$1(dfaStatesOnSymbolSet)); - - if (dfaStatesOnSymbol.length > 0) { - var dfaOnSymbolStr = dfaStatesOnSymbol.join(','); - - dfaTable[dfaStateLabel][symbol] = dfaOnSymbolStr; - - if (!dfaTable.hasOwnProperty(dfaOnSymbolStr)) { - worklist.unshift(dfaStatesOnSymbol); - } - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - } - - return this._transitionTable = this._remapStateNumbers(dfaTable); - } - - /** - * Remaps state numbers in the resulting table: - * combined states '1,2,3' -> 1, '3,4' -> 2, etc. - */ - - }, { - key: '_remapStateNumbers', - value: function _remapStateNumbers(calculatedDFATable) { - var newStatesMap = {}; - - this._originalTransitionTable = calculatedDFATable; - var transitionTable = {}; - - Object.keys(calculatedDFATable).forEach(function (originalNumber, newNumber) { - newStatesMap[originalNumber] = newNumber + 1; - }); - - for (var originalNumber in calculatedDFATable) { - var originalRow = calculatedDFATable[originalNumber]; - var row = {}; - - for (var symbol in originalRow) { - row[symbol] = newStatesMap[originalRow[symbol]]; - } - - transitionTable[newStatesMap[originalNumber]] = row; - } - - // Remap accepting states. - this._originalAcceptingStateNumbers = this._acceptingStateNumbers; - this._acceptingStateNumbers = new Set(); - - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - - try { - for (var _iterator5 = this._originalAcceptingStateNumbers[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var _originalNumber = _step5.value; - - this._acceptingStateNumbers.add(newStatesMap[_originalNumber]); - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - - return transitionTable; - } - - /** - * Returns original DFA table, where state numbers - * are combined numbers from NFA. - */ - - }, { - key: 'getOriginalTransitionTable', - value: function getOriginalTransitionTable() { - if (!this._originalTransitionTable) { - // Original table is determined during table construction. - this.getTransitionTable(); - } - return this._originalTransitionTable; - } - - /** - * Checks whether this DFA accepts a string. - */ - - }, { - key: 'matches', - value: function matches(string) { - var state = 1; - var i = 0; - var table = this.getTransitionTable(); - - while (string[i]) { - state = table[state][string[i++]]; - if (!state) { - return false; - } - } - - if (!this.getAcceptingStateNumbers().has(state)) { - return false; - } - - return true; - } - }]); - - return DFA; -}(); - -var dfa = DFA$1; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * A generic FA State class (base for NFA and DFA). - * - * Maintains the transition map, and the flag whether - * the state is accepting. - */ - -var _createClass$2 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var State$1 = function () { - function State() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$accepting = _ref.accepting, - accepting = _ref$accepting === undefined ? false : _ref$accepting; - - _classCallCheck$2(this, State); - - /** - * Outgoing transitions to other states. - */ - this._transitions = new Map(); - - /** - * Whether the state is accepting. - */ - this.accepting = accepting; - } - - /** - * Returns transitions for this state. - */ - - - _createClass$2(State, [{ - key: 'getTransitions', - value: function getTransitions() { - return this._transitions; - } - - /** - * Creates a transition on symbol. - */ - - }, { - key: 'addTransition', - value: function addTransition(symbol, toState) { - this.getTransitionsOnSymbol(symbol).add(toState); - return this; - } - - /** - * Returns transitions set on symbol. - */ - - }, { - key: 'getTransitionsOnSymbol', - value: function getTransitionsOnSymbol(symbol) { - var transitions = this._transitions.get(symbol); - - if (!transitions) { - transitions = new Set(); - this._transitions.set(symbol, transitions); - } - - return transitions; - } - }]); - - return State; -}(); - -var state = State$1; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var State = state; - -var _require$3 = specialSymbols, - EPSILON$1 = _require$3.EPSILON; - -/** - * NFA state. - * - * Allows nondeterministic transitions to several states on the - * same symbol, and also epsilon-transitions. - */ - - -var NFAState$1 = function (_State) { - _inherits(NFAState, _State); - - function NFAState() { - _classCallCheck$1(this, NFAState); - - return _possibleConstructorReturn(this, (NFAState.__proto__ || Object.getPrototypeOf(NFAState)).apply(this, arguments)); - } - - _createClass$1(NFAState, [{ - key: 'matches', - - - /** - * Whether this state matches a string. - * - * We maintain set of visited epsilon-states to avoid infinite loops - * when an epsilon-transition goes eventually to itself. - * - * NOTE: this function is rather "educational", since we use DFA for strings - * matching. DFA is built on top of NFA, and uses fast transition table. - */ - value: function matches(string) { - var visited = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); - - // An epsilon-state has been visited, stop to avoid infinite loop. - if (visited.has(this)) { - return false; - } - - visited.add(this); - - // No symbols left.. - if (string.length === 0) { - // .. and we're in the accepting state. - if (this.accepting) { - return true; - } - - // Check if we can reach any accepting state from - // on the epsilon transitions. - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = this.getTransitionsOnSymbol(EPSILON$1)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var nextState = _step.value; - - if (nextState.matches('', visited)) { - return true; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return false; - } - - // Else, we get some symbols. - var symbol = string[0]; - var rest = string.slice(1); - - var symbolTransitions = this.getTransitionsOnSymbol(symbol); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = symbolTransitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var _nextState = _step2.value; - - if (_nextState.matches(rest)) { - return true; - } - } - - // If we couldn't match on symbol, check still epsilon-transitions - // without consuming the symbol (i.e. continue from `string`, not `rest`). - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = this.getTransitionsOnSymbol(EPSILON$1)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var _nextState2 = _step3.value; - - if (_nextState2.matches(string, visited)) { - return true; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - return false; - } - - /** - * Returns an ε-closure for this state: - * self + all states following ε-transitions. - */ - - }, { - key: 'getEpsilonClosure', - value: function getEpsilonClosure() { - var _this2 = this; - - if (!this._epsilonClosure) { - (function () { - var epsilonTransitions = _this2.getTransitionsOnSymbol(EPSILON$1); - var closure = _this2._epsilonClosure = new Set(); - closure.add(_this2); - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - - try { - for (var _iterator4 = epsilonTransitions[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var nextState = _step4.value; - - if (!closure.has(nextState)) { - closure.add(nextState); - var nextClosure = nextState.getEpsilonClosure(); - nextClosure.forEach(function (state) { - return closure.add(state); - }); - } - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - })(); - } - - return this._epsilonClosure; - } - }]); - - return NFAState; -}(State); - -var nfaState = NFAState$1; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var NFA$1 = nfa; -var NFAState = nfaState; - -var _require$2 = specialSymbols, - EPSILON = _require$2.EPSILON; - -// ----------------------------------------------------------------------------- -// Char NFA fragment: `c` - -/** - * Char factory. - * - * Creates an NFA fragment for a single char. - * - * [in] --c--> [out] - */ - - -function char$1(c) { - var inState = new NFAState(); - var outState = new NFAState({ - accepting: true - }); - - return new NFA$1(inState.addTransition(c, outState), outState); -} - -// ----------------------------------------------------------------------------- -// Epsilon NFA fragment - -/** - * Epsilon factory. - * - * Creates an NFA fragment for ε (recognizes an empty string). - * - * [in] --ε--> [out] - */ -function e() { - return char$1(EPSILON); -} - -// ----------------------------------------------------------------------------- -// Alteration NFA fragment: `abc` - -/** - * Creates a connection between two NFA fragments on epsilon transition. - * - * [in-a] --a--> [out-a] --ε--> [in-b] --b--> [out-b] - */ -function altPair(first, second) { - first.out.accepting = false; - second.out.accepting = true; - - first.out.addTransition(EPSILON, second.in); - - return new NFA$1(first.in, second.out); -} - -/** - * Alteration factory. - * - * Creates a alteration NFA for (at least) two NFA-fragments. - */ -function alt$1(first) { - for (var _len = arguments.length, fragments = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - fragments[_key - 1] = arguments[_key]; - } - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = fragments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var fragment = _step.value; - - first = altPair(first, fragment); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return first; -} - -// ----------------------------------------------------------------------------- -// Disjunction NFA fragment: `a|b` - -/** - * Creates a disjunction choice between two fragments. - */ -function orPair(first, second) { - var inState = new NFAState(); - var outState = new NFAState(); - - inState.addTransition(EPSILON, first.in); - inState.addTransition(EPSILON, second.in); - - outState.accepting = true; - first.out.accepting = false; - second.out.accepting = false; - - first.out.addTransition(EPSILON, outState); - second.out.addTransition(EPSILON, outState); - - return new NFA$1(inState, outState); -} - -/** - * Disjunction factory. - * - * Creates a disjunction NFA for (at least) two NFA-fragments. - */ -function or$1(first) { - for (var _len2 = arguments.length, fragments = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - fragments[_key2 - 1] = arguments[_key2]; - } - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = fragments[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var fragment = _step2.value; - - first = orPair(first, fragment); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - return first; -} - -// ----------------------------------------------------------------------------- -// Kleene-closure - -/** - * Kleene star/closure. - * - * a* - */ -function repExplicit(fragment) { - var inState = new NFAState(); - var outState = new NFAState({ - accepting: true - }); - - // 0 or more. - inState.addTransition(EPSILON, fragment.in); - inState.addTransition(EPSILON, outState); - - fragment.out.accepting = false; - fragment.out.addTransition(EPSILON, outState); - outState.addTransition(EPSILON, fragment.in); - - return new NFA$1(inState, outState); -} - -/** - * Optimized Kleene-star: just adds ε-transitions from - * input to the output, and back. - */ -function rep$1(fragment) { - fragment.in.addTransition(EPSILON, fragment.out); - fragment.out.addTransition(EPSILON, fragment.in); - return fragment; -} - -/** - * Optimized Plus: just adds ε-transitions from - * the output to the input. - */ -function plusRep$1(fragment) { - fragment.out.addTransition(EPSILON, fragment.in); - return fragment; -} - -/** - * Optimized ? repetition: just adds ε-transitions from - * the input to the output. - */ -function questionRep$1(fragment) { - fragment.in.addTransition(EPSILON, fragment.out); - return fragment; -} - -var builders$1 = { - alt: alt$1, - char: char$1, - e: e, - or: or$1, - rep: rep$1, - repExplicit: repExplicit, - plusRep: plusRep$1, - questionRep: questionRep$1 -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -var parser$1 = parser$4; - -var _require$1 = builders$1, - alt = _require$1.alt, - char = _require$1.char, - or = _require$1.or, - rep = _require$1.rep, - plusRep = _require$1.plusRep, - questionRep = _require$1.questionRep; - -/** - * Helper `gen` function calls node type handler. - */ - - -function gen(node) { - if (node && !generator$1[node.type]) { - throw new Error(node.type + ' is not supported in NFA/DFA interpreter.'); - } - - return node ? generator$1[node.type](node) : ''; -} - -/** - * AST handler. - */ -var generator$1 = { - RegExp: function RegExp(node) { - if (node.flags !== '') { - throw new Error('NFA/DFA: Flags are not supported yet.'); - } - - return gen(node.body); - }, - Alternative: function Alternative(node) { - var fragments = (node.expressions || []).map(gen); - return alt.apply(undefined, _toConsumableArray(fragments)); - }, - Disjunction: function Disjunction(node) { - return or(gen(node.left), gen(node.right)); - }, - Repetition: function Repetition(node) { - switch (node.quantifier.kind) { - case '*': - return rep(gen(node.expression)); - case '+': - return plusRep(gen(node.expression)); - case '?': - return questionRep(gen(node.expression)); - default: - throw new Error('Unknown repeatition: ' + node.quantifier.kind + '.'); - } - }, - Char: function Char(node) { - if (node.kind !== 'simple') { - throw new Error('NFA/DFA: Only simple chars are supported yet.'); - } - - return char(node.value); - }, - Group: function Group(node) { - return gen(node.expression); - } -}; - -var nfaFromRegexp = { - /** - * Builds an NFA from the passed regexp. - */ - build: function build(regexp) { - var ast = regexp; - - if (regexp instanceof RegExp) { - regexp = '' + regexp; - } - - if (typeof regexp === 'string') { - ast = parser$1.parse(regexp, { - captureLocations: true - }); - } - - return gen(ast); - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var NFA = nfa; -var DFA = dfa; - -var nfaFromRegExp = nfaFromRegexp; -var builders = builders$1; - -var finiteAutomaton = { - - /** - * Export NFA and DFA classes. - */ - NFA: NFA, - DFA: DFA, - - /** - * Expose builders. - */ - builders: builders, - - /** - * Builds an NFA for the passed regexp. - * - * @param string | AST | RegExp: - * - * a regular expression in different representations: a string, - * a RegExp object, or an AST. - */ - toNFA: function toNFA(regexp) { - return nfaFromRegExp.build(regexp); - }, - - - /** - * Builds DFA for the passed regexp. - * - * @param string | AST | RegExp: - * - * a regular expression in different representations: a string, - * a RegExp object, or an AST. - */ - toDFA: function toDFA(regexp) { - return new DFA(this.toNFA(regexp)); - }, - - - /** - * Returns true if regexp accepts the string. - */ - test: function test(regexp, string) { - return this.toDFA(regexp).matches(string); - } -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -/** - * The `RegExpTree` class provides runtime support for `compat-transpiler` - * module from `regexp-tree`. - * - * E.g. it tracks names of the capturing groups, in order to access the - * names on the matched result. - * - * It's a thin-wrapper on top of original regexp. - */ - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var RegExpTree$1 = function () { - /** - * Initializes a `RegExpTree` instance. - * - * @param RegExp - a regular expression - * - * @param Object state: - * - * An extra state which may store any related to transformation - * data, for example, names of the groups. - * - * - flags - original flags - * - groups - names of the groups, and their indices - * - source - original source - */ - function RegExpTree(re, _ref) { - var flags = _ref.flags, - groups = _ref.groups, - source = _ref.source; - - _classCallCheck(this, RegExpTree); - - this._re = re; - this._groups = groups; - - // Original props. - this.flags = flags; - this.source = source || re.source; - this.dotAll = flags.includes('s'); - - // Inherited directly from `re`. - this.global = re.global; - this.ignoreCase = re.ignoreCase; - this.multiline = re.multiline; - this.sticky = re.sticky; - this.unicode = re.unicode; - } - - /** - * Facade wrapper for RegExp `test` method. - */ - - - _createClass(RegExpTree, [{ - key: 'test', - value: function test(string) { - return this._re.test(string); - } - - /** - * Facade wrapper for RegExp `compile` method. - */ - - }, { - key: 'compile', - value: function compile(string) { - return this._re.compile(string); - } - - /** - * Facade wrapper for RegExp `toString` method. - */ - - }, { - key: 'toString', - value: function toString() { - if (!this._toStringResult) { - this._toStringResult = '/' + this.source + '/' + this.flags; - } - return this._toStringResult; - } - - /** - * Facade wrapper for RegExp `exec` method. - */ - - }, { - key: 'exec', - value: function exec(string) { - var result = this._re.exec(string); - - if (!this._groups || !result) { - return result; - } - - result.groups = {}; - - for (var group in this._groups) { - var groupNumber = this._groups[group]; - result.groups[group] = result[groupNumber]; - } - - return result; - } - }]); - - return RegExpTree; -}(); - -var runtime = { - RegExpTree: RegExpTree$1 -}; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var compatTranspiler = compatTranspiler$1; -var generator = generator_1; -var optimizer = optimizer$1; -var parser = parser$4; -var _transform = transform$1; -var _traverse = traverse$1; -var fa = finiteAutomaton; - -var _require = runtime, - RegExpTree = _require.RegExpTree; - -/** - * An API object for RegExp processing (parsing/transform/generation). - */ - - -var regexpTree$3 = { - /** - * Parser module exposed. - */ - parser: parser, - - /** - * Expose finite-automaton module. - */ - fa: fa, - - /** - * `TransformResult` exposed. - */ - TransformResult: _transform.TransformResult, - - /** - * Parses a regexp string, producing an AST. - * - * @param string regexp - * - * a regular expression in different formats: string, AST, RegExp. - * - * @param Object options - * - * parsing options for this parse call. Default are: - * - * - captureLocations: boolean - * - any other custom options - * - * @return Object AST - */ - parse: function parse(regexp, options) { - return parser.parse('' + regexp, options); - }, - - - /** - * Traverses a RegExp AST. - * - * @param Object ast - * @param Object | Array handlers - * - * Each `handler` is an object containing handler function for needed - * node types. Example: - * - * regexpTree.traverse(ast, { - * onChar(node) { - * ... - * }, - * }); - * - * The value for a node type may also be an object with functions pre and post. - * This enables more context-aware analyses, e.g. measuring star height. - */ - traverse: function traverse(ast, handlers, options) { - return _traverse.traverse(ast, handlers, options); - }, - - - /** - * Transforms a regular expression. - * - * A regexp can be passed in different formats (string, regexp or AST), - * applying a set of transformations. It is a convenient wrapper - * on top of "parse-traverse-generate" tool chain. - * - * @param string | AST | RegExp regexp - a regular expression; - * @param Object | Array handlers - a list of handlers. - * - * @return TransformResult - a transformation result. - */ - transform: function transform(regexp, handlers) { - return _transform.transform(regexp, handlers); - }, - - - /** - * Generates a RegExp string from an AST. - * - * @param Object ast - * - * Invariant: - * - * regexpTree.generate(regexpTree.parse('/[a-z]+/i')); // '/[a-z]+/i' - */ - generate: function generate(ast) { - return generator.generate(ast); - }, - - - /** - * Creates a RegExp object from a regexp string. - * - * @param string regexp - */ - toRegExp: function toRegExp(regexp) { - var compat = this.compatTranspile(regexp); - return new RegExp(compat.getSource(), compat.getFlags()); - }, - - - /** - * Optimizes a regular expression by replacing some - * sub-expressions with their idiomatic patterns. - * - * @param string regexp - * - * @return TransformResult object - */ - optimize: function optimize(regexp, whitelist) { - var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - blacklist = _ref.blacklist; - - return optimizer.optimize(regexp, { whitelist: whitelist, blacklist: blacklist }); - }, - - - /** - * Translates a regular expression in new syntax or in new format - * into equivalent expressions in old syntax. - * - * @param string regexp - * - * @return TransformResult object - */ - compatTranspile: function compatTranspile(regexp, whitelist) { - return compatTranspiler.transform(regexp, whitelist); - }, - - - /** - * Executes a regular expression on a string. - * - * @param RegExp|string re - a regular expression. - * @param string string - a testing string. - */ - exec: function exec(re, string) { - if (typeof re === 'string') { - var compat = this.compatTranspile(re); - var extra = compat.getExtra(); - - if (extra.namedCapturingGroups) { - re = new RegExpTree(compat.toRegExp(), { - flags: compat.getFlags(), - source: compat.getSource(), - groups: extra.namedCapturingGroups - }); - } else { - re = compat.toRegExp(); - } - } - - return re.exec(string); - } -}; - -var regexpTree_1 = regexpTree$3; - -/** - * The MIT License (MIT) - * Copyright (c) 2017-present Dmitry Soshnikov - */ - -var regexpTree$2 = regexpTree_1; - -// Exports an Analyzer subclass - -const regexpTree$1 = regexpTree$2; -const analyzer$1 = analyzer$2; - -class HeuristicAnalyzer extends analyzer$1.Analyzer { - constructor(analyzerOptions) { - super(analyzerOptions); - } - - isVulnerable(regExp) { - // Heuristic #1: Star height > 1 - const starHeight = this._measureStarHeight(regExp); - if (starHeight > 1) { - return true; - } - - // Heuristic #2: # repetitions > limit - // TODO This is a poor heuristic - const nRepetitions = this._measureRepetitions(regExp); - if (nRepetitions > this.options.heuristic_replimit) { - return true; - } - - return false; - } - - genAttackString(regExp) { - return null; - } - - _measureStarHeight(regExp) { - let currentStarHeight = 0; - let maxObservedStarHeight = 0; - - const ast = regexpTree$1.parse(regExp); - - regexpTree$1.traverse(ast, { - Repetition: { - pre({ node }) { - currentStarHeight++; - if (maxObservedStarHeight < currentStarHeight) { - maxObservedStarHeight = currentStarHeight; - } - }, - - post({ node }) { - currentStarHeight--; - } - } - }); - - return maxObservedStarHeight; - } - - _measureRepetitions(regExp) { - let nRepetitions = 0; - - const ast = regexpTree$1.parse(regExp); - regexpTree$1.traverse(ast, { - Repetition: { - pre({ node }) { - nRepetitions++; - } - } - }); - - return nRepetitions; - } -} - -var heuristicAnalyzer$1 = HeuristicAnalyzer; - -// Load the analyzers -const heuristicAnalyzer = heuristicAnalyzer$1; - -var analyzerFamily$1 = [heuristicAnalyzer]; - -const analyzer = analyzer$2; -const analyzerFamily = analyzerFamily$1; - -const DEFAULT_SAFE_REP_LIMIT = 25; -const RET_IS_SAFE = true; -const RET_IS_VULNERABLE = false; - -class Args { - constructor(regExp, analyzerOptions) { - this.regExp = regExp; - this.analyzerOptions = analyzerOptions; - } -} - -function safeRegex(re, opts) { - try { - const args = buildArgs(re, opts); - const analyzerResponses = askAnalyzersIfVulnerable(args); - - // Did any analyzer say true? - if (analyzerResponses.find((isVulnerable) => isVulnerable)) { - return RET_IS_VULNERABLE; - } else { - return RET_IS_SAFE; - } - } catch (err) { - // Invalid or unparseable input - return false; - } -} - -function buildArgs(re, opts) { - // Build AnalyzerOptions - if (!opts) opts = {}; - const heuristic_replimit = opts.limit === undefined ? DEFAULT_SAFE_REP_LIMIT : opts.limit; - - const analyzerOptions = new analyzer.AnalyzerOptions(heuristic_replimit); - - // Build RegExp - let regExp = null; - // Construct a RegExp object - if (re instanceof RegExp) { - regExp = re; - } else if (typeof re === 'string') { - regExp = new RegExp(re); - } else { - regExp = new RegExp(String(re)); - } - - return new Args(regExp, analyzerOptions); -} - -function askAnalyzersIfVulnerable(args) { - let analyzerSaysVulnerable = []; - - // Query the Analyzers - let Analyzer; - for (Analyzer of analyzerFamily) { - try { - const analyzer = new Analyzer(args.analyzerOptions); - analyzerSaysVulnerable.push(analyzer.isVulnerable(args.regExp)); - } catch (err) { - /* istanbul ignore next */ // No need to worry about code coverage here. - analyzerSaysVulnerable.push(false); - } - } - - return analyzerSaysVulnerable; -} - -// Export - -var safeRegex_1 = safeRegex; - -var safeRegex$1 = /*@__PURE__*/getDefaultExportFromCjs(safeRegex_1); - -class SettingTab extends obsidian.PluginSettingTab { - constructor(app, plugin) { - super(app, plugin); - this.plugin = plugin; - } - displSw(cont) { - cont.findAll(".setting-item").forEach((el) => { - if (el.getAttr("class").includes("media_folder_set")) { - if (this.plugin.settings.saveAttE === "obsFolder" || - this.plugin.settings.saveAttE === "nextToNote") { - el.hide(); - } - else { - el.show(); - } - } - }); - } - display() { - let { containerEl } = this; - containerEl.empty(); - containerEl.createEl("h1", { text: APP_TITLE }); - containerEl.createEl("div"); - // donheader.createEl("a", { text: "Support the project! ", href: "https://www.buymeacoffee.com/sergeikorneev", cls: "donheader_txt" }) - containerEl.createEl("h3", { text: "Interface settings" }); - new obsidian.Setting(containerEl) - .setName("Show notifications") - .setDesc("Show notifications when pages were processed.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.showNotifications) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.showNotifications = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Disable additional commands") - .setDesc("Do not show additional commands in command palette. Reload the plugin in settings to take effect (turn off/on).") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.disAddCom) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.disAddCom = value; - yield this.plugin.saveSettings(); - }))); - containerEl.createEl("h3", { text: "Processing settings" }); - new obsidian.Setting(containerEl) - .setName("Automatic processing") - .setDesc("Process notes on create/copy/paste.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.realTimeUpdate) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.realTimeUpdate = value; - yield this.plugin.saveSettings(); - this.plugin.setupQueueInterval(); - }))); - new obsidian.Setting(containerEl) - .setName("Automatic processing interval") - .setDesc("Interval in seconds for processing update. It takes some time to reveal changed content of a note to plugins.") - .addText((text) => text - .setValue(String(this.plugin.settings.realTimeUpdateInterval)) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - let numberValue = Number(value); - if (isNaN(numberValue) || - !Number.isInteger(numberValue) || - numberValue <= 5 || - numberValue > 3600) { - displayError("The value should be a positive integer number between 5 and 3600!"); - return; - } - if (numberValue < 5) { - numberValue = 5; - } - this.plugin.settings.realTimeUpdateInterval = numberValue; - yield this.plugin.saveSettings(); - this.plugin.setupQueueInterval(); - }))); - new obsidian.Setting(containerEl) - .setName("Number of retries for every single attachment") - .setDesc("If an error occurs during downloading (network etc.) try to re-download several times.") - .addText((text) => text - .setValue(String(this.plugin.settings.tryCount)) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - let numberValue = Number(value); - if (isNaN(numberValue) || - !Number.isInteger(numberValue) || - numberValue < 1 || - numberValue > 6) { - displayError("The value should be a positive integer number between 1 and 6!"); - return; - } - this.plugin.settings.tryCount = numberValue; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Process all new markdown files") - .setDesc("Process all new created/cloud-synced files with corresponding extensions.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.processCreated) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.processCreated = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Process all new attachments") - .setDesc("The plugin will also move all attachments from obsidian default folder to plugin folder.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.processAll) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.processAll = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Use MD5 for new attachments (Pasted images and files)") - .setDesc("The plugin will use MD5 when renaming all new attachments.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.useMD5ForNewAtt) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.useMD5ForNewAtt = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Download unknown filetypes") - .setDesc("Download unknown filetypes and save them with .unknown extension.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.downUnknown) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.downUnknown = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Convert PNG to JPEG (Web Images)") - .setDesc("Convert all downloaded PNG files to JPEG. May reduce file size by several times, but can also affect performance.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.PngToJpeg) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.PngToJpeg = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Convert PNG to JPEG (Pasted Images)") - .setDesc("Convert all pasted PNG files to JPEG. May reduce file size by several times, but can also affect performance.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.PngToJpegLocal) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.PngToJpegLocal = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Jpeg Quality") - .setDesc("Jpeg quality selection (30 to 100).") - .addText((text) => text - .setValue(String(this.plugin.settings.JpegQuality)) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - let numberValue = Number(value); - if (isNaN(numberValue) || - !Number.isInteger(numberValue) || - numberValue < 10 || - numberValue > 100) { - displayError("The value should be a positive integer number between 10 and 100!"); - return; - } - this.plugin.settings.JpegQuality = numberValue; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("File size lower limit in Kb") - .setDesc("Do not download files with size less than this value. Set 0 for no limit.") - .addText((text) => text - .setValue(String(this.plugin.settings.filesizeLimit)) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - let numberValue = Number(value); - if (isNaN(numberValue) || - !Number.isInteger(numberValue) || - numberValue < 0) { - displayError("The value should be a positive integer!"); - return; - } - if (numberValue < 0) { - numberValue = 0; - } - this.plugin.settings.filesizeLimit = numberValue; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Exclusions") - .setDesc("The plugin will not download attachments with these extensions.") - .addText((text) => text - .setValue(this.plugin.settings.ignoredExt) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.ignoredExt = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Do not create Obsidian attachment folder (For compatibility with other plugins)") - .setDesc("The plugin will not create an Obsidian attachments folder. This may cause the plugin to behave incorrectly. ") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.DoNotCreateObsFolder) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.DoNotCreateObsFolder = value; - yield this.plugin.saveSettings(); - }))); - containerEl.createEl("h3", { text: "Note settings" }); - new obsidian.Setting(containerEl) - .setName("Preserve link captions") - .setDesc("Add media links captions to converted tags.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.useCaptions) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.useCaptions = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Add original filename or 'Open file' tag") - .setDesc("Add [[original filename]] or [original filename](link to attachment) after replaced tag (only for file:// protocol or dropped/pasted files ).") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.addNameOfFile) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.addNameOfFile = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Include pattern") - .setDesc("Include only files with extensions only matching this pattern. Example: md|canvas") - .addText((text) => text.setValue(this.plugin.settings.includeps).onChange((value) => __awaiter(this, void 0, void 0, function* () { - //Transform string to regex - let ExtArray = value.split("|"); - if (ExtArray.length >= 1) { - let regexconverted = trimAny(ExtArray.map((extension) => { if (trimAny(extension, [" ", "|"]) !== "") { - return "(?<" + trimAny(extension, [" ", "|"]) + ">.*\\." + trimAny(extension, [" ", "|"]) + ")"; - } }).join("|"), [" ", "|"]); - if (!safeRegex$1(value)) { - displayError("Unsafe regex! https://www.npmjs.com/package/safe-regex"); - return; - } - this.plugin.settings.includepattern = regexconverted; - logError(regexconverted); - yield this.plugin.saveSettings(); - } - }))); - containerEl.createEl("h3", { text: "Orphaned attachments" }); - new obsidian.Setting(containerEl) - .setName("Remove files completely") - .setDesc("Do not move orphaned files into the garbage can.") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.removeOrphansCompl) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.removeOrphansCompl = value; - yield this.plugin.saveSettings(); - }))); - containerEl.createEl("h3", { text: "Media folder settings" }); - new obsidian.Setting(containerEl) - .setName("How to write paths in tags") - .setDesc("Select whether to write full paths in tags or not.") - .addDropdown((text) => text - .addOption("fullDirPath", "Full path") - .addOption("onlyRelative", "Relative to note") - .addOption("baseFileName", "Only filename") - .setValue(this.plugin.settings.pathInTags) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.pathInTags = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Date format") - .setDesc("Date format for ${date} variable. E.g. \ - | MMMM Do YYYY, h:mm:ss a (March 20th 2024, 10:54:46 am) \ - | dddd (Wednesday)\ - | MMM Do YY (Mar 20th 24)") - .addText((text) => text.setValue(this.plugin.settings.DateFormat).onChange((value) => __awaiter(this, void 0, void 0, function* () { - if (value.match(/(\)|\(|\"|\'|\#|\]|\[|\:|\>|\<|\*|\|)/g) !== null) { - displayError("Unsafe folder name! Some chars are forbidden in some filesystems."); - return; - } - this.plugin.settings.DateFormat = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Folder to save new attachments") - .setDesc("Select where all new attachments will be saved.\nYou can use templates e.g. _resouces/${date}/${notename}") - .addDropdown((text) => text - .addOption("obsFolder", "Copy Obsidian settings") - .addOption("inFolderBelow", "In the root folder specified below") - .addOption("nextToNoteS", "Next to note in the folder specified below") - .setValue(this.plugin.settings.saveAttE) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.saveAttE = value; - this.displSw(containerEl); - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Move/delete/rename media folder") - .setDesc("Rename or move this folder to the obsidian or system garbage can when the associated note is deleted/renamed/moved. \ - This setting takes effect only if the path contains ${notename} template at the end\ - and the options 'Next to note in the folder specified below' / 'Relative to note' are selected.\ - Use this setting at your own risk.") - .setClass("media_folder_set") - .addToggle((toggle) => toggle - .setValue(this.plugin.settings.removeMediaFolder) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.removeMediaFolder = value; - yield this.plugin.saveSettings(); - }))); - new obsidian.Setting(containerEl) - .setName("Media folder") - .setDesc("Folder to keep all downloaded media files.") - .setClass("media_folder_set") - .addText((text) => text - .setValue(this.plugin.settings.mediaRootDir) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - if (value.match(/(\)|\(|\"|\'|\#|\]|\[|\:|\>|\<|\*|\|)/g) !== null) { - displayError("Unsafe folder name! Some chars are forbidden in some filesystems."); - return; - } - this.plugin.settings.mediaRootDir = value; - yield this.plugin.saveSettings(); - }))); - containerEl.createEl("h3", { text: "Troubleshooting" }); - new obsidian.Setting(containerEl) - .setName("Debug") - .setDesc("Enable debug output to console.") - .addToggle((toggle) => toggle - .setValue(VERBOSE) - .onChange((value) => __awaiter(this, void 0, void 0, function* () { - setDebug(value); - yield this.plugin.saveSettings(); - }))); - this.displSw(containerEl); - } -} - -var AsyncLock$1 = function (opts) { - opts = opts || {}; - - this.Promise = opts.Promise || Promise; - - // format: {key : [fn, fn]} - // queues[key] = null indicates no job running for key - this.queues = Object.create(null); - - // lock is reentrant for same domain - this.domainReentrant = opts.domainReentrant || false; - if (this.domainReentrant) { - if (typeof process === 'undefined' || typeof process.domain === 'undefined') { - throw new Error( - 'Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, ' + - 'use a NodeJS version that still implements Domain, or install a browser polyfill.'); - } - // domain of current running func {key : fn} - this.domains = Object.create(null); - } - - this.timeout = opts.timeout || AsyncLock$1.DEFAULT_TIMEOUT; - this.maxOccupationTime = opts.maxOccupationTime || AsyncLock$1.DEFAULT_MAX_OCCUPATION_TIME; - this.maxExecutionTime = opts.maxExecutionTime || AsyncLock$1.DEFAULT_MAX_EXECUTION_TIME; - if (opts.maxPending === Infinity || (Number.isInteger(opts.maxPending) && opts.maxPending >= 0)) { - this.maxPending = opts.maxPending; - } else { - this.maxPending = AsyncLock$1.DEFAULT_MAX_PENDING; - } -}; - -AsyncLock$1.DEFAULT_TIMEOUT = 0; //Never -AsyncLock$1.DEFAULT_MAX_OCCUPATION_TIME = 0; //Never -AsyncLock$1.DEFAULT_MAX_EXECUTION_TIME = 0; //Never -AsyncLock$1.DEFAULT_MAX_PENDING = 1000; - -/** - * Acquire Locks - * - * @param {String|Array} key resource key or keys to lock - * @param {function} fn async function - * @param {function} cb callback function, otherwise will return a promise - * @param {Object} opts options - */ -AsyncLock$1.prototype.acquire = function (key, fn, cb, opts) { - if (Array.isArray(key)) { - return this._acquireBatch(key, fn, cb, opts); - } - - if (typeof (fn) !== 'function') { - throw new Error('You must pass a function to execute'); - } - - // faux-deferred promise using new Promise() (as Promise.defer is deprecated) - var deferredResolve = null; - var deferredReject = null; - var deferred = null; - - if (typeof (cb) !== 'function') { - opts = cb; - cb = null; - - // will return a promise - deferred = new this.Promise(function(resolve, reject) { - deferredResolve = resolve; - deferredReject = reject; - }); - } - - opts = opts || {}; - - var resolved = false; - var timer = null; - var occupationTimer = null; - var executionTimer = null; - var self = this; - - var done = function (locked, err, ret) { - - if (occupationTimer) { - clearTimeout(occupationTimer); - occupationTimer = null; - } - - if (executionTimer) { - clearTimeout(executionTimer); - executionTimer = null; - } - - if (locked) { - if (!!self.queues[key] && self.queues[key].length === 0) { - delete self.queues[key]; - } - if (self.domainReentrant) { - delete self.domains[key]; - } - } - - if (!resolved) { - if (!deferred) { - if (typeof (cb) === 'function') { - cb(err, ret); - } - } - else { - //promise mode - if (err) { - deferredReject(err); - } - else { - deferredResolve(ret); - } - } - resolved = true; - } - - if (locked) { - //run next func - if (!!self.queues[key] && self.queues[key].length > 0) { - self.queues[key].shift()(); - } - } - }; - - var exec = function (locked) { - if (resolved) { // may due to timed out - return done(locked); - } - - if (timer) { - clearTimeout(timer); - timer = null; - } - - if (self.domainReentrant && locked) { - self.domains[key] = process.domain; - } - - var maxExecutionTime = opts.maxExecutionTime || self.maxExecutionTime; - if (maxExecutionTime) { - executionTimer = setTimeout(function () { - if (!!self.queues[key]) { - done(locked, new Error('Maximum execution time is exceeded ' + key)); - } - }, maxExecutionTime); - } - - // Callback mode - if (fn.length === 1) { - var called = false; - try { - fn(function (err, ret) { - if (!called) { - called = true; - done(locked, err, ret); - } - }); - } catch (err) { - // catching error thrown in user function fn - if (!called) { - called = true; - done(locked, err); - } - } - } - else { - // Promise mode - self._promiseTry(function () { - return fn(); - }) - .then(function(ret){ - done(locked, undefined, ret); - }, function(error){ - done(locked, error); - }); - } - }; - - if (self.domainReentrant && !!process.domain) { - exec = process.domain.bind(exec); - } - - var maxPending = opts.maxPending || self.maxPending; - - if (!self.queues[key]) { - self.queues[key] = []; - exec(true); - } - else if (self.domainReentrant && !!process.domain && process.domain === self.domains[key]) { - // If code is in the same domain of current running task, run it directly - // Since lock is re-enterable - exec(false); - } - else if (self.queues[key].length >= maxPending) { - done(false, new Error('Too many pending tasks in queue ' + key)); - } - else { - var taskFn = function () { - exec(true); - }; - if (opts.skipQueue) { - self.queues[key].unshift(taskFn); - } else { - self.queues[key].push(taskFn); - } - - var timeout = opts.timeout || self.timeout; - if (timeout) { - timer = setTimeout(function () { - timer = null; - done(false, new Error('async-lock timed out in queue ' + key)); - }, timeout); - } - } - - var maxOccupationTime = opts.maxOccupationTime || self.maxOccupationTime; - if (maxOccupationTime) { - occupationTimer = setTimeout(function () { - if (!!self.queues[key]) { - done(false, new Error('Maximum occupation time is exceeded in queue ' + key)); - } - }, maxOccupationTime); - } - - if (deferred) { - return deferred; - } -}; - -/* - * Below is how this function works: - * - * Equivalent code: - * self.acquire(key1, function(cb){ - * self.acquire(key2, function(cb){ - * self.acquire(key3, fn, cb); - * }, cb); - * }, cb); - * - * Equivalent code: - * var fn3 = getFn(key3, fn); - * var fn2 = getFn(key2, fn3); - * var fn1 = getFn(key1, fn2); - * fn1(cb); - */ -AsyncLock$1.prototype._acquireBatch = function (keys, fn, cb, opts) { - if (typeof (cb) !== 'function') { - opts = cb; - cb = null; - } - - var self = this; - var getFn = function (key, fn) { - return function (cb) { - self.acquire(key, fn, cb, opts); - }; - }; - - var fnx = keys.reduceRight(function (prev, key) { - return getFn(key, prev); - }, fn); - - if (typeof (cb) === 'function') { - fnx(cb); - } - else { - return new this.Promise(function (resolve, reject) { - // check for promise mode in case keys is empty array - if (fnx.length === 1) { - fnx(function (err, ret) { - if (err) { - reject(err); - } - else { - resolve(ret); - } - }); - } else { - resolve(fnx()); - } - }); - } -}; - -/* - * Whether there is any running or pending asyncFunc - * - * @param {String} key - */ -AsyncLock$1.prototype.isBusy = function (key) { - if (!key) { - return Object.keys(this.queues).length > 0; - } - else { - return !!this.queues[key]; - } -}; - -/** - * Promise.try() implementation to become independent of Q-specific methods - */ -AsyncLock$1.prototype._promiseTry = function(fn) { - try { - return this.Promise.resolve(fn()); - } catch (e) { - return this.Promise.reject(e); - } -}; - -var lib = AsyncLock$1; - -var asyncLock = lib; - -var AsyncLock = /*@__PURE__*/getDefaultExportFromCjs(asyncLock); - -var moment$1 = {exports: {}}; - -moment$1.exports; - -(function (module, exports) { -(function (global, factory) { - module.exports = factory() ; - }(commonjsGlobal, (function () { - var hookCallback; - - function hooks() { - return hookCallback.apply(null, arguments); - } - - // This is done to register the method called with moment() - // without creating circular dependencies. - function setHookCallback(callback) { - hookCallback = callback; - } - - function isArray(input) { - return ( - input instanceof Array || - Object.prototype.toString.call(input) === '[object Array]' - ); - } - - function isObject(input) { - // IE8 will treat undefined and null as object if it wasn't for - // input != null - return ( - input != null && - Object.prototype.toString.call(input) === '[object Object]' - ); - } - - function hasOwnProp(a, b) { - return Object.prototype.hasOwnProperty.call(a, b); - } - - function isObjectEmpty(obj) { - if (Object.getOwnPropertyNames) { - return Object.getOwnPropertyNames(obj).length === 0; - } else { - var k; - for (k in obj) { - if (hasOwnProp(obj, k)) { - return false; - } - } - return true; - } - } - - function isUndefined(input) { - return input === void 0; - } - - function isNumber(input) { - return ( - typeof input === 'number' || - Object.prototype.toString.call(input) === '[object Number]' - ); - } - - function isDate(input) { - return ( - input instanceof Date || - Object.prototype.toString.call(input) === '[object Date]' - ); - } - - function map(arr, fn) { - var res = [], - i, - arrLen = arr.length; - for (i = 0; i < arrLen; ++i) { - res.push(fn(arr[i], i)); - } - return res; - } - - function extend(a, b) { - for (var i in b) { - if (hasOwnProp(b, i)) { - a[i] = b[i]; - } - } - - if (hasOwnProp(b, 'toString')) { - a.toString = b.toString; - } - - if (hasOwnProp(b, 'valueOf')) { - a.valueOf = b.valueOf; - } - - return a; - } - - function createUTC(input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, true).utc(); - } - - function defaultParsingFlags() { - // We need to deep clone this object. - return { - empty: false, - unusedTokens: [], - unusedInput: [], - overflow: -2, - charsLeftOver: 0, - nullInput: false, - invalidEra: null, - invalidMonth: null, - invalidFormat: false, - userInvalidated: false, - iso: false, - parsedDateParts: [], - era: null, - meridiem: null, - rfc2822: false, - weekdayMismatch: false, - }; - } - - function getParsingFlags(m) { - if (m._pf == null) { - m._pf = defaultParsingFlags(); - } - return m._pf; - } - - var some; - if (Array.prototype.some) { - some = Array.prototype.some; - } else { - some = function (fun) { - var t = Object(this), - len = t.length >>> 0, - i; - - for (i = 0; i < len; i++) { - if (i in t && fun.call(this, t[i], i, t)) { - return true; - } - } - - return false; - }; - } - - function isValid(m) { - var flags = null, - parsedParts = false, - isNowValid = m._d && !isNaN(m._d.getTime()); - if (isNowValid) { - flags = getParsingFlags(m); - parsedParts = some.call(flags.parsedDateParts, function (i) { - return i != null; - }); - isNowValid = - flags.overflow < 0 && - !flags.empty && - !flags.invalidEra && - !flags.invalidMonth && - !flags.invalidWeekday && - !flags.weekdayMismatch && - !flags.nullInput && - !flags.invalidFormat && - !flags.userInvalidated && - (!flags.meridiem || (flags.meridiem && parsedParts)); - if (m._strict) { - isNowValid = - isNowValid && - flags.charsLeftOver === 0 && - flags.unusedTokens.length === 0 && - flags.bigHour === undefined; - } - } - if (Object.isFrozen == null || !Object.isFrozen(m)) { - m._isValid = isNowValid; - } else { - return isNowValid; - } - return m._isValid; - } - - function createInvalid(flags) { - var m = createUTC(NaN); - if (flags != null) { - extend(getParsingFlags(m), flags); - } else { - getParsingFlags(m).userInvalidated = true; - } - - return m; - } - - // Plugins that add properties should also add the key here (null value), - // so we can properly clone ourselves. - var momentProperties = (hooks.momentProperties = []), - updateInProgress = false; - - function copyConfig(to, from) { - var i, - prop, - val, - momentPropertiesLen = momentProperties.length; - - if (!isUndefined(from._isAMomentObject)) { - to._isAMomentObject = from._isAMomentObject; - } - if (!isUndefined(from._i)) { - to._i = from._i; - } - if (!isUndefined(from._f)) { - to._f = from._f; - } - if (!isUndefined(from._l)) { - to._l = from._l; - } - if (!isUndefined(from._strict)) { - to._strict = from._strict; - } - if (!isUndefined(from._tzm)) { - to._tzm = from._tzm; - } - if (!isUndefined(from._isUTC)) { - to._isUTC = from._isUTC; - } - if (!isUndefined(from._offset)) { - to._offset = from._offset; - } - if (!isUndefined(from._pf)) { - to._pf = getParsingFlags(from); - } - if (!isUndefined(from._locale)) { - to._locale = from._locale; - } - - if (momentPropertiesLen > 0) { - for (i = 0; i < momentPropertiesLen; i++) { - prop = momentProperties[i]; - val = from[prop]; - if (!isUndefined(val)) { - to[prop] = val; - } - } - } - - return to; - } - - // Moment prototype object - function Moment(config) { - copyConfig(this, config); - this._d = new Date(config._d != null ? config._d.getTime() : NaN); - if (!this.isValid()) { - this._d = new Date(NaN); - } - // Prevent infinite loop in case updateOffset creates new moment - // objects. - if (updateInProgress === false) { - updateInProgress = true; - hooks.updateOffset(this); - updateInProgress = false; - } - } - - function isMoment(obj) { - return ( - obj instanceof Moment || (obj != null && obj._isAMomentObject != null) - ); - } - - function warn(msg) { - if ( - hooks.suppressDeprecationWarnings === false && - typeof console !== 'undefined' && - console.warn - ) { - console.warn('Deprecation warning: ' + msg); - } - } - - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (hooks.deprecationHandler != null) { - hooks.deprecationHandler(null, msg); - } - if (firstTime) { - var args = [], - arg, - i, - key, - argLen = arguments.length; - for (i = 0; i < argLen; i++) { - arg = ''; - if (typeof arguments[i] === 'object') { - arg += '\n[' + i + '] '; - for (key in arguments[0]) { - if (hasOwnProp(arguments[0], key)) { - arg += key + ': ' + arguments[0][key] + ', '; - } - } - arg = arg.slice(0, -2); // Remove trailing comma and space - } else { - arg = arguments[i]; - } - args.push(arg); - } - warn( - msg + - '\nArguments: ' + - Array.prototype.slice.call(args).join('') + - '\n' + - new Error().stack - ); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (hooks.deprecationHandler != null) { - hooks.deprecationHandler(name, msg); - } - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - hooks.suppressDeprecationWarnings = false; - hooks.deprecationHandler = null; - - function isFunction(input) { - return ( - (typeof Function !== 'undefined' && input instanceof Function) || - Object.prototype.toString.call(input) === '[object Function]' - ); - } - - function set(config) { - var prop, i; - for (i in config) { - if (hasOwnProp(config, i)) { - prop = config[i]; - if (isFunction(prop)) { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - } - this._config = config; - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. - // TODO: Remove "ordinalParse" fallback in next major release. - this._dayOfMonthOrdinalParseLenient = new RegExp( - (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + - '|' + - /\d{1,2}/.source - ); - } - - function mergeConfigs(parentConfig, childConfig) { - var res = extend({}, parentConfig), - prop; - for (prop in childConfig) { - if (hasOwnProp(childConfig, prop)) { - if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { - res[prop] = {}; - extend(res[prop], parentConfig[prop]); - extend(res[prop], childConfig[prop]); - } else if (childConfig[prop] != null) { - res[prop] = childConfig[prop]; - } else { - delete res[prop]; - } - } - } - for (prop in parentConfig) { - if ( - hasOwnProp(parentConfig, prop) && - !hasOwnProp(childConfig, prop) && - isObject(parentConfig[prop]) - ) { - // make sure changes to properties don't modify parent config - res[prop] = extend({}, res[prop]); - } - } - return res; - } - - function Locale(config) { - if (config != null) { - this.set(config); - } - } - - var keys; - - if (Object.keys) { - keys = Object.keys; - } else { - keys = function (obj) { - var i, - res = []; - for (i in obj) { - if (hasOwnProp(obj, i)) { - res.push(i); - } - } - return res; - }; - } - - var defaultCalendar = { - sameDay: '[Today at] LT', - nextDay: '[Tomorrow at] LT', - nextWeek: 'dddd [at] LT', - lastDay: '[Yesterday at] LT', - lastWeek: '[Last] dddd [at] LT', - sameElse: 'L', - }; - - function calendar(key, mom, now) { - var output = this._calendar[key] || this._calendar['sameElse']; - return isFunction(output) ? output.call(mom, now) : output; - } - - function zeroFill(number, targetLength, forceSign) { - var absNumber = '' + Math.abs(number), - zerosToFill = targetLength - absNumber.length, - sign = number >= 0; - return ( - (sign ? (forceSign ? '+' : '') : '-') + - Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + - absNumber - ); - } - - var formattingTokens = - /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, - formatFunctions = {}, - formatTokenFunctions = {}; - - // token: 'M' - // padded: ['MM', 2] - // ordinal: 'Mo' - // callback: function () { this.month() + 1 } - function addFormatToken(token, padded, ordinal, callback) { - var func = callback; - if (typeof callback === 'string') { - func = function () { - return this[callback](); - }; - } - if (token) { - formatTokenFunctions[token] = func; - } - if (padded) { - formatTokenFunctions[padded[0]] = function () { - return zeroFill(func.apply(this, arguments), padded[1], padded[2]); - }; - } - if (ordinal) { - formatTokenFunctions[ordinal] = function () { - return this.localeData().ordinal( - func.apply(this, arguments), - token - ); - }; - } - } - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ''); - } - return input.replace(/\\/g, ''); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), - i, - length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = '', - i; - for (i = 0; i < length; i++) { - output += isFunction(array[i]) - ? array[i].call(mom, format) - : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - if (!m.isValid()) { - return m.localeData().invalidDate(); - } - - format = expandFormat(format, m.localeData()); - formatFunctions[format] = - formatFunctions[format] || makeFormatFunction(format); - - return formatFunctions[format](m); - } - - function expandFormat(format, locale) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return locale.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace( - localFormattingTokens, - replaceLongDateFormatTokens - ); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - var defaultLongDateFormat = { - LTS: 'h:mm:ss A', - LT: 'h:mm A', - L: 'MM/DD/YYYY', - LL: 'MMMM D, YYYY', - LLL: 'MMMM D, YYYY h:mm A', - LLLL: 'dddd, MMMM D, YYYY h:mm A', - }; - - function longDateFormat(key) { - var format = this._longDateFormat[key], - formatUpper = this._longDateFormat[key.toUpperCase()]; - - if (format || !formatUpper) { - return format; - } - - this._longDateFormat[key] = formatUpper - .match(formattingTokens) - .map(function (tok) { - if ( - tok === 'MMMM' || - tok === 'MM' || - tok === 'DD' || - tok === 'dddd' - ) { - return tok.slice(1); - } - return tok; - }) - .join(''); - - return this._longDateFormat[key]; - } - - var defaultInvalidDate = 'Invalid date'; - - function invalidDate() { - return this._invalidDate; - } - - var defaultOrdinal = '%d', - defaultDayOfMonthOrdinalParse = /\d{1,2}/; - - function ordinal(number) { - return this._ordinal.replace('%d', number); - } - - var defaultRelativeTime = { - future: 'in %s', - past: '%s ago', - s: 'a few seconds', - ss: '%d seconds', - m: 'a minute', - mm: '%d minutes', - h: 'an hour', - hh: '%d hours', - d: 'a day', - dd: '%d days', - w: 'a week', - ww: '%d weeks', - M: 'a month', - MM: '%d months', - y: 'a year', - yy: '%d years', - }; - - function relativeTime(number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return isFunction(output) - ? output(number, withoutSuffix, string, isFuture) - : output.replace(/%d/i, number); - } - - function pastFuture(diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return isFunction(format) ? format(output) : format.replace(/%s/i, output); - } - - var aliases = { - D: 'date', - dates: 'date', - date: 'date', - d: 'day', - days: 'day', - day: 'day', - e: 'weekday', - weekdays: 'weekday', - weekday: 'weekday', - E: 'isoWeekday', - isoweekdays: 'isoWeekday', - isoweekday: 'isoWeekday', - DDD: 'dayOfYear', - dayofyears: 'dayOfYear', - dayofyear: 'dayOfYear', - h: 'hour', - hours: 'hour', - hour: 'hour', - ms: 'millisecond', - milliseconds: 'millisecond', - millisecond: 'millisecond', - m: 'minute', - minutes: 'minute', - minute: 'minute', - M: 'month', - months: 'month', - month: 'month', - Q: 'quarter', - quarters: 'quarter', - quarter: 'quarter', - s: 'second', - seconds: 'second', - second: 'second', - gg: 'weekYear', - weekyears: 'weekYear', - weekyear: 'weekYear', - GG: 'isoWeekYear', - isoweekyears: 'isoWeekYear', - isoweekyear: 'isoWeekYear', - w: 'week', - weeks: 'week', - week: 'week', - W: 'isoWeek', - isoweeks: 'isoWeek', - isoweek: 'isoWeek', - y: 'year', - years: 'year', - year: 'year', - }; - - function normalizeUnits(units) { - return typeof units === 'string' - ? aliases[units] || aliases[units.toLowerCase()] - : undefined; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (hasOwnProp(inputObject, prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - var priorities = { - date: 9, - day: 11, - weekday: 11, - isoWeekday: 11, - dayOfYear: 4, - hour: 13, - millisecond: 16, - minute: 14, - month: 8, - quarter: 7, - second: 15, - weekYear: 1, - isoWeekYear: 1, - week: 5, - isoWeek: 5, - year: 1, - }; - - function getPrioritizedUnits(unitsObj) { - var units = [], - u; - for (u in unitsObj) { - if (hasOwnProp(unitsObj, u)) { - units.push({ unit: u, priority: priorities[u] }); - } - } - units.sort(function (a, b) { - return a.priority - b.priority; - }); - return units; - } - - var match1 = /\d/, // 0 - 9 - match2 = /\d\d/, // 00 - 99 - match3 = /\d{3}/, // 000 - 999 - match4 = /\d{4}/, // 0000 - 9999 - match6 = /[+-]?\d{6}/, // -999999 - 999999 - match1to2 = /\d\d?/, // 0 - 99 - match3to4 = /\d\d\d\d?/, // 999 - 9999 - match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 - match1to3 = /\d{1,3}/, // 0 - 999 - match1to4 = /\d{1,4}/, // 0 - 9999 - match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 - matchUnsigned = /\d+/, // 0 - inf - matchSigned = /[+-]?\d+/, // -inf - inf - matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z - matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z - matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 - // any word (or two) characters or numbers including two/three word month in arabic. - // includes scottish gaelic two word and hyphenated months - matchWord = - /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, - match1to2NoLeadingZero = /^[1-9]\d?/, // 1-99 - match1to2HasZero = /^([1-9]\d|\d)/, // 0-99 - regexes; - - regexes = {}; - - function addRegexToken(token, regex, strictRegex) { - regexes[token] = isFunction(regex) - ? regex - : function (isStrict, localeData) { - return isStrict && strictRegex ? strictRegex : regex; - }; - } - - function getParseRegexForToken(token, config) { - if (!hasOwnProp(regexes, token)) { - return new RegExp(unescapeFormat(token)); - } - - return regexes[token](config._strict, config._locale); - } - - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function unescapeFormat(s) { - return regexEscape( - s - .replace('\\', '') - .replace( - /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, - function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - } - ) - ); - } - - function regexEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - function absFloor(number) { - if (number < 0) { - // -0 -> 0 - return Math.ceil(number) || 0; - } else { - return Math.floor(number); - } - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - value = absFloor(coercedNumber); - } - - return value; - } - - var tokens = {}; - - function addParseToken(token, callback) { - var i, - func = callback, - tokenLen; - if (typeof token === 'string') { - token = [token]; - } - if (isNumber(callback)) { - func = function (input, array) { - array[callback] = toInt(input); - }; - } - tokenLen = token.length; - for (i = 0; i < tokenLen; i++) { - tokens[token[i]] = func; - } - } - - function addWeekParseToken(token, callback) { - addParseToken(token, function (input, array, config, token) { - config._w = config._w || {}; - callback(input, config._w, config, token); - }); - } - - function addTimeToArrayFromToken(token, input, config) { - if (input != null && hasOwnProp(tokens, token)) { - tokens[token](input, config._a, config, token); - } - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - - var YEAR = 0, - MONTH = 1, - DATE = 2, - HOUR = 3, - MINUTE = 4, - SECOND = 5, - MILLISECOND = 6, - WEEK = 7, - WEEKDAY = 8; - - // FORMATTING - - addFormatToken('Y', 0, 0, function () { - var y = this.year(); - return y <= 9999 ? zeroFill(y, 4) : '+' + y; - }); - - addFormatToken(0, ['YY', 2], 0, function () { - return this.year() % 100; - }); - - addFormatToken(0, ['YYYY', 4], 0, 'year'); - addFormatToken(0, ['YYYYY', 5], 0, 'year'); - addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); - - // PARSING - - addRegexToken('Y', matchSigned); - addRegexToken('YY', match1to2, match2); - addRegexToken('YYYY', match1to4, match4); - addRegexToken('YYYYY', match1to6, match6); - addRegexToken('YYYYYY', match1to6, match6); - - addParseToken(['YYYYY', 'YYYYYY'], YEAR); - addParseToken('YYYY', function (input, array) { - array[YEAR] = - input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); - }); - addParseToken('YY', function (input, array) { - array[YEAR] = hooks.parseTwoDigitYear(input); - }); - addParseToken('Y', function (input, array) { - array[YEAR] = parseInt(input, 10); - }); - - // HELPERS - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - // HOOKS - - hooks.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; - - // MOMENTS - - var getSetYear = makeGetSet('FullYear', true); - - function getIsLeapYear() { - return isLeapYear(this.year()); - } - - function makeGetSet(unit, keepTime) { - return function (value) { - if (value != null) { - set$1(this, unit, value); - hooks.updateOffset(this, keepTime); - return this; - } else { - return get(this, unit); - } - }; - } - - function get(mom, unit) { - if (!mom.isValid()) { - return NaN; - } - - var d = mom._d, - isUTC = mom._isUTC; - - switch (unit) { - case 'Milliseconds': - return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds(); - case 'Seconds': - return isUTC ? d.getUTCSeconds() : d.getSeconds(); - case 'Minutes': - return isUTC ? d.getUTCMinutes() : d.getMinutes(); - case 'Hours': - return isUTC ? d.getUTCHours() : d.getHours(); - case 'Date': - return isUTC ? d.getUTCDate() : d.getDate(); - case 'Day': - return isUTC ? d.getUTCDay() : d.getDay(); - case 'Month': - return isUTC ? d.getUTCMonth() : d.getMonth(); - case 'FullYear': - return isUTC ? d.getUTCFullYear() : d.getFullYear(); - default: - return NaN; // Just in case - } - } - - function set$1(mom, unit, value) { - var d, isUTC, year, month, date; - - if (!mom.isValid() || isNaN(value)) { - return; - } - - d = mom._d; - isUTC = mom._isUTC; - - switch (unit) { - case 'Milliseconds': - return void (isUTC - ? d.setUTCMilliseconds(value) - : d.setMilliseconds(value)); - case 'Seconds': - return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value)); - case 'Minutes': - return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value)); - case 'Hours': - return void (isUTC ? d.setUTCHours(value) : d.setHours(value)); - case 'Date': - return void (isUTC ? d.setUTCDate(value) : d.setDate(value)); - // case 'Day': // Not real - // return void (isUTC ? d.setUTCDay(value) : d.setDay(value)); - // case 'Month': // Not used because we need to pass two variables - // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value)); - case 'FullYear': - break; // See below ... - default: - return; // Just in case - } - - year = value; - month = mom.month(); - date = mom.date(); - date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date; - void (isUTC - ? d.setUTCFullYear(year, month, date) - : d.setFullYear(year, month, date)); - } - - // MOMENTS - - function stringGet(units) { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](); - } - return this; - } - - function stringSet(units, value) { - if (typeof units === 'object') { - units = normalizeObjectUnits(units); - var prioritized = getPrioritizedUnits(units), - i, - prioritizedLen = prioritized.length; - for (i = 0; i < prioritizedLen; i++) { - this[prioritized[i].unit](units[prioritized[i].unit]); - } - } else { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](value); - } - } - return this; - } - - function mod(n, x) { - return ((n % x) + x) % x; - } - - var indexOf; - - if (Array.prototype.indexOf) { - indexOf = Array.prototype.indexOf; - } else { - indexOf = function (o) { - // I know - var i; - for (i = 0; i < this.length; ++i) { - if (this[i] === o) { - return i; - } - } - return -1; - }; - } - - function daysInMonth(year, month) { - if (isNaN(year) || isNaN(month)) { - return NaN; - } - var modMonth = mod(month, 12); - year += (month - modMonth) / 12; - return modMonth === 1 - ? isLeapYear(year) - ? 29 - : 28 - : 31 - ((modMonth % 7) % 2); - } - - // FORMATTING - - addFormatToken('M', ['MM', 2], 'Mo', function () { - return this.month() + 1; - }); - - addFormatToken('MMM', 0, 0, function (format) { - return this.localeData().monthsShort(this, format); - }); - - addFormatToken('MMMM', 0, 0, function (format) { - return this.localeData().months(this, format); - }); - - // PARSING - - addRegexToken('M', match1to2, match1to2NoLeadingZero); - addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', function (isStrict, locale) { - return locale.monthsShortRegex(isStrict); - }); - addRegexToken('MMMM', function (isStrict, locale) { - return locale.monthsRegex(isStrict); - }); - - addParseToken(['M', 'MM'], function (input, array) { - array[MONTH] = toInt(input) - 1; - }); - - addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { - var month = config._locale.monthsParse(input, token, config._strict); - // if we didn't find a month name, mark the date as invalid. - if (month != null) { - array[MONTH] = month; - } else { - getParsingFlags(config).invalidMonth = input; - } - }); - - // LOCALES - - var defaultLocaleMonths = - 'January_February_March_April_May_June_July_August_September_October_November_December'.split( - '_' - ), - defaultLocaleMonthsShort = - 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, - defaultMonthsShortRegex = matchWord, - defaultMonthsRegex = matchWord; - - function localeMonths(m, format) { - if (!m) { - return isArray(this._months) - ? this._months - : this._months['standalone']; - } - return isArray(this._months) - ? this._months[m.month()] - : this._months[ - (this._months.isFormat || MONTHS_IN_FORMAT).test(format) - ? 'format' - : 'standalone' - ][m.month()]; - } - - function localeMonthsShort(m, format) { - if (!m) { - return isArray(this._monthsShort) - ? this._monthsShort - : this._monthsShort['standalone']; - } - return isArray(this._monthsShort) - ? this._monthsShort[m.month()] - : this._monthsShort[ - MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' - ][m.month()]; - } - - function handleStrictParse(monthName, format, strict) { - var i, - ii, - mom, - llc = monthName.toLocaleLowerCase(); - if (!this._monthsParse) { - // this is not used - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - for (i = 0; i < 12; ++i) { - mom = createUTC([2000, i]); - this._shortMonthsParse[i] = this.monthsShort( - mom, - '' - ).toLocaleLowerCase(); - this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); - } - } - - if (strict) { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } - } - - function localeMonthsParse(monthName, format, strict) { - var i, mom, regex; - - if (this._monthsParseExact) { - return handleStrictParse.call(this, monthName, format, strict); - } - - if (!this._monthsParse) { - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - } - - // TODO: add sorting - // Sorting makes sure if one month (or abbr) is a prefix of another - // see sorting in computeMonthsParse - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, i]); - if (strict && !this._longMonthsParse[i]) { - this._longMonthsParse[i] = new RegExp( - '^' + this.months(mom, '').replace('.', '') + '$', - 'i' - ); - this._shortMonthsParse[i] = new RegExp( - '^' + this.monthsShort(mom, '').replace('.', '') + '$', - 'i' - ); - } - if (!strict && !this._monthsParse[i]) { - regex = - '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if ( - strict && - format === 'MMMM' && - this._longMonthsParse[i].test(monthName) - ) { - return i; - } else if ( - strict && - format === 'MMM' && - this._shortMonthsParse[i].test(monthName) - ) { - return i; - } else if (!strict && this._monthsParse[i].test(monthName)) { - return i; - } - } - } - - // MOMENTS - - function setMonth(mom, value) { - if (!mom.isValid()) { - // No op - return mom; - } - - if (typeof value === 'string') { - if (/^\d+$/.test(value)) { - value = toInt(value); - } else { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (!isNumber(value)) { - return mom; - } - } - } - - var month = value, - date = mom.date(); - - date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month)); - void (mom._isUTC - ? mom._d.setUTCMonth(month, date) - : mom._d.setMonth(month, date)); - return mom; - } - - function getSetMonth(value) { - if (value != null) { - setMonth(this, value); - hooks.updateOffset(this, true); - return this; - } else { - return get(this, 'Month'); - } - } - - function getDaysInMonth() { - return daysInMonth(this.year(), this.month()); - } - - function monthsShortRegex(isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsShortStrictRegex; - } else { - return this._monthsShortRegex; - } - } else { - if (!hasOwnProp(this, '_monthsShortRegex')) { - this._monthsShortRegex = defaultMonthsShortRegex; - } - return this._monthsShortStrictRegex && isStrict - ? this._monthsShortStrictRegex - : this._monthsShortRegex; - } - } - - function monthsRegex(isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsStrictRegex; - } else { - return this._monthsRegex; - } - } else { - if (!hasOwnProp(this, '_monthsRegex')) { - this._monthsRegex = defaultMonthsRegex; - } - return this._monthsStrictRegex && isStrict - ? this._monthsStrictRegex - : this._monthsRegex; - } - } - - function computeMonthsParse() { - function cmpLenRev(a, b) { - return b.length - a.length; - } - - var shortPieces = [], - longPieces = [], - mixedPieces = [], - i, - mom, - shortP, - longP; - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, i]); - shortP = regexEscape(this.monthsShort(mom, '')); - longP = regexEscape(this.months(mom, '')); - shortPieces.push(shortP); - longPieces.push(longP); - mixedPieces.push(longP); - mixedPieces.push(shortP); - } - // Sorting makes sure if one month (or abbr) is a prefix of another it - // will match the longer piece. - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - - this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._monthsShortRegex = this._monthsRegex; - this._monthsStrictRegex = new RegExp( - '^(' + longPieces.join('|') + ')', - 'i' - ); - this._monthsShortStrictRegex = new RegExp( - '^(' + shortPieces.join('|') + ')', - 'i' - ); - } - - function createDate(y, m, d, h, M, s, ms) { - // can't just apply() to create a date: - // https://stackoverflow.com/q/181348 - var date; - // the date constructor remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - // preserve leap years using a full 400 year cycle, then reset - date = new Date(y + 400, m, d, h, M, s, ms); - if (isFinite(date.getFullYear())) { - date.setFullYear(y); - } - } else { - date = new Date(y, m, d, h, M, s, ms); - } - - return date; - } - - function createUTCDate(y) { - var date, args; - // the Date.UTC function remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - args = Array.prototype.slice.call(arguments); - // preserve leap years using a full 400 year cycle, then reset - args[0] = y + 400; - date = new Date(Date.UTC.apply(null, args)); - if (isFinite(date.getUTCFullYear())) { - date.setUTCFullYear(y); - } - } else { - date = new Date(Date.UTC.apply(null, arguments)); - } - - return date; - } - - // start-of-first-week - start-of-year - function firstWeekOffset(year, dow, doy) { - var // first-week day -- which january is always in the first week (4 for iso, 1 for other) - fwd = 7 + dow - doy, - // first-week day local weekday -- which local weekday is fwd - fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - - return -fwdlw + fwd - 1; - } - - // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, dow, doy) { - var localWeekday = (7 + weekday - dow) % 7, - weekOffset = firstWeekOffset(year, dow, doy), - dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, - resYear, - resDayOfYear; - - if (dayOfYear <= 0) { - resYear = year - 1; - resDayOfYear = daysInYear(resYear) + dayOfYear; - } else if (dayOfYear > daysInYear(year)) { - resYear = year + 1; - resDayOfYear = dayOfYear - daysInYear(year); - } else { - resYear = year; - resDayOfYear = dayOfYear; - } - - return { - year: resYear, - dayOfYear: resDayOfYear, - }; - } - - function weekOfYear(mom, dow, doy) { - var weekOffset = firstWeekOffset(mom.year(), dow, doy), - week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, - resWeek, - resYear; - - if (week < 1) { - resYear = mom.year() - 1; - resWeek = week + weeksInYear(resYear, dow, doy); - } else if (week > weeksInYear(mom.year(), dow, doy)) { - resWeek = week - weeksInYear(mom.year(), dow, doy); - resYear = mom.year() + 1; - } else { - resYear = mom.year(); - resWeek = week; - } - - return { - week: resWeek, - year: resYear, - }; - } - - function weeksInYear(year, dow, doy) { - var weekOffset = firstWeekOffset(year, dow, doy), - weekOffsetNext = firstWeekOffset(year + 1, dow, doy); - return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; - } - - // FORMATTING - - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - - // PARSING - - addRegexToken('w', match1to2, match1to2NoLeadingZero); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2, match1to2NoLeadingZero); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken( - ['w', 'ww', 'W', 'WW'], - function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - } - ); - - // HELPERS - - // LOCALES - - function localeWeek(mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 6th is the first week of the year. - }; - - function localeFirstDayOfWeek() { - return this._week.dow; - } - - function localeFirstDayOfYear() { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek(input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek(input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - // FORMATTING - - addFormatToken('d', 0, 'do', 'day'); - - addFormatToken('dd', 0, 0, function (format) { - return this.localeData().weekdaysMin(this, format); - }); - - addFormatToken('ddd', 0, 0, function (format) { - return this.localeData().weekdaysShort(this, format); - }); - - addFormatToken('dddd', 0, 0, function (format) { - return this.localeData().weekdays(this, format); - }); - - addFormatToken('e', 0, 0, 'weekday'); - addFormatToken('E', 0, 0, 'isoWeekday'); - - // PARSING - - addRegexToken('d', match1to2); - addRegexToken('e', match1to2); - addRegexToken('E', match1to2); - addRegexToken('dd', function (isStrict, locale) { - return locale.weekdaysMinRegex(isStrict); - }); - addRegexToken('ddd', function (isStrict, locale) { - return locale.weekdaysShortRegex(isStrict); - }); - addRegexToken('dddd', function (isStrict, locale) { - return locale.weekdaysRegex(isStrict); - }); - - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { - var weekday = config._locale.weekdaysParse(input, token, config._strict); - // if we didn't get a weekday name, mark the date as invalid - if (weekday != null) { - week.d = weekday; - } else { - getParsingFlags(config).invalidWeekday = input; - } - }); - - addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { - week[token] = toInt(input); - }); - - // HELPERS - - function parseWeekday(input, locale) { - if (typeof input !== 'string') { - return input; - } - - if (!isNaN(input)) { - return parseInt(input, 10); - } - - input = locale.weekdaysParse(input); - if (typeof input === 'number') { - return input; - } - - return null; - } - - function parseIsoWeekday(input, locale) { - if (typeof input === 'string') { - return locale.weekdaysParse(input) % 7 || 7; - } - return isNaN(input) ? null : input; - } - - // LOCALES - function shiftWeekdays(ws, n) { - return ws.slice(n, 7).concat(ws.slice(0, n)); - } - - var defaultLocaleWeekdays = - 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - defaultWeekdaysRegex = matchWord, - defaultWeekdaysShortRegex = matchWord, - defaultWeekdaysMinRegex = matchWord; - - function localeWeekdays(m, format) { - var weekdays = isArray(this._weekdays) - ? this._weekdays - : this._weekdays[ - m && m !== true && this._weekdays.isFormat.test(format) - ? 'format' - : 'standalone' - ]; - return m === true - ? shiftWeekdays(weekdays, this._week.dow) - : m - ? weekdays[m.day()] - : weekdays; - } - - function localeWeekdaysShort(m) { - return m === true - ? shiftWeekdays(this._weekdaysShort, this._week.dow) - : m - ? this._weekdaysShort[m.day()] - : this._weekdaysShort; - } - - function localeWeekdaysMin(m) { - return m === true - ? shiftWeekdays(this._weekdaysMin, this._week.dow) - : m - ? this._weekdaysMin[m.day()] - : this._weekdaysMin; - } - - function handleStrictParse$1(weekdayName, format, strict) { - var i, - ii, - mom, - llc = weekdayName.toLocaleLowerCase(); - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._shortWeekdaysParse = []; - this._minWeekdaysParse = []; - - for (i = 0; i < 7; ++i) { - mom = createUTC([2000, 1]).day(i); - this._minWeekdaysParse[i] = this.weekdaysMin( - mom, - '' - ).toLocaleLowerCase(); - this._shortWeekdaysParse[i] = this.weekdaysShort( - mom, - '' - ).toLocaleLowerCase(); - this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); - } - } - - if (strict) { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } - } - } - - function localeWeekdaysParse(weekdayName, format, strict) { - var i, mom, regex; - - if (this._weekdaysParseExact) { - return handleStrictParse$1.call(this, weekdayName, format, strict); - } - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._minWeekdaysParse = []; - this._shortWeekdaysParse = []; - this._fullWeekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - - mom = createUTC([2000, 1]).day(i); - if (strict && !this._fullWeekdaysParse[i]) { - this._fullWeekdaysParse[i] = new RegExp( - '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', - 'i' - ); - this._shortWeekdaysParse[i] = new RegExp( - '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', - 'i' - ); - this._minWeekdaysParse[i] = new RegExp( - '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', - 'i' - ); - } - if (!this._weekdaysParse[i]) { - regex = - '^' + - this.weekdays(mom, '') + - '|^' + - this.weekdaysShort(mom, '') + - '|^' + - this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if ( - strict && - format === 'dddd' && - this._fullWeekdaysParse[i].test(weekdayName) - ) { - return i; - } else if ( - strict && - format === 'ddd' && - this._shortWeekdaysParse[i].test(weekdayName) - ) { - return i; - } else if ( - strict && - format === 'dd' && - this._minWeekdaysParse[i].test(weekdayName) - ) { - return i; - } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - } - - // MOMENTS - - function getSetDayOfWeek(input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - - var day = get(this, 'Day'); - if (input != null) { - input = parseWeekday(input, this.localeData()); - return this.add(input - day, 'd'); - } else { - return day; - } - } - - function getSetLocaleDayOfWeek(input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; - return input == null ? weekday : this.add(input - weekday, 'd'); - } - - function getSetISODayOfWeek(input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - - if (input != null) { - var weekday = parseIsoWeekday(input, this.localeData()); - return this.day(this.day() % 7 ? weekday : weekday - 7); - } else { - return this.day() || 7; - } - } - - function weekdaysRegex(isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysStrictRegex; - } else { - return this._weekdaysRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysRegex')) { - this._weekdaysRegex = defaultWeekdaysRegex; - } - return this._weekdaysStrictRegex && isStrict - ? this._weekdaysStrictRegex - : this._weekdaysRegex; - } - } - - function weekdaysShortRegex(isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysShortStrictRegex; - } else { - return this._weekdaysShortRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysShortRegex')) { - this._weekdaysShortRegex = defaultWeekdaysShortRegex; - } - return this._weekdaysShortStrictRegex && isStrict - ? this._weekdaysShortStrictRegex - : this._weekdaysShortRegex; - } - } - - function weekdaysMinRegex(isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysMinStrictRegex; - } else { - return this._weekdaysMinRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysMinRegex')) { - this._weekdaysMinRegex = defaultWeekdaysMinRegex; - } - return this._weekdaysMinStrictRegex && isStrict - ? this._weekdaysMinStrictRegex - : this._weekdaysMinRegex; - } - } - - function computeWeekdaysParse() { - function cmpLenRev(a, b) { - return b.length - a.length; - } - - var minPieces = [], - shortPieces = [], - longPieces = [], - mixedPieces = [], - i, - mom, - minp, - shortp, - longp; - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, 1]).day(i); - minp = regexEscape(this.weekdaysMin(mom, '')); - shortp = regexEscape(this.weekdaysShort(mom, '')); - longp = regexEscape(this.weekdays(mom, '')); - minPieces.push(minp); - shortPieces.push(shortp); - longPieces.push(longp); - mixedPieces.push(minp); - mixedPieces.push(shortp); - mixedPieces.push(longp); - } - // Sorting makes sure if one weekday (or abbr) is a prefix of another it - // will match the longer piece. - minPieces.sort(cmpLenRev); - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - - this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._weekdaysShortRegex = this._weekdaysRegex; - this._weekdaysMinRegex = this._weekdaysRegex; - - this._weekdaysStrictRegex = new RegExp( - '^(' + longPieces.join('|') + ')', - 'i' - ); - this._weekdaysShortStrictRegex = new RegExp( - '^(' + shortPieces.join('|') + ')', - 'i' - ); - this._weekdaysMinStrictRegex = new RegExp( - '^(' + minPieces.join('|') + ')', - 'i' - ); - } - - // FORMATTING - - function hFormat() { - return this.hours() % 12 || 12; - } - - function kFormat() { - return this.hours() || 24; - } - - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, hFormat); - addFormatToken('k', ['kk', 2], 0, kFormat); - - addFormatToken('hmm', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); - }); - - addFormatToken('hmmss', 0, 0, function () { - return ( - '' + - hFormat.apply(this) + - zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2) - ); - }); - - addFormatToken('Hmm', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2); - }); - - addFormatToken('Hmmss', 0, 0, function () { - return ( - '' + - this.hours() + - zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2) - ); - }); - - function meridiem(token, lowercase) { - addFormatToken(token, 0, 0, function () { - return this.localeData().meridiem( - this.hours(), - this.minutes(), - lowercase - ); - }); - } - - meridiem('a', true); - meridiem('A', false); - - // PARSING - - function matchMeridiem(isStrict, locale) { - return locale._meridiemParse; - } - - addRegexToken('a', matchMeridiem); - addRegexToken('A', matchMeridiem); - addRegexToken('H', match1to2, match1to2HasZero); - addRegexToken('h', match1to2, match1to2NoLeadingZero); - addRegexToken('k', match1to2, match1to2NoLeadingZero); - addRegexToken('HH', match1to2, match2); - addRegexToken('hh', match1to2, match2); - addRegexToken('kk', match1to2, match2); - - addRegexToken('hmm', match3to4); - addRegexToken('hmmss', match5to6); - addRegexToken('Hmm', match3to4); - addRegexToken('Hmmss', match5to6); - - addParseToken(['H', 'HH'], HOUR); - addParseToken(['k', 'kk'], function (input, array, config) { - var kInput = toInt(input); - array[HOUR] = kInput === 24 ? 0 : kInput; - }); - addParseToken(['a', 'A'], function (input, array, config) { - config._isPm = config._locale.isPM(input); - config._meridiem = input; - }); - addParseToken(['h', 'hh'], function (input, array, config) { - array[HOUR] = toInt(input); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmmss', function (input, array, config) { - var pos1 = input.length - 4, - pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('Hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - }); - addParseToken('Hmmss', function (input, array, config) { - var pos1 = input.length - 4, - pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - }); - - // LOCALES - - function localeIsPM(input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return (input + '').toLowerCase().charAt(0) === 'p'; - } - - var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, - // Setting the hour should keep the time, because the user explicitly - // specified which hour they want. So trying to maintain the same hour (in - // a new timezone) makes sense. Adding/subtracting hours does not follow - // this rule. - getSetHour = makeGetSet('Hours', true); - - function localeMeridiem(hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - } - - var baseConfig = { - calendar: defaultCalendar, - longDateFormat: defaultLongDateFormat, - invalidDate: defaultInvalidDate, - ordinal: defaultOrdinal, - dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, - relativeTime: defaultRelativeTime, - - months: defaultLocaleMonths, - monthsShort: defaultLocaleMonthsShort, - - week: defaultLocaleWeek, - - weekdays: defaultLocaleWeekdays, - weekdaysMin: defaultLocaleWeekdaysMin, - weekdaysShort: defaultLocaleWeekdaysShort, - - meridiemParse: defaultLocaleMeridiemParse, - }; - - // internal storage for locale config files - var locales = {}, - localeFamilies = {}, - globalLocale; - - function commonPrefix(arr1, arr2) { - var i, - minl = Math.min(arr1.length, arr2.length); - for (i = 0; i < minl; i += 1) { - if (arr1[i] !== arr2[i]) { - return i; - } - } - return minl; - } - - function normalizeLocale(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // pick the locale from the array - // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function chooseLocale(names) { - var i = 0, - j, - next, - locale, - split; - - while (i < names.length) { - split = normalizeLocale(names[i]).split('-'); - j = split.length; - next = normalizeLocale(names[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - locale = loadLocale(split.slice(0, j).join('-')); - if (locale) { - return locale; - } - if ( - next && - next.length >= j && - commonPrefix(split, next) >= j - 1 - ) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return globalLocale; - } - - function isLocaleNameSane(name) { - // Prevent names that look like filesystem paths, i.e contain '/' or '\' - // Ensure name is available and function returns boolean - return !!(name && name.match('^[^/\\\\]*$')); - } - - function loadLocale(name) { - var oldLocale = null, - aliasedRequire; - // TODO: Find a better way to register and load all the locales in Node - if ( - locales[name] === undefined && - 'object' !== 'undefined' && - module && - module.exports && - isLocaleNameSane(name) - ) { - try { - oldLocale = globalLocale._abbr; - aliasedRequire = commonjsRequire; - aliasedRequire('./locale/' + name); - getSetGlobalLocale(oldLocale); - } catch (e) { - // mark as not found to avoid repeating expensive file require call causing high CPU - // when trying to find en-US, en_US, en-us for every format call - locales[name] = null; // null means not found - } - } - return locales[name]; - } - - // This function will load locale and then set the global locale. If - // no arguments are passed in, it will simply return the current global - // locale key. - function getSetGlobalLocale(key, values) { - var data; - if (key) { - if (isUndefined(values)) { - data = getLocale(key); - } else { - data = defineLocale(key, values); - } - - if (data) { - // moment.duration._locale = moment._locale = data; - globalLocale = data; - } else { - if (typeof console !== 'undefined' && console.warn) { - //warn user if arguments are passed but the locale could not be set - console.warn( - 'Locale ' + key + ' not found. Did you forget to load it?' - ); - } - } - } - - return globalLocale._abbr; - } - - function defineLocale(name, config) { - if (config !== null) { - var locale, - parentConfig = baseConfig; - config.abbr = name; - if (locales[name] != null) { - deprecateSimple( - 'defineLocaleOverride', - 'use moment.updateLocale(localeName, config) to change ' + - 'an existing locale. moment.defineLocale(localeName, ' + - 'config) should only be used for creating a new locale ' + - 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' - ); - parentConfig = locales[name]._config; - } else if (config.parentLocale != null) { - if (locales[config.parentLocale] != null) { - parentConfig = locales[config.parentLocale]._config; - } else { - locale = loadLocale(config.parentLocale); - if (locale != null) { - parentConfig = locale._config; - } else { - if (!localeFamilies[config.parentLocale]) { - localeFamilies[config.parentLocale] = []; - } - localeFamilies[config.parentLocale].push({ - name: name, - config: config, - }); - return null; - } - } - } - locales[name] = new Locale(mergeConfigs(parentConfig, config)); - - if (localeFamilies[name]) { - localeFamilies[name].forEach(function (x) { - defineLocale(x.name, x.config); - }); - } - - // backwards compat for now: also set the locale - // make sure we set the locale AFTER all child locales have been - // created, so we won't end up with the child locale set. - getSetGlobalLocale(name); - - return locales[name]; - } else { - // useful for testing - delete locales[name]; - return null; - } - } - - function updateLocale(name, config) { - if (config != null) { - var locale, - tmpLocale, - parentConfig = baseConfig; - - if (locales[name] != null && locales[name].parentLocale != null) { - // Update existing child locale in-place to avoid memory-leaks - locales[name].set(mergeConfigs(locales[name]._config, config)); - } else { - // MERGE - tmpLocale = loadLocale(name); - if (tmpLocale != null) { - parentConfig = tmpLocale._config; - } - config = mergeConfigs(parentConfig, config); - if (tmpLocale == null) { - // updateLocale is called for creating a new locale - // Set abbr so it will have a name (getters return - // undefined otherwise). - config.abbr = name; - } - locale = new Locale(config); - locale.parentLocale = locales[name]; - locales[name] = locale; - } - - // backwards compat for now: also set the locale - getSetGlobalLocale(name); - } else { - // pass null for config to unupdate, useful for tests - if (locales[name] != null) { - if (locales[name].parentLocale != null) { - locales[name] = locales[name].parentLocale; - if (name === getSetGlobalLocale()) { - getSetGlobalLocale(name); - } - } else if (locales[name] != null) { - delete locales[name]; - } - } - } - return locales[name]; - } - - // returns locale data - function getLocale(key) { - var locale; - - if (key && key._locale && key._locale._abbr) { - key = key._locale._abbr; - } - - if (!key) { - return globalLocale; - } - - if (!isArray(key)) { - //short-circuit everything else - locale = loadLocale(key); - if (locale) { - return locale; - } - key = [key]; - } - - return chooseLocale(key); - } - - function listLocales() { - return keys(locales); - } - - function checkOverflow(m) { - var overflow, - a = m._a; - - if (a && getParsingFlags(m).overflow === -2) { - overflow = - a[MONTH] < 0 || a[MONTH] > 11 - ? MONTH - : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) - ? DATE - : a[HOUR] < 0 || - a[HOUR] > 24 || - (a[HOUR] === 24 && - (a[MINUTE] !== 0 || - a[SECOND] !== 0 || - a[MILLISECOND] !== 0)) - ? HOUR - : a[MINUTE] < 0 || a[MINUTE] > 59 - ? MINUTE - : a[SECOND] < 0 || a[SECOND] > 59 - ? SECOND - : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 - ? MILLISECOND - : -1; - - if ( - getParsingFlags(m)._overflowDayOfYear && - (overflow < YEAR || overflow > DATE) - ) { - overflow = DATE; - } - if (getParsingFlags(m)._overflowWeeks && overflow === -1) { - overflow = WEEK; - } - if (getParsingFlags(m)._overflowWeekday && overflow === -1) { - overflow = WEEKDAY; - } - - getParsingFlags(m).overflow = overflow; - } - - return m; - } - - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - var extendedIsoRegex = - /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, - basicIsoRegex = - /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, - tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, - isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], - ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], - ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], - ['GGGG-[W]WW', /\d{4}-W\d\d/, false], - ['YYYY-DDD', /\d{4}-\d{3}/], - ['YYYY-MM', /\d{4}-\d\d/, false], - ['YYYYYYMMDD', /[+-]\d{10}/], - ['YYYYMMDD', /\d{8}/], - ['GGGG[W]WWE', /\d{4}W\d{3}/], - ['GGGG[W]WW', /\d{4}W\d{2}/, false], - ['YYYYDDD', /\d{7}/], - ['YYYYMM', /\d{6}/, false], - ['YYYY', /\d{4}/, false], - ], - // iso time formats and regexes - isoTimes = [ - ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], - ['HH:mm:ss', /\d\d:\d\d:\d\d/], - ['HH:mm', /\d\d:\d\d/], - ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], - ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], - ['HHmmss', /\d\d\d\d\d\d/], - ['HHmm', /\d\d\d\d/], - ['HH', /\d\d/], - ], - aspNetJsonRegex = /^\/?Date\((-?\d+)/i, - // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 - rfc2822 = - /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, - obsOffsets = { - UT: 0, - GMT: 0, - EDT: -4 * 60, - EST: -5 * 60, - CDT: -5 * 60, - CST: -6 * 60, - MDT: -6 * 60, - MST: -7 * 60, - PDT: -7 * 60, - PST: -8 * 60, - }; - - // date from iso format - function configFromISO(config) { - var i, - l, - string = config._i, - match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), - allowTime, - dateFormat, - timeFormat, - tzFormat, - isoDatesLen = isoDates.length, - isoTimesLen = isoTimes.length; - - if (match) { - getParsingFlags(config).iso = true; - for (i = 0, l = isoDatesLen; i < l; i++) { - if (isoDates[i][1].exec(match[1])) { - dateFormat = isoDates[i][0]; - allowTime = isoDates[i][2] !== false; - break; - } - } - if (dateFormat == null) { - config._isValid = false; - return; - } - if (match[3]) { - for (i = 0, l = isoTimesLen; i < l; i++) { - if (isoTimes[i][1].exec(match[3])) { - // match[2] should be 'T' or space - timeFormat = (match[2] || ' ') + isoTimes[i][0]; - break; - } - } - if (timeFormat == null) { - config._isValid = false; - return; - } - } - if (!allowTime && timeFormat != null) { - config._isValid = false; - return; - } - if (match[4]) { - if (tzRegex.exec(match[4])) { - tzFormat = 'Z'; - } else { - config._isValid = false; - return; - } - } - config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); - configFromStringAndFormat(config); - } else { - config._isValid = false; - } - } - - function extractFromRFC2822Strings( - yearStr, - monthStr, - dayStr, - hourStr, - minuteStr, - secondStr - ) { - var result = [ - untruncateYear(yearStr), - defaultLocaleMonthsShort.indexOf(monthStr), - parseInt(dayStr, 10), - parseInt(hourStr, 10), - parseInt(minuteStr, 10), - ]; - - if (secondStr) { - result.push(parseInt(secondStr, 10)); - } - - return result; - } - - function untruncateYear(yearStr) { - var year = parseInt(yearStr, 10); - if (year <= 49) { - return 2000 + year; - } else if (year <= 999) { - return 1900 + year; - } - return year; - } - - function preprocessRFC2822(s) { - // Remove comments and folding whitespace and replace multiple-spaces with a single space - return s - .replace(/\([^()]*\)|[\n\t]/g, ' ') - .replace(/(\s\s+)/g, ' ') - .replace(/^\s\s*/, '') - .replace(/\s\s*$/, ''); - } - - function checkWeekday(weekdayStr, parsedInput, config) { - if (weekdayStr) { - // TODO: Replace the vanilla JS Date object with an independent day-of-week check. - var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), - weekdayActual = new Date( - parsedInput[0], - parsedInput[1], - parsedInput[2] - ).getDay(); - if (weekdayProvided !== weekdayActual) { - getParsingFlags(config).weekdayMismatch = true; - config._isValid = false; - return false; - } - } - return true; - } - - function calculateOffset(obsOffset, militaryOffset, numOffset) { - if (obsOffset) { - return obsOffsets[obsOffset]; - } else if (militaryOffset) { - // the only allowed military tz is Z - return 0; - } else { - var hm = parseInt(numOffset, 10), - m = hm % 100, - h = (hm - m) / 100; - return h * 60 + m; - } - } - - // date and time from ref 2822 format - function configFromRFC2822(config) { - var match = rfc2822.exec(preprocessRFC2822(config._i)), - parsedArray; - if (match) { - parsedArray = extractFromRFC2822Strings( - match[4], - match[3], - match[2], - match[5], - match[6], - match[7] - ); - if (!checkWeekday(match[1], parsedArray, config)) { - return; - } - - config._a = parsedArray; - config._tzm = calculateOffset(match[8], match[9], match[10]); - - config._d = createUTCDate.apply(null, config._a); - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); - - getParsingFlags(config).rfc2822 = true; - } else { - config._isValid = false; - } - } - - // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict - function configFromString(config) { - var matched = aspNetJsonRegex.exec(config._i); - if (matched !== null) { - config._d = new Date(+matched[1]); - return; - } - - configFromISO(config); - if (config._isValid === false) { - delete config._isValid; - } else { - return; - } - - configFromRFC2822(config); - if (config._isValid === false) { - delete config._isValid; - } else { - return; - } - - if (config._strict) { - config._isValid = false; - } else { - // Final attempt, use Input Fallback - hooks.createFromInputFallback(config); - } - } - - hooks.createFromInputFallback = deprecate( - 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + - 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + - 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', - function (config) { - config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); - } - ); - - // Pick the first defined of two or three arguments. - function defaults(a, b, c) { - if (a != null) { - return a; - } - if (b != null) { - return b; - } - return c; - } - - function currentDateArray(config) { - // hooks is actually the exported moment object - var nowValue = new Date(hooks.now()); - if (config._useUTC) { - return [ - nowValue.getUTCFullYear(), - nowValue.getUTCMonth(), - nowValue.getUTCDate(), - ]; - } - return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function configFromArray(config) { - var i, - date, - input = [], - currentDate, - expectedWeekday, - yearToUse; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - dayOfYearFromWeekInfo(config); - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear != null) { - yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); - - if ( - config._dayOfYear > daysInYear(yearToUse) || - config._dayOfYear === 0 - ) { - getParsingFlags(config)._overflowDayOfYear = true; - } - - date = createUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = - config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // Check for 24:00:00.000 - if ( - config._a[HOUR] === 24 && - config._a[MINUTE] === 0 && - config._a[SECOND] === 0 && - config._a[MILLISECOND] === 0 - ) { - config._nextDay = true; - config._a[HOUR] = 0; - } - - config._d = (config._useUTC ? createUTCDate : createDate).apply( - null, - input - ); - expectedWeekday = config._useUTC - ? config._d.getUTCDay() - : config._d.getDay(); - - // Apply timezone offset from input. The actual utcOffset can be changed - // with parseZone. - if (config._tzm != null) { - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); - } - - if (config._nextDay) { - config._a[HOUR] = 24; - } - - // check for mismatching day of week - if ( - config._w && - typeof config._w.d !== 'undefined' && - config._w.d !== expectedWeekday - ) { - getParsingFlags(config).weekdayMismatch = true; - } - } - - function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - dow = 1; - doy = 4; - - // TODO: We need to take the current isoWeekYear, but that depends on - // how we interpret now (local, utc, fixed offset). So create - // a now version of current config (take local/utc/offset flags, and - // create now). - weekYear = defaults( - w.GG, - config._a[YEAR], - weekOfYear(createLocal(), 1, 4).year - ); - week = defaults(w.W, 1); - weekday = defaults(w.E, 1); - if (weekday < 1 || weekday > 7) { - weekdayOverflow = true; - } - } else { - dow = config._locale._week.dow; - doy = config._locale._week.doy; - - curWeek = weekOfYear(createLocal(), dow, doy); - - weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); - - // Default to current week. - week = defaults(w.w, curWeek.week); - - if (w.d != null) { - // weekday -- low day numbers are considered next week - weekday = w.d; - if (weekday < 0 || weekday > 6) { - weekdayOverflow = true; - } - } else if (w.e != null) { - // local weekday -- counting starts from beginning of week - weekday = w.e + dow; - if (w.e < 0 || w.e > 6) { - weekdayOverflow = true; - } - } else { - // default to beginning of week - weekday = dow; - } - } - if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { - getParsingFlags(config)._overflowWeeks = true; - } else if (weekdayOverflow != null) { - getParsingFlags(config)._overflowWeekday = true; - } else { - temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - } - - // constant that refers to the ISO standard - hooks.ISO_8601 = function () {}; - - // constant that refers to the RFC 2822 form - hooks.RFC_2822 = function () {}; - - // date from string and format string - function configFromStringAndFormat(config) { - // TODO: Move this to another part of the creation flow to prevent circular deps - if (config._f === hooks.ISO_8601) { - configFromISO(config); - return; - } - if (config._f === hooks.RFC_2822) { - configFromRFC2822(config); - return; - } - config._a = []; - getParsingFlags(config).empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var string = '' + config._i, - i, - parsedInput, - tokens, - token, - skipped, - stringLength = string.length, - totalParsedInputLength = 0, - era, - tokenLen; - - tokens = - expandFormat(config._f, config._locale).match(formattingTokens) || []; - tokenLen = tokens.length; - for (i = 0; i < tokenLen; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || - [])[0]; - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - getParsingFlags(config).unusedInput.push(skipped); - } - string = string.slice( - string.indexOf(parsedInput) + parsedInput.length - ); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - getParsingFlags(config).empty = false; - } else { - getParsingFlags(config).unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } else if (config._strict && !parsedInput) { - getParsingFlags(config).unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - getParsingFlags(config).charsLeftOver = - stringLength - totalParsedInputLength; - if (string.length > 0) { - getParsingFlags(config).unusedInput.push(string); - } - - // clear _12h flag if hour is <= 12 - if ( - config._a[HOUR] <= 12 && - getParsingFlags(config).bigHour === true && - config._a[HOUR] > 0 - ) { - getParsingFlags(config).bigHour = undefined; - } - - getParsingFlags(config).parsedDateParts = config._a.slice(0); - getParsingFlags(config).meridiem = config._meridiem; - // handle meridiem - config._a[HOUR] = meridiemFixWrap( - config._locale, - config._a[HOUR], - config._meridiem - ); - - // handle era - era = getParsingFlags(config).era; - if (era !== null) { - config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); - } - - configFromArray(config); - checkOverflow(config); - } - - function meridiemFixWrap(locale, hour, meridiem) { - var isPm; - - if (meridiem == null) { - // nothing to do - return hour; - } - if (locale.meridiemHour != null) { - return locale.meridiemHour(hour, meridiem); - } else if (locale.isPM != null) { - // Fallback - isPm = locale.isPM(meridiem); - if (isPm && hour < 12) { - hour += 12; - } - if (!isPm && hour === 12) { - hour = 0; - } - return hour; - } else { - // this is not supposed to happen - return hour; - } - } - - // date from string and array of format strings - function configFromStringAndArray(config) { - var tempConfig, - bestMoment, - scoreToBeat, - i, - currentScore, - validFormatFound, - bestFormatIsValid = false, - configfLen = config._f.length; - - if (configfLen === 0) { - getParsingFlags(config).invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < configfLen; i++) { - currentScore = 0; - validFormatFound = false; - tempConfig = copyConfig({}, config); - if (config._useUTC != null) { - tempConfig._useUTC = config._useUTC; - } - tempConfig._f = config._f[i]; - configFromStringAndFormat(tempConfig); - - if (isValid(tempConfig)) { - validFormatFound = true; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += getParsingFlags(tempConfig).charsLeftOver; - - //or tokens - currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; - - getParsingFlags(tempConfig).score = currentScore; - - if (!bestFormatIsValid) { - if ( - scoreToBeat == null || - currentScore < scoreToBeat || - validFormatFound - ) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - if (validFormatFound) { - bestFormatIsValid = true; - } - } - } else { - if (currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - } - - extend(config, bestMoment || tempConfig); - } - - function configFromObject(config) { - if (config._d) { - return; - } - - var i = normalizeObjectUnits(config._i), - dayOrDate = i.day === undefined ? i.date : i.day; - config._a = map( - [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], - function (obj) { - return obj && parseInt(obj, 10); - } - ); - - configFromArray(config); - } - - function createFromConfig(config) { - var res = new Moment(checkOverflow(prepareConfig(config))); - if (res._nextDay) { - // Adding is smart enough around DST - res.add(1, 'd'); - res._nextDay = undefined; - } - - return res; - } - - function prepareConfig(config) { - var input = config._i, - format = config._f; - - config._locale = config._locale || getLocale(config._l); - - if (input === null || (format === undefined && input === '')) { - return createInvalid({ nullInput: true }); - } - - if (typeof input === 'string') { - config._i = input = config._locale.preparse(input); - } - - if (isMoment(input)) { - return new Moment(checkOverflow(input)); - } else if (isDate(input)) { - config._d = input; - } else if (isArray(format)) { - configFromStringAndArray(config); - } else if (format) { - configFromStringAndFormat(config); - } else { - configFromInput(config); - } - - if (!isValid(config)) { - config._d = null; - } - - return config; - } - - function configFromInput(config) { - var input = config._i; - if (isUndefined(input)) { - config._d = new Date(hooks.now()); - } else if (isDate(input)) { - config._d = new Date(input.valueOf()); - } else if (typeof input === 'string') { - configFromString(config); - } else if (isArray(input)) { - config._a = map(input.slice(0), function (obj) { - return parseInt(obj, 10); - }); - configFromArray(config); - } else if (isObject(input)) { - configFromObject(config); - } else if (isNumber(input)) { - // from milliseconds - config._d = new Date(input); - } else { - hooks.createFromInputFallback(config); - } - } - - function createLocalOrUTC(input, format, locale, strict, isUTC) { - var c = {}; - - if (format === true || format === false) { - strict = format; - format = undefined; - } - - if (locale === true || locale === false) { - strict = locale; - locale = undefined; - } - - if ( - (isObject(input) && isObjectEmpty(input)) || - (isArray(input) && input.length === 0) - ) { - input = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c._isAMomentObject = true; - c._useUTC = c._isUTC = isUTC; - c._l = locale; - c._i = input; - c._f = format; - c._strict = strict; - - return createFromConfig(c); - } - - function createLocal(input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, false); - } - - var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other < this ? this : other; - } else { - return createInvalid(); - } - } - ), - prototypeMax = deprecate( - 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other > this ? this : other; - } else { - return createInvalid(); - } - } - ); - - // Pick a moment m from moments so that m[fn](other) is true for all - // other. This relies on the function fn to be transitive. - // - // moments should either be an array of moment objects or an array, whose - // first element is an array of moment objects. - function pickBy(fn, moments) { - var res, i; - if (moments.length === 1 && isArray(moments[0])) { - moments = moments[0]; - } - if (!moments.length) { - return createLocal(); - } - res = moments[0]; - for (i = 1; i < moments.length; ++i) { - if (!moments[i].isValid() || moments[i][fn](res)) { - res = moments[i]; - } - } - return res; - } - - // TODO: Use [].sort instead? - function min() { - var args = [].slice.call(arguments, 0); - - return pickBy('isBefore', args); - } - - function max() { - var args = [].slice.call(arguments, 0); - - return pickBy('isAfter', args); - } - - var now = function () { - return Date.now ? Date.now() : +new Date(); - }; - - var ordering = [ - 'year', - 'quarter', - 'month', - 'week', - 'day', - 'hour', - 'minute', - 'second', - 'millisecond', - ]; - - function isDurationValid(m) { - var key, - unitHasDecimal = false, - i, - orderLen = ordering.length; - for (key in m) { - if ( - hasOwnProp(m, key) && - !( - indexOf.call(ordering, key) !== -1 && - (m[key] == null || !isNaN(m[key])) - ) - ) { - return false; - } - } - - for (i = 0; i < orderLen; ++i) { - if (m[ordering[i]]) { - if (unitHasDecimal) { - return false; // only allow non-integers for smallest unit - } - if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { - unitHasDecimal = true; - } - } - } - - return true; - } - - function isValid$1() { - return this._isValid; - } - - function createInvalid$1() { - return createDuration(NaN); - } - - function Duration(duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || normalizedInput.isoWeek || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - this._isValid = isDurationValid(normalizedInput); - - // representation for dateAddRemove - this._milliseconds = - +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + weeks * 7; - // It is impossible to translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + quarters * 3 + years * 12; - - this._data = {}; - - this._locale = getLocale(); - - this._bubble(); - } - - function isDuration(obj) { - return obj instanceof Duration; - } - - function absRound(number) { - if (number < 0) { - return Math.round(-1 * number) * -1; - } else { - return Math.round(number); - } - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ( - (dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) - ) { - diffs++; - } - } - return diffs + lengthDiff; - } - - // FORMATTING - - function offset(token, separator) { - addFormatToken(token, 0, 0, function () { - var offset = this.utcOffset(), - sign = '+'; - if (offset < 0) { - offset = -offset; - sign = '-'; - } - return ( - sign + - zeroFill(~~(offset / 60), 2) + - separator + - zeroFill(~~offset % 60, 2) - ); - }); - } - - offset('Z', ':'); - offset('ZZ', ''); - - // PARSING - - addRegexToken('Z', matchShortOffset); - addRegexToken('ZZ', matchShortOffset); - addParseToken(['Z', 'ZZ'], function (input, array, config) { - config._useUTC = true; - config._tzm = offsetFromString(matchShortOffset, input); - }); - - // HELPERS - - // timezone chunker - // '+10:00' > ['10', '00'] - // '-1530' > ['-15', '30'] - var chunkOffset = /([\+\-]|\d\d)/gi; - - function offsetFromString(matcher, string) { - var matches = (string || '').match(matcher), - chunk, - parts, - minutes; - - if (matches === null) { - return null; - } - - chunk = matches[matches.length - 1] || []; - parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; - minutes = +(parts[1] * 60) + toInt(parts[2]); - - return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; - } - - // Return a moment from input, that is local/utc/zone equivalent to model. - function cloneWithOffset(input, model) { - var res, diff; - if (model._isUTC) { - res = model.clone(); - diff = - (isMoment(input) || isDate(input) - ? input.valueOf() - : createLocal(input).valueOf()) - res.valueOf(); - // Use low-level api, because this fn is low-level api. - res._d.setTime(res._d.valueOf() + diff); - hooks.updateOffset(res, false); - return res; - } else { - return createLocal(input).local(); - } - } - - function getDateOffset(m) { - // On Firefox.24 Date#getTimezoneOffset returns a floating point. - // https://github.com/moment/moment/pull/1871 - return -Math.round(m._d.getTimezoneOffset()); - } - - // HOOKS - - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - hooks.updateOffset = function () {}; - - // MOMENTS - - // keepLocalTime = true means only change the timezone, without - // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> - // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset - // +0200, so we adjust the time as needed, to be valid. - // - // Keeping the time actually adds/subtracts (one hour) - // from the actual represented time. That is why we call updateOffset - // a second time. In case it wants us to change the offset again - // _changeInProgress == true case, then we have to adjust, because - // there is no such time in the given timezone. - function getSetOffset(input, keepLocalTime, keepMinutes) { - var offset = this._offset || 0, - localAdjust; - if (!this.isValid()) { - return input != null ? this : NaN; - } - if (input != null) { - if (typeof input === 'string') { - input = offsetFromString(matchShortOffset, input); - if (input === null) { - return this; - } - } else if (Math.abs(input) < 16 && !keepMinutes) { - input = input * 60; - } - if (!this._isUTC && keepLocalTime) { - localAdjust = getDateOffset(this); - } - this._offset = input; - this._isUTC = true; - if (localAdjust != null) { - this.add(localAdjust, 'm'); - } - if (offset !== input) { - if (!keepLocalTime || this._changeInProgress) { - addSubtract( - this, - createDuration(input - offset, 'm'), - 1, - false - ); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - hooks.updateOffset(this, true); - this._changeInProgress = null; - } - } - return this; - } else { - return this._isUTC ? offset : getDateOffset(this); - } - } - - function getSetZone(input, keepLocalTime) { - if (input != null) { - if (typeof input !== 'string') { - input = -input; - } - - this.utcOffset(input, keepLocalTime); - - return this; - } else { - return -this.utcOffset(); - } - } - - function setOffsetToUTC(keepLocalTime) { - return this.utcOffset(0, keepLocalTime); - } - - function setOffsetToLocal(keepLocalTime) { - if (this._isUTC) { - this.utcOffset(0, keepLocalTime); - this._isUTC = false; - - if (keepLocalTime) { - this.subtract(getDateOffset(this), 'm'); - } - } - return this; - } - - function setOffsetToParsedOffset() { - if (this._tzm != null) { - this.utcOffset(this._tzm, false, true); - } else if (typeof this._i === 'string') { - var tZone = offsetFromString(matchOffset, this._i); - if (tZone != null) { - this.utcOffset(tZone); - } else { - this.utcOffset(0, true); - } - } - return this; - } - - function hasAlignedHourOffset(input) { - if (!this.isValid()) { - return false; - } - input = input ? createLocal(input).utcOffset() : 0; - - return (this.utcOffset() - input) % 60 === 0; - } - - function isDaylightSavingTime() { - return ( - this.utcOffset() > this.clone().month(0).utcOffset() || - this.utcOffset() > this.clone().month(5).utcOffset() - ); - } - - function isDaylightSavingTimeShifted() { - if (!isUndefined(this._isDSTShifted)) { - return this._isDSTShifted; - } - - var c = {}, - other; - - copyConfig(c, this); - c = prepareConfig(c); - - if (c._a) { - other = c._isUTC ? createUTC(c._a) : createLocal(c._a); - this._isDSTShifted = - this.isValid() && compareArrays(c._a, other.toArray()) > 0; - } else { - this._isDSTShifted = false; - } - - return this._isDSTShifted; - } - - function isLocal() { - return this.isValid() ? !this._isUTC : false; - } - - function isUtcOffset() { - return this.isValid() ? this._isUTC : false; - } - - function isUtc() { - return this.isValid() ? this._isUTC && this._offset === 0 : false; - } - - // ASP.NET json date format regex - var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - // and further modified to allow for strings containing both week and day - isoRegex = - /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; - - function createDuration(input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - diffRes; - - if (isDuration(input)) { - duration = { - ms: input._milliseconds, - d: input._days, - M: input._months, - }; - } else if (isNumber(input) || !isNaN(+input)) { - duration = {}; - if (key) { - duration[key] = +input; - } else { - duration.milliseconds = +input; - } - } else if ((match = aspNetRegex.exec(input))) { - sign = match[1] === '-' ? -1 : 1; - duration = { - y: 0, - d: toInt(match[DATE]) * sign, - h: toInt(match[HOUR]) * sign, - m: toInt(match[MINUTE]) * sign, - s: toInt(match[SECOND]) * sign, - ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match - }; - } else if ((match = isoRegex.exec(input))) { - sign = match[1] === '-' ? -1 : 1; - duration = { - y: parseIso(match[2], sign), - M: parseIso(match[3], sign), - w: parseIso(match[4], sign), - d: parseIso(match[5], sign), - h: parseIso(match[6], sign), - m: parseIso(match[7], sign), - s: parseIso(match[8], sign), - }; - } else if (duration == null) { - // checks for null or undefined - duration = {}; - } else if ( - typeof duration === 'object' && - ('from' in duration || 'to' in duration) - ) { - diffRes = momentsDifference( - createLocal(duration.from), - createLocal(duration.to) - ); - - duration = {}; - duration.ms = diffRes.milliseconds; - duration.M = diffRes.months; - } - - ret = new Duration(duration); - - if (isDuration(input) && hasOwnProp(input, '_locale')) { - ret._locale = input._locale; - } - - if (isDuration(input) && hasOwnProp(input, '_isValid')) { - ret._isValid = input._isValid; - } - - return ret; - } - - createDuration.fn = Duration.prototype; - createDuration.invalid = createInvalid$1; - - function parseIso(inp, sign) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - } - - function positiveMomentsDifference(base, other) { - var res = {}; - - res.months = - other.month() - base.month() + (other.year() - base.year()) * 12; - if (base.clone().add(res.months, 'M').isAfter(other)) { - --res.months; - } - - res.milliseconds = +other - +base.clone().add(res.months, 'M'); - - return res; - } - - function momentsDifference(base, other) { - var res; - if (!(base.isValid() && other.isValid())) { - return { milliseconds: 0, months: 0 }; - } - - other = cloneWithOffset(other, base); - if (base.isBefore(other)) { - res = positiveMomentsDifference(base, other); - } else { - res = positiveMomentsDifference(other, base); - res.milliseconds = -res.milliseconds; - res.months = -res.months; - } - - return res; - } - - // TODO: remove 'name' arg after deprecation is removed - function createAdder(direction, name) { - return function (val, period) { - var dur, tmp; - //invert the arguments, but complain about it - if (period !== null && !isNaN(+period)) { - deprecateSimple( - name, - 'moment().' + - name + - '(period, number) is deprecated. Please use moment().' + - name + - '(number, period). ' + - 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' - ); - tmp = val; - val = period; - period = tmp; - } - - dur = createDuration(val, period); - addSubtract(this, dur, direction); - return this; - }; - } - - function addSubtract(mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = absRound(duration._days), - months = absRound(duration._months); - - if (!mom.isValid()) { - // No op - return; - } - - updateOffset = updateOffset == null ? true : updateOffset; - - if (months) { - setMonth(mom, get(mom, 'Month') + months * isAdding); - } - if (days) { - set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); - } - if (milliseconds) { - mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); - } - if (updateOffset) { - hooks.updateOffset(mom, days || months); - } - } - - var add = createAdder(1, 'add'), - subtract = createAdder(-1, 'subtract'); - - function isString(input) { - return typeof input === 'string' || input instanceof String; - } - - // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined - function isMomentInput(input) { - return ( - isMoment(input) || - isDate(input) || - isString(input) || - isNumber(input) || - isNumberOrStringArray(input) || - isMomentInputObject(input) || - input === null || - input === undefined - ); - } - - function isMomentInputObject(input) { - var objectTest = isObject(input) && !isObjectEmpty(input), - propertyTest = false, - properties = [ - 'years', - 'year', - 'y', - 'months', - 'month', - 'M', - 'days', - 'day', - 'd', - 'dates', - 'date', - 'D', - 'hours', - 'hour', - 'h', - 'minutes', - 'minute', - 'm', - 'seconds', - 'second', - 's', - 'milliseconds', - 'millisecond', - 'ms', - ], - i, - property, - propertyLen = properties.length; - - for (i = 0; i < propertyLen; i += 1) { - property = properties[i]; - propertyTest = propertyTest || hasOwnProp(input, property); - } - - return objectTest && propertyTest; - } - - function isNumberOrStringArray(input) { - var arrayTest = isArray(input), - dataTypeTest = false; - if (arrayTest) { - dataTypeTest = - input.filter(function (item) { - return !isNumber(item) && isString(input); - }).length === 0; - } - return arrayTest && dataTypeTest; - } - - function isCalendarSpec(input) { - var objectTest = isObject(input) && !isObjectEmpty(input), - propertyTest = false, - properties = [ - 'sameDay', - 'nextDay', - 'lastDay', - 'nextWeek', - 'lastWeek', - 'sameElse', - ], - i, - property; - - for (i = 0; i < properties.length; i += 1) { - property = properties[i]; - propertyTest = propertyTest || hasOwnProp(input, property); - } - - return objectTest && propertyTest; - } - - function getCalendarFormat(myMoment, now) { - var diff = myMoment.diff(now, 'days', true); - return diff < -6 - ? 'sameElse' - : diff < -1 - ? 'lastWeek' - : diff < 0 - ? 'lastDay' - : diff < 1 - ? 'sameDay' - : diff < 2 - ? 'nextDay' - : diff < 7 - ? 'nextWeek' - : 'sameElse'; - } - - function calendar$1(time, formats) { - // Support for single parameter, formats only overload to the calendar function - if (arguments.length === 1) { - if (!arguments[0]) { - time = undefined; - formats = undefined; - } else if (isMomentInput(arguments[0])) { - time = arguments[0]; - formats = undefined; - } else if (isCalendarSpec(arguments[0])) { - formats = arguments[0]; - time = undefined; - } - } - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're local/utc/offset or not. - var now = time || createLocal(), - sod = cloneWithOffset(now, this).startOf('day'), - format = hooks.calendarFormat(this, sod) || 'sameElse', - output = - formats && - (isFunction(formats[format]) - ? formats[format].call(this, now) - : formats[format]); - - return this.format( - output || this.localeData().calendar(format, this, createLocal(now)) - ); - } - - function clone() { - return new Moment(this); - } - - function isAfter(input, units) { - var localInput = isMoment(input) ? input : createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units) || 'millisecond'; - if (units === 'millisecond') { - return this.valueOf() > localInput.valueOf(); - } else { - return localInput.valueOf() < this.clone().startOf(units).valueOf(); - } - } - - function isBefore(input, units) { - var localInput = isMoment(input) ? input : createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units) || 'millisecond'; - if (units === 'millisecond') { - return this.valueOf() < localInput.valueOf(); - } else { - return this.clone().endOf(units).valueOf() < localInput.valueOf(); - } - } - - function isBetween(from, to, units, inclusivity) { - var localFrom = isMoment(from) ? from : createLocal(from), - localTo = isMoment(to) ? to : createLocal(to); - if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { - return false; - } - inclusivity = inclusivity || '()'; - return ( - (inclusivity[0] === '(' - ? this.isAfter(localFrom, units) - : !this.isBefore(localFrom, units)) && - (inclusivity[1] === ')' - ? this.isBefore(localTo, units) - : !this.isAfter(localTo, units)) - ); - } - - function isSame(input, units) { - var localInput = isMoment(input) ? input : createLocal(input), - inputMs; - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units) || 'millisecond'; - if (units === 'millisecond') { - return this.valueOf() === localInput.valueOf(); - } else { - inputMs = localInput.valueOf(); - return ( - this.clone().startOf(units).valueOf() <= inputMs && - inputMs <= this.clone().endOf(units).valueOf() - ); - } - } - - function isSameOrAfter(input, units) { - return this.isSame(input, units) || this.isAfter(input, units); - } - - function isSameOrBefore(input, units) { - return this.isSame(input, units) || this.isBefore(input, units); - } - - function diff(input, units, asFloat) { - var that, zoneDelta, output; - - if (!this.isValid()) { - return NaN; - } - - that = cloneWithOffset(input, this); - - if (!that.isValid()) { - return NaN; - } - - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; - - units = normalizeUnits(units); - - switch (units) { - case 'year': - output = monthDiff(this, that) / 12; - break; - case 'month': - output = monthDiff(this, that); - break; - case 'quarter': - output = monthDiff(this, that) / 3; - break; - case 'second': - output = (this - that) / 1e3; - break; // 1000 - case 'minute': - output = (this - that) / 6e4; - break; // 1000 * 60 - case 'hour': - output = (this - that) / 36e5; - break; // 1000 * 60 * 60 - case 'day': - output = (this - that - zoneDelta) / 864e5; - break; // 1000 * 60 * 60 * 24, negate dst - case 'week': - output = (this - that - zoneDelta) / 6048e5; - break; // 1000 * 60 * 60 * 24 * 7, negate dst - default: - output = this - that; - } - - return asFloat ? output : absFloor(output); - } - - function monthDiff(a, b) { - if (a.date() < b.date()) { - // end-of-month calculations work correct when the start month has more - // days than the end month. - return -monthDiff(b, a); - } - // difference in months - var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), - // b is in (anchor - 1 month, anchor + 1 month) - anchor = a.clone().add(wholeMonthDiff, 'months'), - anchor2, - adjust; - - if (b - anchor < 0) { - anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor - anchor2); - } else { - anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor2 - anchor); - } - - //check for negative zero, return zero if negative zero - return -(wholeMonthDiff + adjust) || 0; - } - - hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; - hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; - - function toString() { - return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); - } - - function toISOString(keepOffset) { - if (!this.isValid()) { - return null; - } - var utc = keepOffset !== true, - m = utc ? this.clone().utc() : this; - if (m.year() < 0 || m.year() > 9999) { - return formatMoment( - m, - utc - ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' - : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' - ); - } - if (isFunction(Date.prototype.toISOString)) { - // native implementation is ~50x faster, use it when we can - if (utc) { - return this.toDate().toISOString(); - } else { - return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) - .toISOString() - .replace('Z', formatMoment(m, 'Z')); - } - } - return formatMoment( - m, - utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' - ); - } - - /** - * Return a human readable representation of a moment that can - * also be evaluated to get a new moment which is the same - * - * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects - */ - function inspect() { - if (!this.isValid()) { - return 'moment.invalid(/* ' + this._i + ' */)'; - } - var func = 'moment', - zone = '', - prefix, - year, - datetime, - suffix; - if (!this.isLocal()) { - func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; - zone = 'Z'; - } - prefix = '[' + func + '("]'; - year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; - datetime = '-MM-DD[T]HH:mm:ss.SSS'; - suffix = zone + '[")]'; - - return this.format(prefix + year + datetime + suffix); - } - - function format(inputString) { - if (!inputString) { - inputString = this.isUtc() - ? hooks.defaultFormatUtc - : hooks.defaultFormat; - } - var output = formatMoment(this, inputString); - return this.localeData().postformat(output); - } - - function from(time, withoutSuffix) { - if ( - this.isValid() && - ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) - ) { - return createDuration({ to: this, from: time }) - .locale(this.locale()) - .humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } - } - - function fromNow(withoutSuffix) { - return this.from(createLocal(), withoutSuffix); - } - - function to(time, withoutSuffix) { - if ( - this.isValid() && - ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) - ) { - return createDuration({ from: this, to: time }) - .locale(this.locale()) - .humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } - } - - function toNow(withoutSuffix) { - return this.to(createLocal(), withoutSuffix); - } - - // If passed a locale key, it will set the locale for this - // instance. Otherwise, it will return the locale configuration - // variables for this instance. - function locale(key) { - var newLocaleData; - - if (key === undefined) { - return this._locale._abbr; - } else { - newLocaleData = getLocale(key); - if (newLocaleData != null) { - this._locale = newLocaleData; - } - return this; - } - } - - var lang = deprecate( - 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', - function (key) { - if (key === undefined) { - return this.localeData(); - } else { - return this.locale(key); - } - } - ); - - function localeData() { - return this._locale; - } - - var MS_PER_SECOND = 1000, - MS_PER_MINUTE = 60 * MS_PER_SECOND, - MS_PER_HOUR = 60 * MS_PER_MINUTE, - MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; - - // actual modulo - handles negative numbers (for dates before 1970): - function mod$1(dividend, divisor) { - return ((dividend % divisor) + divisor) % divisor; - } - - function localStartOfDate(y, m, d) { - // the date constructor remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - // preserve leap years using a full 400 year cycle, then reset - return new Date(y + 400, m, d) - MS_PER_400_YEARS; - } else { - return new Date(y, m, d).valueOf(); - } - } - - function utcStartOfDate(y, m, d) { - // Date.UTC remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - // preserve leap years using a full 400 year cycle, then reset - return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; - } else { - return Date.UTC(y, m, d); - } - } - - function startOf(units) { - var time, startOfDate; - units = normalizeUnits(units); - if (units === undefined || units === 'millisecond' || !this.isValid()) { - return this; - } - - startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; - - switch (units) { - case 'year': - time = startOfDate(this.year(), 0, 1); - break; - case 'quarter': - time = startOfDate( - this.year(), - this.month() - (this.month() % 3), - 1 - ); - break; - case 'month': - time = startOfDate(this.year(), this.month(), 1); - break; - case 'week': - time = startOfDate( - this.year(), - this.month(), - this.date() - this.weekday() - ); - break; - case 'isoWeek': - time = startOfDate( - this.year(), - this.month(), - this.date() - (this.isoWeekday() - 1) - ); - break; - case 'day': - case 'date': - time = startOfDate(this.year(), this.month(), this.date()); - break; - case 'hour': - time = this._d.valueOf(); - time -= mod$1( - time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), - MS_PER_HOUR - ); - break; - case 'minute': - time = this._d.valueOf(); - time -= mod$1(time, MS_PER_MINUTE); - break; - case 'second': - time = this._d.valueOf(); - time -= mod$1(time, MS_PER_SECOND); - break; - } - - this._d.setTime(time); - hooks.updateOffset(this, true); - return this; - } - - function endOf(units) { - var time, startOfDate; - units = normalizeUnits(units); - if (units === undefined || units === 'millisecond' || !this.isValid()) { - return this; - } - - startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; - - switch (units) { - case 'year': - time = startOfDate(this.year() + 1, 0, 1) - 1; - break; - case 'quarter': - time = - startOfDate( - this.year(), - this.month() - (this.month() % 3) + 3, - 1 - ) - 1; - break; - case 'month': - time = startOfDate(this.year(), this.month() + 1, 1) - 1; - break; - case 'week': - time = - startOfDate( - this.year(), - this.month(), - this.date() - this.weekday() + 7 - ) - 1; - break; - case 'isoWeek': - time = - startOfDate( - this.year(), - this.month(), - this.date() - (this.isoWeekday() - 1) + 7 - ) - 1; - break; - case 'day': - case 'date': - time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; - break; - case 'hour': - time = this._d.valueOf(); - time += - MS_PER_HOUR - - mod$1( - time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), - MS_PER_HOUR - ) - - 1; - break; - case 'minute': - time = this._d.valueOf(); - time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; - break; - case 'second': - time = this._d.valueOf(); - time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; - break; - } - - this._d.setTime(time); - hooks.updateOffset(this, true); - return this; - } - - function valueOf() { - return this._d.valueOf() - (this._offset || 0) * 60000; - } - - function unix() { - return Math.floor(this.valueOf() / 1000); - } - - function toDate() { - return new Date(this.valueOf()); - } - - function toArray() { - var m = this; - return [ - m.year(), - m.month(), - m.date(), - m.hour(), - m.minute(), - m.second(), - m.millisecond(), - ]; - } - - function toObject() { - var m = this; - return { - years: m.year(), - months: m.month(), - date: m.date(), - hours: m.hours(), - minutes: m.minutes(), - seconds: m.seconds(), - milliseconds: m.milliseconds(), - }; - } - - function toJSON() { - // new Date(NaN).toJSON() === null - return this.isValid() ? this.toISOString() : null; - } - - function isValid$2() { - return isValid(this); - } - - function parsingFlags() { - return extend({}, getParsingFlags(this)); - } - - function invalidAt() { - return getParsingFlags(this).overflow; - } - - function creationData() { - return { - input: this._i, - format: this._f, - locale: this._locale, - isUTC: this._isUTC, - strict: this._strict, - }; - } - - addFormatToken('N', 0, 0, 'eraAbbr'); - addFormatToken('NN', 0, 0, 'eraAbbr'); - addFormatToken('NNN', 0, 0, 'eraAbbr'); - addFormatToken('NNNN', 0, 0, 'eraName'); - addFormatToken('NNNNN', 0, 0, 'eraNarrow'); - - addFormatToken('y', ['y', 1], 'yo', 'eraYear'); - addFormatToken('y', ['yy', 2], 0, 'eraYear'); - addFormatToken('y', ['yyy', 3], 0, 'eraYear'); - addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); - - addRegexToken('N', matchEraAbbr); - addRegexToken('NN', matchEraAbbr); - addRegexToken('NNN', matchEraAbbr); - addRegexToken('NNNN', matchEraName); - addRegexToken('NNNNN', matchEraNarrow); - - addParseToken( - ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], - function (input, array, config, token) { - var era = config._locale.erasParse(input, token, config._strict); - if (era) { - getParsingFlags(config).era = era; - } else { - getParsingFlags(config).invalidEra = input; - } - } - ); - - addRegexToken('y', matchUnsigned); - addRegexToken('yy', matchUnsigned); - addRegexToken('yyy', matchUnsigned); - addRegexToken('yyyy', matchUnsigned); - addRegexToken('yo', matchEraYearOrdinal); - - addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); - addParseToken(['yo'], function (input, array, config, token) { - var match; - if (config._locale._eraYearOrdinalRegex) { - match = input.match(config._locale._eraYearOrdinalRegex); - } - - if (config._locale.eraYearOrdinalParse) { - array[YEAR] = config._locale.eraYearOrdinalParse(input, match); - } else { - array[YEAR] = parseInt(input, 10); - } - }); - - function localeEras(m, format) { - var i, - l, - date, - eras = this._eras || getLocale('en')._eras; - for (i = 0, l = eras.length; i < l; ++i) { - switch (typeof eras[i].since) { - case 'string': - // truncate time - date = hooks(eras[i].since).startOf('day'); - eras[i].since = date.valueOf(); - break; - } - - switch (typeof eras[i].until) { - case 'undefined': - eras[i].until = +Infinity; - break; - case 'string': - // truncate time - date = hooks(eras[i].until).startOf('day').valueOf(); - eras[i].until = date.valueOf(); - break; - } - } - return eras; - } - - function localeErasParse(eraName, format, strict) { - var i, - l, - eras = this.eras(), - name, - abbr, - narrow; - eraName = eraName.toUpperCase(); - - for (i = 0, l = eras.length; i < l; ++i) { - name = eras[i].name.toUpperCase(); - abbr = eras[i].abbr.toUpperCase(); - narrow = eras[i].narrow.toUpperCase(); - - if (strict) { - switch (format) { - case 'N': - case 'NN': - case 'NNN': - if (abbr === eraName) { - return eras[i]; - } - break; - - case 'NNNN': - if (name === eraName) { - return eras[i]; - } - break; - - case 'NNNNN': - if (narrow === eraName) { - return eras[i]; - } - break; - } - } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { - return eras[i]; - } - } - } - - function localeErasConvertYear(era, year) { - var dir = era.since <= era.until ? +1 : -1; - if (year === undefined) { - return hooks(era.since).year(); - } else { - return hooks(era.since).year() + (year - era.offset) * dir; - } - } - - function getEraName() { - var i, - l, - val, - eras = this.localeData().eras(); - for (i = 0, l = eras.length; i < l; ++i) { - // truncate time - val = this.clone().startOf('day').valueOf(); - - if (eras[i].since <= val && val <= eras[i].until) { - return eras[i].name; - } - if (eras[i].until <= val && val <= eras[i].since) { - return eras[i].name; - } - } - - return ''; - } - - function getEraNarrow() { - var i, - l, - val, - eras = this.localeData().eras(); - for (i = 0, l = eras.length; i < l; ++i) { - // truncate time - val = this.clone().startOf('day').valueOf(); - - if (eras[i].since <= val && val <= eras[i].until) { - return eras[i].narrow; - } - if (eras[i].until <= val && val <= eras[i].since) { - return eras[i].narrow; - } - } - - return ''; - } - - function getEraAbbr() { - var i, - l, - val, - eras = this.localeData().eras(); - for (i = 0, l = eras.length; i < l; ++i) { - // truncate time - val = this.clone().startOf('day').valueOf(); - - if (eras[i].since <= val && val <= eras[i].until) { - return eras[i].abbr; - } - if (eras[i].until <= val && val <= eras[i].since) { - return eras[i].abbr; - } - } - - return ''; - } - - function getEraYear() { - var i, - l, - dir, - val, - eras = this.localeData().eras(); - for (i = 0, l = eras.length; i < l; ++i) { - dir = eras[i].since <= eras[i].until ? +1 : -1; - - // truncate time - val = this.clone().startOf('day').valueOf(); - - if ( - (eras[i].since <= val && val <= eras[i].until) || - (eras[i].until <= val && val <= eras[i].since) - ) { - return ( - (this.year() - hooks(eras[i].since).year()) * dir + - eras[i].offset - ); - } - } - - return this.year(); - } - - function erasNameRegex(isStrict) { - if (!hasOwnProp(this, '_erasNameRegex')) { - computeErasParse.call(this); - } - return isStrict ? this._erasNameRegex : this._erasRegex; - } - - function erasAbbrRegex(isStrict) { - if (!hasOwnProp(this, '_erasAbbrRegex')) { - computeErasParse.call(this); - } - return isStrict ? this._erasAbbrRegex : this._erasRegex; - } - - function erasNarrowRegex(isStrict) { - if (!hasOwnProp(this, '_erasNarrowRegex')) { - computeErasParse.call(this); - } - return isStrict ? this._erasNarrowRegex : this._erasRegex; - } - - function matchEraAbbr(isStrict, locale) { - return locale.erasAbbrRegex(isStrict); - } - - function matchEraName(isStrict, locale) { - return locale.erasNameRegex(isStrict); - } - - function matchEraNarrow(isStrict, locale) { - return locale.erasNarrowRegex(isStrict); - } - - function matchEraYearOrdinal(isStrict, locale) { - return locale._eraYearOrdinalRegex || matchUnsigned; - } - - function computeErasParse() { - var abbrPieces = [], - namePieces = [], - narrowPieces = [], - mixedPieces = [], - i, - l, - erasName, - erasAbbr, - erasNarrow, - eras = this.eras(); - - for (i = 0, l = eras.length; i < l; ++i) { - erasName = regexEscape(eras[i].name); - erasAbbr = regexEscape(eras[i].abbr); - erasNarrow = regexEscape(eras[i].narrow); - - namePieces.push(erasName); - abbrPieces.push(erasAbbr); - narrowPieces.push(erasNarrow); - mixedPieces.push(erasName); - mixedPieces.push(erasAbbr); - mixedPieces.push(erasNarrow); - } - - this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); - this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); - this._erasNarrowRegex = new RegExp( - '^(' + narrowPieces.join('|') + ')', - 'i' - ); - } - - // FORMATTING - - addFormatToken(0, ['gg', 2], 0, function () { - return this.weekYear() % 100; - }); - - addFormatToken(0, ['GG', 2], 0, function () { - return this.isoWeekYear() % 100; - }); - - function addWeekYearFormatToken(token, getter) { - addFormatToken(0, [token, token.length], 0, getter); - } - - addWeekYearFormatToken('gggg', 'weekYear'); - addWeekYearFormatToken('ggggg', 'weekYear'); - addWeekYearFormatToken('GGGG', 'isoWeekYear'); - addWeekYearFormatToken('GGGGG', 'isoWeekYear'); - - // ALIASES - - // PARSING - - addRegexToken('G', matchSigned); - addRegexToken('g', matchSigned); - addRegexToken('GG', match1to2, match2); - addRegexToken('gg', match1to2, match2); - addRegexToken('GGGG', match1to4, match4); - addRegexToken('gggg', match1to4, match4); - addRegexToken('GGGGG', match1to6, match6); - addRegexToken('ggggg', match1to6, match6); - - addWeekParseToken( - ['gggg', 'ggggg', 'GGGG', 'GGGGG'], - function (input, week, config, token) { - week[token.substr(0, 2)] = toInt(input); - } - ); - - addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { - week[token] = hooks.parseTwoDigitYear(input); - }); - - // MOMENTS - - function getSetWeekYear(input) { - return getSetWeekYearHelper.call( - this, - input, - this.week(), - this.weekday() + this.localeData()._week.dow, - this.localeData()._week.dow, - this.localeData()._week.doy - ); - } - - function getSetISOWeekYear(input) { - return getSetWeekYearHelper.call( - this, - input, - this.isoWeek(), - this.isoWeekday(), - 1, - 4 - ); - } - - function getISOWeeksInYear() { - return weeksInYear(this.year(), 1, 4); - } - - function getISOWeeksInISOWeekYear() { - return weeksInYear(this.isoWeekYear(), 1, 4); - } - - function getWeeksInYear() { - var weekInfo = this.localeData()._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - } - - function getWeeksInWeekYear() { - var weekInfo = this.localeData()._week; - return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); - } - - function getSetWeekYearHelper(input, week, weekday, dow, doy) { - var weeksTarget; - if (input == null) { - return weekOfYear(this, dow, doy).year; - } else { - weeksTarget = weeksInYear(input, dow, doy); - if (week > weeksTarget) { - week = weeksTarget; - } - return setWeekAll.call(this, input, week, weekday, dow, doy); - } - } - - function setWeekAll(weekYear, week, weekday, dow, doy) { - var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), - date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - - this.year(date.getUTCFullYear()); - this.month(date.getUTCMonth()); - this.date(date.getUTCDate()); - return this; - } - - // FORMATTING - - addFormatToken('Q', 0, 'Qo', 'quarter'); - - // PARSING - - addRegexToken('Q', match1); - addParseToken('Q', function (input, array) { - array[MONTH] = (toInt(input) - 1) * 3; - }); - - // MOMENTS - - function getSetQuarter(input) { - return input == null - ? Math.ceil((this.month() + 1) / 3) - : this.month((input - 1) * 3 + (this.month() % 3)); - } - - // FORMATTING - - addFormatToken('D', ['DD', 2], 'Do', 'date'); - - // PARSING - - addRegexToken('D', match1to2, match1to2NoLeadingZero); - addRegexToken('DD', match1to2, match2); - addRegexToken('Do', function (isStrict, locale) { - // TODO: Remove "ordinalParse" fallback in next major release. - return isStrict - ? locale._dayOfMonthOrdinalParse || locale._ordinalParse - : locale._dayOfMonthOrdinalParseLenient; - }); - - addParseToken(['D', 'DD'], DATE); - addParseToken('Do', function (input, array) { - array[DATE] = toInt(input.match(match1to2)[0]); - }); - - // MOMENTS - - var getSetDayOfMonth = makeGetSet('Date', true); - - // FORMATTING - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - - // MOMENTS - - function getSetDayOfYear(input) { - var dayOfYear = - Math.round( - (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 - ) + 1; - return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); - } - - // FORMATTING - - addFormatToken('m', ['mm', 2], 0, 'minute'); - - // PARSING - - addRegexToken('m', match1to2, match1to2HasZero); - addRegexToken('mm', match1to2, match2); - addParseToken(['m', 'mm'], MINUTE); - - // MOMENTS - - var getSetMinute = makeGetSet('Minutes', false); - - // FORMATTING - - addFormatToken('s', ['ss', 2], 0, 'second'); - - // PARSING - - addRegexToken('s', match1to2, match1to2HasZero); - addRegexToken('ss', match1to2, match2); - addParseToken(['s', 'ss'], SECOND); - - // MOMENTS - - var getSetSecond = makeGetSet('Seconds', false); - - // FORMATTING - - addFormatToken('S', 0, 0, function () { - return ~~(this.millisecond() / 100); - }); - - addFormatToken(0, ['SS', 2], 0, function () { - return ~~(this.millisecond() / 10); - }); - - addFormatToken(0, ['SSS', 3], 0, 'millisecond'); - addFormatToken(0, ['SSSS', 4], 0, function () { - return this.millisecond() * 10; - }); - addFormatToken(0, ['SSSSS', 5], 0, function () { - return this.millisecond() * 100; - }); - addFormatToken(0, ['SSSSSS', 6], 0, function () { - return this.millisecond() * 1000; - }); - addFormatToken(0, ['SSSSSSS', 7], 0, function () { - return this.millisecond() * 10000; - }); - addFormatToken(0, ['SSSSSSSS', 8], 0, function () { - return this.millisecond() * 100000; - }); - addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { - return this.millisecond() * 1000000; - }); - - // PARSING - - addRegexToken('S', match1to3, match1); - addRegexToken('SS', match1to3, match2); - addRegexToken('SSS', match1to3, match3); - - var token, getSetMillisecond; - for (token = 'SSSS'; token.length <= 9; token += 'S') { - addRegexToken(token, matchUnsigned); - } - - function parseMs(input, array) { - array[MILLISECOND] = toInt(('0.' + input) * 1000); - } - - for (token = 'S'; token.length <= 9; token += 'S') { - addParseToken(token, parseMs); - } - - getSetMillisecond = makeGetSet('Milliseconds', false); - - // FORMATTING - - addFormatToken('z', 0, 0, 'zoneAbbr'); - addFormatToken('zz', 0, 0, 'zoneName'); - - // MOMENTS - - function getZoneAbbr() { - return this._isUTC ? 'UTC' : ''; - } - - function getZoneName() { - return this._isUTC ? 'Coordinated Universal Time' : ''; - } - - var proto = Moment.prototype; - - proto.add = add; - proto.calendar = calendar$1; - proto.clone = clone; - proto.diff = diff; - proto.endOf = endOf; - proto.format = format; - proto.from = from; - proto.fromNow = fromNow; - proto.to = to; - proto.toNow = toNow; - proto.get = stringGet; - proto.invalidAt = invalidAt; - proto.isAfter = isAfter; - proto.isBefore = isBefore; - proto.isBetween = isBetween; - proto.isSame = isSame; - proto.isSameOrAfter = isSameOrAfter; - proto.isSameOrBefore = isSameOrBefore; - proto.isValid = isValid$2; - proto.lang = lang; - proto.locale = locale; - proto.localeData = localeData; - proto.max = prototypeMax; - proto.min = prototypeMin; - proto.parsingFlags = parsingFlags; - proto.set = stringSet; - proto.startOf = startOf; - proto.subtract = subtract; - proto.toArray = toArray; - proto.toObject = toObject; - proto.toDate = toDate; - proto.toISOString = toISOString; - proto.inspect = inspect; - if (typeof Symbol !== 'undefined' && Symbol.for != null) { - proto[Symbol.for('nodejs.util.inspect.custom')] = function () { - return 'Moment<' + this.format() + '>'; - }; - } - proto.toJSON = toJSON; - proto.toString = toString; - proto.unix = unix; - proto.valueOf = valueOf; - proto.creationData = creationData; - proto.eraName = getEraName; - proto.eraNarrow = getEraNarrow; - proto.eraAbbr = getEraAbbr; - proto.eraYear = getEraYear; - proto.year = getSetYear; - proto.isLeapYear = getIsLeapYear; - proto.weekYear = getSetWeekYear; - proto.isoWeekYear = getSetISOWeekYear; - proto.quarter = proto.quarters = getSetQuarter; - proto.month = getSetMonth; - proto.daysInMonth = getDaysInMonth; - proto.week = proto.weeks = getSetWeek; - proto.isoWeek = proto.isoWeeks = getSetISOWeek; - proto.weeksInYear = getWeeksInYear; - proto.weeksInWeekYear = getWeeksInWeekYear; - proto.isoWeeksInYear = getISOWeeksInYear; - proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; - proto.date = getSetDayOfMonth; - proto.day = proto.days = getSetDayOfWeek; - proto.weekday = getSetLocaleDayOfWeek; - proto.isoWeekday = getSetISODayOfWeek; - proto.dayOfYear = getSetDayOfYear; - proto.hour = proto.hours = getSetHour; - proto.minute = proto.minutes = getSetMinute; - proto.second = proto.seconds = getSetSecond; - proto.millisecond = proto.milliseconds = getSetMillisecond; - proto.utcOffset = getSetOffset; - proto.utc = setOffsetToUTC; - proto.local = setOffsetToLocal; - proto.parseZone = setOffsetToParsedOffset; - proto.hasAlignedHourOffset = hasAlignedHourOffset; - proto.isDST = isDaylightSavingTime; - proto.isLocal = isLocal; - proto.isUtcOffset = isUtcOffset; - proto.isUtc = isUtc; - proto.isUTC = isUtc; - proto.zoneAbbr = getZoneAbbr; - proto.zoneName = getZoneName; - proto.dates = deprecate( - 'dates accessor is deprecated. Use date instead.', - getSetDayOfMonth - ); - proto.months = deprecate( - 'months accessor is deprecated. Use month instead', - getSetMonth - ); - proto.years = deprecate( - 'years accessor is deprecated. Use year instead', - getSetYear - ); - proto.zone = deprecate( - 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', - getSetZone - ); - proto.isDSTShifted = deprecate( - 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', - isDaylightSavingTimeShifted - ); - - function createUnix(input) { - return createLocal(input * 1000); - } - - function createInZone() { - return createLocal.apply(null, arguments).parseZone(); - } - - function preParsePostFormat(string) { - return string; - } - - var proto$1 = Locale.prototype; - - proto$1.calendar = calendar; - proto$1.longDateFormat = longDateFormat; - proto$1.invalidDate = invalidDate; - proto$1.ordinal = ordinal; - proto$1.preparse = preParsePostFormat; - proto$1.postformat = preParsePostFormat; - proto$1.relativeTime = relativeTime; - proto$1.pastFuture = pastFuture; - proto$1.set = set; - proto$1.eras = localeEras; - proto$1.erasParse = localeErasParse; - proto$1.erasConvertYear = localeErasConvertYear; - proto$1.erasAbbrRegex = erasAbbrRegex; - proto$1.erasNameRegex = erasNameRegex; - proto$1.erasNarrowRegex = erasNarrowRegex; - - proto$1.months = localeMonths; - proto$1.monthsShort = localeMonthsShort; - proto$1.monthsParse = localeMonthsParse; - proto$1.monthsRegex = monthsRegex; - proto$1.monthsShortRegex = monthsShortRegex; - proto$1.week = localeWeek; - proto$1.firstDayOfYear = localeFirstDayOfYear; - proto$1.firstDayOfWeek = localeFirstDayOfWeek; - - proto$1.weekdays = localeWeekdays; - proto$1.weekdaysMin = localeWeekdaysMin; - proto$1.weekdaysShort = localeWeekdaysShort; - proto$1.weekdaysParse = localeWeekdaysParse; - - proto$1.weekdaysRegex = weekdaysRegex; - proto$1.weekdaysShortRegex = weekdaysShortRegex; - proto$1.weekdaysMinRegex = weekdaysMinRegex; - - proto$1.isPM = localeIsPM; - proto$1.meridiem = localeMeridiem; - - function get$1(format, index, field, setter) { - var locale = getLocale(), - utc = createUTC().set(setter, index); - return locale[field](utc, format); - } - - function listMonthsImpl(format, index, field) { - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - - if (index != null) { - return get$1(format, index, field, 'month'); - } - - var i, - out = []; - for (i = 0; i < 12; i++) { - out[i] = get$1(format, i, field, 'month'); - } - return out; - } - - // () - // (5) - // (fmt, 5) - // (fmt) - // (true) - // (true, 5) - // (true, fmt, 5) - // (true, fmt) - function listWeekdaysImpl(localeSorted, format, index, field) { - if (typeof localeSorted === 'boolean') { - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - } else { - format = localeSorted; - index = format; - localeSorted = false; - - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - } - - var locale = getLocale(), - shift = localeSorted ? locale._week.dow : 0, - i, - out = []; - - if (index != null) { - return get$1(format, (index + shift) % 7, field, 'day'); - } - - for (i = 0; i < 7; i++) { - out[i] = get$1(format, (i + shift) % 7, field, 'day'); - } - return out; - } - - function listMonths(format, index) { - return listMonthsImpl(format, index, 'months'); - } - - function listMonthsShort(format, index) { - return listMonthsImpl(format, index, 'monthsShort'); - } - - function listWeekdays(localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); - } - - function listWeekdaysShort(localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); - } - - function listWeekdaysMin(localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); - } - - getSetGlobalLocale('en', { - eras: [ - { - since: '0001-01-01', - until: +Infinity, - offset: 1, - name: 'Anno Domini', - narrow: 'AD', - abbr: 'AD', - }, - { - since: '0000-12-31', - until: -Infinity, - offset: 1, - name: 'Before Christ', - narrow: 'BC', - abbr: 'BC', - }, - ], - dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, - ordinal: function (number) { - var b = number % 10, - output = - toInt((number % 100) / 10) === 1 - ? 'th' - : b === 1 - ? 'st' - : b === 2 - ? 'nd' - : b === 3 - ? 'rd' - : 'th'; - return number + output; - }, - }); - - // Side effect imports - - hooks.lang = deprecate( - 'moment.lang is deprecated. Use moment.locale instead.', - getSetGlobalLocale - ); - hooks.langData = deprecate( - 'moment.langData is deprecated. Use moment.localeData instead.', - getLocale - ); - - var mathAbs = Math.abs; - - function abs() { - var data = this._data; - - this._milliseconds = mathAbs(this._milliseconds); - this._days = mathAbs(this._days); - this._months = mathAbs(this._months); - - data.milliseconds = mathAbs(data.milliseconds); - data.seconds = mathAbs(data.seconds); - data.minutes = mathAbs(data.minutes); - data.hours = mathAbs(data.hours); - data.months = mathAbs(data.months); - data.years = mathAbs(data.years); - - return this; - } - - function addSubtract$1(duration, input, value, direction) { - var other = createDuration(input, value); - - duration._milliseconds += direction * other._milliseconds; - duration._days += direction * other._days; - duration._months += direction * other._months; - - return duration._bubble(); - } - - // supports only 2.0-style add(1, 's') or add(duration) - function add$1(input, value) { - return addSubtract$1(this, input, value, 1); - } - - // supports only 2.0-style subtract(1, 's') or subtract(duration) - function subtract$1(input, value) { - return addSubtract$1(this, input, value, -1); - } - - function absCeil(number) { - if (number < 0) { - return Math.floor(number); - } else { - return Math.ceil(number); - } - } - - function bubble() { - var milliseconds = this._milliseconds, - days = this._days, - months = this._months, - data = this._data, - seconds, - minutes, - hours, - years, - monthsFromDays; - - // if we have a mix of positive and negative values, bubble down first - // check: https://github.com/moment/moment/issues/2166 - if ( - !( - (milliseconds >= 0 && days >= 0 && months >= 0) || - (milliseconds <= 0 && days <= 0 && months <= 0) - ) - ) { - milliseconds += absCeil(monthsToDays(months) + days) * 864e5; - days = 0; - months = 0; - } - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absFloor(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absFloor(seconds / 60); - data.minutes = minutes % 60; - - hours = absFloor(minutes / 60); - data.hours = hours % 24; - - days += absFloor(hours / 24); - - // convert days to months - monthsFromDays = absFloor(daysToMonths(days)); - months += monthsFromDays; - days -= absCeil(monthsToDays(monthsFromDays)); - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - data.days = days; - data.months = months; - data.years = years; - - return this; - } - - function daysToMonths(days) { - // 400 years have 146097 days (taking into account leap year rules) - // 400 years have 12 months === 4800 - return (days * 4800) / 146097; - } - - function monthsToDays(months) { - // the reverse of daysToMonths - return (months * 146097) / 4800; - } - - function as(units) { - if (!this.isValid()) { - return NaN; - } - var days, - months, - milliseconds = this._milliseconds; - - units = normalizeUnits(units); - - if (units === 'month' || units === 'quarter' || units === 'year') { - days = this._days + milliseconds / 864e5; - months = this._months + daysToMonths(days); - switch (units) { - case 'month': - return months; - case 'quarter': - return months / 3; - case 'year': - return months / 12; - } - } else { - // handle milliseconds separately because of floating point math errors (issue #1867) - days = this._days + Math.round(monthsToDays(this._months)); - switch (units) { - case 'week': - return days / 7 + milliseconds / 6048e5; - case 'day': - return days + milliseconds / 864e5; - case 'hour': - return days * 24 + milliseconds / 36e5; - case 'minute': - return days * 1440 + milliseconds / 6e4; - case 'second': - return days * 86400 + milliseconds / 1000; - // Math.floor prevents floating point math errors here - case 'millisecond': - return Math.floor(days * 864e5) + milliseconds; - default: - throw new Error('Unknown unit ' + units); - } - } - } - - function makeAs(alias) { - return function () { - return this.as(alias); - }; - } - - var asMilliseconds = makeAs('ms'), - asSeconds = makeAs('s'), - asMinutes = makeAs('m'), - asHours = makeAs('h'), - asDays = makeAs('d'), - asWeeks = makeAs('w'), - asMonths = makeAs('M'), - asQuarters = makeAs('Q'), - asYears = makeAs('y'), - valueOf$1 = asMilliseconds; - - function clone$1() { - return createDuration(this); - } - - function get$2(units) { - units = normalizeUnits(units); - return this.isValid() ? this[units + 's']() : NaN; - } - - function makeGetter(name) { - return function () { - return this.isValid() ? this._data[name] : NaN; - }; - } - - var milliseconds = makeGetter('milliseconds'), - seconds = makeGetter('seconds'), - minutes = makeGetter('minutes'), - hours = makeGetter('hours'), - days = makeGetter('days'), - months = makeGetter('months'), - years = makeGetter('years'); - - function weeks() { - return absFloor(this.days() / 7); - } - - var round = Math.round, - thresholds = { - ss: 44, // a few seconds to seconds - s: 45, // seconds to minute - m: 45, // minutes to hour - h: 22, // hours to day - d: 26, // days to month/week - w: null, // weeks to month - M: 11, // months to year - }; - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { - return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { - var duration = createDuration(posNegDuration).abs(), - seconds = round(duration.as('s')), - minutes = round(duration.as('m')), - hours = round(duration.as('h')), - days = round(duration.as('d')), - months = round(duration.as('M')), - weeks = round(duration.as('w')), - years = round(duration.as('y')), - a = - (seconds <= thresholds.ss && ['s', seconds]) || - (seconds < thresholds.s && ['ss', seconds]) || - (minutes <= 1 && ['m']) || - (minutes < thresholds.m && ['mm', minutes]) || - (hours <= 1 && ['h']) || - (hours < thresholds.h && ['hh', hours]) || - (days <= 1 && ['d']) || - (days < thresholds.d && ['dd', days]); - - if (thresholds.w != null) { - a = - a || - (weeks <= 1 && ['w']) || - (weeks < thresholds.w && ['ww', weeks]); - } - a = a || - (months <= 1 && ['M']) || - (months < thresholds.M && ['MM', months]) || - (years <= 1 && ['y']) || ['yy', years]; - - a[2] = withoutSuffix; - a[3] = +posNegDuration > 0; - a[4] = locale; - return substituteTimeAgo.apply(null, a); - } - - // This function allows you to set the rounding function for relative time strings - function getSetRelativeTimeRounding(roundingFunction) { - if (roundingFunction === undefined) { - return round; - } - if (typeof roundingFunction === 'function') { - round = roundingFunction; - return true; - } - return false; - } - - // This function allows you to set a threshold for relative time strings - function getSetRelativeTimeThreshold(threshold, limit) { - if (thresholds[threshold] === undefined) { - return false; - } - if (limit === undefined) { - return thresholds[threshold]; - } - thresholds[threshold] = limit; - if (threshold === 's') { - thresholds.ss = limit - 1; - } - return true; - } - - function humanize(argWithSuffix, argThresholds) { - if (!this.isValid()) { - return this.localeData().invalidDate(); - } - - var withSuffix = false, - th = thresholds, - locale, - output; - - if (typeof argWithSuffix === 'object') { - argThresholds = argWithSuffix; - argWithSuffix = false; - } - if (typeof argWithSuffix === 'boolean') { - withSuffix = argWithSuffix; - } - if (typeof argThresholds === 'object') { - th = Object.assign({}, thresholds, argThresholds); - if (argThresholds.s != null && argThresholds.ss == null) { - th.ss = argThresholds.s - 1; - } - } - - locale = this.localeData(); - output = relativeTime$1(this, !withSuffix, th, locale); - - if (withSuffix) { - output = locale.pastFuture(+this, output); - } - - return locale.postformat(output); - } - - var abs$1 = Math.abs; - - function sign(x) { - return (x > 0) - (x < 0) || +x; - } - - function toISOString$1() { - // for ISO strings we do not use the normal bubbling rules: - // * milliseconds bubble up until they become hours - // * days do not bubble at all - // * months bubble up until they become years - // This is because there is no context-free conversion between hours and days - // (think of clock changes) - // and also not between days and months (28-31 days per month) - if (!this.isValid()) { - return this.localeData().invalidDate(); - } - - var seconds = abs$1(this._milliseconds) / 1000, - days = abs$1(this._days), - months = abs$1(this._months), - minutes, - hours, - years, - s, - total = this.asSeconds(), - totalSign, - ymSign, - daysSign, - hmsSign; - - if (!total) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - // 3600 seconds -> 60 minutes -> 1 hour - minutes = absFloor(seconds / 60); - hours = absFloor(minutes / 60); - seconds %= 60; - minutes %= 60; - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; - - totalSign = total < 0 ? '-' : ''; - ymSign = sign(this._months) !== sign(total) ? '-' : ''; - daysSign = sign(this._days) !== sign(total) ? '-' : ''; - hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; - - return ( - totalSign + - 'P' + - (years ? ymSign + years + 'Y' : '') + - (months ? ymSign + months + 'M' : '') + - (days ? daysSign + days + 'D' : '') + - (hours || minutes || seconds ? 'T' : '') + - (hours ? hmsSign + hours + 'H' : '') + - (minutes ? hmsSign + minutes + 'M' : '') + - (seconds ? hmsSign + s + 'S' : '') - ); - } - - var proto$2 = Duration.prototype; - - proto$2.isValid = isValid$1; - proto$2.abs = abs; - proto$2.add = add$1; - proto$2.subtract = subtract$1; - proto$2.as = as; - proto$2.asMilliseconds = asMilliseconds; - proto$2.asSeconds = asSeconds; - proto$2.asMinutes = asMinutes; - proto$2.asHours = asHours; - proto$2.asDays = asDays; - proto$2.asWeeks = asWeeks; - proto$2.asMonths = asMonths; - proto$2.asQuarters = asQuarters; - proto$2.asYears = asYears; - proto$2.valueOf = valueOf$1; - proto$2._bubble = bubble; - proto$2.clone = clone$1; - proto$2.get = get$2; - proto$2.milliseconds = milliseconds; - proto$2.seconds = seconds; - proto$2.minutes = minutes; - proto$2.hours = hours; - proto$2.days = days; - proto$2.weeks = weeks; - proto$2.months = months; - proto$2.years = years; - proto$2.humanize = humanize; - proto$2.toISOString = toISOString$1; - proto$2.toString = toISOString$1; - proto$2.toJSON = toISOString$1; - proto$2.locale = locale; - proto$2.localeData = localeData; - - proto$2.toIsoString = deprecate( - 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', - toISOString$1 - ); - proto$2.lang = lang; - - // FORMATTING - - addFormatToken('X', 0, 0, 'unix'); - addFormatToken('x', 0, 0, 'valueOf'); - - // PARSING - - addRegexToken('x', matchSigned); - addRegexToken('X', matchTimestamp); - addParseToken('X', function (input, array, config) { - config._d = new Date(parseFloat(input) * 1000); - }); - addParseToken('x', function (input, array, config) { - config._d = new Date(toInt(input)); - }); - - //! moment.js - - hooks.version = '2.30.1'; - - setHookCallback(createLocal); - - hooks.fn = proto; - hooks.min = min; - hooks.max = max; - hooks.now = now; - hooks.utc = createUTC; - hooks.unix = createUnix; - hooks.months = listMonths; - hooks.isDate = isDate; - hooks.locale = getSetGlobalLocale; - hooks.invalid = createInvalid; - hooks.duration = createDuration; - hooks.isMoment = isMoment; - hooks.weekdays = listWeekdays; - hooks.parseZone = createInZone; - hooks.localeData = getLocale; - hooks.isDuration = isDuration; - hooks.monthsShort = listMonthsShort; - hooks.weekdaysMin = listWeekdaysMin; - hooks.defineLocale = defineLocale; - hooks.updateLocale = updateLocale; - hooks.locales = listLocales; - hooks.weekdaysShort = listWeekdaysShort; - hooks.normalizeUnits = normalizeUnits; - hooks.relativeTimeRounding = getSetRelativeTimeRounding; - hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; - hooks.calendarFormat = getCalendarFormat; - hooks.prototype = proto; - - // currently HTML5 input type only supports 24-hour formats - hooks.HTML5_FMT = { - DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // - DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // - DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // - DATE: 'YYYY-MM-DD', // - TIME: 'HH:mm', // - TIME_SECONDS: 'HH:mm:ss', // - TIME_MS: 'HH:mm:ss.SSS', // - WEEK: 'GGGG-[W]WW', // - MONTH: 'YYYY-MM', // - }; - - return hooks; - - }))); -} (moment$1, moment$1.exports)); - -var momentExports = moment$1.exports; -var moment = /*@__PURE__*/getDefaultExportFromCjs(momentExports); - -function imageTagProcessor(app, noteFile, settings, defaultdir) { - const unique = Math.random().toString(16).slice(2); - function processImageTag(match, anchor, link, caption, imgsize) { - return __awaiter(this, void 0, void 0, function* () { - logError("processImageTag: " + match); - if (!isUrl(link)) { - return match; - } - try { - var lock = new AsyncLock(); - let fpath; - let fileData; - const opsys = process.platform; - const mediaDir = yield getMDir(app.app, noteFile, settings, defaultdir, unique); - yield app.ensureFolderExists(mediaDir); - const protocol = link.slice(0, 5); - if (protocol == "data:") { - logError("ReadBase64: \r\n" + fpath, false); - fileData = yield base64ToBuff(link); - } - else if (protocol == "file:") { - logError("Readlocal: \r\n" + fpath, false); - if (SUPPORTED_OS.win.includes(opsys)) { - fpath = link.replace("file:///", ""); - } - else if (SUPPORTED_OS.unix.includes(opsys)) { - fpath = link.replace("file://", ""); - } - else { - fpath = link.replace("file://", ""); - } - fileData = yield readFromDisk(fpath); - if (fileData === null) { - fileData = yield readFromDisk(decodeURI(fpath)); - } - } - else { - //Try to download several times - let trycount = 0; - while (trycount < settings.tryCount) { - fileData = yield downloadImage(link); - logError("\r\n\nDownloading (try): " + trycount + "\r\n\n"); - if (fileData !== null) { - break; - } - trycount++; - } - } - if (fileData === null) { - logError("Cannot get an attachment content!", false); - return null; - } - if (Math.round(fileData.byteLength / 1024) < settings.filesizeLimit) { - logError("Lower limit of the file size!", false); - return null; - } - try { - const { fileName, needWrite } = yield lock.acquire(match, function () { - return __awaiter(this, void 0, void 0, function* () { - const parsedUrl = new url.URL(link); - let fileExt = yield getFileExt(fileData, parsedUrl.pathname); - if (fileExt == "png" && settings.PngToJpeg) { - const blob = new Blob([new Uint8Array(fileData)]); - fileData = yield blobToJpegArrayBuffer(blob, settings.JpegQuality * 0.01); - logError("arbuf: "); - logError(fileData); - } - const { fileName, needWrite } = yield chooseFileName(app.app.vault.adapter, mediaDir, link, fileData, settings); - return { fileName, needWrite }; - }); - }); - if (needWrite && fileName) { - yield app.app.vault.createBinary(fileName, fileData); - } - if (fileName) { - let shortName = ""; - const rdir = yield getRDir(noteFile, settings, fileName, link); - let pathWiki = rdir[0]; - let pathMd = rdir[1]; - if (settings.addNameOfFile && protocol == "file:") { - if (!app.app.vault.getConfig("useMarkdownLinks")) { - shortName = "\r\n[[" + - fileName + - "\|" + - rdir[2]["lnkurid"] + "]]\r\n"; - } - else { - shortName = "\r\n[" + - rdir[2]["lnkurid"] + - "](" + - rdir[2]["pathuri"] + - ")\r\n"; - } - } - if (!app.app.vault.getConfig("useMarkdownLinks")) { - // image caption - (!settings.useCaptions || !caption.length) ? caption = "" : caption = "\|" + caption; - // image size has higher priority - (!settings.useCaptions || !imgsize.length) ? caption = "" : caption = "\|" + imgsize; - return [match, `![[${pathWiki}${caption}]]`, `${shortName}`]; - } - else { - (!settings.useCaptions || !caption.length) ? caption = "" : caption = " " + caption; - return [match, `![${anchor}](${pathMd}${caption})`, `${shortName}`]; - } - } - else { - return null; - } - } - catch (error) { - if (error.message === "File already exists.") { - } - else { - throw error; - } - } - return null; - } - catch (error) { - logError("Image processing failed: " + error, false); - return null; - } - }); - } - return processImageTag; -} -function getRDir(noteFile, settings, fileName, link = undefined) { - return __awaiter(this, void 0, void 0, function* () { - let pathWiki = ""; - let pathMd = ""; - const notePath = normalizePath(noteFile.parent.path); - const parsedPath = path__default["default"].parse(normalizePath(fileName)); - const parsedPathE = { - parentd: path__default["default"].basename(parsedPath["dir"]), - basen: (parsedPath["name"] + parsedPath["ext"]), - lnkurid: path__default["default"].basename(decodeURI(link)), - pathuri: encodeURI(normalizePath(fileName)) - }; - switch (settings.pathInTags) { - case "baseFileName": - pathWiki = pathMd = parsedPathE["basen"]; - break; - case "onlyRelative": - pathWiki = pathJoin([path__default["default"].relative(path__default["default"].sep + notePath, path__default["default"].sep + parsedPath["dir"]), parsedPathE["basen"]]); - pathMd = encodeURI(pathWiki); - break; - case "fullDirPath": - pathWiki = fileName.replace(/\\/g, "/"); - pathMd = parsedPathE["pathuri"]; - break; - default: - pathWiki = fileName; - pathMd = parsedPathE["pathuri"]; - } - return [pathWiki, pathMd, parsedPathE]; - }); -} -function getMDir(app, noteFile, settings, defaultdir = false, unique = "") { - return __awaiter(this, void 0, void 0, function* () { - noteFile.parent.path; - const current_date = moment().format(settings.DateFormat); - const obsmediadir = app.vault.getConfig("attachmentFolderPath"); - const mediadir = settings.mediaRootDir; - var attdir = settings.saveAttE; - if (defaultdir) { - attdir = ""; - } - let root = "/"; - switch (attdir) { - case 'inFolderBelow': - root = mediadir - .replace("${notename}", noteFile.basename) - .replace("${unique}", unique) - .replace("${date}", current_date); - break; - case 'nextToNoteS': - root = (pathJoin([noteFile.parent.path, mediadir])) - .replace("${notename}", noteFile.basename) - .replace("${unique}", unique) - .replace("${date}", current_date); - break; - default: - if (obsmediadir === '/') { - root = obsmediadir; - } - else if (obsmediadir === './') { - root = pathJoin([noteFile.parent.path]); - } - else if (obsmediadir.match(/\.\/.+/g) !== null) { - root = pathJoin([noteFile.parent.path, obsmediadir.replace('\.\/', '')]); - } - else { - root = normalizePath(obsmediadir); - } - } - return trimAny(root, ["/", "\\"]); - }); -} -function chooseFileName(adapter, dir, link, contentData, settings) { - return __awaiter(this, void 0, void 0, function* () { - const parsedUrl = new url.URL(link); - const ignoredExt = settings.ignoredExt.split("|"); - let fileExt = yield getFileExt(contentData, parsedUrl.pathname); - logError("file: " + link + " content: " + contentData + " file ext: " + fileExt, false); - if (fileExt == "unknown" && !settings.downUnknown) { - return { fileName: "", needWrite: false }; - } - if (ignoredExt.includes(fileExt)) { - return { fileName: "", needWrite: false }; - } - const baseName = md5Sig(contentData); - let needWrite = true; - let fileName = ""; - const suggestedName = pathJoin([dir, cleanFileName(`${baseName}` + `.${fileExt}`)]); - if (yield adapter.exists(suggestedName, false)) { - const fileData = yield adapter.readBinary(suggestedName); - const existing_file_md5 = md5Sig(fileData); - if (existing_file_md5 === baseName) { - fileName = suggestedName; - needWrite = false; - } - else { - fileName = pathJoin([dir, cleanFileName(Math.random().toString(9).slice(2) + `.${fileExt}`)]); - } - } - else { - fileName = suggestedName; - } - logError("File name: " + fileName, false); - if (!fileName) { - throw new Error("Failed to generate file name for media file."); - } - //linkHashes.ensureHashGenerated(link, contentData); - return { fileName, needWrite }; - }); -} - -// Queue that keep only unique values and counts attempts -class UniqueQueue { - constructor() { - this.queue = new Array(); - } - push(value, attempts) { - if (attempts < 1) { - console.error("Triyng to enqueue item with attempts < 1"); - return; - } - this.remove(value); - this.queue.push({ value, attempts }); - } - remove(value) { - this.queue = this.queue.filter((item) => item.value !== value); - } - iterationQueue() { - const extractIteration = (prev, curr) => { - prev.iteration.push(curr.value); - if (curr.attempts > 1) { - prev.queue.push(curr.value, curr.attempts - 1); - } - return prev; - }; - const { queue, iteration } = this.queue.reduce(extractIteration, { - queue: new UniqueQueue(), - iteration: [], - }); - this.queue = queue.queue; - return iteration; - } -} - -class ModalW1 extends obsidian.Modal { - constructor(app) { - super(app); - this.messg = ""; - this.callbackFunc = null; - } - onOpen() { - let { contentEl, titleEl } = this; - titleEl.setText(APP_TITLE); - contentEl.createDiv({ - text: this.messg - }); - contentEl.createEl("button", { - cls: ["mod-cta"], - text: "Cancel" - }).addEventListener("click", () => __awaiter(this, void 0, void 0, function* () { - this.close(); - })); - contentEl.createEl("button", { - cls: ["mod-cta"], - text: "Confirm" - }).addEventListener("click", () => __awaiter(this, void 0, void 0, function* () { - this.close(); - if (this.callbackFunc) { - this.callbackFunc(); - } - })); - } - onClose() { - let { contentEl } = this; - contentEl.empty(); - } -} - -require('fs').promises; -//import { count, log } from "console" -class LocalImagesPlugin extends obsidian.Plugin { - constructor() { - super(...arguments); - this.modifiedQueue = new UniqueQueue(); - this.intervalId = 0; - this.newfCreated = []; - this.noteModified = []; - this.newfMoveReq = true; - this.newfCreatedByDownloader = []; - // using arrow syntax for callbacks to correctly pass this context - this.processActivePage = (defaultdir = false) => () => __awaiter(this, void 0, void 0, function* () { - logError("processActivePage"); - try { - const activeFile = this.getCurrentNote(); - yield this.processPage(activeFile, defaultdir); - } - catch (e) { - showBalloon(`Please select a note or click inside selected note in canvas.`, this.settings.showNotifications); - return; - } - }); - this.processAllPages = () => __awaiter(this, void 0, void 0, function* () { - const files = this.app.vault.getMarkdownFiles(); - const pagesCount = files.length; - const notice = this.settings.showNotifications - ? new obsidian.Notice(APP_TITLE + `\nStart processing. Total ${pagesCount} pages. `, TIMEOUT_LIKE_INFINITY) - : null; - for (const [index, file] of files.entries()) { - if (this.ExemplaryOfMD(file.path)) { - if (notice) { - //setMessage() is undeclared but factically existing, so ignore the TS error //@ts-expect-error - notice.setMessage(APP_TITLE + `\nProcessing \n"${file.path}" \nPage ${index} of ${pagesCount}`); - } - yield this.processPage(file); - } - } - if (notice) { - // dum @ts-expect-error - notice.setMessage(APP_TITLE + `\n${pagesCount} pages were processed.`); - setTimeout(() => { - notice.hide(); - }, NOTICE_TIMEOUT); - } - }); - this.removeOrphans = (type = undefined, filesToRemove = undefined, noteFile = undefined) => () => __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c, _d, _e; - const obsmediadir = app.vault.getConfig("attachmentFolderPath"); - const allFiles = this.app.vault.getFiles(); - let oldRootdir = this.settings.mediaRootDir; - if (type == "plugin") { - let orphanedAttachments = []; - let allAttachmentsLinks = []; - if (this.settings.saveAttE != "nextToNoteS" || - !path__default["default"].basename(oldRootdir).endsWith("${notename}") || - oldRootdir.includes("${date}")) { - showBalloon("This command requires the settings 'Next to note in the folder specified below' and pattern '${notename}' at the end to be enabled, also the path cannot contain ${date} pattern.\nPlease, change settings first!\r\n", this.settings.showNotifications); - return; - } - if (!noteFile) { - noteFile = this.getCurrentNote(); - if (!noteFile) { - showBalloon("Please, select a note or click inside a note in canvas!", this.settings.showNotifications); - return; - } - } - if (this.ExemplaryOfMD(noteFile.path)) { - oldRootdir = oldRootdir.replace("${notename}", (_a = path__default["default"].parse(noteFile.path)) === null || _a === void 0 ? void 0 : _a.name); - oldRootdir = trimAny(pathJoin([(_b = path__default["default"].parse(noteFile.path)) === null || _b === void 0 ? void 0 : _b.dir, oldRootdir]), ["\/"]); - if (!(yield this.app.vault.exists(oldRootdir))) { - showBalloon("The attachment folder " + oldRootdir + " does not exist!", this.settings.showNotifications); - return; - } - const allAttachments = yield ((_c = this.app.vault.getAbstractFileByPath(oldRootdir)) === null || _c === void 0 ? void 0 : _c.children); - const metaCache = this.app.metadataCache.getFileCache(noteFile); - const embeds = metaCache === null || metaCache === void 0 ? void 0 : metaCache.embeds; - const links = metaCache === null || metaCache === void 0 ? void 0 : metaCache.links; - if (embeds) { - for (const embed of embeds) { - allAttachmentsLinks.push(path__default["default"].basename(embed.link)); - } - } - if (links) { - for (const link of links) { - allAttachmentsLinks.push(path__default["default"].basename(link.link)); - } - } - if (allAttachments) { - for (const attach of allAttachments) { - if (!allAttachmentsLinks.includes(attach.name) && attach.children == undefined) { - logError("orph: " + attach.basename); - orphanedAttachments.push(attach); - } - } - } - if (orphanedAttachments.length > 0) { - const mod = new ModalW1(this.app); - mod.messg = "Confirm remove " + orphanedAttachments.length + " orphan(s) from '" + oldRootdir + "'\r\n\r\n "; - mod.plugin = this; - mod.callbackFunc = this.removeOrphans("execremove", orphanedAttachments); - mod.open(); - } - else { - showBalloon("No orphaned files found!", this.settings.showNotifications); - } - } - } - if (type == "obsidian") { - if (obsmediadir.slice(0, 2) == "./" || obsmediadir == "/") { - showBalloon("This command cannot run on vault's root or on subfolder next to note!\nPlease, change settings first!\r\n", this.settings.showNotifications); - return; - } - const allAttachments = (_d = this.app.vault.getAbstractFileByPath(obsmediadir)) === null || _d === void 0 ? void 0 : _d.children; - let orphanedAttachments = []; - let allAttachmentsLinks = []; - if (allFiles) { - for (const file of allFiles) { - //Fix for canvas files - if (file !== null && this.ExemplaryOfCANVAS(file.path)) { - logError(file); - logError(this.app.metadataCache.getCache(file.path)); - let canvasData; - try { - canvasData = JSON.parse(yield app.vault.cachedRead(file)); - } - catch (e) { - logError("Parse canvas data error"); - continue; - } - if (canvasData.nodes && canvasData.nodes.length > 0) { - for (const node of canvasData.nodes) { - logError(node); - if (node.type === "file") { - logError("file json"); - allAttachmentsLinks.push(path__default["default"].basename(node.file)); - } - else if (node.type == "text") { - logError("text json"); - //https://github.com/Fevol/obsidian-typings - //Undocumented API may be altered in the future - const AllNodeLinks = (_e = (yield this.app.internalPlugins.plugins.canvas.instance.index.parseText(node.text))) === null || _e === void 0 ? void 0 : _e.links; - logError(AllNodeLinks); - if (AllNodeLinks === undefined) { - continue; - } - for (const Nodelink of AllNodeLinks) { - allAttachmentsLinks.push(path__default["default"].basename(Nodelink.link)); - } - } - } - } - } - if (file !== null && this.ExemplaryOfMD(file.path)) { - const metaCache = this.app.metadataCache.getCache(file.path); - const embeds = metaCache === null || metaCache === void 0 ? void 0 : metaCache.embeds; - const links = metaCache === null || metaCache === void 0 ? void 0 : metaCache.links; - logError(embeds); - logError(links); - if (embeds) { - for (const embed of embeds) { - allAttachmentsLinks.push(path__default["default"].basename(embed.link)); - } - } - if (links) { - for (const link of links) { - allAttachmentsLinks.push(path__default["default"].basename(link.link)); - } - } - } - } - for (const attach of allAttachments) { - if (!allAttachmentsLinks.includes(attach.name) && attach.children == undefined) { - logError(allAttachmentsLinks); - logError(attach.name); - logError("orph: " + attach.name); - orphanedAttachments.push(attach); - } - } - } - logError("Orphaned: "); - logError(orphanedAttachments, true); - if (orphanedAttachments.length > 0) { - const mod = new ModalW1(this.app); - mod.messg = "Confirm remove " + orphanedAttachments.length + " orphan(s) from '" + obsmediadir + " '\r\n \ - NOTE: Be careful when running this command on Obsidian attachments folder, since some html-linked files may also be moved.\r\n "; - mod.plugin = this; - mod.callbackFunc = this.removeOrphans("execremove", orphanedAttachments); - mod.open(); - } - else { - showBalloon("No orphaned files found!", this.settings.showNotifications); - } - } - if (type == "execremove") { - const useSysTrash = (this.app.vault.getConfig("trashOption") === "system"); - const remcompl = this.settings.removeOrphansCompl; - let msg = ""; - if (filesToRemove) { - filesToRemove.forEach((el) => { - if (remcompl) { - msg = "were deleted completely."; - this.app.vault.delete(el, true); - } - else { - if (useSysTrash) { - msg = "were moved to the system garbage can."; - } - else { - msg = "were moved to the Obsidian garbage can."; - } - this.app.vault.trash(el, useSysTrash); - } - }); - } - showBalloon(filesToRemove.length + " file(s) " + msg, this.settings.showNotifications); - } - }); - this.openProcessAllModal = () => { - const mod = new ModalW1(this.app); - mod.messg = "Confirm processing all pages.\r\n "; - mod.plugin = this; - mod.callbackFunc = this.processAllPages; - mod.open(); - }; - this.processMdFilesOnTimer = () => __awaiter(this, void 0, void 0, function* () { - var _f; - const th = this; - function onRet() { - th.newfCreated = []; - th.newfCreatedByDownloader = []; - th.noteModified = []; - th.newfMoveReq = false; - window.clearInterval(th.newfProcInt); - th.newfProcInt = 0; - } - logError("func processMdFilesOnTimer:\r\n"); - logError(this.noteModified, true); - try { - window.clearInterval(this.newfProcInt); - this.newfProcInt = 0; - this.newfMoveReq = false; - let itemcount = 0; - const useMdLinks = this.app.vault.getConfig("useMarkdownLinks"); - for (let note of this.noteModified) { - const metaCache = this.app.metadataCache.getFileCache(note); - let filedata = yield this.app.vault.cachedRead(note); - let pr = false; - for (const reg_p of MD_SEARCH_PATTERN) { - if (reg_p.test(filedata)) { - pr = true; - break; - } - } - const mdir = yield getMDir(this.app, note, this.settings); - const obsmdir = yield getMDir(this.app, note, this.settings, true); - let embeds = metaCache === null || metaCache === void 0 ? void 0 : metaCache.embeds; - if (obsmdir != "" && !(yield this.app.vault.adapter.exists(obsmdir))) { - if (!this.settings.DoNotCreateObsFolder) { - this.ensureFolderExists(obsmdir); - showBalloon("You obsidian media folder set to '" + obsmdir + "', and has been created by the plugin. Please, try again. ", this.settings.showNotifications); - onRet(); - } - return; - } - if (embeds || pr) { - yield this.ensureFolderExists(mdir); - for (let el of embeds) { - logError(el); - let oldpath = pathJoin([obsmdir, path__default["default"].basename(el.link)]); - let oldtag = el["original"]; - logError(useMdLinks); - logError(this.newfCreated); - if ((this.newfCreated.indexOf(el.link) != -1 || (obsmdir != "" && (this.newfCreated.includes(oldpath) || this.newfCreated.includes(el.link)))) && - !this.newfCreatedByDownloader.includes(oldtag)) { - if (!(yield this.app.vault.adapter.exists(oldpath))) { - logError("Cannot find " + el.link + " skipping..."); - continue; - } - let newpath = pathJoin([mdir, cFileName(path__default["default"].basename(el.link))]); - let newlink = yield getRDir(note, this.settings, newpath); - logError(el.link); - //let newBinData: Buffer | null = null - let newBinData = null; - let newMD5 = null; - const oldBinData = yield readFromDiskB(pathJoin([this.app.vault.adapter.basePath, oldpath]), 5000); - const oldMD5 = md5Sig(oldBinData); - const fileExt = yield getFileExt(oldBinData, oldpath); - logError("oldbindata: " + oldBinData); - logError("oldext: " + fileExt); - if (this.settings.PngToJpegLocal && fileExt == "png") { - logError("converting to Jpeg"); - const blob = new Blob([new Uint8Array(yield this.app.vault.adapter.readBinary(oldpath))]); - newBinData = yield blobToJpegArrayBuffer(blob, this.settings.JpegQuality * 0.01); - newMD5 = md5Sig(newBinData); - logError(newBinData); - if (newBinData != null) { - if (this.settings.useMD5ForNewAtt) { - newpath = pathJoin([mdir, newMD5 + ".jpeg"]); - } - else { - newpath = pathJoin([mdir, cFileName(((_f = path__default["default"].parse(el.link)) === null || _f === void 0 ? void 0 : _f.name) + ".jpeg")]); - } - newlink = yield getRDir(note, this.settings, newpath); - } - } - else if (this.settings.useMD5ForNewAtt) { - newpath = pathJoin([mdir, oldMD5 + path__default["default"].extname(el.link)]); - newlink = yield getRDir(note, this.settings, newpath); - } - else if (!this.settings.useMD5ForNewAtt) { - newpath = pathJoin([mdir, cFileName(path__default["default"].basename(el.link))]); - newlink = yield getRDir(note, this.settings, newpath); - } - if (yield this.app.vault.adapter.exists(newpath)) { - let newFMD5; - if (newBinData != null) { - newFMD5 = md5Sig(yield this.app.vault.adapter.readBinary(newpath)); - } - else { - newFMD5 = md5Sig(yield readFromDiskB(pathJoin([this.app.vault.adapter.basePath, newpath]), 5000)); - } - if (newMD5 === newFMD5 || (oldMD5 === newFMD5 && oldpath != newpath)) { - logError(path__default["default"].dirname(oldpath)); - logError("Deleting duplicate file: " + oldpath); - yield this.app.vault.adapter.remove(oldpath); - } - else if (oldpath != newpath) { - logError("Renaming existing: " + oldpath); - let inc = 1; - while (yield this.app.vault.adapter.exists(newpath)) { - newpath = pathJoin([mdir, `(${inc}) ` + cFileName(path__default["default"].basename(el.link))]); - inc++; - } - newlink = yield getRDir(note, this.settings, newpath); - yield this.app.vault.adapter.rename(oldpath, newpath); - } - } - else { - logError(`renaming ${oldpath} to ${newpath}`); - try { - if (newBinData != null) { - yield this.app.vault.adapter.writeBinary(newpath, newBinData).then(); - { - yield this.app.vault.adapter.remove(oldpath); - } - } - else { - yield this.app.vault.adapter.rename(oldpath, newpath); - } - } - catch (error) { - logError(error); - } - } - let addName = ""; - if (this.settings.addNameOfFile) { - if (useMdLinks) { - addName = `[Open: ${path__default["default"].basename(el.link)}](${newlink[1]})\r\n`; - } - else { - addName = `[[${newlink[0]}|Open: ${path__default["default"].basename(el.link)}]]\r\n`; - } - } - let newtag = addName + oldtag.replace(el.link, newlink[0]); - if (useMdLinks) { - newtag = addName + oldtag.replace(encObsURI(el.link), newlink[1]); - } - filedata = filedata.replaceAll(oldtag, newtag); - itemcount++; - } - } - } - if (itemcount > 0) { - yield this.app.vault.modify(note, filedata); - showBalloon(itemcount + " attachments for note " + note.path + " were processed.", this.settings.showNotifications); - itemcount = 0; - } - } - } - catch (e) { - logError(e); - onRet(); - } - onRet(); - }); - this.setTitleAsName = () => __awaiter(this, void 0, void 0, function* () { - try { - const noteFile = this.getCurrentNote(); - const fileData = yield this.app.vault.cachedRead(noteFile); - const title = fileData.match(/^#{1,6} .+?($|\n)/gm); - var ind = 0; - if (title !== null) { - const newName = cFileName(trimAny(title[0].toString(), ["#", " "])).slice(0, 200); - var fullPath = pathJoin([noteFile.parent.path, newName + ".md"]); - var fExist = yield this.app.vault.exists(fullPath); - if (trimAny(noteFile.path, ["\\", "/"]) != trimAny(fullPath, ["\\", "/"])) { - while (fExist) { - ind++; - var fullPath = pathJoin([noteFile.parent.path, newName + " (" + ind + ")" + ".md"]); - var fExist = yield this.app.vault.exists(fullPath); - } - yield this.app.vault.rename(noteFile, fullPath); - showBalloon(`The note was renamed to ` + fullPath, this.settings.showNotifications); - } - } - } - catch (e) { - showBalloon(`Cannot rename.`, this.settings.showNotifications); - return; - } - }); - this.convertSelToURI = () => __awaiter(this, void 0, void 0, function* () { - this.app.workspace.activeEditor.editor.replaceSelection(encObsURI(yield this.app.workspace.activeEditor.getSelection())); - }); - this.convertSelToMD = () => __awaiter(this, void 0, void 0, function* () { - this.app.workspace.activeEditor.editor.replaceSelection(obsidian.htmlToMarkdown(yield this.app.workspace.activeEditor.getSelection())); - }); - this.processModifiedQueue = () => __awaiter(this, void 0, void 0, function* () { - const iteration = this.modifiedQueue.iterationQueue(); - for (const page of iteration) { - this.processPage(page, false); - } - }); - } - onload() { - return __awaiter(this, void 0, void 0, function* () { - yield this.loadSettings(); - this.addCommand({ - id: "download-images", - name: "Localize attachments for the current note (plugin folder)", - callback: this.processActivePage(false), - }); - this.addCommand({ - id: "download-images-def", - name: "Localize attachments for the current note (Obsidian folder)", - callback: this.processActivePage(true), - }); - if (!this.settings.disAddCom) { - this.addRibbonIcon("dice", APP_TITLE + "\r\nLocalize attachments (plugin folder)", () => { - this.processActivePage(false)(); - }); - this.addCommand({ - id: "set-title-as-name", - name: "Set the first found # header as a note name.", - callback: this.setTitleAsName, - }); - this.addCommand({ - id: "download-images-all", - name: "Localize attachments for all your notes (plugin folder)", - callback: this.openProcessAllModal, - }); - this.addCommand({ - id: "convert-selection-to-URI", - name: "Convert selection to URI", - callback: this.convertSelToURI, - }); - this.addCommand({ - id: "convert-selection-to-md", - name: "Convert selection from html to markdown", - callback: this.convertSelToMD, - }); - this.addCommand({ - id: "remove-orphans-from-obsidian-folder", - name: "Remove all orphaned attachments (Obsidian folder)", - callback: () => { this.removeOrphans("obsidian")(); }, - }); - this.addCommand({ - id: "remove-orphans-from-plugin-folder", - name: "Remove all orphaned attachments (Plugin folder)", - callback: () => { this.removeOrphans("plugin")(); }, - }); - } - // Some file has been created - this.app.vault.on('create', (file) => __awaiter(this, void 0, void 0, function* () { - logError("New file created: " + file.path); - if (this.ExemplaryOfMD(file.path)) { - this.onMdCreateFunc(file); - } - else { - this.onFCreateFunc(file); - } - })); - // Some file has been deleted - this.app.vault.on('delete', (file) => __awaiter(this, void 0, void 0, function* () { - if (!file || - !(file instanceof obsidian.TFile) || - !(this.ExemplaryOfMD(file.path)) || - !this.settings.removeMediaFolder || - this.settings.saveAttE != "nextToNoteS") { - return; - } - let rootdir = this.settings.mediaRootDir; - const useSysTrash = (this.app.vault.getConfig("trashOption") === "system"); - if (this.settings.saveAttE !== "obsFolder" && - path__default["default"].basename(rootdir).includes("${notename}") && - !rootdir.includes("${date}")) { - rootdir = rootdir.replace("${notename}", file.basename); - if (this.settings.saveAttE == "nextToNoteS") { - rootdir = pathJoin([path__default["default"].dirname((file === null || file === void 0 ? void 0 : file.path) || ""), rootdir]); - } - try { - if (this.app.vault.getAbstractFileByPath(rootdir) instanceof obsidian.TFolder) { - this.app.vault.trash(app.vault.getAbstractFileByPath(rootdir), useSysTrash); - showBalloon("Attachment folder " + rootdir + " was moved to trash can.", this.settings.showNotifications); - } - } - catch (e) { - logError(e); - return; - } - } - })); - this.app.vault.on('rename', (file, oldPath) => __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - if (!file || - !(file instanceof obsidian.TFile) || - !(this.ExemplaryOfMD(file.path)) || - !this.settings.removeMediaFolder || - this.settings.saveAttE != "nextToNoteS" || - this.settings.pathInTags != "onlyRelative") { - return; - } - let oldRootdir = this.settings.mediaRootDir; - if (path__default["default"].basename(oldRootdir).includes("${notename}") && - !oldRootdir.includes("${date}")) { - oldRootdir = oldRootdir.replace("${notename}", (_a = path__default["default"].parse(oldPath)) === null || _a === void 0 ? void 0 : _a.name); - let newRootDir = oldRootdir.replace((_b = path__default["default"].parse(oldPath)) === null || _b === void 0 ? void 0 : _b.name, (_c = path__default["default"].parse(file.path)) === null || _c === void 0 ? void 0 : _c.name); - let newRootDir_ = newRootDir; - let oldRootdir_ = oldRootdir; - oldRootdir_ = pathJoin([(path__default["default"].dirname(oldPath) || ""), oldRootdir]); - newRootDir_ = pathJoin([(path__default["default"].dirname(file.path) || ""), newRootDir]); - try { - if (this.app.vault.getAbstractFileByPath(oldRootdir_) instanceof obsidian.TFolder) { - yield this.ensureFolderExists(path__default["default"].dirname(newRootDir_)); - //await this.app.fileManager.renameFile(app.vault.getAbstractFileByPath(oldRootdir),newRootDir) - yield this.app.vault.adapter.rename(oldRootdir_, newRootDir_); - showBalloon("Attachment folder was renamed to " + newRootDir_, this.settings.showNotifications); - } - } - catch (e) { - showBalloon("Cannot move attachment folder: \r\n" + e, this.settings.showNotifications); - logError(e); - return; - } - let content = yield this.app.vault.cachedRead(file); - content = content - .replaceAll("](" + encodeURI(oldRootdir), "](" + encodeURI(newRootDir)) - .replaceAll("[" + oldRootdir, "[" + newRootDir); - this.app.vault.modify(file, content); - } - })); - // Some file has been modified - this.app.vault.on('modify', (file) => __awaiter(this, void 0, void 0, function* () { - if (!this.newfMoveReq) - return; - logError("File modified: " + file.path, false); - if (!file || - !(file instanceof obsidian.TFile) || - !(this.ExemplaryOfMD(file.path))) { - return; - } - else { - if (this.settings.processAll) { - if (!this.noteModified.includes(file)) { - this.noteModified.push(file); - } - this.setupNewMdFilesProcInterval(); - } - } - })); - this.app.workspace.on("editor-paste", (evt, editor, info) => { - this.onPasteFunc(evt, editor, info); - }); - this.setupQueueInterval(); - this.addSettingTab(new SettingTab(this.app, this)); - }); - } - setupQueueInterval() { - if (this.intervalId) { - const intervalId = this.intervalId; - this.intervalId = 0; - window.clearInterval(intervalId); - } - if (this.settings.realTimeUpdate && - this.settings.realTimeUpdateInterval > 0) { - this.intervalId = window.setInterval(this.processModifiedQueue, this.settings.realTimeUpdateInterval * 1000); - this.registerInterval(this.intervalId); - } - } - getCurrentNote() { - try { - const noteFile = app.workspace.activeEditor.file; - return noteFile; - } - catch (e) { - showBalloon("Cannot get current note! ", this.settings.showNotifications); - } - return null; - } - processPage(file, defaultdir = false) { - return __awaiter(this, void 0, void 0, function* () { - if (file == null) { - return null; - } - const content = yield this.app.vault.cachedRead(file); - if (content.length == 0) { - return null; - } - const fixedContent = yield replaceAsync(content, MD_SEARCH_PATTERN, imageTagProcessor(this, file, this.settings, defaultdir)); - if (content != fixedContent[0] && fixedContent[1] === false) { - this.modifiedQueue.remove(file); - yield this.app.vault.modify(file, fixedContent[0]); - fixedContent[2].forEach((element) => { - this.newfCreatedByDownloader.push(element); - }); - showBalloon(`Attachments for "${file.path}" were processed.`, this.settings.showNotifications); - } - else if (content != fixedContent[0] && fixedContent[1] === true) { - this.modifiedQueue.remove(file); - yield this.app.vault.modify(file, fixedContent[0]); - fixedContent[2].forEach((element) => { - this.newfCreatedByDownloader.push(element); - }); - showBalloon(`WARNING!\r\nAttachments for "${file.path}" were processed, but some attachments were not downloaded/replaced...`, this.settings.showNotifications); - } - else { - if (this.settings.showNotifications) { - showBalloon(`Page "${file.path}" has been processed, but nothing was changed.`, this.settings.showNotifications); - } - } - }); - } - onPasteFunc(evt = undefined, editor = undefined, info = undefined) { - return __awaiter(this, void 0, void 0, function* () { - if (evt === undefined) { - return; - } - if (!this.settings.realTimeUpdate) { - return; - } - try { - const activeFile = this.getCurrentNote(); - const fItems = evt.clipboardData.files; - const tItems = evt.clipboardData.items; - if (fItems.length != 0) { - return; - } - for (const key in tItems) { - // Check if it was a text/html - if (tItems[key].kind == "string") { - if (this.settings.realTimeUpdate) { - const cont = obsidian.htmlToMarkdown(evt.clipboardData.getData("text/html")) + - obsidian.htmlToMarkdown(evt.clipboardData.getData("text")); - for (const reg_p of MD_SEARCH_PATTERN) { - if (reg_p.test(cont)) { - logError("content: " + cont); - showBalloon("Media links were found, processing...", this.settings.showNotifications); - this.enqueueActivePage(activeFile); - this.setupQueueInterval(); - break; - } - } - } - return; - } - } - } - catch (e) { - showBalloon(`Please select a note or click inside selected note in canvas.`, this.settings.showNotifications); - return; - } - }); - } - onMdCreateFunc(file) { - return __awaiter(this, void 0, void 0, function* () { - if (!file || - !(file instanceof obsidian.TFile) || - !(this.settings.processCreated) || - !this.ExemplaryOfMD(file.path)) - return; - const timeGapMs = Math.abs(Date.now() - file.stat.ctime); - if (timeGapMs > 1000) - return; - logError("func onMdCreateFunc: " + file.path); - logError(file, true); - var cont = yield this.app.vault.cachedRead(file); - logError(cont); - this.enqueueActivePage(file); - this.setupQueueInterval(); - this.setupNewMdFilesProcInterval(); - }); - } - onFCreateFunc(file) { - return __awaiter(this, void 0, void 0, function* () { - if (!file || - !(file instanceof obsidian.TFile) || - this.ExemplaryOfMD(file.path) || - this.ExemplaryOfCANVAS(file.path) || - !(this.settings.processAll)) - return; - if (!file.stat.ctime) - return; - const timeGapMs = Math.abs(Date.now() - file.stat.mtime); - if (timeGapMs > 1000) - return; - this.newfCreated.push(file.path); - this.newfMoveReq = true; - this.setupNewMdFilesProcInterval(); - logError("file created "); - }); - } - ExemplaryOfMD(pat) { - var _a, _b; - const includeRegex = new RegExp(this.settings.includepattern, "i"); - return (((_b = (_a = pat.match(includeRegex)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.md) != undefined); - } - ExemplaryOfCANVAS(pat) { - var _a, _b; - const includeRegex = new RegExp(this.settings.includepattern, "i"); - return (((_b = (_a = pat.match(includeRegex)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.canvas) != undefined); - } - setupNewMdFilesProcInterval() { - logError("func setupNewFilesProcInterval: \r\n"); - window.clearInterval(this.newfProcInt); - this.newfProcInt = 0; - this.newfProcInt = window.setInterval(this.processMdFilesOnTimer, this.settings.realTimeUpdateInterval * 1000); - this.registerInterval(this.newfProcInt); - } - enqueueActivePage(activeFile) { - this.modifiedQueue.push(activeFile, 1 //this.settings.realTim3AttemptsToProcess - ); - } - // ------------ Load / Save settings ----------------- - onunload() { - return __awaiter(this, void 0, void 0, function* () { - this.app.workspace.off("editor-drop", null); - this.app.workspace.off("editor-paste", null); - this.app.workspace.off('file-menu', null); - //this.app.vault.off("create", null) - logError(" unloaded."); - }); - } - loadSettings() { - return __awaiter(this, void 0, void 0, function* () { - this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); - this.setupQueueInterval(); - }); - } - saveSettings() { - return __awaiter(this, void 0, void 0, function* () { - try { - yield this.saveData(this.settings); - } - catch (error) { - displayError(error); - } - }); - } - ensureFolderExists(folderPath) { - return __awaiter(this, void 0, void 0, function* () { - try { - yield this.app.vault.createFolder(folderPath); - return; - } - catch (e) { - logError(e); - return; - } - }); - } -} - -module.exports = LocalImagesPlugin; - - -/* nosourcemap */ \ No newline at end of file diff --git a/content/notes/.obsidian/plugins/obsidian-local-images-plus/manifest.json b/content/notes/.obsidian/plugins/obsidian-local-images-plus/manifest.json deleted file mode 100644 index cfae28c..0000000 --- a/content/notes/.obsidian/plugins/obsidian-local-images-plus/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "obsidian-local-images-plus", - "name": "Local Images Plus", - "version": "0.16.3", - "minAppVersion": "1.0.3", - "description": "Local Images Plus plugin searches for all external media links in your notes, downloads and saves them locally and adjusts the links in your notes to point to the saved files.", - "author": "catalysm, aleksey-rezvov, Sergei Korneev", - "authorUrl": "https://github.com/Sergei-Korneev/obsidian-local-images-plus", - "fundingUrl": "https://www.buymeacoffee.com/sergeikorneev", - "isDesktopOnly": true -} diff --git a/content/notes/.obsidian/plugins/obsidian-local-images-plus/styles.css b/content/notes/.obsidian/plugins/obsidian-local-images-plus/styles.css deleted file mode 100644 index 0b77bfa..0000000 --- a/content/notes/.obsidian/plugins/obsidian-local-images-plus/styles.css +++ /dev/null @@ -1,14 +0,0 @@ -/* This file was created to satisfy requirements for Obsidian's plugins */ - -.title_txt{ - color:white; - align:center; -} - -.donheader_txt{ - text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue; - font-weight: 600; - color:red; - align:center; -} - diff --git a/content/notes/.obsidian/templates.json b/content/notes/.obsidian/templates.json new file mode 100644 index 0000000..1971e34 --- /dev/null +++ b/content/notes/.obsidian/templates.json @@ -0,0 +1,3 @@ +{ + "folder": "Templates" +} \ No newline at end of file diff --git a/content/notes/.obsidian/workspace.json b/content/notes/.obsidian/workspace.json index 064db33..b64ad90 100644 --- a/content/notes/.obsidian/workspace.json +++ b/content/notes/.obsidian/workspace.json @@ -8,17 +8,17 @@ "type": "tabs", "children": [ { - "id": "41d42d82984d27da", + "id": "560e779e6f4e85a3", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "Notion/Memory.md", + "file": "index/index.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "Memory" + "title": "index" } } ] @@ -185,21 +185,32 @@ "command-palette:Open command palette": false, "obsidian-importer:Open Importer": false, "table-editor-obsidian:Advanced Tables Toolbar": false, - "obsidian-local-images-plus:Local Images Plus 0.16.3\r\nLocalize attachments (plugin folder)": false + "obsidian-local-images-plus:Local Images Plus 0.16.3\r\nLocalize attachments (plugin folder)": false, + "homepage:Open homepage": false } }, - "active": "41d42d82984d27da", + "active": "560e779e6f4e85a3", "lastOpenFiles": [ - "Notion/CPU Architecture.md", + "binary-operations/index.md", + "index/index.md", + "transistors/index.md", + "notes/transistors.md", + "notes", + "Templates/base.md", + "Untitled.md", + "html.md", + "Templates", + "index", "Notion/Databases SQL.md", - "macOS.md", + "git.md", "Notion/Memory.md", + "Notion/CPU Architecture.md", + "macOS.md", "lua.md", "tmux/index.md", "Notion/Text Editor NVIM.md", "tmux/tmux_design.png", "tmux", - "transistors/index.md", "transistors/image4.png", "transistors/image3.png", "transistors/image2.png", @@ -207,11 +218,9 @@ "transistors", "assembly.md", "Notion/Untitled.md", - "binary-operations/index.md", "linux/index.md", "linux", "pass.md", - "git.md", "flask.md", "https-ssl-certs.md", "encryption.md", @@ -219,11 +228,6 @@ "python.md", "wsl2.md", "irc.md", - "c-language.md", - "Notion/CSS.md", - "ssh.md", - "html.md", - "compiling.md", "EXT2.png", "image 96.png", "image 95.png", @@ -232,8 +236,6 @@ "Notion2", "binary-operations", "algorithms-and-data", - "C language", - "temp", - "Notion" + "C language" ] } \ No newline at end of file diff --git a/content/notes/Templates/base.md b/content/notes/Templates/base.md new file mode 100644 index 0000000..1b92782 --- /dev/null +++ b/content/notes/Templates/base.md @@ -0,0 +1,10 @@ +--- +title: "{{Title}}" +description: +date: "{{date:YYYY-MM-DD}}T{{time:HH:mm:ss}}+00:00" +draft: true +tags: +author: TrudeEH +showToc: true +--- + diff --git a/content/notes/git.md b/content/notes/git.md index 7b2203e..d1d55e5 100644 --- a/content/notes/git.md +++ b/content/notes/git.md @@ -8,6 +8,7 @@ draft: false showToc: true title: Version Control [GIT] --- + Git is a version control system first developed by Linus Torvalds. It facilitates collaboration on large projects, keeps track of changes, and allows mistakes to be rolled back into a previous state. ## Configure Git diff --git a/content/notes/index/index.md b/content/notes/index/index.md new file mode 100644 index 0000000..bc4be6c --- /dev/null +++ b/content/notes/index/index.md @@ -0,0 +1,10 @@ +--- +tags: + - index +author: TrudeEH +draft: false +showToc: false +title: Notes Index +searchHidden: true +--- +TODO diff --git a/themes/.DS_Store b/themes/.DS_Store new file mode 100644 index 0000000..0ceee2c Binary files /dev/null and b/themes/.DS_Store differ