nn-ui / build /client /_app /immutable /chunks /ModalPromptEditor.iom6fo2m.js
muryshev's picture
build update
1fe88b1
import{w as C}from"./index.30gxcYBv.js";import{s as D,g as O,b as S,e as p,t as _,c as b,d as g,f as T,h as k,j as E,i as f,p as v,q as I,k as m,l as h,u as M,v as w,m as z,n as A,r as U}from"./scheduler.6mUjRlUu.js";import{S as x,i as N}from"./index.ywQurLbC.js";const P={message:"Missing Toast Message",autohide:!0,timeout:5e3},q="toastStore";function X(){const i=O(q);if(!i)throw new Error("toastStore is not initialized. Please ensure that `initializeStores()` is invoked in the root layout file of this app!");return i}function Y(){const i=j();return D(q,i)}function R(){const i=Math.random();return Number(i).toString(32)}function j(){const{subscribe:i,set:n,update:l}=C([]),u=e=>l(t=>{if(t.length>0){const a=t.findIndex(d=>d.id===e),s=t[a];s&&(s.callback&&s.callback({id:e,status:"closed"}),s.timeoutId&&clearTimeout(s.timeoutId),t.splice(a,1))}return t});function c(e){if(e.autohide===!0)return setTimeout(()=>{u(e.id)},e.timeout)}return{subscribe:i,close:u,trigger:e=>{const t=R();return l(a=>{e&&e.callback&&e.callback({id:t,status:"queued"}),e.hideDismiss&&(e.autohide=!0);const s={...P,...e,id:t};return s.timeoutId=c(s),a.push(s),a}),t},freeze:e=>l(t=>(t.length>0&&clearTimeout(t[e].timeoutId),t)),unfreeze:e=>l(t=>(t.length>0&&(t[e].timeoutId=c(t[e])),t)),clear:()=>n([])}}function y(i){let n,l=i[2]?"Скрыть":"Показать",u,c,e,t,a,s,d;return{c(){n=p("button"),u=_(l),c=b(),e=_(i[1]),t=b(),a=p("textarea"),this.h()},l(o){n=g(o,"BUTTON",{class:!0});var r=T(n);u=k(r,l),c=E(r),e=k(r,i[1]),r.forEach(f),t=E(o),a=g(o,"TEXTAREA",{class:!0}),T(a).forEach(f),this.h()},h(){v(n,"class","btn variant-outline-tertiary"),v(a,"class","w-full min-h-96 variant-filled"),I(a,"hidden",!i[2])},m(o,r){m(o,n,r),h(n,u),h(n,c),h(n,e),m(o,t,r),m(o,a,r),M(a,i[0]),s||(d=[w(n,"click",i[3]),w(a,"input",i[4])],s=!0)},p(o,[r]){r&4&&l!==(l=o[2]?"Скрыть":"Показать")&&z(u,l),r&2&&z(e,o[1]),r&1&&M(a,o[0]),r&4&&I(a,"hidden",!o[2])},i:A,o:A,d(o){o&&(f(n),f(t),f(a)),s=!1,U(d)}}}function B(i,n,l){let{prompt:u}=n,{label:c}=n,e=!1;const t=()=>{l(2,e=!e)};function a(){u=this.value,l(0,u)}return i.$$set=s=>{"prompt"in s&&l(0,u=s.prompt),"label"in s&&l(1,c=s.label)},[u,c,e,t,a]}class F extends x{constructor(n){super(),N(this,n,B,y,S,{prompt:0,label:1})}}export{F as M,X as g,Y as i};