@knapsack/core 4.70.5--canary.4921.a127e88.0 → 4.70.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -2,8 +2,8 @@ import * as r from 'superstruct';
2
2
  import { define, union, type, literal, string, object, enums, number, optional, size, array, boolean, defaulted, record, assign } from 'superstruct';
3
3
  import { expectType, isObject, isObjKey, isUrl, parseNumberWithUnit } from '@knapsack/utils';
4
4
 
5
- var Ft=Object.create;var be=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty;var s=(e,t)=>be(e,"name",{value:t,configurable:!0});var ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Wt=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bt(t))!Lt.call(e,o)&&o!==n&&be(e,o,{get:()=>t[o],enumerable:!(a=Kt(t,o))||a.enumerable});return e};var $t=(e,t,n)=>(n=e!=null?Ft(Ut(e)):{},Wt(be(n,"default",{value:e,enumerable:!0}),e));var Me=ne((Mn,Oe)=>{Oe.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};});var Fe=ne((zn,ze)=>{ze.exports=s(function(t){return !t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},"isArrayish");});var Ue=ne((Kn,Be)=>{var Ht=Fe(),jt=Array.prototype.concat,Gt=Array.prototype.slice,Ke=Be.exports=s(function(t){for(var n=[],a=0,o=t.length;a<o;a++){var d=t[a];Ht(d)?n=jt.call(n,Gt.call(d)):n.push(d);}return n},"swizzle");Ke.wrap=function(e){return function(){return e(Ke(arguments))}};});var He=ne((Un,$e)=>{var G=Me(),J=Ue(),Le=Object.hasOwnProperty,We=Object.create(null);for(ae in G)Le.call(G,ae)&&(We[G[ae]]=ae);var ae,_=$e.exports={to:{},get:{}};_.get=function(e){var t=e.substring(0,3).toLowerCase(),n,a;switch(t){case"hsl":n=_.get.hsl(e),a="hsl";break;case"hwb":n=_.get.hwb(e),a="hwb";break;default:n=_.get.rgb(e),a="rgb";break}return n?{model:a,value:n}:null};_.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,d=/^(\w+)$/,c=[0,0,0,1],l,p,E;if(l=e.match(n)){for(E=l[2],l=l[1],p=0;p<3;p++){var re=p*2;c[p]=parseInt(l.slice(re,re+2),16);}E&&(c[3]=parseInt(E,16)/255);}else if(l=e.match(t)){for(l=l[1],E=l[3],p=0;p<3;p++)c[p]=parseInt(l[p]+l[p],16);E&&(c[3]=parseInt(E+E,16)/255);}else if(l=e.match(a)){for(p=0;p<3;p++)c[p]=parseInt(l[p+1],0);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else if(l=e.match(o)){for(p=0;p<3;p++)c[p]=Math.round(parseFloat(l[p+1])*2.55);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else return (l=e.match(d))?l[1]==="transparent"?[0,0,0,0]:Le.call(G,l[1])?(c=G[l[1]],c[3]=1,c):null:null;for(p=0;p<3;p++)c[p]=O(c[p],0,255);return c[3]=O(c[3],0,1),c};_.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.to.hex=function(){var e=J(arguments);return "#"+ie(e[0])+ie(e[1])+ie(e[2])+(e[3]<1?ie(Math.round(e[3]*255)):"")};_.to.rgb=function(){var e=J(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};_.to.rgb.percent=function(){var e=J(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+a+"%)":"rgba("+t+"%, "+n+"%, "+a+"%, "+e[3]+")"};_.to.hsl=function(){var e=J(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};_.to.hwb=function(){var e=J(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};_.to.keyword=function(e){return We[e.slice(0,3)]};function O(e,t,n){return Math.min(Math.max(t,e),n)}s(O,"clamp");function ie(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s(ie,"hexDouble");});var it=$t(He());var Ye=Symbol.for("immer-nothing"),je=Symbol.for("immer-draftable"),C=Symbol.for("immer-state"),Jt=process.env.NODE_ENV!=="production"?[function(e){return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return `'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return `'original' expects a draft, got: ${e}`}]:[];function v(e,...t){if(process.env.NODE_ENV!=="production"){let n=Jt[e],a=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${a}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}s(v,"die");var W=Object.getPrototypeOf;function M(e){return !!e&&!!e[C]}s(M,"isDraft");function K(e){return e?Qe(e)||Array.isArray(e)||!!e[je]||!!e.constructor?.[je]||ce(e)||de(e):!1}s(K,"isDraftable");var Xt=Object.prototype.constructor.toString();function Qe(e){if(!e||typeof e!="object")return !1;let t=W(e);if(t===null)return !0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Xt}s(Qe,"isPlainObject");function se(e,t){ue(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e);}):e.forEach((n,a)=>t(a,n,e));}s(se,"each");function ue(e){let t=e[C];return t?t.type_:Array.isArray(e)?1:ce(e)?2:de(e)?3:0}s(ue,"getArchtype");function Se(e,t){return ue(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}s(Se,"has");function Ze(e,t,n){let a=ue(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n;}s(Ze,"set");function qt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}s(qt,"is");function ce(e){return e instanceof Map}s(ce,"isMap");function de(e){return e instanceof Set}s(de,"isSet");function F(e){return e.copy_||e.base_}s(F,"latest");function _e(e,t){if(ce(e))return new Map(e);if(de(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Qe(e);if(t===!0||t==="class_only"&&!n){let a=Object.getOwnPropertyDescriptors(e);delete a[C];let o=Reflect.ownKeys(a);for(let d=0;d<o.length;d++){let c=o[d],l=a[c];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(a[c]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[c]});}return Object.create(W(e),a)}else {let a=W(e);if(a!==null&&n)return {...e};let o=Object.create(a);return Object.assign(o,e)}}s(_e,"shallowCopy");function Ae(e,t=!1){return pe(e)||M(e)||!K(e)||(ue(e)>1&&(e.set=e.add=e.clear=e.delete=Yt),Object.freeze(e),t&&Object.entries(e).forEach(([n,a])=>Ae(a,!0))),e}s(Ae,"freeze");function Yt(){v(2);}s(Yt,"dontMutateFrozenCollections");function pe(e){return Object.isFrozen(e)}s(pe,"isFrozen");var Qt={};function B(e){let t=Qt[e];return t||v(0,e),t}s(B,"getPlugin");var X;function et(){return X}s(et,"getCurrentScope");function Zt(e,t){return {drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}s(Zt,"createScope");function Ge(e,t){t&&(B("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t);}s(Ge,"usePatchesInScope");function Ce(e){we(e),e.drafts_.forEach(er),e.drafts_=null;}s(Ce,"revokeScope");function we(e){e===X&&(X=e.parent_);}s(we,"leaveScope");function Je(e){return X=Zt(X,e)}s(Je,"enterScope");function er(e){let t=e[C];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0;}s(er,"revokeDraft");function Xe(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[C].modified_&&(Ce(t),v(4)),K(e)&&(e=oe(t,e),t.parent_||le(t,e)),t.patches_&&B("Patches").generateReplacementPatches_(n[C].base_,e,t.patches_,t.inversePatches_)):e=oe(t,n,[]),Ce(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ye?e:void 0}s(Xe,"processResult");function oe(e,t,n){if(pe(t))return t;let a=t[C];if(!a)return se(t,(o,d)=>qe(e,a,t,o,d,n)),t;if(a.scope_!==e)return t;if(!a.modified_)return le(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let o=a.copy_,d=o,c=!1;a.type_===3&&(d=new Set(o),o.clear(),c=!0),se(d,(l,p)=>qe(e,a,o,l,p,n,c)),le(e,o,!1),n&&e.patches_&&B("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_);}return a.copy_}s(oe,"finalize");function qe(e,t,n,a,o,d,c){if(process.env.NODE_ENV!=="production"&&o===n&&v(5),M(o)){let l=d&&t&&t.type_!==3&&!Se(t.assigned_,a)?d.concat(a):void 0,p=oe(e,o,l);if(Ze(n,a,p),M(p))e.canAutoFreeze_=!1;else return}else c&&n.add(o);if(K(o)&&!pe(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;oe(e,o),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,a)&&le(e,o);}}s(qe,"finalizeProperty");function le(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ae(t,n);}s(le,"maybeFreeze");function tr(e,t){let n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:et(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=a,d=Ee;n&&(o=[a],d=q);let{revoke:c,proxy:l}=Proxy.revocable(o,d);return a.draft_=l,a.revoke_=c,l}s(tr,"createProxyProxy");var Ee={get(e,t){if(t===C)return e;let n=F(e);if(!Se(n,t))return rr(e,n,t);let a=n[t];return e.finalized_||!K(a)?a:a===ve(e.base_,t)?(ke(e),e.copy_[t]=xe(a,e)):a},has(e,t){return t in F(e)},ownKeys(e){return Reflect.ownKeys(F(e))},set(e,t,n){let a=tt(F(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){let o=ve(F(e),t),d=o?.[C];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(qt(n,o)&&(n!==void 0||Se(e.base_,t)))return !0;ke(e),Te(e);}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ve(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ke(e),Te(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=F(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){v(11);},getPrototypeOf(e){return W(e.base_)},setPrototypeOf(){v(12);}},q={};se(Ee,(e,t)=>{q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};});q.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&v(13),q.set.call(this,e,t,void 0)};q.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&v(14),Ee.set.call(this,e[0],t,n,e[0])};function ve(e,t){let n=e[C];return (n?F(n):e)[t]}s(ve,"peek");function rr(e,t,n){let a=tt(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}s(rr,"readPropFromProto");function tt(e,t){if(!(t in e))return;let n=W(e);for(;n;){let a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=W(n);}}s(tt,"getDescriptorFromProto");function Te(e){e.modified_||(e.modified_=!0,e.parent_&&Te(e.parent_));}s(Te,"markChanged");function ke(e){e.copy_||(e.copy_=_e(e.base_,e.scope_.immer_.useStrictShallowCopy_));}s(ke,"prepareCopy");var nr=class{static{s(this,"Immer2");}constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){let d=n;n=t;let c=this;return s(function(p=d,...E){return c.produce(p,re=>n.call(this,re,...E))},"curriedProduce")}typeof n!="function"&&v(6),a!==void 0&&typeof a!="function"&&v(7);let o;if(K(t)){let d=Je(this),c=xe(t,void 0),l=!0;try{o=n(c),l=!1;}finally{l?Ce(d):we(d);}return Ge(d,a),Xe(o,d)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Ye&&(o=void 0),this.autoFreeze_&&Ae(o,!0),a){let d=[],c=[];B("Patches").generateReplacementPatches_(t,o,d,c),a(d,c);}return o}else v(1,t);},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return (c,...l)=>this.produceWithPatches(c,p=>t(p,...l));let a,o;return [this.produce(t,n,(c,l)=>{a=c,o=l;}),a,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy);}createDraft(e){K(e)||v(8),M(e)&&(e=ar(e));let t=Je(this),n=xe(e,void 0);return n[C].isManual_=!0,we(t),n}finishDraft(e,t){let n=e&&e[C];(!n||!n.isManual_)&&v(9);let{scope_:a}=n;return Ge(a,t),Xe(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e;}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e;}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let a=B("Patches").applyPatches_;return M(e)?a(e,t):this.produce(e,o=>a(o,t))}};function xe(e,t){let n=ce(e)?B("MapSet").proxyMap_(e,t):de(e)?B("MapSet").proxySet_(e,t):tr(e,t);return (t?t.scope_:et()).drafts_.push(n),n}s(xe,"createProxy");function ar(e){return M(e)||v(10,e),rt(e)}s(ar,"current");function rt(e){if(!K(e)||pe(e))return e;let t=e[C],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_e(e,t.scope_.immer_.useStrictShallowCopy_);}else n=_e(e,!0);return se(n,(a,o)=>{Ze(n,a,rt(o));}),t&&(t.finalized_=!1),n}s(rt,"currentImpl");var w=new nr;w.produceWithPatches.bind(w);w.setAutoFreeze.bind(w);w.setUseStrictShallowCopy.bind(w);w.applyPatches.bind(w);w.createDraft.bind(w);w.finishDraft.bind(w);var or=Object.defineProperty,u=s((e,t)=>or(e,"name",{value:t,configurable:!0}),"n");function st(e){if(typeof e!="string")return !1;try{return !!it.default.get(e)}catch{return !1}}s(st,"Ne");u(st,"isColor");var ye=define("ColorStringStruct",e=>typeof e=="string"&&st(e)),m=union([type({type:literal("value"),colorValue:ye}),type({type:literal("design-token"),tokenName:string()})]);type({type:literal("design-token"),tokenName:string()});var nt=object({unit:enums(["rem","px"]),value:number()}),at=union([string(),number()]),lr=(e=>(e.woff2="woff2",e.woff="woff",e))(lr||{}),ur=enums(["woff2","woff"]),cr=type({format:ur,type:literal("url"),path:string()}),ee=type({family:optional(string()),weight:optional(union([at,size(array(at),2)])),src:optional(array(cr)),style:optional(string()),display:optional(enums(["auto","block","swap","fallback","optional"])),variationSettings:optional(string()),unicodeRange:optional(string())}),dr=(e=>(e.inherit="As typed",e.capitalize="Capitalize",e.lowercase="Lowercase",e.uppercase="Uppercase",e))(dr||{}),pr=(e=>(e["ultra-condensed"]="Ultra-condensed",e["extra-condensed"]="Extra-condensed",e.condensed="Condensed",e["semi-condensed"]="Semi-condensed",e.normal="Normal",e["semi-expanded"]="Semi-expanded",e.expanded="Expanded",e["extra-expanded"]="Extra-expanded",e["ultra-expanded"]="Ultra-expanded",e))(pr||{}),te=type({fontWeight:optional(union([string(),number()])),textColor:optional(m),hoverColor:optional(m),underline:optional(boolean()),textTransform:optional(enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:optional(enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))}),fr=type({min:nt,max:optional(nt)}),f=type({fontSize:optional(fr),lineHeight:optional(union([string(),number()])),fontWeight:optional(union([string(),number()])),letterSpacing:optional(string()),fontFamily:optional(string()),textColor:optional(m),textTransform:optional(enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:optional(enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))});var j=union([f,type({accentColor:optional(m)})]),ge=union([j,type({hoverColor:optional(m),backgroundColor:optional(m)})]),me=union([j,type({backgroundColor:optional(m)})]);object({version:literal(1),oldSillySidebarBgColor:ye});object({version:literal(2),anotherSillySidebarBgColor:ye});object({version:literal(3),sidebarBgColor:ye});object({version:literal(4),primaryColor:m,darkColor:m,lightColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0))});object({version:literal(5),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0))});object({version:literal(6),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0)),appearance:type({customFonts:optional(array(ee)),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(7),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0)),appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(j)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(8),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(j)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(9),appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(j)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(10),appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(j)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingXLarge:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),headingXSmall:optional(f),bodyText:optional(f),link:optional(te)})})});function ot(e){return typeof e!="string"?!1:e.split("{").length-1===1&&e.startsWith("{")&&e.endsWith("}")}s(ot,"He");u(ot,"isTokenReference");function R(e){return typeof e=="string"&&e.includes("{")}s(R,"x");u(R,"hasTokenReferences");function lt(e){return !ot(e)}s(lt,"Je");u(lt,"isNotTokenReference");var h=r.define("Token Reference",e=>typeof e!="string"?!1:lt(e)?"Must start and end with curly braces":!0),yr={border:"border",shadow:"shadow",transition:"transition"},gr=Object.values(yr),mr={string:"string",number:"number",boolean:"boolean",color:"color",dimension:"dimension",duration:"duration",fontWeight:"fontWeight",strokeStyle:"strokeStyle",cubicBezier:"cubicBezier"},hr=Object.values(mr);function Ve(e){return gr.includes(e)}s(Ve,"J");u(Ve,"isTokenTypeComposite");function ut(e){return hr.includes(e)}s(ut,"de");u(ut,"isTokenTypeSingular");expectType([{inset:!1,color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px"},{color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px",inset:!0}]);var b=r.type({id:r.string(),description:r.optional(r.string()),references:r.optional(r.array(r.array(r.string()))),tokenConfig:r.optional(r.type({purpose:r.optional(r.string())}))});expectType([{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"static"},{type:"duration",value:"1ms",kind:"ref",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"ref"},{type:"duration",value:"1ms",kind:"static",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"color",value:"#000",kind:"static",id:"1",originalValue:"#000"},{type:"color",value:"#000",kind:"ref",id:"1",originalValue:"{c.b}",referencedTokenId:"c.b"},{type:"cubicBezier",kind:"static",value:[0,0,0,1],originalValue:[0,0,0,1],id:"1"}]);function br(e){return Ve(e.type)}s(br,"un");u(br,"isTokenDataComposite");expectType([{type:"border",kind:"static",id:"1",value:{color:"#000",style:"solid",width:"1px"},originalValue:{color:"#000",style:"solid",width:"1px"}},{type:"border",kind:"ref",referencedTokenId:"a.b",id:"1",value:{color:"red",style:"dashed",width:"2px"},originalValue:"{a.b}"},{type:"shadow",value:{color:"#000",offsetX:"1px",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},originalValue:{color:"#000",offsetX:"{a.a}",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},id:"1",kind:"static"},{type:"shadow",kind:"ref",referencedTokenId:"a.b",value:{inset:!0,color:"red",offsetX:"1px",blur:"2px",offsetY:"3px",spread:"4px"},originalValue:"{a.b}",id:"1"},{type:"transition",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:"{a.b}",kind:"ref",referencedTokenId:"a.b",id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"{a.c}",timingFunction:"{a.c}"},id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},id:"1"}]);function ct(e){return typeof e=="string"&&!R(e)}s(ct,"et");u(ct,"isTokenValueColor");var $=r.define("Color Value",e=>typeof e!="string"?"Value must be a string":e===""?"Value must not be empty":R(e)?"Value must not contain {} (token references)":!0),vr=r.assign(r.type({type:r.literal("color"),value:$,kind:r.literal("static"),originalValue:$}),b),kr=r.assign(r.type({type:r.literal("color"),value:$,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function Y(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("rem"))&&!R(e)}s(Y,"Y");u(Y,"isTokenValueDimension");var D=r.define("Dimension Value",e=>typeof e!="string"?"Value must be a string":R(e)?"Value must not contain {} (token references)":!e.endsWith("px")&&!e.endsWith("rem")&&!e.endsWith("em")&&!e.endsWith("%")?"Value must end with px, rem, em or %":!0),Sr=r.assign(r.type({type:r.literal("dimension"),value:D,kind:r.literal("static"),originalValue:D}),b),_r=r.assign(r.type({type:r.literal("dimension"),value:D,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function Cr(e){return typeof e=="string"&&e.endsWith("ms")&&!R(e)}s(Cr,"gn");u(Cr,"isTokenValueDuration");var L=r.define("Duration Value",e=>typeof e!="string"?"Value must be a string":R(e)?"Value must not contain {} (token references)":/^\d+ms$/.test(e)?!0:'Value must be a number followed by "ms" (e.g., "100ms")'),wr=r.assign(r.type({type:r.literal("duration"),value:L,kind:r.literal("static"),originalValue:L}),b),Tr=r.assign(r.type({type:r.literal("duration"),value:L,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function xr(e){return (typeof e=="string"||typeof e=="number")&&!R(e)}s(xr,"fn");u(xr,"isTokenValueFontWeight");var De=r.define("Font Weight Value",e=>typeof e!="string"&&typeof e!="number"?"Value must be a string or number":R(e)?"Value must not contain {} (token references)":!0),Ar=r.assign(r.type({type:r.literal("fontWeight"),value:De,kind:r.literal("static"),originalValue:De}),b),Er=r.assign(r.type({type:r.literal("fontWeight"),value:De,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Q=r.define("Cubic Bezier Value",e=>Array.isArray(e)?e.length!==4||!e.every(t=>typeof t=="number")?"Value must be an array of 4 numbers":e[0]<0||e[0]>1||e[2]<0||e[2]>1?"The first and third cubicBezier values must be between 0 and 1":!0:"Value must be an array"),Dr=r.assign(r.type({type:r.literal("cubicBezier"),value:Q,kind:r.literal("static"),originalValue:Q}),b),Nr=r.assign(r.type({type:r.literal("cubicBezier"),value:Q,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function dt(e){return isObject(e)&&ct(e.color)&&Y(e.offsetX)&&Y(e.offsetY)&&Y(e.blur)&&Y(e.spread)}s(dt,"ut");u(dt,"isTokenValueShadow");var pt=r.define("Shadow Value",e=>dt(e)?!0:`Expected a shadow value, got ${JSON.stringify(e)}`),Vr=r.assign(r.type({type:r.literal("shadow"),value:pt,kind:r.literal("static"),originalValue:r.type({color:r.union([$,h]),offsetX:r.union([D,h]),offsetY:r.union([D,h]),blur:r.union([D,h]),spread:r.union([D,h]),inset:r.union([r.optional(r.boolean()),h])})}),b),Pr=r.assign(r.type({type:r.literal("shadow"),value:pt,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),H=r.union([r.literal("solid"),r.literal("dashed"),r.literal("dotted"),r.literal("double"),r.literal("groove"),r.literal("ridge"),r.literal("outset"),r.literal("inset")]);function ft(e){return isObject(e)&&$.is(e.color)&&H.is(e.style)&&D.is(e.width)}s(ft,"mt");u(ft,"isTokenValueBorder");var yt=r.define("Border Value",ft),Rr=r.assign(r.type({type:r.literal("border"),value:yt,kind:r.literal("static"),originalValue:r.type({color:r.union([$,h]),style:r.union([H,h]),width:r.union([D,h])})}),b),Ir=r.assign(r.type({type:r.literal("border"),value:yt,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function gt(e){return isObject(e)&&Q.is(e.timingFunction)&&L.is(e.duration)&&L.is(e.delay)}s(gt,"kt");u(gt,"isTokenValueTransition");var mt=r.define("Transition Value",gt),Or=r.assign(r.type({type:r.literal("transition"),value:mt,kind:r.literal("static"),originalValue:r.type({timingFunction:r.union([Q,h]),duration:r.union([L,h]),delay:r.union([L,h])})}),b),Mr=r.assign(r.type({type:r.literal("transition"),value:mt,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),zr=r.assign(r.type({type:r.literal("string"),value:r.string(),kind:r.literal("static"),originalValue:r.string()}),b),Fr=r.assign(r.type({type:r.literal("string"),value:r.string(),kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Kr=r.assign(r.type({type:r.literal("strokeStyle"),value:H,kind:r.literal("static"),originalValue:H}),b),Br=r.assign(r.type({type:r.literal("strokeStyle"),value:H,kind:r.literal("ref"),originalValue:h,referencedTokenId:H}),b),Ur=r.assign(r.type({type:r.literal("number"),value:r.number(),kind:r.literal("static"),originalValue:r.number()}),b),Lr=r.assign(r.type({type:r.literal("number"),value:r.number(),kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Wr=r.assign(r.type({type:r.literal("boolean"),value:r.boolean(),kind:r.literal("static"),originalValue:r.boolean()}),b),$r=r.assign(r.type({type:r.literal("boolean"),value:r.boolean(),kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);u(e=>{if(!isObject(e))throw new Error(`Expected token data to be an object, got ${JSON.stringify(e)}`);if(!isObjKey("type",e))throw new Error(`Expected token data to have a "type" property, got ${JSON.stringify(e)}`);if(typeof e.type!="string")throw new Error(`Expected token data "type" property to be a string, got ${JSON.stringify(e)}`);let t=e.type,n=e.kind;try{switch(t){case"boolean":n==="ref"?$r.assert(e):Wr.assert(e);return;case"border":n==="ref"?Ir.assert(e):Rr.assert(e);return;case"color":n==="ref"?kr.assert(e):vr.assert(e);return;case"cubicBezier":n==="ref"?Nr.assert(e):Dr.assert(e);return;case"dimension":n==="ref"?_r.assert(e):Sr.assert(e);return;case"duration":n==="ref"?Tr.assert(e):wr.assert(e);return;case"fontWeight":n==="ref"?Er.assert(e):Ar.assert(e);return;case"number":n==="ref"?Lr.assert(e):Ur.assert(e);return;case"shadow":n==="ref"?Pr.assert(e):Vr.assert(e);return;case"string":n==="ref"?Fr.assert(e):zr.assert(e);return;case"strokeStyle":n==="ref"?Br.assert(e):Kr.assert(e);return;case"transition":n==="ref"?Mr.assert(e):Or.assert(e);return;default:throw new Error(`Unknown token data type: ${t}`)}}catch(a){throw a instanceof r.StructError?new Error(`Invalid token data for type "${t}": ${a.message}. Received this data: "${JSON.stringify(e)}"`):a}},"assertTokenData");expectType([{type:"dimension",kind:"static",value:"1px"},{type:"dimension",kind:"ref",referencedTokenId:"a.b"}]);expectType([{type:"border",kind:"ref",referencedTokenId:"a.b"},{type:"border",kind:"static",value:{color:{kind:"static",type:"color",value:"red"},style:{kind:"ref",type:"strokeStyle",referencedTokenId:""},width:{kind:"static",type:"dimension",value:"2px"}}}]);expectType([{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function Hr(e){return ut(e?.type)}s(Hr,"Dn");u(Hr,"isTokenSrcValueInfoSingular");function jr(e){return Ve(e?.type)}s(jr,"hn");u(jr,"isTokenSrcValueInfoComposite");expectType([{type:"dimension",kind:"static",value:"1px"},{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"ref",value:"1px"},{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function ht(e){return isObject(e)&&isObjKey("cloud.knapsack",e)}s(ht,"Rt");u(ht,"isTokenSrcExtensions");expectType(["#ddd",!0,[83,1,1,1],{color:"#000",style:"solid",width:"1px"},{inset:!0,color:"#000",offsetX:"0px",offsetY:"{spacing.medium}",spread:"0px",blur:"0px"},{timingFunction:"{timing.ease}",duration:"{timing.duration.medium}",delay:"7ms",color:"#000"}]);function Gr(e){return !!(isObject(e)&&isObjKey("$value",e))}s(Gr,"Rn");u(Gr,"isTokenSrc");function bt(e){return isObject(e)&&!ht(e)&&!isObjKey("$value",e)&&!isObjKey("cloud.knapsack",e)}s(bt,"Bt");u(bt,"isTokenGroup");function Jr(e){if(bt(e)){let t=e.$extensions["cloud.knapsack"].group.collectionInfo;if(isObjKey("type",t)&&isObjKey("referenceId",t))return !0}return !1}s(Jr,"Bn");u(Jr,"isTokenTypeVarRef");function Xr(e){let t=typeof e;if(t==="string"||t==="number"||t==="boolean")return t;throw new Error(`Invalid token value type: ${JSON.stringify(t)}. Token value is: ${JSON.stringify(e)}`)}s(Xr,"An");u(Xr,"getPrimitiveValue");u(e=>e.includes("px")||e.includes("rem")||e.includes("em")||e.includes("%"),"isDimensionString");function qr(e){let{value:t,unit:n}=parseNumberWithUnit(e);if(!n)return {value:t};if(n!=="px"&&n!=="rem"&&n!=="em"&&n!=="%")throw new Error(`Invalid unit "${n}" for value: ${t}`);return {value:t,unit:n}}s(qr,"Kn");u(qr,"parseTokenDimensionValue");u(e=>isObject(e)&&e.type==="text","isSlottedText");function Yr(e){return isObject(e)&&e.type==="template-demo"}s(Yr,"jn");u(Yr,"isSlottedTemplateDemo");function Qr(e){return isObject(e)&&e.type==="template-reference"}s(Qr,"Wn");u(Qr,"isSlottedTemplateReference");var Zr=(e=>(e.portrait="portrait",e.landscape="landscape",e))(Zr||{});function en(e){return e?.type==="data"}s(en,"_n");u(en,"isDataDemo");function tn(e){return e?.type==="template"}s(tn,"Ln");u(tn,"isTemplateDemo");var rn=(e=>(e.auto="auto",e.small="small",e.medium="medium",e.large="large",e.full="full",e))(rn||{});function vt(e){return !isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","db"].every(t=>isObjKey(t,e))?!1:!isObjKey("metaState",e)}s(vt,"At");u(vt,"isKsAppClientDataNoMeta");define("KsAppClientDataNoMeta",vt);function kt(e){return isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","metaState","db"].every(t=>isObjKey(t,e)):!1}s(kt,"Ot");u(kt,"isKsAppClientDataAndMeta");define("KsAppClientDataAndMeta",kt);type({isLocalDev:boolean(),plugins:array(type({id:string(),hasContent:boolean(),clientPluginPath:optional(string()),cssPath:optional(string())})),meta:optional(type({version:optional(string()),hasKnapsackCloud:boolean(),knapsackCloudSiteId:optional(string()),serverPort:optional(number()),websocketsPort:optional(number()),https:optional(boolean()),cacheDir:optional(string()),ksVersions:type({app:string()})}))});function St(e){return !isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState"].every(t=>isObjKey(t,e))?!1:!isObjKey("metaState",e)}s(St,"Ut");u(St,"isKsAppClientDataNoMetaV3");define("KsAppClientDataNoMeta",St);function _t(e){return isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState","metaState"].every(t=>isObjKey(t,e)):!1}s(_t,"zt");u(_t,"isKsAppClientDataAndMetaV3");define("KsAppClientDataAndMeta",_t);type({isLocalDev:boolean(),plugins:array(type({id:string(),hasContent:boolean(),clientPluginPath:optional(string()),cssPath:optional(string())})),meta:optional(type({version:optional(string()),hasKnapsackCloud:boolean(),knapsackCloudSiteId:optional(string()),serverPort:optional(number()),websocketsPort:optional(number()),https:optional(boolean()),cacheDir:optional(string()),ksVersions:type({app:string()})}))});({version:"4.1.7",checkIfNeeded:u(e=>!0,"checkIfNeeded"),migrate:u(e=>{if(!M(e))throw new Error("Tried to run migrations on appClientData but it is not an Immer Draft");Object.values(e.patternsState.patterns).forEach(t=>{delete t.demoSize;}),Object.values(e.db.demos.byId).forEach(t=>{t.type==="data"&&(Object.entries(t.data.slots??{}).forEach(([n,a])=>{t.data.slots[n]=a.map(o=>typeof o=="string"?{type:"text",text:o}:(o.type==="template-reference"||o.type==="text"||(o.type="template-demo"),o));}),!(t.patternId&&t.templateId)&&(()=>{for(let{id:n,templates:a=[]}of Object.values(e.patternsState.patterns))for(let{id:o,demoIds:d=[]}of a)if(d.includes(t.id)){t.patternId=n,t.templateId=o;return}})());});},"migrate")});var sn=(e=>(e.string="string",e.boolean="boolean",e.number="number",e.object="object",e.options="options",e.function="function",e.customTypeScript="customTypeScript",e.array="array",e.arrayOfObjects="arrayOfObjects",e.arrayOfStrings="arrayOfStrings",e.arrayOfNumbers="arrayOfNumbers",e.unknown="unknown",e))(sn||{});u(e=>"type"in e&&e.type==="string"&&!("enum"in e),"isStringProp");u(e=>"type"in e&&e.type==="number","isNumberProp");u(e=>"type"in e&&e.type==="boolean","isBooleanProp");u(e=>"enum"in e,"isOptionsProp");u(e=>"typeof"in e&&e?.typeof==="function","isFunctionProp");u(e=>!("typeof"in e)&&"tsType"in e,"isCustomTypeScriptProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="object","isArrayOfObjectsProp");u(e=>"type"in e&&e.type==="object"&&"properties"in e&&Object.keys(e.properties).length>0,"isObjectProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="string","isArrayOfStringsProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="number","isArrayOfNumbersProp");var Ct=r.object({op:r.union([r.literal("replace"),r.literal("remove"),r.literal("add")]),path:r.array(r.union([r.string(),r.number()])),value:r.optional(r.any())}),on=Ct;u(e=>on.is(e),"isPatch");var Ne=r.array(Ct),ln=Ne;u(e=>ln.is(e),"isPatches");var wt=r.type({patches:Ne,inversePatches:r.optional(Ne),event:r.optional(r.object({type:r.string()})),id:r.string(),date:r.string(),userId:r.optional(r.string())}),un=wt;u(e=>un.is(e),"isKsRemoteChange");var cn=r.array(wt),dn=cn;u(e=>dn.is(e),"isKsRemoteChanges");var pn=(e=>(e.ready="ready",e))(pn||{});var fn=(e=>(e.GitHub="GitHub",e.GitLab="GitLab",e.GitLabRest="GitLabRest",e.Bitbucket="Bitbucket",e.Azure="Azure",e))(fn||{}),yn=(e=>(e.Conflicting="CONFLICTING",e.Mergeable="MERGEABLE",e.Unknown="UNKNOWN",e))(yn||{}),gn=(e=>(e.Create="CREATE",e.Move="MOVE",e.Update="UPDATE",e.Chmod="CHMOD",e))(gn||{}),mn=(e=>(e.Base64="BASE64",e.Text="TEXT",e))(mn||{}),hn={ADMIN:"ADMIN",ANONYMOUS:"ANONYMOUS",CONTRIBUTOR:"CONTRIBUTOR",EDITOR:"EDITOR",MANAGER:"MANAGER",VIEWER:"VIEWER"},Tt=Object.values(hn);var Vt=enums(Tt),Sn=Vt,Ha=s(e=>e==="ADMIN","canRoleAdmin"),Pt=["ADMIN","MANAGER"],ja=s(e=>Pt.includes(e),"canRoleManageUsers"),Rt=[...Pt,"EDITOR"],Ga=s(e=>Rt.includes(e),"canRoleDelete"),It=[...Rt,"CONTRIBUTOR"],Ja=s(e=>It.includes(e),"canRoleEdit"),_n=["ADMIN"],Xa=s(e=>_n.includes(e),"canRolePublish"),Cn=[...It,"VIEWER"],qa=s(e=>Cn.includes(e),"canRoleView"),wn=s(e=>Sn.is(e),"isRoleValid"),Ot=(n=>(n.user="user",n.anonymous="anonymous",n))(Ot||{}),Et=enums(Object.values(Ot)),Tn=object({"x-hasura-allowed-roles":array(Et),"x-hasura-default-role":Et,"x-hasura-user-id":optional(string())}),xn=object({userId:string(),isSuperAdmin:boolean(),sitesByRole:record(Vt,array(string()))}),An=type({exp:number(),email:optional(string()),email_verified:optional(union([string(),boolean()])),iat:number(),iss:string(),sub:string(),aud:union([string(),array(string())])}),En="https://hasura.io/jwt/claims",Mt="https://knapsack.cloud",Dn=object({[En]:Tn,[Mt]:xn}),Nn=assign(An,Dn);function Vn(e){return Object.entries(e).reduce((t,[n,a])=>(wn(n)&&a.forEach(o=>{t[o]=n;}),t),{})}s(Vn,"expandSitesByRole");var Pn={isSuperAdmin:!1,userId:"",siteRoleMap:{},getSiteRole:s(()=>"ANONYMOUS","getSiteRole")},Ya=s(e=>{if(!Nn.is(e))return Pn;let{sitesByRole:t,...n}=e[Mt],a=Vn(t);return {...n,siteRoleMap:a,getSiteRole:s(o=>n.isSuperAdmin?"ADMIN":a[o]||"ANONYMOUS","getSiteRole")}},"getKsClaims");var ei="/site-deployed",ti="/github-auth";var{KS_DB_URL:he}=process.env;if(he&&!isUrl(he))throw new Error(`KS_DB_URL is not a valid URL: '${he}'`);var zt=he||"https://db.knapsack.cloud",In=new URL("/v1/graphql",zt).toString(),ai={dbUrl:zt,dbGqlEndpoint:In};var si={siteId:"X-KS-Site-ID",instanceId:"X-KS-Instance-Id",appClientVersion:"X-KS-App-Client-Version"};
5
+ var Lt=Object.create;var be=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var Ht=Object.getPrototypeOf,Gt=Object.prototype.hasOwnProperty;var s=(e,t)=>be(e,"name",{value:t,configurable:!0});var ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var jt=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $t(t))!Gt.call(e,o)&&o!==n&&be(e,o,{get:()=>t[o],enumerable:!(a=Wt(t,o))||a.enumerable});return e};var Jt=(e,t,n)=>(n=e!=null?Lt(Ht(e)):{},jt(be(n,"default",{value:e,enumerable:!0}),e));var Me=ne((Wn,Re)=>{Re.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};});var ze=ne(($n,Fe)=>{Fe.exports=s(function(t){return !t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},"isArrayish");});var Ue=ne((Gn,Be)=>{var Xt=ze(),qt=Array.prototype.concat,Yt=Array.prototype.slice,Ke=Be.exports=s(function(t){for(var n=[],a=0,o=t.length;a<o;a++){var d=t[a];Xt(d)?n=qt.call(n,Yt.call(d)):n.push(d);}return n},"swizzle");Ke.wrap=function(e){return function(){return e(Ke(arguments))}};});var He=ne((Jn,$e)=>{var j=Me(),J=Ue(),Le=Object.hasOwnProperty,We=Object.create(null);for(ae in j)Le.call(j,ae)&&(We[j[ae]]=ae);var ae,_=$e.exports={to:{},get:{}};_.get=function(e){var t=e.substring(0,3).toLowerCase(),n,a;switch(t){case"hsl":n=_.get.hsl(e),a="hsl";break;case"hwb":n=_.get.hwb(e),a="hwb";break;default:n=_.get.rgb(e),a="rgb";break}return n?{model:a,value:n}:null};_.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,d=/^(\w+)$/,c=[0,0,0,1],l,p,E;if(l=e.match(n)){for(E=l[2],l=l[1],p=0;p<3;p++){var re=p*2;c[p]=parseInt(l.slice(re,re+2),16);}E&&(c[3]=parseInt(E,16)/255);}else if(l=e.match(t)){for(l=l[1],E=l[3],p=0;p<3;p++)c[p]=parseInt(l[p]+l[p],16);E&&(c[3]=parseInt(E+E,16)/255);}else if(l=e.match(a)){for(p=0;p<3;p++)c[p]=parseInt(l[p+1],0);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else if(l=e.match(o)){for(p=0;p<3;p++)c[p]=Math.round(parseFloat(l[p+1])*2.55);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else return (l=e.match(d))?l[1]==="transparent"?[0,0,0,0]:Le.call(j,l[1])?(c=j[l[1]],c[3]=1,c):null:null;for(p=0;p<3;p++)c[p]=R(c[p],0,255);return c[3]=R(c[3],0,1),c};_.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=R(parseFloat(n[2]),0,100),c=R(parseFloat(n[3]),0,100),l=R(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=R(parseFloat(n[2]),0,100),c=R(parseFloat(n[3]),0,100),l=R(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.to.hex=function(){var e=J(arguments);return "#"+ie(e[0])+ie(e[1])+ie(e[2])+(e[3]<1?ie(Math.round(e[3]*255)):"")};_.to.rgb=function(){var e=J(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};_.to.rgb.percent=function(){var e=J(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+a+"%)":"rgba("+t+"%, "+n+"%, "+a+"%, "+e[3]+")"};_.to.hsl=function(){var e=J(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};_.to.hwb=function(){var e=J(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};_.to.keyword=function(e){return We[e.slice(0,3)]};function R(e,t,n){return Math.min(Math.max(t,e),n)}s(R,"clamp");function ie(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s(ie,"hexDouble");});var it=Jt(He());var Ye=Symbol.for("immer-nothing"),Ge=Symbol.for("immer-draftable"),C=Symbol.for("immer-state"),Zt=process.env.NODE_ENV!=="production"?[function(e){return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return `'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return `'original' expects a draft, got: ${e}`}]:[];function v(e,...t){if(process.env.NODE_ENV!=="production"){let n=Zt[e],a=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${a}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}s(v,"die");var W=Object.getPrototypeOf;function M(e){return !!e&&!!e[C]}s(M,"isDraft");function K(e){return e?Ze(e)||Array.isArray(e)||!!e[Ge]||!!e.constructor?.[Ge]||ce(e)||de(e):!1}s(K,"isDraftable");var Qt=Object.prototype.constructor.toString();function Ze(e){if(!e||typeof e!="object")return !1;let t=W(e);if(t===null)return !0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Qt}s(Ze,"isPlainObject");function se(e,t){ue(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e);}):e.forEach((n,a)=>t(a,n,e));}s(se,"each");function ue(e){let t=e[C];return t?t.type_:Array.isArray(e)?1:ce(e)?2:de(e)?3:0}s(ue,"getArchtype");function ke(e,t){return ue(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}s(ke,"has");function Qe(e,t,n){let a=ue(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n;}s(Qe,"set");function er(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}s(er,"is");function ce(e){return e instanceof Map}s(ce,"isMap");function de(e){return e instanceof Set}s(de,"isSet");function z(e){return e.copy_||e.base_}s(z,"latest");function _e(e,t){if(ce(e))return new Map(e);if(de(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Ze(e);if(t===!0||t==="class_only"&&!n){let a=Object.getOwnPropertyDescriptors(e);delete a[C];let o=Reflect.ownKeys(a);for(let d=0;d<o.length;d++){let c=o[d],l=a[c];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(a[c]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[c]});}return Object.create(W(e),a)}else {let a=W(e);if(a!==null&&n)return {...e};let o=Object.create(a);return Object.assign(o,e)}}s(_e,"shallowCopy");function Ae(e,t=!1){return pe(e)||M(e)||!K(e)||(ue(e)>1&&(e.set=e.add=e.clear=e.delete=tr),Object.freeze(e),t&&Object.entries(e).forEach(([n,a])=>Ae(a,!0))),e}s(Ae,"freeze");function tr(){v(2);}s(tr,"dontMutateFrozenCollections");function pe(e){return Object.isFrozen(e)}s(pe,"isFrozen");var rr={};function B(e){let t=rr[e];return t||v(0,e),t}s(B,"getPlugin");var X;function et(){return X}s(et,"getCurrentScope");function nr(e,t){return {drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}s(nr,"createScope");function je(e,t){t&&(B("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t);}s(je,"usePatchesInScope");function Ce(e){Te(e),e.drafts_.forEach(ar),e.drafts_=null;}s(Ce,"revokeScope");function Te(e){e===X&&(X=e.parent_);}s(Te,"leaveScope");function Je(e){return X=nr(X,e)}s(Je,"enterScope");function ar(e){let t=e[C];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0;}s(ar,"revokeDraft");function Xe(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[C].modified_&&(Ce(t),v(4)),K(e)&&(e=oe(t,e),t.parent_||le(t,e)),t.patches_&&B("Patches").generateReplacementPatches_(n[C].base_,e,t.patches_,t.inversePatches_)):e=oe(t,n,[]),Ce(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ye?e:void 0}s(Xe,"processResult");function oe(e,t,n){if(pe(t))return t;let a=t[C];if(!a)return se(t,(o,d)=>qe(e,a,t,o,d,n)),t;if(a.scope_!==e)return t;if(!a.modified_)return le(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let o=a.copy_,d=o,c=!1;a.type_===3&&(d=new Set(o),o.clear(),c=!0),se(d,(l,p)=>qe(e,a,o,l,p,n,c)),le(e,o,!1),n&&e.patches_&&B("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_);}return a.copy_}s(oe,"finalize");function qe(e,t,n,a,o,d,c){if(process.env.NODE_ENV!=="production"&&o===n&&v(5),M(o)){let l=d&&t&&t.type_!==3&&!ke(t.assigned_,a)?d.concat(a):void 0,p=oe(e,o,l);if(Qe(n,a,p),M(p))e.canAutoFreeze_=!1;else return}else c&&n.add(o);if(K(o)&&!pe(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;oe(e,o),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,a)&&le(e,o);}}s(qe,"finalizeProperty");function le(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ae(t,n);}s(le,"maybeFreeze");function ir(e,t){let n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:et(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=a,d=Ee;n&&(o=[a],d=q);let{revoke:c,proxy:l}=Proxy.revocable(o,d);return a.draft_=l,a.revoke_=c,l}s(ir,"createProxyProxy");var Ee={get(e,t){if(t===C)return e;let n=z(e);if(!ke(n,t))return sr(e,n,t);let a=n[t];return e.finalized_||!K(a)?a:a===ve(e.base_,t)?(Se(e),e.copy_[t]=xe(a,e)):a},has(e,t){return t in z(e)},ownKeys(e){return Reflect.ownKeys(z(e))},set(e,t,n){let a=tt(z(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){let o=ve(z(e),t),d=o?.[C];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(er(n,o)&&(n!==void 0||ke(e.base_,t)))return !0;Se(e),we(e);}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ve(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Se(e),we(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=z(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){v(11);},getPrototypeOf(e){return W(e.base_)},setPrototypeOf(){v(12);}},q={};se(Ee,(e,t)=>{q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};});q.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&v(13),q.set.call(this,e,t,void 0)};q.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&v(14),Ee.set.call(this,e[0],t,n,e[0])};function ve(e,t){let n=e[C];return (n?z(n):e)[t]}s(ve,"peek");function sr(e,t,n){let a=tt(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}s(sr,"readPropFromProto");function tt(e,t){if(!(t in e))return;let n=W(e);for(;n;){let a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=W(n);}}s(tt,"getDescriptorFromProto");function we(e){e.modified_||(e.modified_=!0,e.parent_&&we(e.parent_));}s(we,"markChanged");function Se(e){e.copy_||(e.copy_=_e(e.base_,e.scope_.immer_.useStrictShallowCopy_));}s(Se,"prepareCopy");var or=class{static{s(this,"Immer2");}constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){let d=n;n=t;let c=this;return s(function(p=d,...E){return c.produce(p,re=>n.call(this,re,...E))},"curriedProduce")}typeof n!="function"&&v(6),a!==void 0&&typeof a!="function"&&v(7);let o;if(K(t)){let d=Je(this),c=xe(t,void 0),l=!0;try{o=n(c),l=!1;}finally{l?Ce(d):Te(d);}return je(d,a),Xe(o,d)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Ye&&(o=void 0),this.autoFreeze_&&Ae(o,!0),a){let d=[],c=[];B("Patches").generateReplacementPatches_(t,o,d,c),a(d,c);}return o}else v(1,t);},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return (c,...l)=>this.produceWithPatches(c,p=>t(p,...l));let a,o;return [this.produce(t,n,(c,l)=>{a=c,o=l;}),a,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy);}createDraft(e){K(e)||v(8),M(e)&&(e=lr(e));let t=Je(this),n=xe(e,void 0);return n[C].isManual_=!0,Te(t),n}finishDraft(e,t){let n=e&&e[C];(!n||!n.isManual_)&&v(9);let{scope_:a}=n;return je(a,t),Xe(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e;}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e;}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let a=B("Patches").applyPatches_;return M(e)?a(e,t):this.produce(e,o=>a(o,t))}};function xe(e,t){let n=ce(e)?B("MapSet").proxyMap_(e,t):de(e)?B("MapSet").proxySet_(e,t):ir(e,t);return (t?t.scope_:et()).drafts_.push(n),n}s(xe,"createProxy");function lr(e){return M(e)||v(10,e),rt(e)}s(lr,"current");function rt(e){if(!K(e)||pe(e))return e;let t=e[C],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_e(e,t.scope_.immer_.useStrictShallowCopy_);}else n=_e(e,!0);return se(n,(a,o)=>{Qe(n,a,rt(o));}),t&&(t.finalized_=!1),n}s(rt,"currentImpl");var T=new or;T.produceWithPatches.bind(T);T.setAutoFreeze.bind(T);T.setUseStrictShallowCopy.bind(T);T.applyPatches.bind(T);T.createDraft.bind(T);T.finishDraft.bind(T);var st=Object.defineProperty,u=s((e,t)=>st(e,"name",{value:t,configurable:!0}),"n"),ot=s((e,t)=>{for(var n in t)st(e,n,{get:t[n],enumerable:!0});},"ue");function lt(e){if(typeof e!="string")return !1;try{return !!it.default.get(e)}catch{return !1}}s(lt,"Fe");u(lt,"isColor");var ye=define("ColorStringStruct",e=>typeof e=="string"&&lt(e)),m=union([type({type:literal("value"),colorValue:ye}),type({type:literal("design-token"),tokenName:string()})]);type({type:literal("design-token"),tokenName:string()});var nt=object({unit:enums(["rem","px"]),value:number()}),at=union([string(),number()]),dr=(e=>(e.woff2="woff2",e.woff="woff",e))(dr||{}),pr=enums(["woff2","woff"]),fr=type({format:pr,type:literal("url"),path:string()}),ee=type({family:optional(string()),weight:optional(union([at,size(array(at),2)])),src:optional(array(fr)),style:optional(string()),display:optional(enums(["auto","block","swap","fallback","optional"])),variationSettings:optional(string()),unicodeRange:optional(string())}),yr=(e=>(e.inherit="As typed",e.capitalize="Capitalize",e.lowercase="Lowercase",e.uppercase="Uppercase",e))(yr||{}),gr=(e=>(e["ultra-condensed"]="Ultra-condensed",e["extra-condensed"]="Extra-condensed",e.condensed="Condensed",e["semi-condensed"]="Semi-condensed",e.normal="Normal",e["semi-expanded"]="Semi-expanded",e.expanded="Expanded",e["extra-expanded"]="Extra-expanded",e["ultra-expanded"]="Ultra-expanded",e))(gr||{}),te=type({fontWeight:optional(union([string(),number()])),textColor:optional(m),hoverColor:optional(m),underline:optional(boolean()),textTransform:optional(enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:optional(enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))}),mr=type({min:nt,max:optional(nt)}),f=type({fontSize:optional(mr),lineHeight:optional(union([string(),number()])),fontWeight:optional(union([string(),number()])),letterSpacing:optional(string()),fontFamily:optional(string()),textColor:optional(m),textTransform:optional(enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:optional(enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))});var G=union([f,type({accentColor:optional(m)})]),ge=union([G,type({hoverColor:optional(m),backgroundColor:optional(m)})]),me=union([G,type({backgroundColor:optional(m)})]);object({version:literal(1),oldSillySidebarBgColor:ye});object({version:literal(2),anotherSillySidebarBgColor:ye});object({version:literal(3),sidebarBgColor:ye});object({version:literal(4),primaryColor:m,darkColor:m,lightColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0))});object({version:literal(5),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0))});object({version:literal(6),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0)),appearance:type({customFonts:optional(array(ee)),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(7),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:optional(defaulted(boolean(),!0)),appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(G)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(8),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(G)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(9),appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(G)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),bodyText:optional(f),link:optional(te)})})});object({version:literal(10),appearance:type({customFonts:optional(array(ee)),navigation:optional(type({primaryNav:optional(ge),secondaryNav:optional(me),tabs:optional(G)})),pageElements:type({pageTitle:optional(f),pageDescription:optional(f),headingXLarge:optional(f),headingLarge:optional(f),headingMedium:optional(f),headingSmall:optional(f),headingXSmall:optional(f),bodyText:optional(f),link:optional(te)})})});function ut(e){return typeof e!="string"?!1:e.split("{").length-1===1&&e.startsWith("{")&&e.endsWith("}")}s(ut,"Qe");u(ut,"isTokenReference");function P(e){return typeof e=="string"&&e.includes("{")}s(P,"b");u(P,"hasTokenReferences");function ct(e){return !ut(e)}s(ct,"Ze");u(ct,"isNotTokenReference");var h=r.define("Token Reference",e=>typeof e!="string"?!1:ct(e)?"Must start and end with curly braces":!0),hr={border:"border",shadow:"shadow",transition:"transition"},br=Object.values(hr),vr={string:"string",number:"number",boolean:"boolean",color:"color",dimension:"dimension",duration:"duration",fontWeight:"fontWeight",strokeStyle:"strokeStyle",cubicBezier:"cubicBezier"},Sr=Object.values(vr);function Ve(e){return br.includes(e)}s(Ve,"q");u(Ve,"isTokenTypeComposite");function dt(e){return Sr.includes(e)}s(dt,"Te");u(dt,"isTokenTypeSingular");expectType([{inset:!1,color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px"},{color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px",inset:!0}]);var b=r.type({id:r.string(),description:r.optional(r.string()),references:r.optional(r.array(r.array(r.string()))),tokenConfig:r.optional(r.type({purpose:r.optional(r.string())}))});expectType([{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"static"},{type:"duration",value:"1ms",kind:"ref",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"ref"},{type:"duration",value:"1ms",kind:"static",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"color",value:"#000",kind:"static",id:"1",originalValue:"#000"},{type:"color",value:"#000",kind:"ref",id:"1",originalValue:"{c.b}",referencedTokenId:"c.b"},{type:"cubicBezier",kind:"static",value:[0,0,0,1],originalValue:[0,0,0,1],id:"1"}]);function kr(e){return Ve(e.type)}s(kr,"Tn");u(kr,"isTokenDataComposite");expectType([{type:"border",kind:"static",id:"1",value:{color:"#000",style:"solid",width:"1px"},originalValue:{color:"#000",style:"solid",width:"1px"}},{type:"border",kind:"ref",referencedTokenId:"a.b",id:"1",value:{color:"red",style:"dashed",width:"2px"},originalValue:"{a.b}"},{type:"shadow",value:{color:"#000",offsetX:"1px",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},originalValue:{color:"#000",offsetX:"{a.a}",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},id:"1",kind:"static"},{type:"shadow",kind:"ref",referencedTokenId:"a.b",value:{inset:!0,color:"red",offsetX:"1px",blur:"2px",offsetY:"3px",spread:"4px"},originalValue:"{a.b}",id:"1"},{type:"transition",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:"{a.b}",kind:"ref",referencedTokenId:"a.b",id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"{a.c}",timingFunction:"{a.c}"},id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},id:"1"}]);function pt(e){return typeof e=="string"&&!P(e)}s(pt,"it");u(pt,"isTokenValueColor");var $=r.define("Color Value",e=>typeof e!="string"?"Value must be a string":e===""?"Value must not be empty":P(e)?"Value must not contain {} (token references)":!0),_r=r.assign(r.type({type:r.literal("color"),value:$,kind:r.literal("static"),originalValue:$}),b),Cr=r.assign(r.type({type:r.literal("color"),value:$,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function Y(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("rem"))&&!P(e)}s(Y,"J");u(Y,"isTokenValueDimension");var D=r.define("Dimension Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":!e.endsWith("px")&&!e.endsWith("rem")&&!e.endsWith("em")&&!e.endsWith("%")?"Value must end with px, rem, em or %":!0),Tr=r.assign(r.type({type:r.literal("dimension"),value:D,kind:r.literal("static"),originalValue:D}),b),wr=r.assign(r.type({type:r.literal("dimension"),value:D,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function xr(e){return typeof e=="string"&&e.endsWith("ms")&&!P(e)}s(xr,"Sn");u(xr,"isTokenValueDuration");var L=r.define("Duration Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":/^\d+ms$/.test(e)?!0:'Value must be a number followed by "ms" (e.g., "100ms")'),Ar=r.assign(r.type({type:r.literal("duration"),value:L,kind:r.literal("static"),originalValue:L}),b),Er=r.assign(r.type({type:r.literal("duration"),value:L,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function Dr(e){return (typeof e=="string"||typeof e=="number")&&!P(e)}s(Dr,"Cn");u(Dr,"isTokenValueFontWeight");var De=r.define("Font Weight Value",e=>typeof e!="string"&&typeof e!="number"?"Value must be a string or number":P(e)?"Value must not contain {} (token references)":!0),Nr=r.assign(r.type({type:r.literal("fontWeight"),value:De,kind:r.literal("static"),originalValue:De}),b),Vr=r.assign(r.type({type:r.literal("fontWeight"),value:De,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Z=r.define("Cubic Bezier Value",e=>Array.isArray(e)?e.length!==4||!e.every(t=>typeof t=="number")?"Value must be an array of 4 numbers":e[0]<0||e[0]>1||e[2]<0||e[2]>1?"The first and third cubicBezier values must be between 0 and 1":!0:"Value must be an array"),Ir=r.assign(r.type({type:r.literal("cubicBezier"),value:Z,kind:r.literal("static"),originalValue:Z}),b),Pr=r.assign(r.type({type:r.literal("cubicBezier"),value:Z,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function ft(e){return isObject(e)&&pt(e.color)&&Y(e.offsetX)&&Y(e.offsetY)&&Y(e.blur)&&Y(e.spread)}s(ft,"dt");u(ft,"isTokenValueShadow");var yt=r.define("Shadow Value",e=>ft(e)?!0:`Expected a shadow value, got ${JSON.stringify(e)}`),Or=r.assign(r.type({type:r.literal("shadow"),value:yt,kind:r.literal("static"),originalValue:r.type({color:r.union([$,h]),offsetX:r.union([D,h]),offsetY:r.union([D,h]),blur:r.union([D,h]),spread:r.union([D,h]),inset:r.union([r.optional(r.boolean()),h])})}),b),Rr=r.assign(r.type({type:r.literal("shadow"),value:yt,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),H=r.union([r.literal("solid"),r.literal("dashed"),r.literal("dotted"),r.literal("double"),r.literal("groove"),r.literal("ridge"),r.literal("outset"),r.literal("inset")]);function gt(e){return isObject(e)&&$.is(e.color)&&H.is(e.style)&&D.is(e.width)}s(gt,"St");u(gt,"isTokenValueBorder");var mt=r.define("Border Value",gt),Mr=r.assign(r.type({type:r.literal("border"),value:mt,kind:r.literal("static"),originalValue:r.type({color:r.union([$,h]),style:r.union([H,h]),width:r.union([D,h])})}),b),Fr=r.assign(r.type({type:r.literal("border"),value:mt,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);function ht(e){return isObject(e)&&Z.is(e.timingFunction)&&L.is(e.duration)&&L.is(e.delay)}s(ht,"bt");u(ht,"isTokenValueTransition");var bt=r.define("Transition Value",ht),zr=r.assign(r.type({type:r.literal("transition"),value:bt,kind:r.literal("static"),originalValue:r.type({timingFunction:r.union([Z,h]),duration:r.union([L,h]),delay:r.union([L,h])})}),b),Kr=r.assign(r.type({type:r.literal("transition"),value:bt,kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Br=r.assign(r.type({type:r.literal("string"),value:r.string(),kind:r.literal("static"),originalValue:r.string()}),b),Ur=r.assign(r.type({type:r.literal("string"),value:r.string(),kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Lr=r.assign(r.type({type:r.literal("strokeStyle"),value:H,kind:r.literal("static"),originalValue:H}),b),Wr=r.assign(r.type({type:r.literal("strokeStyle"),value:H,kind:r.literal("ref"),originalValue:h,referencedTokenId:H}),b),$r=r.assign(r.type({type:r.literal("number"),value:r.number(),kind:r.literal("static"),originalValue:r.number()}),b),Hr=r.assign(r.type({type:r.literal("number"),value:r.number(),kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b),Gr=r.assign(r.type({type:r.literal("boolean"),value:r.boolean(),kind:r.literal("static"),originalValue:r.boolean()}),b),jr=r.assign(r.type({type:r.literal("boolean"),value:r.boolean(),kind:r.literal("ref"),originalValue:h,referencedTokenId:r.string()}),b);u(e=>{if(!isObject(e))throw new Error(`Expected token data to be an object, got ${JSON.stringify(e)}`);if(!isObjKey("type",e))throw new Error(`Expected token data to have a "type" property, got ${JSON.stringify(e)}`);if(typeof e.type!="string")throw new Error(`Expected token data "type" property to be a string, got ${JSON.stringify(e)}`);let t=e.type,n=e.kind;try{switch(t){case"boolean":n==="ref"?jr.assert(e):Gr.assert(e);return;case"border":n==="ref"?Fr.assert(e):Mr.assert(e);return;case"color":n==="ref"?Cr.assert(e):_r.assert(e);return;case"cubicBezier":n==="ref"?Pr.assert(e):Ir.assert(e);return;case"dimension":n==="ref"?wr.assert(e):Tr.assert(e);return;case"duration":n==="ref"?Er.assert(e):Ar.assert(e);return;case"fontWeight":n==="ref"?Vr.assert(e):Nr.assert(e);return;case"number":n==="ref"?Hr.assert(e):$r.assert(e);return;case"shadow":n==="ref"?Rr.assert(e):Or.assert(e);return;case"string":n==="ref"?Ur.assert(e):Br.assert(e);return;case"strokeStyle":n==="ref"?Wr.assert(e):Lr.assert(e);return;case"transition":n==="ref"?Kr.assert(e):zr.assert(e);return;default:throw new Error(`Unknown token data type: ${t}`)}}catch(a){throw a instanceof r.StructError?new Error(`Invalid token data for type "${t}": ${a.message}. Received this data: "${JSON.stringify(e)}"`):a}},"assertTokenData");expectType([{type:"dimension",kind:"static",value:"1px"},{type:"dimension",kind:"ref",referencedTokenId:"a.b"}]);expectType([{type:"border",kind:"ref",referencedTokenId:"a.b"},{type:"border",kind:"static",value:{color:{kind:"static",type:"color",value:"red"},style:{kind:"ref",type:"strokeStyle",referencedTokenId:""},width:{kind:"static",type:"dimension",value:"2px"}}}]);expectType([{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function Jr(e){return dt(e?.type)}s(Jr,"Bn");u(Jr,"isTokenSrcValueInfoSingular");function Xr(e){return Ve(e?.type)}s(Xr,"En");u(Xr,"isTokenSrcValueInfoComposite");expectType([{type:"dimension",kind:"static",value:"1px"},{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"ref",value:"1px"},{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function vt(e){return isObject(e)&&isObjKey("cloud.knapsack",e)}s(vt,"At");u(vt,"isTokenSrcExtensions");expectType(["#ddd",!0,[83,1,1,1],{color:"#000",style:"solid",width:"1px"},{inset:!0,color:"#000",offsetX:"0px",offsetY:"{spacing.medium}",spread:"0px",blur:"0px"},{timingFunction:"{timing.ease}",duration:"{timing.duration.medium}",delay:"7ms",color:"#000"}]);function qr(e){return !!(isObject(e)&&isObjKey("$value",e))}s(qr,"Kn");u(qr,"isTokenSrc");function St(e){return isObject(e)&&!vt(e)&&!isObjKey("$value",e)&&!isObjKey("cloud.knapsack",e)}s(St,"Ot");u(St,"isTokenGroup");function Yr(e){if(St(e)){let t=e.$extensions["cloud.knapsack"].group.collectionInfo;if(isObjKey("type",t)&&isObjKey("referenceId",t))return !0}return !1}s(Yr,"Fn");u(Yr,"isTokenTypeVarRef");function Zr(e){let t=typeof e;if(t==="string"||t==="number"||t==="boolean")return t;throw new Error(`Invalid token value type: ${JSON.stringify(t)}. Token value is: ${JSON.stringify(e)}`)}s(Zr,"jn");u(Zr,"getPrimitiveValue");u(e=>e.includes("px")||e.includes("rem")||e.includes("em")||e.includes("%"),"isDimensionString");function Qr(e){let{value:t,unit:n}=parseNumberWithUnit(e);if(!n)return {value:t};if(n!=="px"&&n!=="rem"&&n!=="em"&&n!=="%")throw new Error(`Invalid unit "${n}" for value: ${t}`);return {value:t,unit:n}}s(Qr,"_n");u(Qr,"parseTokenDimensionValue");u(e=>isObject(e)&&e.type==="text","isSlottedText");function en(e){return isObject(e)&&e.type==="template-demo"}s(en,"qn");u(en,"isSlottedTemplateDemo");function tn(e){return isObject(e)&&e.type==="template-reference"}s(tn,"Jn");u(tn,"isSlottedTemplateReference");var rn=(e=>(e.portrait="portrait",e.landscape="landscape",e))(rn||{});function nn(e){return e?.type==="data"}s(nn,"Yn");u(nn,"isDataDemo");function an(e){return e?.type==="template"}s(an,"Xn");u(an,"isTemplateDemo");var sn=(e=>(e.auto="auto",e.small="small",e.medium="medium",e.large="large",e.full="full",e))(sn||{});function kt(e){return !isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","db"].every(t=>isObjKey(t,e))?!1:!isObjKey("metaState",e)}s(kt,"zt");u(kt,"isKsAppClientDataNoMeta");define("KsAppClientDataNoMeta",kt);function _t(e){return isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","metaState","db"].every(t=>isObjKey(t,e)):!1}s(_t,"Mt");u(_t,"isKsAppClientDataAndMeta");define("KsAppClientDataAndMeta",_t);type({isLocalDev:boolean(),plugins:array(type({id:string(),hasContent:boolean(),clientPluginPath:optional(string()),cssPath:optional(string())})),meta:optional(type({version:optional(string()),hasKnapsackCloud:boolean(),knapsackCloudSiteId:optional(string()),serverPort:optional(number()),websocketsPort:optional(number()),https:optional(boolean()),cacheDir:optional(string()),ksVersions:type({app:string()})}))});function Ct(e){return !isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState"].every(t=>isObjKey(t,e))?!1:!isObjKey("metaState",e)}s(Ct,"_t");u(Ct,"isKsAppClientDataNoMetaV3");define("KsAppClientDataNoMeta",Ct);function Tt(e){return isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState","metaState"].every(t=>isObjKey(t,e)):!1}s(Tt,"Lt");u(Tt,"isKsAppClientDataAndMetaV3");define("KsAppClientDataAndMeta",Tt);type({isLocalDev:boolean(),plugins:array(type({id:string(),hasContent:boolean(),clientPluginPath:optional(string()),cssPath:optional(string())})),meta:optional(type({version:optional(string()),hasKnapsackCloud:boolean(),knapsackCloudSiteId:optional(string()),serverPort:optional(number()),websocketsPort:optional(number()),https:optional(boolean()),cacheDir:optional(string()),ksVersions:type({app:string()})}))});({version:"4.1.7",checkIfNeeded:u(e=>!0,"checkIfNeeded"),migrate:u(e=>{if(!M(e))throw new Error("Tried to run migrations on appClientData but it is not an Immer Draft");Object.values(e.patternsState.patterns).forEach(t=>{delete t.demoSize;}),Object.values(e.db.demos.byId).forEach(t=>{t.type==="data"&&(Object.entries(t.data.slots??{}).forEach(([n,a])=>{t.data.slots[n]=a.map(o=>typeof o=="string"?{type:"text",text:o}:(o.type==="template-reference"||o.type==="text"||(o.type="template-demo"),o));}),!(t.patternId&&t.templateId)&&(()=>{for(let{id:n,templates:a=[]}of Object.values(e.patternsState.patterns))for(let{id:o,demoIds:d=[]}of a)if(d.includes(t.id)){t.patternId=n,t.templateId=o;return}})());});},"migrate")});var un=(e=>(e.string="string",e.boolean="boolean",e.number="number",e.object="object",e.options="options",e.function="function",e.customTypeScript="customTypeScript",e.array="array",e.arrayOfObjects="arrayOfObjects",e.arrayOfStrings="arrayOfStrings",e.arrayOfNumbers="arrayOfNumbers",e.unknown="unknown",e))(un||{});u(e=>"type"in e&&e.type==="string"&&!("enum"in e),"isStringProp");u(e=>"type"in e&&e.type==="number","isNumberProp");u(e=>"type"in e&&e.type==="boolean","isBooleanProp");u(e=>"enum"in e,"isOptionsProp");u(e=>"typeof"in e&&e?.typeof==="function","isFunctionProp");u(e=>!("typeof"in e)&&"tsType"in e,"isCustomTypeScriptProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="object","isArrayOfObjectsProp");u(e=>"type"in e&&e.type==="object"&&"properties"in e&&Object.keys(e.properties).length>0,"isObjectProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="string","isArrayOfStringsProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="number","isArrayOfNumbersProp");var wt=r.object({op:r.union([r.literal("replace"),r.literal("remove"),r.literal("add")]),path:r.array(r.union([r.string(),r.number()])),value:r.optional(r.any())}),cn=wt;u(e=>cn.is(e),"isPatch");var Ne=r.array(wt),dn=Ne;u(e=>dn.is(e),"isPatches");var xt=r.type({patches:Ne,inversePatches:r.optional(Ne),event:r.optional(r.object({type:r.string()})),id:r.string(),date:r.string(),userId:r.optional(r.string())}),pn=xt;u(e=>pn.is(e),"isKsRemoteChange");var fn=r.array(xt),yn=fn;u(e=>yn.is(e),"isKsRemoteChanges");var gn=(e=>(e.ready="ready",e))(gn||{});var mn=(e=>(e.GitHub="GitHub",e.GitLab="GitLab",e.GitLabRest="GitLabRest",e.Bitbucket="Bitbucket",e.Azure="Azure",e))(mn||{}),hn=(e=>(e.Conflicting="CONFLICTING",e.Mergeable="MERGEABLE",e.Unknown="UNKNOWN",e))(hn||{}),bn=(e=>(e.Create="CREATE",e.Move="MOVE",e.Update="UPDATE",e.Chmod="CHMOD",e))(bn||{}),vn=(e=>(e.Base64="BASE64",e.Text="TEXT",e))(vn||{}),Sn={};ot(Sn,{ACTIONS:s(()=>At,"ACTIONS"),endpoint:s(()=>kn,"endpoint")});var kn="/plugins",At=(e=>(e.getContent="getContent",e))(At||{}),_n={};ot(_n,{ACTIONS:s(()=>Et,"ACTIONS"),endpoint:s(()=>Cn,"endpoint")});var Cn="/files",Et=(e=>(e.verify="verify",e))(Et||{}),Tn={ADMIN:"ADMIN",ANONYMOUS:"ANONYMOUS",CONTRIBUTOR:"CONTRIBUTOR",EDITOR:"EDITOR",MANAGER:"MANAGER",VIEWER:"VIEWER"},Dt=Object.values(Tn);var Rt=enums(Dt),En=Rt,Za=s(e=>e==="ADMIN","canRoleAdmin"),Mt=["ADMIN","MANAGER"],Qa=s(e=>Mt.includes(e),"canRoleManageUsers"),Ft=[...Mt,"EDITOR"],ei=s(e=>Ft.includes(e),"canRoleDelete"),zt=[...Ft,"CONTRIBUTOR"],ti=s(e=>zt.includes(e),"canRoleEdit"),Dn=["ADMIN"],ri=s(e=>Dn.includes(e),"canRolePublish"),Nn=[...zt,"VIEWER"],ni=s(e=>Nn.includes(e),"canRoleView"),Vn=s(e=>En.is(e),"isRoleValid"),Kt=(n=>(n.user="user",n.anonymous="anonymous",n))(Kt||{}),It=enums(Object.values(Kt)),In=object({"x-hasura-allowed-roles":array(It),"x-hasura-default-role":It,"x-hasura-user-id":optional(string())}),Pn=object({userId:string(),isSuperAdmin:boolean(),sitesByRole:record(Rt,array(string()))}),On=type({exp:number(),email:optional(string()),email_verified:optional(union([string(),boolean()])),iat:number(),iss:string(),sub:string(),aud:union([string(),array(string())])}),Rn="https://hasura.io/jwt/claims",Bt="https://knapsack.cloud",Mn=object({[Rn]:In,[Bt]:Pn}),Fn=assign(On,Mn);function zn(e){return Object.entries(e).reduce((t,[n,a])=>(Vn(n)&&a.forEach(o=>{t[o]=n;}),t),{})}s(zn,"expandSitesByRole");var Kn={isSuperAdmin:!1,userId:"",siteRoleMap:{},getSiteRole:s(()=>"ANONYMOUS","getSiteRole")},ai=s(e=>{if(!Fn.is(e))return Kn;let{sitesByRole:t,...n}=e[Bt],a=zn(t);return {...n,siteRoleMap:a,getSiteRole:s(o=>n.isSuperAdmin?"ADMIN":a[o]||"ANONYMOUS","getSiteRole")}},"getKsClaims");var oi="/site-deployed",li="/github-auth";var{KS_DB_URL:he}=process.env;if(he&&!isUrl(he))throw new Error(`KS_DB_URL is not a valid URL: '${he}'`);var Ut=he||"https://db.knapsack.cloud",Un=new URL("/v1/graphql",Ut).toString(),di={dbUrl:Ut,dbGqlEndpoint:Un};var fi={siteId:"X-KS-Site-ID",instanceId:"X-KS-Instance-Id",appClientVersion:"X-KS-App-Client-Version"};
6
6
 
7
- export { En as HASURA_CLAIMS_NAMESPACE, Tn as HasuraClaimsStruct, Ot as HasuraRoles, An as JwtBaseStruct, Dn as JwtCustomClaimsStruct, Nn as JwtWithCustomClaimsStruct, Mt as KNAPSACK_CLAIMS_NAMESPACE, xn as KsClaimsStruct, Vt as RolesEnums, Sn as RolesEnumsStruct, Ha as canRoleAdmin, Ga as canRoleDelete, Ja as canRoleEdit, ja as canRoleManageUsers, Xa as canRolePublish, qa as canRoleView, Pn as defaultAnonymousKsClaims, Vn as expandSitesByRole, Ya as getKsClaims, ti as gitHubOauthInternalEndpoint, wn as isRoleValid, si as ksHttpHeaders, ai as ksUrls, Rt as rolesThatCanDelete, It as rolesThatCanEdit, Pt as rolesThatCanManageUsers, _n as rolesThatCanPublish, Cn as rolesThatCanView, ei as siteDeployedWebhookEndpoint };
7
+ export { Rn as HASURA_CLAIMS_NAMESPACE, In as HasuraClaimsStruct, Kt as HasuraRoles, On as JwtBaseStruct, Mn as JwtCustomClaimsStruct, Fn as JwtWithCustomClaimsStruct, Bt as KNAPSACK_CLAIMS_NAMESPACE, Pn as KsClaimsStruct, Rt as RolesEnums, En as RolesEnumsStruct, Za as canRoleAdmin, ei as canRoleDelete, ti as canRoleEdit, Qa as canRoleManageUsers, ri as canRolePublish, ni as canRoleView, Kn as defaultAnonymousKsClaims, zn as expandSitesByRole, ai as getKsClaims, li as gitHubOauthInternalEndpoint, Vn as isRoleValid, fi as ksHttpHeaders, di as ksUrls, Ft as rolesThatCanDelete, zt as rolesThatCanEdit, Mt as rolesThatCanManageUsers, Dn as rolesThatCanPublish, Nn as rolesThatCanView, oi as siteDeployedWebhookEndpoint };
8
8
  //# sourceMappingURL=index.mjs.map
9
9
  //# sourceMappingURL=index.mjs.map