1?y(u,d):u,!1}var u,d})),!r})),r||(r=c),r==t&&(r=f?y(r,1):function(){return t.apply(this,arguments)}),r.convert=L(o,t),r.placeholder=t.placeholder=n,r}if(!o)return U(n,r,p);var F=r,B=[];return S(A,(function(e){S(rv.aryMethod[e],(function(e){var t=F[rv.remap[e]||e];t&&B.push([e,U(e,t,F)])}))})),S(O(F),(function(e){var t=F[e];if("function"==typeof t){for(var n=B.length;n--;)if(B[n][0]==e)return;t.convert=L(e,t),B.push([e,t])}})),S(B,(function(e){F[e[0]]=e[1]})),F.convert=function(e){return F.runInContext.convert(e)(void 0)},F.placeholder=F,S(O(F),(function(e){S(rv.realToAlias[e]||[],(function(t){F[t]=F[e]}))})),F}(cv,cv),dv={math:{abs:{args:["a"],numArgs:1,example:"{{ abs 12012.1000 }} -> 12012.1",description:"Return the magnitude of a
.
\n"},add:{args:["a","b"],numArgs:2,example:"{{ add 1 2 }} -> 3",description:"Return the sum of a
plus b
.
\n"},avg:{args:["array"],numArgs:1,example:"{{ avg [1,2,3,4,5] }} -> 3",description:"Returns the average of all numbers in the given array.
\n"},ceil:{args:["value"],numArgs:1,example:"{{ ceil 1.2 }} -> 2",description:"Get the Math.ceil()
of the given value.
\n"},divide:{args:["a","b"],numArgs:2,example:"{{ divide 10 5 }} -> 2",description:"Divide a
by b
\n"},floor:{args:["value"],numArgs:1,example:"{{ floor 1.2 }} -> 1",description:"Get the Math.floor()
of the given value.
\n"},minus:{args:["a","b"],numArgs:2,example:"{{ subtract 10 5 }} -> 5",description:"Return the product of a
minus b
.
\n"},modulo:{args:["a","b"],numArgs:2,example:"{{ modulo 10 5 }} -> 0",description:"Get the remainder of a division operation.
\n"},multiply:{args:["a","b"],numArgs:2,example:"{{ product 10 5 }} -> 50",description:"Return the product of a
times b
.
\n"},plus:{args:["a","b"],numArgs:2,example:"{{ plus 10 5 }} -> 15",description:"Add a
by b
.
\n"},random:{args:["min","max"],numArgs:2,example:"{{ random 0 20 }} -> 10",description:"Generate a random number between two values
\n"},remainder:{args:["a","b"],numArgs:2,example:"{{ remainder 10 6 }} -> 4",description:"Get the remainder when a
is divided by b
.
\n"},round:{args:["number"],numArgs:1,example:"{{ round 10.3 }} -> 10",description:"Round the given number.
\n"},subtract:{args:["a","b"],numArgs:2,example:"{{ subtract 10 5 }} -> 5",description:"Return the product of a
minus b
.
\n"},sum:{args:["array"],numArgs:1,example:"{{ sum [1, 2, 3] }} -> 6",description:"Returns the sum of all numbers in the given array.
\n"},times:{args:["a","b"],numArgs:2,example:"{{ times 10 5 }} -> 50",description:"Multiply number a
by number b
.
\n"}},array:{after:{args:["array","n"],numArgs:2,example:"{{ after [1, 2, 3] 1}} -> [3]",description:'Returns all of the items in an array after the specified index. Opposite of before.
\n'},arrayify:{args:["value"],numArgs:1,example:'{{ arrayify "foo" }} -> ["foo"]',description:"Cast the given value
to an array.
\n"},before:{args:["array","n"],numArgs:2,example:"{{ before [1, 2, 3] 2}} -> [1, 2]",description:'Return all of the items in the collection before the specified count. Opposite of after.
\n'},eachIndex:{args:["array","options"],numArgs:2,example:"{{#eachIndex [1, 2, 3]}} {{item}} is {{index}} {{/eachIndex}}",description:"Iterates the array, listing an item and the index of it.
\n"},filter:{args:["array","value","options"],numArgs:3,example:"{{#filter [1, 2, 3] 2}}2 Found{{else}}2 not found{{/filter}}",description:"Block helper that filters the given array and renders the block for values that evaluate to true
, otherwise the inverse block is returned.
\n"},first:{args:["array","n"],numArgs:2,example:"{{first [1, 2, 3, 4] 2}} -> [1, 2]",description:"Returns the first item, or first n
items of an array.
\n"},forEach:{args:["array"],numArgs:1,example:"{{#forEach [{ 'name': 'John' }] }} {{ name }} {{/forEach}}",description:"Iterates over each item in an array and exposes the current item in the array as context to the inner block. In addition to the current array item, the helper exposes the following variables to the inner block: - index
- total
- isFirst
- isLast
Also, @index
is exposed as a private variable, and additional private variables may be defined as hash arguments.
\n"},inArray:{args:["array","value","options"],numArgs:3,example:"{{#inArray [1, 2, 3] 2}} 2 exists {{else}} 2 does not exist {{/inArray}} -> 2 exists",description:"Block helper that renders the block if an array has the given value
. Optionally specify an inverse block to render when the array does not have the given value.
\n"},isArray:{args:["value"],numArgs:1,example:"{{isArray [1, 2]}} -> true",description:"Returns true if value
is an es5 array.
\n"},itemAt:{args:["array","idx"],numArgs:2,example:"{{itemAt [1, 2, 3] 1}} -> 2",description:"Returns the item from array
at index idx
.
\n"},join:{args:["array","separator"],numArgs:2,example:"{{join [1, 2, 3]}} -> '1, 2, 3'",description:"Join all elements of array into a string, optionally using a given separator.
\n"},equalsLength:{args:["value","length","options"],numArgs:3,example:"{{equalsLength [1, 2, 3] 3}} -> true",description:"Returns true if the the length of the given value
is equal to the given length
. Can be used as a block or inline helper.
\n"},last:{args:["value","n"],numArgs:2,example:"{{last [1, 2, 3]}} -> 3",description:'Returns the last item, or last n
items of an array or string. Opposite of first.
\n'},length:{args:["value"],numArgs:1,example:"{{length [1, 2, 3]}} -> 3",description:"Returns the length of the given string or array.
\n"},lengthEqual:{args:["value","length","options"],numArgs:3,example:"{{equalsLength [1, 2, 3] 3}} -> true",description:"Returns true if the the length of the given value
is equal to the given length
. Can be used as a block or inline helper.
\n"},map:{args:["array","fn"],numArgs:2,example:"{{map [1, 2, 3] double}} -> [2, 4, 6]",description:"Returns a new array, created by calling function
on each element of the given array
. For example,
\n"},pluck:{args:["collection","prop"],numArgs:2,example:"{{pluck [{ 'name': 'Bob' }] \"name\" }} -> ['Bob']",description:"Map over the given object or array or objects and create an array of values from the given prop
. Dot-notation may be used (as a string) to get nested properties.
\n"},reverse:{args:["value"],numArgs:1,example:"{{reverse [1, 2, 3]}} -> [3, 2, 1]",description:"Reverse the elements in an array, or the characters in a string.
\n"},some:{args:["array","iter","provided"],numArgs:3,example:"{{#some [1, 'b', 3] isString}} string found {{else}} No string found {{/some}} -> string found",description:"Block helper that returns the block if the callback returns true for some value in the given array.
\n"},sort:{args:["array","key"],numArgs:2,example:"{{ sort ['b', 'a', 'c'] }} -> ['a', 'b', 'c']",description:"Sort the given array
. If an array of objects is passed, you may optionally pass a key
to sort on as the second argument. You may alternatively pass a sorting function as the second argument.
\n"},sortBy:{args:["array","props"],numArgs:2,example:'{{ sortBy [{a: \'zzz\'}, {a: \'aaa\'}] "a" }} -> [{"a":"aaa"}, {"a":"zzz"}]',description:"Sort an array
. If an array of objects is passed, you may optionally pass a key
to sort on as the second argument. You may alternatively pass a sorting function as the second argument.
\n"},withAfter:{args:["array","idx","options"],numArgs:3,example:"{{ withAfter [1, 2, 3] 1 }} {{this}} {{/withAfter}}",description:'Use the items in the array after the specified index as context inside a block. Opposite of withBefore.
\n'},withBefore:{args:["array","idx","options"],numArgs:3,example:"{{ withBefore [1, 2, 3] 2 }} {{this}} {{/withBefore}}",description:'Use the items in the array before the specified index as context inside a block. Opposite of withAfter.
\n'},withFirst:{args:["array","idx","options"],numArgs:3,example:"{{ withFirst [1, 2, 3] }} {{this}} {{/withFirst}}",description:'Use the first item in a collection inside a handlebars block expression. Opposite of withLast.
\n'},withGroup:{args:["array","size","options"],numArgs:3,example:"{{#withGroup [1, 2, 3, 4] 2}} {{#each this}} {{.}} {{each}}
{{/withGroup}} -> 1,2
3,4
",description:"Block helper that groups array elements by given group size
.
\n"},withLast:{args:["array","idx","options"],numArgs:3,example:"{{#withLast [1, 2, 3, 4]}} {{this}} {{/withLast}} -> 4",description:'Use the last item or n
items in an array as context inside a block. Opposite of withFirst.
\n'},withSort:{args:["array","prop","options"],numArgs:3,example:"{{#withSort ['b', 'a', 'c']}} {{this}} {{/withSort}} -> abc",description:"Block helper that sorts a collection and exposes the sorted collection as context inside the block.
\n"},unique:{args:["array","options"],numArgs:2,example:"{{#each (unique ['a', 'a', 'c', 'b', 'e', 'e']) }} {{.}} {{/each}} -> acbe",description:'Block helper that return an array with all duplicate values removed. Best used along with a each helper.
\n'}},number:{bytes:{args:["number"],numArgs:1,example:"{{ bytes 1386 }} -> 1.4Kb",description:"Format a number to it's equivalent in bytes. If a string is passed, it's length will be formatted and returned. Examples: - 'foo' => 3 B
- 13661855 => 13.66 MB
- 825399 => 825.39 kB
- 1396 => 1.4 kB
\n"},addCommas:{args:["num"],numArgs:1,example:"{{ addCommas 1000000 }} -> 1,000,000",description:"Add commas to numbers
\n"},phoneNumber:{args:["num"],numArgs:1,example:"{{ phoneNumber 8005551212 }} -> (800) 555-1212",description:"Convert a string or number to a formatted phone number.
\n"},toAbbr:{args:["number","precision"],numArgs:2,example:"{{ toAbbr 10123 2 }} -> 10.12k",description:"Abbreviate numbers to the given number of precision
. This for general numbers, not size in bytes.
\n"},toExponential:{args:["number","fractionDigits"],numArgs:2,example:"{{ toExponential 10123 2 }} -> 101e+4",description:"Returns a string representing the given number in exponential notation.
\n"},toFixed:{args:["number","digits"],numArgs:2,example:"{{ toFixed 1.1234 2 }} -> 1.12",description:"Formats the given number using fixed-point notation.
\n"},toFloat:{args:["number"],numArgs:1,description:"Convert input to a float.
\n"},toInt:{args:["number"],numArgs:1,description:"Convert input to an integer.
\n"},toPrecision:{args:["number","precision"],numArgs:2,example:'{{toPrecision "1.1234" 2}}',description:"Returns a string representing the Number
object to the specified precision.
\n"}},url:{encodeURI:{args:["str"],numArgs:1,example:'{{ encodeURI "https://myurl?Hello There" }} -> https://myurl?Hello%20There',description:"Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.
\n"},escape:{args:["str"],numArgs:1,example:'{{ escape "https://myurl?Hello+There" }} -> https://myurl?Hello%20There',description:"Escape the given string by replacing characters with escape sequences. Useful for allowing the string to be used in a URL, etc.
\n"},decodeURI:{args:["str"],numArgs:1,example:'{{ escape "https://myurl?Hello%20There" }} -> https://myurl?Hello+There',description:"Decode a Uniform Resource Identifier (URI) component.
\n"},url_encode:{args:[],numArgs:0,description:'Alias for encodeURI.
\n'},url_decode:{args:[],numArgs:0,description:'Alias for decodeURI.
\n'},urlResolve:{args:["base","href"],numArgs:2,example:'{{ urlResolve "https://myurl" "/api/test" }} -> https://myurl/api/test',description:"Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.
\n"},urlParse:{args:["str"],numArgs:1,example:'{{ urlParse "https://myurl/api/test" }}',description:"Parses a url
string into an object.
\n"},stripQuerystring:{args:["url"],numArgs:1,example:'{{ stripQueryString "https://myurl/api/test?foo=bar" }} -> "https://myurl/api/test"',description:"Strip the query string from the given url
.
\n"},stripProtocol:{args:["str"],numArgs:1,example:'{{ stripProtocol "https://myurl/api/test" }} -> "myurl/api/test"',description:"Strip protocol from a url
. Useful for displaying media that may have an 'http' protocol on secure connections.
\n"}},string:{append:{args:["str","suffix"],numArgs:2,example:'{{append "index" ".html"}} -> index.html',description:"Append the specified suffix
to the given string.
\n"},camelcase:{args:["string"],numArgs:1,example:'{{camelcase "foo bar baz"}} -> fooBarBaz',description:"camelCase the characters in the given string
.
\n"},capitalize:{args:["str"],numArgs:1,example:'{{capitalize "foo bar baz"}} -> Foo bar baz',description:"Capitalize the first word in a sentence.
\n"},capitalizeAll:{args:["str"],numArgs:1,example:'{{ capitalizeAll "foo bar baz"}} -> Foo Bar Baz',description:"Capitalize all words in a string.
\n"},center:{args:["str","spaces"],numArgs:2,example:'{{ center "test" 1}} -> " test "',description:"Center a string using non-breaking spaces
\n"},chop:{args:["string"],numArgs:1,example:'{{ chop " ABC "}} -> "ABC"',description:"Like trim, but removes both extraneous whitespace and non-word characters from the beginning and end of a string.
\n"},dashcase:{args:["string"],numArgs:1,example:'{{dashcase "a-b-c d_e"}} -> a-b-c-d-e',description:"dash-case the characters in string
. Replaces non-word characters and periods with hyphens.
\n"},dotcase:{args:["string"],numArgs:1,example:'{{dotcase "a-b-c d_e"}} -> a.b.c.d.e',description:"dot.case the characters in string
.
\n"},downcase:{args:["string"],numArgs:1,example:'{{downcase "aBcDeF"}} -> abcdef',description:'Lowercase all of the characters in the given string. Alias for lowercase.
\n'},ellipsis:{args:["str","length"],numArgs:2,example:'{{ellipsis "foo bar baz", 7}} -> foo bar…',description:"Truncates a string to the specified length
, and appends it with an elipsis, …
.
\n"},hyphenate:{args:["str"],numArgs:1,example:'{{hyphenate "foo bar baz qux"}} -> foo-bar-baz-qux',description:"Replace spaces in a string with hyphens.
\n"},isString:{args:["value"],numArgs:1,example:'{{isString "foo"}} -> true',description:"Return true if value
is a string.
\n"},lowercase:{args:["str"],numArgs:1,example:'{{lowercase "Foo BAR baZ"}} -> foo bar baz',description:"Lowercase all characters in the given string.
\n"},occurrences:{args:["str","substring"],numArgs:2,example:'{{occurrences "foo bar foo bar baz" "foo"}} -> 2',description:"Return the number of occurrences of substring
within the given string
.
\n"},pascalcase:{args:["string"],numArgs:1,example:'{{pascalcase "foo bar baz"}} -> FooBarBaz',description:"PascalCase the characters in string
.
\n"},pathcase:{args:["string"],numArgs:1,example:'{{pathcase "a-b-c d_e"}} -> a/b/c/d/e',description:"path/case the characters in string
.
\n"},plusify:{args:["str"],numArgs:1,example:'{{plusify "foo bar baz"}} -> foo+bar+baz',description:"Replace spaces in the given string with pluses.
\n"},prepend:{args:["str","prefix"],numArgs:2,example:'{{prepend "bar" "foo-"}} -> foo-bar',description:"Prepends the given string
with the specified prefix
.
\n"},raw:{args:["options"],numArgs:1,example:"{{{{#raw}}}} {{foo}} {{{{/raw}}}} -> {{foo}}",description:"Render a block without processing mustache templates inside the block.
\n"},remove:{args:["str","substring"],numArgs:2,example:'{{remove "a b a b a b" "a "}} -> b b b',description:"Remove all occurrences of substring
from the given str
.
\n"},removeFirst:{args:["str","substring"],numArgs:2,example:'{{remove "a b a b a b" "a"}} -> b a b a b',description:"Remove the first occurrence of substring
from the given str
.
\n"},replace:{args:["str","a","b"],numArgs:3,example:'{{replace "a b a b a b" "a" "z"}} -> z b z b z b',description:"Replace all occurrences of substring a
with substring b
.
\n"},replaceFirst:{args:["str","a","b"],numArgs:3,example:'{{replace "a b a b a b" "a" "z"}} -> z b a b a b',description:"Replace the first occurrence of substring a
with substring b
.
\n"},sentence:{args:["str"],numArgs:1,example:'{{sentence "hello world. goodbye world."}} -> Hello world. Goodbye world.',description:"Sentence case the given string
\n"},snakecase:{args:["string"],numArgs:1,example:'{{snakecase "a-b-c d_e"}} -> a_b_c_d_e',description:"snake_case the characters in the given string
.
\n"},split:{args:["string"],numArgs:1,example:"{{split \"a,b,c\"}} -> ['a', 'b', 'c']",description:"Split string
by the given character
.
\n"},startsWith:{args:["prefix","testString","options"],numArgs:3,example:'{{#startsWith "Goodbye" "Hello, world!"}} Yep {{else}} Nope {{/startsWith}} -> Nope',description:"Tests whether a string begins with the given prefix.
\n"},titleize:{args:["str"],numArgs:1,example:'{{#titleize "this is title case" }} -> This Is Title Case',description:"Title case the given string.
\n"},trim:{args:["string"],numArgs:1,example:'{{trim " ABC " }} -> ABC',description:"Removes extraneous whitespace from the beginning and end of a string.
\n"},trimLeft:{args:["string"],numArgs:1,example:'{{trimLeft " ABC " }} -> "ABC "',description:"Removes extraneous whitespace from the beginning of a string.
\n"},trimRight:{args:["string"],numArgs:1,example:'{{trimRight " ABC " }} -> " ABC "',description:"Removes extraneous whitespace from the end of a string.
\n"},truncate:{args:["str","limit","suffix"],numArgs:3,example:'{{truncate "foo bar baz" 7 }} -> foo bar',description:'Truncate a string to the specified length
. Also see ellipsis.
\n'},truncateWords:{args:["str","limit","suffix"],numArgs:3,example:'{{truncateWords "foo bar baz" 1 }} -> foo',description:'Truncate a string to have the specified number of words. Also see truncate.
\n'},upcase:{args:["string"],numArgs:1,example:'{{upcase "aBcDef"}} -> ABCDEF',description:'Uppercase all of the characters in the given string. Alias for uppercase.
\n'},uppercase:{args:["str","options"],numArgs:2,example:'{{uppercase "aBcDef"}} -> ABCDEF',description:"Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.
\n"}},comparison:{and:{args:["a","b","options"],numArgs:3,example:"{{#and great magnificent}}both{{else}}no{{/and}}",description:"Helper that renders the block if both of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.
\n"},compare:{args:["a","operator","b","options"],numArgs:4,example:'{{compare 10 "<" 5 }} -> true',description:"Render a block when a comparison of the first and third arguments returns true. The second argument is the [arithemetic operator][operators] to use. You may also optionally specify an inverse block to render when falsy.
\n"},contains:{args:["collection","value","[startIndex=0]","options"],numArgs:4,example:"{{#contains ['a', 'b', 'c'] \"d\"}} This will not be rendered. {{else}} This will be rendered. {{/contains}}",description:"Block helper that renders the block if collection
has the given value
, using strict equality (===
) for comparison, otherwise the inverse block is rendered (if specified). If a startIndex
is specified and is negative, it is used as the offset from the end of the collection.
\n"},default:{args:["value","defaultValue"],numArgs:2,example:'{{default null null "default"}} -> default',description:"Returns the first value that is not undefined, otherwise the "default" value is returned.
\n"},eq:{args:["a","b","options"],numArgs:3,example:"{{#eq 3 3}} equal{{else}} not equal{{/eq}} -> equal",description:"Block helper that renders a block if a
is equal to b
. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare=""
hash argument for the second value.
\n"},gt:{args:["a","b","options"],numArgs:3,example:"{{#gt 4 3}} greater than{{else}} not greater than{{/gt}} -> greater than",description:"Block helper that renders a block if a
is greater than b
. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare=""
hash argument for the second value.
\n"},gte:{args:["a","b","options"],numArgs:3,example:"{{#gte 4 3}} greater than or equal{{else}} not greater than{{/gte}} -> greater than or equal",description:"Block helper that renders a block if a
is greater than or equal to b
. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare=""
hash argument for the second value.
\n"},has:{args:["val","pattern","options"],numArgs:3,example:'{{#has "foobar" "foo"}} has it{{else}} doesn\'t{{/has}} -> has it',description:"Block helper that renders a block if value
has pattern
. If an inverse block is specified it will be rendered when falsy.
\n"},isFalsey:{args:["val","options"],numArgs:2,example:'{{isFalsey "" }} -> true',description:"Returns true if the given value
is falsey. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.
\n"},isTruthy:{args:["val","options"],numArgs:2,example:'{{isTruthy "12" }} -> true',description:"Returns true if the given value
is truthy. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.
\n"},ifEven:{args:["number","options"],numArgs:2,example:"{{#ifEven 2}} even {{else}} odd {{/ifEven}} -> even",description:"Return true if the given value is an even number.
\n"},ifNth:{args:["a","b","options"],numArgs:3,example:"{{#ifNth 10 2}} remainder {{else}} no remainder {{/ifNth}} -> remainder",description:"Conditionally renders a block if the remainder is zero when a
operand is divided by b
. If an inverse block is specified it will be rendered when the remainder is not zero.
\n"},ifOdd:{args:["value","options"],numArgs:2,example:"{{#ifOdd 3}} odd {{else}} even {{/ifOdd}} -> odd",description:"Block helper that renders a block if value
is an odd number. If an inverse block is specified it will be rendered when falsy.
\n"},is:{args:["a","b","options"],numArgs:3,example:"{{#is 3 3}} is {{else}} is not {{/is}} -> is",description:'Block helper that renders a block if a
is equal to b
. If an inverse block is specified it will be rendered when falsy. Similar to eq but does not do strict equality.
\n'},isnt:{args:["a","b","options"],numArgs:3,example:"{{#isnt 3 3}} isnt {{else}} is {{/isnt}} -> is",description:'Block helper that renders a block if a
is not equal to b
. If an inverse block is specified it will be rendered when falsy. Similar to unlessEq but does not use strict equality for comparisons.
\n'},lt:{args:["context","options"],numArgs:2,example:"{{#lt 2 3}} less than {{else}} more than or equal {{/lt}} -> less than",description:"Block helper that renders a block if a
is less than b
. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare=""
hash argument for the second value.
\n"},lte:{args:["a","b","options"],numArgs:3,example:"{{#lte 2 3}} less than or equal {{else}} more than {{/lte}} -> less than or equal",description:"Block helper that renders a block if a
is less than or equal to b
. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare=""
hash argument for the second value.
\n"},neither:{args:["a","b","options"],numArgs:3,example:"{{#neither null null}} both falsey {{else}} both not falsey {{/neither}} -> both falsey",description:"Block helper that renders a block if neither of the given values are truthy. If an inverse block is specified it will be rendered when falsy.
\n"},not:{args:["val","options"],numArgs:2,example:"{{#not undefined }} falsey {{else}} not falsey {{/not}} -> falsey",description:"Returns true if val
is falsey. Works as a block or inline helper.
\n"},or:{args:["arguments","options"],numArgs:2,example:"{{#or 1 2 undefined }} at least one truthy {{else}} all falsey {{/or}} -> at least one truthy",description:"Block helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy.
\n"},unlessEq:{args:["a","b","options"],numArgs:3,example:"{{#unlessEq 2 1 }} not equal {{else}} equal {{/unlessEq}} -> not equal",description:"Block helper that always renders the inverse block unless a
is equal to b
.
\n"},unlessGt:{args:["a","b","options"],numArgs:3,example:"{{#unlessGt 20 1 }} not greater than {{else}} greater than {{/unlessGt}} -> greater than",description:"Block helper that always renders the inverse block unless a
is greater than b
.
\n"},unlessLt:{args:["a","b","options"],numArgs:3,example:"{{#unlessLt 20 1 }} greater than or equal {{else}} less than {{/unlessLt}} -> greater than or equal",description:"Block helper that always renders the inverse block unless a
is less than b
.
\n"},unlessGteq:{args:["a","b","options"],numArgs:3,example:"{{#unlessGteq 20 1 }} less than {{else}} greater than or equal to {{/unlessGteq}} -> greater than or equal to",description:"Block helper that always renders the inverse block unless a
is greater than or equal to b
.
\n"},unlessLteq:{args:["a","b","options"],numArgs:3,example:"{{#unlessLteq 20 1 }} greater than {{else}} less than or equal to {{/unlessLteq}} -> greater than",description:"Block helper that always renders the inverse block unless a
is less than or equal to b
.
\n"}},date:{date:{args:["datetime","format"],numArgs:2,example:'{{date now "DD-MM-YYYY"}} -> 21-01-2021',description:"Format a date using moment.js date formatting.
\n"},duration:{args:["time","durationType"],numArgs:2,example:'{{duration timeLeft "seconds"}} -> a few seconds',description:"Produce a humanized duration left/until given an amount of time and the type of time measurement.
\n"}}},pv=Dt((function(e,t){const{registerAll:n}=G_,{cloneDeep:r}=uv,{removeNull:a,addConstants:i,removeHandlebarsStatements:o}=Y_,s=Yr.create();function l(e){try{JSON.stringify(e)}catch(t){throw"Unable to process inputs to JSON, cannot recurse"}}n(s),e.exports.processObject=async(t,n)=>{l(t);for(let r of Object.keys(t))if(null!=t[r]){let a=t[r];"string"==typeof a?t[r]=await e.exports.processString(t[r],n):"object"==typeof a&&(t[r]=await e.exports.processObject(t[r],n))}return t},e.exports.processString=async(t,n)=>e.exports.processStringSync(t,n),e.exports.processObjectSync=(t,n)=>{l(t);for(let r of Object.keys(t)){let a=t[r];"string"==typeof a?t[r]=e.exports.processStringSync(t[r],n):"object"==typeof a&&(t[r]=e.exports.processObjectSync(t[r],n))}return t},e.exports.processStringSync=(e,n)=>{if(!t.isValid(e))return e;const l=e;let c=a(r(n));if(c=i(c),"string"!=typeof e)throw"Cannot process non-string types.";try{e=tv(e);return(e=>ev(e,X_.processors))(s.compile(e,{strict:!1})(c))}catch(u){return o(l)}},e.exports.makePropSafe=e=>`[${e}]`.replace("[[","[").replace("]]","]"),e.exports.isValid=e=>{const t=["string","number","object","array","cannot read property"],n=["expecting '"],r={};try{return s.compile(tv(e,!1))(r),!0}catch(a){const e=a&&a.message?a.message:a;if(!e)return!1;const r=n.some((t=>e.toLowerCase().includes(t)));return t.some((t=>e.toLowerCase().includes(t)))&&!r}},e.exports.getManifest=()=>dv}));const fv=pv.isValid,mv=pv.makePropSafe,hv=pv.getManifest,gv=pv.processStringSync;pv.processObjectSync,pv.processString,pv.processObject;const _v=/{{([^}]+)}}/g,vv=/{{[\S\s]*?}}/g,Ev=(e,t)=>[...Sv(e,t),...$v(),...Tv(e)],bv=(e,t)=>{if(!e||!t)return[];const n=Ot(e.props,t);return n.pop(),n.filter((e=>{const t=Mv.actions.components.getDefinition(e._component);return null!=(null==t?void 0:t.context)}))},yv=(e,t)=>{const n=Mv.actions.components.getDefinition(null==t?void 0:t._component);if(!n)return null;const r=n.settings.find((e=>"dataProvider"===e.type));if(r){const n=t[r.key],o=null==(i=null==(a=n)?void 0:a.match(/{{\s*literal[\s[]+([a-fA-F0-9]+)[\s\]]*}}/))?void 0:i[1],s=Tt(e.props,o);return yv(e,s)}var a,i;const o=["dataSource","table","schema"],s=n.settings.find((e=>o.includes(e.type)));return s?"table"===s.type?{tableId:t[null==s?void 0:s.key],type:"table"}:t[null==s?void 0:s.key]:null},Sv=(e,t)=>{const n=bv(e,t);let r=[];return n.forEach((t=>{var n;const a=Mv.actions.components.getDefinition(t._component).context;let i,o;if("form"===a.type)i=wv(t),o="Fields";else if("static"===a.type){i={};(a.values||[]).forEach((e=>{i[e.key]={name:e.label,type:"string"}}))}else if("schema"===a.type){const r=yv(e,t);if(!r)return;const a=Cv(r);i=a.schema,o=null==(n=a.table)?void 0:n.name}if(!i)return;const s=Object.keys(i).sort(),l=mv(t._id);s.forEach((e=>{const n=i[e];let a=e;"link"===n.type?a=`${e}_text`:"attachment"===n.type&&(a=`${e}_first`);const s=`${l}.${mv(a)}`;let c=t._instanceName;o&&(c+=`.${o}`),c+=`.${n.name||e}`,r.push({type:"context",runtimeBinding:s,readableBinding:c,fieldSchema:n,providerId:t._id})}))})),r},$v=()=>{let e=[];const{schema:t}=Cv({type:"table",tableId:gt}),n=Object.keys(t).sort(),r=mv("user");return n.forEach((n=>{const a=t[n];let i=n;"link"===a.type?i=`${n}_text`:"attachment"===a.type&&(i=`${n}_first`),e.push({type:"context",runtimeBinding:`${r}.${mv(i)}`,readableBinding:`Current User.${n}`,fieldSchema:a,providerId:"user"})})),e},Tv=e=>{var t,n;const r=(null!=(n=null==(t=null==e?void 0:e.routing)?void 0:t.route)?n:"").split("/");let a=[];r.forEach((e=>{e.startsWith(":")&&e.length>1&&a.push(e.replace(/:/g,"").replace(/\?/g,""))}));const i=mv("url");return a.map((e=>({type:"context",runtimeBinding:`${i}.${mv(e)}`,readableBinding:`URL.${e}`})))},Cv=(e,t=!1)=>{var n,r;let a,o;if(e){const{type:l}=e;if("query"===l){o=s(Lv).queries.find((t=>t._id===e._id))}else{o=s(Lv).tables.find((t=>t._id===e.tableId))}if(o)if("view"===l)a=u.cloneDeep(null==(r=null==(n=o.views)?void 0:n[e.name])?void 0:r.schema);else if("query"===l&&t){a={};(o.parameters||[]).forEach((e=>{(null==e?void 0:e.name)&&(a[e.name]=i(i({},e),{type:"string"}))}))}else a=u.cloneDeep(o.schema);a&&!t&&["table","link"].includes(e.type)&&(a._id={type:"string"},a._rev={type:"string"}),a&&Object.keys(a).forEach((e=>{a[e].name||(a[e].name=e)}))}return{schema:a,table:o}},wv=e=>{var t,n;let r={};if(!e)return r;const a=Mv.actions.components.getDefinition(e._component),o=null==(t=null==a?void 0:a.settings)?void 0:t.find((e=>"field"===e.key&&e.type.startsWith("field/")));if(o&&e.field){const t=o.type.split("field/")[1];t&&(r[e.field]={type:t})}return null==(n=e._children)||n.forEach((e=>{const t=wv(e);r=i(i({},r),t)})),r};function Ov(e){for(let[t,n]of Object.entries(e))"object"==typeof n?e[t]=Ov(n):"string"==typeof n&&(e[t]=n.replace(vv,"Invalid binding"));return e}function Nv(e,t,n){const r="runtimeBinding"===n?"readableBinding":"runtimeBinding";if("string"!=typeof t)return t;const a=e.map((e=>e[r])).sort(((e,t)=>t.length-e.length)),i=t.match(_v)||[];let o=t;for(let s of i){let t=s;for(let i of a)if(t.includes(i)){const a=e.find((e=>e[r]===i));t=t.replace(i,a[n])}o=o.replace(s,t)}return o}function Rv(e,t){return Nv(e,t,"runtimeBinding")}function xv(e,t){return Nv(e,t,"readableBinding")}const Av={apps:[],name:"",url:"",description:"",layouts:[],screens:[],components:[],currentFrontEndType:"none",selectedScreenId:"",selectedLayoutId:"",selectedComponentId:"",errors:[],hasAppPackage:!1,libraries:null,appId:"",routes:{}},Iv={tables:[],views:[],users:[],roles:[],datasources:[],queries:[],integrations:{},selectedDatabase:{},selectedTable:{},draftTable:{}};class Dv{constructor(e){this.automation=e}hasTrigger(){return this.automation.definition.trigger}addBlock(e){if(!this.hasTrigger()&&"TRIGGER"===e.type){const t=i({id:p.generate()},e);return this.automation.definition.trigger=t,t}const t=i({id:p.generate()},e);return this.automation.definition.steps=[...this.automation.definition.steps,t],t}updateBlock(e,t){const{steps:n,trigger:r}=this.automation.definition;if(r&&r.id===t)return void(this.automation.definition.trigger=e);const a=n.findIndex((e=>e.id===t));if(a<0)throw new Error("Block not found.");n.splice(a,1,e),this.automation.definition.steps=n}deleteBlock(e){const{steps:t,trigger:n}=this.automation.definition;if(n&&n.id===e)return void(this.automation.definition.trigger=null);const r=t.findIndex((t=>t.id===e));if(r<0)throw new Error("Block not found.");t.splice(r,1),this.automation.definition.steps=t}constructBlock(e,t,n){return i(i({},n),{inputs:n.inputs||{},stepId:t,type:e})}}const kv={hostingInfo:{},appUrl:"",deployedApps:{},deployedAppNames:[],deployedAppUrls:[]},Mv=(()=>{const e=d(i({},Av));return e.actions={initialise:async t=>{const{layouts:n,screens:r,application:a}=t,o=await(async e=>{const t=`/${e}/components/definitions`;try{const e=await ft(t);return await e.json()}catch(n){console.error(`Error fetching component definitions for ${e}`,n)}})(a._id);e.update((e=>i(i({},e),{libraries:a.componentLibraries,components:o,name:a.name,description:a.description,appId:a._id,url:a.url,layouts:n,screens:r,hasAppPackage:!0,appInstance:a.instance}))),await Fv.actions.fetch(),await Lv.actions.database.select(a.instance)},routing:{fetch:async()=>{const t=await ht.get("/api/routing"),n=await t.json();e.update((e=>(e.routes=n.routes,e)))}},screens:{select:t=>{e.update((e=>{var n;let r=s(Yv),a=r.find((e=>e._id===t))||r[0];return a?(jv.set(a.routing.roleId),e.currentFrontEndType=_t.SCREEN,e.selectedScreenId=a._id,e.currentView="detail",e.selectedComponentId=null==(n=a.props)?void 0:n._id,e):e}))},create:async t=>(t=await e.actions.screens.save(t),e.update((e=>(e.selectedScreenId=t._id,e.selectedComponentId=t.props._id,e.currentFrontEndType=_t.SCREEN,jv.set(t.routing.roleId),e))),t),save:async t=>{const n=void 0===t._id,r=await ht.post("/api/screens",t);return t=await r.json(),await e.actions.routing.fetch(),e.update((e=>{const n=e.screens.findIndex((e=>e._id===t._id));return-1!==n&&e.screens.splice(n,1),e.screens.push(t),e})),n&&e.actions.screens.select(t._id),t},delete:async t=>{const n=Array.isArray(t)?t:[t],r=[];e.update((e=>{for(let t of n)e.screens=e.screens.filter((e=>e._id!==t._id)),r.push(ht.delete(`/api/screens/${t._id}/${t._rev}`)),t._id===e.selectedScreenId&&(e.selectedScreenId=null);return e})),await Promise.all(r)}},preview:{saveSelected:async()=>{const t=s(e),n=s(Bv);t.currentFrontEndType!==_t.LAYOUT?await e.actions.screens.save(n):await e.actions.layouts.save(n)}},layouts:{select:t=>{e.update((n=>{var r;const a=e.actions.layouts.find(t)||s(e).layouts[0];if(a)return n.currentFrontEndType=_t.LAYOUT,n.currentView="detail",n.selectedLayoutId=a._id,n.selectedComponentId=null==(r=a.props)?void 0:r._id,n}))},save:async t=>{const n=u.cloneDeep(t),r=void 0===n._id,a=await ht.post("/api/layouts",n),i=await a.json();return e.update((e=>{const t=e.layouts.findIndex((e=>e._id===i._id));return t>=0?e.layouts.splice(t,1,i):e.layouts.push(i),e})),r&&e.actions.layouts.select(i._id),i},find:t=>{if(!t)return s(Vv);return s(e).layouts.find((e=>e._id===t))},delete:async t=>{const n=await ht.delete(`/api/layouts/${t._id}/${t._rev}`);if(200!==n.status){const e=await n.json();throw new Error(e.message)}e.update((e=>(e.layouts=e.layouts.filter((e=>e._id!==t._id)),t._id===e.selectedLayoutId&&(e.selectedLayoutId=s(Vv)._id),e)))}},components:{select:t=>{if(!t)return;const n=s(Bv);if(null!=wt(n.props,t._id))e.update((e=>(e.selectedComponentId=t._id,e.currentView="component",e)));else{s(e).currentFrontEndType===_t.LAYOUT?e.actions.layouts.select(n._id):e.actions.screens.select(n._id)}},getDefinition:t=>t?(t.startsWith("@budibase")||(t=`@budibase/standard-components/${t}`),s(e).components[t]):null,createInstance:(t,n)=>{const r=e.actions.components.getDefinition(t);if(!r)return null;let a=i({},n);r.settings&&r.settings.forEach((e=>{void 0!==e.defaultValue&&(a[e.key]=e.defaultValue)}));let o={};return r.hasChildren&&(o._children=[]),i(i({_id:xt(),_component:r.component,_styles:{normal:{},hover:{},active:{}},_transition:"",_instanceName:`New ${r.name}`},u.cloneDeep(a)),o)},create:async(t,n)=>{const r=s(Gv),a=s(Bv),i=s(e);if(t.endsWith("screenslot")){const e=i.currentFrontEndType===_t.LAYOUT,n=Ct(a.props,t);if(!e||null!=n)return}const o=e.actions.components.createInstance(t,n);if(!o)return;let l;if(a){if(r){const t=e.actions.components.getDefinition(r._component);l=(null==t?void 0:t.hasChildren)?r:wt(a.props,r._id)}else l=a.props;if(l)return l._children||(l._children=[]),l._children.push(o),await e.actions.preview.saveSelected(),e.update((e=>(e.currentView="component",e.selectedComponentId=o._id,e))),$t.captureEvent("Added Component",{name:o._component}),o}},delete:async t=>{if(!t)return;const n=s(Bv);if(!n)return;const r=wt(n.props,t._id);r&&(r._children=r._children.filter((e=>e._id!==t._id)),e.actions.components.select(r)),await e.actions.preview.saveSelected()},copy:(t,n=!1)=>{const r=s(Bv);if(!r)return null;if(e.update((e=>(e.componentToPaste=u.cloneDeep(t),e.componentToPaste.isCut=n,e))),n){const n=wt(r.props,t._id);n&&(n._children=n._children.filter((e=>e._id!==t._id)),e.actions.components.select(n))}},paste:async(t,n)=>{let r=[];e.update((a=>{if(!a.componentToPaste)return a;const i=a.componentToPaste.isCut;i||(a.componentToPaste=Ov(a.componentToPaste)),delete a.componentToPaste.isCut;let o=u.cloneDeep(a.componentToPaste);if(i)a.componentToPaste=null;else{const e=t=>{var n;t&&(t._id=xt(),null==(n=t._children)||n.forEach(e))};e(o)}if("inside"===n)t._children||(t._children=[]),t._children.push(o);else{const e=s(Bv);if(!e)return a;const r=wt(e.props,t._id);if(!r)return a;const i=r._children.indexOf(t),l="above"===n?i:i+1;r._children.splice(l,0,u.cloneDeep(o))}return r.push(e.actions.preview.saveSelected()),e.actions.components.select(o),a})),await Promise.all(r)},updateStyle:async(t,n,r)=>{const a=s(Gv);null==r||""===r?delete a._styles[t][n]:a._styles[t][n]=r,await e.actions.preview.saveSelected()},updateCustomStyle:async t=>{s(Gv)._styles.custom=t,await e.actions.preview.saveSelected()},resetStyles:async()=>{s(Gv)._styles={normal:{},hover:{},active:{}},await e.actions.preview.saveSelected()},updateTransition:async t=>{const n=s(Gv);n._transition=null==t||""===t?"":t,await e.actions.preview.saveSelected()},updateProp:async(t,n)=>{let r=s(Gv);t&&r&&(r[t]=n,e.update((e=>(e.selectedComponentId=r._id,e))),await e.actions.preview.saveSelected())},links:{save:async(t,n)=>{const r=s(Vv);if(!r)return;const a=Ct(r.props,"@budibase/standard-components/navigation");if(!a)return;let o;a._children&&a._children.length?(o=u.cloneDeep(a._children[0]),o._id=xt(),o._instanceName=`${n} Link`,o.url=t,o.text=n):o=i(i({},e.actions.components.createInstance("link")),{url:t,text:n,_instanceName:`${n} Link`}),a._children=[...a._children,o],await e.actions.layouts.save(r)}}}},e})(),Lv=(()=>{const e=d(i({},Iv));return e.actions={reset:()=>e.set(i({},Iv)),database:{select:async t=>{const n=await ht.get("/api/tables"),r=await n.json(),a=await ht.get("/api/datasources"),i=await a.json(),o=await ht.get("/api/queries"),s=await o.json(),l=await ht.get("/api/integrations"),c=await l.json(),u=await e.actions.permissions.fetchLevels();e.update((e=>(e.selectedDatabase=t,e.tables=r,e.datasources=i,e.queries=s,e.integrations=c,e.permissionLevels=u,e)))}},rows:{save:()=>e.update((e=>(e.selectedView=e.selectedView,e))),delete:()=>e.update((e=>(e.selectedView=e.selectedView,e))),select:t=>e.update((e=>(e.selectedRow=t,e)))},datasources:{fetch:async()=>{const t=await ht.get("/api/datasources"),n=await t.json();return e.update((e=>(e.datasources=n,e))),n},select:async t=>{e.update((e=>(e.selectedDatasourceId=t,e.selectedQueryId=null,e)))},save:async t=>{const n=await ht.post("/api/datasources",t),r=await n.json();return e.update((e=>{const t=e.datasources.findIndex((e=>e._id===r._id));return t>=0?e.datasources.splice(t,1,r):e.datasources.push(r),e.datasources=e.datasources,e.selectedDatasourceId=r._id,e})),r},delete:async t=>{await ht.delete(`/api/datasources/${t._id}/${t._rev}`),e.update((e=>(e.datasources=e.datasources.filter((e=>e._id!==t._id)),t._id===e.selectedDatasourceId&&(e.selectedDatasourceId=null),e)))}},queries:{fetch:async()=>{const t=await ht.get("/api/queries"),n=await t.json();return e.update((e=>(e.queries=n,e))),n},save:async(t,n)=>{const r=s(e).integrations,a=s(e).datasources.filter((e=>e._id===t));if(0!==a.length){const e=r[a[0].source].query[n.queryVerb].readable;e&&(n.readable=e)}n.datasourceId=t;const i=await ht.post("/api/queries",n);if(200!==i.status)throw new Error("Failed saving query.");const o=await i.json();return e.update((e=>{const t=e.queries.findIndex((e=>e._id===o._id));return t>=0?e.queries.splice(t,1,o):e.queries.push(o),e.queries=e.queries,e.selectedQueryId=o._id,e})),o},select:t=>e.update((e=>(e.selectedDatasourceId=t.datasourceId,e.selectedQueryId=t._id,e))),delete:async t=>{await ht.delete(`/api/queries/${t._id}/${t._rev}`),e.update((e=>(e.queries=e.queries.filter((e=>e._id!==t._id)),e.selectedQueryId===t._id&&(e.selectedQueryId=null),e)))}},tables:{fetch:async()=>{const t=await ht.get("/api/tables"),n=await t.json();e.update((e=>(e.tables=n,e)))},select:t=>e.update((e=>(e.selectedTable=t,e.draftTable=u.cloneDeep(t),e.selectedView={name:`all_${t._id}`},e))),save:async t=>{const n=u.cloneDeep(t),r=s(e).tables.filter((e=>e._id===t._id))[0],a=[];for(let e of Object.keys(n.schema)){if(-1!==a.indexOf(e.toLowerCase())){delete n.schema[e];continue}const t=n.schema[e],i=null==r?void 0:r.schema[e];null!=i&&i.type!==t.type&&(n.schema[e]=i),t.name&&t.name!==e&&(n.schema[t.name]=t,n._rename={old:e,updated:t.name},delete n.schema[e]),a.push(e.toLowerCase())}const i=await ht.post("/api/tables",n),o=await i.json();return await e.actions.tables.fetch(),e.actions.tables.select(o),o},delete:async t=>{await ht.delete(`/api/tables/${t._id}/${t._rev}`),e.update((e=>(e.tables=e.tables.filter((e=>e._id!==t._id)),t._id===e.selectedTable._id&&(e.selectedTable={}),e)))},saveField:({originalName:t,field:n,primaryDisplay:r=!1,indexes:a})=>{e.update((i=>((t||""===t)&&(delete i.draftTable.schema[t],i.draftTable._rename={old:t,updated:n.name}),r&&(i.draftTable.primaryDisplay=n.name),a&&(i.draftTable.indexes=a),i.draftTable.schema[n.name]=u.cloneDeep(n),e.actions.tables.save(i.draftTable),i)))},deleteField:t=>{e.update((n=>(delete n.draftTable.schema[t.name],e.actions.tables.save(n.draftTable),n)))}},views:{select:t=>e.update((e=>(e.selectedView=t,e.selectedTable={},e))),delete:async t=>{await ht.delete(`/api/views/${t}`),await e.actions.tables.fetch()},save:async t=>{const n=await ht.post("/api/views",t),r=await n.json(),a=i({name:t.name},r);e.update((e=>{const n=e.tables.find((e=>e._id===t.tableId));return t.originalName&&delete n.views[t.originalName],n.views[t.name]=a,e.tables=e.tables,e.selectedView=a,e}))}},users:{create:t=>e.update((e=>(e.users.push(t),e.users=e.users,e)))},roles:{fetch:async()=>{const t=await ht.get("/api/roles"),n=await t.json();e.update((e=>(e.roles=n,e)))},delete:async t=>{const n=await ht.delete(`/api/roles/${t._id}/${t._rev}`);return await e.actions.roles.fetch(),n},save:async t=>{const n=await ht.post("/api/roles",t);return await e.actions.roles.fetch(),n}},permissions:{fetchLevels:async()=>{const e=await ht.get("/api/permission/levels");return await e.json()},forResource:async e=>{const t=await ht.get(`/api/permission/${e}`);return await t.json()},save:async({role:e,resource:t,level:n})=>{const r=await ht.post(`/api/permission/${e}/${t}/${n}`);return await r.json()}}},e})(),Pv=(()=>{const e=d({automations:[],blockDefinitions:{TRIGGER:[],ACTION:[],LOGIC:[]},selectedAutomation:null});return e.actions=(e=>({fetch:async()=>{const t=await Promise.all([ht.get("/api/automations"),ht.get("/api/automations/definitions/list")]),n=await Promise.all(t.map((e=>e.json())));e.update((e=>{var t;let r=null==(t=e.selectedAutomation)?void 0:t.automation;return e.automations=n[0],e.blockDefinitions={TRIGGER:n[1].trigger,ACTION:n[1].action,LOGIC:n[1].logic},r&&(r=n[0].filter((e=>e._id===r._id)),e.selectedAutomation=new Dv(r[0])),e}))},create:async({name:t})=>{const n={name:t,type:"automation",definition:{steps:[]}},r=await ht.post("/api/automations",n),a=await r.json();e.update((t=>(t.automations=[...t.automations,a.automation],e.actions.select(a.automation),t)))},save:async({automation:t})=>{const n=await ht.put("/api/automations",t),r=await n.json();e.update((n=>{const a=n.automations.findIndex((e=>e._id===t._id));return n.automations.splice(a,1,r.automation),n.automations=n.automations,e.actions.select(r.automation),n}))},delete:async({automation:t})=>{const{_id:n,_rev:r}=t,a=`/api/automations/${n}/${r}`;await ht.delete(a),e.update((e=>{const t=e.automations.findIndex((e=>e._id===n));return e.automations.splice(t,1),e.automations=e.automations,e.selectedAutomation=null,e.selectedBlock=null,e}))},trigger:async({automation:e})=>{const{_id:t}=e,n=`/api/automations/${t}/trigger`;return await ht.post(n)},select:t=>{e.update((e=>(e.selectedAutomation=new Dv(u.cloneDeep(t)),e.selectedBlock=null,e)))},addBlockToAutomation:t=>{e.update((e=>{const n=e.selectedAutomation.addBlock(u.cloneDeep(t));return e.selectedBlock=n,e})),$t.captureEvent("Added Automation Block",{name:t.name})},deleteAutomationBlock:t=>{e.update((e=>{const n=e.selectedAutomation.automation.definition.steps.findIndex((e=>e.id===t.id));e.selectedAutomation.deleteBlock(t.id);const r=e.selectedAutomation.automation.definition.steps;let a;return a=null!=r[n]?r[n]:null!=r[n-1]?r[n-1]:e.selectedAutomation.automation.definition.trigger||null,e.selectedBlock=a,e}))}}))(e),e})(),Uv=(()=>{const e=document.documentElement,t={darkMode:!0,hue:208,saturation:9,lightness:16},n=((e,t)=>{const n=d(t,(()=>{a();const t=({key:t})=>t===e&&a();return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)})),r=t=>{n.set(t),localStorage.setItem(e,JSON.stringify(t))},a=()=>{const a=localStorage.getItem(e);if(null==a)r(t);else try{n.set(JSON.parse(a))}catch(fn){r(t)}};return i(i({},n),{set:r,update:e=>r(e(s(n)))})})("bb-theme",t);function r(t,n){e.style.setProperty(t,n)}return n.reset=()=>{n.set(i(i({},t),{darkMode:!0}))},n.subscribe((t=>{e.classList[t.darkMode?"add":"remove"]("dark"),r("--theme-hue",Math.round(t.hue)),r("--theme-saturation",`${Math.round(t.saturation)}%`),r("--theme-brightness",`${Math.round(t.lightness)}%`)})),n})(),Fv=(()=>{const e=d(i({},kv));return e.actions={fetch:async()=>{const t=await Promise.all([ht.get("/api/hosting/"),ht.get("/api/hosting/urls")]),[n,r]=await Promise.all(t.map((e=>e.json())));return e.update((e=>(e.hostingInfo=n,e.appUrl=r.app,e))),n},save:async t=>{const n=await ht.post("/api/hosting",t),r=(await n.json()).rev;e.update((e=>(e.hostingInfo=i(i({},t),{_rev:r}),e)))},fetchDeployedApps:async()=>{let t=await(await ft("/api/hosting/apps")).json();return e.update((e=>(e.deployedApps=t,e.deployedAppNames=Object.values(t).map((e=>e.name)),e.deployedAppUrls=Object.values(t).map((e=>e.url)),e))),t}},e})(),Bv=f(Mv,(e=>{const t=e.currentFrontEndType;return t===_t.SCREEN?e.screens.find((t=>t._id===e.selectedScreenId)):t===_t.LAYOUT?e.layouts.find((t=>t._id===e.selectedLayoutId)):null})),Gv=f([Mv,Bv],(([e,t])=>t&&e.selectedComponentId?Tt(t.props,e.selectedComponentId):null));f(Mv,(e=>e.currentFrontEndType===_t.SCREEN?e.selectedScreenId:e.selectedLayoutId));const qv=f(Bv,(e=>null==e?void 0:e.name)),Yv=f(Mv,(e=>e.screens)),Vv=f(Mv,(e=>{var t;return null==(t=e.layouts)?void 0:t.find((e=>e._id===Et.PRIVATE))})),jv=d("BASIC"),Hv=d(null);function zv(e){let t,n,r,a;const i=e[17].default,o=C(i,e,e[16],null);return{c(){t=w("button"),o&&o.c(),this.h()},l(e){t=O(e,"BUTTON",{disabled:!0,class:!0});var n=N(t);o&&o.l(n),n.forEach($),this.h()},h(){t.disabled=e[3],R(t,"class","svelte-1iv2rn5"),x(t,"primary",e[0]),x(t,"secondary",e[1]),x(t,"translucent",e[4]),x(t,"blue",e[2]),x(t,"red",e[6]),x(t,"yellow",e[7]),x(t,"orange",e[8]),x(t,"green",e[9]),x(t,"purple",e[10]),x(t,"small",e[11]),x(t,"medium",e[12]),x(t,"wide",e[13]),x(t,"large",e[14]),x(t,"text",e[5])},m(i,s){v(i,t,s),o&&o.m(t,null),n=!0,r||(a=A(t,"click",I(e[18])),r=!0)},p(e,r){o&&o.p&&65536&r&&D(o,i,e,e[16],r,null,null),(!n||8&r)&&(t.disabled=e[3]),1&r&&x(t,"primary",e[0]),2&r&&x(t,"secondary",e[1]),16&r&&x(t,"translucent",e[4]),4&r&&x(t,"blue",e[2]),64&r&&x(t,"red",e[6]),128&r&&x(t,"yellow",e[7]),256&r&&x(t,"orange",e[8]),512&r&&x(t,"green",e[9]),1024&r&&x(t,"purple",e[10]),2048&r&&x(t,"small",e[11]),4096&r&&x(t,"medium",e[12]),8192&r&&x(t,"wide",e[13]),16384&r&&x(t,"large",e[14]),32&r&&x(t,"text",e[5])},i(e){n||(S(o,e),n=!0)},o(e){b(o,e),n=!1},d(e){e&&$(t),o&&o.d(e),r=!1,a()}}}function Wv(e){let t,n;const r=e[17].default,a=C(r,e,e[16],null);return{c(){t=w("a"),a&&a.c(),this.h()},l(e){t=O(e,"A",{href:!0,disabled:!0,class:!0});var n=N(t);a&&a.l(n),n.forEach($),this.h()},h(){R(t,"href",e[15]),R(t,"disabled",e[3]),R(t,"class","svelte-1iv2rn5"),x(t,"primary",e[0]),x(t,"secondary",e[1]),x(t,"translucent",e[4]),x(t,"blue",e[2]),x(t,"red",e[6]),x(t,"yellow",e[7]),x(t,"orange",e[8]),x(t,"green",e[9]),x(t,"purple",e[10]),x(t,"small",e[11]),x(t,"medium",e[12]),x(t,"wide",e[13]),x(t,"large",e[14]),x(t,"text",e[5])},m(e,r){v(e,t,r),a&&a.m(t,null),n=!0},p(e,i){a&&a.p&&65536&i&&D(a,r,e,e[16],i,null,null),(!n||32768&i)&&R(t,"href",e[15]),(!n||8&i)&&R(t,"disabled",e[3]),1&i&&x(t,"primary",e[0]),2&i&&x(t,"secondary",e[1]),16&i&&x(t,"translucent",e[4]),4&i&&x(t,"blue",e[2]),64&i&&x(t,"red",e[6]),128&i&&x(t,"yellow",e[7]),256&i&&x(t,"orange",e[8]),512&i&&x(t,"green",e[9]),1024&i&&x(t,"purple",e[10]),2048&i&&x(t,"small",e[11]),4096&i&&x(t,"medium",e[12]),8192&i&&x(t,"wide",e[13]),16384&i&&x(t,"large",e[14]),32&i&&x(t,"text",e[5])},i(e){n||(S(a,e),n=!0)},o(e){b(a,e),n=!1},d(e){e&&$(t),a&&a.d(e)}}}function Qv(e){let t,n,r,a;const i=[Wv,zv],o=[];function s(e,t){return e[15]?0:1}return t=s(e),n=o[t]=i[t](e),{c(){n.c(),r=_()},l(e){n.l(e),r=_()},m(e,n){o[t].m(e,n),v(e,r,n),a=!0},p(e,[a]){let l=t;t=s(e),t===l?o[t].p(e,a):(E(),b(o[l],1,1,(()=>{o[l]=null})),y(),n=o[t],n?n.p(e,a):(n=o[t]=i[t](e),n.c()),S(n,1),n.m(r.parentNode,r))},i(e){a||(S(n),a=!0)},o(e){b(n),a=!1},d(e){o[t].d(e),e&&$(r)}}}function Kv(e,t,n){let{$$slots:r={},$$scope:a}=t,{primary:i=!1}=t,{secondary:o=!1}=t,{blue:s=!1}=t,{disabled:l=!1}=t,{translucent:c=!1}=t,{text:u=!1}=t,{red:d=!1}=t,{yellow:p=!1}=t,{orange:f=!1}=t,{green:m=!1}=t,{purple:h=!1}=t,{small:g=!1}=t,{medium:_=!1}=t,{wide:v=!1}=t,{large:E=!1}=t,{href:b=!1}=t;return e.$$set=e=>{"primary"in e&&n(0,i=e.primary),"secondary"in e&&n(1,o=e.secondary),"blue"in e&&n(2,s=e.blue),"disabled"in e&&n(3,l=e.disabled),"translucent"in e&&n(4,c=e.translucent),"text"in e&&n(5,u=e.text),"red"in e&&n(6,d=e.red),"yellow"in e&&n(7,p=e.yellow),"orange"in e&&n(8,f=e.orange),"green"in e&&n(9,m=e.green),"purple"in e&&n(10,h=e.purple),"small"in e&&n(11,g=e.small),"medium"in e&&n(12,_=e.medium),"wide"in e&&n(13,v=e.wide),"large"in e&&n(14,E=e.large),"href"in e&&n(15,b=e.href),"$$scope"in e&&n(16,a=e.$$scope)},[i,o,s,l,c,u,d,p,f,m,h,g,_,v,E,b,a,r,function(t){T(e,t)}]}class Zv extends m{constructor(e){super(),h(this,e,Kv,Qv,g,{primary:0,secondary:1,blue:2,disabled:3,translucent:4,text:5,red:6,yellow:7,orange:8,green:9,purple:10,small:11,medium:12,wide:13,large:14,href:15})}}function Xv(e){let t,n;const r=e[10].default,a=C(r,e,e[9],null);return{c(){t=w("label"),a&&a.c(),this.h()},l(e){t=O(e,"LABEL",{class:!0,for:!0});var n=N(t);a&&a.l(n),n.forEach($),this.h()},h(){R(t,"class","bb-label svelte-18qm31a"),R(t,"for",e[0]),x(t,"extraSmall",e[1]),x(t,"small",e[2]),x(t,"medium",e[3]),x(t,"large",e[4]),x(t,"extraLarge",e[5]),x(t,"white",e[6]),x(t,"grey",e[7]),x(t,"black",e[8])},m(e,r){v(e,t,r),a&&a.m(t,null),n=!0},p(e,[i]){a&&a.p&&512&i&&D(a,r,e,e[9],i,null,null),(!n||1&i)&&R(t,"for",e[0]),2&i&&x(t,"extraSmall",e[1]),4&i&&x(t,"small",e[2]),8&i&&x(t,"medium",e[3]),16&i&&x(t,"large",e[4]),32&i&&x(t,"extraLarge",e[5]),64&i&&x(t,"white",e[6]),128&i&&x(t,"grey",e[7]),256&i&&x(t,"black",e[8])},i(e){n||(S(a,e),n=!0)},o(e){b(a,e),n=!1},d(e){e&&$(t),a&&a.d(e)}}}function Jv(e,t,n){let{$$slots:r={},$$scope:a}=t,{forAttr:i=""}=t,{extraSmall:o=!1}=t,{small:s=!1}=t,{medium:l=!1}=t,{large:c=!1}=t,{extraLarge:u=!1}=t,{white:d=!1}=t,{grey:p=!1}=t,{black:f=!1}=t;return e.$$set=e=>{"forAttr"in e&&n(0,i=e.forAttr),"extraSmall"in e&&n(1,o=e.extraSmall),"small"in e&&n(2,s=e.small),"medium"in e&&n(3,l=e.medium),"large"in e&&n(4,c=e.large),"extraLarge"in e&&n(5,u=e.extraLarge),"white"in e&&n(6,d=e.white),"grey"in e&&n(7,p=e.grey),"black"in e&&n(8,f=e.black),"$$scope"in e&&n(9,a=e.$$scope)},[i,o,s,l,c,u,d,p,f,a,r]}class eE extends m{constructor(e){super(),h(this,e,Jv,Xv,g,{forAttr:0,extraSmall:1,small:2,medium:3,large:4,extraLarge:5,white:6,grey:7,black:8})}}function tE(e){let t,n,r,a=e[2]&&nE(e),i=e[9]&&aE(e);return{c(){t=w("div"),a&&a.c(),n=k(),i&&i.c(),this.h()},l(e){t=O(e,"DIV",{class:!0});var r=N(t);a&&a.l(r),n=M(r),i&&i.l(r),r.forEach($),this.h()},h(){R(t,"class","label-container svelte-hkx922")},m(e,o){v(e,t,o),a&&a.m(t,null),L(t,n),i&&i.m(t,null),r=!0},p(e,r){e[2]?a?(a.p(e,r),4&r&&S(a,1)):(a=nE(e),a.c(),S(a,1),a.m(t,n)):a&&(E(),b(a,1,1,(()=>{a=null})),y()),e[9]?i?(i.p(e,r),512&r&&S(i,1)):(i=aE(e),i.c(),S(i,1),i.m(t,null)):i&&(E(),b(i,1,1,(()=>{i=null})),y())},i(e){r||(S(a),S(i),r=!0)},o(e){b(a),b(i),r=!1},d(e){e&&$(t),a&&a.d(),i&&i.d()}}}function nE(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,forAttr:e[1],$$slots:{default:[rE]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.forAttr=e[1]),4194308&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function rE(e){let t;return{c(){t=G(e[2])},l(n){t=q(n,e[2])},m(e,n){v(e,t,n)},p(e,n){4&n&&Y(t,e[2])},d(e){e&&$(t)}}}function aE(e){let t,n,r,a,i;return n=new Zv({props:{small:!0,secondary:!0,disabled:e[15],$$slots:{default:[iE]},$$scope:{ctx:e}}}),n.$on("click",e[18]),a=new Zv({props:{small:!0,blue:!0,disabled:!e[15],$$slots:{default:[oE]},$$scope:{ctx:e}}}),a.$on("click",e[17]),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment),this.h()},l(e){t=O(e,"DIV",{class:!0});var i=N(t);U(n.$$.fragment,i),r=M(i),U(a.$$.fragment,i),i.forEach($),this.h()},h(){R(t,"class","controls svelte-hkx922")},m(e,o){v(e,t,o),F(n,t,null),L(t,r),F(a,t,null),i=!0},p(e,t){const r={};32768&t&&(r.disabled=e[15]),4194304&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};32768&t&&(i.disabled=!e[15]),4194304&t&&(i.$$scope={dirty:t,ctx:e}),a.$set(i)},i(e){i||(S(n.$$.fragment,e),S(a.$$.fragment,e),i=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),i=!1},d(e){e&&$(t),B(n),B(a)}}}function iE(e){let t;return{c(){t=G("Edit")},l(e){t=q(e,"Edit")},m(e,n){v(e,t,n)},d(e){e&&$(t)}}}function oE(e){let t;return{c(){t=G("Save")},l(e){t=q(e,"Save")},m(e,n){v(e,t,n)},d(e){e&&$(t)}}}function sE(e){let t,n;return{c(){t=w("div"),n=G(e[13]),this.h()},l(r){t=O(r,"DIV",{class:!0});var a=N(t);n=q(a,e[13]),a.forEach($),this.h()},h(){R(t,"class","error svelte-hkx922")},m(e,r){v(e,t,r),L(t,n)},p(e,t){8192&t&&Y(n,e[13])},d(e){e&&$(t)}}}function lE(e){let t,n,r,a,i,o,s,l,c,u=(e[2]||e[9])&&tE(e),d=e[13]&&sE(e);return{c(){t=w("div"),u&&u.c(),n=k(),r=w("input"),o=k(),d&&d.c(),this.h()},l(e){t=O(e,"DIV",{class:!0});var a=N(t);u&&u.l(a),n=M(a),r=O(a,"INPUT",{disabled:!0,value:!0,type:!0,name:!0,placeholder:!0,class:!0}),o=M(a),d&&d.l(a),a.forEach($),this.h()},h(){r.disabled=a=e[10]||e[9]&&!e[15],r.value=i=null==e[0]?"":e[0],R(r,"type",e[11]),R(r,"name",e[1]),R(r,"placeholder",e[12]),R(r,"class","svelte-hkx922"),x(r,"outline",e[3]),x(r,"presentation",e[4]),x(r,"thin",e[5]),x(r,"extraThin",e[6]),x(r,"large",e[7]),x(r,"border",e[8]),R(t,"class","container svelte-hkx922")},m(a,i){v(a,t,i),u&&u.m(t,null),L(t,n),L(t,r),L(t,o),d&&d.m(t,null),s=!0,l||(c=[A(r,"change",e[19]),A(r,"input",e[20]),A(r,"change",e[16]),A(r,"input",e[16]),A(r,"blur",e[16]),V(e[14].call(null,r))],l=!0)},p(e,[o]){e[2]||e[9]?u?(u.p(e,o),516&o&&S(u,1)):(u=tE(e),u.c(),S(u,1),u.m(t,n)):u&&(E(),b(u,1,1,(()=>{u=null})),y()),(!s||34304&o&&a!==(a=e[10]||e[9]&&!e[15]))&&(r.disabled=a),(!s||1&o&&i!==(i=null==e[0]?"":e[0])&&r.value!==i)&&(r.value=i),(!s||2048&o)&&R(r,"type",e[11]),(!s||2&o)&&R(r,"name",e[1]),(!s||4096&o)&&R(r,"placeholder",e[12]),8&o&&x(r,"outline",e[3]),16&o&&x(r,"presentation",e[4]),32&o&&x(r,"thin",e[5]),64&o&&x(r,"extraThin",e[6]),128&o&&x(r,"large",e[7]),256&o&&x(r,"border",e[8]),e[13]?d?d.p(e,o):(d=sE(e),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(e){s||(S(u),s=!0)},o(e){b(u),s=!1},d(e){e&&$(t),u&&u.d(),d&&d.d(),l=!1,j(c)}}}function cE(e,t,n){const r=H();let{name:a}=t,{label:i}=t,{outline:o=!1}=t,{presentation:s=!1}=t,{thin:l=!1}=t,{extraThin:c=!1}=t,{large:u=!1}=t,{border:d=!1}=t,{edit:p=!1}=t,{disabled:f=!1}=t,{type:m}=t,{placeholder:h=""}=t,{value:g=""}=t,{error:_=!1}=t,{validator:v=(()=>{})}=t,E=!1;return e.$$set=e=>{"name"in e&&n(1,a=e.name),"label"in e&&n(2,i=e.label),"outline"in e&&n(3,o=e.outline),"presentation"in e&&n(4,s=e.presentation),"thin"in e&&n(5,l=e.thin),"extraThin"in e&&n(6,c=e.extraThin),"large"in e&&n(7,u=e.large),"border"in e&&n(8,d=e.border),"edit"in e&&n(9,p=e.edit),"disabled"in e&&n(10,f=e.disabled),"type"in e&&n(11,m=e.type),"placeholder"in e&&n(12,h=e.placeholder),"value"in e&&n(0,g=e.value),"error"in e&&n(13,_=e.error),"validator"in e&&n(14,v=e.validator)},[g,a,i,o,s,l,c,u,d,p,f,m,h,_,v,E,e=>{if("number"===m){const t=parseFloat(e.target.value);n(0,g=isNaN(t)?"":t)}else n(0,g=e.target.value)},()=>{n(15,E=!1),r("save",g)},()=>{n(15,E=!0)},function(t){T(e,t)},function(t){T(e,t)}]}class uE extends m{constructor(e){super(),h(this,e,cE,lE,g,{name:1,label:2,outline:3,presentation:4,thin:5,extraThin:6,large:7,border:8,edit:9,disabled:10,type:11,placeholder:12,value:0,error:13,validator:14})}}function dE({target:e}){e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function pE(e){return dE({target:e}),e.style.overflow="hidden",e.addEventListener("input",dE),{destroy:()=>e.removeEventListener("input",dE)}}function fE(e){let t,n,r,a=e[2]&&mE(e),i=e[5]&&gE(e);return{c(){t=w("div"),a&&a.c(),n=k(),i&&i.c(),this.h()},l(e){t=O(e,"DIV",{class:!0});var r=N(t);a&&a.l(r),n=M(r),i&&i.l(r),r.forEach($),this.h()},h(){R(t,"class","label-container svelte-1xmm808")},m(e,o){v(e,t,o),a&&a.m(t,null),L(t,n),i&&i.m(t,null),r=!0},p(e,r){e[2]?a?(a.p(e,r),4&r&&S(a,1)):(a=mE(e),a.c(),S(a,1),a.m(t,n)):a&&(E(),b(a,1,1,(()=>{a=null})),y()),e[5]?i?(i.p(e,r),32&r&&S(i,1)):(i=gE(e),i.c(),S(i,1),i.m(t,null)):i&&(E(),b(i,1,1,(()=>{i=null})),y())},i(e){r||(S(a),S(i),r=!0)},o(e){b(a),b(i),r=!1},d(e){e&&$(t),a&&a.d(),i&&i.d()}}}function mE(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,forAttr:e[1],$$slots:{default:[hE]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.forAttr=e[1]),262148&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function hE(e){let t;return{c(){t=G(e[2])},l(n){t=q(n,e[2])},m(e,n){v(e,t,n)},p(e,n){4&n&&Y(t,e[2])},d(e){e&&$(t)}}}function gE(e){let t,n,r,a,i;return n=new Zv({props:{small:!0,secondary:!0,disabled:e[9],$$slots:{default:[_E]},$$scope:{ctx:e}}}),n.$on("click",e[11]),a=new Zv({props:{small:!0,blue:!0,disabled:!e[9],$$slots:{default:[vE]},$$scope:{ctx:e}}}),a.$on("click",e[10]),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment),this.h()},l(e){t=O(e,"DIV",{class:!0});var i=N(t);U(n.$$.fragment,i),r=M(i),U(a.$$.fragment,i),i.forEach($),this.h()},h(){R(t,"class","controls svelte-1xmm808")},m(e,o){v(e,t,o),F(n,t,null),L(t,r),F(a,t,null),i=!0},p(e,t){const r={};512&t&&(r.disabled=e[9]),262144&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};512&t&&(i.disabled=!e[9]),262144&t&&(i.$$scope={dirty:t,ctx:e}),a.$set(i)},i(e){i||(S(n.$$.fragment,e),S(a.$$.fragment,e),i=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),i=!1},d(e){e&&$(t),B(n),B(a)}}}function _E(e){let t;return{c(){t=G("Edit")},l(e){t=q(e,"Edit")},m(e,n){v(e,t,n)},d(e){e&&$(t)}}}function vE(e){let t;return{c(){t=G("Save")},l(e){t=q(e,"Save")},m(e,n){v(e,t,n)},d(e){e&&$(t)}}}function EE(e){let t,n,r,a,i,o,s,l=(e[2]||e[5])&&fE(e);return{c(){t=w("div"),l&&l.c(),n=k(),r=w("textarea"),this.h()},l(e){t=O(e,"DIV",{class:!0});var a=N(t);l&&l.l(a),n=M(a),r=O(a,"TEXTAREA",{disabled:!0,placeholder:!0,name:!0,class:!0}),N(r).forEach($),a.forEach($),this.h()},h(){r.disabled=a=e[6]||e[5]&&!e[9],R(r,"placeholder",e[7]),R(r,"name",e[1]),R(r,"class","svelte-1xmm808"),x(r,"thin",e[3]),x(r,"extraThin",e[4]),R(t,"class","container svelte-1xmm808")},m(a,c){v(a,t,c),l&&l.m(t,null),L(t,n),L(t,r),z(r,e[0]),e[16](r),i=!0,o||(s=[A(r,"input",e[15]),A(r,"change",e[14]),V(pE.call(null,r))],o=!0)},p(e,[o]){e[2]||e[5]?l?(l.p(e,o),36&o&&S(l,1)):(l=fE(e),l.c(),S(l,1),l.m(t,n)):l&&(E(),b(l,1,1,(()=>{l=null})),y()),(!i||608&o&&a!==(a=e[6]||e[5]&&!e[9]))&&(r.disabled=a),(!i||128&o)&&R(r,"placeholder",e[7]),(!i||2&o)&&R(r,"name",e[1]),1&o&&z(r,e[0]),8&o&&x(r,"thin",e[3]),16&o&&x(r,"extraThin",e[4])},i(e){i||(S(l),i=!0)},o(e){b(l),i=!1},d(n){n&&$(t),l&&l.d(),e[16](null),o=!1,j(s)}}}function bE(e,t,n){const r=H();let{name:a=!1}=t,{label:i=!1}=t,{thin:o=!1}=t,{extraThin:s=!1}=t,{edit:l=!1}=t,{disabled:c=!1}=t,{placeholder:u}=t,{validator:d=(()=>{})}=t,{value:p=""}=t;let f,m=!1;return e.$$set=e=>{"name"in e&&n(1,a=e.name),"label"in e&&n(2,i=e.label),"thin"in e&&n(3,o=e.thin),"extraThin"in e&&n(4,s=e.extraThin),"edit"in e&&n(5,l=e.edit),"disabled"in e&&n(6,c=e.disabled),"placeholder"in e&&n(7,u=e.placeholder),"validator"in e&&n(12,d=e.validator),"value"in e&&n(0,p=e.value)},[p,a,i,o,s,l,c,u,f,m,()=>{n(9,m=!1),r("save",p)},()=>{n(9,m=!0)},d,()=>({start:f.selectionStart,end:f.selectionEnd}),function(t){T(e,t)},function(){p=this.value,n(0,p)},function(e){W[e?"unshift":"push"]((()=>{f=e,n(8,f)}))}]}class yE extends m{constructor(e){super(),h(this,e,bE,EE,g,{name:1,label:2,thin:3,extraThin:4,edit:5,disabled:6,placeholder:7,validator:12,value:0,getCaretPosition:13})}get getCaretPosition(){return this.$$.ctx[13]}}function SE(e){let t,n,r,a,i="snow"!==e[2].theme&&function(e){let t;return{c(){t=w("link"),this.h()},l(e){t=O(e,"LINK",{rel:!0,href:!0}),this.h()},h(){R(t,"rel","stylesheet"),R(t,"href","//cdn.quilljs.com/1.3.6/quill."+e[2].theme+".css")},m(e,n){v(e,t,n)},p:Q,d(e){e&&$(t)}}}(e);return{c(){i&&i.c(),t=_(),n=k(),r=w("div"),a=w("div"),this.h()},l(e){const o=K('[data-svelte="svelte-1lq0sbj"]',document.head);i&&i.l(o),t=_(),o.forEach($),n=M(e),r=O(e,"DIV",{style:!0});var s=N(r);a=O(s,"DIV",{}),N(a).forEach($),s.forEach($),this.h()},h(){Z(r,"width",e[0]+"px")},m(o,s){i&&i.m(document.head,null),L(document.head,t),v(o,n,s),v(o,r,s),L(r,a),e[5](a)},p(e,[t]){"snow"!==e[2].theme&&i.p(e,t),1&t&&Z(r,"width",e[0]+"px")},i:Q,o:Q,d(a){i&&i.d(a),$(t),a&&$(n),a&&$(r),e[5](null)}}}function $E(e,t,n){const r=new X;r.set({html:!0});const a=new J;let o,s,{value:l=""}=t,{options:c=null}=t,{width:u=400}=t,d=i(i({},{modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"]]},placeholder:"Type something...",theme:"snow"}),c);const p=()=>{n(3,l=a.turndown(o.container.firstChild.innerHTML))};return ee((()=>(o=new te(s,d),l&&o.clipboard.dangerouslyPasteHTML(r.render(l+"\n")),o.on("text-change",p),()=>{o.off("text-change",p)}))),e.$$set=e=>{"value"in e&&n(3,l=e.value),"options"in e&&n(4,c=e.options),"width"in e&&n(0,u=e.width)},[u,s,d,l,c,function(e){W[e?"unshift":"push"]((()=>{s=e,n(1,s)}))}]}class TE extends m{constructor(e){super(),h(this,e,$E,SE,g,{value:3,options:4,width:0})}}var CE={arrow:["M0.200275 13.2782C0.200275 12.4153 0.89983 11.7157 1.76278 11.7157H23.6378C24.5007 11.7157 25.2003 12.4153 25.2003 13.2782C25.2003 14.1411 24.5007 14.8407 23.6378 14.8407H1.76278C0.89983 14.8407 0.200275 14.1411 0.200275 13.2782Z","M11.5954 1.23584C12.2056 0.62565 13.1949 0.62565 13.8051 1.23584L24.7426 12.1733C25.3528 12.7835 25.3528 13.7729 24.7426 14.3831L13.8051 25.3206C13.1949 25.9307 12.2056 25.9307 11.5954 25.3206C10.9852 24.7104 10.9852 23.721 11.5954 23.1108L21.4281 13.2782L11.5954 3.44555C10.9852 2.83536 10.9852 1.84604 11.5954 1.23584Z"],check:["M24.3522 3.64786C23.4883 2.78405 22.0878 2.78405 21.224 3.64786L8.64198 16.2299L3.77601 11.3639C2.9122 10.5001 1.51168 10.5001 0.647861 11.3639C-0.215954 12.2277 -0.215954 13.6283 0.647861 14.4921L7.07791 20.9221C7.94172 21.7859 9.34224 21.7859 10.2061 20.9221L24.3522 6.77601L23.6974 6.12128L24.3522 6.77601C25.216 5.9122 25.216 4.51168 24.3522 3.64786L23.6974 4.30259L24.3522 3.64786Z"],coffee:["M6.69069 1.96879C6.69069 1.36848 6.20405 0.881836 5.60374 0.881836C5.00343 0.881836 4.51678 1.36848 4.51678 1.96879V5.22966C4.51678 5.82997 5.00343 6.31662 5.60374 6.31662C6.20405 6.31662 6.69069 5.82997 6.69069 5.22966V1.96879ZM0.168955 9.57749C0.168955 8.97718 0.655602 8.49053 1.25591 8.49053H18.6472H19.7342C21.1756 8.49053 22.5579 9.06312 23.5771 10.0823C24.5964 11.1016 25.169 12.4839 25.169 13.9253C25.169 15.3667 24.5964 16.7491 23.5771 17.7683C22.5579 18.7875 21.1756 19.3601 19.7342 19.3601C19.7342 20.8015 19.1616 22.1838 18.1424 23.2031C17.1231 24.2223 15.7408 24.7949 14.2994 24.7949H5.60374C4.16234 24.7949 2.77998 24.2223 1.76077 23.2031C0.741547 22.1838 0.168955 20.8015 0.168955 19.3601V9.57749ZM19.7342 17.1862V10.6644C20.599 10.6644 21.4284 11.008 22.04 11.6195C22.6515 12.2311 22.995 13.0605 22.995 13.9253C22.995 14.7901 22.6515 15.6196 22.04 16.2311C21.4284 16.8426 20.599 17.1862 19.7342 17.1862ZM17.5603 10.6644V18.2731V19.3601C17.5603 20.2249 17.2167 21.0543 16.6052 21.6659C15.9936 22.2774 15.1642 22.621 14.2994 22.621H5.60374C4.7389 22.621 3.90949 22.2774 3.29795 21.6659C2.68642 21.0543 2.34287 20.2249 2.34287 19.3601V10.6644H17.5603ZM9.95156 0.881836C10.5519 0.881836 11.0385 1.36848 11.0385 1.96879V5.22966C11.0385 5.82997 10.5519 6.31662 9.95156 6.31662C9.35125 6.31662 8.86461 5.82997 8.86461 5.22966V1.96879C8.86461 1.36848 9.35125 0.881836 9.95156 0.881836ZM15.3863 1.96879C15.3863 1.36848 14.8997 0.881836 14.2994 0.881836C13.6991 0.881836 13.2124 1.36848 13.2124 1.96879V5.22966C13.2124 5.82997 13.6991 6.31662 14.2994 6.31662C14.8997 6.31662 15.3863 5.82997 15.3863 5.22966V1.96879Z"],copy:["M2.98325 3.58322C3.19636 3.37011 3.48539 3.25039 3.78678 3.25039H14.014C14.3154 3.25039 14.6045 3.37011 14.8176 3.58322C15.0307 3.79633 15.1504 4.08537 15.1504 4.38675V5.52312C15.1504 6.15071 15.6592 6.65948 16.2868 6.65948C16.9144 6.65948 17.4231 6.15071 17.4231 5.52312V4.38675C17.4231 3.4826 17.064 2.61549 16.4246 1.97616C15.7853 1.33683 14.9182 0.977661 14.014 0.977661H3.78678C2.88263 0.977661 2.01551 1.33683 1.37619 1.97616C0.736856 2.61549 0.377686 3.4826 0.377686 4.38675V14.614C0.377686 15.5182 0.736857 16.3853 1.37619 17.0246C2.01551 17.6639 2.88263 18.0231 3.78678 18.0231H4.92314C5.55074 18.0231 6.0595 17.5143 6.0595 16.8868C6.0595 16.2592 5.55074 15.7504 4.92314 15.7504H3.78678C3.48539 15.7504 3.19636 15.6307 2.98325 15.4176C2.77014 15.2044 2.65041 14.9154 2.65041 14.614V4.38675C2.65041 4.08537 2.77014 3.79633 2.98325 3.58322ZM10.605 12.3413C10.605 11.7137 11.1137 11.2049 11.7413 11.2049H21.9686C22.5962 11.2049 23.105 11.7137 23.105 12.3413V22.5686C23.105 23.1962 22.5962 23.7049 21.9686 23.7049H11.7413C11.1137 23.7049 10.605 23.1962 10.605 22.5686V12.3413ZM11.7413 8.93221C9.85853 8.93221 8.33223 10.4585 8.33223 12.3413V22.5686C8.33223 24.4514 9.85853 25.9777 11.7413 25.9777H21.9686C23.8514 25.9777 25.3777 24.4514 25.3777 22.5686V12.3413C25.3777 10.4585 23.8514 8.93221 21.9686 8.93221H11.7413Z"],downloadalt:["M2.21191 15.4277C2.90227 15.4277 3.46191 15.9874 3.46191 16.6777V21.6777C3.46191 22.0093 3.59361 22.3272 3.82803 22.5616C4.06245 22.796 4.38039 22.9277 4.71191 22.9277H22.2119C22.5434 22.9277 22.8614 22.796 23.0958 22.5616C23.3302 22.3272 23.4619 22.0093 23.4619 21.6777V16.6777C23.4619 15.9874 24.0216 15.4277 24.7119 15.4277C25.4023 15.4277 25.9619 15.9874 25.9619 16.6777V21.6777C25.9619 22.6723 25.5668 23.6261 24.8636 24.3294C24.1603 25.0326 23.2065 25.4277 22.2119 25.4277H4.71191C3.71735 25.4277 2.76352 25.0326 2.06026 24.3294C1.357 23.6261 0.961914 22.6723 0.961914 21.6777V16.6777C0.961914 15.9874 1.52156 15.4277 2.21191 15.4277Z","M6.32803 9.54385C6.81619 9.0557 7.60764 9.0557 8.0958 9.54385L13.4619 14.91L18.828 9.54385C19.3162 9.0557 20.1076 9.0557 20.5958 9.54385C21.084 10.032 21.084 10.8235 20.5958 11.3116L14.3458 17.5616C13.8576 18.0498 13.0662 18.0498 12.578 17.5616L6.32803 11.3116C5.83988 10.8235 5.83988 10.032 6.32803 9.54385Z","M13.4619 0.427734C14.1523 0.427734 14.7119 0.987378 14.7119 1.67773V16.6777C14.7119 17.3681 14.1523 17.9277 13.4619 17.9277C12.7716 17.9277 12.2119 17.3681 12.2119 16.6777V1.67773C12.2119 0.987378 12.7716 0.427734 13.4619 0.427734Z"],external:["M25.3673 1.28312C25.3077 1.13904 25.22 1.00384 25.1042 0.88591C25.0988 0.88042 25.0933 0.87498 25.0878 0.86959C24.8623 0.648163 24.5532 0.511597 24.2122 0.511597H24.2119H16.7122C16.0218 0.511597 15.4622 1.07124 15.4622 1.7616C15.4622 2.45195 16.0218 3.0116 16.7122 3.0116H21.1944L9.57827 14.6277C9.09012 15.1159 9.09012 15.9073 9.57827 16.3955C10.0664 16.8836 10.8579 16.8836 11.346 16.3955L22.9622 4.77936V9.2616C22.9622 9.95195 23.5218 10.5116 24.2122 10.5116C24.9025 10.5116 25.4622 9.95195 25.4622 9.2616V1.76269C25.4622 1.75848 25.4621 1.75427 25.4621 1.75006C25.4606 1.59108 25.429 1.43233 25.3673 1.28312ZM4.21216 6.7616C3.88064 6.7616 3.5627 6.89329 3.32827 7.12771C3.09385 7.36213 2.96216 7.68008 2.96216 8.0116V21.7616C2.96216 22.0931 3.09385 22.4111 3.32827 22.6455C3.5627 22.8799 3.88064 23.0116 4.21216 23.0116H17.9622C18.2937 23.0116 18.6116 22.8799 18.846 22.6455C19.0805 22.4111 19.2122 22.0931 19.2122 21.7616V14.2616C19.2122 13.5712 19.7718 13.0116 20.4622 13.0116C21.1525 13.0116 21.7122 13.5712 21.7122 14.2616V21.7616C21.7122 22.7562 21.3171 23.71 20.6138 24.4132C19.9105 25.1165 18.9567 25.5116 17.9622 25.5116H4.21216C3.2176 25.5116 2.26377 25.1165 1.56051 24.4132C0.857246 23.71 0.462158 22.7562 0.462158 21.7616V8.0116C0.462158 7.01704 0.857246 6.06321 1.56051 5.35995C2.26377 4.65668 3.2176 4.2616 4.21216 4.2616H11.7122C12.4025 4.2616 12.9622 4.82124 12.9622 5.5116C12.9622 6.20195 12.4025 6.7616 11.7122 6.7616H4.21216Z"],file:["M4.00045 1.63229C4.63978 0.99296 5.5069 0.633789 6.41104 0.633789H14.3656C14.667 0.633789 14.956 0.753513 15.1691 0.966622L23.1237 8.92117C23.3368 9.13428 23.4565 9.42332 23.4565 9.7247V22.2247C23.4565 23.1288 23.0973 23.996 22.458 24.6353C21.8187 25.2746 20.9516 25.6338 20.0474 25.6338H6.41104C5.5069 25.6338 4.63978 25.2746 4.00045 24.6353C3.36112 23.996 3.00195 23.1288 3.00195 22.2247V4.04288C3.00195 3.13873 3.36112 2.27162 4.00045 1.63229ZM6.41104 2.90652C6.10966 2.90652 5.82062 3.02624 5.60751 3.23935C5.3944 3.45246 5.27468 3.7415 5.27468 4.04288V22.2247C5.27468 22.5261 5.3944 22.8151 5.60751 23.0282C5.82062 23.2413 6.10966 23.3611 6.41104 23.3611H20.0474C20.3488 23.3611 20.6378 23.2413 20.8509 23.0282C21.064 22.8151 21.1838 22.5261 21.1838 22.2247V10.1954L13.8949 2.90652H6.41104Z","M14.3656 0.633789C14.9932 0.633789 15.502 1.14256 15.502 1.77015V8.58833H22.3202C22.9478 8.58833 23.4565 9.0971 23.4565 9.7247C23.4565 10.3523 22.9478 10.8611 22.3202 10.8611H14.3656C13.738 10.8611 13.2292 10.3523 13.2292 9.7247V1.77015C13.2292 1.14256 13.738 0.633789 14.3656 0.633789Z"],list:["M0 10.25C0 9.55964 0.559644 9 1.25 9H18.75C19.4404 9 20 9.55964 20 10.25C20 10.9404 19.4404 11.5 18.75 11.5H1.25C0.559644 11.5 0 10.9404 0 10.25Z","M0 5.25C0 4.55964 0.559644 4 1.25 4H23.75C24.4404 4 25 4.55964 25 5.25C25 5.94036 24.4404 6.5 23.75 6.5H1.25C0.559644 6.5 0 5.94036 0 5.25Z","M0 15.25C0 14.5596 0.559644 14 1.25 14H23.75C24.4404 14 25 14.5596 25 15.25C25 15.9404 24.4404 16.5 23.75 16.5H1.25C0.559644 16.5 0 15.9404 0 15.25Z","M0 20.25C0 19.5596 0.559644 19 1.25 19H18.75C19.4404 19 20 19.5596 20 20.25C20 20.9404 19.4404 21.5 18.75 21.5H1.25C0.559644 21.5 0 20.9404 0 20.25Z"],money:["M13.2917 0C13.867 0 14.3333 0.46637 14.3333 1.04167V23.9583C14.3333 24.5336 13.867 25 13.2917 25C12.7164 25 12.25 24.5336 12.25 23.9583V1.04167C12.25 0.46637 12.7164 0 13.2917 0Z","M7.37294 5.53956C8.25201 4.66049 9.4443 4.16663 10.6875 4.16663H18.5C19.0753 4.16663 19.5417 4.633 19.5417 5.20829C19.5417 5.78359 19.0753 6.24996 18.5 6.24996H10.6875C9.99683 6.24996 9.33445 6.52433 8.84608 7.0127C8.3577 7.50108 8.08333 8.16346 8.08333 8.85413C8.08333 9.54479 8.3577 10.2072 8.84608 10.6955C9.33445 11.1839 9.99683 11.4583 10.6875 11.4583H15.8958C17.139 11.4583 18.3313 11.9522 19.2104 12.8312C20.0895 13.7103 20.5833 14.9026 20.5833 16.1458C20.5833 17.389 20.0895 18.5813 19.2104 19.4604C18.3313 20.3394 17.139 20.8333 15.8958 20.8333H7.04167C6.46637 20.8333 6 20.3669 6 19.7916C6 19.2163 6.46637 18.75 7.04167 18.75H15.8958C16.5865 18.75 17.2489 18.4756 17.7373 17.9872C18.2256 17.4988 18.5 16.8365 18.5 16.1458C18.5 15.4551 18.2256 14.7927 17.7373 14.3044C17.2489 13.816 16.5865 13.5416 15.8958 13.5416H10.6875C9.4443 13.5416 8.25201 13.0478 7.37294 12.1687C6.49386 11.2896 6 10.0973 6 8.85413C6 7.61092 6.49386 6.41864 7.37294 5.53956Z"],paperclip:["M17.5359 2.82806C16.6555 2.82806 15.8112 3.17779 15.1886 3.80031L5.02747 13.9615C3.99 14.999 3.40716 16.4061 3.40716 17.8733C3.40716 19.3405 3.99 20.7476 5.02747 21.785C6.06493 22.8225 7.47204 23.4053 8.93924 23.4053C10.4064 23.4053 11.8135 22.8225 12.851 21.785L23.0122 11.6239C23.444 11.1921 24.1441 11.1921 24.5759 11.6239C25.0076 12.0556 25.0076 12.7557 24.5759 13.1875L14.4147 23.3487C12.9625 24.8009 10.9929 25.6167 8.93924 25.6167C6.88555 25.6167 4.91598 24.8009 3.4638 23.3487C2.01162 21.8965 1.1958 19.9269 1.1958 17.8733C1.1958 15.8196 2.01162 13.85 3.4638 12.3978L13.625 2.23665C14.6622 1.19941 16.069 0.616699 17.5359 0.616699C19.0028 0.616699 20.4095 1.19941 21.4468 2.23665C22.484 3.27388 23.0667 4.68068 23.0667 6.14755C23.0667 7.61442 22.484 9.02121 21.4468 10.0584L11.2745 20.2196C10.6523 20.8419 9.80824 21.1915 8.92818 21.1915C8.04812 21.1915 7.20411 20.8419 6.58181 20.2196C5.95952 19.5973 5.60992 18.7533 5.60992 17.8733C5.60992 16.9932 5.95952 16.1492 6.58181 15.5269L15.9695 6.15029C16.4015 5.71875 17.1016 5.71916 17.5331 6.15121C17.9647 6.58326 17.9643 7.28333 17.5322 7.71487L8.14548 17.0906C7.93818 17.2981 7.82127 17.5799 7.82127 17.8733C7.82127 18.1668 7.93789 18.4484 8.14548 18.656C8.35306 18.8636 8.63461 18.9802 8.92818 18.9802C9.22175 18.9802 9.50329 18.8636 9.71088 18.656L19.8831 8.49479C20.5054 7.8723 20.8554 7.02773 20.8554 6.14755C20.8554 5.26716 20.5056 4.42284 19.8831 3.80031C19.2606 3.17779 18.4163 2.82806 17.5359 2.82806Z"],person:["M3.04927 16.6449C4.23321 15.4462 5.83898 14.7727 7.51333 14.7727H17.6143C19.2887 14.7727 20.8945 15.4462 22.0784 16.6449C23.2623 17.8436 23.9275 19.4695 23.9275 21.1648V23.7216C23.9275 24.4276 23.3622 25 22.6648 25C21.9675 25 21.4022 24.4276 21.4022 23.7216V21.1648C21.4022 20.1476 21.0031 19.1721 20.2928 18.4528C19.5824 17.7336 18.6189 17.3295 17.6143 17.3295H7.51333C6.50872 17.3295 5.54526 17.7336 4.83489 18.4528C4.12453 19.1721 3.72545 20.1476 3.72545 21.1648V23.7216C3.72545 24.4276 3.16015 25 2.46282 25C1.76549 25 1.2002 24.4276 1.2002 23.7216V21.1648C1.2002 19.4695 1.86533 17.8436 3.04927 16.6449Z","M11.9956 2.5C9.92454 2.5 8.24561 4.17893 8.24561 6.25C8.24561 8.32107 9.92454 10 11.9956 10C14.0667 10 15.7456 8.32107 15.7456 6.25C15.7456 4.17893 14.0667 2.5 11.9956 2.5ZM5.74561 6.25C5.74561 2.79822 8.54383 0 11.9956 0C15.4474 0 18.2456 2.79822 18.2456 6.25C18.2456 9.70178 15.4474 12.5 11.9956 12.5C8.54383 12.5 5.74561 9.70178 5.74561 6.25Z"],refresh:["M6.97937 3.40529C8.70577 2.45337 10.6948 2.08834 12.6467 2.36521C14.5986 2.64207 16.4076 3.54582 17.8012 4.94028C17.8093 4.94841 17.8176 4.95642 17.8259 4.9643L21.0026 7.95574H17.048C16.4203 7.95574 15.9115 8.4646 15.9115 9.09231C15.9115 9.72002 16.4203 10.2289 17.048 10.2289H23.8643H23.8675C24.0269 10.2289 24.1787 10.196 24.3165 10.1367C24.4544 10.0775 24.5828 9.98985 24.6925 9.874C24.7014 9.86462 24.7102 9.85508 24.7187 9.8454C24.9095 9.62998 25.0041 9.36088 25.004 9.09232C25.004 9.09121 25.004 9.09009 25.004 9.08898V2.27288C25.004 1.64517 24.4952 1.13631 23.8675 1.13631C23.2397 1.13631 22.7309 1.64517 22.7309 2.27288V6.46082L19.3966 3.32095C17.6563 1.58497 15.4 0.45984 12.9659 0.11459C10.526 -0.231487 8.03977 0.224801 5.88178 1.4147C3.72379 2.60459 2.01099 4.46363 1.00148 6.71166C-0.00803095 8.9597 -0.259554 11.4749 0.284811 13.8784C0.829176 16.2818 2.13994 18.4432 4.01957 20.0368C5.89921 21.6305 8.24589 22.5701 10.706 22.714C13.1661 22.8579 15.6063 22.1984 17.6589 20.8347C19.7116 19.4711 21.2654 17.4773 22.0863 15.1538C22.2954 14.5619 21.9851 13.9126 21.3933 13.7035C20.8014 13.4944 20.1521 13.8047 19.943 14.3966C19.2863 16.2554 18.0432 17.8504 16.4011 18.9413C14.759 20.0322 12.8068 20.5599 10.8387 20.4447C8.87066 20.3296 6.99332 19.5779 5.48961 18.303C3.9859 17.0281 2.93729 15.299 2.5018 13.3762C2.06631 11.4535 2.26753 9.44129 3.07513 7.64286C3.88274 5.84443 5.25298 4.35721 6.97937 3.40529Z"],swoop:["M17.6488 0.406796C17.1064 -0.135599 16.227 -0.135599 15.6846 0.406796C15.1422 0.949191 15.1422 1.82859 15.6846 2.37098L20.258 6.94444H6.94444C5.10266 6.94444 3.33632 7.67609 2.03398 8.97843C0.731644 10.2808 0 12.0471 0 13.8889V23.6111C0 24.3782 0.621827 25 1.38889 25C2.15595 25 2.77778 24.3782 2.77778 23.6111V13.8889C2.77778 12.7838 3.21676 11.724 3.99817 10.9426C4.77957 10.1612 5.83938 9.72222 6.94444 9.72222H20.258L15.6846 14.2957C15.1422 14.8381 15.1422 15.7175 15.6846 16.2599C16.227 16.8023 17.1064 16.8023 17.6488 16.2599L24.5932 9.31543C24.8611 9.04749 24.9967 8.69732 24.9999 8.34616C25 8.34189 25 8.33761 25 8.33333C25 8.32906 25 8.32478 24.9999 8.32051C24.9983 8.13686 24.961 7.96173 24.8946 7.80169C24.8268 7.63788 24.7264 7.4844 24.5932 7.35124L17.6488 0.406796Z"],twitter:["M21.351 2.5026C20.4177 1.5026 19.0844 0.835938 17.6177 0.835938C14.8177 0.835938 12.4844 3.16927 12.4844 6.1026C12.4844 6.5026 12.551 6.9026 12.6177 7.3026C8.35104 7.1026 4.61771 4.96927 2.08438 1.83594C1.61771 2.63594 1.41771 3.5026 1.41771 4.5026C1.41771 6.3026 2.35104 7.9026 3.68437 8.9026C2.81771 8.9026 2.08437 8.63594 1.35104 8.23594V8.3026C1.35104 10.8359 3.08438 12.9693 5.48438 13.4359C5.08438 13.5693 4.61771 13.6359 4.15104 13.6359C3.81771 13.6359 3.48438 13.6359 3.21771 13.5693C3.88438 15.6359 5.75104 17.1693 8.01771 17.2359C6.28438 18.6359 4.08438 19.5026 1.68438 19.5026C1.28438 19.5026 0.884375 19.5026 0.484375 19.4359C2.75104 20.9026 5.41771 21.7693 8.35104 21.7693C17.751 21.7693 22.951 13.7693 22.951 6.83594V6.16927C23.951 5.43594 24.8177 4.5026 25.4844 3.43594C24.551 3.83594 23.551 4.16927 22.551 4.23594C23.4177 3.5026 24.2177 2.5026 24.6177 1.23594C23.6177 1.83594 22.551 2.3026 21.351 2.5026Z"],add:["M12.5 2.27273C6.85163 2.27273 2.27273 6.85163 2.27273 12.5C2.27273 18.1484 6.85163 22.7273 12.5 22.7273C18.1484 22.7273 22.7273 18.1484 22.7273 12.5C22.7273 6.85163 18.1484 2.27273 12.5 2.27273ZM0 12.5C0 5.59644 5.59644 0 12.5 0C19.4036 0 25 5.59644 25 12.5C25 19.4036 19.4036 25 12.5 25C5.59644 25 0 19.4036 0 12.5Z","M12.5 7.29167C13.0753 7.29167 13.5417 7.75804 13.5417 8.33333V16.6667C13.5417 17.242 13.0753 17.7083 12.5 17.7083C11.9247 17.7083 11.4583 17.242 11.4583 16.6667V8.33333C11.4583 7.75804 11.9247 7.29167 12.5 7.29167Z","M7.29167 12.5C7.29167 11.9247 7.75804 11.4583 8.33333 11.4583H16.6667C17.242 11.4583 17.7083 11.9247 17.7083 12.5C17.7083 13.0753 17.242 13.5417 16.6667 13.5417H8.33333C7.75804 13.5417 7.29167 13.0753 7.29167 12.5Z"],addcolumn:["M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"],addrow:["M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"],view:["M12 3c5.392 0 9.878 3.88 10.819 9-.94 5.12-5.427 9-10.819 9-5.392 0-9.878-3.88-10.819-9C2.121 6.88 6.608 3 12 3zm0 16a9.005 9.005 0 0 0 8.777-7 9.005 9.005 0 0 0-17.554 0A9.005 9.005 0 0 0 12 19zm0-2.5a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9zm0-2a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"],table:["M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"],edit:["M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"],delete:["M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zM9 4v2h6V4H9z"],close:["M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-11.414L9.172 7.757 7.757 9.172 10.586 12l-2.829 2.828 1.415 1.415L12 13.414l2.828 2.829 1.415-1.415L13.414 12l2.829-2.828-1.415-1.415L12 10.586z"],arrowup:["M12 8l6 6H6z"],arrowdown:["M12 16l-6-6h12z"],arrowleft:["M8 12l6-6v12z"],arrowright:["M16 12l-6 6V6z"],search:["M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15z"],settings:["M2.132 13.63a9.942 9.942 0 0 1 0-3.26c1.102.026 2.092-.502 2.477-1.431.385-.93.058-2.004-.74-2.763a9.942 9.942 0 0 1 2.306-2.307c.76.798 1.834 1.125 2.764.74.93-.385 1.457-1.376 1.43-2.477a9.942 9.942 0 0 1 3.262 0c-.027 1.102.501 2.092 1.43 2.477.93.385 2.004.058 2.763-.74a9.942 9.942 0 0 1 2.307 2.306c-.798.76-1.125 1.834-.74 2.764.385.93 1.376 1.457 2.477 1.43a9.942 9.942 0 0 1 0 3.262c-1.102-.027-2.092.501-2.477 1.43-.385.93-.058 2.004.74 2.763a9.942 9.942 0 0 1-2.306 2.307c-.76-.798-1.834-1.125-2.764-.74-.93.385-1.457 1.376-1.43 2.477a9.942 9.942 0 0 1-3.262 0c.027-1.102-.501-2.092-1.43-2.477-.93-.385-2.004-.058-2.763.74a9.942 9.942 0 0 1-2.307-2.306c.798-.76 1.125-1.834.74-2.764-.385-.93-1.376-1.457-2.477-1.43zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"],preview:["M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zM10.622 8.415a.4.4 0 0 0-.622.332v6.506a.4.4 0 0 0 .622.332l4.879-3.252a.4.4 0 0 0 0-.666l-4.88-3.252z"],adduser:["M14 14.252V22H4a8 8 0 0 1 10-7.748zM12 13c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm6 4v-3h2v3h3v2h-3v3h-2v-3h-3v-2h3z"],plugin:["M13 18v2h6v2h-6a2 2 0 0 1-2-2v-2H8a4 4 0 0 1-4-4v-4h16v4a4 4 0 0 1-4 4h-3zm3-12h3a1 1 0 0 1 1 1v2H4V7a1 1 0 0 1 1-1h3V2h2v4h4V2h2v4zm-4 8.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"],help:["M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-7v2h2v-2h-2zm2-1.645A3.502 3.502 0 0 0 12 6.5a3.501 3.501 0 0 0-3.433 2.813l1.962.393A1.5 1.5 0 1 1 12 11.5a1 1 0 0 0-1 1V14h2v-.645z"],sortdescending:["M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"],sortascending:["M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"],calculate:["M4 2h16a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 2v16h14V4H5zm2 2h10v4H7V6zm0 6h2v2H7v-2zm0 4h2v2H7v-2zm4-4h2v2h-2v-2zm0 4h2v2h-2v-2zm4-4h2v6h-2v-6z"],filter:["M21 4v2h-1l-5 7.5V22H9v-8.5L4 6H3V4h18zM6.404 6L11 12.894V20h2v-7.106L17.596 6H6.404z"],addfill:["M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-11H7v2h4v4h2v-4h4v-2h-4V7h-2v4z"],group:["M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"],download:["M13 10h5l-6 6-6-6h5V3h2v7zm-9 9h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7z"],lightning:["M13 9h8L11 24v-9H4l9-15v9zm-2 2V7.22L7.532 13H13v4.394L17.263 11H11z"],closeline:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};function wE(e,t,n){const r=e.slice();return r[4]=t[n],r}function OE(e){let t,n;return{c(){t=ne("path"),this.h()},l(e){t=O(e,"path",{d:!0},1),N(t).forEach($),this.h()},h(){R(t,"d",n=e[4])},m(e,n){v(e,t,n)},p(e,r){1&r&&n!==(n=e[4])&&R(t,"d",n)},d(e){e&&$(t)}}}function NE(e){let t,n,r=e[0],a=[];for(let i=0;i{"name"in e&&n(2,i=e.name),"direction"in e&&n(3,o=e.direction)},e.$$.update=()=>{4&e.$$.dirty&&n(0,r=CE[i]||[]),8&e.$$.dirty&&n(1,a=45*RE.indexOf(o))},[r,a,i,o]}class AE extends m{constructor(e){super(),h(this,e,xE,NE,g,{name:2,direction:3})}}function IE(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,forAttr:e[1],$$slots:{default:[DE]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.forAttr=e[1]),2052&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function DE(e){let t;return{c(){t=G(e[2])},l(n){t=q(n,e[2])},m(e,n){v(e,t,n)},p(e,n){4&n&&Y(t,e[2])},d(e){e&&$(t)}}}function kE(e){let t,n,r,a,i,o,s,l,c,u,d=e[2]&&IE(e);const p=e[8].default,f=C(p,e,e[11],null);return s=new AE({props:{name:"arrowdown"}}),{c(){t=w("div"),d&&d.c(),n=k(),r=w("div"),a=w("select"),f&&f.c(),i=k(),o=w("div"),P(s.$$.fragment),this.h()},l(e){t=O(e,"DIV",{});var l=N(t);d&&d.l(l),n=M(l),r=O(l,"DIV",{class:!0});var c=N(r);a=O(c,"SELECT",{name:!0,disabled:!0,class:!0});var u=N(a);f&&f.l(u),u.forEach($),i=M(c),o=O(c,"DIV",{class:!0});var p=N(o);U(s.$$.fragment,p),p.forEach($),c.forEach($),l.forEach($),this.h()},h(){R(a,"name",e[1]),a.disabled=e[7],R(a,"class","svelte-s26xy7"),void 0===e[0]&&ae((()=>e[10].call(a))),x(a,"thin",e[3]),x(a,"extraThin",e[4]),x(a,"secondary",e[5]),x(a,"outline",e[6]),R(o,"class","pointer svelte-s26xy7"),R(r,"class","relative svelte-s26xy7")},m(p,m){v(p,t,m),d&&d.m(t,null),L(t,n),L(t,r),L(r,a),f&&f.m(a,null),ie(a,e[0]),L(r,i),L(r,o),F(s,o,null),l=!0,c||(u=[A(a,"change",e[9]),A(a,"change",e[10])],c=!0)},p(e,[r]){e[2]?d?(d.p(e,r),4&r&&S(d,1)):(d=IE(e),d.c(),S(d,1),d.m(t,n)):d&&(E(),b(d,1,1,(()=>{d=null})),y()),f&&f.p&&2048&r&&D(f,p,e,e[11],r,null,null),(!l||2&r)&&R(a,"name",e[1]),(!l||128&r)&&(a.disabled=e[7]),1&r&&ie(a,e[0]),8&r&&x(a,"thin",e[3]),16&r&&x(a,"extraThin",e[4]),32&r&&x(a,"secondary",e[5]),64&r&&x(a,"outline",e[6])},i(e){l||(S(d),S(f,e),S(s.$$.fragment,e),l=!0)},o(e){b(d),b(f,e),b(s.$$.fragment,e),l=!1},d(e){e&&$(t),d&&d.d(),f&&f.d(e),B(s),c=!1,j(u)}}}function ME(e,t,n){let{$$slots:r={},$$scope:a}=t,{value:i=""}=t,{name:o}=t,{label:s}=t,{thin:l=!1}=t,{extraThin:c=!1}=t,{secondary:u=!1}=t,{outline:d=!1}=t,{disabled:p=!1}=t;return e.$$set=e=>{"value"in e&&n(0,i=e.value),"name"in e&&n(1,o=e.name),"label"in e&&n(2,s=e.label),"thin"in e&&n(3,l=e.thin),"extraThin"in e&&n(4,c=e.extraThin),"secondary"in e&&n(5,u=e.secondary),"outline"in e&&n(6,d=e.outline),"disabled"in e&&n(7,p=e.disabled),"$$scope"in e&&n(11,a=e.$$scope)},[i,o,s,l,c,u,d,p,r,function(t){T(e,t)},function(){i=oe(this),n(0,i)},a]}class LE extends m{constructor(e){super(),h(this,e,ME,kE,g,{value:0,name:1,label:2,thin:3,extraThin:4,secondary:5,outline:6,disabled:7})}}const PE=e=>({}),UE=e=>({});function FE(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,forAttr:e[2],$$slots:{default:[BE]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.forAttr=e[2]),65538&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function BE(e){let t;return{c(){t=G(e[1])},l(n){t=q(n,e[1])},m(e,n){v(e,t,n)},p(e,n){2&n&&Y(t,e[1])},d(e){e&&$(t)}}}function GE(e){let t,n,r,a,i,o,s,l,c,u,d,p,f,m=e[1]&&FE(e);const h=e[12].default,g=C(h,e,e[16],null),_=e[12]["custom-input"],T=C(_,e,e[16],UE);return u=new AE({props:{name:"arrowdown"}}),{c(){m&&m.c(),t=k(),n=w("div"),r=w("select"),g&&g.c(),a=k(),T&&T.c(),i=k(),o=w("input"),l=k(),c=w("div"),P(u.$$.fragment),this.h()},l(e){m&&m.l(e),t=M(e),n=O(e,"DIV",{class:!0});var s=N(n);r=O(s,"SELECT",{name:!0,disabled:!0,class:!0});var d=N(r);g&&g.l(d),d.forEach($),a=M(s),T&&T.l(s),i=M(s),o=O(s,"INPUT",{disabled:!0,value:!0,type:!0,class:!0}),l=M(s),c=O(s,"DIV",{class:!0});var p=N(c);U(u.$$.fragment,p),p.forEach($),s.forEach($),this.h()},h(){R(r,"name",e[2]),r.disabled=e[7],R(r,"class","svelte-1qjxaky"),void 0===e[0]&&ae((()=>e[14].call(r))),x(r,"thin",e[3]),x(r,"extraThin",e[4]),x(r,"secondary",e[5]),o.disabled=e[7],o.value=s=e[0]||"",R(o,"type","text"),R(o,"class","svelte-1qjxaky"),x(o,"thin",e[3]),x(o,"extraThin",e[4]),x(o,"secondary",e[5]),x(o,"disabled",e[7]),R(c,"class","pointer editable-pointer svelte-1qjxaky"),R(n,"class","container svelte-1qjxaky"),x(n,"disabled",e[7]),x(n,"secondary",e[5]),x(n,"outline",e[6]),x(n,"focus",e[8])},m(s,h){m&&m.m(s,h),v(s,t,h),v(s,n,h),L(n,r),g&&g.m(r,null),ie(r,e[0]),L(n,a),T&&T.m(n,null),L(n,i),L(n,o),L(n,l),L(n,c),F(u,c,null),d=!0,p||(f=[A(r,"change",e[13]),A(r,"focus",e[10]),A(r,"blur",e[11]),A(r,"change",e[14]),A(o,"change",e[9]),A(o,"input",e[9]),A(o,"focus",e[10]),A(o,"blur",e[15])],p=!0)},p(e,[a]){e[1]?m?(m.p(e,a),2&a&&S(m,1)):(m=FE(e),m.c(),S(m,1),m.m(t.parentNode,t)):m&&(E(),b(m,1,1,(()=>{m=null})),y()),g&&g.p&&65536&a&&D(g,h,e,e[16],a,null,null),(!d||4&a)&&R(r,"name",e[2]),(!d||128&a)&&(r.disabled=e[7]),1&a&&ie(r,e[0]),8&a&&x(r,"thin",e[3]),16&a&&x(r,"extraThin",e[4]),32&a&&x(r,"secondary",e[5]),T&&T.p&&65536&a&&D(T,_,e,e[16],a,PE,UE),(!d||128&a)&&(o.disabled=e[7]),(!d||1&a&&s!==(s=e[0]||"")&&o.value!==s)&&(o.value=s),8&a&&x(o,"thin",e[3]),16&a&&x(o,"extraThin",e[4]),32&a&&x(o,"secondary",e[5]),128&a&&x(o,"disabled",e[7]),128&a&&x(n,"disabled",e[7]),32&a&&x(n,"secondary",e[5]),64&a&&x(n,"outline",e[6]),256&a&&x(n,"focus",e[8])},i(e){d||(S(m),S(g,e),S(T,e),S(u.$$.fragment,e),d=!0)},o(e){b(m),b(g,e),b(T,e),b(u.$$.fragment,e),d=!1},d(e){m&&m.d(e),e&&$(t),e&&$(n),g&&g.d(e),T&&T.d(e),B(u),p=!1,j(f)}}}function qE(e,t,n){let{$$slots:r={},$$scope:a}=t,{label:i}=t,{value:o=""}=t,{name:s}=t,{thin:l=!1}=t,{extraThin:c=!1}=t,{secondary:u=!1}=t,{outline:d=!1}=t,{disabled:p=!1}=t;const f=H();let m=!1;const h=e=>{n(0,o=e.target.value)};function g(e){n(8,m=!1),f("blur",e)}return e.$$set=e=>{"label"in e&&n(1,i=e.label),"value"in e&&n(0,o=e.value),"name"in e&&n(2,s=e.name),"thin"in e&&n(3,l=e.thin),"extraThin"in e&&n(4,c=e.extraThin),"secondary"in e&&n(5,u=e.secondary),"outline"in e&&n(6,d=e.outline),"disabled"in e&&n(7,p=e.disabled),"$$scope"in e&&n(16,a=e.$$scope)},[o,i,s,l,c,u,d,p,m,h,function(e){n(8,m=!0),f("focus",e)},g,r,function(t){T(e,t)},function(){o=oe(this),n(0,o)},e=>{h(e),g(e)},a]}class YE extends m{constructor(e){super(),h(this,e,qE,GE,g,{label:1,value:0,name:2,thin:3,extraThin:4,secondary:5,outline:6,disabled:7})}}const VE={IMAGE:["png","tiff","gif","raw","jpg","jpeg","svg"],CODE:["js","rs","py","java","rb","hs","yml"],DOCUMENT:["odf","docx","doc","pdf","csv"]};function jE(e){let t,n,r,a,i,o,s,l,c,u,d,p,f,m,h,g,_,E,b,y,S,T=e[4].name+"";function C(e,t){return e[4].size<=XE?zE:HE}let x=C(e),I=x(e),D=0!==e[2]&&WE(e),P=e[2]!==e[0].length-1&&QE(e);return{c(){t=w("ul"),n=w("li"),r=w("header"),a=w("div"),i=w("i"),s=k(),l=w("span"),c=G(T),u=k(),d=w("p"),I.c(),p=k(),f=w("div"),m=w("i"),h=k(),D&&D.c(),g=k(),_=w("img"),b=k(),P&&P.c(),this.h()},l(e){t=O(e,"UL",{class:!0});var o=N(t);n=O(o,"LI",{class:!0});var v=N(n);r=O(v,"HEADER",{class:!0});var E=N(r);a=O(E,"DIV",{class:!0});var y=N(a);i=O(y,"I",{class:!0}),N(i).forEach($),s=M(y),l=O(y,"SPAN",{class:!0});var S=N(l);c=q(S,T),S.forEach($),y.forEach($),u=M(E),d=O(E,"P",{class:!0});var C=N(d);I.l(C),C.forEach($),E.forEach($),p=M(v),f=O(v,"DIV",{class:!0});var w=N(f);m=O(w,"I",{class:!0}),N(m).forEach($),w.forEach($),h=M(v),D&&D.l(v),g=M(v),_=O(v,"IMG",{src:!0,class:!0}),b=M(v),P&&P.l(v),v.forEach($),o.forEach($),this.h()},h(){R(i,"class",o=se(e[6](e[4].extension))+" svelte-1j0ps18"),R(l,"class","filename svelte-1j0ps18"),R(a,"class","svelte-1j0ps18"),R(d,"class","svelte-1j0ps18"),R(r,"class","svelte-1j0ps18"),R(m,"class","ri-close-circle-fill svelte-1j0ps18"),R(f,"class","delete-button svelte-1j0ps18"),_.src!==(E=e[4].url)&&R(_,"src",E),R(_,"class","svelte-1j0ps18"),R(n,"class","svelte-1j0ps18"),R(t,"class","svelte-1j0ps18")},m(o,E){v(o,t,E),L(t,n),L(n,r),L(r,a),L(a,i),L(a,s),L(a,l),L(l,c),L(r,u),L(r,d),I.m(d,null),L(n,p),L(n,f),L(f,m),L(n,h),D&&D.m(n,null),L(n,g),L(n,_),L(n,b),P&&P.m(n,null),y||(S=A(f,"click",e[7]),y=!0)},p(e,t){16&t&&o!==(o=se(e[6](e[4].extension))+" svelte-1j0ps18")&&R(i,"class",o),16&t&&T!==(T=e[4].name+"")&&Y(c,T),x===(x=C(e))&&I?I.p(e,t):(I.d(1),I=x(e),I&&(I.c(),I.m(d,null))),0!==e[2]?D?D.p(e,t):(D=WE(e),D.c(),D.m(n,g)):D&&(D.d(1),D=null),16&t&&_.src!==(E=e[4].url)&&R(_,"src",E),e[2]!==e[0].length-1?P?P.p(e,t):(P=QE(e),P.c(),P.m(n,null)):P&&(P.d(1),P=null)},d(e){e&&$(t),I.d(),D&&D.d(),P&&P.d(),y=!1,S()}}}function HE(e){let t,n,r=e[4].size/XE+"";return{c(){t=G(r),n=G("MB")},l(e){t=q(e,r),n=q(e,"MB")},m(e,r){v(e,t,r),v(e,n,r)},p(e,n){16&n&&r!==(r=e[4].size/XE+"")&&Y(t,r)},d(e){e&&$(t),e&&$(n)}}}function zE(e){let t,n,r=e[4].size/ZE+"";return{c(){t=G(r),n=G("KB")},l(e){t=q(e,r),n=q(e,"KB")},m(e,r){v(e,t,r),v(e,n,r)},p(e,n){16&n&&r!==(r=e[4].size/ZE+"")&&Y(t,r)},d(e){e&&$(t),e&&$(n)}}}function WE(e){let t,n,r,a;return{c(){t=w("div"),n=w("i"),this.h()},l(e){t=O(e,"DIV",{class:!0});var r=N(t);n=O(r,"I",{class:!0}),N(n).forEach($),r.forEach($),this.h()},h(){R(n,"class","ri-arrow-left-circle-fill svelte-1j0ps18"),R(t,"class","nav left svelte-1j0ps18")},m(i,o){v(i,t,o),L(t,n),r||(a=A(t,"click",e[8]),r=!0)},p:Q,d(e){e&&$(t),r=!1,a()}}}function QE(e){let t,n,r,a;return{c(){t=w("div"),n=w("i"),this.h()},l(e){t=O(e,"DIV",{class:!0});var r=N(t);n=O(r,"I",{class:!0}),N(n).forEach($),r.forEach($),this.h()},h(){R(n,"class","ri-arrow-right-circle-fill svelte-1j0ps18"),R(t,"class","nav right svelte-1j0ps18")},m(i,o){v(i,t,o),L(t,n),r||(a=A(t,"click",e[9]),r=!0)},p:Q,d(e){e&&$(t),r=!1,a()}}}function KE(e){let t,n,r,a,i,o,s,l,c,u,d,p,f,m,h,g,_=e[4]&&jE(e),E=[{id:e[5]},{type:"file"},{multiple:!0},e[14]],b={};for(let v=0;ve.size>=l)))return void u(l,file);const t=await c(e);n(0,s=[...t,...s]),n(2,d=0)}return e.$$set=e=>{t=le(le({},t),pe(e)),n(14,i=de(t,a)),"icons"in e&&n(1,o=e.icons),"files"in e&&n(0,s=e.files),"fileSizeLimit"in e&&n(15,l=e.fileSizeLimit),"processFiles"in e&&n(16,c=e.processFiles),"handleFileTooLarge"in e&&n(17,u=e.handleFileTooLarge)},e.$$.update=()=>{5&e.$$.dirty&&n(4,r=s?s[d]:null)},[s,o,d,p,r,f,function(e){const t=e.toLowerCase();return VE.IMAGE.includes(t)?o.image:VE.CODE.includes(t)?o.code:o.file},async function(){s.splice(d,1),n(0,s),n(2,d=0)},function(){n(2,d-=1)},function(){n(2,d+=1)},function(e){m(e.target.files)},function(e){e.preventDefault(),n(3,p=!0)},function(e){e.preventDefault(),n(3,p=!1)},function(e){e.preventDefault(),m(e.dataTransfer.files),n(3,p=!1)},i,l,c,u]}class eb extends m{constructor(e){super(),h(this,e,JE,KE,g,{icons:1,files:0,fileSizeLimit:15,processFiles:16,handleFileTooLarge:17})}}function tb(e,t){function n(n){e.contains(n.target)||t()}return document.body.addEventListener("click",n,!0),{update(e){t=e},destroy(){document.body.removeEventListener("click",n,!0)}}}const nb=e=>({}),rb=e=>({}),ab=e=>({}),ib=e=>({}),ob=e=>({}),sb=e=>({});function lb(e){let t,n;return t=new fe({props:{$$slots:{default:[cb]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};65&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function cb(e){let t,n,r,a,i,o,s,l,c,u,d,p,f,m,h;const g=e[5].description,_=C(g,e,e[6],sb),E=e[5].buttons,y=C(E,e,e[6],ib),T=e[5].body,x=C(T,e,e[6],rb);return{c(){t=w("section"),n=w("header"),r=w("div"),a=w("div"),i=G(e[0]),o=k(),_&&_.c(),s=k(),l=w("div"),y&&y.c(),c=k(),u=w("i"),d=k(),x&&x.c(),this.h()},l(p){t=O(p,"SECTION",{class:!0});var f=N(t);n=O(f,"HEADER",{class:!0});var m=N(n);r=O(m,"DIV",{class:!0});var h=N(r);a=O(h,"DIV",{class:!0});var g=N(a);i=q(g,e[0]),g.forEach($),o=M(h),_&&_.l(h),h.forEach($),s=M(m),l=O(m,"DIV",{class:!0});var v=N(l);y&&y.l(v),c=M(v),u=O(v,"I",{class:!0}),N(u).forEach($),v.forEach($),m.forEach($),d=M(f),x&&x.l(f),f.forEach($),this.h()},h(){R(a,"class","title svelte-17gu2fn"),R(r,"class","text svelte-17gu2fn"),R(u,"class","ri-close-fill close svelte-17gu2fn"),R(l,"class","controls svelte-17gu2fn"),R(n,"class","svelte-17gu2fn"),R(t,"class","drawer svelte-17gu2fn")},m(p,g){v(p,t,g),L(t,n),L(n,r),L(r,a),L(a,i),L(r,o),_&&_.m(r,null),L(n,s),L(n,l),y&&y.m(l,null),L(l,c),L(l,u),L(t,d),x&&x.m(t,null),f=!0,m||(h=A(u,"click",e[1]),m=!0)},p(e,t){(!f||1&t)&&Y(i,e[0]),_&&_.p&&64&t&&D(_,g,e,e[6],t,ob,sb),y&&y.p&&64&t&&D(y,E,e,e[6],t,ab,ib),x&&x.p&&64&t&&D(x,T,e,e[6],t,nb,rb)},i(e){f||(S(_,e),S(y,e),S(x,e),ae((()=>{p||(p=me(t,he,{},!0)),p.run(1)})),f=!0)},o(e){b(_,e),b(y,e),b(x,e),p||(p=me(t,he,{},!1)),p.run(0),f=!1},d(e){e&&$(t),_&&_.d(e),y&&y.d(e),x&&x.d(e),e&&p&&p.end(),m=!1,h()}}}function ub(e){let t,n,r,a,i=e[2]&&lb(e);return{c(){i&&i.c(),t=_()},l(e){i&&i.l(e),t=_()},m(o,s){i&&i.m(o,s),v(o,t,s),n=!0,r||(a=A(window,"keydown",e[3]),r=!0)},p(e,[n]){e[2]?i?(i.p(e,n),4&n&&S(i,1)):(i=lb(e),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(E(),b(i,1,1,(()=>{i=null})),y())},i(e){n||(S(i),n=!0)},o(e){b(i),n=!1},d(e){i&&i.d(e),e&&$(t),r=!1,a()}}}function db(e,t,n){let{$$slots:r={},$$scope:a}=t,{title:i}=t,o=!1;function s(){o&&n(2,o=!1)}return e.$$set=e=>{"title"in e&&n(0,i=e.title),"$$scope"in e&&n(6,a=e.$$scope)},[i,s,o,function(e){o&&"Escape"===e.key&&s()},function(){o||n(2,o=!0)},r,a]}class pb extends m{constructor(e){super(),h(this,e,db,ub,g,{title:0,show:4,hide:1})}get show(){return this.$$.ctx[4]}get hide(){return this.$$.ctx[1]}}function fb(e){let t,n,r,a;const i=e[14].default,o=C(i,e,e[13],null);return{c(){t=w("button"),o&&o.c(),this.h()},l(e){t=O(e,"BUTTON",{disabled:!0,class:!0});var n=N(t);o&&o.l(n),n.forEach($),this.h()},h(){t.disabled=e[11],R(t,"class","svelte-e34rx5"),x(t,"active",e[0]),x(t,"small",e[2]),x(t,"medium",e[3]),x(t,"large",e[4]),x(t,"text",e[1]),x(t,"blue",e[5]),x(t,"green",e[6]),x(t,"yellow",e[7]),x(t,"purple",e[8]),x(t,"red",e[9]),x(t,"orange",e[10])},m(i,s){v(i,t,s),o&&o.m(t,null),n=!0,r||(a=A(t,"click",I(e[15])),r=!0)},p(e,r){o&&o.p&&8192&r&&D(o,i,e,e[13],r,null,null),(!n||2048&r)&&(t.disabled=e[11]),1&r&&x(t,"active",e[0]),4&r&&x(t,"small",e[2]),8&r&&x(t,"medium",e[3]),16&r&&x(t,"large",e[4]),2&r&&x(t,"text",e[1]),32&r&&x(t,"blue",e[5]),64&r&&x(t,"green",e[6]),128&r&&x(t,"yellow",e[7]),256&r&&x(t,"purple",e[8]),512&r&&x(t,"red",e[9]),1024&r&&x(t,"orange",e[10])},i(e){n||(S(o,e),n=!0)},o(e){b(o,e),n=!1},d(e){e&&$(t),o&&o.d(e),r=!1,a()}}}function mb(e){let t,n;const r=e[14].default,a=C(r,e,e[13],null);return{c(){t=w("a"),a&&a.c(),this.h()},l(e){t=O(e,"A",{href:!0,class:!0});var n=N(t);a&&a.l(n),n.forEach($),this.h()},h(){R(t,"href",e[12]),R(t,"class","svelte-e34rx5"),x(t,"active",e[0]),x(t,"small",e[2]),x(t,"medium",e[3]),x(t,"large",e[4]),x(t,"text",e[1]),x(t,"blue",e[5]),x(t,"green",e[6]),x(t,"yellow",e[7]),x(t,"purple",e[8]),x(t,"red",e[9]),x(t,"orange",e[10])},m(e,r){v(e,t,r),a&&a.m(t,null),n=!0},p(e,i){a&&a.p&&8192&i&&D(a,r,e,e[13],i,null,null),(!n||4096&i)&&R(t,"href",e[12]),1&i&&x(t,"active",e[0]),4&i&&x(t,"small",e[2]),8&i&&x(t,"medium",e[3]),16&i&&x(t,"large",e[4]),2&i&&x(t,"text",e[1]),32&i&&x(t,"blue",e[5]),64&i&&x(t,"green",e[6]),128&i&&x(t,"yellow",e[7]),256&i&&x(t,"purple",e[8]),512&i&&x(t,"red",e[9]),1024&i&&x(t,"orange",e[10])},i(e){n||(S(a,e),n=!0)},o(e){b(a,e),n=!1},d(e){e&&$(t),a&&a.d(e)}}}function hb(e){let t,n,r,a;const i=[mb,fb],o=[];function s(e,t){return e[12]?0:1}return t=s(e),n=o[t]=i[t](e),{c(){n.c(),r=_()},l(e){n.l(e),r=_()},m(e,n){o[t].m(e,n),v(e,r,n),a=!0},p(e,[a]){let l=t;t=s(e),t===l?o[t].p(e,a):(E(),b(o[l],1,1,(()=>{o[l]=null})),y(),n=o[t],n?n.p(e,a):(n=o[t]=i[t](e),n.c()),S(n,1),n.m(r.parentNode,r))},i(e){a||(S(n),a=!0)},o(e){b(n),a=!1},d(e){o[t].d(e),e&&$(r)}}}function gb(e,t,n){let{$$slots:r={},$$scope:a}=t,{active:i=!1}=t,{text:o=!1}=t,{small:s=!1}=t,{medium:l=!1}=t,{large:c=!1}=t,{blue:u=!1}=t,{green:d=!1}=t,{yellow:p=!1}=t,{purple:f=!1}=t,{red:m=!1}=t,{orange:h=!1}=t,{disabled:g=!1}=t,{href:_=!1}=t;return e.$$set=e=>{"active"in e&&n(0,i=e.active),"text"in e&&n(1,o=e.text),"small"in e&&n(2,s=e.small),"medium"in e&&n(3,l=e.medium),"large"in e&&n(4,c=e.large),"blue"in e&&n(5,u=e.blue),"green"in e&&n(6,d=e.green),"yellow"in e&&n(7,p=e.yellow),"purple"in e&&n(8,f=e.purple),"red"in e&&n(9,m=e.red),"orange"in e&&n(10,h=e.orange),"disabled"in e&&n(11,g=e.disabled),"href"in e&&n(12,_=e.href),"$$scope"in e&&n(13,a=e.$$scope)},[i,o,s,l,c,u,d,p,f,m,h,g,_,a,r,function(t){T(e,t)}]}class _b extends m{constructor(e){super(),h(this,e,gb,hb,g,{active:0,text:1,small:2,medium:3,large:4,blue:5,green:6,yellow:7,purple:8,red:9,orange:10,disabled:11,href:12})}}function vb(e){let t,n;return{c(){t=w("span"),n=G(e[2]),this.h()},l(r){t=O(r,"SPAN",{class:!0});var a=N(t);n=q(a,e[2]),a.forEach($),this.h()},h(){R(t,"class","text svelte-1aydi31"),x(t,"thin",e[5])},m(e,r){v(e,t,r),L(t,n)},p(e,r){4&r&&Y(n,e[2]),32&r&&x(t,"thin",e[5])},d(e){e&&$(t)}}}function Eb(e){let t,n,r,a,i,o,s,l,c,u=e[2]&&vb(e);return{c(){t=w("label"),n=w("div"),r=w("input"),a=k(),i=w("div"),o=w("div"),s=k(),u&&u.c(),this.h()},l(e){t=O(e,"LABEL",{for:!0,class:!0});var l=N(t);n=O(l,"DIV",{class:!0});var c=N(n);r=O(c,"INPUT",{id:!0,name:!0,type:!0,disabled:!0,class:!0}),a=M(c),i=O(c,"DIV",{class:!0});var d=N(i);o=O(d,"DIV",{class:!0}),N(o).forEach($),d.forEach($),c.forEach($),s=M(l),u&&u.l(l),l.forEach($),this.h()},h(){R(r,"id",e[1]),R(r,"name",e[1]),R(r,"type","checkbox"),r.disabled=e[3],R(r,"class","svelte-1aydi31"),x(r,"screenreader",e[4]),R(o,"class","thumb svelte-1aydi31"),R(i,"class","track svelte-1aydi31"),R(n,"class","toggle svelte-1aydi31"),R(t,"for",e[1]),R(t,"class","container svelte-1aydi31")},m(d,p){v(d,t,p),L(t,n),L(n,r),r.checked=e[0],L(n,a),L(n,i),L(i,o),L(t,s),u&&u.m(t,null),l||(c=[A(r,"change",e[7]),A(r,"change",e[6])],l=!0)},p(e,[n]){2&n&&R(r,"id",e[1]),2&n&&R(r,"name",e[1]),8&n&&(r.disabled=e[3]),1&n&&(r.checked=e[0]),16&n&&x(r,"screenreader",e[4]),e[2]?u?u.p(e,n):(u=vb(e),u.c(),u.m(t,null)):u&&(u.d(1),u=null),2&n&&R(t,"for",e[1])},i:Q,o:Q,d(e){e&&$(t),u&&u.d(),l=!1,j(c)}}}function bb(e,t,n){let{name:r}=t,{text:a=""}=t,{checked:i=!1}=t,{disabled:o=!1}=t,{screenreader:s=!0}=t,{thin:l=!1}=t;return e.$$set=e=>{"name"in e&&n(1,r=e.name),"text"in e&&n(2,a=e.text),"checked"in e&&n(0,i=e.checked),"disabled"in e&&n(3,o=e.disabled),"screenreader"in e&&n(4,s=e.screenreader),"thin"in e&&n(5,l=e.thin)},[i,r,a,o,s,l,function(t){T(e,t)},function(){i=this.checked,n(0,i)}]}class yb extends m{constructor(e){super(),h(this,e,bb,Eb,g,{name:1,text:2,checked:0,disabled:3,screenreader:4,thin:5})}}function Sb(e){let t,n,r,a,i,o,s,l,c,u;const d=e[6].default,p=C(d,e,e[5],null);return{c(){t=w("div"),n=w("input"),r=k(),a=w("div"),i=w("div"),o=w("div"),s=k(),p&&p.c(),this.h()},l(e){t=O(e,"DIV",{class:!0});var l=N(t);n=O(l,"INPUT",{disabled:!0,value:!0,type:!0,name:!0,class:!0,id:!0}),r=M(l),a=O(l,"DIV",{class:!0});var c=N(a);i=O(c,"DIV",{class:!0});var u=N(i);o=O(u,"DIV",{class:!0}),N(o).forEach($),u.forEach($),c.forEach($),s=M(l),p&&p.l(l),l.forEach($),this.h()},h(){n.disabled=e[3],n.__value=e[1],n.value=n.__value,R(n,"type","radio"),R(n,"name",e[2]),R(n,"class","checkbox svelte-debkjn"),R(n,"id",e[1]),e[8][0].push(n),R(o,"class","tick_mark svelte-debkjn"),R(i,"class","check-div svelte-debkjn"),x(i,"disabled",e[3]),x(i,"checked",e[0]===e[1]),R(a,"class","checkbox-container svelte-debkjn"),R(t,"class","container svelte-debkjn")},m(d,f){v(d,t,f),L(t,n),n.checked=n.__value===e[0],L(t,r),L(t,a),L(a,i),L(i,o),L(t,s),p&&p.m(t,null),l=!0,c||(u=[A(n,"change",e[4]),A(n,"change",e[7]),A(a,"click",e[4])],c=!0)},p(e,[t]){(!l||8&t)&&(n.disabled=e[3]),(!l||2&t)&&(n.__value=e[1],n.value=n.__value),(!l||4&t)&&R(n,"name",e[2]),(!l||2&t)&&R(n,"id",e[1]),1&t&&(n.checked=n.__value===e[0]),8&t&&x(i,"disabled",e[3]),3&t&&x(i,"checked",e[0]===e[1]),p&&p.p&&32&t&&D(p,d,e,e[5],t,null,null)},i(e){l||(S(p,e),l=!0)},o(e){b(p,e),l=!1},d(r){r&&$(t),e[8][0].splice(e[8][0].indexOf(n),1),p&&p.d(r),c=!1,j(u)}}}function $b(e,t,n){let{$$slots:r={},$$scope:a}=t;const i=H();let{value:o}=t,{group:s}=t,{name:l}=t,{disabled:c=!1}=t;return e.$$set=e=>{"value"in e&&n(1,o=e.value),"group"in e&&n(0,s=e.group),"name"in e&&n(2,l=e.name),"disabled"in e&&n(3,c=e.disabled),"$$scope"in e&&n(5,a=e.$$scope)},[s,o,l,c,function(){c||(n(0,s=o),i("change",s))},a,r,function(){s=this.__value,n(0,s)},[[]]]}class Tb extends m{constructor(e){super(),h(this,e,$b,Sb,g,{value:1,group:0,name:2,disabled:3})}}function Cb(e){let t,n,r;var a=e[1];return a&&(n=new a({})),{c(){t=w("span"),n&&P(n.$$.fragment),this.h()},l(e){t=O(e,"SPAN",{class:!0});var r=N(t);n&&U(n.$$.fragment,r),r.forEach($),this.h()},h(){R(t,"class","nav-item-icon svelte-1xizxux")},m(e,a){v(e,t,a),n&&F(n,t,null),r=!0},p(e,r){if(a!==(a=e[1])){if(n){E();const e=n;b(e.$$.fragment,1,0,(()=>{B(e,1)})),y()}a?(n=new a({}),P(n.$$.fragment),S(n.$$.fragment,1),F(n,t,null)):n=null}},i(e){r||(n&&S(n.$$.fragment,e),r=!0)},o(e){n&&b(n.$$.fragment,e),r=!1},d(e){e&&$(t),n&&B(n)}}}function wb(e){let t,n;return{c(){t=w("div"),n=G(e[2]),this.h()},l(r){t=O(r,"DIV",{class:!0});var a=N(t);n=q(a,e[2]),a.forEach($),this.h()},h(){R(t,"class","nav-item-title svelte-1xizxux")},m(e,r){v(e,t,r),L(t,n)},p(e,t){4&t&&Y(n,e[2])},d(e){e&&$(t)}}}function Ob(e){let t,n,r,a=e[1]&&Cb(e),i=e[2]&&wb(e);return{c(){t=w("a"),a&&a.c(),n=k(),i&&i.c(),this.h()},l(e){t=O(e,"A",{href:!0,target:!0,class:!0});var r=N(t);a&&a.l(r),n=M(r),i&&i.l(r),r.forEach($),this.h()},h(){R(t,"href",e[0]),R(t,"target","_blank"),R(t,"class","nav-item svelte-1xizxux"),x(t,"active",e[3])},m(e,o){v(e,t,o),a&&a.m(t,null),L(t,n),i&&i.m(t,null),r=!0},p(e,[o]){e[1]?a?(a.p(e,o),2&o&&S(a,1)):(a=Cb(e),a.c(),S(a,1),a.m(t,n)):a&&(E(),b(a,1,1,(()=>{a=null})),y()),e[2]?i?i.p(e,o):(i=wb(e),i.c(),i.m(t,null)):i&&(i.d(1),i=null),(!r||1&o)&&R(t,"href",e[0]),8&o&&x(t,"active",e[3])},i(e){r||(S(a),r=!0)},o(e){b(a),r=!1},d(e){e&&$(t),a&&a.d(),i&&i.d()}}}function Nb(e,t,n){let{href:r}=t,{icon:a}=t,{title:i}=t,{active:o=!1}=t;return e.$$set=e=>{"href"in e&&n(0,r=e.href),"icon"in e&&n(1,a=e.icon),"title"in e&&n(2,i=e.title),"active"in e&&n(3,o=e.active)},[r,a,i,o]}class Rb extends m{constructor(e){super(),h(this,e,Nb,Ob,g,{href:0,icon:1,title:2,active:3})}}function xb(e){let t,n,r,a,i,o,s,l,c,u,d,p,f,m=e[3](e[2])+"";const h=e[6].default,g=C(h,e,e[5],null);return{c(){t=w("div"),n=w("div"),r=w("div"),a=G(m),i=k(),o=w("div"),s=w("i"),c=k(),u=w("div"),g&&g.c(),this.h()},l(e){t=O(e,"DIV",{class:!0});var l=N(t);n=O(l,"DIV",{class:!0});var d=N(n);r=O(d,"DIV",{class:!0});var p=N(r);a=q(p,m),p.forEach($),i=M(d),o=O(d,"DIV",{class:!0});var f=N(o);s=O(f,"I",{class:!0}),N(s).forEach($),f.forEach($),d.forEach($),c=M(l),u=O(l,"DIV",{class:!0});var h=N(u);g&&g.l(h),h.forEach($),l.forEach($),this.h()},h(){R(r,"class","name svelte-85id1s"),x(r,"thin",e[1]),R(s,"class",l=e[0]?"ri-arrow-down-s-fill":"ri-arrow-left-s-fill"),R(o,"class","icon svelte-85id1s"),R(n,"class","property-group-name svelte-85id1s"),R(u,"class","property-panel svelte-85id1s"),x(u,"show",e[0]),R(t,"class","property-group-container svelte-85id1s"),x(t,"thin",e[1])},m(l,m){v(l,t,m),L(t,n),L(n,r),L(r,a),L(n,i),L(n,o),L(o,s),L(t,c),L(t,u),g&&g.m(u,null),d=!0,p||(f=A(n,"click",e[4]),p=!0)},p(e,[n]){(!d||4&n)&&m!==(m=e[3](e[2])+"")&&Y(a,m),2&n&&x(r,"thin",e[1]),(!d||1&n&&l!==(l=e[0]?"ri-arrow-down-s-fill":"ri-arrow-left-s-fill"))&&R(s,"class",l),g&&g.p&&32&n&&D(g,h,e,e[5],n,null,null),1&n&&x(u,"show",e[0]),2&n&&x(t,"thin",e[1])},i(e){d||(S(g,e),d=!0)},o(e){b(g,e),d=!1},d(e){e&&$(t),g&&g.d(e),p=!1,f()}}}function Ab(e,t,n){let{$$slots:r={},$$scope:a}=t;const i=H();let{thin:o=!1}=t,{name:s}=t,{show:l=!1}=t;return e.$$set=e=>{"thin"in e&&n(1,o=e.thin),"name"in e&&n(2,s=e.name),"show"in e&&n(0,l=e.show),"$$scope"in e&&n(5,a=e.$$scope)},[l,o,s,e=>e[0].toUpperCase()+e.slice(1),()=>{n(0,l=!l),l&&i("open")},a,r]}class Ib extends m{constructor(e){super(),h(this,e,Ab,xb,g,{thin:1,name:2,show:0})}}function Db(e,t,n){const r=e.slice();return r[6]=t[n],r}function kb(e){let t,n,r,a,i,o=e[6].title+"";function s(){return e[5](e[6])}return{c(){t=w("span"),n=G(o),r=k(),this.h()},l(e){t=O(e,"SPAN",{class:!0});var a=N(t);n=q(a,o),r=M(a),a.forEach($),this.h()},h(){R(t,"class","svelte-1aykd46"),x(t,"selected",e[0]===e[6].key)},m(e,o){v(e,t,o),L(t,n),L(t,r),a||(i=A(t,"click",s),a=!0)},p(r,a){e=r,2&a&&o!==(o=e[6].title+"")&&Y(n,o),3&a&&x(t,"selected",e[0]===e[6].key)},d(e){e&&$(t),a=!1,i()}}}function Mb(e){let t,n,r,a,i=e[1],o=[];for(let c=0;c{"headings"in e&&n(1,o=e.headings),"value"in e&&n(0,s=e.value),"$$scope"in e&&n(3,a=e.$$scope)},[s,o,i,a,r,e=>{n(0,s=e.key),i("change",{heading:e})}]}class Pb extends m{constructor(e){super(),h(this,e,Lb,Mb,g,{headings:1,value:0})}}function Ub(e,{anchor:t,align:n}){let r="top",a=0,i=o();function o(){const{bottom:n,top:i,left:o,width:s}=t.getBoundingClientRect(),l=window.innerHeight-n,c=e.getBoundingClientRect();let u;return i>l?(r="bottom",a=i-20,u=window.innerHeight-i):(r="top",u=n,a=l-20),{[r]:u,left:o,width:s,containerWidth:c.width}}function s(){return"right"===n?i.left+i.width-i.containerWidth:i.left}e.style.position="absolute",e.style.zIndex="9999",e.style.minWidth=`${i.width}px`,e.style.maxHeight=`${a.toFixed(0)}px`,e.style.transformOrigin=`center ${r}`,e.style[r]=`${i[r]}px`,e.style.left=`${s().toFixed(0)}px`;const l=new ResizeObserver((t=>{for(let n of t)i=o(),e.style[r]=`${i[r]}px`,e.style.left=`${s().toFixed(0)}px`}));return l.observe(t),l.observe(e),{destroy(){l.disconnect()}}}function Fb(e){let t,n;return t=new fe({props:{$$slots:{default:[Bb]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};539&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function Bb(e){let t,n,r,a,i;const o=e[8].default,s=C(o,e,e[9],null);return{c(){t=w("div"),s&&s.c(),this.h()},l(e){t=O(e,"DIV",{tabindex:!0,style:!0,class:!0});var n=N(t);s&&s.l(n),n.forEach($),this.h()},h(){R(t,"tabindex","0"),R(t,"style",e[4]),R(t,"class","menu-container svelte-hfi790"),x(t,"open",e[3])},m(o,l){v(o,t,l),s&&s.m(t,null),r=!0,a||(i=[V(n=Ub.call(null,t,{anchor:e[0],align:e[1]})),V(tb.call(null,t,e[2])),A(t,"keydown",e[5])],a=!0)},p(e,a){s&&s.p&&512&a&&D(s,o,e,e[9],a,null,null),(!r||16&a)&&R(t,"style",e[4]),n&&ge(n.update)&&3&a&&n.update.call(null,{anchor:e[0],align:e[1]}),8&a&&x(t,"open",e[3])},i(e){r||(S(s,e),r=!0)},o(e){b(s,e),r=!1},d(e){e&&$(t),s&&s.d(e),a=!1,j(i)}}}function Gb(e){let t,n,r=e[3]&&Fb(e);return{c(){r&&r.c(),t=_()},l(e){r&&r.l(e),t=_()},m(e,a){r&&r.m(e,a),v(e,t,a),n=!0},p(e,[n]){e[3]?r?(r.p(e,n),8&n&&S(r,1)):(r=Fb(e),r.c(),S(r,1),r.m(t.parentNode,t)):r&&(E(),b(r,1,1,(()=>{r=null})),y())},i(e){n||(S(r),n=!0)},o(e){b(r),n=!1},d(e){r&&r.d(e),e&&$(t)}}}function qb(e,t,n){let r,{$$slots:a={},$$scope:i}=t;const o=H();let{anchor:s}=t,{align:l="right"}=t,{borderColor:c=""}=t;const u=()=>{o("close"),n(3,d=!1)};let d=null;return e.$$set=e=>{"anchor"in e&&n(0,s=e.anchor),"align"in e&&n(1,l=e.align),"borderColor"in e&&n(6,c=e.borderColor),"$$scope"in e&&n(9,i=e.$$scope)},e.$$.update=()=>{64&e.$$.dirty&&n(4,r=function(e){let t="";for(let n in e)e[n]&&(t+=`${n.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}: ${e[n]}; `);return t}({borderColor:c}))},[s,l,u,d,r,function(e){d&&"Escape"===e.key&&u()},c,()=>{o("open"),n(3,d=!0)},a,i]}class Yb extends m{constructor(e){super(),h(this,e,qb,Gb,g,{anchor:0,align:1,borderColor:6,show:7,hide:2})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[2]}}function Vb(e){let t,n;return t=new fe({props:{$$slots:{default:[jb]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};139&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function jb(e){let t,n,r,a,i;const o=e[6].default,s=C(o,e,e[7],null);return{c(){t=w("div"),s&&s.c(),this.h()},l(e){t=O(e,"DIV",{tabindex:!0,class:!0});var n=N(t);s&&s.l(n),n.forEach($),this.h()},h(){R(t,"tabindex","0"),R(t,"class","menu-container svelte-150pfjd"),x(t,"open",e[3])},m(o,l){v(o,t,l),s&&s.m(t,null),r=!0,a||(i=[V(n=Ub.call(null,t,{anchor:e[0],align:e[1]})),V(tb.call(null,t,e[2])),A(t,"keydown",e[4])],a=!0)},p(e,r){s&&s.p&&128&r&&D(s,o,e,e[7],r,null,null),n&&ge(n.update)&&3&r&&n.update.call(null,{anchor:e[0],align:e[1]}),8&r&&x(t,"open",e[3])},i(e){r||(S(s,e),r=!0)},o(e){b(s,e),r=!1},d(e){e&&$(t),s&&s.d(e),a=!1,j(i)}}}function Hb(e){let t,n,r=e[3]&&Vb(e);return{c(){r&&r.c(),t=_()},l(e){r&&r.l(e),t=_()},m(e,a){r&&r.m(e,a),v(e,t,a),n=!0},p(e,[n]){e[3]?r?(r.p(e,n),8&n&&S(r,1)):(r=Vb(e),r.c(),S(r,1),r.m(t.parentNode,t)):r&&(E(),b(r,1,1,(()=>{r=null})),y())},i(e){n||(S(r),n=!0)},o(e){b(r),n=!1},d(e){r&&r.d(e),e&&$(t)}}}function zb(e,t,n){let{$$slots:r={},$$scope:a}=t;const i=H();let{anchor:o}=t,{align:s="right"}=t,l=null;const c=()=>{n(3,l=!1),i("hide")};return e.$$set=e=>{"anchor"in e&&n(0,o=e.anchor),"align"in e&&n(1,s=e.align),"$$scope"in e&&n(7,a=e.$$scope)},[o,s,c,l,function(e){l&&"Escape"===e.key&&c()},()=>{n(3,l=!0),i("show")},r,a]}class Wb extends m{constructor(e){super(),h(this,e,zb,Hb,g,{anchor:0,align:1,show:5,hide:2})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[2]}}function Qb(e){let t,n;const r=e[10].default,a=C(r,e,e[9],null);return{c(){t=w("p"),a&&a.c(),this.h()},l(e){t=O(e,"P",{class:!0});var n=N(t);a&&a.l(n),n.forEach($),this.h()},h(){R(t,"class","bb-body svelte-aqpcv8"),x(t,"extraSmall",e[0]),x(t,"small",e[1]),x(t,"medium",e[2]),x(t,"large",e[3]),x(t,"extraLarge",e[4]),x(t,"white",e[5]),x(t,"grey",e[6]),x(t,"black",e[7]),x(t,"lh",e[8])},m(e,r){v(e,t,r),a&&a.m(t,null),n=!0},p(e,[n]){a&&a.p&&512&n&&D(a,r,e,e[9],n,null,null),1&n&&x(t,"extraSmall",e[0]),2&n&&x(t,"small",e[1]),4&n&&x(t,"medium",e[2]),8&n&&x(t,"large",e[3]),16&n&&x(t,"extraLarge",e[4]),32&n&&x(t,"white",e[5]),64&n&&x(t,"grey",e[6]),128&n&&x(t,"black",e[7]),256&n&&x(t,"lh",e[8])},i(e){n||(S(a,e),n=!0)},o(e){b(a,e),n=!1},d(e){e&&$(t),a&&a.d(e)}}}function Kb(e,t,n){let{$$slots:r={},$$scope:a}=t,{extraSmall:i=!1}=t,{small:o=!1}=t,{medium:s=!1}=t,{large:l=!1}=t,{extraLarge:c=!1}=t,{white:u=!1}=t,{grey:d=!1}=t,{black:p=!1}=t,{lh:f=!1}=t;return e.$$set=e=>{"extraSmall"in e&&n(0,i=e.extraSmall),"small"in e&&n(1,o=e.small),"medium"in e&&n(2,s=e.medium),"large"in e&&n(3,l=e.large),"extraLarge"in e&&n(4,c=e.extraLarge),"white"in e&&n(5,u=e.white),"grey"in e&&n(6,d=e.grey),"black"in e&&n(7,p=e.black),"lh"in e&&n(8,f=e.lh),"$$scope"in e&&n(9,a=e.$$scope)},[i,o,s,l,c,u,d,p,f,a,r]}class Zb extends m{constructor(e){super(),h(this,e,Kb,Qb,g,{extraSmall:0,small:1,medium:2,large:3,extraLarge:4,white:5,grey:6,black:7,lh:8})}}function Xb(e){let t,n;const r=e[10].default,a=C(r,e,e[9],null);return{c(){t=w("h1"),a&&a.c(),this.h()},l(e){t=O(e,"H1",{class:!0});var n=N(t);a&&a.l(n),n.forEach($),this.h()},h(){R(t,"class","bb-heading svelte-1n0wwm3"),x(t,"extraSmall",e[0]),x(t,"small",e[1]),x(t,"medium",e[2]),x(t,"large",e[3]),x(t,"extraLarge",e[4]),x(t,"white",e[5]),x(t,"grey",e[6]),x(t,"black",e[7]),x(t,"lh",e[8])},m(e,r){v(e,t,r),a&&a.m(t,null),n=!0},p(e,[n]){a&&a.p&&512&n&&D(a,r,e,e[9],n,null,null),1&n&&x(t,"extraSmall",e[0]),2&n&&x(t,"small",e[1]),4&n&&x(t,"medium",e[2]),8&n&&x(t,"large",e[3]),16&n&&x(t,"extraLarge",e[4]),32&n&&x(t,"white",e[5]),64&n&&x(t,"grey",e[6]),128&n&&x(t,"black",e[7]),256&n&&x(t,"lh",e[8])},i(e){n||(S(a,e),n=!0)},o(e){b(a,e),n=!1},d(e){e&&$(t),a&&a.d(e)}}}function Jb(e,t,n){let{$$slots:r={},$$scope:a}=t,{extraSmall:i=!1}=t,{small:o=!1}=t,{medium:s=!1}=t,{large:l=!1}=t,{extraLarge:c=!1}=t,{white:u=!1}=t,{grey:d=!1}=t,{black:p=!1}=t,{lh:f=!1}=t;return e.$$set=e=>{"extraSmall"in e&&n(0,i=e.extraSmall),"small"in e&&n(1,o=e.small),"medium"in e&&n(2,s=e.medium),"large"in e&&n(3,l=e.large),"extraLarge"in e&&n(4,c=e.extraLarge),"white"in e&&n(5,u=e.white),"grey"in e&&n(6,d=e.grey),"black"in e&&n(7,p=e.black),"lh"in e&&n(8,f=e.lh),"$$scope"in e&&n(9,a=e.$$scope)},[i,o,s,l,c,u,d,p,f,a,r]}class ey extends m{constructor(e){super(),h(this,e,Jb,Xb,g,{extraSmall:0,small:1,medium:2,large:3,extraLarge:4,white:5,grey:6,black:7,lh:8})}}var ty="bbui-modal";function ny(e){let t,n;return t=new fe({props:{target:"body",$$slots:{default:[ry]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};263&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function ry(e){let t,n,r,a,i,o,s,l,c,u;const d=e[7].default,p=C(d,e,e[8],null);return{c(){t=w("div"),n=w("div"),r=w("div"),a=w("div"),p&&p.c(),this.h()},l(e){t=O(e,"DIV",{class:!0});var i=N(t);n=O(i,"DIV",{class:!0});var o=N(n);r=O(o,"DIV",{class:!0});var s=N(r);a=O(s,"DIV",{class:!0,style:!0});var l=N(a);p&&p.l(l),l.forEach($),s.forEach($),o.forEach($),i.forEach($),this.h()},h(){R(a,"class","modal svelte-anqb37"),R(a,"style",i=e[1]?`flex: 0 0 ${e[1]}`:""),x(a,"padding",e[0]),x(a,"border",e[2]),R(r,"class","content-wrapper svelte-anqb37"),R(n,"class","scroll-wrapper svelte-anqb37"),R(t,"class","overlay svelte-anqb37")},m(i,o){v(i,t,o),L(t,n),L(n,r),L(r,a),p&&p.m(a,null),l=!0,c||(u=[A(r,"click",ve(e[3])),A(n,"click",ve(e[3])),A(t,"click",ve(e[3]))],c=!0)},p(e,t){p&&p.p&&256&t&&D(p,d,e,e[8],t,null,null),(!l||2&t&&i!==(i=e[1]?`flex: 0 0 ${e[1]}`:""))&&R(a,"style",i),1&t&&x(a,"padding",e[0]),4&t&&x(a,"border",e[2])},i(e){l||(S(p,e),ae((()=>{o||(o=me(n,Ee,{y:30,duration:200},!0)),o.run(1)})),ae((()=>{s||(s=me(t,be,{duration:200},!0)),s.run(1)})),l=!0)},o(e){b(p,e),o||(o=me(n,Ee,{y:30,duration:200},!1)),o.run(0),s||(s=me(t,be,{duration:200},!1)),s.run(0),l=!1},d(e){e&&$(t),p&&p.d(e),e&&o&&o.end(),e&&s&&s.end(),c=!1,j(u)}}}function ay(e){let t,n,r,a,i=e[4]&&ny(e);return{c(){i&&i.c(),t=_()},l(e){i&&i.l(e),t=_()},m(o,s){i&&i.m(o,s),v(o,t,s),n=!0,r||(a=A(window,"keydown",e[5]),r=!0)},p(e,[n]){e[4]?i?(i.p(e,n),16&n&&S(i,1)):(i=ny(e),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(E(),b(i,1,1,(()=>{i=null})),y())},i(e){n||(S(i),n=!0)},o(e){b(i),n=!1},d(e){i&&i.d(e),e&&$(t),r=!1,a()}}}function iy(e,t,n){let{$$slots:r={},$$scope:a}=t;const i=H();let{padding:o=!0}=t,{width:s}=t,{border:l=!0}=t,c=!1;function u(){c||n(4,c=!0)}function d(){c&&n(4,c=!1)}return _e(ty,{show:u,hide:d}),e.$$set=e=>{"padding"in e&&n(0,o=e.padding),"width"in e&&n(1,s=e.width),"border"in e&&n(2,l=e.border),"$$scope"in e&&n(8,a=e.$$scope)},e.$$.update=()=>{16&e.$$.dirty&&i(c?"show":"hide")},[o,s,l,d,c,function(e){c&&"Escape"===e.key&&d()},u,r,a]}class oy extends m{constructor(e){super(),h(this,e,iy,ay,g,{padding:0,width:1,border:2,show:6,hide:3})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[3]}}const sy=e=>({}),ly=e=>({}),cy=e=>({}),uy=e=>({});function dy(e){let t,n,r,a,i,o;const s=e[13].header,l=C(s,e,e[14],uy);return{c(){t=w("header"),n=w("h5"),r=G(e[0]),a=k(),i=w("div"),l&&l.c(),this.h()},l(o){t=O(o,"HEADER",{class:!0});var s=N(t);n=O(s,"H5",{class:!0});var c=N(n);r=q(c,e[0]),c.forEach($),a=M(s),i=O(s,"DIV",{class:!0});var u=N(i);l&&l.l(u),u.forEach($),s.forEach($),this.h()},h(){R(n,"class","svelte-1lx4kbg"),R(i,"class","header-content svelte-1lx4kbg"),R(t,"class","svelte-1lx4kbg")},m(e,s){v(e,t,s),L(t,n),L(n,r),L(t,a),L(t,i),l&&l.m(i,null),o=!0},p(e,t){(!o||1&t)&&Y(r,e[0]),l&&l.p&&16384&t&&D(l,s,e,e[14],t,cy,uy)},i(e){o||(S(l,e),o=!0)},o(e){b(l,e),o=!1},d(e){e&&$(t),l&&l.d(e)}}}function py(e){let t,n,r,a,i,o;const s=e[13].footer,l=C(s,e,e[14],ly);let c=e[3]&&fy(e),u=e[4]&&hy(e);return{c(){t=w("footer"),n=w("div"),l&&l.c(),r=k(),a=w("div"),c&&c.c(),i=k(),u&&u.c(),this.h()},l(e){t=O(e,"FOOTER",{class:!0});var o=N(t);n=O(o,"DIV",{class:!0});var s=N(n);l&&l.l(s),s.forEach($),r=M(o),a=O(o,"DIV",{class:!0});var d=N(a);c&&c.l(d),i=M(d),u&&u.l(d),d.forEach($),o.forEach($),this.h()},h(){R(n,"class","footer-content svelte-1lx4kbg"),R(a,"class","buttons svelte-1lx4kbg"),R(t,"class","svelte-1lx4kbg")},m(e,s){v(e,t,s),L(t,n),l&&l.m(n,null),L(t,r),L(t,a),c&&c.m(a,null),L(a,i),u&&u.m(a,null),o=!0},p(e,t){l&&l.p&&16384&t&&D(l,s,e,e[14],t,sy,ly),e[3]?c?(c.p(e,t),8&t&&S(c,1)):(c=fy(e),c.c(),S(c,1),c.m(a,i)):c&&(E(),b(c,1,1,(()=>{c=null})),y()),e[4]?u?(u.p(e,t),16&t&&S(u,1)):(u=hy(e),u.c(),S(u,1),u.m(a,null)):u&&(E(),b(u,1,1,(()=>{u=null})),y())},i(e){o||(S(l,e),S(c),S(u),o=!0)},o(e){b(l,e),b(c),b(u),o=!1},d(e){e&&$(t),l&&l.d(e),c&&c.d(),u&&u.d()}}}function fy(e){let t,n;return t=new Zv({props:{secondary:!0,$$slots:{default:[my]},$$scope:{ctx:e}}}),t.$on("click",e[7]),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};16386&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function my(e){let t;return{c(){t=G(e[1])},l(n){t=q(n,e[1])},m(e,n){v(e,t,n)},p(e,n){2&n&&Y(t,e[1])},d(e){e&&$(t)}}}function hy(e){let t,n;const r=[{primary:!0},e[9],{disabled:e[6]}];let a={$$slots:{default:[gy]},$$scope:{ctx:e}};for(let i=0;i{o=null})),y()),l&&l.p&&16384&r&&D(l,s,e,e[14],r,null,null),e[3]||e[4]?c?(c.p(e,r),24&r&&S(c,1)):(c=py(e),c.c(),S(c,1),c.m(t,a)):c&&(E(),b(c,1,1,(()=>{c=null})),y()),e[5]?u?(u.p(e,r),32&r&&S(u,1)):(u=_y(e),u.c(),S(u,1),u.m(t,null)):u&&(E(),b(u,1,1,(()=>{u=null})),y())},i(e){i||(S(o),S(l,e),S(c),S(u),i=!0)},o(e){b(o),b(l,e),b(c),b(u),i=!1},d(e){e&&$(t),o&&o.d(),l&&l.d(e),c&&c.d(),u&&u.d()}}}function Ey(e,t,n){let r;const a=["title","cancelText","confirmText","showCancelButton","showConfirmButton","showCloseIcon","onConfirm","disabled"];let i=de(t,a),{$$slots:o={},$$scope:s}=t;H();let{title:l}=t,{cancelText:c="Cancel"}=t,{confirmText:u="Confirm"}=t,{showCancelButton:d=!0}=t,{showConfirmButton:p=!0}=t,{showCloseIcon:f=!0}=t,{onConfirm:m}=t,{disabled:h=!1}=t;const{hide:g}=Se(ty);let _=!1;return e.$$set=e=>{t=le(le({},t),pe(e)),n(9,i=de(t,a)),"title"in e&&n(0,l=e.title),"cancelText"in e&&n(1,c=e.cancelText),"confirmText"in e&&n(2,u=e.confirmText),"showCancelButton"in e&&n(3,d=e.showCancelButton),"showConfirmButton"in e&&n(4,p=e.showConfirmButton),"showCloseIcon"in e&&n(5,f=e.showCloseIcon),"onConfirm"in e&&n(10,m=e.onConfirm),"disabled"in e&&n(11,h=e.disabled),"$$scope"in e&&n(14,s=e.$$scope)},e.$$.update=()=>{6144&e.$$.dirty&&n(6,r=h||_)},[l,c,u,d,p,f,r,g,async function(){n(12,_=!0),m&&!1===await m()||g(),n(12,_=!1)},i,m,h,_,o,s]}class by extends m{constructor(e){super(),h(this,e,Ey,vy,g,{title:0,cancelText:1,confirmText:2,showCancelButton:3,showConfirmButton:4,showCloseIcon:5,onConfirm:10,disabled:11})}}function yy(e){let t;return{c(){t=w("spacer"),this.h()},l(e){t=O(e,"SPACER",{class:!0}),N(t).forEach($),this.h()},h(){R(t,"class","svelte-sxe0nr"),x(t,"extraSmall",e[0]),x(t,"small",e[1]),x(t,"medium",e[2]),x(t,"large",e[3]),x(t,"extraLarge",e[4])},m(e,n){v(e,t,n)},p(e,[n]){1&n&&x(t,"extraSmall",e[0]),2&n&&x(t,"small",e[1]),4&n&&x(t,"medium",e[2]),8&n&&x(t,"large",e[3]),16&n&&x(t,"extraLarge",e[4])},i:Q,o:Q,d(e){e&&$(t)}}}function Sy(e,t,n){let{extraSmall:r=!1}=t,{small:a=!1}=t,{medium:i=!1}=t,{large:o=!1}=t,{extraLarge:s=!1}=t;return e.$$set=e=>{"extraSmall"in e&&n(0,r=e.extraSmall),"small"in e&&n(1,a=e.small),"medium"in e&&n(2,i=e.medium),"large"in e&&n(3,o=e.large),"extraLarge"in e&&n(4,s=e.extraLarge)},[r,a,i,o,s]}class $y extends m{constructor(e){super(),h(this,e,Sy,yy,g,{extraSmall:0,small:1,medium:2,large:3,extraLarge:4})}}function Ty(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,$$slots:{default:[Cy]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};130&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function Cy(e){let t;return{c(){t=G(e[1])},l(n){t=q(n,e[1])},m(e,n){v(e,t,n)},p(e,n){2&n&&Y(t,e[1])},d(e){e&&$(t)}}}function wy(e){let t,n,r,a,i,o=e[1]&&Ty(e);function s(t){e[5](t)}let l={placeholder:e[2],options:e[4]};return void 0!==e[0]&&(l.value=e[0]),r=new $e({props:l}),W.push((()=>Te(r,"value",s))),r.$on("change",e[6]),{c(){t=w("div"),o&&o.c(),n=k(),P(r.$$.fragment),this.h()},l(e){t=O(e,"DIV",{class:!0});var a=N(t);o&&o.l(a),n=M(a),U(r.$$.fragment,a),a.forEach($),this.h()},h(){R(t,"class","svelte-1le7hs"),x(t,"thin",e[3])},m(e,a){v(e,t,a),o&&o.m(t,null),L(t,n),F(r,t,null),i=!0},p(e,[i]){e[1]?o?(o.p(e,i),2&i&&S(o,1)):(o=Ty(e),o.c(),S(o,1),o.m(t,n)):o&&(E(),b(o,1,1,(()=>{o=null})),y());const s={};4&i&&(s.placeholder=e[2]),!a&&1&i&&(a=!0,s.value=e[0],Ce((()=>a=!1))),r.$set(s),8&i&&x(t,"thin",e[3])},i(e){i||(S(o),S(r.$$.fragment,e),i=!0)},o(e){b(o),b(r.$$.fragment,e),i=!1},d(e){e&&$(t),o&&o.d(),B(r)}}}function Oy(e,t,n){let{label:r}=t,{placeholder:a}=t,{value:i}=t,{thin:o=!1}=t;return e.$$set=e=>{"label"in e&&n(1,r=e.label),"placeholder"in e&&n(2,a=e.placeholder),"value"in e&&n(0,i=e.value),"thin"in e&&n(3,o=e.thin)},[i,r,a,o,{enableTime:!0},function(e){i=e,n(0,i)},function(t){T(e,t)}]}class Ny extends m{constructor(e){super(),h(this,e,Oy,wy,g,{label:1,placeholder:2,value:0,thin:3})}}function Ry(e,t,n){const r=e.slice();return r[26]=t[n],r}function xy(e,t,n){const r=e.slice();return r[26]=t[n],r}function Ay(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,$$slots:{default:[Iy]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};8388610&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function Iy(e){let t;return{c(){t=G(e[1])},l(n){t=q(n,e[1])},m(e,n){v(e,t,n)},p(e,n){2&n&&Y(t,e[1])},d(e){e&&$(t)}}}function Dy(e){let t,n,r,a,i,o,s,l,c,u,d,p=e[26].name+"";function f(){return e[19](e[26])}return{c(){t=w("div"),n=w("span"),r=G(p),a=k(),i=w("div"),o=ne("svg"),s=ne("path"),this.h()},l(e){t=O(e,"DIV",{class:!0,"data-id":!0});var l=N(t);n=O(l,"SPAN",{class:!0});var c=N(n);r=q(c,p),c.forEach($),a=M(l),i=O(l,"DIV",{class:!0,title:!0});var u=N(i);o=O(u,"svg",{class:!0,xmlns:!0,width:!0,height:!0,viewBox:!0},1);var d=N(o);s=O(d,"path",{d:!0,class:!0},1),N(s).forEach($),d.forEach($),u.forEach($),l.forEach($),this.h()},h(){R(n,"class","svelte-f9fc90"),R(s,"d",qy),R(s,"class","svelte-f9fc90"),R(o,"class","icon-clear svelte-f9fc90"),R(o,"xmlns","http://www.w3.org/2000/svg"),R(o,"width","18"),R(o,"height","18"),R(o,"viewBox","0 0 24 24"),R(i,"class","token-remove svelte-f9fc90"),R(i,"title",l="Remove "+e[26].name),R(t,"class","token svelte-f9fc90"),R(t,"data-id",c=e[26].value),x(t,"extraThin",e[7])},m(l,c){v(l,t,c),L(t,n),L(n,r),L(t,a),L(t,i),L(i,o),L(o,s),u||(d=[A(i,"click",f),A(t,"click",ve(e[16]))],u=!0)},p(n,a){e=n,8192&a&&p!==(p=e[26].name+"")&&Y(r,p),8192&a&&l!==(l="Remove "+e[26].name)&&R(i,"title",l),8192&a&&c!==(c=e[26].value)&&R(t,"data-id",c),128&a&&x(t,"extraThin",e[7])},d(e){e&&$(t),u=!1,j(d)}}}function ky(e){let t;function n(e,t){return e[6]&&e[6].length?Ly:My}let r=n(e),a=r(e);return{c(){a.c(),t=_()},l(e){a.l(e),t=_()},m(e,n){a.m(e,n),v(e,t,n)},p(e,i){r===(r=n(e))&&a?a.p(e,i):(a.d(1),a=r(e),a&&(a.c(),a.m(t.parentNode,t)))},d(e){a.d(e),e&&$(t)}}}function My(e){let t,n;return{c(){t=w("div"),n=G(" "),this.h()},l(e){t=O(e,"DIV",{class:!0});var r=N(t);n=q(r," "),r.forEach($),this.h()},h(){R(t,"class","placeholder svelte-f9fc90")},m(e,r){v(e,t,r),L(t,n)},p:Q,d(e){e&&$(t)}}}function Ly(e){let t,n;return{c(){t=w("div"),n=G(e[6]),this.h()},l(r){t=O(r,"DIV",{class:!0});var a=N(t);n=q(a,e[6]),a.forEach($),this.h()},h(){R(t,"class","placeholder svelte-f9fc90"),x(t,"disabled",e[5])},m(e,r){v(e,t,r),L(t,n)},p(e,r){64&r&&Y(n,e[6]),32&r&&x(t,"disabled",e[5])},d(e){e&&$(t)}}}function Py(e){let t,n;return t=new fe({props:{$$slots:{default:[By]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};8393476&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function Uy(e){let t,n,r,a=e[26].name+"";return{c(){t=w("li"),n=G(a),this.h()},l(e){t=O(e,"LI",{"data-value":!0,class:!0});var r=N(t);n=q(r,a),r.forEach($),this.h()},h(){R(t,"data-value",r=e[26].value),R(t,"class","svelte-f9fc90"),x(t,"selected",e[9][e[26].value])},m(e,r){v(e,t,r),L(t,n)},p(e,i){256&i&&a!==(a=e[26].name+"")&&Y(n,a),256&i&&r!==(r=e[26].value)&&R(t,"data-value",r),768&i&&x(t,"selected",e[9][e[26].value])},d(e){e&&$(t)}}}function Fy(e){let t,n;return{c(){t=w("li"),n=G("No results"),this.h()},l(e){t=O(e,"LI",{class:!0});var r=N(t);n=q(r,"No results"),r.forEach($),this.h()},h(){R(t,"class","no-results svelte-f9fc90")},m(e,r){v(e,t,r),L(t,n)},d(e){e&&$(t)}}}function By(e){let t,n,r,a,i,o,s,l=e[8],c=[];for(let d=0;d{a||(a=me(t,Ee,{duration:200,y:5},!0)),a.run(1)})),i=!0)},o(e){a||(a=me(t,Ee,{duration:200,y:5},!1)),a.run(0),i=!1},d(e){e&&$(t),re(c,e),u&&u.d(),e&&a&&a.end(),o=!1,j(s)}}}function Gy(e){let t,n,r,a,i,o,s,l,c,u,d,p=e[1]&&Ay(e),f=e[13],m=[];for(let v=0;v{p=null})),y()),90240&r){let t;for(f=e[13],t=0;t{T=null})),y())},i(e){c||(S(p),S(_,e),S(T),c=!0)},o(e){b(p),b(_,e),b(T),c=!1},d(r){p&&p.d(r),r&&$(t),r&&$(n),re(m,r),h&&h.d(),_&&_.d(r),e[20](null),T&&T.d(),e[22](null),u=!1,d()}}}const qy="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";function Yy(e,t,n){let r,a,{$$slots:i={},$$scope:o}=t;const s=H();let l,c,{value:u=[]}=t,{label:d}=t,{align:p="left"}=t,{secondary:f=!1}=t,{outline:m=!1}=t,{disabled:h=!1}=t,{placeholder:g}=t,{extraThin:_=!1}=t,v=[],E=!1;function b(e){n(0,u=u.filter((t=>t!==e))),s("change",u)}function y(e){n(10,E=e)}we((()=>{const e=Array.from(l.querySelectorAll("option"));n(8,v=e.map((e=>({value:e.value,name:e.textContent}))))}));return e.$$set=e=>{"value"in e&&n(0,u=e.value),"label"in e&&n(1,d=e.label),"align"in e&&n(2,p=e.align),"secondary"in e&&n(3,f=e.secondary),"outline"in e&&n(4,m=e.outline),"disabled"in e&&n(5,h=e.disabled),"placeholder"in e&&n(6,g=e.placeholder),"extraThin"in e&&n(7,_=e.extraThin),"$$scope"in e&&n(23,o=e.$$scope)},e.$$.update=()=>{1&e.$$.dirty&&n(9,r=function(e){let t={};return e&&e.forEach((e=>{t[e]=!0})),t}(u)),768&e.$$.dirty&&n(13,a=v.filter((e=>r[e.value])))},[u,d,p,f,m,h,g,_,v,r,E,l,c,a,b,y,function(){y(!E)},function(e){const t=e.target.dataset.value;var a;null!=t&&(r[t]?b(t):(a=t,n(0,u=[...u,a]),s("change",u)))},i,e=>b(e.value),function(e){W[e?"unshift":"push"]((()=>{l=e,n(11,l)}))},()=>y(!1),function(e){W[e?"unshift":"push"]((()=>{c=e,n(12,c)}))},o]}class Vy extends m{constructor(e){super(),h(this,e,Yy,Gy,g,{value:0,label:1,align:2,secondary:3,outline:4,disabled:5,placeholder:6,extraThin:7})}}function jy(e){let t,n;return t=new eE({props:{extraSmall:!0,grey:!0,$$slots:{default:[zy]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};291&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function Hy(e){let t,n,r;return{c(){t=G("("),n=G(e[0]),r=G(")")},l(a){t=q(a,"("),n=q(a,e[0]),r=q(a,")")},m(e,a){v(e,t,a),v(e,n,a),v(e,r,a)},p(e,t){1&t&&Y(n,e[0])},d(e){e&&$(t),e&&$(n),e&&$(r)}}}function zy(e){let t,n,r,a=e[5]&&null!=e[0]&&Hy(e);return{c(){t=G(e[1]),n=k(),a&&a.c(),r=_()},l(i){t=q(i,e[1]),n=M(i),a&&a.l(i),r=_()},m(e,i){v(e,t,i),v(e,n,i),a&&a.m(e,i),v(e,r,i)},p(e,n){2&n&&Y(t,e[1]),e[5]&&null!=e[0]?a?a.p(e,n):(a=Hy(e),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null)},d(e){e&&$(t),e&&$(n),a&&a.d(e),e&&$(r)}}}function Wy(e){let t,n;return{c(){t=w("span"),n=G(e[2]),this.h()},l(r){t=O(r,"SPAN",{class:!0});var a=N(t);n=q(a,e[2]),a.forEach($),this.h()},h(){R(t,"class","svelte-1bwhxq3")},m(e,r){v(e,t,r),L(t,n)},p(e,t){4&t&&Y(n,e[2])},d(e){e&&$(t)}}}function Qy(e){let t,n;return{c(){t=w("span"),n=G(e[3]),this.h()},l(r){t=O(r,"SPAN",{class:!0});var a=N(t);n=q(a,e[3]),a.forEach($),this.h()},h(){R(t,"class","svelte-1bwhxq3")},m(e,r){v(e,t,r),L(t,n)},p(e,t){8&t&&Y(n,e[3])},d(e){e&&$(t)}}}function Ky(e){let t,n,r,a,i,o,s,l,c,u=e[1]&&jy(e),d=e[6]&&null!=e[2]&&Wy(e),p=e[6]&&null!=e[3]&&Qy(e);return{c(){t=w("div"),u&&u.c(),n=k(),r=w("div"),d&&d.c(),a=k(),i=w("input"),o=k(),p&&p.c(),this.h()},l(e){t=O(e,"DIV",{});var s=N(t);u&&u.l(s),n=M(s),r=O(s,"DIV",{class:!0});var l=N(r);d&&d.l(l),a=M(l),i=O(l,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),o=M(l),p&&p.l(l),l.forEach($),s.forEach($),this.h()},h(){R(i,"type","range"),R(i,"min",e[2]),R(i,"max",e[3]),R(i,"step",e[4]),R(i,"class","svelte-1bwhxq3"),R(r,"class","container svelte-1bwhxq3")},m(f,m){v(f,t,m),u&&u.m(t,null),L(t,n),L(t,r),d&&d.m(r,null),L(r,a),L(r,i),z(i,e[0]),L(r,o),p&&p.m(r,null),s=!0,l||(c=[A(i,"change",e[7]),A(i,"input",e[7])],l=!0)},p(e,[o]){e[1]?u?(u.p(e,o),2&o&&S(u,1)):(u=jy(e),u.c(),S(u,1),u.m(t,n)):u&&(E(),b(u,1,1,(()=>{u=null})),y()),e[6]&&null!=e[2]?d?d.p(e,o):(d=Wy(e),d.c(),d.m(r,a)):d&&(d.d(1),d=null),(!s||4&o)&&R(i,"min",e[2]),(!s||8&o)&&R(i,"max",e[3]),(!s||16&o)&&R(i,"step",e[4]),1&o&&z(i,e[0]),e[6]&&null!=e[3]?p?p.p(e,o):(p=Qy(e),p.c(),p.m(r,null)):p&&(p.d(1),p=null)},i(e){s||(S(u),s=!0)},o(e){b(u),s=!1},d(e){e&&$(t),u&&u.d(),d&&d.d(),p&&p.d(),l=!1,j(c)}}}function Zy(e,t,n){let{label:r}=t,{min:a=0}=t,{max:i=100}=t,{step:o=1}=t,{value:s}=t,{showValue:l=!1}=t,{showRange:c=!1}=t;return e.$$set=e=>{"label"in e&&n(1,r=e.label),"min"in e&&n(2,a=e.min),"max"in e&&n(3,i=e.max),"step"in e&&n(4,o=e.step),"value"in e&&n(0,s=e.value),"showValue"in e&&n(5,l=e.showValue),"showRange"in e&&n(6,c=e.showRange)},[s,r,a,i,o,l,c,function(){s=Oe(this.value),n(0,s)}]}class Xy extends m{constructor(e){super(),h(this,e,Zy,Ky,g,{label:1,min:2,max:3,step:4,value:0,showValue:5,showRange:6})}}(()=>{const e=d([]),t=(t,n="default")=>{e.update((e=>[...e,{id:"_"+Math.random().toString(36).substr(2,9),type:n,message:t}]))},n=f(e,((t,n)=>{if(n(t),t.length>0){const r=setTimeout((()=>{e.update((e=>(e.shift(),e))),n(t)}),3e3);return()=>{clearTimeout(r)}}})),{subscribe:r}=n})();const Jy=d({notifications:[]});function eS(e,t="default"){Jy.update((n=>(n.notifications=[...n.notifications,{id:p.generate(),type:t,message:e}],n)))}const tS=e=>eS(e,"danger"),nS=e=>eS(e,"info"),rS=e=>eS(e,"success");function aS(e){let t,n,r,a;return t=new eE({props:{small:!0,$$slots:{default:[iS]},$$scope:{ctx:e}}}),r=new $y({props:{medium:!0}}),{c(){P(t.$$.fragment),n=k(),P(r.$$.fragment)},l(e){U(t.$$.fragment,e),n=M(e),U(r.$$.fragment,e)},m(e,i){F(t,e,i),v(e,n,i),F(r,e,i),a=!0},p(e,n){const r={};67108866&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){a||(S(t.$$.fragment,e),S(r.$$.fragment,e),a=!0)},o(e){b(t.$$.fragment,e),b(r.$$.fragment,e),a=!1},d(e){B(t,e),e&&$(n),B(r,e)}}}function iS(e){let t;return{c(){t=G(e[1])},l(n){t=q(n,e[1])},m(e,n){v(e,t,n)},p(e,n){2&n&&Y(t,e[1])},d(e){e&&$(t)}}}function oS(e){let t,n,r,a,i,o=e[1]&&aS(e);return{c(){o&&o.c(),t=k(),n=w("div"),r=w("textarea"),this.h()},l(e){o&&o.l(e),t=M(e),n=O(e,"DIV",{style:!0,class:!0});var a=N(n);r=O(a,"TEXTAREA",{tabindex:!0,readonly:!0,value:!0,class:!0}),N(r).forEach($),a.forEach($),this.h()},h(){R(r,"tabindex","0"),r.readOnly=!0,r.value=e[0],R(r,"class","svelte-1tm9fq0"),R(n,"style",a=`--code-mirror-height: ${e[2]}px`),R(n,"class","svelte-1tm9fq0")},m(a,s){o&&o.m(a,s),v(a,t,s),v(a,n,s),L(n,r),e[13](r),i=!0},p(e,[s]){e[1]?o?(o.p(e,s),2&s&&S(o,1)):(o=aS(e),o.c(),S(o,1),o.m(t.parentNode,t)):o&&(E(),b(o,1,1,(()=>{o=null})),y()),(!i||1&s)&&(r.value=e[0]),(!i||4&s&&a!==(a=`--code-mirror-height: ${e[2]}px`))&&R(n,"style",a)},i(e){i||(S(o),i=!0)},o(e){b(o),i=!1},d(r){o&&o.d(r),r&&$(t),r&&$(n),e[13](null)}}}function sS(e){return new Promise((t=>setTimeout(t,e)))}function lS(e,t,n){let r;Ne(e,Uv,(e=>n(17,r=e)));const a=H(),i="tomorrow-night-eighties",o="default";let{label:s}=t,{value:l=""}=t,{readOnly:c=!1}=t,{lineNumbers:u=!0}=t,{tab:d=!0}=t,{mode:p}=t,{editorHeight:f=500}=t;const m={js:{name:"javascript",json:!1},json:{name:"javascript",json:!0},sql:{name:"sql"},svelte:{name:"handlebars",base:"text/html"}},h={};let g,_=!1,v=!1;ee((()=>(b(p).then((()=>{g&&g.setValue(l||"")})),()=>{v=!0,g&&g.toTextArea()})));let E=!0;async function b(e){if(v||!Re)return;g&&g.toTextArea();const t={lineNumbers:u,lineWrapping:!0,indentWithTabs:!0,indentUnit:2,tabSize:2,value:"",mode:m[e]||{name:e},readOnly:c,autoCloseBrackets:!0,autoCloseTags:!0,theme:r.darkMode?i:o};d||(t.extraKeys={Tab:d,"Shift-Tab":d}),E&&await sS(50),v||(n(12,g=Re.fromTextArea(h.editor,t)),g.on("change",(e=>{if(!_){const t=e.getValue();a("change",{value:t})}})),E&&await sS(50),g.refresh(),E=!1)}return e.$$set=e=>{"label"in e&&n(1,s=e.label),"value"in e&&n(0,l=e.value),"readOnly"in e&&n(5,c=e.readOnly),"lineNumbers"in e&&n(6,u=e.lineNumbers),"tab"in e&&n(7,d=e.tab),"mode"in e&&n(4,p=e.mode),"editorHeight"in e&&n(2,f=e.editorHeight)},e.$$.update=()=>{e.$$.dirty},[l,s,f,h,p,c,u,d,async function(e,t){t!==p&&await b(n(4,p=t)),n(0,l=e),_=!0,g&&g.setValue(l),_=!1},function(e){if(n(0,l=e),g){const{left:t,top:r}=g.getScrollInfo();g.setValue(n(0,l=e)),g.scrollTo(t,r)}},function(){g.refresh()},function(){g.focus()},g,function(e){W[e?"unshift":"push"]((()=>{h.editor=e,n(3,h)}))}]}class cS extends m{constructor(e){super(),h(this,e,lS,oS,g,{label:1,value:0,readOnly:5,lineNumbers:6,tab:7,mode:4,editorHeight:2,set:8,update:9,resize:10,focus:11})}get set(){return this.$$.ctx[8]}get update(){return this.$$.ctx[9]}get resize(){return this.$$.ctx[10]}get focus(){return this.$$.ctx[11]}}function uS(e,t,n){const r=e.slice();return r[9]=t[n],r[10]=t,r[11]=n,r}function dS(e){let t,n,r;function a(){return e[8](e[11])}return{c(){t=w("i"),this.h()},l(e){t=O(e,"I",{class:!0}),N(t).forEach($),this.h()},h(){R(t,"class","ri-close-circle-fill svelte-1oxhjp5")},m(e,i){v(e,t,i),n||(r=A(t,"click",a),n=!0)},p(t,n){e=t},d(e){e&&$(t),n=!1,r()}}}function pS(e){let t,n,r,a,i,o,s,l;function c(t){e[6](t,e[9])}let u={placeholder:"Key",thin:!0,outline:!0};function d(t){e[7](t,e[9])}void 0!==e[9].name&&(u.value=e[9].name),t=new uE({props:u}),W.push((()=>Te(t,"value",c)));let p={placeholder:"Value",thin:!0,outline:!0};void 0!==e[9].value&&(p.value=e[9].value),a=new uE({props:p}),W.push((()=>Te(a,"value",d)));let f=!e[0]&&dS(e);return{c(){P(t.$$.fragment),r=k(),P(a.$$.fragment),o=k(),f&&f.c(),s=_()},l(e){U(t.$$.fragment,e),r=M(e),U(a.$$.fragment,e),o=M(e),f&&f.l(e),s=_()},m(e,n){F(t,e,n),v(e,r,n),F(a,e,n),v(e,o,n),f&&f.m(e,n),v(e,s,n),l=!0},p(r,o){e=r;const l={};!n&&2&o&&(n=!0,l.value=e[9].name,Ce((()=>n=!1))),t.$set(l);const c={};!i&&2&o&&(i=!0,c.value=e[9].value,Ce((()=>i=!1))),a.$set(c),e[0]?f&&(f.d(1),f=null):f?f.p(e,o):(f=dS(e),f.c(),f.m(s.parentNode,s))},i(e){l||(S(t.$$.fragment,e),S(a.$$.fragment,e),l=!0)},o(e){b(t.$$.fragment,e),b(a.$$.fragment,e),l=!1},d(e){B(t,e),e&&$(r),B(a,e),e&&$(o),f&&f.d(e),e&&$(s)}}}function fS(e){let t,n;return t=new Zv({props:{secondary:!0,thin:!0,outline:!0,$$slots:{default:[mS]},$$scope:{ctx:e}}}),t.$on("click",e[2]),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function mS(e){let t;return{c(){t=G("Add")},l(e){t=q(e,"Add")},m(e,n){v(e,t,n)},d(e){e&&$(t)}}}function hS(e){let t,n,r,a,i=e[1],o=[];for(let c=0;cb(o[e],1,1,(()=>{o[e]=null}));let l=!e[0]&&fS(e);return{c(){t=w("div");for(let e=0;e{l=null})),y()):l?(l.p(e,n),1&n&&S(l,1)):(l=fS(e),l.c(),S(l,1),l.m(r.parentNode,r))},i(e){if(!a){for(let e=0;e({name:e,value:t})));function l(e){s.splice(e,1),n(1,s)}return e.$$set=e=>{"defaults"in e&&n(5,r=e.defaults),"object"in e&&n(4,a=e.object),"readOnly"in e&&n(0,o=e.readOnly)},e.$$.update=()=>{2&e.$$.dirty&&n(4,a=s.reduce(((e,t)=>i(i({},e),{[t.name]:t.value})),{}))},[o,s,function(){n(1,s=[...s,{}])},l,a,r,function(t,r){e.$$.not_equal(r.name,t)&&(r.name=t,n(1,s))},function(t,r){e.$$.not_equal(r.value,t)&&(r.value=t,n(1,s))},e=>l(e)]}class _S extends m{constructor(e){super(),h(this,e,gS,hS,g,{defaults:5,object:4,readOnly:0})}}function vS(e,t,n){const r=e.slice();return r[9]=t[n],r[10]=t,r[11]=n,r}function ES(e){var t,n;let r,a,i,o,s,l,c;function u(t){e[8](t,e[9])}a=new eE({props:{small:!0,$$slots:{default:[SS]},$$scope:{ctx:e}}});let d={placeholder:"Enter "+e[9],outline:!0,disabled:!e[2],type:null==(t=e[1].fields[e[9]])?void 0:t.type,required:null==(n=e[1].fields[e[9]])?void 0:n.required};return void 0!==e[0][e[9]]&&(d.value=e[0][e[9]]),o=new uE({props:d}),W.push((()=>Te(o,"value",u))),{c(){r=w("div"),P(a.$$.fragment),i=k(),P(o.$$.fragment),l=k(),this.h()},l(e){r=O(e,"DIV",{class:!0});var t=N(r);U(a.$$.fragment,t),i=M(t),U(o.$$.fragment,t),l=M(t),t.forEach($),this.h()},h(){R(r,"class","horizontal svelte-180a0qn")},m(e,t){v(e,r,t),F(a,r,null),L(r,i),F(o,r,null),L(r,l),c=!0},p(t,n){var r,i;e=t;const l={};4104&n&&(l.$$scope={dirty:n,ctx:e}),a.$set(l);const c={};8&n&&(c.placeholder="Enter "+e[9]),4&n&&(c.disabled=!e[2]),10&n&&(c.type=null==(r=e[1].fields[e[9]])?void 0:r.type),10&n&&(c.required=null==(i=e[1].fields[e[9]])?void 0:i.required),!s&&9&n&&(s=!0,c.value=e[0][e[9]],Ce((()=>s=!1))),o.$set(c)},i(e){c||(S(a.$$.fragment,e),S(o.$$.fragment,e),c=!0)},o(e){b(a.$$.fragment,e),b(o.$$.fragment,e),c=!1},d(e){e&&$(r),B(a),B(o)}}}function bS(e){let t,n,r,a,i,o;return n=new eE({props:{extraSmall:!0,grey:!0,$$slots:{default:[$S]},$$scope:{ctx:e}}}),a=new cS({props:{mode:"json",readOnly:!e[2],value:e[0][e[9]]}}),a.$on("change",(function(...t){return e[7](e[9],...t)})),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment),i=k()},l(e){t=O(e,"DIV",{});var o=N(t);U(n.$$.fragment,o),r=M(o),U(a.$$.fragment,o),i=M(o),o.forEach($)},m(e,s){v(e,t,s),F(n,t,null),L(t,r),F(a,t,null),L(t,i),o=!0},p(t,r){e=t;const i={};4104&r&&(i.$$scope={dirty:r,ctx:e}),n.$set(i);const o={};4&r&&(o.readOnly=!e[2]),9&r&&(o.value=e[0][e[9]]),a.$set(o)},i(e){o||(S(n.$$.fragment,e),S(a.$$.fragment,e),o=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),o=!1},d(e){e&&$(t),B(n),B(a)}}}function yS(e){let t,n,r,a,i,o,s,l,c;function u(t){e[6](t,e[9])}n=new eE({props:{small:!0,$$slots:{default:[TS]},$$scope:{ctx:e}}}),a=new $y({props:{small:!0}});let d={readOnly:!e[2]};return void 0!==e[0][e[9]]&&(d.object=e[0][e[9]]),o=new _S({props:d}),W.push((()=>Te(o,"object",u))),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment),i=k(),P(o.$$.fragment),l=k()},l(e){t=O(e,"DIV",{});var s=N(t);U(n.$$.fragment,s),r=M(s),U(a.$$.fragment,s),i=M(s),U(o.$$.fragment,s),l=M(s),s.forEach($)},m(e,s){v(e,t,s),F(n,t,null),L(t,r),F(a,t,null),L(t,i),F(o,t,null),L(t,l),c=!0},p(t,r){e=t;const a={};4104&r&&(a.$$scope={dirty:r,ctx:e}),n.$set(a);const i={};4&r&&(i.readOnly=!e[2]),!s&&9&r&&(s=!0,i.object=e[0][e[9]],Ce((()=>s=!1))),o.$set(i)},i(e){c||(S(n.$$.fragment,e),S(a.$$.fragment,e),S(o.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),b(o.$$.fragment,e),c=!1},d(e){e&&$(t),B(n),B(a),B(o)}}}function SS(e){let t,n=e[9]+"";return{c(){t=G(n)},l(e){t=q(e,n)},m(e,n){v(e,t,n)},p(e,r){8&r&&n!==(n=e[9]+"")&&Y(t,n)},d(e){e&&$(t)}}}function $S(e){let t,n=e[9]+"";return{c(){t=G(n)},l(e){t=q(e,n)},m(e,n){v(e,t,n)},p(e,r){8&r&&n!==(n=e[9]+"")&&Y(t,n)},d(e){e&&$(t)}}}function TS(e){let t,n=e[9]+"";return{c(){t=G(n)},l(e){t=q(e,n)},m(e,n){v(e,t,n)},p(e,r){8&r&&n!==(n=e[9]+"")&&Y(t,n)},d(e){e&&$(t)}}}function CS(e){let t,n,r,a;const i=[yS,bS,ES],o=[];function s(e,t){var n,r;return"object"===(null==(n=e[1].fields[e[9]])?void 0:n.type)?0:"json"===(null==(r=e[1].fields[e[9]])?void 0:r.type)?1:2}return t=s(e),n=o[t]=i[t](e),{c(){n.c(),r=_()},l(e){n.l(e),r=_()},m(e,n){o[t].m(e,n),v(e,r,n),a=!0},p(e,a){let l=t;t=s(e),t===l?o[t].p(e,a):(E(),b(o[l],1,1,(()=>{o[l]=null})),y(),n=o[t],n?n.p(e,a):(n=o[t]=i[t](e),n.c()),S(n,1),n.m(r.parentNode,r))},i(e){a||(S(n),a=!0)},o(e){b(n),a=!1},d(e){o[t].d(e),e&&$(r)}}}function wS(e){let t,n;return t=new cS({props:{label:"Query",mode:"json",readOnly:!e[2],value:e[0].customData}}),t.$on("change",e[4]),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.readOnly=!e[2]),1&n&&(r.value=e[0].customData),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function OS(e){let t,n,r,a,i,o,s,l=e[3],c=[];for(let p=0;pb(c[e],1,1,(()=>{c[e]=null}));let d=e[1].customisable&&wS(e);return{c(){t=w("form"),n=w("div");for(let e=0;e{d=null})),y())},i(e){if(!i){for(let e=0;e{"fields"in e&&n(0,a=e.fields),"schema"in e&&n(1,i=e.schema),"editable"in e&&n(2,o=e.editable)},e.$$.update=()=>{2&e.$$.dirty&&n(3,r=Object.keys(i.fields))},[a,i,o,r,function({detail:e}){n(0,a.customData=e.value,a)},function(t){T(e,t)},function(t,r){e.$$.not_equal(a[r],t)&&(a[r]=t,n(0,a))},(e,{detail:t})=>n(0,a[e]=t.value,a),function(t,r){e.$$.not_equal(a[r],t)&&(a[r]=t,n(0,a))}]}class RS extends m{constructor(e){super(),h(this,e,NS,OS,g,{fields:0,schema:1,editable:2})}}function xS(e){let t,n,r=e[0]._id,a=LS(e);return{c(){a.c(),t=_()},l(e){a.l(e),t=_()},m(e,r){a.m(e,r),v(e,t,r),n=!0},p(e,n){1&n&&g(r,r=e[0]._id)?(E(),b(a,1,1,Q),y(),a=LS(e),a.c(),S(a),a.m(t.parentNode,t)):a.p(e,n)},i(e){n||(S(a),n=!0)},o(e){b(a),n=!1},d(e){e&&$(t),a.d(e)}}}function AS(e){let t,n,r,a,i;function o(t){e[8](t)}let s={schema:e[1],editable:e[2]};void 0!==e[0].fields&&(s.fields=e[0].fields),t=new RS({props:s}),W.push((()=>Te(t,"fields",o)));let l=e[1].urlDisplay&&kS(e);return{c(){P(t.$$.fragment),r=k(),l&&l.c(),a=_()},l(e){U(t.$$.fragment,e),r=M(e),l&&l.l(e),a=_()},m(e,n){F(t,e,n),v(e,r,n),l&&l.m(e,n),v(e,a,n),i=!0},p(e,r){const i={};2&r&&(i.schema=e[1]),4&r&&(i.editable=e[2]),!n&&1&r&&(n=!0,i.fields=e[0].fields,Ce((()=>n=!1))),t.$set(i),e[1].urlDisplay?l?(l.p(e,r),2&r&&S(l,1)):(l=kS(e),l.c(),S(l,1),l.m(a.parentNode,a)):l&&(E(),b(l,1,1,(()=>{l=null})),y())},i(e){i||(S(t.$$.fragment,e),S(l),i=!0)},o(e){b(t.$$.fragment,e),b(l),i=!1},d(e){B(t,e),e&&$(r),l&&l.d(e),e&&$(a)}}}function IS(e){let t,n;return t=new cS({props:{editorHeight:e[3],label:"Query",mode:"json",readOnly:!e[2],value:e[0].fields.json,parameters:e[0].parameters}}),t.$on("change",e[6]),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.editorHeight=e[3]),4&n&&(r.readOnly=!e[2]),1&n&&(r.value=e[0].fields.json),1&n&&(r.parameters=e[0].parameters),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function DS(e){let t,n;return t=new cS({props:{editorHeight:e[3],label:"Query",mode:"sql",readOnly:!e[2],value:e[0].fields.sql,parameters:e[0].parameters}}),t.$on("change",e[6]),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.editorHeight=e[3]),4&n&&(r.readOnly=!e[2]),1&n&&(r.value=e[0].fields.sql),1&n&&(r.parameters=e[0].parameters),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function kS(e){let t,n,r,a,i;return n=new eE({props:{small:!0,$$slots:{default:[MS]},$$scope:{ctx:e}}}),a=new uE({props:{thin:!0,outline:!0,disabled:!0,value:e[4]}}),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment),this.h()},l(e){t=O(e,"DIV",{class:!0});var i=N(t);U(n.$$.fragment,i),r=M(i),U(a.$$.fragment,i),i.forEach($),this.h()},h(){R(t,"class","url-row svelte-59z4gq")},m(e,o){v(e,t,o),F(n,t,null),L(t,r),F(a,t,null),i=!0},p(e,t){const r={};512&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};16&t&&(i.value=e[4]),a.$set(i)},i(e){i||(S(n.$$.fragment,e),S(a.$$.fragment,e),i=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),i=!1},d(e){e&&$(t),B(n),B(a)}}}function MS(e){let t;return{c(){t=G("URL")},l(e){t=q(e,"URL")},m(e,n){v(e,t,n)},d(e){e&&$(t)}}}function LS(e){let t,n,r,a;const i=[DS,IS,AS],o=[];function s(e,t){return e[1].type===e[5].SQL?0:e[1].type===e[5].JSON?1:e[1].type===e[5].FIELDS?2:-1}return~(t=s(e))&&(n=o[t]=i[t](e)),{c(){n&&n.c(),r=_()},l(e){n&&n.l(e),r=_()},m(e,n){~t&&o[t].m(e,n),v(e,r,n),a=!0},p(e,a){let l=t;t=s(e),t===l?~t&&o[t].p(e,a):(n&&(E(),b(o[l],1,1,(()=>{o[l]=null})),y()),~t?(n=o[t],n?n.p(e,a):(n=o[t]=i[t](e),n.c()),S(n,1),n.m(r.parentNode,r)):n=null)},i(e){a||(S(n),a=!0)},o(e){b(n),a=!1},d(e){~t&&o[t].d(e),e&&$(r)}}}function PS(e){let t,n,r=e[1]&&xS(e);return{c(){r&&r.c(),t=_()},l(e){r&&r.l(e),t=_()},m(e,a){r&&r.m(e,a),v(e,t,a),n=!0},p(e,[n]){e[1]?r?(r.p(e,n),2&n&&S(r,1)):(r=xS(e),r.c(),S(r,1),r.m(t.parentNode,t)):r&&(E(),b(r,1,1,(()=>{r=null})),y())},i(e){n||(S(r),n=!0)},o(e){b(r),n=!1},d(e){r&&r.d(e),e&&$(t)}}}function US(e,t,n){let r;let{query:a}=t,{datasource:i}=t,{schema:o}=t,{editable:s=!0}=t,{height:l=500}=t;return e.$$set=e=>{"query"in e&&n(0,a=e.query),"datasource"in e&&n(7,i=e.datasource),"schema"in e&&n(1,o=e.schema),"editable"in e&&n(2,s=e.editable),"height"in e&&n(3,l=e.height)},e.$$.update=()=>{131&e.$$.dirty&&n(4,r=o.urlDisplay&&`${i.config.url}${a.fields.path}${a.fields.queryString}`)},[a,o,s,l,r,{SQL:"sql",JSON:"json",FIELDS:"fields"},function({detail:e}){n(0,a.fields[o.type]=e.value,a)},i,function(t){e.$$.not_equal(a.fields,t)&&(a.fields=t,n(0,a))}]}class FS extends m{constructor(e){super(),h(this,e,US,PS,g,{query:0,datasource:7,schema:1,editable:2,height:3})}}async function BS(e,t){const n=`/api/${t}/rows`,r=await ht.post(n,e);return await r.json()}function GS(e){let t,n,r;return n=new xe({props:{size:e[0],color:"var(--ink)",unit:"px"}}),{c(){t=w("div"),P(n.$$.fragment),this.h()},l(e){t=O(e,"DIV",{class:!0});var r=N(t);U(n.$$.fragment,r),r.forEach($),this.h()},h(){R(t,"class","spinner-container svelte-1wtx5yq")},m(e,a){v(e,t,a),F(n,t,null),r=!0},p(e,[t]){const r={};1&t&&(r.size=e[0]),n.$set(r)},i(e){r||(S(n.$$.fragment,e),r=!0)},o(e){b(n.$$.fragment,e),r=!1},d(e){e&&$(t),B(n)}}}function qS(e,t,n){let{size:r="60"}=t;return e.$$set=e=>{"size"in e&&n(0,r=e.size)},[r]}class YS extends m{constructor(e){super(),h(this,e,qS,GS,g,{size:0})}}function VS(e){let t,n,r,a;const i=e[9].default,o=C(i,e,e[11],null);return{c(){t=w("div"),n=G(e[1]),r=k(),o&&o.c(),this.h()},l(a){t=O(a,"DIV",{class:!0});var i=N(t);n=q(i,e[1]),r=M(i),o&&o.l(i),i.forEach($),this.h()},h(){R(t,"class","body svelte-1ig5q72")},m(e,i){v(e,t,i),L(t,n),L(t,r),o&&o.m(t,null),a=!0},p(e,t){(!a||2&t)&&Y(n,e[1]),o&&o.p&&2048&t&&D(o,i,e,e[11],t,null,null)},i(e){a||(S(o,e),a=!0)},o(e){b(o,e),a=!1},d(e){e&&$(t),o&&o.d(e)}}}function jS(e){let t,n;return t=new by({props:{onConfirm:e[4],title:e[0],confirmText:e[2],cancelText:e[3],red:!0,$$slots:{default:[VS]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};16&n&&(r.onConfirm=e[4]),1&n&&(r.title=e[0]),4&n&&(r.confirmText=e[2]),8&n&&(r.cancelText=e[3]),2050&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function HS(e){let t,n;return t=new oy({props:{$$slots:{default:[jS]},$$scope:{ctx:e}}}),e[10](t),t.$on("hide",(function(){ge(e[5])&&e[5].apply(this,arguments)})),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(n,[r]){e=n;const a={};2079&r&&(a.$$scope={dirty:r,ctx:e}),t.$set(a)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(n){e[10](null),B(t,n)}}}function zS(e,t,n){let r,{$$slots:a={},$$scope:i}=t,{title:o=""}=t,{body:s=""}=t,{okText:l="Confirm"}=t,{cancelText:c="Cancel"}=t,{onOk:u}=t,{onCancel:d}=t;return e.$$set=e=>{"title"in e&&n(0,o=e.title),"body"in e&&n(1,s=e.body),"okText"in e&&n(2,l=e.okText),"cancelText"in e&&n(3,c=e.cancelText),"onOk"in e&&n(4,u=e.onOk),"onCancel"in e&&n(5,d=e.onCancel),"$$scope"in e&&n(11,i=e.$$scope)},[o,s,l,c,u,d,r,()=>{r.show()},()=>{r.hide()},a,function(e){W[e?"unshift":"push"]((()=>{r=e,n(6,r)}))},i]}class WS extends m{constructor(e){super(),h(this,e,zS,HS,g,{title:0,body:1,okText:2,cancelText:3,onOk:4,onCancel:5,show:7,hide:8})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[8]}}function QS(e){let t,n,r,a,i,o=e[0].length+"";return t=new AE({props:{name:"delete"}}),{c(){P(t.$$.fragment),n=G("\n Delete\n "),r=G(o),a=G("\n row(s)")},l(e){U(t.$$.fragment,e),n=q(e,"\n Delete\n "),r=q(e,o),a=q(e,"\n row(s)")},m(e,o){F(t,e,o),v(e,n,o),v(e,r,o),v(e,a,o),i=!0},p(e,t){(!i||1&t)&&o!==(o=e[0].length+"")&&Y(r,o)},i(e){i||(S(t.$$.fragment,e),i=!0)},o(e){b(t.$$.fragment,e),i=!1},d(e){B(t,e),e&&$(n),e&&$(r),e&&$(a)}}}function KS(e){let t,n,r,a,i,o=e[0].length+"",s=e[0].length>1?"s":"";return{c(){t=G("Are you sure you want to delete\n "),n=G(o),r=G("\n row"),a=G(s),i=G("?")},l(e){t=q(e,"Are you sure you want to delete\n "),n=q(e,o),r=q(e,"\n row"),a=q(e,s),i=q(e,"?")},m(e,o){v(e,t,o),v(e,n,o),v(e,r,o),v(e,a,o),v(e,i,o)},p(e,t){1&t&&o!==(o=e[0].length+"")&&Y(n,o),1&t&&s!==(s=e[0].length>1?"s":"")&&Y(a,s)},d(e){e&&$(t),e&&$(n),e&&$(r),e&&$(a),e&&$(i)}}}function ZS(e){let t,n,r,a,i;n=new _b({props:{small:!0,text:!0,$$slots:{default:[QS]},$$scope:{ctx:e}}}),n.$on("click",(function(){ge(e[1].show)&&e[1].show.apply(this,arguments)}));let o={okText:"Delete",onOk:e[2],title:"Confirm Deletion",$$slots:{default:[KS]},$$scope:{ctx:e}};return a=new WS({props:o}),e[4](a),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment)},l(e){t=O(e,"DIV",{});var i=N(t);U(n.$$.fragment,i),i.forEach($),r=M(e),U(a.$$.fragment,e)},m(e,o){v(e,t,o),F(n,t,null),v(e,r,o),F(a,e,o),i=!0},p(t,[r]){e=t;const i={};33&r&&(i.$$scope={dirty:r,ctx:e}),n.$set(i);const o={};33&r&&(o.$$scope={dirty:r,ctx:e}),a.$set(o)},i(e){i||(S(n.$$.fragment,e),S(a.$$.fragment,e),i=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),i=!1},d(i){i&&$(t),B(n),i&&$(r),e[4](null),B(a,i)}}}function XS(e,t,n){let r,{selectedRows:a}=t,{deleteRows:i}=t;return e.$$set=e=>{"selectedRows"in e&&n(0,a=e.selectedRows),"deleteRows"in e&&n(3,i=e.deleteRows)},[a,r,async function(){await i(),r.hide()},i,function(e){W[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class JS extends m{constructor(e){super(),h(this,e,XS,ZS,g,{selectedRows:0,deleteRows:3})}}const e$={STRING:{name:"Text",icon:"ri-text",type:"string",constraints:{type:"string",length:{},presence:!1}},LONGFORM:{name:"Long Form Text",icon:"ri-file-text-line",type:"longform",constraints:{type:"string",length:{},presence:!1}},OPTIONS:{name:"Options",icon:"ri-list-check-2",type:"options",constraints:{type:"string",presence:!1,inclusion:[]}},NUMBER:{name:"Number",icon:"ri-number-1",type:"number",constraints:{type:"number",presence:!1,numericality:{greaterThanOrEqualTo:"",lessThanOrEqualTo:""}}},BOOLEAN:{name:"Boolean",icon:"ri-toggle-line",type:"boolean",constraints:{type:"boolean",presence:!1}},DATETIME:{name:"Date/Time",icon:"ri-calendar-event-fill",type:"datetime",constraints:{type:"string",length:{},presence:!1,datetime:{latest:"",earliest:""}}},ATTACHMENT:{name:"Attachment",icon:"ri-file-line",type:"attachment",constraints:{type:"array",presence:!1}},LINK:{name:"Relationship",icon:"ri-link",type:"link",constraints:{type:"array",presence:!1}}},t$={AUTO_ID:"autoID",CREATED_BY:"createdBy",CREATED_AT:"createdAt",UPDATED_BY:"updatedBy",UPDATED_AT:"updatedAt"},n$={AUTO_ID:"Auto ID",CREATED_BY:"Created By",CREATED_AT:"Created At",UPDATED_BY:"Updated By",UPDATED_AT:"Updated At"},r$={IMAGE:["png","tiff","gif","raw","jpg","jpeg"],CODE:["js","rs","py","java","rb","hs","yml"],DOCUMENT:["odf","docx","doc","pdf","csv"]},a$="cloud",i$="self";const o$="many-to-many",s$="one-to-many",l$="many-to-one";function c$(e,t,n){const r=e.slice();return r[3]=t[n],r}function u$(e){let t,n,r,a,i,o,s,l,c=e[3].extension+"",u=e[3].name+"";return{c(){t=w("span"),n=G("."),r=G(c),a=k(),i=w("i"),o=k(),s=w("span"),l=G(u),this.h()},l(e){t=O(e,"SPAN",{class:!0});var d=N(t);n=q(d,"."),r=q(d,c),d.forEach($),a=M(e),i=O(e,"I",{class:!0}),N(i).forEach($),o=M(e),s=O(e,"SPAN",{class:!0});var p=N(s);l=q(p,u),p.forEach($),this.h()},h(){R(t,"class","extension svelte-1ia2qq9"),R(i,"class","ri-file-line svelte-1ia2qq9"),R(s,"class","svelte-1ia2qq9")},m(e,c){v(e,t,c),L(t,n),L(t,r),v(e,a,c),v(e,i,c),v(e,o,c),v(e,s,c),L(s,l)},p(e,t){1&t&&c!==(c=e[3].extension+"")&&Y(r,c),1&t&&u!==(u=e[3].name+"")&&Y(l,u)},d(e){e&&$(t),e&&$(a),e&&$(i),e&&$(o),e&&$(s)}}}function d$(e){let t,n;return{c(){t=w("img"),this.h()},l(e){t=O(e,"IMG",{width:!0,height:!0,src:!0,class:!0}),this.h()},h(){R(t,"width",e[2]),R(t,"height",e[1]),t.src!==(n=e[3].url)&&R(t,"src",n),R(t,"class","svelte-1ia2qq9")},m(e,n){v(e,t,n)},p(e,r){4&r&&R(t,"width",e[2]),2&r&&R(t,"height",e[1]),1&r&&t.src!==(n=e[3].url)&&R(t,"src",n)},d(e){e&&$(t)}}}function p$(e){let t,n,r;function a(e,t){return(null==n||1&t)&&(n=!!r$.IMAGE.includes(e[3].extension.toLowerCase())),n?d$:u$}let i=a(e,-1),o=i(e);return{c(){t=w("div"),o.c(),r=k(),this.h()},l(e){t=O(e,"DIV",{class:!0});var n=N(t);o.l(n),r=M(n),n.forEach($),this.h()},h(){R(t,"class","file svelte-1ia2qq9")},m(e,n){v(e,t,n),o.m(t,null),L(t,r)},p(e,n){i===(i=a(e,n))&&o?o.p(e,n):(o.d(1),o=i(e),o&&(o.c(),o.m(t,r)))},d(e){e&&$(t),o.d()}}}function f$(e){let t,n=e[0],r=[];for(let a=0;a{"files"in e&&n(0,r=e.files),"height"in e&&n(1,a=e.height),"width"in e&&n(2,i=e.width)},[r,a,i]}class h$ extends m{constructor(e){super(),h(this,e,m$,f$,g,{files:0,height:1,width:2})}}function g$(e){let t,n,r;function a(t){e[3](t)}let i={processFiles:e[2],handleFileTooLarge:e[1]};return void 0!==e[0]&&(i.files=e[0]),t=new eb({props:i}),W.push((()=>Te(t,"files",a))),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,n){F(t,e,n),r=!0},p(e,[r]){const a={};!n&&1&r&&(n=!0,a.files=e[0],Ce((()=>n=!1))),t.$set(a)},i(e){r||(S(t.$$.fragment,e),r=!0)},o(e){b(t.$$.fragment,e),r=!1},d(e){B(t,e)}}}function _$(e,t,n){let{files:r=[]}=t;return e.$$set=e=>{"files"in e&&n(0,r=e.files)},[r,function(e){tS(`Files cannot exceed ${e/1e6}MB. Please try again with smaller files.`)},async function(e){let t=new FormData;for(let r=0;re.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),b$=e=>e.substring(0,1).toUpperCase()+e.substring(1);function y$(e,t,n){const r=e.slice();return r[12]=t[n],r}function S$(e,t,n){const r=e.slice();return r[12]=t[n],r}function $$(e){let t,n,r;function a(t){e[10](t)}let i={secondary:!0,label:e[3],placeholder:"Choose some options",$$slots:{default:[O$]},$$scope:{ctx:e}};return void 0!==e[1]&&(i.value=e[1]),t=new Vy({props:i}),W.push((()=>Te(t,"value",a))),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,n){F(t,e,n),r=!0},p(e,r){const a={};8&r&&(a.label=e[3]),131076&r&&(a.$$scope={dirty:r,ctx:e}),!n&&2&r&&(n=!0,a.value=e[1],Ce((()=>n=!1))),t.$set(a)},i(e){r||(S(t.$$.fragment,e),r=!0)},o(e){b(t.$$.fragment,e),r=!1},d(e){B(t,e)}}}function T$(e){let t,n;return t=new LE({props:{thin:!0,secondary:!0,name:e[3],label:e[3],$$slots:{default:[R$]},$$scope:{ctx:e}}}),t.$on("change",e[9]),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,r){F(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.name=e[3]),8&n&&(r.label=e[3]),131078&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(S(t.$$.fragment,e),n=!0)},o(e){b(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function C$(e){let t,n,r,a;return t=new eE({props:{extraSmall:!0,grey:!0,$$slots:{default:[x$]},$$scope:{ctx:e}}}),r=new eE({props:{small:!0,black:!0,$$slots:{default:[A$]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment),n=k(),P(r.$$.fragment)},l(e){U(t.$$.fragment,e),n=M(e),U(r.$$.fragment,e)},m(e,i){F(t,e,i),v(e,n,i),F(r,e,i),a=!0},p(e,n){const a={};131080&n&&(a.$$scope={dirty:n,ctx:e}),t.$set(a);const i={};131088&n&&(i.$$scope={dirty:n,ctx:e}),r.$set(i)},i(e){a||(S(t.$$.fragment,e),S(r.$$.fragment,e),a=!0)},o(e){b(t.$$.fragment,e),b(r.$$.fragment,e),a=!1},d(e){B(t,e),e&&$(n),B(r,e)}}}function w$(e){let t,n,r,a=e[5](e[12])+"";return{c(){t=w("option"),n=G(a),this.h()},l(e){t=O(e,"OPTION",{value:!0});var r=N(t);n=q(r,a),r.forEach($),this.h()},h(){t.__value=r=e[12]._id,t.value=t.__value},m(e,r){v(e,t,r),L(t,n)},p(e,i){4&i&&a!==(a=e[5](e[12])+"")&&Y(n,a),4&i&&r!==(r=e[12]._id)&&(t.__value=r,t.value=t.__value)},d(e){e&&$(t)}}}function O$(e){let t,n=e[2],r=[];for(let a=0;a{o[l]=null})),y(),n=o[t],n?n.p(e,a):(n=o[t]=i[t](e),n.c()),S(n,1),n.m(r.parentNode,r))},i(e){a||(S(n),a=!0)},o(e){b(n),a=!1},d(e){o[t].d(e),e&&$(r)}}}function D$(e,t,n){var r;let a,i,o,s;Ne(e,Lv,(e=>n(8,s=e)));let{schema:l}=t,{linkedRows:c=[]}=t,u=[],d=null==(r=c||[])?void 0:r.map((e=>(null==e?void 0:e._id)||e));return e.$$set=e=>{"schema"in e&&n(0,l=e.schema),"linkedRows"in e&&n(6,c=e.linkedRows)},e.$$.update=()=>{2&e.$$.dirty&&n(6,c=d),1&e.$$.dirty&&n(3,a=b$(l.name)),1&e.$$.dirty&&n(7,i=l.tableId),384&e.$$.dirty&&n(4,o=s.tables.find((e=>e._id===i))),128&e.$$.dirty&&async function(e){const t=`/api/${e}/rows`;try{const e=await ht.get(t);n(2,u=await e.json())}catch(r){console.log(r),n(2,u=[])}}(i)},[l,d,u,a,o,function(e){return e[o.primaryDisplay||"_id"]},c,i,s,e=>n(1,d=e.target.value?[e.target.value]:[]),function(e){d=e,n(1,d)}]}class k$ extends m{constructor(e){super(),h(this,e,D$,I$,g,{schema:0,linkedRows:6})}}function M$(e,t,n){const r=e.slice();return r[13]=t[n],r}function L$(e){let t,n,r;function a(t){e[12](t)}let i={thin:!0,label:e[4],"data-cy":e[1].name+"-input",type:e[3],disabled:e[2]};return void 0!==e[0]&&(i.value=e[0]),t=new uE({props:i}),W.push((()=>Te(t,"value",a))),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,n){F(t,e,n),r=!0},p(e,r){const a={};16&r&&(a.label=e[4]),2&r&&(a["data-cy"]=e[1].name+"-input"),8&r&&(a.type=e[3]),4&r&&(a.disabled=e[2]),!n&&1&r&&(n=!0,a.value=e[0],Ce((()=>n=!1))),t.$set(a)},i(e){r||(S(t.$$.fragment,e),r=!0)},o(e){b(t.$$.fragment,e),r=!1},d(e){B(t,e)}}}function P$(e){let t,n,r,a,i,o;function s(t){e[11](t)}n=new eE({props:{extraSmall:!0,grey:!0,$$slots:{default:[Y$]},$$scope:{ctx:e}}});let l={};return void 0!==e[0]&&(l.value=e[0]),a=new TE({props:l}),W.push((()=>Te(a,"value",s))),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment)},l(e){t=O(e,"DIV",{});var i=N(t);U(n.$$.fragment,i),r=M(i),U(a.$$.fragment,i),i.forEach($)},m(e,i){v(e,t,i),F(n,t,null),L(t,r),F(a,t,null),o=!0},p(e,t){const r={};65552&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const o={};!i&&1&t&&(i=!0,o.value=e[0],Ce((()=>i=!1))),a.$set(o)},i(e){o||(S(n.$$.fragment,e),S(a.$$.fragment,e),o=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),o=!1},d(e){e&&$(t),B(n),B(a)}}}function U$(e){let t,n,r,a;function i(t){e[10](t)}let o={schema:e[1]};return void 0!==e[0]&&(o.linkedRows=e[0]),n=new k$({props:o}),W.push((()=>Te(n,"linkedRows",i))),{c(){t=w("div"),P(n.$$.fragment)},l(e){t=O(e,"DIV",{});var r=N(t);U(n.$$.fragment,r),r.forEach($)},m(e,r){v(e,t,r),F(n,t,null),a=!0},p(e,t){const a={};2&t&&(a.schema=e[1]),!r&&1&t&&(r=!0,a.linkedRows=e[0],Ce((()=>r=!1))),n.$set(a)},i(e){a||(S(n.$$.fragment,e),a=!0)},o(e){b(n.$$.fragment,e),a=!1},d(e){e&&$(t),B(n)}}}function F$(e){let t,n,r;function a(t){e[9](t)}let i={text:e[4],"data-cy":e[1].name+"-input"};return void 0!==e[0]&&(i.checked=e[0]),t=new yb({props:i}),W.push((()=>Te(t,"checked",a))),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,n){F(t,e,n),r=!0},p(e,r){const a={};16&r&&(a.text=e[4]),2&r&&(a["data-cy"]=e[1].name+"-input"),!n&&1&r&&(n=!0,a.checked=e[0],Ce((()=>n=!1))),t.$set(a)},i(e){r||(S(t.$$.fragment,e),r=!0)},o(e){b(t.$$.fragment,e),r=!1},d(e){B(t,e)}}}function B$(e){let t,n,r,a,i,o;function s(t){e[8](t)}n=new eE({props:{extraSmall:!0,grey:!0,forAttr:"dropzone-label",$$slots:{default:[V$]},$$scope:{ctx:e}}});let l={};return void 0!==e[0]&&(l.files=e[0]),a=new v$({props:l}),W.push((()=>Te(a,"files",s))),{c(){t=w("div"),P(n.$$.fragment),r=k(),P(a.$$.fragment)},l(e){t=O(e,"DIV",{});var i=N(t);U(n.$$.fragment,i),r=M(i),U(a.$$.fragment,i),i.forEach($)},m(e,i){v(e,t,i),F(n,t,null),L(t,r),F(a,t,null),o=!0},p(e,t){const r={};65552&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const o={};!i&&1&t&&(i=!0,o.files=e[0],Ce((()=>i=!1))),a.$set(o)},i(e){o||(S(n.$$.fragment,e),S(a.$$.fragment,e),o=!0)},o(e){b(n.$$.fragment,e),b(a.$$.fragment,e),o=!1},d(e){e&&$(t),B(n),B(a)}}}function G$(e){let t,n,r;function a(t){e[7](t)}let i={label:e[4]};return void 0!==e[0]&&(i.value=e[0]),t=new Ny({props:i}),W.push((()=>Te(t,"value",a))),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,n){F(t,e,n),r=!0},p(e,r){const a={};16&r&&(a.label=e[4]),!n&&1&r&&(n=!0,a.value=e[0],Ce((()=>n=!1))),t.$set(a)},i(e){r||(S(t.$$.fragment,e),r=!0)},o(e){b(t.$$.fragment,e),r=!1},d(e){B(t,e)}}}function q$(e){let t,n,r;function a(t){e[6](t)}let i={thin:!0,secondary:!0,label:e[4],"data-cy":e[1].name+"-select",$$slots:{default:[H$]},$$scope:{ctx:e}};return void 0!==e[0]&&(i.value=e[0]),t=new LE({props:i}),W.push((()=>Te(t,"value",a))),{c(){P(t.$$.fragment)},l(e){U(t.$$.fragment,e)},m(e,n){F(t,e,n),r=!0},p(e,r){const a={};16&r&&(a.label=e[4]),2&r&&(a["data-cy"]=e[1].name+"-select"),65538&r&&(a.$$scope={dirty:r,ctx:e}),!n&&1&r&&(n=!0,a.value=e[0],Ce((()=>n=!1))),t.$set(a)},i(e){r||(S(t.$$.fragment,e),r=!0)},o(e){b(t.$$.fragment,e),r=!1},d(e){B(t,e)}}}function Y$(e){let t;return{c(){t=G(e[4])},l(n){t=q(n,e[4])},m(e,n){v(e,t,n)},p(e,n){16&n&&Y(t,e[4])},d(e){e&&$(t)}}}function V$(e){let t;return{c(){t=G(e[4])},l(n){t=q(n,e[4])},m(e,n){v(e,t,n)},p(e,n){16&n&&Y(t,e[4])},d(e){e&&$(t)}}}function j$(e){let t,n,r,a=e[13]+"";return{c(){t=w("option"),n=G(a),this.h()},l(e){t=O(e,"OPTION",{value:!0});var r=N(t);n=q(r,a),r.forEach($),this.h()},h(){t.__value=r=e[13],t.value=t.__value},m(e,r){v(e,t,r),L(t,n)},p(e,i){2&i&&a!==(a=e[13]+"")&&Y(n,a),2&i&&r!==(r=e[13])&&(t.__value=r,t.value=t.__value)},d(e){e&&$(t)}}}function H$(e){let t,n,r,a,i=e[1].constraints.inclusion,o=[];for(let s=0;s