tiny-essentials
Version:
Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.
1 lines • 18.1 kB
JavaScript
(()=>{"use strict";var e={d:(n,o)=>{for(var a in o)e.o(o,a)&&!e.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:o[a]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)},n={};e.d(n,{UltraRandomMsgGen:()=>d});const o=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","sed","do","eiusmod","tempor","incididunt","ut","labore","et","dolore","magna","aliqua"],a=["😂","🌈","🤖","💥","🐸","🍕","🦄","🧠","🧬","🚀","🫠","💫","🍩","👾","🎉","🥴","🐙","🧃","🪐","🎈","🧸","👻","🥳","🍭","💖","😺","🌮","🪅","🎮","🥓","🍮"],t=["pudding","bean","snuggle","bloop","jelly","unicorn","floof","giggle","bubble","muffin","puff","pickle","goblin","waffle","sprinkle","cupcake","fizzle","marshmallow","duckling","sock","cloud","teacup","nugget","gnome","hug","moonbean","crayon","jiggle","glitter","carrot","goober"],r=["wiggles","bounces","flies","splats","scoots","giggles","wigglesnacks","twirls","boops","pops","sings","hugs","floats","glows","flaps","mlems","dances","puddles","nomnoms","wigglejumps","sniffs","tumbles","slides","chirps","burps","sparkles","waddles","rambles","blinks","mews"],i=["fluffy","silly","yummy","squishy","wobbly","magical","tiny","sleepy","wiggly","bubbly","glittery","fuzzy","jiggly","sparkly","giggly","crunchy","goofy","soft","mushy","sweet","loopy","floaty","bonkers","chewy","ticklish","dreamy","pastel","cozy","teensy","grumbly"],s=["Boop!","Wiggle achieved.","Oops, {noun} everywhere!","Tiny {adj} {noun}, big {adj} {noun}.","Snuggle initiated with a {adj} {noun}.","{adj} vibes only, powered by {noun}.","No {noun}, no {noun}.","Bounce first, {verb} later.","Mlem. {verb}. {noun}.","{noun} go brrr and {verb}.","Why not? {noun} did. Then {noun} followed.","A {adj} {noun} just {verb} near the {adj} window.","That {adj} {noun} stole my {noun}!","Look, a {adj} {noun} trying to {verb} again!","Every {noun} deserves a {adj} nap.","The {adj} {noun} is my {adj} spirit animal.","Someone call the {noun}, it’s {verb}ing and {verb}ing again!","Don’t touch the {adj} {noun}. It {verb}s loudly.","{noun} forgot how {noun}s work and just {verb}ed.","There once was a {adj} {noun} who loved to {verb} with a {adj} {noun} all day.","Apparently, {noun}s are banned from {verb}ing and {verb}ing in the {noun} library.","That {adj} noise? Just a {noun} learning to {verb} on a {adj} {noun}.","I saw a {adj} {noun} {verb} so hard, it became a {adj} muffin.","The {adj} {noun} met a {adj} pickle and everything {verb}ed.","{noun}s are like {noun}: {adj}, unpredictable, and wiggly.","Don’t judge a {adj} {noun} by its ability to {verb}, or by its {adj} hat.","All I wanted was peace, but a {adj} {noun} with a {adj} {noun} had other plans.","One {adj} morning, a {adj} {noun} decided it was finally time to {verb}, but halfway through, it tripped on a {noun} and turned into a {adj} marshmallow.","I tried to be {adj} today, but then a {noun} {verb}ed across my {noun} and typed “asdfgh{noun}” repeatedly.","If you think you’ve seen everything, wait until a {adj} {noun} {verb}s on a {noun} wearing {adj} socks with tiny {noun}s.","No one ever believed the stories about the ancient {adj} {noun} who could {verb} with such {adj} grace that entire {noun}s turned pink out of embarrassment.","A curious {adj} {noun} wandered into a {noun} shop, not knowing that its destiny involved twelve {adj} {noun}s, one rubber {noun}, and a suspiciously quiet {adj} llama.","In a land where every {adj} {noun} was made of pudding and the sky was {adj} whipped cream, one brave {adj} {noun} set out to discover the legendary Spoon of {noun}s, facing obstacles like bouncing {noun}s, sassy {noun}s, and the Great Wobble of the {noun}.","Once upon a {adj} time, long before the {noun}s learned to {verb}, there existed a tiny {adj} {noun} who dreamed of swimming in a pool made entirely of {adj} glitter pudding while {verb}ing off-key lullabies to passing {noun}s with monocles.","The Council of {noun}s gathered in {adj} secret when the sacred {adj} {noun} started to {verb} uncontrollably, threatening the entire {adj} dessert-based civilization with spontaneous {noun} jiggles and uncontainable {noun} fits across the {noun}.","Hey... do you ever wonder if {noun}s dream of {noun}s?","Okay but hear me out: what if the {adj} {noun} could actually {verb} backwards?","Can we talk about the {noun} that just {verb}ed and vanished?","So I was talking to a {noun}, and it told me to stop being {adj}. Rude.","Not to alarm you, but there’s a {adj} {noun} behind you doing the {verb}.","Why does this {noun} keep staring at me like I owe it pudding?","Is this a safe space to admit I accidentally {verb}ed a {noun}?","I just walked into the room and someone shouted “{adj} {noun}!” — what did I miss?","Wait... we were supposed to bring a {noun}? No one told me!","Okay but what if the {adj} {noun} has feelings too?","Be honest, do I look like a {noun} that forgot how to {verb}?",'If I say "oops", do I still have to explain why the {noun} is glowing?',"I don’t know what’s going on but I brought snacks and a confused {noun}.","Do you think pudding knows it’s pudding? Just a thought.","Is this about the time I {verb}ed the {adj} {noun} by accident? Because I can explain.","Wait, are we talking about {noun}s or am I on the wrong chat again?",'What is this group even about? I just saw "pudding" and joined.',"Hi! I have no idea what’s happening but I’m here and I brought a {noun}.","I blinked and now there’s a {adj} {noun} in charge of everything.","Can someone please explain why the {noun} is floating and chanting?","Okay who gave the {noun} access to glitter and emotional support pickles?","I came for a calm discussion and now there’s a {adj} battle between {noun}s.","Not sure if I’m early, late, or inside a {noun} dream.","I was gone for 3 minutes and now someone’s riding a {noun} into the pudding realm.","This isn’t the pudding appreciation group, is it? ...oh no.","So... who summoned the {adj} {noun} this time? Be honest.","I came here for vibes and stayed for the {noun}s.","Does anyone else hear faint giggling or is that just the {adj} {noun} again?","I feel like I missed step one, two, and also three of this conversation.","All I asked was “what’s up?” and now I’m emotionally attached to a {noun}.",'Me: "I’ll be normal today." Also me: *{verb}s into a meeting riding a {adj} {noun}*','"It’s just pudding," they said. "It can’t hurt you," they said. They were wrong.',"I said one nice thing to a {noun} and now it follows me everywhere.","Can we take a moment to appreciate how the {adj} {noun} is just vibing?","Who put a tiny hat on the {noun}? Because that’s adorable.","My life has been different ever since the {noun} started {verb}ing.","Raise your hand if you’ve ever been personally attacked by a {adj} {noun}.",'"Don’t be weird," they said. So I became a {noun} instead.',"Do {noun}s have feelings? Asking for a {adj} friend.","I trusted the {noun} and all I got was a glitter-covered sock.","Plot twist: the {adj} {noun} was inside us all along.","The {adj} {noun} {verb} and {verb} all over the {adj} {noun}!","Oops! {noun}s {verb}ed into the {adj} {noun} while {verb}ing crazily.","{adj}, {adj}, and more {adj} {noun}s just {verb}ed by!","Why does the {adj} {noun} keep {verb}ing and {verb}ing without stopping?","Look! A {adj} {noun}, a {adj} {noun}, and a {noun} all {verb}ing together!","Sometimes, the {noun} just {verb}s, then {verb}s again, and never stops being {adj}.","{noun}, {noun}, and {noun} — all {verb}ing and {verb}ing in a {adj} {noun}.","I saw a {adj} {noun} {verb}, then another {noun} {verb}ing with a {adj} {noun}.","The {noun} {verb}s {verb} while the {adj} {noun} {verb}s and the {noun} just {verb}s.","Can a {adj} {noun} {verb} {verb} without a {adj} {noun} watching?","Whoa! The {adj} {noun} just {verb}ed... and then {verb}ed again!","Hey... did you see that {adj} {noun} {verb} over there?","Umm, the {noun} is {verb}ing but also {verb}ing and {verb}ing!","Lol! {noun}s {verb} so {adj}ly, it’s impossible not to giggle.",'"Hey! What’s up?" asked the {adj} {noun}, who {verb}ed loudly.','"I’m just a {adj} {noun} trying to {verb}, you know?"','"Did you see the {adj} {noun} that just {verb}ed in the pudding?"','"No way! The {noun} {verb}s better than me!"','"Wait, the {adj} {noun} said it would {verb}, but it {verb}ed instead!"',"Once upon a {adj} {noun}, a group of {adj} {noun}s {verb}ed through the {adj} forest, singing {adj} songs and eating {noun}s made of pudding.","The legend tells of a {adj} {noun} who could {verb} faster than any {noun} ever seen, leaving trails of {adj} sparkles behind.","Every day, the {adj} {noun} would {verb} around the {adj} meadow, trying to convince the {noun}s to join the grand pudding party.","No one knows why the {adj} {noun} suddenly {verb}ed and then {verb}ed again, but everyone agrees it was the cutest thing they ever saw.","In the kingdom of {adj} {noun}s, only the bravest {noun} dared to {verb} the giant pudding monster, armed with nothing but {adj} smiles and jellybeans.","{adj} {noun} {verb} {verb} {verb} {noun} {verb} {adj} {noun} {verb} {noun}!","{noun} {noun} {verb} {adj} {noun} and then {verb} {verb} the {adj} {noun}.","{verb} the {adj} {noun}, then {verb} the {noun} while {verb}ing {adj}ly.","Can the {adj} {noun} {verb} and {verb} the {adj} {noun} at the same time?","{noun} {verb} {noun} {verb}, but the {adj} {noun} {verb}s better.","Boop! The {adj} {noun} just {verb}ed in the pudding.","Bloop bloop, the {noun} is {verb}ing all over again!","Mlem mlem, a {adj} {noun} {verb}s quietly in the corner.","Splat! {noun} {verb}ed right on the {adj} {noun}.","Yum! A {adj} {noun} just {verb}ed in my mouth.","Do {noun}s really {verb} when nobody’s watching?","Why does the {adj} {noun} always {verb} at midnight?","Can a {noun} be too {adj} to {verb} properly?","Is it normal for a {adj} {noun} to {verb} three times in a row?","Who taught the {noun} to {verb} like that?","Wait, did the {adj} {noun} just {verb} itself?","I can’t believe the {noun} {verb}ed into a {adj} {noun}!","Suddenly, a {adj} {noun} appeared and started to {verb} wildly.","That {noun} was {verb}ing so {adj}ly it broke the pudding meter.","Everyone’s talking about the {adj} {noun} that {verb}ed out of nowhere."],d=class{static defaultWords=o;static defaultEmojis=a;static defaultNouns=t;static defaultVerbs=r;static defaultAdjectives=i;static defaultTemplates=s;config={minLength:10,maxLength:300,readable:!0,useEmojis:!0,includeNumbers:!0,includeSymbols:!0,allowWeirdSpacing:!1,emojiSet:[],wordSet:[],mode:"mixed",grammar:{templates:[],nouns:[],verbs:[],adjectives:[]},repeatWords:!0,emojiPlacement:"inline",line:{minLength:20,maxLength:120,emojiChance:.3}};constructor(e={}){this.symbols="!@#$%^&*()-_=+[]{}|;:,.<>?/\\~".split("");const{minLength:n,maxLength:d,readable:u,useEmojis:h,includeNumbers:l,includeSymbols:g,allowWeirdSpacing:m,emojiSet:b,wordSet:c,mode:f,grammar:v,repeatWords:p,emojiPlacement:w,paragraphs:j,line:y}=e;if(void 0!==n&&(!Number.isInteger(n)||n<1))throw new TypeError("config.minLength must be an integer >= 1");if(void 0!==d&&(!Number.isInteger(d)||d<1))throw new TypeError("config.maxLength must be an integer >= 1");if(void 0!==n&&void 0!==d&&n>d)throw new RangeError("config.minLength cannot be greater than config.maxLength");if(void 0!==u&&"boolean"!=typeof u)throw new TypeError("config.readable must be a boolean");if(void 0!==h&&"boolean"!=typeof h)throw new TypeError("config.useEmojis must be a boolean");if(void 0!==l&&"boolean"!=typeof l)throw new TypeError("config.includeNumbers must be a boolean");if(void 0!==g&&"boolean"!=typeof g)throw new TypeError("config.includeSymbols must be a boolean");if(void 0!==m&&"boolean"!=typeof m)throw new TypeError("config.allowWeirdSpacing must be a boolean");if(void 0!==b&&!Array.isArray(b))throw new TypeError("config.emojiSet must be an array of strings");if(void 0!==c&&!Array.isArray(c))throw new TypeError("config.wordSet must be an array of strings");if(void 0!==f&&!["mixed","readable","chaotic","natural"].includes(f))throw new RangeError('config.mode must be one of: "mixed", "readable", "chaotic", "natural');if(void 0!==v){if("object"!=typeof v||null===v)throw new TypeError("config.grammar must be an object");const{templates:e,nouns:n,verbs:o,adjectives:a}=v;if(void 0!==e&&!Array.isArray(e))throw new TypeError("config.grammar.templates must be an array of strings");if(void 0!==n&&!Array.isArray(n))throw new TypeError("config.grammar.nouns must be an array of strings");if(void 0!==o&&!Array.isArray(o))throw new TypeError("config.grammar.verbs must be an array of strings");if(void 0!==a&&!Array.isArray(a))throw new TypeError("config.grammar.adjectives must be an array of strings")}if(void 0!==p&&"boolean"!=typeof p)throw new TypeError("config.repeatWords must be a boolean");if(void 0!==w&&!["inline","end","none"].includes(w))throw new RangeError('config.emojiPlacement must be one of: "inline", "end", "none"');if(void 0!==j){if("object"!=typeof j)throw new TypeError("config.paragraphs must be an object or null");const{min:e,max:n}=j;if(void 0!==e&&(!Number.isInteger(e)||e<1))throw new TypeError("config.paragraphs.min must be an integer >= 1");if(void 0!==n&&(!Number.isInteger(n)||n<1))throw new TypeError("config.paragraphs.max must be an integer >= 1");if(void 0!==e&&void 0!==n&&e>n)throw new RangeError("config.paragraphs.min cannot be greater than config.paragraphs.max")}if(void 0!==y){if("object"!=typeof y||null===y)throw new TypeError("config.line must be an object");const{minLength:e,maxLength:n,emojiChance:o}=y;if(void 0!==e&&(!Number.isInteger(e)||e<1))throw new TypeError("config.line.minLength must be an integer >= 1");if(void 0!==n&&(!Number.isInteger(n)||n<1))throw new TypeError("config.line.maxLength must be an integer >= 1");if(void 0!==e&&void 0!==n&&e>n)throw new RangeError("config.line.minLength cannot be greater than config.line.maxLength");if(void 0!==o&&("number"!=typeof o||o<0||o>1))throw new RangeError("config.line.emojiChance must be a number between 0 and 1")}this.config.emojiSet=[...a],this.config.wordSet=[...o],this.config.grammar.templates=[...s],this.config.grammar.nouns=[...t],this.config.grammar.verbs=[...r],this.config.grammar.adjectives=[...i],Object.assign(this.config,e)}configure(e={}){return Object.assign(this.config,e),this}setGrammarTemplates(...e){return this.config.grammar.templates=e.flat(),this}addGrammarTemplates(...e){return this.config.grammar.templates.push(...e.flat()),this}setGrammarNouns(...e){return this.config.grammar.nouns=e.flat(),this}addGrammarNouns(...e){return this.config.grammar.nouns.push(...e.flat()),this}setGrammarVerbs(...e){return this.config.grammar.verbs=e.flat(),this}addGrammarVerbs(...e){return this.config.grammar.verbs.push(...e.flat()),this}setGrammarAdjectives(...e){return this.config.grammar.adjectives=e.flat(),this}addGrammarAdjectives(...e){return this.config.grammar.adjectives.push(...e.flat()),this}removeGrammarTemplates(...e){const n=new Set(e.flat());return this.config.grammar.templates=this.config.grammar.templates.filter(e=>!n.has(e)),this}removeGrammarNouns(...e){const n=new Set(e.flat());return this.config.grammar.nouns=this.config.grammar.nouns.filter(e=>!n.has(e)),this}removeGrammarVerbs(...e){const n=new Set(e.flat());return this.config.grammar.verbs=this.config.grammar.verbs.filter(e=>!n.has(e)),this}removeGrammarAdjectives(...e){const n=new Set(e.flat());return this.config.grammar.adjectives=this.config.grammar.adjectives.filter(e=>!n.has(e)),this}setWords(...e){return this.config.wordSet=e.flat(),this}addWords(...e){return this.config.wordSet.push(...e.flat()),this}removeWords(...e){const n=new Set(e.flat());return this.config.wordSet=this.config.wordSet.filter(e=>!n.has(e)),this}setEmojis(...e){return this.config.emojiSet=e.flat(),this}addEmojis(...e){return this.config.emojiSet.push(...e.flat()),this}removeEmojis(...e){const n=new Set(e.flat());return this.config.emojiSet=this.config.emojiSet.filter(e=>!n.has(e)),this}_getRandomItem(e){return e[Math.floor(Math.random()*e.length)]}_generateChunk(){const{wordSet:e,emojiSet:n,includeNumbers:o,includeSymbols:a,useEmojis:t,readable:r,mode:i,emojiPlacement:s}=this.config;if("natural"===i)return this._generateNaturalSentence();const d=[];return(r||"readable"===i||"mixed"===i)&&d.push(this._getRandomItem(e)),"chaotic"!==i&&"mixed"!==i||d.push(Math.random().toString(36).slice(2)),o&&d.push(Math.floor(99999*Math.random()).toString()),a&&d.push(this._getRandomItem(this.symbols)),"inline"===s&&t&&n.length&&d.push(this._getRandomItem(n)),this._getRandomItem(d)}_generateNaturalSentence(){const{templates:e,nouns:n,verbs:o,adjectives:a}=this.config.grammar;return this._getRandomItem(e).replace(/{noun}/g,()=>this._getRandomItem(n)).replace(/{verb}/g,()=>this._getRandomItem(o)).replace(/{adj}/g,()=>this._getRandomItem(a))}_generateLine(e,n){const{allowWeirdSpacing:o,repeatWords:a,readable:t,emojiSet:r,useEmojis:i,emojiPlacement:s,line:d}=this.config,u=[];for(n??=new Set;u.join(" ").length<e;){let e=this._generateChunk();!a&&n.has(e)||(n.add(e),o&&(Math.random()<.1&&(e="\n"+e),Math.random()<.1&&(e=" "+e),Math.random()<.05&&(e=e.toUpperCase())),u.push(e))}let h=u.join(t?" ":"");return"end"===s&&i&&r.length&&Math.random()<(d?.emojiChance||0)&&(h+=" "+this._getRandomItem(r)),h}_generateParagraphLines(e){const{line:n}=this.config,o=[],a=new Set;let t=0;for(;t<e;){const r=Math.floor(Math.random()*(n.maxLength-n.minLength+1)+n.minLength),i=Math.min(r,e-t);o.push(this._generateLine(i,a)),t+=i}return o}generate(){const{minLength:e,maxLength:n,paragraphs:o}=this.config,a=Math.floor(Math.random()*(n-e+1))+e;if(o&&"object"==typeof o){const e=Math.floor(Math.random()*(o.max-o.min+1))+o.min,n=Math.floor(a/e),t=[];for(let o=0;o<e;o++){const e=this._generateParagraphLines(n);t.push(e.join("\n"))}return t.join("\n\n")}return this._generateParagraphLines(a).join("\n")}};window.UltraRandomMsgGen=n.UltraRandomMsgGen})();