youtuber-blog-frontend/build/client/_app/immutable/chunks/textarea.DRjWiPsk.js

4 lines
138 KiB
JavaScript
Raw Normal View History

2024-08-25 16:39:31 +00:00
import{K as En,s as me,F as ke,k as $,i as q,E as K,o as ie,y as M,z as Ne,I as Fe,c as te,e as we,d as Ee,f as Pe,D as J,v as ct,w as Z,u as ne,g as re,a as se,x as st,ac as Zn,ad as Vn,n as Be,b as ai,j as oi,V as mr,ai as gs,A as yn,C as ys,t as vs,h as bs,l as ks,ah as Ts,S as Q,p as Ar,a9 as li,aj as Cn,ab as Tn,O as Gt}from"./scheduler.DhJS7lTB.js";import{S as pe,i as _e,g as yt,a as j,e as vt,t as R,c as dt,b as ft,m as ht,d as mt,h as ws,j as Es,k as Or,f as ui}from"./index.CsLdTWKk.js";import{g as ue,a as bt}from"./spread.CgU5AtxT.js";import{m as Ft,h as We,o as Cs,v as Hn,f as wn,l as tr,s as nr,k as Ss,g as Wn,G as Nr,H as ci,p as di,j as Yn,a as Ir,n as Mr,e as fi,I as hi}from"./index.C-lF7DSK.js";import{b as rr,o as As,g as mi,c as pi,u as _i,a as gi,d as pr,f as Ln,r as Os,e as Ns,h as yi}from"./Toaster.svelte_svelte_type_style_lang.DBrjgtAI.js";import{c as he,f as vi}from"./button.C_FZXt9d.js";import{w as oe,d as hn,a as Gn}from"./index.BksXECXn.js";import{e as Sn}from"./each.DOX4E1Ka.js";import{p as Kt,n as Pr}from"./stores.CYmI1CWU.js";import{b as bi,g as ki,i as Ti,a as Kn}from"./entry.CovI40VX.js";import{e as wi}from"./forms.BiMDMPlu.js";const Ei=!0,Is=Ei;function Ci(t){const e=t.slice();return e.sort(Ai),Si(e)}function Si(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length==1&&n.length==1&&e[0].x==n[0].x&&e[0].y==n[0].y?e:e.concat(n)}function Ai(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}function Oi(t){const e=t.getBoundingClientRect();return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.right,y:e.bottom},{x:e.left,y:e.bottom}]}function Ni(t){const e=t.flatMap(n=>Oi(n));return Ci(e)}function Ii(t,e){let n=!1;for(let r=0,s=e.length-1;r<e.length;s=r++){const i=e[r].x,a=e[r].y,o=e[s].x,l=e[s].y;a>t.y!=l>t.y&&t.x<(o-i)*(t.y-a)/(l-a)+i&&(n=!n)}return n}function Mi(){return{elements:{root:Ft("label",{action:e=>({destroy:We(e,"mousedown",r=>{!r.defaultPrevented&&r.detail>1&&r.preventDefault()})})})}}}const Pi={defaultChecked:!1,disabled:!1,required:!1,name:"",value:""},{name:Rr}=Ss("switch");function Ri(t){const e={...Pi,...t},n=rr(Cs(e,"checked")),{disabled:r,required:s,name:i,value:a}=n,o=e.checked??oe(e.defaultChecked),l=As(o,e==null?void 0:e.onCheckedChange);function u(){r.get()||l.update(y=>!y)}const c=Ft(Rr(),{stores:[l,r,s],returned:([y,C,g])=>({"data-disabled":Hn(C),disabled:Hn(C),"data-state":y?"checked":"unchecked",type:"button",role:"switch","aria-checked":y?"true":"false","aria-required":g?"true":void 0}),action(y){return{destroy:wn(We(y,"click",()=>{u()}),We(y,"keydown",g=>{g.key!==tr.ENTER&&g.key!==tr.SPACE||(g.preventDefault(),u())}))}}}),f=Ft(Rr("input"),{stores:[l,i,s,r,a],returned:([y,C,g,L,m])=>({type:"checkbox","aria-hidden":!0,hidden:!0,tabindex:-1,name:C,value:m,checked:y,required:g,disabled:Hn(L),style:nr({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"})})});return{elements:{root:c,input:f},states:{checked:l},options:n}}const ji={positioning:{placement:"bottom"},arrowSize:8,defaultOpen:!1,closeOnPointerDown:!0,openDelay:1e3,closeDelay:0,forceVisible:!1,portal:void 0,closeOnEscape:!0,disableHoverableContent:!1,group:void 0},{name:Jn}=Ss("tooltip"),vn=new Map,Di=["trigger","content"];function Zi(t){const e={...ji,...t},n=rr(Cs(e,"open","ids")),{positioning:r,arrowSize:s,closeOnPointerDown:i,openDelay:a,closeDelay:o,forceVisible:l,portal:u,closeOnEscape:c,disableHoverableContent:f,group:y}=n,C=e.open??oe(e.defaultOpen),g=As(C,e==null?void 0:e.onOpenChange),L=oe(null),m=rr({...mi(Di),...e.ids});let F=!1;const b=E=>Ir?document.getElementById(m[E].get()):null;let T=null,X=null;function P(E){X&&(window.clearTimeout(X),X=null),T||(T=window.setTimeout(()=>{g.set(
`):"";t.setCustomValidity(n),n&&t.reportValidity()}const Xo=(t,e=0)=>{const n=t.getBoundingClientRect();return n.top>=e&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},Qo=(t,e=1.125,n="smooth")=>{const i=t.getBoundingClientRect().top+window.pageYOffset-window.innerHeight/(2*e);window.scrollTo({left:0,top:i,behavior:n})},$o=["checkbox","radio","range","file"];function hs(t){const e=!!t&&(t instanceof HTMLSelectElement||t instanceof HTMLInputElement&&$o.includes(t.type)),n=!!t&&t instanceof HTMLSelectElement&&t.multiple,r=!!t&&t instanceof HTMLInputElement&&t.type=="file";return{immediate:e,multiple:n,file:r}}var Ae;(function(t){t[t.Idle=0]="Idle",t[t.Submitting=1]="Submitting",t[t.Delayed=2]="Delayed",t[t.Timeout=3]="Timeout"})(Ae||(Ae={}));const el=new Set;function tl(t,e,n){let r=Ae.Idle,s,i;const a=el;function o(){l(),c(r!=Ae.Delayed?Ae.Submitting:Ae.Delayed),s=window.setTimeout(()=>{s&&r==Ae.Submitting&&c(Ae.Delayed)},n.delayMs),i=window.setTimeout(()=>{i&&r==Ae.Delayed&&c(Ae.Timeout)},n.timeoutMs),a.add(l)}function l(){clearTimeout(s),clearTimeout(i),s=i=0,a.delete(l),c(Ae.Idle)}function u(){a.forEach(m=>m()),a.clear()}function c(m){r=m,e.submitting.set(r>=Ae.Submitting),e.delayed.set(r>=Ae.Delayed),e.timeout.set(r>=Ae.Timeout)}const f=t;function y(m){const F=m.target;n.selectErrorText&&F.select()}function C(){n.selectErrorText&&f.querySelectorAll("input").forEach(m=>{m.addEventListener("invalid",y)})}function g(){n.selectErrorText&&f.querySelectorAll("input").forEach(m=>m.removeEventListener("invalid",y))}const L=t;{C();const m=F=>{F.clearAll?u():l(),F.cancelled||setTimeout(()=>lr(L,n),1)};return Tn(()=>{g(),m({cancelled:!0})}),{submitting(){o()},completed:m,scrollToFirstError(){setTimeout(()=>lr(L,n),1)},isSubmitting:()=>r===Ae.Submitting||r===Ae.Delayed}}}const lr=async(t,e)=>{if(e.scrollToError=="off")return;const n=e.errorSelector;if(!n)return;await En();let r;if(r=t.querySelector(n),!r)return;r=r.querySelector(n)??r;const s=e.stickyNavbar?document.querySelector(e.stickyNavbar):null;typeof e.scrollToError!="string"?r.scrollIntoView(e.scrollToError):Xo(r,(s==null?void 0:s.offsetHeight)??0)||Qo(r,void 0,e.scrollToError);function i(o){return typeof e.autoFocusOnError=="boolean"?e.autoFocusOnError:!/iPhone|iPad|iPod|Android/i.test(o)}if(!i(navigator.userAgent))return;let a;if(a=r,["INPUT","SELECT","BUTTON","TEXTAREA"].includes(a.tagName)||(a=a.querySelector('input:not([type="hidden"]):not(.flatpickr-input), select, textarea')),a)try{a.focus({preventScroll:!0}),e.selectErrorText&&a.tagName=="INPUT"&&a.select()}catch{}};class Qn extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}}function ms(t){return Object(t)!==t}const nl=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rl(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===nl}function sl(t){return Object.prototype.toString.call(t).slice(8,-1)}function il(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return t<" "?`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function Lt(t){let e="",n=0;const r=t.length;for(let s=0;s<r;s+=1){const i=t[s],a=il(i);a&&(e+=t.slice(n,s)+a,n=s+1)}return`"${n===0?t:e+t.slice(n)}"`}const Ls=-1,al=-2,ol=-3,ll=-4,ul=-5,xs=-6;function cl(t,e){const n=[],r=new Map,s=[];for(const u in e)s.push({key:u,fn:e[u]});const i=[];let a=0;function o(u){if(typeof u=="function")throw new Qn("Cannot stringify a function",i);if(r.has(u))return r.get(u);if(u===void 0)return Ls;if(Number.isNaN(u))return ol;if(u===1/0)return ll;if(u===-1/0)return ul;if(u===0&&1/u<0)return xs;const c=a++;r.set(u,c);for(const{key:y,fn:C}of s){const g=C(u);if(g)return n[c]=`["${y}",${o(g)}]`,c}let f="";if(ms(u))f=$n(u);else switch(sl(u)){case"Number":case"String":case"Boolean":f=`["Object",${$n(u)}]`;break;case"BigInt":f=`["BigInt",${u}]`;break;case"Date":f=`["Date","${!isNaN(u.getDate())?u.toISOString():""}"]`;break;case"RegExp":const{source:g,flags:L}=u;f=L?`["RegExp",${Lt(g)},"${L}"]`:`["RegExp",${Lt(g)}]`;break;case"Array":f="[";for(let m=0;m<u.length;m+=1)m>0&&(f+=","),m in u?(i.push(`[${m}]`),f+=o(u[m]),i.pop()):f+=al;f+="]";break;case"Set":f='["Set"';for(const m of u)f+=`,${o(m)}`;f+="]";break;case"Map":f='["Map"';for(const[m,F]of u)i.push(`.get(${ms(m)?$n(m):"..."})`),f+=`,${o(m)},${o(F)}`,i.pop();f+="]";break;default:if(!rl(u))throw new Qn("Cannot stringify arbitrary non-POJOs",i);if(Object.getOwnPropertySymbols(u).length>0)throw new Qn("Cannot stringify POJOs with symbolic keys",i);if(Object.getPrototypeOf(u)===null){f='["null"';for(const m in u)i.push(`.${m}`),f+=`,${Lt(m)},${o(u[m])}`,i.pop();f+="]"}else{f="{";let m=!1;for(const F in u)m&&(f+=","),m=!0,i.push(`.${F}`),f+=`${Lt(F)}:${o(u[F])}`,i.pop();f+="}"}}return n[c]=f,c}const l=o(t);return l<0?`${l}`:`[${n.join(",")}]`}function $n(t){const e=typeof t;return e==="string"?Lt(t):t instanceof String?Lt(t.toString()):t===void 0?Ls.toString():t===0&&1/t<0?xs.toString():e==="bigint"?`["BigInt","${t}"]`:String(t)}function An(t,e,n){const r=tt(t,e,({parent:s,key:i,value:a})=>(a===void 0&&(s[i]=/\D/.test(i)?{}:[]),s[i]));if(r){const s=n(r.value);r.parent[r.key]=s}return t}function dl(t,e,n){const r=t.form,s=Bt(e),i=hn(r,a=>{const o=tt(a,s);return o==null?void 0:o.value});return{subscribe(...a){const o=i.subscribe(...a);return()=>o()},update(a,o){r.update(l=>An(l,s,a),o??n)},set(a,o){r.update(l=>An(l,s,()=>a),o??n)}}}function fl(t,e){const n="form"in t;if(!n&&(e==null?void 0:e.taint)!==void 0)throw new Te("If options.taint is set, the whole superForm object must be used as a proxy.");return n}function bn(t,e,n){const r=Bt(e);if(fl(t,n))return dl(t,e,n);const s=hn(t,i=>{const a=tt(i,r);return a==null?void 0:a.value});return{subscribe(...i){const a=s.subscribe(...i);return()=>a()},update(i){t.update(a=>An(a,r,i))},set(i){t.update(a=>An(a,r,()=>i))}}}function ur(t){let e={};const n=Array.isArray(t);for(const[r,s]of Object.entries(t))!s||typeof s!="object"||(n?e={...e,...ur(s)}:e[r]=ur(s));return e}const kn=new WeakMap,jt=new WeakMap,Fs=t=>{console.warn("Unhandled error caught by Superforms, use onError event to handle it:",t.result.error)},hl={applyAction:!0,invalidateAll:!0,resetForm:!0,autoFocusOnError:"detect",scrollToError:"smooth",errorSelector:'[aria-invalid="true"],[data-invalid]',selectErrorText:!1,stickyNavbar:void 0,taintedMessage:!1,onSubmit:void 0,onResult:void 0,onUpdate:void 0,onUpdated:void 0,onError:Fs,dataType:"form",validators:void 0,customValidity:!1,clearOnSubmit:"message",delayMs:500,timeoutMs:8e3,multipleSubmits:"prevent",SPA:void 0,validationMethod:"auto"};function ml(t){return`Duplicate form id's found: "${t}". Multiple forms will receive the same data. Use the id option to differentiate between them, or if this is intended, set the warnings.duplicateId option to false in superForm to disable this warning. More information: https://superforms.rocks/concepts/multiple-forms`}let Bs=!1;try