@nanoporetech-digital/components 8.0.0-alpha.4 → 8.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/cjs/{fade-Dt8ydSYD.js → fade-B3XUTiE5.js} +1 -1
  2. package/dist/cjs/{fullscreen-D_o31hdQ.js → fullscreen-BQdjQr7K.js} +1 -1
  3. package/dist/cjs/{lazyload-obUQkoFT.js → lazyload-B8HnSPAU.js} +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{local-logged-in-C8Qr7Q7o.js → local-logged-in-CX0THX6r.js} +1 -1
  6. package/dist/cjs/{local-logged-out-fCQ614s8.js → local-logged-out-C-cPz-8v.js} +1 -1
  7. package/dist/cjs/nano-algolia.cjs.entry.js +1 -1
  8. package/dist/cjs/nano-avatar_5.cjs.entry.js +1 -1
  9. package/dist/cjs/nano-components.cjs.js +1 -1
  10. package/dist/cjs/{nano-data-table-Zj71h_Hm.js → nano-data-table-BiTzaPlZ.js} +2 -2
  11. package/dist/cjs/nano-data-table.cjs.entry.js +1 -1
  12. package/dist/cjs/nano-datalist_3.cjs.entry.js +4 -4
  13. package/dist/cjs/nano-date-picker_2.cjs.entry.js +1 -1
  14. package/dist/cjs/nano-global-nav.cjs.entry.js +2 -2
  15. package/dist/cjs/nano-icon_3.cjs.entry.js +2 -2
  16. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  17. package/dist/cjs/{nano-slides-BcdSNmlz.js → nano-slides-BHsOLxRZ.js} +5 -5
  18. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  19. package/dist/cjs/nano-spinner.cjs.entry.js +1 -12
  20. package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
  21. package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
  22. package/dist/cjs/nano-tab.cjs.entry.js +2 -2
  23. package/dist/cjs/nano-table.cjs.entry.js +2 -2
  24. package/dist/cjs/{page-dots-CUrSK-1M.js → page-dots-DJrv0V9e.js} +1 -1
  25. package/dist/cjs/{table.worker-D7-NI7ZI.js → table.worker-DjOtTDwg.js} +1 -1
  26. package/dist/collection/components/algolia/algolia.js +1 -1
  27. package/dist/collection/components/data-table/table.js +1 -1
  28. package/dist/collection/components/global-nav/assets/local-logged-in.json +1 -1
  29. package/dist/collection/components/global-nav/assets/local-logged-out.json +1 -1
  30. package/dist/collection/components/input/input.css +1 -1
  31. package/dist/collection/components/option/option.js +6 -3
  32. package/dist/collection/components/select/select.css +1 -1
  33. package/dist/collection/components/slides/slide.js +9 -1
  34. package/dist/collection/components/slides/slides.css +16 -10
  35. package/dist/collection/components/spinner/spinner.css +45 -138
  36. package/dist/collection/components/spinner/spinner.js +3 -43
  37. package/dist/collection/components/sticker/sticker.js +2 -2
  38. package/dist/collection/components/table/table.js +2 -2
  39. package/dist/collection/components/tabs/tab-content.js +2 -2
  40. package/dist/collection/components/tabs/tab.js +2 -2
  41. package/dist/collection/components/tag/tag.js +2 -2
  42. package/dist/collection/components/tooltip/tooltip.js +2 -2
  43. package/dist/components/algolia.js +1 -1
  44. package/dist/components/input.js +1 -1
  45. package/dist/components/local-logged-in.js +1 -1
  46. package/dist/components/local-logged-out.js +1 -1
  47. package/dist/components/nano-data-table.js +1 -1
  48. package/dist/components/nano-slide.js +1 -1
  49. package/dist/components/nano-tab-content.js +2 -2
  50. package/dist/components/nano-tab.js +2 -2
  51. package/dist/components/nano-table.js +2 -2
  52. package/dist/components/option.js +2 -2
  53. package/dist/components/select.js +1 -1
  54. package/dist/components/slides.js +1 -1
  55. package/dist/components/spinner.js +4 -18
  56. package/dist/components/sticker.js +2 -2
  57. package/dist/components/tag.js +2 -2
  58. package/dist/components/tooltip.js +2 -2
  59. package/dist/esm/{fade-DcRXMf28.js → fade-C74M8NQp.js} +1 -1
  60. package/dist/esm/{fullscreen-BQyi4GFz.js → fullscreen-CmJdWdrB.js} +1 -1
  61. package/dist/esm/{lazyload-C00srsFN.js → lazyload-BPqjfQB3.js} +1 -1
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/{local-logged-in-DNQyU0ot.js → local-logged-in-Bycp-mPl.js} +1 -1
  64. package/dist/esm/{local-logged-out-CD2oXHpq.js → local-logged-out-BhOAka-2.js} +1 -1
  65. package/dist/esm/nano-algolia.entry.js +1 -1
  66. package/dist/esm/nano-avatar_5.entry.js +1 -1
  67. package/dist/esm/nano-components.js +1 -1
  68. package/dist/esm/{nano-data-table-wGnglzmF.js → nano-data-table-BPQhfLyq.js} +2 -2
  69. package/dist/esm/nano-data-table.entry.js +1 -1
  70. package/dist/esm/nano-datalist_3.entry.js +4 -4
  71. package/dist/esm/nano-date-picker_2.entry.js +1 -1
  72. package/dist/esm/nano-global-nav.entry.js +2 -2
  73. package/dist/esm/nano-icon_3.entry.js +2 -2
  74. package/dist/esm/nano-slide.entry.js +1 -1
  75. package/dist/esm/{nano-slides-g94uYmWm.js → nano-slides-Bv0u7kg0.js} +5 -5
  76. package/dist/esm/nano-slides.entry.js +1 -1
  77. package/dist/esm/nano-spinner.entry.js +2 -13
  78. package/dist/esm/nano-sticker.entry.js +2 -2
  79. package/dist/esm/nano-tab-content.entry.js +2 -2
  80. package/dist/esm/nano-tab.entry.js +2 -2
  81. package/dist/esm/nano-table.entry.js +2 -2
  82. package/dist/esm/{page-dots-B947EGDd.js → page-dots-e1Gyk8V7.js} +1 -1
  83. package/dist/esm/{table.worker-DQJ9Zgy3.js → table.worker-DlLhvqK5.js} +1 -1
  84. package/dist/nano-assets/hash.txt +1 -1
  85. package/dist/nano-assets/local-logged-in.json +1 -1
  86. package/dist/nano-assets/local-logged-out.json +1 -1
  87. package/dist/nano-components/assets/local-logged-in.json +1 -1
  88. package/dist/nano-components/assets/local-logged-out.json +1 -1
  89. package/dist/nano-components/{fade-DcRXMf28.js → fade-C74M8NQp.js} +1 -1
  90. package/dist/nano-components/{fullscreen-BQyi4GFz.js → fullscreen-CmJdWdrB.js} +1 -1
  91. package/dist/nano-components/{lazyload-C00srsFN.js → lazyload-BPqjfQB3.js} +1 -1
  92. package/dist/nano-components/{local-logged-in-DNQyU0ot.js → local-logged-in-Bycp-mPl.js} +1 -1
  93. package/dist/nano-components/{local-logged-out-CD2oXHpq.js → local-logged-out-BhOAka-2.js} +1 -1
  94. package/dist/nano-components/nano-algolia.entry.js +1 -1
  95. package/dist/nano-components/nano-avatar_5.entry.js +1 -1
  96. package/dist/nano-components/nano-components.css +29 -29
  97. package/dist/nano-components/nano-components.esm.js +1 -1
  98. package/dist/nano-components/{nano-data-table-wGnglzmF.js → nano-data-table-BPQhfLyq.js} +1 -1
  99. package/dist/nano-components/nano-data-table.entry.js +1 -1
  100. package/dist/nano-components/nano-datalist_3.entry.js +1 -1
  101. package/dist/nano-components/nano-date-picker_2.entry.js +1 -1
  102. package/dist/nano-components/nano-global-nav.entry.js +1 -1
  103. package/dist/nano-components/nano-icon_3.entry.js +1 -1
  104. package/dist/nano-components/nano-slide.entry.js +1 -1
  105. package/dist/nano-components/{nano-slides-g94uYmWm.js → nano-slides-Bv0u7kg0.js} +3 -3
  106. package/dist/nano-components/nano-slides.entry.js +1 -1
  107. package/dist/nano-components/nano-spinner.entry.js +1 -1
  108. package/dist/nano-components/nano-sticker.entry.js +1 -1
  109. package/dist/nano-components/nano-tab-content.entry.js +1 -1
  110. package/dist/nano-components/nano-tab.entry.js +1 -1
  111. package/dist/nano-components/nano-table.entry.js +1 -1
  112. package/dist/nano-components/{page-dots-B947EGDd.js → page-dots-e1Gyk8V7.js} +1 -1
  113. package/dist/nano-components/{table.worker-DQJ9Zgy3.js → table.worker-DlLhvqK5.js} +1 -1
  114. package/dist/style/components.css +1 -1
  115. package/dist/style/components.css.map +1 -1
  116. package/dist/style/core.css +1 -1
  117. package/dist/style/core.css.map +1 -1
  118. package/dist/style/nano.css +1 -1
  119. package/dist/style/nano.css.map +1 -1
  120. package/dist/types/components/date-picker/date-picker-interface.d.ts +19 -0
  121. package/dist/types/components/option/option.d.ts +4 -1
  122. package/dist/types/components/slides/slide.d.ts +8 -0
  123. package/dist/types/components/spinner/spinner.d.ts +3 -7
  124. package/dist/types/components.d.ts +36 -14
  125. package/docs-json.json +52 -53
  126. package/docs-vscode.json +2 -14
  127. package/hydrate/index.js +40 -39
  128. package/hydrate/index.mjs +40 -39
  129. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Custom elements for Nanopore-Digital Web applications
