hypnagaga/docs/assets/preview-71136cce.js
Prasanta Kumar Dutta c523f6e003 build
2023-09-08 17:38:39 +05:30

2 lines
2.1 KiB
JavaScript

import{u as m}from"./stringify-ec884b6d.js";var O="storybook/actions",h=`${O}/action-event`;let c;const D=new Uint8Array(16);function v(){if(!c&&(c=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(D)}const A=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),d={randomUUID:A};function b(t,r,n){if(d.randomUUID&&!r&&!t)return d.randomUUID();t=t||{};const e=t.random||(t.rng||v)();if(e[6]=e[6]&15|64,e[8]=e[8]&63|128,r){n=n||0;for(let o=0;o<16;++o)r[n+o]=e[o];return r}return m(e)}const{addons:R}=__STORYBOOK_MODULE_PREVIEW_API__;var U={depth:10,clearOnStoryChange:!0,limit:50},u=(t,r)=>{let n=Object.getPrototypeOf(t);return!n||r(n)?n:u(n,r)},j=t=>!!(typeof t=="object"&&t&&u(t,r=>/^Synthetic(?:Base)?Event$/.test(r.constructor.name))&&typeof t.persist=="function"),x=t=>{if(j(t)){let r=Object.create(t.constructor.prototype,Object.getOwnPropertyDescriptors(t));r.persist();let n=Object.getOwnPropertyDescriptor(r,"view"),e=n==null?void 0:n.value;return typeof e=="object"&&(e==null?void 0:e.constructor.name)==="Window"&&Object.defineProperty(r,"view",{...n,value:Object.create(e.constructor.prototype)}),r}return t};function y(t,r={}){let n={...U,...r},e=function(...o){let i=R.getChannel(),a=b(),s=5,p=o.map(x),l=o.length>1?p:p[0],f={id:a,count:0,data:{name:t,args:l},options:{...n,maxDepth:s+(n.depth||3),allowFunction:n.allowFunction||!1}};i.emit(h,f)};return e.isAction=!0,e}var g=(t,r)=>typeof r[t]>"u"&&!(t in r),E=t=>{let{initialArgs:r,argTypes:n,parameters:{actions:e}}=t;if(!e||e.disable||!e.argTypesRegex||!n)return{};let o=new RegExp(e.argTypesRegex);return Object.entries(n).filter(([i])=>!!o.test(i)).reduce((i,[a,s])=>(g(a,r)&&(i[a]=y(a)),i),{})},I=t=>{let{initialArgs:r,argTypes:n,parameters:{actions:e}}=t;return e!=null&&e.disable||!n?{}:Object.entries(n).filter(([o,i])=>!!i.action).reduce((o,[i,a])=>(g(i,r)&&(o[i]=y(typeof a.action=="string"?a.action:i)),o),{})},w=[I,E];export{w as argsEnhancers};
//# sourceMappingURL=preview-71136cce.js.map