import{c as n,d as t,b as s,D as r,o as e,E as a,p as o,F as i,l,A as c,y as f,G as p,j as m,B as u,e as $,f as g,g as h,h as d,i as b,k as y,m as v,r as k,x,z as w,a1 as j}from"./chunk.82446879.js";import{q as B}from"./chunk.f5a3f321.js";import"./chunk.e8a2e241.js";import{a as P}from"./chunk.4b4ee497.js";import"./chunk.b01e898f.js";import{a as E}from"./chunk.fb378401.js";function M(n,t,s){const r=n.slice();return r[3]=t[s],r[5]=s,r}function I(n){let t;const s=new B({props:{type:n[3],value:n[0][n[5]],duration:200*n[5],max:"100"}});return{c(){r(s.$$.fragment)},l(n){a(s.$$.fragment,n)},m(n,r){i(s,n,r),t=!0},p(n,t){const r={};1&t&&(r.value=n[0][n[5]]),s.$set(r)},i(n){t||(c(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){p(s,n)}}}function R(n){let t,s,u,P,E,R,U,A,D,T,q,z,F,G,N,O,V,C,H,J=n[1],K=[];for(let t=0;t<J.length;t+=1)K[t]=I(M(n,J,t));const L=n=>f(K[n],1,1,()=>{K[n]=null}),Q=new B({props:{max:"100"}});return{c(){t=$("div"),s=$("button"),u=g("Update"),P=e(),E=$("br"),R=e(),U=$("br"),A=e();for(let n=0;n<K.length;n+=1)K[n].c();D=e(),T=$("br"),q=e(),z=$("br"),F=e(),G=$("p"),N=g("Indeterminate (no value)"),O=e(),r(Q.$$.fragment),this.h()},l(n){t=h(n,"DIV",{slot:!0});var r=d(t);s=h(r,"BUTTON",{class:!0});var e=d(s);u=b(e,"Update"),e.forEach(m),P=o(r),E=h(r,"BR",{}),R=o(r),U=h(r,"BR",{}),A=o(r);for(let n=0;n<K.length;n+=1)K[n].l(r);D=o(r),T=h(r,"BR",{}),q=o(r),z=h(r,"BR",{}),F=o(r),G=h(r,"P",{class:!0});var i=d(G);N=b(i,"Indeterminate (no value)"),i.forEach(m),O=o(r),a(Q.$$.fragment,r),r.forEach(m),this.h()},h(){y(s,"class","button is-primary"),y(G,"class","title is-5"),y(t,"slot","preview")},m(r,e){l(r,t,e),v(t,s),v(s,u),v(t,P),v(t,E),v(t,R),v(t,U),v(t,A);for(let n=0;n<K.length;n+=1)K[n].m(t,null);v(t,D),v(t,T),v(t,q),v(t,z),v(t,F),v(t,G),v(G,N),v(t,O),i(Q,t,null),V=!0,C||(H=k(s,"click",n[2]),C=!0)},p(n,s){if(3&s){let r;for(J=n[1],r=0;r<J.length;r+=1){const e=M(n,J,r);K[r]?(K[r].p(e,s),c(K[r],1)):(K[r]=I(e),K[r].c(),c(K[r],1),K[r].m(t,D))}for(x(),r=J.length;r<K.length;r+=1)L(r);w()}},i(n){if(!V){for(let n=0;n<J.length;n+=1)c(K[n]);c(Q.$$.fragment,n),V=!0}},o(n){K=K.filter(Boolean);for(let n=0;n<K.length;n+=1)f(K[n]);f(Q.$$.fragment,n),V=!1},d(n){n&&m(t),j(K,n),p(Q),C=!1,H()}}}function U(n){let t,s;const u=new P({props:{title:"Progress",subtitle:"进度条"}}),$=new E({props:{code:"<script>\n  import { onDestroy, onMount } from 'svelte'\n  import { Progress } from 'svelma-pro'\n  \n  const types = ['is-primary', 'is-success', 'is-danger', 'is-warning', 'is-info', 'is-link']\n  const progresses = Array(6).fill(0)\n  \n  function update() {\n    types.forEach((type, i) => {\n      progresses[i] = Math.floor(Math.random() * 100)\n    })\n  }\n  \n  onMount(() => {\n    update()\n  })\n<\/script>\n\n<button class=\"button is-primary\" on:click={update}>Update</button>\n\n<br />\n<br />\n\n{#each types as type, i}\n  <Progress {type} value={progresses[i]} duration={i * 200} max=\"100\"></Progress>\n{/each}\n\n<br>\n<br>\n\n<p class=\"title is-5\">Indeterminate (no value)</p>\n<Progress max=\"100\"></Progress>",$$slots:{preview:[R]},$$scope:{ctx:n}}});return{c(){r(u.$$.fragment),t=e(),r($.$$.fragment)},l(n){a(u.$$.fragment,n),t=o(n),a($.$$.fragment,n)},m(n,r){i(u,n,r),l(n,t,r),i($,n,r),s=!0},p(n,[t]){const s={};65&t&&(s.$$scope={dirty:t,ctx:n}),$.$set(s)},i(n){s||(c(u.$$.fragment,n),c($.$$.fragment,n),s=!0)},o(n){f(u.$$.fragment,n),f($.$$.fragment,n),s=!1},d(n){p(u,n),n&&m(t),p($,n)}}}function A(n,t,s){const r=["is-primary","is-success","is-danger","is-warning","is-info","is-link"],e=Array(6).fill(0);function a(){r.forEach((n,t)=>{s(0,e[t]=Math.floor(100*Math.random()),e)})}return u(()=>{a()}),[e,r,a]}export default class extends n{constructor(n){super(),t(this,n,A,U,s,{})}}
//# sourceMappingURL=progress.4e9860c8.js.map