3
3
  */
4
- import{j as t,a as e,r as i,c as s,e as n,f as o,d as r}from"./index-DXvE-U_j.js";import{a}from"./algoliasearch-lite.esm.browser-C1SNUAIj.js";import{g as h}from"./dom-Cb7FUtXp.js";import{C as l}from"./component-store-CH5BI3Tg.js";import{d as c}from"./throttle-C93FMm2Z.js";import{t as u,h as f}from"./renderer-BUaAsDso.js";import{S as d}from"./algolia-data-D6wnbV__.js";var p=new Map,m=function(t,e){var i=t.updater;t.fields.forEach((function(t){i(t,e[t])}))},g=function(e,i){var s=e.state,n=t();if(p.has(n)){var o=p.get(n);o.state=s,o.wormholes.forEach((function(t){m(t,s)}))}return i};class y{queue=[];workingOnPromise=!1;static pendingPromise=!1;stop=!1;limit=null;enqueue(t){return new Promise(((e,i)=>{this.queue.push({promise:t,resolve:e,reject:i}),this.dequeue()}))}dequeue(){if(this.workingOnPromise)return!1;if(this.stop)return this.queue=[],void(this.stop=!1);const t=this.queue.shift();if(!t)return!1;try{this.workingOnPromise=!0,t.promise().then((e=>{this.workingOnPromise=!1,t.resolve(e),this.dequeue()})).catch((e=>{this.workingOnPromise=!1,t.reject(e),this.dequeue()}))}catch(e){this.workingOnPromise=!1,t.reject(e),this.dequeue()}return!0}}function b(t){const e=new Error(t);var i,s;return i=e,s=b.prototype,Object.setPrototypeOf?Object.setPrototypeOf(i,s):i.__proto__=s,e}function w(t,e,i){const s=e.slice(0,i).split(/\n/),n=s.length,o=s[n-1].length+1;throw b(t+=" at line "+n+" col "+o+":\n\n "+e.split(/\n/)[n-1]+"\n "+Array(o).join(" ")+"^")}b.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});const v=new Function("return this")().Promise;let x=!1;try{x=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function F(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function C(t,e,i){for(const s in e)F(e,s)&&(t[s]=null==e[s]||"object"!=typeof e[s]||"storage"!==s&&"prefixes"!==s||i?e[s]:C({},e[s]));return t}const I=/^async +/,k=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,S=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,R=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,j=/[.*+\-?^${}()|[\]\\]/g;function _(t){return j.test(t)?t.replace(j,"\\$&"):t}function A(t,e){e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),k.lastIndex=0,S.lastIndex=0,R.lastIndex=0;const i=e.prefixes,s=[i.h,i.b,i.i,i.r,i.c,i.e].reduce((function(t,e){return t&&e?t+"|"+_(e):e?_(e):t}),""),n=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+_(e.tags[1])+")","g"),o=new RegExp("([^]*?)"+_(e.tags[0])+"(-|_)?\\s*("+s+")?\\s*","g");let r=0,a=!1;function h(i,s){const h={f:[]};let l,c=0,u="c";function f(i){const s=t.slice(r,i);let n=s.trim();if("f"===u)"safe"===n?h.raw=!0:e.async&&I.test(n)?(n=n.replace(I,""),h.f.push([n,"",!0])):h.f.push([n,""]);else if("fp"===u)h.f[h.f.length-1][1]+=n;else if("err"===u){if(n){const e=s.search(/\S/);w("invalid syntax",t,r+e)}}else h[u]=n;r=i+1}for("h"===s||"b"===s||"c"===s?u="n":"r"===s&&(h.raw=!0,s="i"),n.lastIndex=r;null!==(l=n.exec(t));){const e=l[1],i=l[2],d=l[3],p=l[4],m=l[5],g=l.index;if(e)"("===e?(0===c&&("n"===u?(f(g),u="p"):"f"===u&&(f(g),u="fp")),c++):")"===e?(c--,0===c&&"c"!==u&&(f(g),u="err")):0===c&&"|"===e?(f(g),u="f"):"=>"===e&&(f(g),r+=1,u="res");else if(i)if("/*"===i){const e=t.indexOf("*/",n.lastIndex);-1===e&&w("unclosed comment",t,l.index),n.lastIndex=e+2}else"'"===i?(S.lastIndex=l.index,S.exec(t)?n.lastIndex=S.lastIndex:w("unclosed string",t,l.index)):'"'===i?(R.lastIndex=l.index,R.exec(t)?n.lastIndex=R.lastIndex:w("unclosed string",t,l.index)):"`"===i&&(k.lastIndex=l.index,k.exec(t)?n.lastIndex=k.lastIndex:w("unclosed string",t,l.index));else if(d)return f(g),r=g+l[0].length,o.lastIndex=r,a=m,p&&"h"===s&&(s="s"),h.t=s,h}return w("unclosed tag",t,i),h}const l=function s(n,l){n.b=[],n.d=[];let c,u=!1,f=[];function d(t,i){t&&(t=function(t,e,i,s){let n,o;return"string"==typeof e.autoTrim?n=o=e.autoTrim:Array.isArray(e.autoTrim)&&(n=e.autoTrim[1],o=e.autoTrim[0]),(i||!1===i)&&(n=i),(s||!1===s)&&(o=s),"slurp"===n&&"slurp"===o?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===o||"slurp"===o?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==o&&"nl"!==o||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,e,a,i),t&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),f.push(t)))}for(;null!==(c=o.exec(t));){const o=c[1],a=c[2],l=c[3]||"";let p;for(const t in i)if(i[t]===l){p=t;break}d(o,a),r=c.index+c[0].length,p||w("unrecognized tag type: "+l,t,r);let m=h(c.index,p);const g=m.t;if("h"===g){const t=m.n||"";e.async&&I.test(t)&&(m.a=!0,m.n=t.replace(I,"")),m=s(m),f.push(m)}else if("c"===g){if(n.n===m.n)return u?(u.d=f,n.b.push(u)):n.d=f,n;w("Helper start and end don't match",t,c.index+c[0].length)}else if("b"===g){u?(u.d=f,n.b.push(u)):n.d=f;const t=m.n||"";e.async&&I.test(t)&&(m.a=!0,m.n=t.replace(I,"")),u=m,f=[]}else if("s"===g){const t=m.n||"";e.async&&I.test(t)&&(m.a=!0,m.n=t.replace(I,"")),f.push(m)}else f.push(m)}if(!l)throw b('unclosed helper "'+n.n+'"');return d(t.slice(r,t.length),!1),n.d=f,n}({f:[]},!0);if(e.plugins)for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];i.processAST&&(l.d=i.processAST(l.d,e))}return l.d}function z(t,e){const i=A(t,e);let s="var tR='';"+(e.useWith?"with("+e.varName+"||{}){":"")+q(i,e)+"if(cb){cb(null,tR)} return tR"+(e.useWith?"}":"");if(e.plugins)for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];i.processFnString&&(s=i.processFnString(s,e))}return s}function P(t,e){for(let i=0;i<e.length;i++){const s=e[i][1];t=(e[i][2]?"await ":"")+"c.l('F','"+e[i][0]+"')("+t,s&&(t+=","+s),t+=")"}return t}function T(t,e,i,s,n,o){let r="{exec:"+(n?"async ":"")+O(i,e,t)+",params:["+s+"]";return o&&(r+=",name:'"+o+"'"),n&&(r+=",async:true"),r+="}",r}function E(t,e){let i="[";for(let s=0;s<t.length;s++){const n=t[s];i+=T(e,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(i+=",")}return i+="]",i}function O(t,e,i){return"function("+e+"){var tR='';"+q(t,i)+"return tR}"}function q(t,e){let i=0;const s=t.length;let n="";for(;i<s;i++){const s=t[i];if("string"==typeof s)n+="tR+='"+s+"';";else{const t=s.t;let i=s.c||"";const o=s.f,r=s.n||"",a=s.p||"",h=s.res||"",l=s.b,c=!!s.a;if("i"===t){e.defaultFilter&&(i="c.l('F','"+e.defaultFilter+"')("+i+")");let t=P(i,o);!s.raw&&e.autoEscape&&(t="c.l('F','e')("+t+")"),n+="tR+="+t+";"}else if("h"===t)if(e.storage.nativeHelpers.get(r))n+=e.storage.nativeHelpers.get(r)(s,e);else{let t=(c?"await ":"")+"c.l('H','"+r+"')("+T(e,h,s.d,a,c);t+=l?","+E(l,e):",[]",t+=",c)",n+="tR+="+P(t,o)+";"}else"s"===t?n+="tR+="+P((c?"await ":"")+"c.l('H','"+r+"')({params:["+a+"]},[],c)",o)+";":"e"===t&&(n+=i+"\n")}}return n}class D{cache;constructor(t){this.cache=t}define(t,e){this.cache[t]=e}get(t){return this.cache[t]}remove(t){delete this.cache[t]}reset(){this.cache={}}load(t){C(this.cache,t,!0)}}function H(t,e,i,s){if(e&&e.length>0)throw b((s?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(i&&i.length>0)throw b((s?"Native":"")+"Helper '"+t+"' doesn't accept filters")}function N(t,e,i,s,n){i(t[e],e).then((function(o){s+=o,e===t.length-1?n(s):N(t,e+1,i,s,n)}))}function $(t,e,i,s,n,o){s(e[i],t[e[i]]).then((function(r){n+=r,i===e.length-1?o(n):$(t,e,i+1,s,n,o)}))}const L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function M(t){return L[t]}const U=new D({}),B=new D({each:function(t,e){let i="";const s=t.params[0];if(H("each",e,!1),t.async)return new Promise((function(e){N(s,0,t.exec,i,e)}));for(let e=0;e<s.length;e++)i+=t.exec(s[e],e);return i},foreach:function(t,e){const i=t.params[0];if(H("foreach",e,!1),t.async)return new Promise((function(e){$(i,Object.keys(i),0,t.exec,"",e)}));{let e="";for(const s in i)F(i,s)&&(e+=t.exec(s,i[s]));return e}},include:function(t,e,i){H("include",e,!1);const s=i.storage.templates.get(t.params[0]);if(!s)throw b('Could not fetch template "'+t.params[0]+'"');return s(t.params[1],i)},extends:function(t,e,i){const s=t.params[1]||{};s.content=t.exec();for(let t=0;t<e.length;t++){const i=e[t];s[i.name]=i.exec()}const n=i.storage.templates.get(t.params[0]);if(!n)throw b('Could not fetch template "'+t.params[0]+'"');return n(s,i)},useScope:function(t,e){return H("useScope",e,!1),t.exec(t.params[0])}}),Q=new D({if:function(t,e){H("if",!1,t.f,!0);let i="if("+t.p+"){"+q(t.d,e)+"}";if(t.b)for(let s=0;s<t.b.length;s++){const n=t.b[s];"else"===n.n?i+="else{"+q(n.d,e)+"}":"elif"===n.n&&(i+="else if("+n.p+"){"+q(n.d,e)+"}")}return i},try:function(t,e){if(H("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw b("native helper 'try' only accepts 1 block, 'catch'");let i="try{"+q(t.d,e)+"}";const s=t.b[0];return i+="catch"+(s.res?"("+s.res+")":"")+"{"+q(s.d,e)+"}",i},block:function(t,e){return H("block",t.b,t.f,!0),"if(!"+e.varName+"["+t.p+"]){tR+=("+O(t.d,"",e)+")()}else{tR+="+e.varName+"["+t.p+"]}"}}),W=new D({e:function(t){const e=String(t);return/[&<>"']/.test(e)?e.replace(/[&<>"']/g,M):e}}),K={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){const t=this.storage.helpers.get(e);if(t)return t;throw b("Can't find helper '"+e+"'")}if("F"===t){const t=this.storage.filters.get(e);if(t)return t;throw b("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:B,nativeHelpers:Q,filters:W,templates:U},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function X(t,e){const i={};return C(i,K),e&&C(i,e),t&&C(i,t),i.l.bind(i),i}function G(t,e){const i=X(e||{});let s=Function;if(i.async){if(!x)throw b("This environment doesn't support async/await");s=x}try{return new s(i.varName,"c","cb",z(t,i))}catch(e){throw e instanceof SyntaxError?b("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+z(t,i)):e}}function V(t,e){let i;return e.cache&&e.name&&e.storage.templates.get(e.name)?e.storage.templates.get(e.name):(i="function"==typeof t?t:G(t,e),e.cache&&e.name&&e.storage.templates.define(e.name,i),i)}K.l.bind(K);var Z=Object.freeze({__proto__:null,compile:G,compileScope:q,compileScopeIntoFunction:O,compileToString:z,defaultConfig:K,filters:W,getConfig:X,helpers:B,nativeHelpers:Q,parse:A,render:function(t,e,i,s){const n=X(i||{});if(!n.async)return V(t,n)(e,n);{let i;if(!s){if("function"==typeof v)return new v((function(s,o){try{i=V(t,n)(e,n),s(i)}catch(t){o(t)}}));throw b("Please provide a callback function, this env doesn't support Promises")}try{V(t,n)(e,n,s)}catch(t){return s(t)}}},templates:U});W.define("date_long",((t,e={year:"numeric",month:"long",day:"numeric"})=>{if(t)return new Date(1e3*parseInt(t)).toLocaleDateString("en-GB",e)})),W.define("date_short",((t,e="d/m/y")=>{if(!t)return;const i=new Date(1e3*parseInt(t));return(t=(t=e.replace(/(d)/,i.getDate().toString())).replace(/(m)/,(i.getMonth()+1).toString())).replace(/(y)/,i.getFullYear().toString())})),W.define("public_name",(t=>{if(t)return(t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ")).charAt(0).toUpperCase()+t.slice(1)})),W.define("trim_to",((t,e=100)=>{if(t)return t.length<=e?t:t.substr(0,e)+"..."})),W.define("classname",(t=>{if(t)return t.replace(/[\W]+/g,"")})),W.define("abs_url",((t,e=null,i)=>{if(!e)return t;if(!t)return;let s;if(e.domains&&i&&i.origin){const t=e.domains.find((t=>t.origin===i.origin));s=t?t.domain:""}else e.domain&&(s=e.domain);return t.match(/^http/)||!s?t:(t.startsWith("/")||(t="/"+t),location.protocol+"//"+s+t)})),W.define("replace",((t,e,i)=>t.replace(e,i))),W.define("remove_spaces",(t=>t.replace(/ /g,"_"))),W.define("add_spaces",(t=>t.replace(/[_\-]/g," "))),W.define("capitalise",(t=>t.charAt(0).toUpperCase()+t.slice(1))),W.define("lowercase",(t=>t.toLowerCase()));const J=Z,Y=class{constructor(t){i(this,t),this.nanoDidLoad=s(this,"nanoDidLoad",7),this.nanoResultsShown=s(this,"nanoResultsShown",3),this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7),this.nanoAfterQuery=s(this,"nanoAfterQuery",7),this.nanoNewResults=s(this,"nanoNewResults",7)}staticFacetFilters={};dynFacetFilters={};tplSlot;outputSlot;slottedInput;hasLoadSlot=!1;resultsDiv;defaultDiv;tpl;facets;placedAlgoliaEles=[];algoliaClient;promiseQueue=new y;get host(){return e(this)}_dynFacetFilters={};inputField;algoliaIndex;indeces=[];indexResults;filterChanged="";currentHits;changeEvent=d.Init;isLoading=!1;wormholeState=this;showResults=!1;resultsPage=0;appId;apiKey;searchIndex={};searchIndexName="";listenTo=null;handleListenToChange(){if(!this.listenTo)return;const t=document.querySelector(this.listenTo);["nano-input","input"].includes(t.tagName.toLocaleLowerCase())&&(this.inputField=t)}query="";operator="and";filters=[];tplRenderFn=J.render;replicaIndex="";browseIndex=!1;minChars=2;storeId;storeMethod="session";nanoDidLoad;nanoResultsShown;nanoBeforeQuery;nanoAfterQuery;nanoNewResults;async removeFilters(t,e){t||e?Object.keys(this._dynFacetFilters).forEach((i=>{t&&this._dynFacetFilters[i].facetName===t&&(this._dynFacetFilters[i].element.value=e?this._dynFacetFilters[i].value.filter((t=>t!==e)):"")})):this.clearAllFacetFilters()}onAllTplUpdate(t){t.stopPropagation(),t.target.tagName.toLowerCase()===u("nano-algolia-results")&&requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}async onPageChange(t){if(!this.indexResults)return;let e=this.resultsPage;t&&(t.stopPropagation(),e=t.detail.page),e=Math.min(this.indexResults.totalPages-1,e),e=Math.max(e,0),this.indexResults.currentPage!==e&&(this.indexResults.currentPage=e,await this.algoliaSearch(d.Page))}async onFilterChange(t){t.stopPropagation();const e={},i=t.detail;i.element=t.target,this.indexResults?(this.staticFacetFilters[i.filterId]?this.staticFacetFilters[i.filterId]=i:(e[i.filterId]=i,this._dynFacetFilters={...this._dynFacetFilters,...e}),this.indexResults.appliedFilters=this.makeAppliedFilters()):this.staticFacetFilters[i.filterId]=i,this.filterChanged=i.value&&i.value.length?i.filterId:"all",this.resetPage(),this.algoliaSearch(d.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{this.host.ownerDocument===t.element.ownerDocument?this.dynFacetFilters[t.filterId]=t:delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){this.browseIndex&&(!this.query||this.query.length<this.minChars)&&(this.query="*")}inputFieldSet(){this.inputField&&"*"!==this.query&&this.inputField&&this.inputField.value!==this.query&&(this.inputField.value=this.query)}queryChange(){this.searchChange()}searchChange=async()=>{if(this.algoliaIndex){if(!this.query||this.query.length<this.minChars){if(!this.browseIndex)return this.query&&0!==this.query.length?void 0:void this.handleSearchReset();if("*"!==this.query)return void(this.query="*")}this.isLoading=!0,setTimeout((async()=>{this.resetPage(),await this.algoliaSearch(d.Init),await this.updateContent(),setTimeout((()=>this.isLoading=!1),800),this.showResults=!0,this.nanoResultsShown.emit({meta:this.indexResults,client:{appId:this.appId,apiKey:this.apiKey}})}),200)}};async internalIndexSwitch(){this.replicaIndex&&this.indexResults&&this.indexResults.index!==this.replicaIndex&&(this.indexResults.index=this.replicaIndex,this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index),this.resetPage(),this.algoliaSearch(d.Replica))}pageChange(){this.onPageChange()}searchIndexNameChange(){!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName||(this.searchIndex={index:this.searchIndexName})}initAlgoliaClient(){this.appId&&this.apiKey&&(this.algoliaClient=a(this.appId,this.apiKey))}initAlgoliaIndex(){this.algoliaClient&&this.searchIndex&&this.searchIndex.index&&(this.searchIndex.hitsPerPage||(this.searchIndex.hitsPerPage=100),this.replicaIndex&&(this.searchIndex.index=this.replicaIndex),this.searchIndexName=this.searchIndex.index,this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index),this.searchChange())}showResultsChange(){this.resultsDiv&&this.defaultDiv&&(this.showResults?(this.resultsDiv.style.width=this.host.scrollWidth+"px",this.resultsDiv.style.minHeight=this.host.scrollHeight+"px",n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay),this.resultsDiv.style.display="block",setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))):n((()=>{this.resultsDiv.classList.remove("shown"),this.defaultDiv.style.display="block",setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay),this.resultsDiv.classList.remove("show"),this.slottedInput?this.slottedInput.focus({preventScroll:!0}):this.defaultDiv.focus({preventScroll:!0})}),50)})))}handleFilterpropChange(){this.algoliaSearch(d.Init)}fixDomain(t){return this.searchIndex&&this.searchIndex.domain?(t.hits.map((t=>{t.url&&!t.url.match(/^http/)&&(t.url=location.protocol+"//"+this.searchIndex.domain+t.url)})),t):t}makeAppliedFilters=()=>{const t=[],e=e=>{Object.values(e).forEach((e=>{if(e.value&&e.value.length){const i=t.find((t=>t.name===e.facetName));i?i.values=[...i.values,...e.value]:t.push({name:e.facetName,values:[...e.value]})}}))};return e(this.dynFacetFilters),e(this.staticFacetFilters),t.length?t:null};algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));queueSearch=async t=>{if(!(this.algoliaIndex&&this.query&&this.searchIndex&&this.searchIndex.index))return;this.nanoBeforeQuery.emit(this.indexResults),d.Init===t&&this.clearAllFacetFilters();const e={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0,clickAnalytics:!0};this.searchIndex.filters&&(e.facets=this.searchIndex.filters),this.searchIndex.hitsPerPage&&(e.hitsPerPage=this.searchIndex.hitsPerPage);let i=await this.algoliaIndex.search(this.query,e);return i=this.fixDomain(i),this.changeEvent=t,t!==d.Init&&this.indexResults||(this.indexResults={queryID:i.queryID,currentPage:0,totalHits:i.nbHits,hitsPerPage:null,origFilters:i.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index,searchIndex:this.searchIndex}),this.indexResults.dynFilters=i.facets,this.indexResults.results=i.hits,this.indexResults.totalHitsWithFilters=i.nbHits,this.indexResults.currentPage=i.page,this.indexResults.totalPages=i.nbPages,this.indexResults.hitsPerPage=i.hitsPerPage,this.indexResults.query=i.query,this.changeEvent!==d.Page&&this.changeEvent!==d.Replica&&(this.facets=i.facets),this.nanoAfterQuery.emit(this.indexResults),new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((()=>{this.currentHits=this.indexResults.results,this.resultsPage=this.indexResults.currentPage}))};resetPage(){this.indexResults&&(this.indexResults.currentPage=0)}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""})),this._dynFacetFilters={}}algoliaFilterStr(){const t={},e=e=>{let i,s;Object.keys(e).forEach((n=>{i=e[n],t[n]=t[n]||{name:i.facetName,or:[],and:[],not:[]},s=t[n][i.operator],i.value&&i.value.length&&(t[n][i.operator]=[...s,...i.value])}))};e(this.dynFacetFilters),e(this.staticFacetFilters);const i=(t,e)=>e.indexOf(" ")>-1?t+':"'+e+'"':t+":"+e;let s,n,o=[];return Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((e=>{s=t,n=t.name,"or"===e||"and"===e?s[e].length&&o.push("( "+s[e].map((t=>{if(t.length)return i(n,t)})).join(" "+e.toLocaleUpperCase()+" ")+" )"):s.not.length&&o.push("( "+s[e].map((t=>{if(t.length)return"NOT "+i(n,t)})).join(" AND ")+" )")}))})),o=[...this.filters,...o],o.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){t.target===this.inputField&&(this.query=this.inputField.value)}handleSearchReset=()=>{this.showResults=!1,this.indexResults=null};onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay),this.showResults?(this.defaultDiv.style.display="none",this.resultsDiv.classList.add("shown"),this.resultsDiv.style.minHeight="",this.resultsDiv.style.width=""):this.resultsDiv.style.display="none"}))};async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const e=document.createElement("div");e.innerHTML=this.tpl;const i=[];return this.placedAlgoliaEles=[],Array.from(e.querySelectorAll(`${u("nano-algolia")}, ${u("nano-algolia-filter")}, ${u("nano-algolia-results")}`)).forEach(((t,e)=>{const s=document.createElement("div");s.dataset.placeholderId=e.toString(),s.classList.add("nano-ele-placeholder"),i.push(t),t.parentNode.replaceChild(s,t)})),t.innerHTML=this.tplRenderFn(e.innerHTML.replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&"),this.indexResults),Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(i[parseInt(t.dataset.placeholderId)],t),this.placedAlgoliaEles.push(i[parseInt(t.dataset.placeholderId)])})),this.placedAlgoliaEles.length?new Promise((e=>{const i=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail)),this.placedAlgoliaEles.length||(setTimeout((()=>e("tpl updated")),500),t.removeEventListener("nanoTplUpdated",i))};t.addEventListener("nanoTplUpdated",i)})):Promise.resolve("algolia setup")}componentWillLoad(){o((()=>{this.tplSlot=h(this.host,'[slot="template"]')[0],this.outputSlot=h(this.host,'[slot="output"]')[0],this.slottedInput=h(this.host,'[slot="search-input"]')[0],this.hasLoadSlot=!!h(this.host,'[slot="loader"]')[0],this.tplSlot&&(this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText),this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()===u("nano-input")||this.slottedInput instanceof HTMLInputElement)?this.inputField=this.slottedInput:this.slottedInput?this.inputField=this.slottedInput.querySelector(`${u("nano-input")}, input:not([type="radio"]):not([type="checkbox"])`):this.handleListenToChange(),n((()=>{this.showResults&&this.tpl&&this.searchChange()}))})),this.searchIndexNameChange(),this.initAlgoliaClient(),this.initAlgoliaIndex(),function(t,i){var s=e(t),n=new Map,o={wormholes:n,state:i};p.set(t,o);var r=t.connectedCallback;t.connectedCallback=function(){p.set(t,o),r&&r.call(t)};var a=t.disconnectedCallback;t.disconnectedCallback=function(){p.delete(t),a&&a.call(t)},s.addEventListener("openWormhole",(function(t){t.stopPropagation();var e=t.detail,i=e.consumer,s=e.onOpen;if(!n.has(i)){if("symbol"!=typeof i){var r=i.connectedCallback,a=i.disconnectedCallback;i.connectedCallback=function(){n.set(i,t.detail),r&&r.call(i)},i.disconnectedCallback=function(){n.delete(i),a&&a.call(i)}}n.set(i,t.detail),m(t.detail,o.state),null==s||s.resolve((function(){n.delete(i)}))}})),s.addEventListener("closeWormhole",(function(t){n.delete(t.detail)}))}(this,this.wormholeState),this.storeId&&(l.init(this,["query","replicaIndex"],this.storeMethod,this.storeId),l.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")),this.internalIndexSwitch()}connectedCallback(){this.searchChange=c(this.searchChange,300),this.browseIndexChange(),this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return f(r,{key:"e5a080bf3b11c991465f1b44521b75539f80d5ec",class:{"show-results":this.showResults,"is-loading":this.isLoading,"nano-algolia":!0},"aria-busy":this.isLoading},this.hasLoadSlot&&f("div",{key:"586696526af9ba7b721ebfe8aeba2b5a45b8a19a",hidden:!this.isLoading},f("slot",{key:"40556633911954fd20b756fedf71aea7e15b15e1",name:"loader"})),!this.hasLoadSlot&&f("div",{key:"e5ee4968b6864b656b3537ec46b69e64ebe76370",class:{loader:!0,loading:this.isLoading}},f("nano-spinner",{key:"63bbc6292b6a7183fe21a2527ffbd3002548871b",overlay:!0,type:"circle"})),f(g,{key:"64e8d5149940ad9c3353709db00677805f0d9946",state:t},f("slot",{key:"700649f3a918fce90e0e4c533c849942b9c0ad5c",name:"search-input"}),f("div",{key:"5e5c54c6365ea0725a5b995115c196eb5b1026ca",class:"results-container","aria-live":"polite"},f("div",{key:"0a9559ae98ab627e5529dca1026ac1312127d824",ref:t=>this.resultsDiv=t,class:"results"},f("slot",{key:"cf30d2970741dfb1631fca008317e4420d228a98",name:"output"})))),f("div",{key:"4d9cf66b3c2c3d0e10e1a443002db80d686530f7",ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},f("slot",{key:"fc365faa7953cdf3a0aa2887716e2f0f3af464fa"})))}static get watchers(){return{listenTo:["handleListenToChange"],_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};Y.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";export{Y as nano_algolia}
4
+ import{j as t,a as e,r as i,c as s,e as n,f as o,d as r}from"./index-DXvE-U_j.js";import{a}from"./algoliasearch-lite.esm.browser-C1SNUAIj.js";import{g as h}from"./dom-Cb7FUtXp.js";import{C as l}from"./component-store-CH5BI3Tg.js";import{d as c}from"./throttle-C93FMm2Z.js";import{t as u,h as f}from"./renderer-BUaAsDso.js";import{S as d}from"./algolia-data-D6wnbV__.js";var p=new Map,m=function(t,e){var i=t.updater;t.fields.forEach((function(t){i(t,e[t])}))},g=function(e,i){var s=e.state,n=t();if(p.has(n)){var o=p.get(n);o.state=s,o.wormholes.forEach((function(t){m(t,s)}))}return i};class y{queue=[];workingOnPromise=!1;static pendingPromise=!1;stop=!1;limit=null;enqueue(t){return new Promise(((e,i)=>{this.queue.push({promise:t,resolve:e,reject:i}),this.dequeue()}))}dequeue(){if(this.workingOnPromise)return!1;if(this.stop)return this.queue=[],void(this.stop=!1);const t=this.queue.shift();if(!t)return!1;try{this.workingOnPromise=!0,t.promise().then((e=>{this.workingOnPromise=!1,t.resolve(e),this.dequeue()})).catch((e=>{this.workingOnPromise=!1,t.reject(e),this.dequeue()}))}catch(e){this.workingOnPromise=!1,t.reject(e),this.dequeue()}return!0}}function b(t){const e=new Error(t);var i,s;return i=e,s=b.prototype,Object.setPrototypeOf?Object.setPrototypeOf(i,s):i.__proto__=s,e}function w(t,e,i){const s=e.slice(0,i).split(/\n/),n=s.length,o=s[n-1].length+1;throw b(t+=" at line "+n+" col "+o+":\n\n "+e.split(/\n/)[n-1]+"\n "+Array(o).join(" ")+"^")}b.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});const v=new Function("return this")().Promise;let x=!1;try{x=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function F(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function C(t,e,i){for(const s in e)F(e,s)&&(t[s]=null==e[s]||"object"!=typeof e[s]||"storage"!==s&&"prefixes"!==s||i?e[s]:C({},e[s]));return t}const I=/^async +/,k=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,S=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,R=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,j=/[.*+\-?^${}()|[\]\\]/g;function _(t){return j.test(t)?t.replace(j,"\\$&"):t}function A(t,e){e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),k.lastIndex=0,S.lastIndex=0,R.lastIndex=0;const i=e.prefixes,s=[i.h,i.b,i.i,i.r,i.c,i.e].reduce((function(t,e){return t&&e?t+"|"+_(e):e?_(e):t}),""),n=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+_(e.tags[1])+")","g"),o=new RegExp("([^]*?)"+_(e.tags[0])+"(-|_)?\\s*("+s+")?\\s*","g");let r=0,a=!1;function h(i,s){const h={f:[]};let l,c=0,u="c";function f(i){const s=t.slice(r,i);let n=s.trim();if("f"===u)"safe"===n?h.raw=!0:e.async&&I.test(n)?(n=n.replace(I,""),h.f.push([n,"",!0])):h.f.push([n,""]);else if("fp"===u)h.f[h.f.length-1][1]+=n;else if("err"===u){if(n){const e=s.search(/\S/);w("invalid syntax",t,r+e)}}else h[u]=n;r=i+1}for("h"===s||"b"===s||"c"===s?u="n":"r"===s&&(h.raw=!0,s="i"),n.lastIndex=r;null!==(l=n.exec(t));){const e=l[1],i=l[2],d=l[3],p=l[4],m=l[5],g=l.index;if(e)"("===e?(0===c&&("n"===u?(f(g),u="p"):"f"===u&&(f(g),u="fp")),c++):")"===e?(c--,0===c&&"c"!==u&&(f(g),u="err")):0===c&&"|"===e?(f(g),u="f"):"=>"===e&&(f(g),r+=1,u="res");else if(i)if("/*"===i){const e=t.indexOf("*/",n.lastIndex);-1===e&&w("unclosed comment",t,l.index),n.lastIndex=e+2}else"'"===i?(S.lastIndex=l.index,S.exec(t)?n.lastIndex=S.lastIndex:w("unclosed string",t,l.index)):'"'===i?(R.lastIndex=l.index,R.exec(t)?n.lastIndex=R.lastIndex:w("unclosed string",t,l.index)):"`"===i&&(k.lastIndex=l.index,k.exec(t)?n.lastIndex=k.lastIndex:w("unclosed string",t,l.index));else if(d)return f(g),r=g+l[0].length,o.lastIndex=r,a=m,p&&"h"===s&&(s="s"),h.t=s,h}return w("unclosed tag",t,i),h}const l=function s(n,l){n.b=[],n.d=[];let c,u=!1,f=[];function d(t,i){t&&(t=function(t,e,i,s){let n,o;return"string"==typeof e.autoTrim?n=o=e.autoTrim:Array.isArray(e.autoTrim)&&(n=e.autoTrim[1],o=e.autoTrim[0]),(i||!1===i)&&(n=i),(s||!1===s)&&(o=s),"slurp"===n&&"slurp"===o?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===o||"slurp"===o?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==o&&"nl"!==o||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,e,a,i),t&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),f.push(t)))}for(;null!==(c=o.exec(t));){const o=c[1],a=c[2],l=c[3]||"";let p;for(const t in i)if(i[t]===l){p=t;break}d(o,a),r=c.index+c[0].length,p||w("unrecognized tag type: "+l,t,r);let m=h(c.index,p);const g=m.t;if("h"===g){const t=m.n||"";e.async&&I.test(t)&&(m.a=!0,m.n=t.replace(I,"")),m=s(m),f.push(m)}else if("c"===g){if(n.n===m.n)return u?(u.d=f,n.b.push(u)):n.d=f,n;w("Helper start and end don't match",t,c.index+c[0].length)}else if("b"===g){u?(u.d=f,n.b.push(u)):n.d=f;const t=m.n||"";e.async&&I.test(t)&&(m.a=!0,m.n=t.replace(I,"")),u=m,f=[]}else if("s"===g){const t=m.n||"";e.async&&I.test(t)&&(m.a=!0,m.n=t.replace(I,"")),f.push(m)}else f.push(m)}if(!l)throw b('unclosed helper "'+n.n+'"');return d(t.slice(r,t.length),!1),n.d=f,n}({f:[]},!0);if(e.plugins)for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];i.processAST&&(l.d=i.processAST(l.d,e))}return l.d}function z(t,e){const i=A(t,e);let s="var tR='';"+(e.useWith?"with("+e.varName+"||{}){":"")+q(i,e)+"if(cb){cb(null,tR)} return tR"+(e.useWith?"}":"");if(e.plugins)for(let t=0;t<e.plugins.length;t++){const i=e.plugins[t];i.processFnString&&(s=i.processFnString(s,e))}return s}function P(t,e){for(let i=0;i<e.length;i++){const s=e[i][1];t=(e[i][2]?"await ":"")+"c.l('F','"+e[i][0]+"')("+t,s&&(t+=","+s),t+=")"}return t}function T(t,e,i,s,n,o){let r="{exec:"+(n?"async ":"")+O(i,e,t)+",params:["+s+"]";return o&&(r+=",name:'"+o+"'"),n&&(r+=",async:true"),r+="}",r}function E(t,e){let i="[";for(let s=0;s<t.length;s++){const n=t[s];i+=T(e,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(i+=",")}return i+="]",i}function O(t,e,i){return"function("+e+"){var tR='';"+q(t,i)+"return tR}"}function q(t,e){let i=0;const s=t.length;let n="";for(;i<s;i++){const s=t[i];if("string"==typeof s)n+="tR+='"+s+"';";else{const t=s.t;let i=s.c||"";const o=s.f,r=s.n||"",a=s.p||"",h=s.res||"",l=s.b,c=!!s.a;if("i"===t){e.defaultFilter&&(i="c.l('F','"+e.defaultFilter+"')("+i+")");let t=P(i,o);!s.raw&&e.autoEscape&&(t="c.l('F','e')("+t+")"),n+="tR+="+t+";"}else if("h"===t)if(e.storage.nativeHelpers.get(r))n+=e.storage.nativeHelpers.get(r)(s,e);else{let t=(c?"await ":"")+"c.l('H','"+r+"')("+T(e,h,s.d,a,c);t+=l?","+E(l,e):",[]",t+=",c)",n+="tR+="+P(t,o)+";"}else"s"===t?n+="tR+="+P((c?"await ":"")+"c.l('H','"+r+"')({params:["+a+"]},[],c)",o)+";":"e"===t&&(n+=i+"\n")}}return n}class D{cache;constructor(t){this.cache=t}define(t,e){this.cache[t]=e}get(t){return this.cache[t]}remove(t){delete this.cache[t]}reset(){this.cache={}}load(t){C(this.cache,t,!0)}}function H(t,e,i,s){if(e&&e.length>0)throw b((s?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(i&&i.length>0)throw b((s?"Native":"")+"Helper '"+t+"' doesn't accept filters")}function N(t,e,i,s,n){i(t[e],e).then((function(o){s+=o,e===t.length-1?n(s):N(t,e+1,i,s,n)}))}function $(t,e,i,s,n,o){s(e[i],t[e[i]]).then((function(r){n+=r,i===e.length-1?o(n):$(t,e,i+1,s,n,o)}))}const L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function M(t){return L[t]}const U=new D({}),B=new D({each:function(t,e){let i="";const s=t.params[0];if(H("each",e,!1),t.async)return new Promise((function(e){N(s,0,t.exec,i,e)}));for(let e=0;e<s.length;e++)i+=t.exec(s[e],e);return i},foreach:function(t,e){const i=t.params[0];if(H("foreach",e,!1),t.async)return new Promise((function(e){$(i,Object.keys(i),0,t.exec,"",e)}));{let e="";for(const s in i)F(i,s)&&(e+=t.exec(s,i[s]));return e}},include:function(t,e,i){H("include",e,!1);const s=i.storage.templates.get(t.params[0]);if(!s)throw b('Could not fetch template "'+t.params[0]+'"');return s(t.params[1],i)},extends:function(t,e,i){const s=t.params[1]||{};s.content=t.exec();for(let t=0;t<e.length;t++){const i=e[t];s[i.name]=i.exec()}const n=i.storage.templates.get(t.params[0]);if(!n)throw b('Could not fetch template "'+t.params[0]+'"');return n(s,i)},useScope:function(t,e){return H("useScope",e,!1),t.exec(t.params[0])}}),Q=new D({if:function(t,e){H("if",!1,t.f,!0);let i="if("+t.p+"){"+q(t.d,e)+"}";if(t.b)for(let s=0;s<t.b.length;s++){const n=t.b[s];"else"===n.n?i+="else{"+q(n.d,e)+"}":"elif"===n.n&&(i+="else if("+n.p+"){"+q(n.d,e)+"}")}return i},try:function(t,e){if(H("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw b("native helper 'try' only accepts 1 block, 'catch'");let i="try{"+q(t.d,e)+"}";const s=t.b[0];return i+="catch"+(s.res?"("+s.res+")":"")+"{"+q(s.d,e)+"}",i},block:function(t,e){return H("block",t.b,t.f,!0),"if(!"+e.varName+"["+t.p+"]){tR+=("+O(t.d,"",e)+")()}else{tR+="+e.varName+"["+t.p+"]}"}}),W=new D({e:function(t){const e=String(t);return/[&<>"']/.test(e)?e.replace(/[&<>"']/g,M):e}}),K={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){const t=this.storage.helpers.get(e);if(t)return t;throw b("Can't find helper '"+e+"'")}if("F"===t){const t=this.storage.filters.get(e);if(t)return t;throw b("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:B,nativeHelpers:Q,filters:W,templates:U},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function X(t,e){const i={};return C(i,K),e&&C(i,e),t&&C(i,t),i.l.bind(i),i}function G(t,e){const i=X(e||{});let s=Function;if(i.async){if(!x)throw b("This environment doesn't support async/await");s=x}try{return new s(i.varName,"c","cb",z(t,i))}catch(e){throw e instanceof SyntaxError?b("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+z(t,i)):e}}function V(t,e){let i;return e.cache&&e.name&&e.storage.templates.get(e.name)?e.storage.templates.get(e.name):(i="function"==typeof t?t:G(t,e),e.cache&&e.name&&e.storage.templates.define(e.name,i),i)}K.l.bind(K);var Z=Object.freeze({__proto__:null,compile:G,compileScope:q,compileScopeIntoFunction:O,compileToString:z,defaultConfig:K,filters:W,getConfig:X,helpers:B,nativeHelpers:Q,parse:A,render:function(t,e,i,s){const n=X(i||{});if(!n.async)return V(t,n)(e,n);{let i;if(!s){if("function"==typeof v)return new v((function(s,o){try{i=V(t,n)(e,n),s(i)}catch(t){o(t)}}));throw b("Please provide a callback function, this env doesn't support Promises")}try{V(t,n)(e,n,s)}catch(t){return s(t)}}},templates:U});W.define("date_long",((t,e={year:"numeric",month:"long",day:"numeric"})=>{if(t)return new Date(1e3*parseInt(t)).toLocaleDateString("en-GB",e)})),W.define("date_short",((t,e="d/m/y")=>{if(!t)return;const i=new Date(1e3*parseInt(t));return(t=(t=e.replace(/(d)/,i.getDate().toString())).replace(/(m)/,(i.getMonth()+1).toString())).replace(/(y)/,i.getFullYear().toString())})),W.define("public_name",(t=>{if(t)return(t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ")).charAt(0).toUpperCase()+t.slice(1)})),W.define("trim_to",((t,e=100)=>{if(t)return t.length<=e?t:t.substr(0,e)+"..."})),W.define("classname",(t=>{if(t)return t.replace(/[\W]+/g,"")})),W.define("abs_url",((t,e=null,i)=>{if(!e)return t;if(!t)return;let s;if(e.domains&&i&&i.origin){const t=e.domains.find((t=>t.origin===i.origin));s=t?t.domain:""}else e.domain&&(s=e.domain);return t.match(/^http/)||!s?t:(t.startsWith("/")||(t="/"+t),location.protocol+"//"+s+t)})),W.define("replace",((t,e,i)=>t.replace(e,i))),W.define("remove_spaces",(t=>t.replace(/ /g,"_"))),W.define("add_spaces",(t=>t.replace(/[_\-]/g," "))),W.define("capitalise",(t=>t.charAt(0).toUpperCase()+t.slice(1))),W.define("lowercase",(t=>t.toLowerCase()));const J=Z,Y=class{constructor(t){i(this,t),this.nanoDidLoad=s(this,"nanoDidLoad",7),this.nanoResultsShown=s(this,"nanoResultsShown",3),this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7),this.nanoAfterQuery=s(this,"nanoAfterQuery",7),this.nanoNewResults=s(this,"nanoNewResults",7)}staticFacetFilters={};dynFacetFilters={};tplSlot;outputSlot;slottedInput;hasLoadSlot=!1;resultsDiv;defaultDiv;tpl;facets;placedAlgoliaEles=[];algoliaClient;promiseQueue=new y;get host(){return e(this)}_dynFacetFilters={};inputField;algoliaIndex;indeces=[];indexResults;filterChanged="";currentHits;changeEvent=d.Init;isLoading=!1;wormholeState=this;showResults=!1;resultsPage=0;appId;apiKey;searchIndex={};searchIndexName="";listenTo=null;handleListenToChange(){if(!this.listenTo)return;const t=document.querySelector(this.listenTo);["nano-input","input"].includes(t.tagName.toLocaleLowerCase())&&(this.inputField=t)}query="";operator="and";filters=[];tplRenderFn=J.render;replicaIndex="";browseIndex=!1;minChars=2;storeId;storeMethod="session";nanoDidLoad;nanoResultsShown;nanoBeforeQuery;nanoAfterQuery;nanoNewResults;async removeFilters(t,e){t||e?Object.keys(this._dynFacetFilters).forEach((i=>{t&&this._dynFacetFilters[i].facetName===t&&(this._dynFacetFilters[i].element.value=e?this._dynFacetFilters[i].value.filter((t=>t!==e)):"")})):this.clearAllFacetFilters()}onAllTplUpdate(t){t.stopPropagation(),t.target.tagName.toLowerCase()===u("nano-algolia-results")&&requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}async onPageChange(t){if(!this.indexResults)return;let e=this.resultsPage;t&&(t.stopPropagation(),e=t.detail.page),e=Math.min(this.indexResults.totalPages-1,e),e=Math.max(e,0),this.indexResults.currentPage!==e&&(this.indexResults.currentPage=e,await this.algoliaSearch(d.Page))}async onFilterChange(t){t.stopPropagation();const e={},i=t.detail;i.element=t.target,this.indexResults?(this.staticFacetFilters[i.filterId]?this.staticFacetFilters[i.filterId]=i:(e[i.filterId]=i,this._dynFacetFilters={...this._dynFacetFilters,...e}),this.indexResults.appliedFilters=this.makeAppliedFilters()):this.staticFacetFilters[i.filterId]=i,this.filterChanged=i.value&&i.value.length?i.filterId:"all",this.resetPage(),this.algoliaSearch(d.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{this.host.ownerDocument===t.element.ownerDocument?this.dynFacetFilters[t.filterId]=t:delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){this.browseIndex&&(!this.query||this.query.length<this.minChars)&&(this.query="*")}inputFieldSet(){this.inputField&&"*"!==this.query&&this.inputField&&this.inputField.value!==this.query&&(this.inputField.value=this.query)}queryChange(){this.searchChange()}searchChange=async()=>{if(this.algoliaIndex){if(!this.query||this.query.length<this.minChars){if(!this.browseIndex)return this.query&&0!==this.query.length?void 0:void this.handleSearchReset();if("*"!==this.query)return void(this.query="*")}this.isLoading=!0,setTimeout((async()=>{this.resetPage(),await this.algoliaSearch(d.Init),await this.updateContent(),setTimeout((()=>this.isLoading=!1),800),this.showResults=!0,this.nanoResultsShown.emit({meta:this.indexResults,client:{appId:this.appId,apiKey:this.apiKey}})}),200)}};async internalIndexSwitch(){this.replicaIndex&&this.indexResults&&this.indexResults.index!==this.replicaIndex&&(this.indexResults.index=this.replicaIndex,this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index),this.resetPage(),this.algoliaSearch(d.Replica))}pageChange(){this.onPageChange()}searchIndexNameChange(){!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName||(this.searchIndex={index:this.searchIndexName})}initAlgoliaClient(){this.appId&&this.apiKey&&(this.algoliaClient=a(this.appId,this.apiKey))}initAlgoliaIndex(){this.algoliaClient&&this.searchIndex&&this.searchIndex.index&&(this.searchIndex.hitsPerPage||(this.searchIndex.hitsPerPage=100),this.replicaIndex&&(this.searchIndex.index=this.replicaIndex),this.searchIndexName=this.searchIndex.index,this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index),this.searchChange())}showResultsChange(){this.resultsDiv&&this.defaultDiv&&(this.showResults?(this.resultsDiv.style.width=this.host.scrollWidth+"px",this.resultsDiv.style.minHeight=this.host.scrollHeight+"px",n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay),this.resultsDiv.style.display="block",setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))):n((()=>{this.resultsDiv.classList.remove("shown"),this.defaultDiv.style.display="block",setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay),this.resultsDiv.classList.remove("show"),this.slottedInput?this.slottedInput.focus({preventScroll:!0}):this.defaultDiv.focus({preventScroll:!0})}),50)})))}handleFilterpropChange(){this.algoliaSearch(d.Init)}fixDomain(t){return this.searchIndex&&this.searchIndex.domain?(t.hits.map((t=>{t.url&&!t.url.match(/^http/)&&(t.url=location.protocol+"//"+this.searchIndex.domain+t.url)})),t):t}makeAppliedFilters=()=>{const t=[],e=e=>{Object.values(e).forEach((e=>{if(e.value&&e.value.length){const i=t.find((t=>t.name===e.facetName));i?i.values=[...i.values,...e.value]:t.push({name:e.facetName,values:[...e.value]})}}))};return e(this.dynFacetFilters),e(this.staticFacetFilters),t.length?t:null};algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));queueSearch=async t=>{if(!(this.algoliaIndex&&this.query&&this.searchIndex&&this.searchIndex.index))return;this.nanoBeforeQuery.emit(this.indexResults),d.Init===t&&this.clearAllFacetFilters();const e={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0,clickAnalytics:!0};this.searchIndex.filters&&(e.facets=this.searchIndex.filters),this.searchIndex.hitsPerPage&&(e.hitsPerPage=this.searchIndex.hitsPerPage);let i=await this.algoliaIndex.search(this.query,e);return i=this.fixDomain(i),this.changeEvent=t,t!==d.Init&&this.indexResults||(this.indexResults={queryID:i.queryID,currentPage:0,totalHits:i.nbHits,hitsPerPage:null,origFilters:i.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index,searchIndex:this.searchIndex}),this.indexResults.dynFilters=i.facets,this.indexResults.results=i.hits,this.indexResults.totalHitsWithFilters=i.nbHits,this.indexResults.currentPage=i.page,this.indexResults.totalPages=i.nbPages,this.indexResults.hitsPerPage=i.hitsPerPage,this.indexResults.query=i.query,this.changeEvent!==d.Page&&this.changeEvent!==d.Replica&&(this.facets=i.facets),this.nanoAfterQuery.emit(this.indexResults),new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((()=>{this.currentHits=this.indexResults.results,this.resultsPage=this.indexResults.currentPage}))};resetPage(){this.indexResults&&(this.indexResults.currentPage=0)}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""})),this._dynFacetFilters={}}algoliaFilterStr(){const t={},e=e=>{let i,s;Object.keys(e).forEach((n=>{i=e[n],t[n]=t[n]||{name:i.facetName,or:[],and:[],not:[]},s=t[n][i.operator],i.value&&i.value.length&&(t[n][i.operator]=[...s,...i.value])}))};e(this.dynFacetFilters),e(this.staticFacetFilters);const i=(t,e)=>e.indexOf(" ")>-1?t+':"'+e+'"':t+":"+e;let s,n,o=[];return Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((e=>{s=t,n=t.name,"or"===e||"and"===e?s[e].length&&o.push("( "+s[e].map((t=>{if(t.length)return i(n,t)})).join(" "+e.toLocaleUpperCase()+" ")+" )"):s.not.length&&o.push("( "+s[e].map((t=>{if(t.length)return"NOT "+i(n,t)})).join(" AND ")+" )")}))})),o=[...this.filters,...o],o.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){t.target===this.inputField&&(this.query=this.inputField.value)}handleSearchReset=()=>{this.showResults=!1,this.indexResults=null};onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay),this.showResults?(this.defaultDiv.style.display="none",this.resultsDiv.classList.add("shown"),this.resultsDiv.style.minHeight="",this.resultsDiv.style.width=""):this.resultsDiv.style.display="none"}))};async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const e=document.createElement("div");e.innerHTML=this.tpl;const i=[];return this.placedAlgoliaEles=[],Array.from(e.querySelectorAll(`${u("nano-algolia")}, ${u("nano-algolia-filter")}, ${u("nano-algolia-results")}`)).forEach(((t,e)=>{const s=document.createElement("div");s.dataset.placeholderId=e.toString(),s.classList.add("nano-ele-placeholder"),i.push(t),t.parentNode.replaceChild(s,t)})),t.innerHTML=this.tplRenderFn(e.innerHTML.replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&"),this.indexResults),Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(i[parseInt(t.dataset.placeholderId)],t),this.placedAlgoliaEles.push(i[parseInt(t.dataset.placeholderId)])})),this.placedAlgoliaEles.length?new Promise((e=>{const i=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail)),this.placedAlgoliaEles.length||(setTimeout((()=>e("tpl updated")),500),t.removeEventListener("nanoTplUpdated",i))};t.addEventListener("nanoTplUpdated",i)})):Promise.resolve("algolia setup")}componentWillLoad(){o((()=>{this.tplSlot=h(this.host,'[slot="template"]')[0],this.outputSlot=h(this.host,'[slot="output"]')[0],this.slottedInput=h(this.host,'[slot="search-input"]')[0],this.hasLoadSlot=!!h(this.host,'[slot="loader"]')[0],this.tplSlot&&(this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText),this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()===u("nano-input")||this.slottedInput instanceof HTMLInputElement)?this.inputField=this.slottedInput:this.slottedInput?this.inputField=this.slottedInput.querySelector(`${u("nano-input")}, input:not([type="radio"]):not([type="checkbox"])`):this.handleListenToChange(),n((()=>{this.showResults&&this.tpl&&this.searchChange()}))})),this.searchIndexNameChange(),this.initAlgoliaClient(),this.initAlgoliaIndex(),function(t,i){var s=e(t),n=new Map,o={wormholes:n,state:i};p.set(t,o);var r=t.connectedCallback;t.connectedCallback=function(){p.set(t,o),r&&r.call(t)};var a=t.disconnectedCallback;t.disconnectedCallback=function(){p.delete(t),a&&a.call(t)},s.addEventListener("openWormhole",(function(t){t.stopPropagation();var e=t.detail,i=e.consumer,s=e.onOpen;if(!n.has(i)){if("symbol"!=typeof i){var r=i.connectedCallback,a=i.disconnectedCallback;i.connectedCallback=function(){n.set(i,t.detail),r&&r.call(i)},i.disconnectedCallback=function(){n.delete(i),a&&a.call(i)}}n.set(i,t.detail),m(t.detail,o.state),null==s||s.resolve((function(){n.delete(i)}))}})),s.addEventListener("closeWormhole",(function(t){n.delete(t.detail)}))}(this,this.wormholeState),this.storeId&&(l.init(this,["query","replicaIndex"],this.storeMethod,this.storeId),l.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")),this.internalIndexSwitch()}connectedCallback(){this.searchChange=c(this.searchChange,300),this.browseIndexChange(),this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return f(r,{key:"e5a080bf3b11c991465f1b44521b75539f80d5ec",class:{"show-results":this.showResults,"is-loading":this.isLoading,"nano-algolia":!0},"aria-busy":this.isLoading},this.hasLoadSlot&&f("div",{key:"586696526af9ba7b721ebfe8aeba2b5a45b8a19a",hidden:!this.isLoading},f("slot",{key:"40556633911954fd20b756fedf71aea7e15b15e1",name:"loader"})),!this.hasLoadSlot&&f("div",{key:"e5ee4968b6864b656b3537ec46b69e64ebe76370",class:{loader:!0,loading:this.isLoading}},f("nano-spinner",{key:"420a97d058127ea029329d6eca5055c0c54f4c1f",overlay:!0})),f(g,{key:"9c271e35ea7f850eb1ec2f99415ab2eebf014387",state:t},f("slot",{key:"7a7a5ac869321d6db0a2f6f784a28e638cbe1a3f",name:"search-input"}),f("div",{key:"91b799022bee756066f1eb60038fdb428c98d3dc",class:"results-container","aria-live":"polite"},f("div",{key:"4209e438e0cefbc244dde4c3a9c10e3e5bf56137",ref:t=>this.resultsDiv=t,class:"results"},f("slot",{key:"44b89a4cae72f8ff38c08dd605df32df03a2fc9a",name:"output"})))),f("div",{key:"7fa2100def56573ef4e098ca6da1a722d50416f9",ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},f("slot",{key:"2d5b9cd557465ceee3f249cc556aa6fa32cffd75"})))}static get watchers(){return{listenTo:["handleListenToChange"],_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};Y.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";export{Y as nano_algolia}