(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a="undefined"==typeof globalThis?a||self:globalThis,a.Flag=b())})(this,function(){'use strict';function a(){}function b(a){return a&&"object"==typeof a&&"function"==typeof a.then}function c(a){return a()}function d(){return Object.create(null)}function e(a){a.forEach(c)}function f(a){return"function"==typeof a}function g(c,a){return c==c?c!==a||c&&"object"==typeof c||"function"==typeof c:a==a}function h(a,b){return Q||(Q=document.createElement("a")),Q.href=b,a===Q.href}function i(a){return 0===Object.keys(a).length}function j(a){return null==a?"":a}function k(a,b){a.appendChild(b)}function l(a,b,c){const d=m(a);if(!d.getElementById(b)){const a=q("style");a.id=b,a.textContent=c,n(d,a)}}function m(a){if(!a)return document;const b=a.getRootNode?a.getRootNode():a.ownerDocument;return b&&b.host?b:a.ownerDocument}function n(a,b){k(a.head||a,b)}function o(a,b,c){a.insertBefore(b,c||null)}function p(a){a.parentNode.removeChild(a)}function q(a){return document.createElement(a)}function r(a,b,c){null==c?a.removeAttribute(b):a.getAttribute(b)!==c&&a.setAttribute(b,c)}function s(a){return Array.from(a.childNodes)}function t(a){R=a}function u(){if(!R)throw new Error("Function called outside component initialization");return R}function v(){X||(X=!0,W.then(x))}function w(a){U.push(a)}function x(){if(!Y){Y=!0;do{// first, call beforeUpdate functions
// and update components
for(let a=0;a<S.length;a+=1){const b=S[a];t(b),y(b.$$)}for(t(null),S.length=0;T.length;)T.pop()();// then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for(let a=0;a<U.length;a+=1){const b=U[a];Z.has(b)||(Z.add(b),b())}U.length=0}while(S.length);for(;V.length;)V.pop()();X=!1,Y=!1,Z.clear()}}function y(a){if(null!==a.fragment){a.update(),e(a.before_update);const b=a.dirty;a.dirty=[-1],a.fragment&&a.fragment.p(a.ctx,b),a.after_update.forEach(w)}}function z(){_={r:0,c:[],p:_// parent group
}}function A(){_.r||e(_.c),_=_.p}function B(a,b){a&&a.i&&($.delete(a),a.i(b))}function C(a,b,c,d){if(a&&a.o){if($.has(a))return;$.add(a),_.c.push(()=>{$.delete(a),d&&(c&&a.d(1),d())}),a.o(b)}}function D(a,c){function d(a,b,d,f){if(c.token!==e)return;c.resolved=f;let g=c.ctx;d!==void 0&&(g=g.slice(),g[d]=f);const h=a&&(c.current=a)(g);let i=!1;c.block&&(c.blocks?c.blocks.forEach((a,d)=>{d!==b&&a&&(z(),C(a,1,1,()=>{c.blocks[d]===a&&(c.blocks[d]=null)}),A())}):c.block.d(1),h.c(),B(h,1),h.m(c.mount(),c.anchor),i=!0),c.block=h,c.blocks&&(c.blocks[b]=h),i&&x()}const e=c.token={};if(b(a)){const b=u();// if we previously had a then/catch block, destroy it
if(a.then(a=>{t(b),d(c.then,1,c.value,a),t(null)},a=>{if(t(b),d(c.catch,2,c.error,a),t(null),!c.hasCatch)throw a}),c.current!==c.pending)return d(c.pending,0),!0}else{if(c.current!==c.then)return d(c.then,1,c.value,a),!0;c.resolved=a}}function E(a,b,c){const d=b.slice(),{resolved:e}=a;a.current===a.then&&(d[a.value]=e),a.current===a.catch&&(d[a.error]=e),a.block.p(d,c)}function F(a,b,d,g){const{fragment:h,on_mount:i,on_destroy:j,after_update:k}=a.$$;h&&h.m(b,d),g||w(()=>{const b=i.map(c).filter(f);j?j.push(...b):e(b),a.$$.on_mount=[]}),k.forEach(w)}function G(a,b){const c=a.$$;null!==c.fragment&&(e(c.on_destroy),c.fragment&&c.fragment.d(b),c.on_destroy=c.fragment=null,c.ctx=[])}function H(a,b){-1===a.$$.dirty[0]&&(S.push(a),v(),a.$$.dirty.fill(0)),a.$$.dirty[0|b/31]|=1<<b%31}function I(b,c,f,g,h,i,j,k=[-1]){const l=R;t(b);const m=b.$$={fragment:null,ctx:null,// state
props:i,update:a,not_equal:h,bound:d(),// lifecycle
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:c.context||[]),// everything else
callbacks:d(),dirty:k,skip_bound:!1,root:c.target||l.$$.root};j&&j(m.root);let n=!1;if(m.ctx=f?f(b,c.props||{},(a,c,...d)=>{const e=d.length?d[0]:c;return m.ctx&&h(m.ctx[a],m.ctx[a]=e)&&(!m.skip_bound&&m.bound[a]&&m.bound[a](e),n&&H(b,a)),c}):[],m.update(),n=!0,e(m.before_update),m.fragment=!!g&&g(m.ctx),c.target){if(c.hydrate){const a=s(c.target);// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
m.fragment&&m.fragment.l(a),a.forEach(p)}else// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
m.fragment&&m.fragment.c();c.intro&&B(b.$$.fragment),F(b,c.target,c.anchor,c.customElement),x()}t(l)}/**
     * Base class for Svelte components. Used when dev=false.
     */function J(a){return new Promise(function(b,c){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(c.bind(null,new Error("Unknown variable dynamic import: "+a)))})}function K(a){l(a,"svelte-1rxzg3v",".flag.svelte-1rxzg3v.svelte-1rxzg3v{display:inline-block;overflow:hidden;position:relative;box-sizing:border-box;align-items:center}.flag.svelte-1rxzg3v img.svelte-1rxzg3v{display:block;width:100%;height:100%;object-fit:cover}.flag.size-s.svelte-1rxzg3v.svelte-1rxzg3v{width:16px;height:12px}.flag.size-s.drop-shadow.svelte-1rxzg3v.svelte-1rxzg3v{box-shadow:0 0 1px 0.5px rgba(0, 0, 0, 0.1)}.flag.size-s.border-radius.svelte-1rxzg3v.svelte-1rxzg3v{border-radius:1px}.flag.size-s.border-radius.border.svelte-1rxzg3v.svelte-1rxzg3v::before{border-radius:1px}.flag.size-m.svelte-1rxzg3v.svelte-1rxzg3v{width:20px;height:15px}.flag.size-m.drop-shadow.svelte-1rxzg3v.svelte-1rxzg3v{box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.1)}.flag.size-m.border-radius.svelte-1rxzg3v.svelte-1rxzg3v{border-radius:1.5px}.flag.size-m.border-radius.border.svelte-1rxzg3v.svelte-1rxzg3v::before{border-radius:1.5px}.flag.size-l.svelte-1rxzg3v.svelte-1rxzg3v{width:32px;height:24px}.flag.size-l.drop-shadow.svelte-1rxzg3v.svelte-1rxzg3v{box-shadow:0 2px 3px 0 rgba(0, 0, 0, 0.1)}.flag.size-l.border-radius.svelte-1rxzg3v.svelte-1rxzg3v{border-radius:2px}.flag.size-l.border-radius.border.svelte-1rxzg3v.svelte-1rxzg3v::before{border-radius:2px}.flag.border.svelte-1rxzg3v.svelte-1rxzg3v::before{content:'';width:100%;height:100%;position:absolute;display:block;mix-blend-mode:overlay;box-sizing:border-box;border:1px solid rgba(0, 0, 0, 0.5);mix-blend-mode:overlay}.flag.top-down.svelte-1rxzg3v.svelte-1rxzg3v::before{content:'';width:100%;height:100%;position:absolute;display:block;mix-blend-mode:overlay;box-sizing:border-box;background-image:linear-gradient(0deg, rgba(0, 0, 0, 0.3) 2%, rgba(255, 255, 255, 0.7) 100%)}.flag.real-linear.svelte-1rxzg3v.svelte-1rxzg3v::before{content:'';width:100%;height:100%;position:absolute;display:block;mix-blend-mode:overlay;box-sizing:border-box;background-image:linear-gradient(45deg, rgba(0, 0, 0, 0.2) 0%, rgba(39, 39, 39, 0.22) 11%, rgba(255, 255, 255, 0.3) 27%, rgba(0, 0, 0, 0.24) 41%, rgba(0, 0, 0, 0.55) 52%, rgba(255, 255, 255, 0.26) 63%, rgba(0, 0, 0, 0.27) 74%, rgba(255, 255, 255, 0.3) 100%)}.flag.real-circular.svelte-1rxzg3v.svelte-1rxzg3v::before{content:'';width:100%;height:100%;position:absolute;display:block;mix-blend-mode:overlay;box-sizing:border-box;background:radial-gradient(50% 36%, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0.24) 11%, rgba(0, 0, 0, 0.55) 17%, rgba(255, 255, 255, 0.26) 22%, rgba(0, 0, 0, 0.17) 27%, rgba(255, 255, 255, 0.28) 31%, rgba(255, 255, 255, 0) 37%) center calc(50% - 8px)/600% 600%, radial-gradient(50% 123%, rgba(255, 255, 255, 0.3) 25%, rgba(0, 0, 0, 0.24) 48%, rgba(0, 0, 0, 0.55) 61%, rgba(255, 255, 255, 0.26) 72%, rgba(0, 0, 0, 0.17) 80%, rgba(255, 255, 255, 0.28) 88%, rgba(255, 255, 255, 0.3) 100%) center calc(50% - 8px)/600% 600%}")}// (1:0) <script>   import { onMount }
function L(){return{c:a,m:a,p:a,d:a}}// (35:43)      <img src="{Flag}
function M(a){let b,c,d;return{c(){b=q("img"),h(b.src,c=/*Flag*/a[8])||r(b,"src",c),r(b,"alt",d=`Flag of ${/*code*/a[2]}`),r(b,"class","svelte-1rxzg3v")},m(a,c){o(a,b,c)},p(a,e){/*size, code*/5&e&&!h(b.src,c=/*Flag*/a[8])&&r(b,"src",c),/*code*/4&e&&d!==(d=`Flag of ${/*code*/a[2]}`)&&r(b,"alt",d)},d(a){a&&p(b)}}}// (1:0) <script>   import { onMount }
function N(){return{c:a,m:a,p:a,d:a}}function O(b){let c,d,e,f={ctx:b,current:null,token:null,hasCatch:!1,pending:N,then:M,catch:L,value:8};return D(d=/*importFlag*/b[7](/*size*/b[0],/*code*/b[2]),f),{c(){c=q("div"),f.block.c(),r(c,"class",e=""+(j(`
  flag
  ${/*gradient*/b[1]}
  size-${/*size*/b[0]}
  ${/*hasBorder*/b[3]?"border":""}
  ${/*hasDropShadow*/b[4]?"drop-shadow":""}
  ${/*hasBorderRadius*/b[5]?"border-radius":""}
  ${/*className*/b[6]?/*className*/b[6].replace(/\s\s+/g," ").trim():""}
`)+" svelte-1rxzg3v"))},m(a,b){o(a,c,b),f.block.m(c,f.anchor=null),f.mount=()=>c,f.anchor=null},p(a,[g]){if(b=a,f.ctx=b,/*size, code*/5&g&&d!==(d=/*importFlag*/b[7](/*size*/b[0],/*code*/b[2]))&&D(d,f));else E(f,b,g);/*gradient, size, hasBorder, hasDropShadow, hasBorderRadius, className*/123&g&&e!==(e=""+(j(`
  flag
  ${/*gradient*/b[1]}
  size-${/*size*/b[0]}
  ${/*hasBorder*/b[3]?"border":""}
  ${/*hasDropShadow*/b[4]?"drop-shadow":""}
  ${/*hasBorderRadius*/b[5]?"border-radius":""}
  ${/*className*/b[6]?/*className*/b[6].replace(/\s\s+/g," ").trim():""}
`)+" svelte-1rxzg3v"))&&r(c,"class",e)},i:a,o:a,d(a){a&&p(c),f.block.d(),f.token=null,f=null}}}function P(a,b,c){async function d(a,b){return J(`./dist/flags/${a}/${b}.svg`).then(a=>a.default)}let{code:e="NL"}=b,{size:f="m"}=b,{gradient:g=""}=b,{hasBorder:h=!0}=b,{hasDropShadow:i=!1}=b,{hasBorderRadius:j=!0}=b,{class:k}=b;const l=a=>a.toLowerCase();let m;return a.$$set=a=>{"code"in a&&c(2,e=a.code),"size"in a&&c(0,f=a.size),"gradient"in a&&c(1,g=a.gradient),"hasBorder"in a&&c(3,h=a.hasBorder),"hasDropShadow"in a&&c(4,i=a.hasDropShadow),"hasBorderRadius"in a&&c(5,j=a.hasBorderRadius),"class"in a&&c(6,k=a.class)},a.$$.update=()=>{/*gradient*/2&a.$$.dirty&&c(1,g=l(g)),/*size*/1&a.$$.dirty&&c(0,f=l(f))},[f,g,e,h,i,j,k,d,m]}let Q,R;const S=[],T=[],U=[],V=[],W=Promise.resolve();let X=!1,Y=!1;const Z=new Set,$=new Set;let _;class aa{$destroy(){G(this,1),this.$destroy=a}$on(a,b){const c=this.$$.callbacks[a]||(this.$$.callbacks[a]=[]);return c.push(b),()=>{const a=c.indexOf(b);-1!==a&&c.splice(a,1)}}$set(a){this.$$set&&!i(a)&&(this.$$.skip_bound=!0,this.$$set(a),this.$$.skip_bound=!1)}}return class extends aa{constructor(a){super(),I(this,a,P,O,g,{code:2,size:0,gradient:1,hasBorder:3,hasDropShadow:4,hasBorderRadius:5,class:6},K)}}});
