radames HF staff commited on
Commit
bb145f1
β€’
1 Parent(s): 9709301
frontend/package.json CHANGED
@@ -39,9 +39,7 @@
39
  "type": "module",
40
  "dependencies": {
41
  "@fontsource/fira-mono": "^4.5.0",
42
- "extract-colors": "^1.1.22",
43
  "quantize": "^1.0.2",
44
- "scroll-into-view-if-needed": "^2.2.29",
45
- "uninstall": "^0.0.0"
46
  }
47
  }
 
39
  "type": "module",
40
  "dependencies": {
41
  "@fontsource/fira-mono": "^4.5.0",
 
42
  "quantize": "^1.0.2",
43
+ "scroll-into-view-if-needed": "^2.2.29"
 
44
  }
45
  }
frontend/src/app.d.ts CHANGED
@@ -1,9 +1,15 @@
1
  // See https://kit.svelte.dev/docs/types#app
2
  // for information about these interfaces
3
  // and what to do when importing types
4
- declare namespace App {
5
- // interface Locals {}
6
- // interface PageData {}
7
- // interface PageError {}
8
- // interface Platform {}
 
 
 
 
 
 
9
  }
 
1
  // See https://kit.svelte.dev/docs/types#app
2
  // for information about these interfaces
3
  // and what to do when importing types
4
+
5
+ declare global {
6
+ namespace App {
7
+ // interface Locals {}
8
+ // interface PageData {}
9
+ // interface PageError {}
10
+ // interface Platform {}
11
+ interface Window {
12
+ parentIFrame: unknown;
13
+ }
14
+ }
15
  }
frontend/src/routes/+page.svelte CHANGED
@@ -1,13 +1,11 @@
1
  <script lang="ts">
2
  import { onMount } from 'svelte';
3
- import scrollIntoView from 'scroll-into-view-if-needed';
4
-
5
  import type { ColorsPrompt, ColorsImage } from '$lib/types';
6
  import { randomSeed, extractPalette, uploadImage } from '$lib/utils';
7
  import { isLoading, loadingState } from '$lib/store';
8
  import { PUBLIC_WS_ENDPOINT, PUBLIC_DEV_MODE } from '$env/static/public';
9
- console.log(PUBLIC_DEV_MODE);
10
  import Pallette from '$lib/Palette.svelte';
 
11
  const apiUrl =
12
  PUBLIC_DEV_MODE === 'DEV'
13
  ? 'http://localhost:7860'
@@ -154,7 +152,10 @@
154
  }
155
  function remix(e: CustomEvent) {
156
  prompt = e.detail.prompt;
157
- scrollIntoView(promptInputEl, { behavior: 'smooth', scrollMode: 'if-needed' });
 
 
 
158
  }
159
  </script>
160
 
 
1
  <script lang="ts">
2
  import { onMount } from 'svelte';
 
 
3
  import type { ColorsPrompt, ColorsImage } from '$lib/types';
4
  import { randomSeed, extractPalette, uploadImage } from '$lib/utils';
5
  import { isLoading, loadingState } from '$lib/store';
6
  import { PUBLIC_WS_ENDPOINT, PUBLIC_DEV_MODE } from '$env/static/public';
 
7
  import Pallette from '$lib/Palette.svelte';
8
+
9
  const apiUrl =
10
  PUBLIC_DEV_MODE === 'DEV'
11
  ? 'http://localhost:7860'
 
152
  }
153
  function remix(e: CustomEvent) {
154
  prompt = e.detail.prompt;
155
+ promptInputEl.scrollIntoView({ behavior: 'smooth' });
156
+ if ('parentIFrame' in window) {
157
+ window.parentIFrame.scrollTo(0, promptInputEl.offsetTop);
158
+ }
159
  }
160
  </script>
161
 
static/_app/immutable/chunks/1-31cf4ccc.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{default as t}from"../components/error.svelte-ebe8b925.js";export{t as component};
static/_app/immutable/chunks/1-dea0ad4d.js DELETED
@@ -1 +0,0 @@
1
- import{default as t}from"../components/error.svelte-06141ece.js";export{t as component};
 
 
static/_app/immutable/chunks/2-41999758.js DELETED
@@ -1 +0,0 @@
1
- import{default as t}from"../components/pages/_page.svelte-af06679d.js";export{t as component};
 
 
static/_app/immutable/chunks/2-41cb5b33.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{default as t}from"../components/pages/_page.svelte-bf6d812e.js";export{t as component};
static/_app/immutable/chunks/{singletons-30e820d5.js β†’ singletons-aa6d0232.js} RENAMED
@@ -1 +1 @@
1
- import{w as u}from"./index-3bda1050.js";let f="",b="";function g(n){f=n.base,b=n.assets||f}function m(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function _(){return{x:pageXOffset,y:pageYOffset}}function k(n){let e,t=null,r=null,a=null;for(const s of n.composedPath())s instanceof Element&&(!e&&s.nodeName.toUpperCase()==="A"&&(e=s),t===null&&(t=l(s,"data-sveltekit-noscroll")),r===null&&(r=l(s,"data-sveltekit-prefetch")),a===null&&(a=l(s,"data-sveltekit-reload")));const o=e&&new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI);return{a:e,url:o,options:{noscroll:t,prefetch:r,reload:a}}}function l(n,e){const t=n.getAttribute(e);return t===null?t:t===""?!0:(t==="off",!1)}function d(n){const e=u(n);let t=!0;function r(){t=!0,e.update(s=>s)}function a(s){t=!1,e.set(s)}function o(s){let i;return e.subscribe(c=>{(i===void 0||t&&c!==i)&&s(i=c)})}return{notify:r,set:a,subscribe:o}}function p(){const{set:n,subscribe:e}=u(!1);let t;async function r(){clearTimeout(t);const a=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(a.ok){const{version:o}=await a.json(),s=o!=="1663886403064";return s&&(n(!0),clearTimeout(t)),s}else throw new Error(`Version check failed: ${a.status}`)}return{subscribe:e,check:r}}function v(n){n.client}const w={url:d({}),page:d({}),navigating:u(null),updated:p()};export{_ as a,g as b,k as f,m as g,v as i,w as s};
 
1
+ import{w as u}from"./index-3bda1050.js";let f="",b="";function g(n){f=n.base,b=n.assets||f}function m(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function _(){return{x:pageXOffset,y:pageYOffset}}function k(n){let e,t=null,r=null,a=null;for(const s of n.composedPath())s instanceof Element&&(!e&&s.nodeName.toUpperCase()==="A"&&(e=s),t===null&&(t=l(s,"data-sveltekit-noscroll")),r===null&&(r=l(s,"data-sveltekit-prefetch")),a===null&&(a=l(s,"data-sveltekit-reload")));const o=e&&new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI);return{a:e,url:o,options:{noscroll:t,prefetch:r,reload:a}}}function l(n,e){const t=n.getAttribute(e);return t===null?t:t===""?!0:(t==="off",!1)}function d(n){const e=u(n);let t=!0;function r(){t=!0,e.update(s=>s)}function a(s){t=!1,e.set(s)}function o(s){let i;return e.subscribe(c=>{(i===void 0||t&&c!==i)&&s(i=c)})}return{notify:r,set:a,subscribe:o}}function p(){const{set:n,subscribe:e}=u(!1);let t;async function r(){clearTimeout(t);const a=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(a.ok){const{version:o}=await a.json(),s=o!=="1663890399767";return s&&(n(!0),clearTimeout(t)),s}else throw new Error(`Version check failed: ${a.status}`)}return{subscribe:e,check:r}}function v(n){n.client}const w={url:d({}),page:d({}),navigating:u(null),updated:p()};export{_ as a,g as b,k as f,m as g,v as i,w as s};
static/_app/immutable/components/{error.svelte-06141ece.js β†’ error.svelte-ebe8b925.js} RENAMED
@@ -1 +1 @@
1
- import{S as A,i as C,s as F,k as v,q as k,a as h,e as q,l as g,m as E,r as $,h as p,c as R,b as u,F as P,u as S,A as w,G}from"../chunks/index-5559954d.js";import{s as H}from"../chunks/singletons-30e820d5.js";const O=()=>{const t=H,s={page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated};return Object.defineProperties(s,{preloading:{get(){return console.error("stores.preloading is deprecated; use stores.navigating instead"),{subscribe:t.navigating.subscribe}},enumerable:!1},session:{get(){return B(),{}},enumerable:!1}}),s},z={subscribe(t){return O().page.subscribe(t)}};function B(){throw new Error("stores.session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")}function N(t){let s,i=t[0].error.frame+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.frame+"")&&S(o,i)},d(r){r&&p(s)}}}function y(t){let s,i=t[0].error.stack+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.stack+"")&&S(o,i)},d(r){r&&p(s)}}}function D(t){let s,i=t[0].status+"",o,r,a,b=t[0].error.message+"",_,d,c,m,l=t[0].error.frame&&N(t),n=t[0].error.stack&&y(t);return{c(){s=v("h1"),o=k(i),r=h(),a=v("pre"),_=k(b),d=h(),l&&l.c(),c=h(),n&&n.c(),m=q()},l(e){s=g(e,"H1",{});var f=E(s);o=$(f,i),f.forEach(p),r=R(e),a=g(e,"PRE",{});var j=E(a);_=$(j,b),j.forEach(p),d=R(e),l&&l.l(e),c=R(e),n&&n.l(e),m=q()},m(e,f){u(e,s,f),P(s,o),u(e,r,f),u(e,a,f),P(a,_),u(e,d,f),l&&l.m(e,f),u(e,c,f),n&&n.m(e,f),u(e,m,f)},p(e,[f]){f&1&&i!==(i=e[0].status+"")&&S(o,i),f&1&&b!==(b=e[0].error.message+"")&&S(_,b),e[0].error.frame?l?l.p(e,f):(l=N(e),l.c(),l.m(c.parentNode,c)):l&&(l.d(1),l=null),e[0].error.stack?n?n.p(e,f):(n=y(e),n.c(),n.m(m.parentNode,m)):n&&(n.d(1),n=null)},i:w,o:w,d(e){e&&p(s),e&&p(r),e&&p(a),e&&p(d),l&&l.d(e),e&&p(c),n&&n.d(e),e&&p(m)}}}function I(t,s,i){let o;return G(t,z,r=>i(0,o=r)),[o]}class L extends A{constructor(s){super(),C(this,s,I,D,F,{})}}export{L as default};
 
1
+ import{S as A,i as C,s as F,k as v,q as k,a as h,e as q,l as g,m as E,r as $,h as p,c as R,b as u,F as P,u as S,A as w,G}from"../chunks/index-5559954d.js";import{s as H}from"../chunks/singletons-aa6d0232.js";const O=()=>{const t=H,s={page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated};return Object.defineProperties(s,{preloading:{get(){return console.error("stores.preloading is deprecated; use stores.navigating instead"),{subscribe:t.navigating.subscribe}},enumerable:!1},session:{get(){return B(),{}},enumerable:!1}}),s},z={subscribe(t){return O().page.subscribe(t)}};function B(){throw new Error("stores.session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")}function N(t){let s,i=t[0].error.frame+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.frame+"")&&S(o,i)},d(r){r&&p(s)}}}function y(t){let s,i=t[0].error.stack+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.stack+"")&&S(o,i)},d(r){r&&p(s)}}}function D(t){let s,i=t[0].status+"",o,r,a,b=t[0].error.message+"",_,d,c,m,l=t[0].error.frame&&N(t),n=t[0].error.stack&&y(t);return{c(){s=v("h1"),o=k(i),r=h(),a=v("pre"),_=k(b),d=h(),l&&l.c(),c=h(),n&&n.c(),m=q()},l(e){s=g(e,"H1",{});var f=E(s);o=$(f,i),f.forEach(p),r=R(e),a=g(e,"PRE",{});var j=E(a);_=$(j,b),j.forEach(p),d=R(e),l&&l.l(e),c=R(e),n&&n.l(e),m=q()},m(e,f){u(e,s,f),P(s,o),u(e,r,f),u(e,a,f),P(a,_),u(e,d,f),l&&l.m(e,f),u(e,c,f),n&&n.m(e,f),u(e,m,f)},p(e,[f]){f&1&&i!==(i=e[0].status+"")&&S(o,i),f&1&&b!==(b=e[0].error.message+"")&&S(_,b),e[0].error.frame?l?l.p(e,f):(l=N(e),l.c(),l.m(c.parentNode,c)):l&&(l.d(1),l=null),e[0].error.stack?n?n.p(e,f):(n=y(e),n.c(),n.m(m.parentNode,m)):n&&(n.d(1),n=null)},i:w,o:w,d(e){e&&p(s),e&&p(r),e&&p(a),e&&p(d),l&&l.d(e),e&&p(c),n&&n.d(e),e&&p(m)}}}function I(t,s,i){let o;return G(t,z,r=>i(0,o=r)),[o]}class L extends A{constructor(s){super(),C(this,s,I,D,F,{})}}export{L as default};
static/_app/immutable/components/pages/_page.svelte-af06679d.js DELETED
@@ -1,9 +0,0 @@
1
- import{S as Te,i as Ve,s as Le,k as R,l as z,m as S,h as k,n as b,b as F,F as w,A as Qe,H as bt,I as $e,a as U,q as Q,J as Me,c as j,r as X,p as Ee,K as pe,u as ve,v as xt,w as vt,L as Xe,x as wt,f as le,t as be,y as yt,M as _t,N as zt,O as Ze,P as Je,d as Et,G as Ye,o as Bt,e as Fe,g as Nt,Q as V,R as Tt}from"../../chunks/index-5559954d.js";import{w as kt}from"../../chunks/index-3bda1050.js";function Ke(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function Ge(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function Oe(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return Ge(r.overflowY,t)||Ge(r.overflowX,t)||function(a){var n=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}}(a);return!!n&&(n.clientHeight<a.scrollHeight||n.clientWidth<a.scrollWidth)}(e)}return!1}function Ne(e,t,r,a,n,s,l,o){return s<e&&l>t||s>e&&l<t?0:s<=e&&o<=r||l>=t&&o>=r?s-e-a:l>t&&o<r||s<e&&o>r?l-t+n:0}function et(e,t){var r=window,a=t.scrollMode,n=t.block,s=t.inline,l=t.boundary,o=t.skipOverflowHiddenElements,u=typeof l=="function"?l:function(Rt){return Rt!==l};if(!Ke(e))throw new TypeError("Invalid target");for(var N=document.scrollingElement||document.documentElement,H=[],$=e;Ke($)&&u($);){if(($=$.parentElement)===N){H.push($);break}$!=null&&$===document.body&&Oe($)&&!Oe(document.documentElement)||$!=null&&Oe($,o)&&H.push($)}for(var c=r.visualViewport?r.visualViewport.width:innerWidth,i=r.visualViewport?r.visualViewport.height:innerHeight,h=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),x=g.height,_=g.width,d=g.top,y=g.right,p=g.bottom,m=g.left,v=n==="start"||n==="nearest"?d:n==="end"?p:d+x/2,E=s==="center"?m+_/2:s==="end"?y:m,M=[],C=0;C<H.length;C++){var D=H[C],P=D.getBoundingClientRect(),T=P.height,A=P.width,B=P.top,O=P.right,q=P.bottom,I=P.left;if(a==="if-needed"&&d>=0&&m>=0&&p<=i&&y<=c&&d>=B&&p<=q&&m>=I&&y<=O)return M;var W=getComputedStyle(D),K=parseInt(W.borderLeftWidth,10),oe=parseInt(W.borderTopWidth,10),ce=parseInt(W.borderRightWidth,10),re=parseInt(W.borderBottomWidth,10),Z=0,G=0,ne="offsetWidth"in D?D.offsetWidth-D.clientWidth-K-ce:0,se="offsetHeight"in D?D.offsetHeight-D.clientHeight-oe-re:0;if(N===D)Z=n==="start"?v:n==="end"?v-i:n==="nearest"?Ne(f,f+i,i,oe,re,f+v,f+v+x,x):v-i/2,G=s==="start"?E:s==="center"?E-c/2:s==="end"?E-c:Ne(h,h+c,c,K,ce,h+E,h+E+_,_),Z=Math.max(0,Z+f),G=Math.max(0,G+h);else{Z=n==="start"?v-B-oe:n==="end"?v-q+re+se:n==="nearest"?Ne(B,q,T,oe,re+se,v,v+x,x):v-(B+T/2)+se/2,G=s==="start"?E-I-K:s==="center"?E-(I+A/2)+ne/2:s==="end"?E-O+ce+ne:Ne(I,O,A,K,ce+ne,E,E+_,_);var We=D.scrollLeft,Ae=D.scrollTop;v+=Ae-(Z=Math.max(0,Math.min(Ae+Z,D.scrollHeight-T+se))),E+=We-(G=Math.max(0,Math.min(We+G,D.scrollWidth-A+ne)))}M.push({el:D,top:Z,left:G})}return M}function Ct(e){return e===Object(e)&&Object.keys(e).length!==0}function Vt(e,t){t===void 0&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach(function(a){var n=a.el,s=a.top,l=a.left;n.scroll&&r?n.scroll({top:s,left:l,behavior:t}):(n.scrollTop=s,n.scrollLeft=l)})}function Lt(e){return e===!1?{block:"end",inline:"nearest"}:Ct(e)?e:{block:"start",inline:"nearest"}}function Ut(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(Ct(t)&&typeof t.behavior=="function")return t.behavior(r?et(e,t):[]);if(!!r){var a=Lt(t);return Vt(et(e,a),a.behavior)}}if(!ae)var ae={map:function(e,t){var r={};return t?e.map(function(a,n){return r.index=n,t.call(r,a)}):e.slice()},naturalOrder:function(e,t){return e<t?-1:e>t?1:0},sum:function(e,t){var r={};return e.reduce(t?function(a,n,s){return r.index=s,a+t.call(r,n)}:function(a,n){return a+n},0)},max:function(e,t){return Math.max.apply(null,t?ae.map(e,t):e)}};var jt=function(){var e=5,t=8-e,r=1e3,a=.75;function n(c,i,h){return(c<<2*e)+(i<<e)+h}function s(c){var i=[],h=!1;function f(){i.sort(c),h=!0}return{push:function(g){i.push(g),h=!1},peek:function(g){return h||f(),g===void 0&&(g=i.length-1),i[g]},pop:function(){return h||f(),i.pop()},size:function(){return i.length},map:function(g){return i.map(g)},debug:function(){return h||f(),i}}}function l(c,i,h,f,g,x,_){var d=this;d.r1=c,d.r2=i,d.g1=h,d.g2=f,d.b1=g,d.b2=x,d.histo=_}l.prototype={volume:function(c){var i=this;return(!i._volume||c)&&(i._volume=(i.r2-i.r1+1)*(i.g2-i.g1+1)*(i.b2-i.b1+1)),i._volume},count:function(c){var i=this,h=i.histo;if(!i._count_set||c){var f=0,g,x,_,d;for(g=i.r1;g<=i.r2;g++)for(x=i.g1;x<=i.g2;x++)for(_=i.b1;_<=i.b2;_++)d=n(g,x,_),f+=h[d]||0;i._count=f,i._count_set=!0}return i._count},copy:function(){var c=this;return new l(c.r1,c.r2,c.g1,c.g2,c.b1,c.b2,c.histo)},avg:function(c){var i=this,h=i.histo;if(!i._avg||c){var f=0,g=1<<8-e,x=0,_=0,d=0,y,p,m,v,E;for(p=i.r1;p<=i.r2;p++)for(m=i.g1;m<=i.g2;m++)for(v=i.b1;v<=i.b2;v++)E=n(p,m,v),y=h[E]||0,f+=y,x+=y*(p+.5)*g,_+=y*(m+.5)*g,d+=y*(v+.5)*g;f?i._avg=[~~(x/f),~~(_/f),~~(d/f)]:i._avg=[~~(g*(i.r1+i.r2+1)/2),~~(g*(i.g1+i.g2+1)/2),~~(g*(i.b1+i.b2+1)/2)]}return i._avg},contains:function(c){var i=this,h=c[0]>>t;return gval=c[1]>>t,bval=c[2]>>t,h>=i.r1&&h<=i.r2&&gval>=i.g1&&gval<=i.g2&&bval>=i.b1&&bval<=i.b2}};function o(){this.vboxes=new s(function(c,i){return ae.naturalOrder(c.vbox.count()*c.vbox.volume(),i.vbox.count()*i.vbox.volume())})}o.prototype={push:function(c){this.vboxes.push({vbox:c,color:c.avg()})},palette:function(){return this.vboxes.map(function(c){return c.color})},size:function(){return this.vboxes.size()},map:function(c){for(var i=this.vboxes,h=0;h<i.size();h++)if(i.peek(h).vbox.contains(c))return i.peek(h).color;return this.nearest(c)},nearest:function(c){for(var i=this.vboxes,h,f,g,x=0;x<i.size();x++)f=Math.sqrt(Math.pow(c[0]-i.peek(x).color[0],2)+Math.pow(c[1]-i.peek(x).color[1],2)+Math.pow(c[2]-i.peek(x).color[2],2)),(f<h||h===void 0)&&(h=f,g=i.peek(x).color);return g},forcebw:function(){var c=this.vboxes;c.sort(function(g,x){return ae.naturalOrder(ae.sum(g.color),ae.sum(x.color))});var i=c[0].color;i[0]<5&&i[1]<5&&i[2]<5&&(c[0].color=[0,0,0]);var h=c.length-1,f=c[h].color;f[0]>251&&f[1]>251&&f[2]>251&&(c[h].color=[255,255,255])}};function u(c){var i=1<<3*e,h=new Array(i),f,g,x,_;return c.forEach(function(d){g=d[0]>>t,x=d[1]>>t,_=d[2]>>t,f=n(g,x,_),h[f]=(h[f]||0)+1}),h}function N(c,i){var h=1e6,f=0,g=1e6,x=0,_=1e6,d=0,y,p,m;return c.forEach(function(v){y=v[0]>>t,p=v[1]>>t,m=v[2]>>t,y<h?h=y:y>f&&(f=y),p<g?g=p:p>x&&(x=p),m<_?_=m:m>d&&(d=m)}),new l(h,f,g,x,_,d,i)}function H(c,i){if(!i.count())return;var h=i.r2-i.r1+1,f=i.g2-i.g1+1,g=i.b2-i.b1+1,x=ae.max([h,f,g]);if(i.count()==1)return[i.copy()];var _=0,d=[],y=[],p,m,v,E,M;if(x==h)for(p=i.r1;p<=i.r2;p++){for(E=0,m=i.g1;m<=i.g2;m++)for(v=i.b1;v<=i.b2;v++)M=n(p,m,v),E+=c[M]||0;_+=E,d[p]=_}else if(x==f)for(p=i.g1;p<=i.g2;p++){for(E=0,m=i.r1;m<=i.r2;m++)for(v=i.b1;v<=i.b2;v++)M=n(m,p,v),E+=c[M]||0;_+=E,d[p]=_}else for(p=i.b1;p<=i.b2;p++){for(E=0,m=i.r1;m<=i.r2;m++)for(v=i.g1;v<=i.g2;v++)M=n(m,v,p),E+=c[M]||0;_+=E,d[p]=_}d.forEach(function(D,P){y[P]=_-D});function C(D){var P=D+"1",T=D+"2",A,B,O,q,I,W=0;for(p=i[P];p<=i[T];p++)if(d[p]>_/2){for(O=i.copy(),q=i.copy(),A=p-i[P],B=i[T]-p,A<=B?I=Math.min(i[T]-1,~~(p+B/2)):I=Math.max(i[P],~~(p-1-A/2));!d[I];)I++;for(W=y[I];!W&&d[I-1];)W=y[--I];return O[T]=I,q[P]=O[T]+1,[O,q]}}return x==h?C("r"):x==f?C("g"):C("b")}function $(c,i){if(!c.length||i<2||i>256)return!1;var h=u(c);h.forEach(function(){});var f=N(c,h),g=new s(function(y,p){return ae.naturalOrder(y.count(),p.count())});g.push(f);function x(y,p){for(var m=1,v=0,E;v<r;){if(E=y.pop(),!E.count()){y.push(E),v++;continue}var M=H(h,E),C=M[0],D=M[1];if(!C||(y.push(C),D&&(y.push(D),m++),m>=p)||v++>r)return}}x(g,a*i);for(var _=new s(function(y,p){return ae.naturalOrder(y.count()*y.volume(),p.count()*p.volume())});g.size();)_.push(g.pop());x(_,i-_.size());for(var d=new o;_.size();)d.push(_.pop());return d}return{quantize:$}}(),Wt=jt.quantize;function _e(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Pe(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function he(){}var we=.7,He=1/we,ge="\\s*([+-]?\\d+)\\s*",ye="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",At=/^#([0-9a-f]{3,8})$/,Qt=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),Xt=new RegExp(`^rgb\\(${ee},${ee},${ee}\\)$`),Zt=new RegExp(`^rgba\\(${ge},${ge},${ge},${ye}\\)$`),Jt=new RegExp(`^rgba\\(${ee},${ee},${ee},${ye}\\)$`),Yt=new RegExp(`^hsl\\(${ye},${ee},${ee}\\)$`),Ft=new RegExp(`^hsla\\(${ye},${ee},${ee},${ye}\\)$`),tt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};_e(he,Ue,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rt,formatHex:rt,formatHex8:Kt,formatHsl:Gt,formatRgb:nt,toString:nt});function rt(){return this.rgb().formatHex()}function Kt(){return this.rgb().formatHex8()}function Gt(){return Mt(this).formatHsl()}function nt(){return this.rgb().formatRgb()}function Ue(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=At.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?at(t):r===3?new L(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ke(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ke(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qt.exec(e))?new L(t[1],t[2],t[3],1):(t=Xt.exec(e))?new L(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zt.exec(e))?ke(t[1],t[2],t[3],t[4]):(t=Jt.exec(e))?ke(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Yt.exec(e))?lt(t[1],t[2]/100,t[3]/100,1):(t=Ft.exec(e))?lt(t[1],t[2]/100,t[3]/100,t[4]):tt.hasOwnProperty(e)?at(tt[e]):e==="transparent"?new L(NaN,NaN,NaN,0):null}function at(e){return new L(e>>16&255,e>>8&255,e&255,1)}function ke(e,t,r,a){return a<=0&&(e=t=r=NaN),new L(e,t,r,a)}function $t(e){return e instanceof he||(e=Ue(e)),e?(e=e.rgb(),new L(e.r,e.g,e.b,e.opacity)):new L}function je(e,t,r,a){return arguments.length===1?$t(e):new L(e,t,r,a==null?1:a)}function L(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}_e(L,je,Pe(he,{brighter(e){return e=e==null?He:Math.pow(He,e),new L(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?we:Math.pow(we,e),new L(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new L(ue(this.r),ue(this.g),ue(this.b),Ie(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:it,formatHex:it,formatHex8:er,formatRgb:st,toString:st}));function it(){return`#${fe(this.r)}${fe(this.g)}${fe(this.b)}`}function er(){return`#${fe(this.r)}${fe(this.g)}${fe(this.b)}${fe((isNaN(this.opacity)?1:this.opacity)*255)}`}function st(){const e=Ie(this.opacity);return`${e===1?"rgb(":"rgba("}${ue(this.r)}, ${ue(this.g)}, ${ue(this.b)}${e===1?")":`, ${e})`}`}function Ie(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ue(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fe(e){return e=ue(e),(e<16?"0":"")+e.toString(16)}function lt(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Y(e,t,r,a)}function Mt(e){if(e instanceof Y)return new Y(e.h,e.s,e.l,e.opacity);if(e instanceof he||(e=Ue(e)),!e)return new Y;if(e instanceof Y)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,n=Math.min(t,r,a),s=Math.max(t,r,a),l=NaN,o=s-n,u=(s+n)/2;return o?(t===s?l=(r-a)/o+(r<a)*6:r===s?l=(a-t)/o+2:l=(t-r)/o+4,o/=u<.5?s+n:2-s-n,l*=60):o=u>0&&u<1?0:l,new Y(l,o,u,e.opacity)}function tr(e,t,r,a){return arguments.length===1?Mt(e):new Y(e,t,r,a==null?1:a)}function Y(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}_e(Y,tr,Pe(he,{brighter(e){return e=e==null?He:Math.pow(He,e),new Y(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?we:Math.pow(we,e),new Y(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,n=2*r-a;return new L(qe(e>=240?e-240:e+120,n,a),qe(e,n,a),qe(e<120?e+240:e-120,n,a),this.opacity)},clamp(){return new Y(ot(this.h),Ce(this.s),Ce(this.l),Ie(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ie(this.opacity);return`${e===1?"hsl(":"hsla("}${ot(this.h)}, ${Ce(this.s)*100}%, ${Ce(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ot(e){return e=(e||0)%360,e<0?e+360:e}function Ce(e){return Math.max(0,Math.min(1,e||0))}function qe(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const rr=Math.PI/180,nr=180/Math.PI,De=18,Ht=.96422,It=1,Dt=.82521,Pt=4/29,me=6/29,Ot=3*me*me,ar=me*me*me;function qt(e){if(e instanceof te)return new te(e.l,e.a,e.b,e.opacity);if(e instanceof ie)return St(e);e instanceof L||(e=$t(e));var t=Be(e.r),r=Be(e.g),a=Be(e.b),n=Se((.2225045*t+.7168786*r+.0606169*a)/It),s,l;return t===r&&r===a?s=l=n:(s=Se((.4360747*t+.3850649*r+.1430804*a)/Ht),l=Se((.0139322*t+.0971045*r+.7141733*a)/Dt)),new te(116*n-16,500*(s-n),200*(n-l),e.opacity)}function ir(e,t,r,a){return arguments.length===1?qt(e):new te(e,t,r,a==null?1:a)}function te(e,t,r,a){this.l=+e,this.a=+t,this.b=+r,this.opacity=+a}_e(te,ir,Pe(he,{brighter(e){return new te(this.l+De*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new te(this.l-De*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=Ht*Re(t),e=It*Re(e),r=Dt*Re(r),new L(ze(3.1338561*t-1.6168667*e-.4906146*r),ze(-.9787684*t+1.9161415*e+.033454*r),ze(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Se(e){return e>ar?Math.pow(e,1/3):e/Ot+Pt}function Re(e){return e>me?e*e*e:Ot*(e-Pt)}function ze(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Be(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function sr(e){if(e instanceof ie)return new ie(e.h,e.c,e.l,e.opacity);if(e instanceof te||(e=qt(e)),e.a===0&&e.b===0)return new ie(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*nr;return new ie(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function xe(e,t,r,a){return arguments.length===1?sr(e):new ie(e,t,r,a==null?1:a)}function ie(e,t,r,a){this.h=+e,this.c=+t,this.l=+r,this.opacity=+a}function St(e){if(isNaN(e.h))return new te(e.l,0,0,e.opacity);var t=e.h*rr;return new te(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}_e(ie,xe,Pe(he,{brighter(e){return new ie(this.h,this.c,this.l+De*(e==null?1:e),this.opacity)},darker(e){return new ie(this.h,this.c,this.l-De*(e==null?1:e),this.opacity)},rgb(){return St(this).rgb()}}));function lr(){return BigInt(0xb7dd73e137d20800&((1<<63)-1)*Math.random())}function or(e){return e.map(t=>xe(t)).sort((t,r)=>{const a=t.h,n=r.h;return n-a||isNaN(n)-isNaN(a)})}function cr(e,t,r){const a=e,n=[];for(let s=0,l,o,u,N,H;s<t;s=s+r)l=s*4,o=a[l+0],u=a[l+1],N=a[l+2],H=a[l+3],(typeof H>"u"||H>=125)&&(o>250&&u>250&&N>250||n.push([o,u,N]));return n}function fr(e,t=5,r=1){return new Promise(a=>{const n=new Image;n.onload=async()=>{const s=n.width,l=n.height,o=document.createElement("canvas");o.width=s,o.height=l;const u=o.getContext("2d");u.drawImage(n,0,0,s,l);const N=u.getImageData(0,0,s,l),H=cr(N.data,s*l,r),c=Wt(H,t).palette(),i=await new Promise(f=>o.toBlob(f,"image/jpeg",.95)),h=c.map(f=>je(...f));a({colors:or(h),imgBlob:i})},n.src=e})}async function ur(e,t){const r=hr(t),a="https://huggingface.co/uploads",s=`color-palette-${crypto.randomUUID().split("-")[0]}-${r}.jpeg`,l=new File([e],s,{type:"image/jpeg"});console.log("uploading image",l);const u=await(await fetch(a,{method:"POST",headers:{"Content-Type":l.type,"X-Requested-With":"XMLHttpRequest"},body:l})).text();return console.log("uploaded images",u),u}function hr(e){return e?e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""):""}const J=kt(""),de=kt(!1),dr="PROD",pr="wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join";function ct(e,t,r){const a=e.slice();return a[6]=t[r],a[8]=r,a}function ft(e){let t,r,a,n,s,l,o=(e[1]===e[8]?"copied":e[6].formatHex())+"",u,N,H,$,c;function i(){return e[4](e[6],e[8])}return{c(){t=R("div"),r=$e("svg"),a=$e("rect"),s=U(),l=R("span"),u=Q(o),N=U(),this.h()},l(h){t=z(h,"DIV",{class:!0,style:!0});var f=S(t);r=Me(f,"svg",{class:!0,width:!0,viewBox:!0});var g=S(r);a=Me(g,"rect",{x:!0,y:!0,width:!0,height:!0,fill:!0}),S(a).forEach(k),g.forEach(k),s=j(f),l=z(f,"SPAN",{title:!0,class:!0,style:!0});var x=S(l);u=X(x,o),x.forEach(k),N=j(f),f.forEach(k),this.h()},h(){b(a,"x","0"),b(a,"y","0"),b(a,"width","50"),b(a,"height","50"),b(a,"fill",n=e[6].formatHex()),b(r,"class","block max-w-full aspect-square"),b(r,"width","100"),b(r,"viewBox","0 0 50 50"),b(l,"title","Copy single color"),b(l,"class","absolute bottom-0 text-center text-xs pl-1 font-bold uppercase"),Ee(l,"color",e[2](e[6])),b(t,"class",H=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative"),Ee(t,"background-color",e[6].formatHex())},m(h,f){F(h,t,f),w(t,r),w(r,a),w(t,s),w(t,l),w(l,u),w(t,N),$||(c=pe(t,"click",i),$=!0)},p(h,f){e=h,f&1&&n!==(n=e[6].formatHex())&&b(a,"fill",n),f&3&&o!==(o=(e[1]===e[8]?"copied":e[6].formatHex())+"")&&ve(u,o),f&1&&Ee(l,"color",e[2](e[6])),f&2&&H!==(H=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative")&&b(t,"class",H),f&1&&Ee(t,"background-color",e[6].formatHex())},d(h){h&&k(t),$=!1,c()}}}function gr(e){let t,r,a=e[0],n=[];for(let s=0;s<a.length;s+=1)n[s]=ft(ct(e,a,s));return{c(){t=R("div"),r=R("div");for(let s=0;s<n.length;s+=1)n[s].c();this.h()},l(s){t=z(s,"DIV",{class:!0});var l=S(t);r=z(l,"DIV",{class:!0});var o=S(r);for(let u=0;u<n.length;u+=1)n[u].l(o);o.forEach(k),l.forEach(k),this.h()},h(){b(r,"class","flex"),b(t,"class","flex flex-col items-center")},m(s,l){F(s,t,l),w(t,r);for(let o=0;o<n.length;o+=1)n[o].m(r,null)},p(s,[l]){if(l&15){a=s[0];let o;for(o=0;o<a.length;o+=1){const u=ct(s,a,o);n[o]?n[o].p(u,l):(n[o]=ft(u),n[o].c(),n[o].m(r,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=a.length}},i:Qe,o:Qe,d(s){s&&k(t),bt(n,s)}}}function mr(e,t,r){let{colors:a}=t;a.length;function n(u){const N=xe(u);return N.l>50?xe(N.h,N.c,0).formatHex():xe(N.h,N.c,100).formatHex()}let s=-1;async function l(u,N){s>-1||(r(1,s=N),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([u],{type:"text/plain"})})]),setTimeout(()=>{r(1,s=-1)},800))}const o=(u,N)=>l(u.formatHex(),N);return e.$$set=u=>{"colors"in u&&r(0,a=u.colors)},[a,s,n,l,o]}class br extends Te{constructor(t){super(),Ve(this,t,mr,gr,Le,{colors:0})}}function xr(e){let t,r,a,n,s,l,o,u,N,H,$,c,i,h,f,g,x,_,d,y=e[0]?"Copied":"Copy",p,m,v,E;return o=new br({props:{colors:e[2]}}),{c(){t=R("div"),r=R("blockquote"),a=R("p"),n=Q(e[3]),s=U(),l=R("div"),xt(o.$$.fragment),u=U(),N=R("div"),H=R("div"),$=R("img"),i=U(),h=R("div"),f=R("div"),g=R("button"),x=Q("Remix"),_=U(),d=R("button"),p=Q(y),this.h()},l(M){t=z(M,"DIV",{class:!0});var C=S(t);r=z(C,"BLOCKQUOTE",{class:!0,title:!0});var D=S(r);a=z(D,"P",{});var P=S(a);n=X(P,e[3]),P.forEach(k),D.forEach(k),s=j(C),l=z(C,"DIV",{class:!0});var T=S(l);vt(o.$$.fragment,T),T.forEach(k),u=j(C),N=z(C,"DIV",{class:!0});var A=S(N);H=z(A,"DIV",{class:!0});var B=S(H);$=z(B,"IMG",{loading:!0,class:!0,src:!0,alt:!0}),B.forEach(k),A.forEach(k),i=j(C),h=z(C,"DIV",{class:!0});var O=S(h);f=z(O,"DIV",{class:!0});var q=S(f);g=z(q,"BUTTON",{class:!0,title:!0});var I=S(g);x=X(I,"Remix"),I.forEach(k),_=j(q),d=z(q,"BUTTON",{class:!0,title:!0});var W=S(d);p=X(W,y),W.forEach(k),q.forEach(k),O.forEach(k),C.forEach(k),this.h()},h(){b(r,"class","row-start-1 mx-auto col-span-6 italic font-semibold max-w-prose text-base text-center line-clamp-3 my-3"),b(r,"title",e[3]),b(l,"class","row-start-3 md:row-start-2 col-span-6 md:col-span-4 flex items-center justify-center"),b($,"loading","lazy"),b($,"class","relative max-w-[100px] w-full aspect-square"),Xe($.src,c=e[1])||b($,"src",c),b($,"alt",e[3]),b(H,"class","relative"),b(N,"class","row-start-2 col-span-6 md:col-span-2 flex justify-center md:justify-end pb-3"),b(g,"class","button svelte-8zu88a"),b(g,"title","Send this prompt to input so you can remix it"),b(d,"class","button svelte-8zu88a"),b(d,"title","Copy all colors to clipboard"),d.disabled=e[0],b(f,"class","flex justify-center items-center"),b(h,"class","row-start-4 col-span-6 md:col-span-2 md:col-start-5 flex justify-center md:justify-end"),b(t,"class","grid grid-cols-6 gap-3")},m(M,C){F(M,t,C),w(t,r),w(r,a),w(a,n),w(t,s),w(t,l),wt(o,l,null),w(t,u),w(t,N),w(N,H),w(H,$),w(t,i),w(t,h),w(h,f),w(f,g),w(g,x),w(f,_),w(f,d),w(d,p),m=!0,v||(E=[pe(g,"click",e[7]),pe(d,"click",e[8])],v=!0)},p(M,[C]){(!m||C&8)&&ve(n,M[3]),(!m||C&8)&&b(r,"title",M[3]);const D={};C&4&&(D.colors=M[2]),o.$set(D),(!m||C&2&&!Xe($.src,c=M[1]))&&b($,"src",c),(!m||C&8)&&b($,"alt",M[3]),(!m||C&1)&&y!==(y=M[0]?"Copied":"Copy")&&ve(p,y),(!m||C&1)&&(d.disabled=M[0])},i(M){m||(le(o.$$.fragment,M),m=!0)},o(M){be(o.$$.fragment,M),m=!1},d(M){M&&k(t),yt(o),v=!1,_t(E)}}}function vr(e,t,r){let a,n,s;const l=zt();let{promptData:o}=t,u=!1;async function N(c){u||(r(0,u=!0),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([c],{type:"text/plain"})})]),setTimeout(()=>{r(0,u=!1)},1e3))}const H=()=>l("remix",{prompt:a}),$=()=>N(n.map(c=>c.formatHex()).join(", "));return e.$$set=c=>{"promptData"in c&&r(6,o=c.promptData)},e.$$.update=()=>{e.$$.dirty&64&&r(3,a=o.prompt),e.$$.dirty&64&&r(2,n=o.images[0].colors.map(c=>je(c))),e.$$.dirty&64&&r(1,s=o.images[0].imgURL)},[u,s,n,a,l,N,o,H,$]}class wr extends Te{constructor(t){super(),Ve(this,t,vr,xr,Le,{promptData:6})}}function ut(e,t,r){const a=e.slice();return a[16]=t[r],a}function ht(e){let t,r,a,n,s=e[5]&&dt();return{c(){t=R("h3"),r=Q(e[4]),a=U(),s&&s.c(),n=Fe(),this.h()},l(l){t=z(l,"H3",{class:!0});var o=S(t);r=X(o,e[4]),o.forEach(k),a=j(l),s&&s.l(l),n=Fe(),this.h()},h(){b(t,"class","text-xs font-bold ml-3 inline-block")},m(l,o){F(l,t,o),w(t,r),F(l,a,o),s&&s.m(l,o),F(l,n,o)},p(l,o){o&16&&ve(r,l[4]),l[5]?s||(s=dt(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null)},d(l){l&&k(t),l&&k(a),s&&s.d(l),l&&k(n)}}}function dt(e){let t,r;return{c(){t=$e("svg"),r=$e("path"),this.h()},l(a){t=Me(a,"svg",{xmlns:!0,fill:!0,viewBox:!0,class:!0});var n=S(t);r=Me(n,"path",{fill:!0,d:!0}),S(r).forEach(k),n.forEach(k),this.h()},h(){b(r,"fill","currentColor"),b(r,"d","M20 12a8 8 0 0 1-8 8v4a12 12 0 0 0 12-12h-4Zm-2-5.3a8 8 0 0 1 2 5.3h4c0-3-1.1-5.8-3-8l-3 2.7Z"),b(t,"xmlns","http://www.w3.org/2000/svg"),b(t,"fill","none"),b(t,"viewBox","0 0 24 24"),b(t,"class","animate-spin max-w-[1rem] inline-block")},m(a,n){F(a,t,n),w(t,r)},d(a){a&&k(t)}}}function pt(e){let t,r,a=e[0],n=[];for(let l=0;l<a.length;l+=1)n[l]=gt(ut(e,a,l));const s=l=>be(n[l],1,1,()=>{n[l]=null});return{c(){t=R("div");for(let l=0;l<n.length;l+=1)n[l].c()},l(l){t=z(l,"DIV",{});var o=S(t);for(let u=0;u<n.length;u+=1)n[u].l(o);o.forEach(k)},m(l,o){F(l,t,o);for(let u=0;u<n.length;u+=1)n[u].m(t,null);r=!0},p(l,o){if(o&129){a=l[0];let u;for(u=0;u<a.length;u+=1){const N=ut(l,a,u);n[u]?(n[u].p(N,o),le(n[u],1)):(n[u]=gt(N),n[u].c(),le(n[u],1),n[u].m(t,null))}for(Nt(),u=a.length;u<n.length;u+=1)s(u);Et()}},i(l){if(!r){for(let o=0;o<a.length;o+=1)le(n[o]);r=!0}},o(l){n=n.filter(Boolean);for(let o=0;o<n.length;o+=1)be(n[o]);r=!1},d(l){l&&k(t),bt(n,l)}}}function gt(e){let t,r,a,n;return t=new wr({props:{promptData:e[16]}}),t.$on("remix",e[7]),{c(){xt(t.$$.fragment),r=U(),a=R("div"),this.h()},l(s){vt(t.$$.fragment,s),r=j(s),a=z(s,"DIV",{class:!0}),S(a).forEach(k),this.h()},h(){b(a,"class","border-b border-gray-200 py-2")},m(s,l){wt(t,s,l),F(s,r,l),F(s,a,l),n=!0},p(s,l){const o={};l&1&&(o.promptData=s[16]),t.$set(o)},i(s){n||(le(t.$$.fragment,s),n=!0)},o(s){be(t.$$.fragment,s),n=!1},d(s){yt(t,s),s&&k(r),s&&k(a)}}}function yr(e){let t,r,a,n,s,l,o,u,N,H,$,c,i,h,f,g,x,_,d,y,p,m,v,E,M,C,D,P,T,A,B=e[4]&&ht(e),O=e[0]&&pt(e);return{c(){t=R("div"),r=R("h1"),a=Q("Palette generation with Stable Diffussion"),n=U(),s=R("p"),l=Q(`Original ideas:
2
-
3
- `),o=R("a"),u=Q(`Matt DesLauriers
4
- `),N=Q(`,
5
- `),H=R("a"),$=Q("dribnet"),c=U(),i=R("div"),h=R("form"),f=R("input"),g=U(),x=R("button"),_=Q("Create Palette"),d=U(),B&&B.c(),y=U(),p=R("div"),m=R("div"),v=Q(e[3]),E=Q(" submitted palettes"),M=U(),C=R("div"),D=U(),O&&O.c(),this.h()},l(q){t=z(q,"DIV",{class:!0});var I=S(t);r=z(I,"H1",{class:!0});var W=S(r);a=X(W,"Palette generation with Stable Diffussion"),W.forEach(k),n=j(I),s=z(I,"P",{class:!0});var K=S(s);l=X(K,`Original ideas:
6
-
7
- `),o=z(K,"A",{class:!0,target:!0,rel:!0,href:!0});var oe=S(o);u=X(oe,`Matt DesLauriers
8
- `),oe.forEach(k),N=X(K,`,
9
- `),H=z(K,"A",{class:!0,href:!0});var ce=S(H);$=X(ce,"dribnet"),ce.forEach(k),K.forEach(k),c=j(I),i=z(I,"DIV",{class:!0});var re=S(i);h=z(re,"FORM",{class:!0});var Z=S(h);f=z(Z,"INPUT",{class:!0,placeholder:!0,title:!0,type:!0,name:!0}),g=j(Z),x=z(Z,"BUTTON",{class:!0,title:!0});var G=S(x);_=X(G,"Create Palette"),G.forEach(k),Z.forEach(k),d=j(re),B&&B.l(re),re.forEach(k),y=j(I),p=z(I,"DIV",{class:!0});var ne=S(p);m=z(ne,"DIV",{class:!0});var se=S(m);v=X(se,e[3]),E=X(se," submitted palettes"),se.forEach(k),M=j(ne),C=z(ne,"DIV",{class:!0}),S(C).forEach(k),ne.forEach(k),D=j(I),O&&O.l(I),I.forEach(k),this.h()},h(){b(r,"class","text-3xl font-bold leading-normal"),b(o,"class","link svelte-zbscw1"),b(o,"target","_blank"),b(o,"rel","nofollow noopener"),b(o,"href","https://twitter.com/mattdesl/status/1569457653298139136"),b(H,"class","link svelte-zbscw1"),b(H,"href","https://drib.net/homage"),b(s,"class","text-sm"),b(f,"class","input svelte-zbscw1"),b(f,"placeholder","A photo of a beautiful sunset in San Francisco"),b(f,"title","Input prompt to generate image and obtain palette"),b(f,"type","text"),b(f,"name","prompt"),f.disabled=e[5],b(x,"class","button svelte-zbscw1"),x.disabled=e[5],b(x,"title","Generate Palette"),b(h,"class","grid grid-cols-6"),b(i,"class","relative top-0 z-50 bg-white dark:bg-black py-3"),b(m,"class","font-bold text-sm"),b(C,"class","grow border-b border-gray-200"),b(p,"class","flex items-center gap-4 my-10"),b(t,"class","max-w-screen-md mx-auto px-3 py-8 relative z-0")},m(q,I){F(q,t,I),w(t,r),w(r,a),w(t,n),w(t,s),w(s,l),w(s,o),w(o,u),w(s,N),w(s,H),w(H,$),w(t,c),w(t,i),w(i,h),w(h,f),e[8](f),Ze(f,e[1]),w(h,g),w(h,x),w(x,_),w(i,d),B&&B.m(i,null),w(t,y),w(t,p),w(p,m),w(m,v),w(m,E),w(p,M),w(p,C),w(t,D),O&&O.m(t,null),P=!0,T||(A=[pe(f,"input",e[9]),pe(x,"click",Je(e[10])),pe(h,"submit",Je(e[11]))],T=!0)},p(q,[I]){(!P||I&32)&&(f.disabled=q[5]),I&2&&f.value!==q[1]&&Ze(f,q[1]),(!P||I&32)&&(x.disabled=q[5]),q[4]?B?B.p(q,I):(B=ht(q),B.c(),B.m(i,null)):B&&(B.d(1),B=null),(!P||I&8)&&ve(v,q[3]),q[0]?O?(O.p(q,I),I&1&&le(O,1)):(O=pt(q),O.c(),le(O,1),O.m(t,null)):O&&(Nt(),be(O,1,1,()=>{O=null}),Et())},i(q){P||(le(O),P=!0)},o(q){be(O),P=!1},d(q){q&&k(t),e[8](null),B&&B.d(),O&&O.d(),T=!1,_t(A)}}}function mt(e){return e.sort((t,r)=>r.id-t.id).map(t=>t.data)}function _r(e,t,r){let a,n,s;Ye(e,J,d=>r(4,n=d)),Ye(e,de,d=>r(5,s=d)),console.log(dr);const l="/embed/huggingface-projects/color-palette-generator-sd";let o,u,N;Bt(()=>{H();const d=window.setInterval(H,5e3);return()=>{clearInterval(d)}});async function H(){const d=await fetch(l+"/data").then(y=>y.json());(!o||d.length>o.length)&&r(0,o=mt(d))}async function $(d){try{const y=await fetch(l+"/new_palette",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:d.prompt,images:d.images.map(p=>({imgURL:p.imgURL,colors:p.colors.map(m=>m.formatHex())}))})}).then(p=>p.json());r(0,o=mt(y))}catch(y){console.error(y)}}async function c(d){if(!d||s==!0)return;V(J,n="Pending",n),V(de,s=!0,s);const y=crypto.randomUUID(),p={fn_index:2,data:[d,1,40,7.5,Number(lr())]},m=new WebSocket(pr);m.onopen=async function(v){m.send(JSON.stringify({hash:y}))},m.onclose=v=>{v.wasClean||(V(J,n="Error",n),V(de,s=!1,s))},m.onmessage=async function(v){try{const E=JSON.parse(v.data);switch(V(J,n="",n),E.msg){case"send_data":V(J,n="Sending Data",n),m.send(JSON.stringify(p));break;case"queue_full":V(J,n="Queue full",n),m.close(),V(de,s=!1,s);return;case"estimation":const{msg:M,rank:C,queue_size:D}=E;V(J,n=`On queue ${C}/${D}`,n);break;case"process_generating":V(J,n=E.success?"Generating":"Error",n);break;case"process_completed":try{const P=await i(E.output.data[0],d);$({prompt:d,images:P}),V(J,n=E.success?"Complete":"Error",n)}catch(P){V(J,n=P.message,n)}m.close(),V(de,s=!1,s);return;case"process_starts":V(J,n="Processing",n);break}}catch(E){console.error(E),V(de,s=!1,s),V(J,n="Error",n)}}}async function i(d,y){const p=["#040404","#B7B7B7","#565656","#747474","#6C6C6C"],m=[];for(const v of d){const{colors:E,imgBlob:M}=await fr(v);if(E.map(P=>P.formatHex().toUpperCase()).every(P=>p.includes(P)))throw console.error("Possible NSFW image"),new Error("Possible NSFW image");const C=await ur(M,y),D={colors:E,imgURL:C};m.push(D)}return m}function h(d){r(1,u=d.detail.prompt),Ut(N,{behavior:"smooth"})}function f(d){Tt[d?"unshift":"push"](()=>{N=d,r(2,N)})}function g(){u=this.value,r(1,u)}const x=()=>c(u),_=()=>c(u);return e.$$.update=()=>{e.$$.dirty&1&&r(3,a=(o==null?void 0:o.length)||0)},[o,u,N,a,n,s,c,h,f,g,x,_]}class kr extends Te{constructor(t){super(),Ve(this,t,_r,yr,Le,{})}}export{kr as default};
 
 
 
 
 
 
 
 
 
 
static/_app/immutable/components/pages/_page.svelte-bf6d812e.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import{S as Se,i as ze,s as Re,k as D,l as H,m as P,h as y,n as g,b as Q,F as v,A as Ve,H as ft,I as ye,a as U,q as j,J as ke,c as V,r as A,p as ve,K as ie,u as he,v as ut,w as ht,L as je,x as dt,f as te,t as ce,y as pt,M as gt,N as Ct,O as Ae,P as Fe,d as mt,G as Ge,o as Mt,e as Je,g as bt,Q as T,R as Pt}from"../../chunks/index-5559954d.js";import{w as xt}from"../../chunks/index-3bda1050.js";if(!Y)var Y={map:function(e,t){var r={};return t?e.map(function(s,n){return r.index=n,t.call(r,s)}):e.slice()},naturalOrder:function(e,t){return e<t?-1:e>t?1:0},sum:function(e,t){var r={};return e.reduce(t?function(s,n,i){return r.index=i,s+t.call(r,n)}:function(s,n){return s+n},0)},max:function(e,t){return Math.max.apply(null,t?Y.map(e,t):e)}};var Dt=function(){var e=5,t=8-e,r=1e3,s=.75;function n(c,a,h){return(c<<2*e)+(a<<e)+h}function i(c){var a=[],h=!1;function u(){a.sort(c),h=!0}return{push:function(b){a.push(b),h=!1},peek:function(b){return h||u(),b===void 0&&(b=a.length-1),a[b]},pop:function(){return h||u(),a.pop()},size:function(){return a.length},map:function(b){return a.map(b)},debug:function(){return h||u(),a}}}function l(c,a,h,u,b,x,N){var d=this;d.r1=c,d.r2=a,d.g1=h,d.g2=u,d.b1=b,d.b2=x,d.histo=N}l.prototype={volume:function(c){var a=this;return(!a._volume||c)&&(a._volume=(a.r2-a.r1+1)*(a.g2-a.g1+1)*(a.b2-a.b1+1)),a._volume},count:function(c){var a=this,h=a.histo;if(!a._count_set||c){var u=0,b,x,N,d;for(b=a.r1;b<=a.r2;b++)for(x=a.g1;x<=a.g2;x++)for(N=a.b1;N<=a.b2;N++)d=n(b,x,N),u+=h[d]||0;a._count=u,a._count_set=!0}return a._count},copy:function(){var c=this;return new l(c.r1,c.r2,c.g1,c.g2,c.b1,c.b2,c.histo)},avg:function(c){var a=this,h=a.histo;if(!a._avg||c){var u=0,b=1<<8-e,x=0,N=0,d=0,w,p,m,k,E;for(p=a.r1;p<=a.r2;p++)for(m=a.g1;m<=a.g2;m++)for(k=a.b1;k<=a.b2;k++)E=n(p,m,k),w=h[E]||0,u+=w,x+=w*(p+.5)*b,N+=w*(m+.5)*b,d+=w*(k+.5)*b;u?a._avg=[~~(x/u),~~(N/u),~~(d/u)]:a._avg=[~~(b*(a.r1+a.r2+1)/2),~~(b*(a.g1+a.g2+1)/2),~~(b*(a.b1+a.b2+1)/2)]}return a._avg},contains:function(c){var a=this,h=c[0]>>t;return gval=c[1]>>t,bval=c[2]>>t,h>=a.r1&&h<=a.r2&&gval>=a.g1&&gval<=a.g2&&bval>=a.b1&&bval<=a.b2}};function o(){this.vboxes=new i(function(c,a){return Y.naturalOrder(c.vbox.count()*c.vbox.volume(),a.vbox.count()*a.vbox.volume())})}o.prototype={push:function(c){this.vboxes.push({vbox:c,color:c.avg()})},palette:function(){return this.vboxes.map(function(c){return c.color})},size:function(){return this.vboxes.size()},map:function(c){for(var a=this.vboxes,h=0;h<a.size();h++)if(a.peek(h).vbox.contains(c))return a.peek(h).color;return this.nearest(c)},nearest:function(c){for(var a=this.vboxes,h,u,b,x=0;x<a.size();x++)u=Math.sqrt(Math.pow(c[0]-a.peek(x).color[0],2)+Math.pow(c[1]-a.peek(x).color[1],2)+Math.pow(c[2]-a.peek(x).color[2],2)),(u<h||h===void 0)&&(h=u,b=a.peek(x).color);return b},forcebw:function(){var c=this.vboxes;c.sort(function(b,x){return Y.naturalOrder(Y.sum(b.color),Y.sum(x.color))});var a=c[0].color;a[0]<5&&a[1]<5&&a[2]<5&&(c[0].color=[0,0,0]);var h=c.length-1,u=c[h].color;u[0]>251&&u[1]>251&&u[2]>251&&(c[h].color=[255,255,255])}};function f(c){var a=1<<3*e,h=new Array(a),u,b,x,N;return c.forEach(function(d){b=d[0]>>t,x=d[1]>>t,N=d[2]>>t,u=n(b,x,N),h[u]=(h[u]||0)+1}),h}function _(c,a){var h=1e6,u=0,b=1e6,x=0,N=1e6,d=0,w,p,m;return c.forEach(function(k){w=k[0]>>t,p=k[1]>>t,m=k[2]>>t,w<h?h=w:w>u&&(u=w),p<b?b=p:p>x&&(x=p),m<N?N=m:m>d&&(d=m)}),new l(h,u,b,x,N,d,a)}function C(c,a){if(!a.count())return;var h=a.r2-a.r1+1,u=a.g2-a.g1+1,b=a.b2-a.b1+1,x=Y.max([h,u,b]);if(a.count()==1)return[a.copy()];var N=0,d=[],w=[],p,m,k,E,I;if(x==h)for(p=a.r1;p<=a.r2;p++){for(E=0,m=a.g1;m<=a.g2;m++)for(k=a.b1;k<=a.b2;k++)I=n(p,m,k),E+=c[I]||0;N+=E,d[p]=N}else if(x==u)for(p=a.g1;p<=a.g2;p++){for(E=0,m=a.r1;m<=a.r2;m++)for(k=a.b1;k<=a.b2;k++)I=n(m,p,k),E+=c[I]||0;N+=E,d[p]=N}else for(p=a.b1;p<=a.b2;p++){for(E=0,m=a.r1;m<=a.r2;m++)for(k=a.g1;k<=a.g2;k++)I=n(m,k,p),E+=c[I]||0;N+=E,d[p]=N}d.forEach(function(B,R){w[R]=N-B});function $(B){var R=B+"1",F=B+"2",X,O,q,S,M,Z=0;for(p=a[R];p<=a[F];p++)if(d[p]>N/2){for(q=a.copy(),S=a.copy(),X=p-a[R],O=a[F]-p,X<=O?M=Math.min(a[F]-1,~~(p+O/2)):M=Math.max(a[R],~~(p-1-X/2));!d[M];)M++;for(Z=w[M];!Z&&d[M-1];)Z=w[--M];return q[F]=M,S[R]=q[F]+1,[q,S]}}return x==h?$("r"):x==u?$("g"):$("b")}function z(c,a){if(!c.length||a<2||a>256)return!1;var h=f(c);h.forEach(function(){});var u=_(c,h),b=new i(function(w,p){return Y.naturalOrder(w.count(),p.count())});b.push(u);function x(w,p){for(var m=1,k=0,E;k<r;){if(E=w.pop(),!E.count()){w.push(E),k++;continue}var I=C(h,E),$=I[0],B=I[1];if(!$||(w.push($),B&&(w.push(B),m++),m>=p)||k++>r)return}}x(b,s*a);for(var N=new i(function(w,p){return Y.naturalOrder(w.count()*w.volume(),p.count()*p.volume())});b.size();)N.push(b.pop());x(N,a-N.size());for(var d=new o;N.size();)d.push(N.pop());return d}return{quantize:z}}(),Ht=Dt.quantize;function ge(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Ie(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function ae(){}var de=.7,Ne=1/de,le="\\s*([+-]?\\d+)\\s*",pe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qt=/^#([0-9a-f]{3,8})$/,St=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),zt=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),Rt=new RegExp(`^rgba\\(${le},${le},${le},${pe}\\)$`),Ot=new RegExp(`^rgba\\(${W},${W},${W},${pe}\\)$`),Bt=new RegExp(`^hsl\\(${pe},${W},${W}\\)$`),Tt=new RegExp(`^hsla\\(${pe},${W},${W},${pe}\\)$`),Qe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ge(ae,Oe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:We,formatHex:We,formatHex8:Lt,formatHsl:Ut,formatRgb:Ke,toString:Ke});function We(){return this.rgb().formatHex()}function Lt(){return this.rgb().formatHex8()}function Ut(){return wt(this).formatHsl()}function Ke(){return this.rgb().formatRgb()}function Oe(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=qt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Xe(t):r===3?new L(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?we(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?we(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=St.exec(e))?new L(t[1],t[2],t[3],1):(t=zt.exec(e))?new L(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Rt.exec(e))?we(t[1],t[2],t[3],t[4]):(t=Ot.exec(e))?we(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Bt.exec(e))?et(t[1],t[2]/100,t[3]/100,1):(t=Tt.exec(e))?et(t[1],t[2]/100,t[3]/100,t[4]):Qe.hasOwnProperty(e)?Xe(Qe[e]):e==="transparent"?new L(NaN,NaN,NaN,0):null}function Xe(e){return new L(e>>16&255,e>>8&255,e&255,1)}function we(e,t,r,s){return s<=0&&(e=t=r=NaN),new L(e,t,r,s)}function vt(e){return e instanceof ae||(e=Oe(e)),e?(e=e.rgb(),new L(e.r,e.g,e.b,e.opacity)):new L}function Be(e,t,r,s){return arguments.length===1?vt(e):new L(e,t,r,s==null?1:s)}function L(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}ge(L,Be,Ie(ae,{brighter(e){return e=e==null?Ne:Math.pow(Ne,e),new L(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?de:Math.pow(de,e),new L(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new L(ne(this.r),ne(this.g),ne(this.b),Ee(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ze,formatHex:Ze,formatHex8:Vt,formatRgb:Ye,toString:Ye}));function Ze(){return`#${re(this.r)}${re(this.g)}${re(this.b)}`}function Vt(){return`#${re(this.r)}${re(this.g)}${re(this.b)}${re((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ye(){const e=Ee(this.opacity);return`${e===1?"rgb(":"rgba("}${ne(this.r)}, ${ne(this.g)}, ${ne(this.b)}${e===1?")":`, ${e})`}`}function Ee(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ne(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function re(e){return e=ne(e),(e<16?"0":"")+e.toString(16)}function et(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new J(e,t,r,s)}function wt(e){if(e instanceof J)return new J(e.h,e.s,e.l,e.opacity);if(e instanceof ae||(e=Oe(e)),!e)return new J;if(e instanceof J)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,n=Math.min(t,r,s),i=Math.max(t,r,s),l=NaN,o=i-n,f=(i+n)/2;return o?(t===i?l=(r-s)/o+(r<s)*6:r===i?l=(s-t)/o+2:l=(t-r)/o+4,o/=f<.5?i+n:2-i-n,l*=60):o=f>0&&f<1?0:l,new J(l,o,f,e.opacity)}function jt(e,t,r,s){return arguments.length===1?wt(e):new J(e,t,r,s==null?1:s)}function J(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}ge(J,jt,Ie(ae,{brighter(e){return e=e==null?Ne:Math.pow(Ne,e),new J(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?de:Math.pow(de,e),new J(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*t,n=2*r-s;return new L(Me(e>=240?e-240:e+120,n,s),Me(e,n,s),Me(e<120?e+240:e-120,n,s),this.opacity)},clamp(){return new J(tt(this.h),_e(this.s),_e(this.l),Ee(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ee(this.opacity);return`${e===1?"hsl(":"hsla("}${tt(this.h)}, ${_e(this.s)*100}%, ${_e(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tt(e){return e=(e||0)%360,e<0?e+360:e}function _e(e){return Math.max(0,Math.min(1,e||0))}function Me(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const At=Math.PI/180,Ft=180/Math.PI,$e=18,_t=.96422,yt=1,kt=.82521,Nt=4/29,oe=6/29,Et=3*oe*oe,Gt=oe*oe*oe;function $t(e){if(e instanceof K)return new K(e.l,e.a,e.b,e.opacity);if(e instanceof ee)return It(e);e instanceof L||(e=vt(e));var t=qe(e.r),r=qe(e.g),s=qe(e.b),n=Pe((.2225045*t+.7168786*r+.0606169*s)/yt),i,l;return t===r&&r===s?i=l=n:(i=Pe((.4360747*t+.3850649*r+.1430804*s)/_t),l=Pe((.0139322*t+.0971045*r+.7141733*s)/kt)),new K(116*n-16,500*(i-n),200*(n-l),e.opacity)}function Jt(e,t,r,s){return arguments.length===1?$t(e):new K(e,t,r,s==null?1:s)}function K(e,t,r,s){this.l=+e,this.a=+t,this.b=+r,this.opacity=+s}ge(K,Jt,Ie(ae,{brighter(e){return new K(this.l+$e*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new K(this.l-$e*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=_t*De(t),e=yt*De(e),r=kt*De(r),new L(He(3.1338561*t-1.6168667*e-.4906146*r),He(-.9787684*t+1.9161415*e+.033454*r),He(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Pe(e){return e>Gt?Math.pow(e,1/3):e/Et+Nt}function De(e){return e>oe?e*e*e:Et*(e-Nt)}function He(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function qe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qt(e){if(e instanceof ee)return new ee(e.h,e.c,e.l,e.opacity);if(e instanceof K||(e=$t(e)),e.a===0&&e.b===0)return new ee(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ft;return new ee(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ue(e,t,r,s){return arguments.length===1?Qt(e):new ee(e,t,r,s==null?1:s)}function ee(e,t,r,s){this.h=+e,this.c=+t,this.l=+r,this.opacity=+s}function It(e){if(isNaN(e.h))return new K(e.l,0,0,e.opacity);var t=e.h*At;return new K(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ge(ee,ue,Ie(ae,{brighter(e){return new ee(this.h,this.c,this.l+$e*(e==null?1:e),this.opacity)},darker(e){return new ee(this.h,this.c,this.l-$e*(e==null?1:e),this.opacity)},rgb(){return It(this).rgb()}}));function Wt(){return BigInt(0xb7dd73e137d20800&((1<<63)-1)*Math.random())}function Kt(e){return e.map(t=>ue(t)).sort((t,r)=>{const s=t.h,n=r.h;return n-s||isNaN(n)-isNaN(s)})}function Xt(e,t,r){const s=e,n=[];for(let i=0,l,o,f,_,C;i<t;i=i+r)l=i*4,o=s[l+0],f=s[l+1],_=s[l+2],C=s[l+3],(typeof C>"u"||C>=125)&&(o>250&&f>250&&_>250||n.push([o,f,_]));return n}function Zt(e,t=5,r=1){return new Promise(s=>{const n=new Image;n.onload=async()=>{const i=n.width,l=n.height,o=document.createElement("canvas");o.width=i,o.height=l;const f=o.getContext("2d");f.drawImage(n,0,0,i,l);const _=f.getImageData(0,0,i,l),C=Xt(_.data,i*l,r),c=Ht(C,t).palette(),a=await new Promise(u=>o.toBlob(u,"image/jpeg",.95)),h=c.map(u=>Be(...u));s({colors:Kt(h),imgBlob:a})},n.src=e})}async function Yt(e,t){const r=er(t),s="https://huggingface.co/uploads",i=`color-palette-${crypto.randomUUID().split("-")[0]}-${r}.jpeg`,l=new File([e],i,{type:"image/jpeg"});console.log("uploading image",l);const f=await(await fetch(s,{method:"POST",headers:{"Content-Type":l.type,"X-Requested-With":"XMLHttpRequest"},body:l})).text();return console.log("uploaded images",f),f}function er(e){return e?e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""):""}const G=xt(""),se=xt(!1),tr="wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join";function rt(e,t,r){const s=e.slice();return s[6]=t[r],s[8]=r,s}function nt(e){let t,r,s,n,i,l,o=(e[1]===e[8]?"copied":e[6].formatHex())+"",f,_,C,z,c;function a(){return e[4](e[6],e[8])}return{c(){t=D("div"),r=ye("svg"),s=ye("rect"),i=U(),l=D("span"),f=j(o),_=U(),this.h()},l(h){t=H(h,"DIV",{class:!0,style:!0});var u=P(t);r=ke(u,"svg",{class:!0,width:!0,viewBox:!0});var b=P(r);s=ke(b,"rect",{x:!0,y:!0,width:!0,height:!0,fill:!0}),P(s).forEach(y),b.forEach(y),i=V(u),l=H(u,"SPAN",{title:!0,class:!0,style:!0});var x=P(l);f=A(x,o),x.forEach(y),_=V(u),u.forEach(y),this.h()},h(){g(s,"x","0"),g(s,"y","0"),g(s,"width","50"),g(s,"height","50"),g(s,"fill",n=e[6].formatHex()),g(r,"class","block max-w-full aspect-square"),g(r,"width","100"),g(r,"viewBox","0 0 50 50"),g(l,"title","Copy single color"),g(l,"class","absolute bottom-0 text-center text-xs pl-1 font-bold uppercase"),ve(l,"color",e[2](e[6])),g(t,"class",C=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative"),ve(t,"background-color",e[6].formatHex())},m(h,u){Q(h,t,u),v(t,r),v(r,s),v(t,i),v(t,l),v(l,f),v(t,_),z||(c=ie(t,"click",a),z=!0)},p(h,u){e=h,u&1&&n!==(n=e[6].formatHex())&&g(s,"fill",n),u&3&&o!==(o=(e[1]===e[8]?"copied":e[6].formatHex())+"")&&he(f,o),u&1&&ve(l,"color",e[2](e[6])),u&2&&C!==(C=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative")&&g(t,"class",C),u&1&&ve(t,"background-color",e[6].formatHex())},d(h){h&&y(t),z=!1,c()}}}function rr(e){let t,r,s=e[0],n=[];for(let i=0;i<s.length;i+=1)n[i]=nt(rt(e,s,i));return{c(){t=D("div"),r=D("div");for(let i=0;i<n.length;i+=1)n[i].c();this.h()},l(i){t=H(i,"DIV",{class:!0});var l=P(t);r=H(l,"DIV",{class:!0});var o=P(r);for(let f=0;f<n.length;f+=1)n[f].l(o);o.forEach(y),l.forEach(y),this.h()},h(){g(r,"class","flex"),g(t,"class","flex flex-col items-center")},m(i,l){Q(i,t,l),v(t,r);for(let o=0;o<n.length;o+=1)n[o].m(r,null)},p(i,[l]){if(l&15){s=i[0];let o;for(o=0;o<s.length;o+=1){const f=rt(i,s,o);n[o]?n[o].p(f,l):(n[o]=nt(f),n[o].c(),n[o].m(r,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=s.length}},i:Ve,o:Ve,d(i){i&&y(t),ft(n,i)}}}function nr(e,t,r){let{colors:s}=t;s.length;function n(f){const _=ue(f);return _.l>50?ue(_.h,_.c,0).formatHex():ue(_.h,_.c,100).formatHex()}let i=-1;async function l(f,_){i>-1||(r(1,i=_),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([f],{type:"text/plain"})})]),setTimeout(()=>{r(1,i=-1)},800))}const o=(f,_)=>l(f.formatHex(),_);return e.$$set=f=>{"colors"in f&&r(0,s=f.colors)},[s,i,n,l,o]}class ar extends Se{constructor(t){super(),ze(this,t,nr,rr,Re,{colors:0})}}function sr(e){let t,r,s,n,i,l,o,f,_,C,z,c,a,h,u,b,x,N,d,w=e[0]?"Copied":"Copy",p,m,k,E;return o=new ar({props:{colors:e[2]}}),{c(){t=D("div"),r=D("blockquote"),s=D("p"),n=j(e[3]),i=U(),l=D("div"),ut(o.$$.fragment),f=U(),_=D("div"),C=D("div"),z=D("img"),a=U(),h=D("div"),u=D("div"),b=D("button"),x=j("Remix"),N=U(),d=D("button"),p=j(w),this.h()},l(I){t=H(I,"DIV",{class:!0});var $=P(t);r=H($,"BLOCKQUOTE",{class:!0,title:!0});var B=P(r);s=H(B,"P",{});var R=P(s);n=A(R,e[3]),R.forEach(y),B.forEach(y),i=V($),l=H($,"DIV",{class:!0});var F=P(l);ht(o.$$.fragment,F),F.forEach(y),f=V($),_=H($,"DIV",{class:!0});var X=P(_);C=H(X,"DIV",{class:!0});var O=P(C);z=H(O,"IMG",{loading:!0,class:!0,src:!0,alt:!0}),O.forEach(y),X.forEach(y),a=V($),h=H($,"DIV",{class:!0});var q=P(h);u=H(q,"DIV",{class:!0});var S=P(u);b=H(S,"BUTTON",{class:!0,title:!0});var M=P(b);x=A(M,"Remix"),M.forEach(y),N=V(S),d=H(S,"BUTTON",{class:!0,title:!0});var Z=P(d);p=A(Z,w),Z.forEach(y),S.forEach(y),q.forEach(y),$.forEach(y),this.h()},h(){g(r,"class","row-start-1 mx-auto col-span-6 italic font-semibold max-w-prose text-base text-center line-clamp-3 my-3"),g(r,"title",e[3]),g(l,"class","row-start-3 md:row-start-2 col-span-6 md:col-span-4 flex items-center justify-center"),g(z,"loading","lazy"),g(z,"class","relative max-w-[100px] w-full aspect-square"),je(z.src,c=e[1])||g(z,"src",c),g(z,"alt",e[3]),g(C,"class","relative"),g(_,"class","row-start-2 col-span-6 md:col-span-2 flex justify-center md:justify-end pb-3"),g(b,"class","button svelte-8zu88a"),g(b,"title","Send this prompt to input so you can remix it"),g(d,"class","button svelte-8zu88a"),g(d,"title","Copy all colors to clipboard"),d.disabled=e[0],g(u,"class","flex justify-center items-center"),g(h,"class","row-start-4 col-span-6 md:col-span-2 md:col-start-5 flex justify-center md:justify-end"),g(t,"class","grid grid-cols-6 gap-3")},m(I,$){Q(I,t,$),v(t,r),v(r,s),v(s,n),v(t,i),v(t,l),dt(o,l,null),v(t,f),v(t,_),v(_,C),v(C,z),v(t,a),v(t,h),v(h,u),v(u,b),v(b,x),v(u,N),v(u,d),v(d,p),m=!0,k||(E=[ie(b,"click",e[7]),ie(d,"click",e[8])],k=!0)},p(I,[$]){(!m||$&8)&&he(n,I[3]),(!m||$&8)&&g(r,"title",I[3]);const B={};$&4&&(B.colors=I[2]),o.$set(B),(!m||$&2&&!je(z.src,c=I[1]))&&g(z,"src",c),(!m||$&8)&&g(z,"alt",I[3]),(!m||$&1)&&w!==(w=I[0]?"Copied":"Copy")&&he(p,w),(!m||$&1)&&(d.disabled=I[0])},i(I){m||(te(o.$$.fragment,I),m=!0)},o(I){ce(o.$$.fragment,I),m=!1},d(I){I&&y(t),pt(o),k=!1,gt(E)}}}function ir(e,t,r){let s,n,i;const l=Ct();let{promptData:o}=t,f=!1;async function _(c){f||(r(0,f=!0),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([c],{type:"text/plain"})})]),setTimeout(()=>{r(0,f=!1)},1e3))}const C=()=>l("remix",{prompt:s}),z=()=>_(n.map(c=>c.formatHex()).join(", "));return e.$$set=c=>{"promptData"in c&&r(6,o=c.promptData)},e.$$.update=()=>{e.$$.dirty&64&&r(3,s=o.prompt),e.$$.dirty&64&&r(2,n=o.images[0].colors.map(c=>Be(c))),e.$$.dirty&64&&r(1,i=o.images[0].imgURL)},[f,i,n,s,l,_,o,C,z]}class lr extends Se{constructor(t){super(),ze(this,t,ir,sr,Re,{promptData:6})}}function at(e,t,r){const s=e.slice();return s[16]=t[r],s}function st(e){let t,r,s,n,i=e[5]&&it();return{c(){t=D("h3"),r=j(e[4]),s=U(),i&&i.c(),n=Je(),this.h()},l(l){t=H(l,"H3",{class:!0});var o=P(t);r=A(o,e[4]),o.forEach(y),s=V(l),i&&i.l(l),n=Je(),this.h()},h(){g(t,"class","text-xs font-bold ml-3 inline-block")},m(l,o){Q(l,t,o),v(t,r),Q(l,s,o),i&&i.m(l,o),Q(l,n,o)},p(l,o){o&16&&he(r,l[4]),l[5]?i||(i=it(),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(l){l&&y(t),l&&y(s),i&&i.d(l),l&&y(n)}}}function it(e){let t,r;return{c(){t=ye("svg"),r=ye("path"),this.h()},l(s){t=ke(s,"svg",{xmlns:!0,fill:!0,viewBox:!0,class:!0});var n=P(t);r=ke(n,"path",{fill:!0,d:!0}),P(r).forEach(y),n.forEach(y),this.h()},h(){g(r,"fill","currentColor"),g(r,"d","M20 12a8 8 0 0 1-8 8v4a12 12 0 0 0 12-12h-4Zm-2-5.3a8 8 0 0 1 2 5.3h4c0-3-1.1-5.8-3-8l-3 2.7Z"),g(t,"xmlns","http://www.w3.org/2000/svg"),g(t,"fill","none"),g(t,"viewBox","0 0 24 24"),g(t,"class","animate-spin max-w-[1rem] inline-block")},m(s,n){Q(s,t,n),v(t,r)},d(s){s&&y(t)}}}function lt(e){let t,r,s=e[0],n=[];for(let l=0;l<s.length;l+=1)n[l]=ot(at(e,s,l));const i=l=>ce(n[l],1,1,()=>{n[l]=null});return{c(){t=D("div");for(let l=0;l<n.length;l+=1)n[l].c()},l(l){t=H(l,"DIV",{});var o=P(t);for(let f=0;f<n.length;f+=1)n[f].l(o);o.forEach(y)},m(l,o){Q(l,t,o);for(let f=0;f<n.length;f+=1)n[f].m(t,null);r=!0},p(l,o){if(o&129){s=l[0];let f;for(f=0;f<s.length;f+=1){const _=at(l,s,f);n[f]?(n[f].p(_,o),te(n[f],1)):(n[f]=ot(_),n[f].c(),te(n[f],1),n[f].m(t,null))}for(bt(),f=s.length;f<n.length;f+=1)i(f);mt()}},i(l){if(!r){for(let o=0;o<s.length;o+=1)te(n[o]);r=!0}},o(l){n=n.filter(Boolean);for(let o=0;o<n.length;o+=1)ce(n[o]);r=!1},d(l){l&&y(t),ft(n,l)}}}function ot(e){let t,r,s,n;return t=new lr({props:{promptData:e[16]}}),t.$on("remix",e[7]),{c(){ut(t.$$.fragment),r=U(),s=D("div"),this.h()},l(i){ht(t.$$.fragment,i),r=V(i),s=H(i,"DIV",{class:!0}),P(s).forEach(y),this.h()},h(){g(s,"class","border-b border-gray-200 py-2")},m(i,l){dt(t,i,l),Q(i,r,l),Q(i,s,l),n=!0},p(i,l){const o={};l&1&&(o.promptData=i[16]),t.$set(o)},i(i){n||(te(t.$$.fragment,i),n=!0)},o(i){ce(t.$$.fragment,i),n=!1},d(i){pt(t,i),i&&y(r),i&&y(s)}}}function or(e){let t,r,s,n,i,l,o,f,_,C,z,c,a,h,u,b,x,N,d,w,p,m,k,E,I,$,B,R,F,X,O=e[4]&&st(e),q=e[0]&&lt(e);return{c(){t=D("div"),r=D("h1"),s=j("Palette generation with Stable Diffussion"),n=U(),i=D("p"),l=j(`Original ideas:
2
+
3
+ `),o=D("a"),f=j(`Matt DesLauriers
4
+ `),_=j(`,
5
+ `),C=D("a"),z=j("dribnet"),c=U(),a=D("div"),h=D("form"),u=D("input"),b=U(),x=D("button"),N=j("Create Palette"),d=U(),O&&O.c(),w=U(),p=D("div"),m=D("div"),k=j(e[3]),E=j(" submitted palettes"),I=U(),$=D("div"),B=U(),q&&q.c(),this.h()},l(S){t=H(S,"DIV",{class:!0});var M=P(t);r=H(M,"H1",{class:!0});var Z=P(r);s=A(Z,"Palette generation with Stable Diffussion"),Z.forEach(y),n=V(M),i=H(M,"P",{class:!0});var fe=P(i);l=A(fe,`Original ideas:
6
+
7
+ `),o=H(fe,"A",{class:!0,target:!0,rel:!0,href:!0});var Te=P(o);f=A(Te,`Matt DesLauriers
8
+ `),Te.forEach(y),_=A(fe,`,
9
+ `),C=H(fe,"A",{class:!0,href:!0});var Le=P(C);z=A(Le,"dribnet"),Le.forEach(y),fe.forEach(y),c=V(M),a=H(M,"DIV",{class:!0});var me=P(a);h=H(me,"FORM",{class:!0});var be=P(h);u=H(be,"INPUT",{class:!0,placeholder:!0,title:!0,type:!0,name:!0}),b=V(be),x=H(be,"BUTTON",{class:!0,title:!0});var Ue=P(x);N=A(Ue,"Create Palette"),Ue.forEach(y),be.forEach(y),d=V(me),O&&O.l(me),me.forEach(y),w=V(M),p=H(M,"DIV",{class:!0});var xe=P(p);m=H(xe,"DIV",{class:!0});var Ce=P(m);k=A(Ce,e[3]),E=A(Ce," submitted palettes"),Ce.forEach(y),I=V(xe),$=H(xe,"DIV",{class:!0}),P($).forEach(y),xe.forEach(y),B=V(M),q&&q.l(M),M.forEach(y),this.h()},h(){g(r,"class","text-3xl font-bold leading-normal"),g(o,"class","link svelte-zbscw1"),g(o,"target","_blank"),g(o,"rel","nofollow noopener"),g(o,"href","https://twitter.com/mattdesl/status/1569457653298139136"),g(C,"class","link svelte-zbscw1"),g(C,"href","https://drib.net/homage"),g(i,"class","text-sm"),g(u,"class","input svelte-zbscw1"),g(u,"placeholder","A photo of a beautiful sunset in San Francisco"),g(u,"title","Input prompt to generate image and obtain palette"),g(u,"type","text"),g(u,"name","prompt"),u.disabled=e[5],g(x,"class","button svelte-zbscw1"),x.disabled=e[5],g(x,"title","Generate Palette"),g(h,"class","grid grid-cols-6"),g(a,"class","relative top-0 z-50 bg-white dark:bg-black py-3"),g(m,"class","font-bold text-sm"),g($,"class","grow border-b border-gray-200"),g(p,"class","flex items-center gap-4 my-10"),g(t,"class","max-w-screen-md mx-auto px-3 py-8 relative z-0")},m(S,M){Q(S,t,M),v(t,r),v(r,s),v(t,n),v(t,i),v(i,l),v(i,o),v(o,f),v(i,_),v(i,C),v(C,z),v(t,c),v(t,a),v(a,h),v(h,u),e[8](u),Ae(u,e[1]),v(h,b),v(h,x),v(x,N),v(a,d),O&&O.m(a,null),v(t,w),v(t,p),v(p,m),v(m,k),v(m,E),v(p,I),v(p,$),v(t,B),q&&q.m(t,null),R=!0,F||(X=[ie(u,"input",e[9]),ie(x,"click",Fe(e[10])),ie(h,"submit",Fe(e[11]))],F=!0)},p(S,[M]){(!R||M&32)&&(u.disabled=S[5]),M&2&&u.value!==S[1]&&Ae(u,S[1]),(!R||M&32)&&(x.disabled=S[5]),S[4]?O?O.p(S,M):(O=st(S),O.c(),O.m(a,null)):O&&(O.d(1),O=null),(!R||M&8)&&he(k,S[3]),S[0]?q?(q.p(S,M),M&1&&te(q,1)):(q=lt(S),q.c(),te(q,1),q.m(t,null)):q&&(bt(),ce(q,1,1,()=>{q=null}),mt())},i(S){R||(te(q),R=!0)},o(S){ce(q),R=!1},d(S){S&&y(t),e[8](null),O&&O.d(),q&&q.d(),F=!1,gt(X)}}}function ct(e){return e.sort((t,r)=>r.id-t.id).map(t=>t.data)}function cr(e,t,r){let s,n,i;Ge(e,G,d=>r(4,n=d)),Ge(e,se,d=>r(5,i=d));const l="/embed/huggingface-projects/color-palette-generator-sd";let o,f,_;Mt(()=>{C();const d=window.setInterval(C,5e3);return()=>{clearInterval(d)}});async function C(){const d=await fetch(l+"/data").then(w=>w.json());(!o||d.length>o.length)&&r(0,o=ct(d))}async function z(d){try{const w=await fetch(l+"/new_palette",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:d.prompt,images:d.images.map(p=>({imgURL:p.imgURL,colors:p.colors.map(m=>m.formatHex())}))})}).then(p=>p.json());r(0,o=ct(w))}catch(w){console.error(w)}}async function c(d){if(!d||i==!0)return;T(G,n="Pending",n),T(se,i=!0,i);const w=crypto.randomUUID(),p={fn_index:2,data:[d,1,40,7.5,Number(Wt())]},m=new WebSocket(tr);m.onopen=async function(k){m.send(JSON.stringify({hash:w}))},m.onclose=k=>{k.wasClean||(T(G,n="Error",n),T(se,i=!1,i))},m.onmessage=async function(k){try{const E=JSON.parse(k.data);switch(T(G,n="",n),E.msg){case"send_data":T(G,n="Sending Data",n),m.send(JSON.stringify(p));break;case"queue_full":T(G,n="Queue full",n),m.close(),T(se,i=!1,i);return;case"estimation":const{msg:I,rank:$,queue_size:B}=E;T(G,n=`On queue ${$}/${B}`,n);break;case"process_generating":T(G,n=E.success?"Generating":"Error",n);break;case"process_completed":try{const R=await a(E.output.data[0],d);z({prompt:d,images:R}),T(G,n=E.success?"Complete":"Error",n)}catch(R){T(G,n=R.message,n)}m.close(),T(se,i=!1,i);return;case"process_starts":T(G,n="Processing",n);break}}catch(E){console.error(E),T(se,i=!1,i),T(G,n="Error",n)}}}async function a(d,w){const p=["#040404","#B7B7B7","#565656","#747474","#6C6C6C"],m=[];for(const k of d){const{colors:E,imgBlob:I}=await Zt(k);if(E.map(R=>R.formatHex().toUpperCase()).every(R=>p.includes(R)))throw console.error("Possible NSFW image"),new Error("Possible NSFW image");const $=await Yt(I,w),B={colors:E,imgURL:$};m.push(B)}return m}function h(d){r(1,f=d.detail.prompt),_.scrollIntoView({behavior:"smooth"}),"parentIFrame"in window&&window.parentIFrame.scrollTo(0,_.offsetTop)}function u(d){Pt[d?"unshift":"push"](()=>{_=d,r(2,_)})}function b(){f=this.value,r(1,f)}const x=()=>c(f),N=()=>c(f);return e.$$.update=()=>{e.$$.dirty&1&&r(3,s=(o==null?void 0:o.length)||0)},[o,f,_,s,n,i,c,h,u,b,x,N]}class hr extends Se{constructor(t){super(),ze(this,t,cr,or,Re,{})}}export{hr as default};
static/_app/immutable/{start-ea085781.js β†’ start-852e9e2b.js} RENAMED
@@ -1 +1 @@
1
- import{S as Ge,i as We,s as He,a as Me,e as z,c as Xe,b as W,g as ie,t as K,d as le,f as x,h as F,j as Ye,o as be,k as Qe,l as Ze,m as et,n as ge,p as C,q as tt,r as nt,u as rt,v as H,w as Se,x as M,y as X,z as De}from"./chunks/index-5559954d.js";import{g as Ce,f as qe,s as G,a as ve,b as at,i as st}from"./chunks/singletons-30e820d5.js";const ot=function(){const e=document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}(),it=function(r,e){return new URL(r,e).href},Ve={},se=function(e,t,c){return!t||t.length===0?e():Promise.all(t.map(o=>{if(o=it(o,c),o in Ve)return;Ve[o]=!0;const d=o.endsWith(".css"),n=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${n}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":ot,d||(f.as="script",f.crossOrigin=""),f.href=o,document.head.appendChild(f),d)return new Promise((w,_)=>{f.addEventListener("load",w),f.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};class we{constructor(e,t){this.status=e,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Be{constructor(e,t){this.status=e,this.location=t}}function lt(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&!r.endsWith("/")?r+"/":r}function ct(r){for(const e in r)r[e]=r[e].replace(/%23/g,"#").replace(/%3[Bb]/g,";").replace(/%2[Cc]/g,",").replace(/%2[Ff]/g,"/").replace(/%3[Ff]/g,"?").replace(/%3[Aa]/g,":").replace(/%40/g,"@").replace(/%26/g,"&").replace(/%3[Dd]/g,"=").replace(/%2[Bb]/g,"+").replace(/%24/g,"$");return r}const ft=["href","pathname","search","searchParams","toString","toJSON"];function ut(r,e){const t=new URL(r);for(const c of ft){let o=t[c];Object.defineProperty(t,c,{get(){return e(),o},enumerable:!0,configurable:!0})}return t[Symbol.for("nodejs.util.inspect.custom")]=(c,o,d)=>d(r,o),dt(t),t}function dt(r){Object.defineProperty(r,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}function pt(r){let e=5381,t=r.length;if(typeof r=="string")for(;t;)e=e*33^r.charCodeAt(--t);else for(;t;)e=e*33^r[--t];return(e>>>0).toString(36)}const Re=window.fetch;window.fetch=(r,e)=>{if((r instanceof Request?r.method:(e==null?void 0:e.method)||"GET")!=="GET"){const c=new URL(r instanceof Request?r.url:r.toString(),document.baseURI).href;oe.delete(c)}return Re(r,e)};const oe=new Map;function ht(r,e,t){let o=`script[data-sveltekit-fetched][data-url=${JSON.stringify(typeof r=="string"?r:r.url)}]`;t&&typeof t.body=="string"&&(o+=`[data-hash="${pt(t.body)}"]`);const d=document.querySelector(o);if(d!=null&&d.textContent){const{body:n,...f}=JSON.parse(d.textContent),w=d.getAttribute("data-ttl");return w&&oe.set(e,{body:n,init:f,ttl:1e3*Number(w)}),Promise.resolve(new Response(n,f))}return Re(r,t)}function mt(r,e){const t=oe.get(r);if(t){if(performance.now()<t.ttl)return new Response(t.body,t.init);oe.delete(r)}return Re(r,e)}const _t=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function gt(r){const e=[],t=[];let c=!0;return{pattern:r===""?/^\/$/:new RegExp(`^${r.split(/(?:\/|$)/).filter(wt).map((d,n,f)=>{const w=decodeURIComponent(d),_=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(w);if(_)return e.push(_[1]),t.push(_[2]),"(?:/(.*))?";const b=n===f.length-1;return w&&"/"+w.split(/\[(.+?)\]/).map(($,S)=>{if(S%2){const N=_t.exec($);if(!N)throw new Error(`Invalid param: ${$}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,q]=N;return e.push(T),t.push(q),j?"(.*?)":"([^/]+?)"}return b&&$.includes(".")&&(c=!1),$.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${c?"/?":""}$`),names:e,types:t}}function wt(r){return!/^\([^)]+\)$/.test(r)}function yt(r,e,t,c){const o={};for(let d=0;d<e.length;d+=1){const n=e[d],f=t[d],w=r[d+1]||"";if(f){const _=c[f];if(!_)throw new Error(`Missing "${f}" param matcher`);if(!_(w))return}o[n]=w}return o}function bt(r,e,t,c){const o=new Set(e);return Object.entries(t).map(([f,[w,_,b]])=>{const{pattern:$,names:S,types:N}=gt(f),j={id:f,exec:T=>{const q=$.exec(T);if(q)return yt(q,S,N,c)},errors:[1,...b||[]].map(T=>r[T]),layouts:[0,..._||[]].map(n),leaf:d(w)};return j.errors.length=j.layouts.length=Math.max(j.errors.length,j.layouts.length),j});function d(f){const w=f<0;return w&&(f=~f),[w,r[f]]}function n(f){return f===void 0?f:[o.has(f),r[f]]}}function vt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&2&&(w.form=n[1]),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function kt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],$$slots:{default:[Et]},$$scope:{ctx:n}}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&523&&(w.$$scope={dirty:f,ctx:n}),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Et(r){let e,t,c;var o=r[0][1];function d(n){return{props:{data:n[3],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&8&&(w.data=n[3]),f&2&&(w.form=n[1]),o!==(o=n[0][1])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Je(r){let e,t=r[5]&&ze(r);return{c(){e=Qe("div"),t&&t.c(),this.h()},l(c){e=Ze(c,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=et(e);t&&t.l(o),o.forEach(F),this.h()},h(){ge(e,"id","svelte-announcer"),ge(e,"aria-live","assertive"),ge(e,"aria-atomic","true"),C(e,"position","absolute"),C(e,"left","0"),C(e,"top","0"),C(e,"clip","rect(0 0 0 0)"),C(e,"clip-path","inset(50%)"),C(e,"overflow","hidden"),C(e,"white-space","nowrap"),C(e,"width","1px"),C(e,"height","1px")},m(c,o){W(c,e,o),t&&t.m(e,null)},p(c,o){c[5]?t?t.p(c,o):(t=ze(c),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(c){c&&F(e),t&&t.d()}}}function ze(r){let e;return{c(){e=tt(r[6])},l(t){e=nt(t,r[6])},m(t,c){W(t,e,c)},p(t,c){c&64&&rt(e,t[6])},d(t){t&&F(e)}}}function St(r){let e,t,c,o,d;const n=[kt,vt],f=[];function w(b,$){return b[0][1]?0:1}e=w(r),t=f[e]=n[e](r);let _=r[4]&&Je(r);return{c(){t.c(),c=Me(),_&&_.c(),o=z()},l(b){t.l(b),c=Xe(b),_&&_.l(b),o=z()},m(b,$){f[e].m(b,$),W(b,c,$),_&&_.m(b,$),W(b,o,$),d=!0},p(b,[$]){let S=e;e=w(b),e===S?f[e].p(b,$):(ie(),K(f[S],1,1,()=>{f[S]=null}),le(),t=f[e],t?t.p(b,$):(t=f[e]=n[e](b),t.c()),x(t,1),t.m(c.parentNode,c)),b[4]?_?_.p(b,$):(_=Je(b),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null)},i(b){d||(x(t),d=!0)},o(b){K(t),d=!1},d(b){f[e].d(b),b&&F(c),_&&_.d(b),b&&F(o)}}}function Rt(r,e,t){let{stores:c}=e,{page:o}=e,{components:d}=e,{form:n}=e,{data_0:f=null}=e,{data_1:w=null}=e;Ye(c.page.notify);let _=!1,b=!1,$=null;return be(()=>{const S=c.page.subscribe(()=>{_&&(t(5,b=!0),t(6,$=document.title||"untitled page"))});return t(4,_=!0),S}),r.$$set=S=>{"stores"in S&&t(7,c=S.stores),"page"in S&&t(8,o=S.page),"components"in S&&t(0,d=S.components),"form"in S&&t(1,n=S.form),"data_0"in S&&t(2,f=S.data_0),"data_1"in S&&t(3,w=S.data_1)},r.$$.update=()=>{r.$$.dirty&384&&c.page.set(o)},[d,n,f,w,_,b,$,c,o]}class $t extends Ge{constructor(e){super(),We(this,e,Rt,St,He,{stores:7,page:8,components:0,form:1,data_0:2,data_1:3})}}const Lt={},ce=[()=>se(()=>import("./chunks/0-17a4fec1.js"),["chunks/0-17a4fec1.js","chunks/_layout-1daba58d.js","components/pages/_layout.svelte-55da5a4f.js","assets/_layout-0243ccbc.css","chunks/index-5559954d.js"],import.meta.url),()=>se(()=>import("./chunks/1-dea0ad4d.js"),["chunks/1-dea0ad4d.js","components/error.svelte-06141ece.js","chunks/index-5559954d.js","chunks/singletons-30e820d5.js","chunks/index-3bda1050.js"],import.meta.url),()=>se(()=>import("./chunks/2-41999758.js"),["chunks/2-41999758.js","components/pages/_page.svelte-af06679d.js","assets/_page-fd1176fc.css","chunks/index-5559954d.js","chunks/index-3bda1050.js"],import.meta.url)],Pt=[],Ot={"":[2]},jt={handleError:({error:r})=>(console.error(r),{message:"Internal Error"})},Ut="/__data.js",Fe="sveltekit:scroll",J="sveltekit:index",ne=bt(ce,Pt,Ot,Lt),ke=ce[0],Ee=ce[1];ke();Ee();let ee={};try{ee=JSON.parse(sessionStorage[Fe])}catch{}function ye(r){ee[r]=ve()}function It({target:r,base:e,trailing_slash:t}){var Ne;const c=[],o={id:null,promise:null},d={before_navigate:[],after_navigate:[]};let n={branch:[],error:null,session_id:0,url:null},f=!1,w=!0,_=!1,b=1,$=null,S=!1,N,j=(Ne=history.state)==null?void 0:Ne[J];j||(j=Date.now(),history.replaceState({...history.state,[J]:j},"",location.href));const T=ee[j];T&&(history.scrollRestoration="manual",scrollTo(T.x,T.y));let q=!1,V,$e;function Le(){if(!$){const a=new URL(location.href);$=Promise.resolve().then(async()=>{const i=pe(a,!0);await Oe(i,a,[]),$=null,S=!1})}return $}async function fe(a,{noscroll:i=!1,replaceState:p=!1,keepfocus:s=!1,state:l={}},h){return typeof a=="string"&&(a=new URL(a,Ce(document))),he({url:a,scroll:i?ve():null,keepfocus:s,redirect_chain:h,details:{state:l,replaceState:p},accepted:()=>{},blocked:()=>{},type:"goto"})}async function Pe(a){const i=pe(a,!1);if(!i)throw new Error("Attempted to prefetch a URL that does not belong to this app");return o.promise=Ie(i),o.id=i.id,o.promise}async function Oe(a,i,p,s,l){var v,k;const h=$e={};let m=a&&await Ie(a);if(!m&&i.origin===location.origin&&i.pathname===location.pathname&&(m=await te({status:404,error:new Error(`Not found: ${i.pathname}`),url:i,routeId:null})),!m)return await Q(i),!1;if(i=(a==null?void 0:a.url)||i,$e!==h)return!1;if(c.length=0,m.type==="redirect")if(p.length>10||p.includes(i.pathname))m=await te({status:500,error:new Error("Redirect loop"),url:i,routeId:null});else return fe(new URL(m.location,i).href,{},[...p,i.pathname]),!1;else((k=(v=m.props)==null?void 0:v.page)==null?void 0:k.status)>=400&&await G.updated.check()&&await Q(i);if(_=!0,s&&s.details){const{details:y}=s,g=y.replaceState?0:1;y.state[J]=j+=g,history[y.replaceState?"replaceState":"pushState"](y.state,"",i)}if(f){n=m.state,m.props.page&&(m.props.page.url=i);const y=ae();N.$set(m.props),y()}else je(m);if(s){const{scroll:y,keepfocus:g}=s;if(!g){const E=document.body,U=E.getAttribute("tabindex");E.tabIndex=-1,E.focus({preventScroll:!0}),setTimeout(()=>{var L;(L=getSelection())==null||L.removeAllRanges()}),U!==null?E.setAttribute("tabindex",U):E.removeAttribute("tabindex")}if(await De(),w){const E=i.hash&&document.getElementById(i.hash.slice(1));y?scrollTo(y.x,y.y):E?E.scrollIntoView():scrollTo(0,0)}}else await De();o.promise=null,o.id=null,w=!0,m.props.page&&(V=m.props.page),l&&l(),_=!1}function je(a){var l,h;n=a.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),V=a.props.page;const p=ae();N=new $t({target:r,props:{...a.props,stores:G},hydrate:!0}),p();const s={from:null,to:re("to",{params:n.params,routeId:(h=(l=n.route)==null?void 0:l.id)!=null?h:null,url:new URL(location.href)}),type:"load"};d.after_navigate.forEach(m=>m(s)),f=!0}async function Y({url:a,params:i,branch:p,status:s,error:l,route:h,form:m}){var U;const v=p.filter(Boolean),k={type:"loaded",state:{url:a,params:i,branch:p,error:l,route:h,session_id:b},props:{components:v.map(L=>L.node.component)}};m!==void 0&&(k.props.form=m);let y={},g=!V;for(let L=0;L<v.length;L+=1){const I=v[L];y={...y,...I.data},(g||!n.branch.some(A=>A===I))&&(k.props[`data_${L}`]=y,g=g||Object.keys((U=I.data)!=null?U:{}).length>0)}if(g||(g=Object.keys(V.data).length!==Object.keys(y).length),!n.url||a.href!==n.url.href||n.error!==l||g){k.props.page={error:l,params:i,routeId:h&&h.id,status:s,url:a,data:g?y:V.data};const L=(I,A)=>{Object.defineProperty(k.props.page,I,{get:()=>{throw new Error(`$page.${I} has been replaced by $page.url.${A}`)}})};L("origin","origin"),L("path","pathname"),L("query","searchParams")}return k}async function ue({loader:a,parent:i,url:p,params:s,routeId:l,server_data_node:h}){var y,g,E,U,L;let m=null;const v={dependencies:new Set,params:new Set,parent:!1,url:!1},k=await a();if((y=k.shared)!=null&&y.load){let I=function(...u){for(const R of u){const{href:O}=new URL(R,p);v.dependencies.add(O)}};const A={};for(const u in s)Object.defineProperty(A,u,{get(){return v.params.add(u),s[u]},enumerable:!0});const B={routeId:l,params:A,data:(g=h==null?void 0:h.data)!=null?g:null,url:ut(p,()=>{v.url=!0}),async fetch(u,R){let O;typeof u=="string"?O=u:(O=u.url,R={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:u.headers,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...R});const P=new URL(O,p).href;return I(P),f?mt(P,R):ht(O,P,R)},setHeaders:()=>{},depends:I,parent(){return v.parent=!0,i()}};Object.defineProperties(B,{props:{get(){throw new Error("@migration task: Replace `props` with `data` stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},session:{get(){throw new Error("session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")},enumerable:!1},stuff:{get(){throw new Error("@migration task: Remove stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1}}),m=(E=await k.shared.load.call(null,B))!=null?E:null}return{node:k,loader:a,server:h,shared:(U=k.shared)!=null&&U.load?{type:"data",data:m,uses:v}:null,data:(L=m!=null?m:h==null?void 0:h.data)!=null?L:null}}function Ue(a,i,p){if(S)return!0;if(!p)return!1;if(p.parent&&i||a.url&&p.url)return!0;for(const s of a.params)if(p.params.has(s))return!0;for(const s of p.dependencies)if(c.some(l=>l(new URL(s))))return!0;return!1}function de(a,i){var p,s;return(a==null?void 0:a.type)==="data"?{type:"data",data:a.data,uses:{dependencies:new Set((p=a.uses.dependencies)!=null?p:[]),params:new Set((s=a.uses.params)!=null?s:[]),parent:!!a.uses.parent,url:!!a.uses.url}}:(a==null?void 0:a.type)==="skip"&&i!=null?i:null}async function Ie({id:a,invalidating:i,url:p,params:s,route:l}){var B;if(o.id===a&&o.promise)return o.promise;const{errors:h,layouts:m,leaf:v}=l,k=n.url&&{url:a!==n.url.pathname+n.url.search,params:Object.keys(s).filter(u=>n.params[u]!==s[u])},y=[...m,v];h.forEach(u=>u==null?void 0:u().catch(()=>{})),y.forEach(u=>u==null?void 0:u[1]().catch(()=>{}));let g=null;const E=y.reduce((u,R,O)=>{var D;const P=n.branch[O],Z=!!(R!=null&&R[0])&&((P==null?void 0:P.loader)!==R[1]||Ue(k,u.some(Boolean),(D=P.server)==null?void 0:D.uses));return u.push(Z),u},[]);if(E.some(Boolean)){try{g=await Ke(p,E)}catch(u){return te({status:500,error:u,url:p,routeId:l.id})}if(g.type==="redirect")return g}const U=g==null?void 0:g.nodes;let L=!1;const I=y.map(async(u,R)=>{var D;if(!u)return;const O=n.branch[R],P=U==null?void 0:U[R];if((!P||P.type==="skip")&&u[1]===(O==null?void 0:O.loader)&&!Ue(k,L,(D=O.shared)==null?void 0:D.uses))return O;if(L=!0,(P==null?void 0:P.type)==="error")throw P;return ue({loader:u[1],url:p,params:s,routeId:l.id,parent:async()=>{var Te;const me={};for(let _e=0;_e<R;_e+=1)Object.assign(me,(Te=await I[_e])==null?void 0:Te.data);return me},server_data_node:de(P===void 0&&u[0]?{type:"skip"}:P!=null?P:null,O==null?void 0:O.server)})});for(const u of I)u.catch(()=>{});const A=[];for(let u=0;u<y.length;u+=1)if(y[u])try{A.push(await I[u])}catch(R){if(R instanceof Be)return{type:"redirect",location:R.location};let O=500,P;for(U!=null&&U.includes(R)?(O=(B=R.status)!=null?B:O,P=R.error):R instanceof we?(O=R.status,P=R.body):P=xe(R,{params:s,url:p,routeId:l.id});u--;)if(h[u]){let Z,D=u;for(;!A[D];)D-=1;try{return Z={node:await h[u](),loader:h[u],data:{},server:null,shared:null},await Y({url:p,params:s,branch:A.slice(0,D+1).concat(Z),status:O,error:P,route:l})}catch{continue}}await Q(p);return}else A.push(void 0);return await Y({url:p,params:s,branch:A,status:200,error:null,route:l,form:i?void 0:null})}async function te({status:a,error:i,url:p,routeId:s}){var y;const l={},h=await ke();let m=null;if(h.server)try{const g=await Ke(p,[!0]);if(g.type!=="data"||g.nodes[0]&&g.nodes[0].type!=="data")throw 0;m=(y=g.nodes[0])!=null?y:null}catch{await Q(p);return}const v=await ue({loader:ke,url:p,params:l,routeId:s,parent:()=>Promise.resolve({}),server_data_node:de(m)}),k={node:await Ee(),loader:Ee,shared:null,server:null,data:null};return await Y({url:p,params:l,branch:[v,k],status:a,error:i instanceof we?i.body:xe(i,{url:p,params:l,routeId:null}),route:null})}function pe(a,i){if(Ae(a))return;const p=decodeURI(a.pathname.slice(e.length)||"/");for(const s of ne){const l=s.exec(p);if(l){const h=new URL(a.origin+lt(a.pathname,t)+a.search+a.hash);return{id:h.pathname+h.search,invalidating:i,route:s,params:ct(l),url:h}}}}function Ae(a){return a.origin!==location.origin||!a.pathname.startsWith(e)}async function he({url:a,scroll:i,keepfocus:p,redirect_chain:s,details:l,type:h,delta:m,accepted:v,blocked:k}){var L,I,A,B;let y=!1;const g=pe(a,!1),E={from:re("from",{params:n.params,routeId:(I=(L=n.route)==null?void 0:L.id)!=null?I:null,url:n.url}),to:re("to",{params:(A=g==null?void 0:g.params)!=null?A:null,routeId:(B=g==null?void 0:g.route.id)!=null?B:null,url:a}),type:h};m!==void 0&&(E.delta=m);const U={...E,cancel:()=>{y=!0}};if(d.before_navigate.forEach(u=>u(U)),y){k();return}ye(j),v(),f&&G.navigating.set(E),await Oe(g,a,s,{scroll:i,keepfocus:p,details:l},()=>{d.after_navigate.forEach(u=>u(E)),G.navigating.set(null)})}function Q(a){return location.href=a.href,new Promise(()=>{})}return{after_navigate:a=>{be(()=>(d.after_navigate.push(a),()=>{const i=d.after_navigate.indexOf(a);d.after_navigate.splice(i,1)}))},before_navigate:a=>{be(()=>(d.before_navigate.push(a),()=>{const i=d.before_navigate.indexOf(a);d.before_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(_||!f)&&(w=!1)},goto:(a,i={})=>fe(a,i,[]),invalidate:a=>{if(a===void 0)throw new Error("`invalidate()` (with no arguments) has been replaced by `invalidateAll()`");if(typeof a=="function")c.push(a);else{const{href:i}=new URL(a,location.href);c.push(p=>p.href===i)}return Le()},invalidateAll:()=>(S=!0,Le()),prefetch:async a=>{const i=new URL(a,Ce(document));await Pe(i)},prefetch_routes:async a=>{const p=(a?ne.filter(s=>a.some(l=>s.exec(l))):ne).map(s=>Promise.all([...s.layouts,s.leaf].map(l=>l==null?void 0:l[1]())));await Promise.all(p)},apply_action:async a=>{if(a.type==="error"){const i=new URL(location.href),{branch:p,route:s}=n;if(!s)return;let l=n.branch.length;for(;l--;)if(s.errors[l]){let h,m=l;for(;!p[m];)m-=1;try{h={node:await s.errors[l](),loader:s.errors[l],data:{},server:null,shared:null};const v=await Y({url:i,params:n.params,branch:p.slice(0,m+1).concat(h),status:500,error:a.error,route:s});n=v.state;const k=ae();N.$set(v.props),k();return}catch{continue}}}else if(a.type==="redirect")fe(a.location,{},[]);else{const i={form:a.data};a.status!==V.status&&(i.page={...V,status:a.status});const p=ae();N.$set(i),p()}},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",s=>{var m,v;let l=!1;const h={from:re("from",{params:n.params,routeId:(v=(m=n.route)==null?void 0:m.id)!=null?v:null,url:n.url}),to:null,type:"unload",cancel:()=>l=!0};d.before_navigate.forEach(k=>k(h)),l?(s.preventDefault(),s.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ye(j);try{sessionStorage[Fe]=JSON.stringify(ee)}catch{}}});const a=s=>{const{url:l,options:h}=qe(s);if(l&&h.prefetch){if(Ae(l))return;Pe(l)}};let i;const p=s=>{clearTimeout(i),i=setTimeout(()=>{var l;(l=s.target)==null||l.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",a),addEventListener("mousemove",p),addEventListener("sveltekit:trigger_prefetch",a),addEventListener("click",s=>{if(s.button||s.which!==1||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.defaultPrevented)return;const{a:l,url:h,options:m}=qe(s);if(!l||!h)return;const v=l instanceof SVGAElement;if(!v&&!(h.protocol==="https:"||h.protocol==="http:"))return;const k=(l.getAttribute("rel")||"").split(/\s+/);if(l.hasAttribute("download")||k.includes("external")||m.reload||(v?l.target.baseVal:l.target))return;const[y,g]=h.href.split("#");if(g!==void 0&&y===location.href.split("#")[0]){q=!0,ye(j),n.url=h,G.page.set({...V,url:h}),G.page.notify();return}he({url:h,scroll:m.noscroll?ve():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:h.href===location.href},accepted:()=>s.preventDefault(),blocked:()=>s.preventDefault(),type:"link"})}),addEventListener("popstate",s=>{if(s.state){if(s.state[J]===j)return;const l=s.state[J]-j;he({url:new URL(location.href),scroll:ee[s.state[J]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=s.state[J]},blocked:()=>{history.go(-l)},type:"popstate",delta:l})}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[J]:++j},"",location.href))});for(const s of document.querySelectorAll("link"))s.rel==="icon"&&(s.href=s.href);addEventListener("pageshow",s=>{s.persisted&&G.navigating.set(null)})},_hydrate:async({status:a,error:i,node_ids:p,params:s,routeId:l,data:h,form:m})=>{var y;const v=new URL(location.href);let k;try{const g=p.map(async(E,U)=>{const L=h[U];return ue({loader:ce[E],url:v,params:s,routeId:l,parent:async()=>{const I={};for(let A=0;A<U;A+=1)Object.assign(I,(await g[A]).data);return I},server_data_node:de(L)})});k=await Y({url:v,params:s,branch:await Promise.all(g),status:a,error:i,form:m,route:(y=ne.find(E=>E.id===l))!=null?y:null})}catch(g){const E=g;if(E instanceof Be){await Q(new URL(g.location,location.href));return}k=await te({status:E instanceof we?E.status:500,error:E,url:v,routeId:l})}je(k)}}}let At=1;async function Ke(r,e){const t=new URL(r);t.pathname=r.pathname.replace(/\/$/,"")+Ut,t.searchParams.set("__invalid",e.map(o=>o?"y":"n").join("")),t.searchParams.set("__id",String(At++)),await se(()=>import(t.href),[],import.meta.url);const c=window.__sveltekit_data;return delete window.__sveltekit_data,c}function xe(r,e){var t;return(t=jt.handleError({error:r,event:e}))!=null?t:{message:"Internal Error"}}const Nt=["hash","href","host","hostname","origin","pathname","port","protocol","search","searchParams","toString","toJSON"];function re(r,e){for(const t of Nt)Object.defineProperty(e,t,{get(){throw new Error(`The navigation shape changed - ${r}.${t} should now be ${r}.url.${t}`)}});return e}function ae(){return()=>{}}async function Ct({env:r,hydrate:e,paths:t,target:c,trailing_slash:o}){at(t);const d=It({target:c,base:t.base,trailing_slash:o});st({client:d}),e?await d._hydrate(e):d.goto(location.href,{replaceState:!0}),d._start_router()}export{Ct as start};
 
1
+ import{S as Ge,i as We,s as He,a as Me,e as z,c as Xe,b as W,g as ie,t as K,d as le,f as x,h as F,j as Ye,o as be,k as Qe,l as Ze,m as et,n as ge,p as C,q as tt,r as nt,u as rt,v as H,w as Se,x as M,y as X,z as De}from"./chunks/index-5559954d.js";import{g as Ce,f as qe,s as G,a as ve,b as at,i as st}from"./chunks/singletons-aa6d0232.js";const ot=function(){const e=document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}(),it=function(r,e){return new URL(r,e).href},Ve={},se=function(e,t,c){return!t||t.length===0?e():Promise.all(t.map(o=>{if(o=it(o,c),o in Ve)return;Ve[o]=!0;const d=o.endsWith(".css"),n=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${n}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":ot,d||(f.as="script",f.crossOrigin=""),f.href=o,document.head.appendChild(f),d)return new Promise((w,_)=>{f.addEventListener("load",w),f.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};class we{constructor(e,t){this.status=e,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Be{constructor(e,t){this.status=e,this.location=t}}function lt(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&!r.endsWith("/")?r+"/":r}function ct(r){for(const e in r)r[e]=r[e].replace(/%23/g,"#").replace(/%3[Bb]/g,";").replace(/%2[Cc]/g,",").replace(/%2[Ff]/g,"/").replace(/%3[Ff]/g,"?").replace(/%3[Aa]/g,":").replace(/%40/g,"@").replace(/%26/g,"&").replace(/%3[Dd]/g,"=").replace(/%2[Bb]/g,"+").replace(/%24/g,"$");return r}const ft=["href","pathname","search","searchParams","toString","toJSON"];function ut(r,e){const t=new URL(r);for(const c of ft){let o=t[c];Object.defineProperty(t,c,{get(){return e(),o},enumerable:!0,configurable:!0})}return t[Symbol.for("nodejs.util.inspect.custom")]=(c,o,d)=>d(r,o),dt(t),t}function dt(r){Object.defineProperty(r,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}function pt(r){let e=5381,t=r.length;if(typeof r=="string")for(;t;)e=e*33^r.charCodeAt(--t);else for(;t;)e=e*33^r[--t];return(e>>>0).toString(36)}const Re=window.fetch;window.fetch=(r,e)=>{if((r instanceof Request?r.method:(e==null?void 0:e.method)||"GET")!=="GET"){const c=new URL(r instanceof Request?r.url:r.toString(),document.baseURI).href;oe.delete(c)}return Re(r,e)};const oe=new Map;function ht(r,e,t){let o=`script[data-sveltekit-fetched][data-url=${JSON.stringify(typeof r=="string"?r:r.url)}]`;t&&typeof t.body=="string"&&(o+=`[data-hash="${pt(t.body)}"]`);const d=document.querySelector(o);if(d!=null&&d.textContent){const{body:n,...f}=JSON.parse(d.textContent),w=d.getAttribute("data-ttl");return w&&oe.set(e,{body:n,init:f,ttl:1e3*Number(w)}),Promise.resolve(new Response(n,f))}return Re(r,t)}function mt(r,e){const t=oe.get(r);if(t){if(performance.now()<t.ttl)return new Response(t.body,t.init);oe.delete(r)}return Re(r,e)}const _t=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function gt(r){const e=[],t=[];let c=!0;return{pattern:r===""?/^\/$/:new RegExp(`^${r.split(/(?:\/|$)/).filter(wt).map((d,n,f)=>{const w=decodeURIComponent(d),_=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(w);if(_)return e.push(_[1]),t.push(_[2]),"(?:/(.*))?";const b=n===f.length-1;return w&&"/"+w.split(/\[(.+?)\]/).map(($,S)=>{if(S%2){const N=_t.exec($);if(!N)throw new Error(`Invalid param: ${$}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,q]=N;return e.push(T),t.push(q),j?"(.*?)":"([^/]+?)"}return b&&$.includes(".")&&(c=!1),$.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${c?"/?":""}$`),names:e,types:t}}function wt(r){return!/^\([^)]+\)$/.test(r)}function yt(r,e,t,c){const o={};for(let d=0;d<e.length;d+=1){const n=e[d],f=t[d],w=r[d+1]||"";if(f){const _=c[f];if(!_)throw new Error(`Missing "${f}" param matcher`);if(!_(w))return}o[n]=w}return o}function bt(r,e,t,c){const o=new Set(e);return Object.entries(t).map(([f,[w,_,b]])=>{const{pattern:$,names:S,types:N}=gt(f),j={id:f,exec:T=>{const q=$.exec(T);if(q)return yt(q,S,N,c)},errors:[1,...b||[]].map(T=>r[T]),layouts:[0,..._||[]].map(n),leaf:d(w)};return j.errors.length=j.layouts.length=Math.max(j.errors.length,j.layouts.length),j});function d(f){const w=f<0;return w&&(f=~f),[w,r[f]]}function n(f){return f===void 0?f:[o.has(f),r[f]]}}function vt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&2&&(w.form=n[1]),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function kt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],$$slots:{default:[Et]},$$scope:{ctx:n}}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&523&&(w.$$scope={dirty:f,ctx:n}),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Et(r){let e,t,c;var o=r[0][1];function d(n){return{props:{data:n[3],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&8&&(w.data=n[3]),f&2&&(w.form=n[1]),o!==(o=n[0][1])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Je(r){let e,t=r[5]&&ze(r);return{c(){e=Qe("div"),t&&t.c(),this.h()},l(c){e=Ze(c,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=et(e);t&&t.l(o),o.forEach(F),this.h()},h(){ge(e,"id","svelte-announcer"),ge(e,"aria-live","assertive"),ge(e,"aria-atomic","true"),C(e,"position","absolute"),C(e,"left","0"),C(e,"top","0"),C(e,"clip","rect(0 0 0 0)"),C(e,"clip-path","inset(50%)"),C(e,"overflow","hidden"),C(e,"white-space","nowrap"),C(e,"width","1px"),C(e,"height","1px")},m(c,o){W(c,e,o),t&&t.m(e,null)},p(c,o){c[5]?t?t.p(c,o):(t=ze(c),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(c){c&&F(e),t&&t.d()}}}function ze(r){let e;return{c(){e=tt(r[6])},l(t){e=nt(t,r[6])},m(t,c){W(t,e,c)},p(t,c){c&64&&rt(e,t[6])},d(t){t&&F(e)}}}function St(r){let e,t,c,o,d;const n=[kt,vt],f=[];function w(b,$){return b[0][1]?0:1}e=w(r),t=f[e]=n[e](r);let _=r[4]&&Je(r);return{c(){t.c(),c=Me(),_&&_.c(),o=z()},l(b){t.l(b),c=Xe(b),_&&_.l(b),o=z()},m(b,$){f[e].m(b,$),W(b,c,$),_&&_.m(b,$),W(b,o,$),d=!0},p(b,[$]){let S=e;e=w(b),e===S?f[e].p(b,$):(ie(),K(f[S],1,1,()=>{f[S]=null}),le(),t=f[e],t?t.p(b,$):(t=f[e]=n[e](b),t.c()),x(t,1),t.m(c.parentNode,c)),b[4]?_?_.p(b,$):(_=Je(b),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null)},i(b){d||(x(t),d=!0)},o(b){K(t),d=!1},d(b){f[e].d(b),b&&F(c),_&&_.d(b),b&&F(o)}}}function Rt(r,e,t){let{stores:c}=e,{page:o}=e,{components:d}=e,{form:n}=e,{data_0:f=null}=e,{data_1:w=null}=e;Ye(c.page.notify);let _=!1,b=!1,$=null;return be(()=>{const S=c.page.subscribe(()=>{_&&(t(5,b=!0),t(6,$=document.title||"untitled page"))});return t(4,_=!0),S}),r.$$set=S=>{"stores"in S&&t(7,c=S.stores),"page"in S&&t(8,o=S.page),"components"in S&&t(0,d=S.components),"form"in S&&t(1,n=S.form),"data_0"in S&&t(2,f=S.data_0),"data_1"in S&&t(3,w=S.data_1)},r.$$.update=()=>{r.$$.dirty&384&&c.page.set(o)},[d,n,f,w,_,b,$,c,o]}class $t extends Ge{constructor(e){super(),We(this,e,Rt,St,He,{stores:7,page:8,components:0,form:1,data_0:2,data_1:3})}}const Lt={},ce=[()=>se(()=>import("./chunks/0-17a4fec1.js"),["chunks/0-17a4fec1.js","chunks/_layout-1daba58d.js","components/pages/_layout.svelte-55da5a4f.js","assets/_layout-0243ccbc.css","chunks/index-5559954d.js"],import.meta.url),()=>se(()=>import("./chunks/1-31cf4ccc.js"),["chunks/1-31cf4ccc.js","components/error.svelte-ebe8b925.js","chunks/index-5559954d.js","chunks/singletons-aa6d0232.js","chunks/index-3bda1050.js"],import.meta.url),()=>se(()=>import("./chunks/2-41cb5b33.js"),["chunks/2-41cb5b33.js","components/pages/_page.svelte-bf6d812e.js","assets/_page-fd1176fc.css","chunks/index-5559954d.js","chunks/index-3bda1050.js"],import.meta.url)],Pt=[],Ot={"":[2]},jt={handleError:({error:r})=>(console.error(r),{message:"Internal Error"})},Ut="/__data.js",Fe="sveltekit:scroll",J="sveltekit:index",ne=bt(ce,Pt,Ot,Lt),ke=ce[0],Ee=ce[1];ke();Ee();let ee={};try{ee=JSON.parse(sessionStorage[Fe])}catch{}function ye(r){ee[r]=ve()}function It({target:r,base:e,trailing_slash:t}){var Ne;const c=[],o={id:null,promise:null},d={before_navigate:[],after_navigate:[]};let n={branch:[],error:null,session_id:0,url:null},f=!1,w=!0,_=!1,b=1,$=null,S=!1,N,j=(Ne=history.state)==null?void 0:Ne[J];j||(j=Date.now(),history.replaceState({...history.state,[J]:j},"",location.href));const T=ee[j];T&&(history.scrollRestoration="manual",scrollTo(T.x,T.y));let q=!1,V,$e;function Le(){if(!$){const a=new URL(location.href);$=Promise.resolve().then(async()=>{const i=pe(a,!0);await Oe(i,a,[]),$=null,S=!1})}return $}async function fe(a,{noscroll:i=!1,replaceState:p=!1,keepfocus:s=!1,state:l={}},h){return typeof a=="string"&&(a=new URL(a,Ce(document))),he({url:a,scroll:i?ve():null,keepfocus:s,redirect_chain:h,details:{state:l,replaceState:p},accepted:()=>{},blocked:()=>{},type:"goto"})}async function Pe(a){const i=pe(a,!1);if(!i)throw new Error("Attempted to prefetch a URL that does not belong to this app");return o.promise=Ie(i),o.id=i.id,o.promise}async function Oe(a,i,p,s,l){var v,k;const h=$e={};let m=a&&await Ie(a);if(!m&&i.origin===location.origin&&i.pathname===location.pathname&&(m=await te({status:404,error:new Error(`Not found: ${i.pathname}`),url:i,routeId:null})),!m)return await Q(i),!1;if(i=(a==null?void 0:a.url)||i,$e!==h)return!1;if(c.length=0,m.type==="redirect")if(p.length>10||p.includes(i.pathname))m=await te({status:500,error:new Error("Redirect loop"),url:i,routeId:null});else return fe(new URL(m.location,i).href,{},[...p,i.pathname]),!1;else((k=(v=m.props)==null?void 0:v.page)==null?void 0:k.status)>=400&&await G.updated.check()&&await Q(i);if(_=!0,s&&s.details){const{details:y}=s,g=y.replaceState?0:1;y.state[J]=j+=g,history[y.replaceState?"replaceState":"pushState"](y.state,"",i)}if(f){n=m.state,m.props.page&&(m.props.page.url=i);const y=ae();N.$set(m.props),y()}else je(m);if(s){const{scroll:y,keepfocus:g}=s;if(!g){const E=document.body,U=E.getAttribute("tabindex");E.tabIndex=-1,E.focus({preventScroll:!0}),setTimeout(()=>{var L;(L=getSelection())==null||L.removeAllRanges()}),U!==null?E.setAttribute("tabindex",U):E.removeAttribute("tabindex")}if(await De(),w){const E=i.hash&&document.getElementById(i.hash.slice(1));y?scrollTo(y.x,y.y):E?E.scrollIntoView():scrollTo(0,0)}}else await De();o.promise=null,o.id=null,w=!0,m.props.page&&(V=m.props.page),l&&l(),_=!1}function je(a){var l,h;n=a.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),V=a.props.page;const p=ae();N=new $t({target:r,props:{...a.props,stores:G},hydrate:!0}),p();const s={from:null,to:re("to",{params:n.params,routeId:(h=(l=n.route)==null?void 0:l.id)!=null?h:null,url:new URL(location.href)}),type:"load"};d.after_navigate.forEach(m=>m(s)),f=!0}async function Y({url:a,params:i,branch:p,status:s,error:l,route:h,form:m}){var U;const v=p.filter(Boolean),k={type:"loaded",state:{url:a,params:i,branch:p,error:l,route:h,session_id:b},props:{components:v.map(L=>L.node.component)}};m!==void 0&&(k.props.form=m);let y={},g=!V;for(let L=0;L<v.length;L+=1){const I=v[L];y={...y,...I.data},(g||!n.branch.some(A=>A===I))&&(k.props[`data_${L}`]=y,g=g||Object.keys((U=I.data)!=null?U:{}).length>0)}if(g||(g=Object.keys(V.data).length!==Object.keys(y).length),!n.url||a.href!==n.url.href||n.error!==l||g){k.props.page={error:l,params:i,routeId:h&&h.id,status:s,url:a,data:g?y:V.data};const L=(I,A)=>{Object.defineProperty(k.props.page,I,{get:()=>{throw new Error(`$page.${I} has been replaced by $page.url.${A}`)}})};L("origin","origin"),L("path","pathname"),L("query","searchParams")}return k}async function ue({loader:a,parent:i,url:p,params:s,routeId:l,server_data_node:h}){var y,g,E,U,L;let m=null;const v={dependencies:new Set,params:new Set,parent:!1,url:!1},k=await a();if((y=k.shared)!=null&&y.load){let I=function(...u){for(const R of u){const{href:O}=new URL(R,p);v.dependencies.add(O)}};const A={};for(const u in s)Object.defineProperty(A,u,{get(){return v.params.add(u),s[u]},enumerable:!0});const B={routeId:l,params:A,data:(g=h==null?void 0:h.data)!=null?g:null,url:ut(p,()=>{v.url=!0}),async fetch(u,R){let O;typeof u=="string"?O=u:(O=u.url,R={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:u.headers,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...R});const P=new URL(O,p).href;return I(P),f?mt(P,R):ht(O,P,R)},setHeaders:()=>{},depends:I,parent(){return v.parent=!0,i()}};Object.defineProperties(B,{props:{get(){throw new Error("@migration task: Replace `props` with `data` stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},session:{get(){throw new Error("session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")},enumerable:!1},stuff:{get(){throw new Error("@migration task: Remove stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1}}),m=(E=await k.shared.load.call(null,B))!=null?E:null}return{node:k,loader:a,server:h,shared:(U=k.shared)!=null&&U.load?{type:"data",data:m,uses:v}:null,data:(L=m!=null?m:h==null?void 0:h.data)!=null?L:null}}function Ue(a,i,p){if(S)return!0;if(!p)return!1;if(p.parent&&i||a.url&&p.url)return!0;for(const s of a.params)if(p.params.has(s))return!0;for(const s of p.dependencies)if(c.some(l=>l(new URL(s))))return!0;return!1}function de(a,i){var p,s;return(a==null?void 0:a.type)==="data"?{type:"data",data:a.data,uses:{dependencies:new Set((p=a.uses.dependencies)!=null?p:[]),params:new Set((s=a.uses.params)!=null?s:[]),parent:!!a.uses.parent,url:!!a.uses.url}}:(a==null?void 0:a.type)==="skip"&&i!=null?i:null}async function Ie({id:a,invalidating:i,url:p,params:s,route:l}){var B;if(o.id===a&&o.promise)return o.promise;const{errors:h,layouts:m,leaf:v}=l,k=n.url&&{url:a!==n.url.pathname+n.url.search,params:Object.keys(s).filter(u=>n.params[u]!==s[u])},y=[...m,v];h.forEach(u=>u==null?void 0:u().catch(()=>{})),y.forEach(u=>u==null?void 0:u[1]().catch(()=>{}));let g=null;const E=y.reduce((u,R,O)=>{var D;const P=n.branch[O],Z=!!(R!=null&&R[0])&&((P==null?void 0:P.loader)!==R[1]||Ue(k,u.some(Boolean),(D=P.server)==null?void 0:D.uses));return u.push(Z),u},[]);if(E.some(Boolean)){try{g=await Ke(p,E)}catch(u){return te({status:500,error:u,url:p,routeId:l.id})}if(g.type==="redirect")return g}const U=g==null?void 0:g.nodes;let L=!1;const I=y.map(async(u,R)=>{var D;if(!u)return;const O=n.branch[R],P=U==null?void 0:U[R];if((!P||P.type==="skip")&&u[1]===(O==null?void 0:O.loader)&&!Ue(k,L,(D=O.shared)==null?void 0:D.uses))return O;if(L=!0,(P==null?void 0:P.type)==="error")throw P;return ue({loader:u[1],url:p,params:s,routeId:l.id,parent:async()=>{var Te;const me={};for(let _e=0;_e<R;_e+=1)Object.assign(me,(Te=await I[_e])==null?void 0:Te.data);return me},server_data_node:de(P===void 0&&u[0]?{type:"skip"}:P!=null?P:null,O==null?void 0:O.server)})});for(const u of I)u.catch(()=>{});const A=[];for(let u=0;u<y.length;u+=1)if(y[u])try{A.push(await I[u])}catch(R){if(R instanceof Be)return{type:"redirect",location:R.location};let O=500,P;for(U!=null&&U.includes(R)?(O=(B=R.status)!=null?B:O,P=R.error):R instanceof we?(O=R.status,P=R.body):P=xe(R,{params:s,url:p,routeId:l.id});u--;)if(h[u]){let Z,D=u;for(;!A[D];)D-=1;try{return Z={node:await h[u](),loader:h[u],data:{},server:null,shared:null},await Y({url:p,params:s,branch:A.slice(0,D+1).concat(Z),status:O,error:P,route:l})}catch{continue}}await Q(p);return}else A.push(void 0);return await Y({url:p,params:s,branch:A,status:200,error:null,route:l,form:i?void 0:null})}async function te({status:a,error:i,url:p,routeId:s}){var y;const l={},h=await ke();let m=null;if(h.server)try{const g=await Ke(p,[!0]);if(g.type!=="data"||g.nodes[0]&&g.nodes[0].type!=="data")throw 0;m=(y=g.nodes[0])!=null?y:null}catch{await Q(p);return}const v=await ue({loader:ke,url:p,params:l,routeId:s,parent:()=>Promise.resolve({}),server_data_node:de(m)}),k={node:await Ee(),loader:Ee,shared:null,server:null,data:null};return await Y({url:p,params:l,branch:[v,k],status:a,error:i instanceof we?i.body:xe(i,{url:p,params:l,routeId:null}),route:null})}function pe(a,i){if(Ae(a))return;const p=decodeURI(a.pathname.slice(e.length)||"/");for(const s of ne){const l=s.exec(p);if(l){const h=new URL(a.origin+lt(a.pathname,t)+a.search+a.hash);return{id:h.pathname+h.search,invalidating:i,route:s,params:ct(l),url:h}}}}function Ae(a){return a.origin!==location.origin||!a.pathname.startsWith(e)}async function he({url:a,scroll:i,keepfocus:p,redirect_chain:s,details:l,type:h,delta:m,accepted:v,blocked:k}){var L,I,A,B;let y=!1;const g=pe(a,!1),E={from:re("from",{params:n.params,routeId:(I=(L=n.route)==null?void 0:L.id)!=null?I:null,url:n.url}),to:re("to",{params:(A=g==null?void 0:g.params)!=null?A:null,routeId:(B=g==null?void 0:g.route.id)!=null?B:null,url:a}),type:h};m!==void 0&&(E.delta=m);const U={...E,cancel:()=>{y=!0}};if(d.before_navigate.forEach(u=>u(U)),y){k();return}ye(j),v(),f&&G.navigating.set(E),await Oe(g,a,s,{scroll:i,keepfocus:p,details:l},()=>{d.after_navigate.forEach(u=>u(E)),G.navigating.set(null)})}function Q(a){return location.href=a.href,new Promise(()=>{})}return{after_navigate:a=>{be(()=>(d.after_navigate.push(a),()=>{const i=d.after_navigate.indexOf(a);d.after_navigate.splice(i,1)}))},before_navigate:a=>{be(()=>(d.before_navigate.push(a),()=>{const i=d.before_navigate.indexOf(a);d.before_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(_||!f)&&(w=!1)},goto:(a,i={})=>fe(a,i,[]),invalidate:a=>{if(a===void 0)throw new Error("`invalidate()` (with no arguments) has been replaced by `invalidateAll()`");if(typeof a=="function")c.push(a);else{const{href:i}=new URL(a,location.href);c.push(p=>p.href===i)}return Le()},invalidateAll:()=>(S=!0,Le()),prefetch:async a=>{const i=new URL(a,Ce(document));await Pe(i)},prefetch_routes:async a=>{const p=(a?ne.filter(s=>a.some(l=>s.exec(l))):ne).map(s=>Promise.all([...s.layouts,s.leaf].map(l=>l==null?void 0:l[1]())));await Promise.all(p)},apply_action:async a=>{if(a.type==="error"){const i=new URL(location.href),{branch:p,route:s}=n;if(!s)return;let l=n.branch.length;for(;l--;)if(s.errors[l]){let h,m=l;for(;!p[m];)m-=1;try{h={node:await s.errors[l](),loader:s.errors[l],data:{},server:null,shared:null};const v=await Y({url:i,params:n.params,branch:p.slice(0,m+1).concat(h),status:500,error:a.error,route:s});n=v.state;const k=ae();N.$set(v.props),k();return}catch{continue}}}else if(a.type==="redirect")fe(a.location,{},[]);else{const i={form:a.data};a.status!==V.status&&(i.page={...V,status:a.status});const p=ae();N.$set(i),p()}},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",s=>{var m,v;let l=!1;const h={from:re("from",{params:n.params,routeId:(v=(m=n.route)==null?void 0:m.id)!=null?v:null,url:n.url}),to:null,type:"unload",cancel:()=>l=!0};d.before_navigate.forEach(k=>k(h)),l?(s.preventDefault(),s.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ye(j);try{sessionStorage[Fe]=JSON.stringify(ee)}catch{}}});const a=s=>{const{url:l,options:h}=qe(s);if(l&&h.prefetch){if(Ae(l))return;Pe(l)}};let i;const p=s=>{clearTimeout(i),i=setTimeout(()=>{var l;(l=s.target)==null||l.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",a),addEventListener("mousemove",p),addEventListener("sveltekit:trigger_prefetch",a),addEventListener("click",s=>{if(s.button||s.which!==1||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.defaultPrevented)return;const{a:l,url:h,options:m}=qe(s);if(!l||!h)return;const v=l instanceof SVGAElement;if(!v&&!(h.protocol==="https:"||h.protocol==="http:"))return;const k=(l.getAttribute("rel")||"").split(/\s+/);if(l.hasAttribute("download")||k.includes("external")||m.reload||(v?l.target.baseVal:l.target))return;const[y,g]=h.href.split("#");if(g!==void 0&&y===location.href.split("#")[0]){q=!0,ye(j),n.url=h,G.page.set({...V,url:h}),G.page.notify();return}he({url:h,scroll:m.noscroll?ve():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:h.href===location.href},accepted:()=>s.preventDefault(),blocked:()=>s.preventDefault(),type:"link"})}),addEventListener("popstate",s=>{if(s.state){if(s.state[J]===j)return;const l=s.state[J]-j;he({url:new URL(location.href),scroll:ee[s.state[J]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=s.state[J]},blocked:()=>{history.go(-l)},type:"popstate",delta:l})}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[J]:++j},"",location.href))});for(const s of document.querySelectorAll("link"))s.rel==="icon"&&(s.href=s.href);addEventListener("pageshow",s=>{s.persisted&&G.navigating.set(null)})},_hydrate:async({status:a,error:i,node_ids:p,params:s,routeId:l,data:h,form:m})=>{var y;const v=new URL(location.href);let k;try{const g=p.map(async(E,U)=>{const L=h[U];return ue({loader:ce[E],url:v,params:s,routeId:l,parent:async()=>{const I={};for(let A=0;A<U;A+=1)Object.assign(I,(await g[A]).data);return I},server_data_node:de(L)})});k=await Y({url:v,params:s,branch:await Promise.all(g),status:a,error:i,form:m,route:(y=ne.find(E=>E.id===l))!=null?y:null})}catch(g){const E=g;if(E instanceof Be){await Q(new URL(g.location,location.href));return}k=await te({status:E instanceof we?E.status:500,error:E,url:v,routeId:l})}je(k)}}}let At=1;async function Ke(r,e){const t=new URL(r);t.pathname=r.pathname.replace(/\/$/,"")+Ut,t.searchParams.set("__invalid",e.map(o=>o?"y":"n").join("")),t.searchParams.set("__id",String(At++)),await se(()=>import(t.href),[],import.meta.url);const c=window.__sveltekit_data;return delete window.__sveltekit_data,c}function xe(r,e){var t;return(t=jt.handleError({error:r,event:e}))!=null?t:{message:"Internal Error"}}const Nt=["hash","href","host","hostname","origin","pathname","port","protocol","search","searchParams","toString","toJSON"];function re(r,e){for(const t of Nt)Object.defineProperty(e,t,{get(){throw new Error(`The navigation shape changed - ${r}.${t} should now be ${r}.url.${t}`)}});return e}function ae(){return()=>{}}async function Ct({env:r,hydrate:e,paths:t,target:c,trailing_slash:o}){at(t);const d=It({target:c,base:t.base,trailing_slash:o});st({client:d}),e?await d._hydrate(e):d.goto(location.href,{replaceState:!0}),d._start_router()}export{Ct as start};
static/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1663886403064"}
 
1
+ {"version":"1663890399767"}
static/index.html CHANGED
@@ -8,14 +8,14 @@
8
  <meta http-equiv="content-security-policy" content="">
9
  <link href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/assets/_layout-0243ccbc.css" rel="stylesheet">
10
  <link href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/assets/_page-fd1176fc.css" rel="stylesheet">
11
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/start-ea085781.js">
12
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/index-5559954d.js">
13
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/singletons-30e820d5.js">
14
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/index-3bda1050.js">
15
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/components/pages/_layout.svelte-55da5a4f.js">
16
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/modules/pages/_layout.ts-b8ee4d7c.js">
17
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/_layout-1daba58d.js">
18
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/components/pages/_page.svelte-af06679d.js">
19
  </head>
20
  <body class="dark:bg-[rgb(11,15,25)] bg-white dark:text-white text-black">
21
  <div>
@@ -40,7 +40,7 @@
40
 
41
 
42
  <script type="module" data-sveltekit-hydrate="if2tkf">
43
- import { start } from "/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/start-ea085781.js";
44
 
45
  start({
46
  env: {"PUBLIC_DEV_MODE":"PROD","PUBLIC_WS_ENDPOINT":"wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join"},
 
8
  <meta http-equiv="content-security-policy" content="">
9
  <link href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/assets/_layout-0243ccbc.css" rel="stylesheet">
10
  <link href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/assets/_page-fd1176fc.css" rel="stylesheet">
11
+ <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/start-852e9e2b.js">
12
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/index-5559954d.js">
13
+ <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/singletons-aa6d0232.js">
14
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/index-3bda1050.js">
15
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/components/pages/_layout.svelte-55da5a4f.js">
16
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/modules/pages/_layout.ts-b8ee4d7c.js">
17
  <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/_layout-1daba58d.js">
18
+ <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/components/pages/_page.svelte-bf6d812e.js">
19
  </head>
20
  <body class="dark:bg-[rgb(11,15,25)] bg-white dark:text-white text-black">
21
  <div>
 
40
 
41
 
42
  <script type="module" data-sveltekit-hydrate="if2tkf">
43
+ import { start } from "/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/start-852e9e2b.js";
44
 
45
  start({
46
  env: {"PUBLIC_DEV_MODE":"PROD","PUBLIC_WS_ENDPOINT":"wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join"},
static/vite-manifest.json CHANGED
@@ -1,11 +1,11 @@
1
  {
2
  "node_modules/@sveltejs/kit/src/runtime/client/start.js": {
3
- "file": "_app/immutable/start-ea085781.js",
4
  "src": "node_modules/@sveltejs/kit/src/runtime/client/start.js",
5
  "isEntry": true,
6
  "imports": [
7
  "_index-5559954d.js",
8
- "_singletons-30e820d5.js"
9
  ],
10
  "dynamicImports": [
11
  ".svelte-kit/generated/nodes/0.js",
@@ -25,16 +25,16 @@
25
  ]
26
  },
27
  "node_modules/@sveltejs/kit/src/runtime/components/error.svelte": {
28
- "file": "_app/immutable/components/error.svelte-06141ece.js",
29
  "src": "node_modules/@sveltejs/kit/src/runtime/components/error.svelte",
30
  "isEntry": true,
31
  "imports": [
32
  "_index-5559954d.js",
33
- "_singletons-30e820d5.js"
34
  ]
35
  },
36
  "src/routes/+page.svelte": {
37
- "file": "_app/immutable/components/pages/_page.svelte-af06679d.js",
38
  "src": "src/routes/+page.svelte",
39
  "isEntry": true,
40
  "imports": [
@@ -53,8 +53,8 @@
53
  "__layout-1daba58d.js"
54
  ]
55
  },
56
- "_singletons-30e820d5.js": {
57
- "file": "_app/immutable/chunks/singletons-30e820d5.js",
58
  "imports": [
59
  "_index-3bda1050.js"
60
  ]
@@ -81,7 +81,7 @@
81
  ]
82
  },
83
  ".svelte-kit/generated/nodes/1.js": {
84
- "file": "_app/immutable/chunks/1-dea0ad4d.js",
85
  "src": ".svelte-kit/generated/nodes/1.js",
86
  "isDynamicEntry": true,
87
  "imports": [
@@ -89,7 +89,7 @@
89
  ]
90
  },
91
  ".svelte-kit/generated/nodes/2.js": {
92
- "file": "_app/immutable/chunks/2-41999758.js",
93
  "src": ".svelte-kit/generated/nodes/2.js",
94
  "isDynamicEntry": true,
95
  "imports": [
 
1
  {
2
  "node_modules/@sveltejs/kit/src/runtime/client/start.js": {
3
+ "file": "_app/immutable/start-852e9e2b.js",
4
  "src": "node_modules/@sveltejs/kit/src/runtime/client/start.js",
5
  "isEntry": true,
6
  "imports": [
7
  "_index-5559954d.js",
8
+ "_singletons-aa6d0232.js"
9
  ],
10
  "dynamicImports": [
11
  ".svelte-kit/generated/nodes/0.js",
 
25
  ]
26
  },
27
  "node_modules/@sveltejs/kit/src/runtime/components/error.svelte": {
28
+ "file": "_app/immutable/components/error.svelte-ebe8b925.js",
29
  "src": "node_modules/@sveltejs/kit/src/runtime/components/error.svelte",
30
  "isEntry": true,
31
  "imports": [
32
  "_index-5559954d.js",
33
+ "_singletons-aa6d0232.js"
34
  ]
35
  },
36
  "src/routes/+page.svelte": {
37
+ "file": "_app/immutable/components/pages/_page.svelte-bf6d812e.js",
38
  "src": "src/routes/+page.svelte",
39
  "isEntry": true,
40
  "imports": [
 
53
  "__layout-1daba58d.js"
54
  ]
55
  },
56
+ "_singletons-aa6d0232.js": {
57
+ "file": "_app/immutable/chunks/singletons-aa6d0232.js",
58
  "imports": [
59
  "_index-3bda1050.js"
60
  ]
 
81
  ]
82
  },
83
  ".svelte-kit/generated/nodes/1.js": {
84
+ "file": "_app/immutable/chunks/1-31cf4ccc.js",
85
  "src": ".svelte-kit/generated/nodes/1.js",
86
  "isDynamicEntry": true,
87
  "imports": [
 
89
  ]
90
  },
91
  ".svelte-kit/generated/nodes/2.js": {
92
+ "file": "_app/immutable/chunks/2-41cb5b33.js",
93
  "src": ".svelte-kit/generated/nodes/2.js",
94
  "isDynamicEntry": true,
95
  "imports": [