slice-machine-ui 1.13.0 → 1.13.1-dev-next-release.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +7 -4
  2. package/out/404.html +1 -1
  3. package/out/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
  4. package/out/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  5. package/out/[lib]/[sliceName]/[variation].html +1 -1
  6. package/out/_next/static/chunks/{18539003-b0b0df3d19f7d641.js → 18539003-a714ba731c9448b9.js} +22 -22
  7. package/out/_next/static/chunks/{377-53e916959dab47c4.js → 377-870ca4414847069f.js} +1 -1
  8. package/out/_next/static/chunks/{482-ad5ef8eecedd8b52.js → 482-a4c1c3721ca38516.js} +1 -1
  9. package/out/_next/static/chunks/780-643ae720f13fb3dc.js +1 -0
  10. package/out/_next/static/chunks/799-5ea3393033a9f617.js +1 -0
  11. package/out/_next/static/chunks/970-435552e338205936.js +1 -0
  12. package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]/{simulator-2c6033d99c3672e0.js → simulator-4dcf33735c45c344.js} +1 -1
  13. package/out/_next/static/chunks/pages/[lib]/[sliceName]/{[variation]-bd1822e54ac8836c.js → [variation]-9fff494255e34c39.js} +1 -1
  14. package/out/_next/static/chunks/pages/{_app-72e68f8cbd128095.js → _app-8fd5890485cbd0e8.js} +93 -93
  15. package/out/_next/static/chunks/pages/{changelog-dda7774c702c6b47.js → changelog-c08cc37b54d73a60.js} +1 -1
  16. package/out/_next/static/chunks/pages/{changes-7a3c37a25631d524.js → changes-6a039e823313b41c.js} +1 -1
  17. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-000131f34adb09ab.js → [customTypeId]-f8e48a51edbb5e1c.js} +1 -1
  18. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-ef69705204e4ca4e.js → [pageTypeId]-ddc8d057c3e251d1.js} +1 -1
  19. package/out/_next/static/chunks/pages/{slices-0333a80308f2058b.js → slices-24d2714462334469.js} +1 -1
  20. package/out/_next/static/css/{05ee3752aba1232a.css → 2d1eda18406a9ff4.css} +1 -1
  21. package/out/_next/static/css/6b6c11ed1fffd3e0.css +1 -0
  22. package/out/_next/static/css/{8488e84efc1f7f54.css → d6e6d21ff661397d.css} +1 -1
  23. package/out/_next/static/css/{74653a9f89a68929.css → fe2a2a1cbf3b4092.css} +1 -1
  24. package/out/_next/static/iV9BjBEUYwiSwOLcxg-Zq/_buildManifest.js +1 -0
  25. package/out/blank-slate-slice-zone.png +0 -0
  26. package/out/changelog.html +1 -1
  27. package/out/changes.html +1 -1
  28. package/out/custom-types/[customTypeId].html +1 -1
  29. package/out/custom-types.html +1 -1
  30. package/out/index.html +1 -1
  31. package/out/page-types/[pageTypeId].html +1 -1
  32. package/out/slices.html +1 -1
  33. package/package.json +8 -8
  34. package/public/blank-slate-slice-zone.png +0 -0
  35. package/src/components/BlankSlate/BlankSlate.css.ts +2 -2
  36. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +30 -49
  37. package/src/icons/LightningIcon3D.tsx +49 -0
  38. package/test/pages/custom-types.test.tsx +1 -2
  39. package/out/_next/static/7e5b6avcazgNMfyzSf2Je/_buildManifest.js +0 -1
  40. package/out/_next/static/chunks/677-d8555c165c261511.js +0 -1
  41. package/out/_next/static/chunks/777-a3c83f63c2609096.js +0 -1
  42. package/out/_next/static/chunks/799-2ecedfb7a28f9844.js +0 -1
  43. package/out/_next/static/css/be974b8a064b90bc.css +0 -1
  44. /package/out/_next/static/{7e5b6avcazgNMfyzSf2Je → iV9BjBEUYwiSwOLcxg-Zq}/_ssgManifest.js +0 -0
@@ -0,0 +1,49 @@
1
+ import type { FC, SVGProps } from "react";
2
+
3
+ export const LightningIcon3D: FC<SVGProps<SVGSVGElement>> = (props) => (
4
+ <svg
5
+ width="65"
6
+ height="66"
7
+ viewBox="0 0 65 66"
8
+ fill="none"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ {...props}
11
+ >
12
+ <path
13
+ d="M15.6919 40.6473L46.8725 8.13344L32.7614 32.5783L48.3885 32.4863L17.2078 65.0001L31.0542 40.4849L15.6919 40.6473Z"
14
+ fill="#17151F"
15
+ stroke="#17151F"
16
+ strokeLinejoin="round"
17
+ />
18
+ <path
19
+ d="M26.9347 33.3512L11.5723 33.5137L15.6904 40.6464L31.0528 40.484L26.9347 33.3512Z"
20
+ fill="#17151F"
21
+ stroke="#17151F"
22
+ strokeLinejoin="round"
23
+ />
24
+ <path
25
+ d="M48.3886 32.4856L17.208 64.9995L13.0898 57.8667L44.2705 25.3528L48.3886 32.4856Z"
26
+ fill="#E9E8EA"
27
+ />
28
+ <path
29
+ d="M46.8727 8.13278L32.7616 32.5776L28.6435 25.4448L42.7546 1L46.8727 8.13278Z"
30
+ fill="#E9E8EA"
31
+ />
32
+ <path
33
+ d="M48.3886 32.4856L17.208 64.9995L13.0898 57.8667L44.2705 25.3528L48.3886 32.4856Z"
34
+ stroke="#17151F"
35
+ strokeLinejoin="round"
36
+ />
37
+ <path
38
+ d="M46.8727 8.13278L32.7616 32.5776L28.6435 25.4448L42.7546 1L46.8727 8.13278Z"
39
+ stroke="#17151F"
40
+ strokeLinejoin="round"
41
+ />
42
+ <path
43
+ d="M11.5742 33.5139L42.7549 1L28.6438 25.4448L44.2708 25.3528L13.0902 57.8667L26.9366 33.3514L11.5742 33.5139Z"
44
+ fill="#E9E8EA"
45
+ stroke="#17151F"
46
+ strokeLinejoin="round"
47
+ />
48
+ </svg>
49
+ );
@@ -300,8 +300,7 @@ describe("Custom Type Builder", () => {
300
300
  });
301
301
 
302
302
  const user = userEvent.setup();
303
- await user.click(screen.getByTestId("add-slice-dropdown"));
304
- await user.click(screen.getByText("From library"));
303
+ await user.click(screen.getByText("Add from this project"));
305
304
 
306
305
  const slicesToSelect = screen.getAllByTestId("slicezone-modal-item");
307
306
 
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,c,a,e,t,i,f,n,b,u,d,h,l){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[c,n,b,"static/chunks/pages/index-f382c8090bd21628.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":["static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-dda7774c702c6b47.js"],"/changes":[a,"static/chunks/8eec4907-b712959d9f984b68.js",s,e,"static/chunks/918-38d08f1e885b222d.js",t,i,"static/css/be974b8a064b90bc.css","static/chunks/pages/changes-7a3c37a25631d524.js"],"/custom-types":[c,n,b,"static/chunks/pages/custom-types-abb8c8c92880120e.js"],"/custom-types/[customTypeId]":[s,e,u,c,t,f,d,h,"static/chunks/pages/custom-types/[customTypeId]-000131f34adb09ab.js"],"/page-types/[pageTypeId]":[s,e,u,c,t,f,d,h,"static/chunks/pages/page-types/[pageTypeId]-ef69705204e4ca4e.js"],"/slices":[a,s,e,t,i,"static/css/e855bef88bb5345b.css","static/chunks/pages/slices-0333a80308f2058b.js"],"/[lib]/[sliceName]/[variation]":[a,s,i,f,"static/css/d4b59834999106a5.css","static/chunks/pages/[lib]/[sliceName]/[variation]-bd1822e54ac8836c.js"],"/[lib]/[sliceName]/[variation]/screenshot":[l,"static/chunks/pages/[lib]/[sliceName]/[variation]/screenshot-2750adc7cdad5005.js"],"/[lib]/[sliceName]/[variation]/simulator":[a,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-b0b0df3d19f7d641.js",s,l,"static/chunks/677-d8555c165c261511.js","static/chunks/pages/[lib]/[sliceName]/[variation]/simulator-2c6033d99c3672e0.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/page-types/[pageTypeId]","/slices","/[lib]/[sliceName]/[variation]","/[lib]/[sliceName]/[variation]/screenshot","/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/909-e4eec905c21ad8ad.js","static/chunks/799-2ecedfb7a28f9844.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/97-f6188ebe22eb21da.js","static/chunks/906-9224feb63b5e36f3.js","static/chunks/573-aaae870d20e5f86c.js","static/chunks/377-53e916959dab47c4.js","static/chunks/482-ad5ef8eecedd8b52.js","static/css/8488e84efc1f7f54.css","static/chunks/740-d0642219804fa9f0.js","static/chunks/777-a3c83f63c2609096.js","static/css/05ee3752aba1232a.css","static/chunks/746-1d8d106d76d9a63e.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[677],{1611:function(e,t,r){"use strict";r.d(t,{WY:function(){return i},xb:function(){return o}});var n=r(86579);async function i(e,t){let{okType:r,signal:i,headers:o,body:l,timeout:u=1e4,...d}=t,c=new Headers(o);c.has("Content-Type")||c.set("Content-Type","application/json"),"multipart/form-data"===c.get("Content-Type")&&c.delete("Content-Type");let p=s();p&&c.set("Authorization",`Bearer ${p}`);let h="application/json"===c.get("Content-Type")?JSON.stringify(l):l,f=!1;try{let m=new AbortController,y=function(e){let t=new AbortController;function r(){for(let n of(t.abort(),e))n.removeEventListener("abort",r)}for(let n of e){if(n.aborted){r();break}n.addEventListener("abort",r)}return t.signal}([m.signal,i].filter(n.$));setTimeout(()=>{f=!0,m.abort()},u);let g=await fetch(e,{...d,body:h,headers:c,signal:y}),{status:v}=g,_=g.clone(),x=await g.json().catch(e=>_.text());if(g.ok){let b=r.safeParse(x);if(!b.success)throw new a({type:"validation",status:v,cause:b.error});return b.data}throw new a({type:"http",status:v,body:x})}catch(T){var k,w;throw(k=T,k instanceof a)?T:new a((w=T,w instanceof DOMException&&"AbortError"===w.name)?{type:f?"timeout":"abort"}:{type:"unknown",cause:T})}}class a extends Error{constructor(e){super(JSON.stringify(e,null,2)),this.detail=e,this.name="RequestError"}}let s=()=>"";function o(e){return"dev"===e?"same-origin":"include"}},661:function(e,t,r){"use strict";r.d(t,{f:function(){return eR},W:function(){return eZ}}),(ek=eS||(eS={})).assertEqual=e=>e,ek.assertIs=function(e){},ek.assertNever=function(e){throw Error()},ek.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},ek.getValidEnumValues=e=>{let t=ek.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return ek.objectValues(r)},ek.objectValues=e=>ek.objectKeys(e).map(function(t){return e[t]}),ek.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},ek.find=(e,t)=>{for(let r of e)if(t(r))return r},ek.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,ek.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},ek.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(ew=eE||(eE={})).mergeShapes=(e,t)=>({...e,...t});let n=eS.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set",]),i=e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":if(Array.isArray(e))return n.array;if(null===e)return n.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return n.promise;if("undefined"!=typeof Map&&e instanceof Map)return n.map;if("undefined"!=typeof Set&&e instanceof Set)return n.set;if("undefined"!=typeof Date&&e instanceof Date)return n.date;return n.object;default:return n.unknown}},a=eS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite",]);class s extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){let o=i.path[s],l=s===i.path.length-1;l?(a[o]=a[o]||{_errors:[]},a[o]._errors.push(t(i))):a[o]=a[o]||{_errors:[]},a=a[o],s++}}};return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,eS.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>{let t=new s(e);return t};let o=(e,t)=>{let r;switch(e.code){case a.invalid_type:r=e.received===n.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,eS.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:r=`Unrecognized key(s) in object: ${eS.joinValues(e.keys,", ")}`;break;case a.invalid_union:r="Invalid input";break;case a.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${eS.joinValues(e.options)}`;break;case a.invalid_enum_value:r=`Invalid enum value. Expected ${eS.joinValues(e.options)}, received '${e.received}'`;break;case a.invalid_arguments:r="Invalid function arguments";break;case a.invalid_return_type:r="Invalid function return type";break;case a.invalid_date:r="Invalid date";break;case a.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:eS.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.custom:r="Invalid input";break;case a.invalid_intersection_types:r="Intersection results could not be merged";break;case a.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case a.not_finite:r="Number must be finite";break;default:r=t.defaultError,eS.assertNever(e)}return{message:r}},l=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a},o="",l=n.filter(e=>!!e).slice().reverse();for(let u of l)o=u(s,{data:t,defaultError:o}).message;return{...i,path:a,message:i.message||o}};function u(e,t){let r=l({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,o,o].filter(e=>!!e)});e.common.issues.push(r)}class d{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return c;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t)r.push({key:await n.key,value:await n.value});return d.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:i,value:a}=n;if("aborted"===i.status||"aborted"===a.status)return c;"dirty"===i.status&&e.dirty(),"dirty"===a.status&&e.dirty(),(void 0!==a.value||n.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}}let c=Object.freeze({status:"aborted"}),p=e=>({status:"dirty",value:e}),h=e=>({status:"valid",value:e}),f=e=>"aborted"===e.status,m=e=>"dirty"===e.status,y=e=>"valid"===e.status,g=e=>"undefined"!=typeof Promise&&e instanceof Promise;(eT=eO||(eO={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},eT.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class v{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let _=(e,t)=>{if(y(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new s(e.common.issues);return this._error=r,this._error}}};function x(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};let a=(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError};return{errorMap:a,description:i}}class b{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new d,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(g(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:n.path,parent:n});return _(n,a)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await (g(n)?n:Promise.resolve(n));return _(r,a)}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let i=e(t),s=()=>n.addIssue({code:a.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(s(),!1)):!!i||(s(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new el({schema:this,typeName:eN.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return eu.create(this,this._def)}nullable(){return ed.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return H.create(this,this._def)}promise(){return eo.create(this,this._def)}or(e){return q.create([this,e],this._def)}and(e){return X.create(this,e,this._def)}transform(e){return new el({...x(this._def),schema:this,typeName:eN.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ec({...x(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:eN.ZodDefault})}brand(){return new ef({typeName:eN.ZodBranded,type:this,...x(this._def)})}catch(e){return new ep({...x(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:eN.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return em.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let k=/^c[^\s-]{8,}$/i,w=/^[a-z][a-z0-9]*$/,T=/[0-9A-HJKMNP-TV-Z]{26}/,C=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,S=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,E=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,O=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,N=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,P=e=>e.precision?e.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function A(e,t){return!!(("v4"===t||!t)&&O.test(e)||("v6"===t||!t)&&N.test(e))}class I extends b{constructor(){super(...arguments),this._regex=(e,t,r)=>this.refinement(t=>e.test(t),{validation:t,code:a.invalid_string,...eO.errToObj(r)}),this.nonempty=e=>this.min(1,eO.errToObj(e)),this.trim=()=>new I({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new I({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new I({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));let t=this._getType(e);if(t!==n.string){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.string,received:r.parsedType}),c}let i=new d,s;for(let o of this._def.checks)if("min"===o.kind)e.data.length<o.value&&(u(s=this._getOrReturnCtx(e,s),{code:a.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if("max"===o.kind)e.data.length>o.value&&(u(s=this._getOrReturnCtx(e,s),{code:a.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if("length"===o.kind){let l=e.data.length>o.value,p=e.data.length<o.value;(l||p)&&(s=this._getOrReturnCtx(e,s),l?u(s,{code:a.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):p&&u(s,{code:a.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if("email"===o.kind)S.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{validation:"email",code:a.invalid_string,message:o.message}),i.dirty());else if("emoji"===o.kind)E.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{validation:"emoji",code:a.invalid_string,message:o.message}),i.dirty());else if("uuid"===o.kind)C.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{validation:"uuid",code:a.invalid_string,message:o.message}),i.dirty());else if("cuid"===o.kind)k.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{validation:"cuid",code:a.invalid_string,message:o.message}),i.dirty());else if("cuid2"===o.kind)w.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{validation:"cuid2",code:a.invalid_string,message:o.message}),i.dirty());else if("ulid"===o.kind)T.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{validation:"ulid",code:a.invalid_string,message:o.message}),i.dirty());else if("url"===o.kind)try{new URL(e.data)}catch(h){u(s=this._getOrReturnCtx(e,s),{validation:"url",code:a.invalid_string,message:o.message}),i.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;let f=o.regex.test(e.data);f||(u(s=this._getOrReturnCtx(e,s),{validation:"regex",code:a.invalid_string,message:o.message}),i.dirty())}else if("trim"===o.kind)e.data=e.data.trim();else if("includes"===o.kind)e.data.includes(o.value,o.position)||(u(s=this._getOrReturnCtx(e,s),{code:a.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty());else if("toLowerCase"===o.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===o.kind)e.data=e.data.toUpperCase();else if("startsWith"===o.kind)e.data.startsWith(o.value)||(u(s=this._getOrReturnCtx(e,s),{code:a.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty());else if("endsWith"===o.kind)e.data.endsWith(o.value)||(u(s=this._getOrReturnCtx(e,s),{code:a.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty());else if("datetime"===o.kind){let m=P(o);m.test(e.data)||(u(s=this._getOrReturnCtx(e,s),{code:a.invalid_string,validation:"datetime",message:o.message}),i.dirty())}else"ip"===o.kind?A(e.data,o.version)||(u(s=this._getOrReturnCtx(e,s),{validation:"ip",code:a.invalid_string,message:o.message}),i.dirty()):eS.assertNever(o);return{status:i.value,value:e.data}}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...eO.errToObj(e)})}url(e){return this._addCheck({kind:"url",...eO.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...eO.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...eO.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...eO.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...eO.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...eO.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...eO.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...eO.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...eO.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...eO.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...eO.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...eO.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...eO.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...eO.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...eO.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function j(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}I.create=e=>{var t;return new I({checks:[],typeName:eN.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...x(e)})};class Z extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));let t=this._getType(e);if(t!==n.number){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.number,received:r.parsedType}),c}let i,s=new d;for(let o of this._def.checks)if("int"===o.kind)eS.isInteger(e.data)||(u(i=this._getOrReturnCtx(e,i),{code:a.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty());else if("min"===o.kind){let l=o.inclusive?e.data<o.value:e.data<=o.value;l&&(u(i=this._getOrReturnCtx(e,i),{code:a.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty())}else if("max"===o.kind){let p=o.inclusive?e.data>o.value:e.data>=o.value;p&&(u(i=this._getOrReturnCtx(e,i),{code:a.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty())}else"multipleOf"===o.kind?0!==j(e.data,o.value)&&(u(i=this._getOrReturnCtx(e,i),{code:a.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):"finite"===o.kind?Number.isFinite(e.data)||(u(i=this._getOrReturnCtx(e,i),{code:a.not_finite,message:o.message}),s.dirty()):eS.assertNever(o);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,eO.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eO.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eO.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eO.toString(t))}setLimit(e,t,r,n){return new Z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eO.toString(n)},]})}_addCheck(e){return new Z({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:eO.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:eO.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:eO.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:eO.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:eO.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eO.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:eO.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:eO.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:eO.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&eS.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Z.create=e=>new Z({checks:[],typeName:eN.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...x(e)});class R extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));let t=this._getType(e);if(t!==n.bigint){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.bigint,received:r.parsedType}),c}let i,s=new d;for(let o of this._def.checks)if("min"===o.kind){let l=o.inclusive?e.data<o.value:e.data<=o.value;l&&(u(i=this._getOrReturnCtx(e,i),{code:a.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty())}else if("max"===o.kind){let p=o.inclusive?e.data>o.value:e.data>=o.value;p&&(u(i=this._getOrReturnCtx(e,i),{code:a.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty())}else"multipleOf"===o.kind?e.data%o.value!==BigInt(0)&&(u(i=this._getOrReturnCtx(e,i),{code:a.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):eS.assertNever(o);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,eO.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eO.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eO.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eO.toString(t))}setLimit(e,t,r,n){return new R({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eO.toString(n)},]})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:eO.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:eO.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:eO.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:eO.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eO.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}R.create=e=>{var t;return new R({checks:[],typeName:eN.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...x(e)})};class M extends b{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));let t=this._getType(e);if(t!==n.boolean){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.boolean,received:r.parsedType}),c}return h(e.data)}}M.create=e=>new M({typeName:eN.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...x(e)});class L extends b{_parse(e){this._def.coerce&&(e.data=new Date(e.data));let t=this._getType(e);if(t!==n.date){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.date,received:r.parsedType}),c}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return u(i,{code:a.invalid_date}),c}let s=new d,o;for(let l of this._def.checks)"min"===l.kind?e.data.getTime()<l.value&&(u(o=this._getOrReturnCtx(e,o),{code:a.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),s.dirty()):"max"===l.kind?e.data.getTime()>l.value&&(u(o=this._getOrReturnCtx(e,o),{code:a.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),s.dirty()):eS.assertNever(l);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:eO.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:eO.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}L.create=e=>new L({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:eN.ZodDate,...x(e)});class D extends b{_parse(e){let t=this._getType(e);if(t!==n.symbol){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.symbol,received:r.parsedType}),c}return h(e.data)}}D.create=e=>new D({typeName:eN.ZodSymbol,...x(e)});class z extends b{_parse(e){let t=this._getType(e);if(t!==n.undefined){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.undefined,received:r.parsedType}),c}return h(e.data)}}z.create=e=>new z({typeName:eN.ZodUndefined,...x(e)});class F extends b{_parse(e){let t=this._getType(e);if(t!==n.null){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.null,received:r.parsedType}),c}return h(e.data)}}F.create=e=>new F({typeName:eN.ZodNull,...x(e)});class $ extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return h(e.data)}}$.create=e=>new $({typeName:eN.ZodAny,...x(e)});class V extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return h(e.data)}}V.create=e=>new V({typeName:eN.ZodUnknown,...x(e)});class U extends b{_parse(e){let t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.never,received:t.parsedType}),c}}U.create=e=>new U({typeName:eN.ZodNever,...x(e)});class B extends b{_parse(e){let t=this._getType(e);if(t!==n.undefined){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.void,received:r.parsedType}),c}return h(e.data)}}B.create=e=>new B({typeName:eN.ZodVoid,...x(e)});class H extends b{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==n.array)return u(t,{code:a.invalid_type,expected:n.array,received:t.parsedType}),c;if(null!==i.exactLength){let s=t.data.length>i.exactLength.value,o=t.data.length<i.exactLength.value;(s||o)&&(u(t,{code:s?a.too_big:a.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&(u(t,{code:a.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&(u(t,{code:a.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>i.type._parseAsync(new v(t,e,t.path,r)))).then(e=>d.mergeArray(r,e));let l=[...t.data].map((e,r)=>i.type._parseSync(new v(t,e,t.path,r)));return d.mergeArray(r,l)}get element(){return this._def.type}min(e,t){return new H({...this._def,minLength:{value:e,message:eO.toString(t)}})}max(e,t){return new H({...this._def,maxLength:{value:e,message:eO.toString(t)}})}length(e,t){return new H({...this._def,exactLength:{value:e,message:eO.toString(t)}})}nonempty(e){return this.min(1,e)}}H.create=(e,t)=>new H({type:e,minLength:null,maxLength:null,exactLength:null,typeName:eN.ZodArray,...x(t)});class W extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=eS.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){let t=this._getType(e);if(t!==n.object){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.object,received:r.parsedType}),c}let{status:i,ctx:s}=this._processInputParams(e),{shape:o,keys:l}=this._getCached(),p=[];if(!(this._def.catchall instanceof U&&"strip"===this._def.unknownKeys))for(let h in s.data)l.includes(h)||p.push(h);let f=[];for(let m of l){let y=o[m],g=s.data[m];f.push({key:{status:"valid",value:m},value:y._parse(new v(s,g,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof U){let _=this._def.unknownKeys;if("passthrough"===_)for(let x of p)f.push({key:{status:"valid",value:x},value:{status:"valid",value:s.data[x]}});else if("strict"===_)p.length>0&&(u(s,{code:a.unrecognized_keys,keys:p}),i.dirty());else if("strip"===_);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let b=this._def.catchall;for(let k of p){let w=s.data[k];f.push({key:{status:"valid",value:k},value:b._parse(new v(s,w,s.path,k)),alwaysSet:k in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of f){let r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>d.mergeObjectSync(i,e)):d.mergeObjectSync(i,f)}get shape(){return this._def.shape()}strict(e){return eO.errToObj,new W({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,a,s;let o=null!==(a=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=eO.errToObj(e).message)&&void 0!==s?s:o}:{message:o}}}:{}})}strip(){return new W({...this._def,unknownKeys:"strip"})}passthrough(){return new W({...this._def,unknownKeys:"passthrough"})}extend(e){return new W({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){let t=new W({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:eN.ZodObject});return t}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new W({...this._def,catchall:e})}pick(e){let t={};return eS.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new W({...this._def,shape:()=>t})}omit(e){let t={};return eS.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new W({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof W){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=eu.create(e(i))}return new W({...t._def,shape:()=>r})}if(t instanceof H)return new H({...t._def,type:e(t.element)});if(t instanceof eu)return eu.create(e(t.unwrap()));if(t instanceof ed)return ed.create(e(t.unwrap()));if(t instanceof Y)return Y.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};return eS.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new W({...this._def,shape:()=>t})}required(e){let t={};return eS.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r],i=n;for(;i instanceof eu;)i=i._def.innerType;t[r]=i}}),new W({...this._def,shape:()=>t})}keyof(){return ei(eS.objectKeys(this.shape))}}W.create=(e,t)=>new W({shape:()=>e,unknownKeys:"strip",catchall:U.create(),typeName:eN.ZodObject,...x(t)}),W.strictCreate=(e,t)=>new W({shape:()=>e,unknownKeys:"strict",catchall:U.create(),typeName:eN.ZodObject,...x(t)}),W.lazycreate=(e,t)=>new W({shape:e,unknownKeys:"strip",catchall:U.create(),typeName:eN.ZodObject,...x(t)});class q extends b{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let r of e)if("valid"===r.result.status)return r.result;for(let n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;let i=e.map(e=>new s(e.ctx.common.issues));return u(t,{code:a.invalid_union,unionErrors:i}),c});{let n,i=[];for(let o of r){let l={...t,common:{...t.common,issues:[]},parent:null},d=o._parseSync({data:t.data,path:t.path,parent:l});if("valid"===d.status)return d;"dirty"!==d.status||n||(n={result:d,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let p=i.map(e=>new s(e));return u(t,{code:a.invalid_union,unionErrors:p}),c}}get options(){return this._def.options}}q.create=(e,t)=>new q({options:e,typeName:eN.ZodUnion,...x(t)});let K=e=>{if(e instanceof er)return K(e.schema);if(e instanceof el)return K(e.innerType());if(e instanceof en)return[e.value];if(e instanceof ea)return e.options;if(e instanceof es)return Object.keys(e.enum);else if(e instanceof ec)return K(e._def.innerType);else if(e instanceof z)return[void 0];else if(e instanceof F)return[null];else return null};class G extends b{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.object)return u(t,{code:a.invalid_type,expected:n.object,received:t.parsedType}),c;let r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),c)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let i of t){let a=K(i.shape[e]);if(!a)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,i)}}return new G({typeName:eN.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...x(r)})}}class X extends b{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=(e,s)=>{if(f(e)||f(s))return c;let o=function e(t,r){let a=i(t),s=i(r);if(t===r)return{valid:!0,data:t};if(a===n.object&&s===n.object){let o=eS.objectKeys(r),l=eS.objectKeys(t).filter(e=>-1!==o.indexOf(e)),u={...t,...r};for(let d of l){let c=e(t[d],r[d]);if(!c.valid)return{valid:!1};u[d]=c.data}return{valid:!0,data:u}}if(a===n.array&&s===n.array){if(t.length!==r.length)return{valid:!1};let p=[];for(let h=0;h<t.length;h++){let f=t[h],m=r[h],y=e(f,m);if(!y.valid)return{valid:!1};p.push(y.data)}return{valid:!0,data:p}}if(a===n.date&&s===n.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,s.value);return o.valid?((m(e)||m(s))&&t.dirty(),{status:t.value,value:o.data}):(u(r,{code:a.invalid_intersection_types}),c)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r}),]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}X.create=(e,t,r)=>new X({left:e,right:t,typeName:eN.ZodIntersection,...x(r)});class Y extends b{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.array)return u(r,{code:a.invalid_type,expected:n.array,received:r.parsedType}),c;if(r.data.length<this._def.items.length)return u(r,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c;let i=this._def.rest;!i&&r.data.length>this._def.items.length&&(u(r,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new v(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(s).then(e=>d.mergeArray(t,e)):d.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Y({...this._def,rest:e})}}Y.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y({items:e,typeName:eN.ZodTuple,rest:null,...x(t)})};class J extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.object)return u(r,{code:a.invalid_type,expected:n.object,received:r.parsedType}),c;let i=[],s=this._def.keyType,o=this._def.valueType;for(let l in r.data)i.push({key:s._parse(new v(r,l,r.path,l)),value:o._parse(new v(r,r.data[l],r.path,l))});return r.common.async?d.mergeObjectAsync(t,i):d.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return new J(t instanceof b?{keyType:e,valueType:t,typeName:eN.ZodRecord,...x(r)}:{keyType:I.create(),valueType:e,typeName:eN.ZodRecord,...x(t)})}}class Q extends b{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.map)return u(r,{code:a.invalid_type,expected:n.map,received:r.parsedType}),c;let i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([e,t],n)=>({key:i._parse(new v(r,e,r.path,[n,"key"])),value:s._parse(new v(r,t,r.path,[n,"value"]))}));if(r.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let e of o){let r=await e.key,n=await e.value;if("aborted"===r.status||"aborted"===n.status)return c;("dirty"===r.status||"dirty"===n.status)&&t.dirty(),l.set(r.value,n.value)}return{status:t.value,value:l}})}{let d=new Map;for(let p of o){let h=p.key,f=p.value;if("aborted"===h.status||"aborted"===f.status)return c;("dirty"===h.status||"dirty"===f.status)&&t.dirty(),d.set(h.value,f.value)}return{status:t.value,value:d}}}}Q.create=(e,t,r)=>new Q({valueType:t,keyType:e,typeName:eN.ZodMap,...x(r)});class ee extends b{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.set)return u(r,{code:a.invalid_type,expected:n.set,received:r.parsedType}),c;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(u(r,{code:a.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&(u(r,{code:a.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function o(e){let r=new Set;for(let n of e){if("aborted"===n.status)return c;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let l=[...r.data.values()].map((e,t)=>s._parse(new v(r,e,r.path,t)));return r.common.async?Promise.all(l).then(e=>o(e)):o(l)}min(e,t){return new ee({...this._def,minSize:{value:e,message:eO.toString(t)}})}max(e,t){return new ee({...this._def,maxSize:{value:e,message:eO.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ee.create=(e,t)=>new ee({valueType:e,minSize:null,maxSize:null,typeName:eN.ZodSet,...x(t)});class et extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.function)return u(t,{code:a.invalid_type,expected:n.function,received:t.parsedType}),c;function r(e,r){return l({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o,].filter(e=>!!e),issueData:{code:a.invalid_arguments,argumentsError:r}})}function i(e,r){return l({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o,].filter(e=>!!e),issueData:{code:a.invalid_return_type,returnTypeError:r}})}let d={errorMap:t.common.contextualErrorMap},p=t.data;return this._def.returns instanceof eo?h(async(...e)=>{let t=new s([]),n=await this._def.args.parseAsync(e,d).catch(n=>{throw t.addIssue(r(e,n)),t}),a=await p(...n),o=await this._def.returns._def.type.parseAsync(a,d).catch(e=>{throw t.addIssue(i(a,e)),t});return o}):h((...e)=>{let t=this._def.args.safeParse(e,d);if(!t.success)throw new s([r(e,t.error)]);let n=p(...t.data),a=this._def.returns.safeParse(n,d);if(!a.success)throw new s([i(n,a.error)]);return a.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new et({...this._def,args:Y.create(e).rest(V.create())})}returns(e){return new et({...this._def,returns:e})}implement(e){let t=this.parse(e);return t}strictImplement(e){let t=this.parse(e);return t}static create(e,t,r){return new et({args:e||Y.create([]).rest(V.create()),returns:t||V.create(),typeName:eN.ZodFunction,...x(r)})}}class er extends b{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.getter();return r._parse({data:t.data,path:t.path,parent:t})}}er.create=(e,t)=>new er({getter:e,typeName:eN.ZodLazy,...x(t)});class en extends b{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),c}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ei(e,t){return new ea({values:e,typeName:eN.ZodEnum,...x(t)})}en.create=(e,t)=>new en({value:e,typeName:eN.ZodLiteral,...x(t)});class ea extends b{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return u(t,{expected:eS.joinValues(r),received:t.parsedType,code:a.invalid_type}),c}if(-1===this._def.values.indexOf(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return u(n,{received:n.data,code:a.invalid_enum_value,options:i}),c}return h(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return ea.create(e)}exclude(e){return ea.create(this.options.filter(t=>!e.includes(t)))}}ea.create=ei;class es extends b{_parse(e){let t=eS.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==n.string&&r.parsedType!==n.number){let i=eS.objectValues(t);return u(r,{expected:eS.joinValues(i),received:r.parsedType,code:a.invalid_type}),c}if(-1===t.indexOf(e.data)){let s=eS.objectValues(t);return u(r,{received:r.data,code:a.invalid_enum_value,options:s}),c}return h(e.data)}get enum(){return this._def.values}}es.create=(e,t)=>new es({values:e,typeName:eN.ZodNativeEnum,...x(t)});class eo extends b{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&!1===t.common.async)return u(t,{code:a.invalid_type,expected:n.promise,received:t.parsedType}),c;let r=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return h(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eo.create=(e,t)=>new eo({type:e,typeName:eN.ZodPromise,...x(t)});class el extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===eN.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null;if("preprocess"===n.type){let i=n.transform(r.data);return r.common.async?Promise.resolve(i).then(e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r})):this._def.schema._parseSync({data:i,path:r.path,parent:r})}let a={addIssue(e){u(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),"refinement"===n.type){let s=e=>{let t=n.refinement(e,a);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"aborted"===e.status?c:("dirty"===e.status&&t.dirty(),s(e.value).then(()=>({status:t.value,value:e.value}))));{let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===o.status?c:("dirty"===o.status&&t.dirty(),s(o.value),{status:t.value,value:o.value})}}if("transform"===n.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>y(e)?Promise.resolve(n.transform(e.value,a)).then(e=>({status:t.value,value:e})):e);{let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!y(l))return l;let d=n.transform(l.value,a);if(d instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}}eS.assertNever(n)}}el.create=(e,t,r)=>new el({schema:e,typeName:eN.ZodEffects,effect:t,...x(r)}),el.createWithPreprocess=(e,t,r)=>new el({schema:t,effect:{type:"preprocess",transform:e},typeName:eN.ZodEffects,...x(r)});class eu extends b{_parse(e){let t=this._getType(e);return t===n.undefined?h(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eu.create=(e,t)=>new eu({innerType:e,typeName:eN.ZodOptional,...x(t)});class ed extends b{_parse(e){let t=this._getType(e);return t===n.null?h(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ed.create=(e,t)=>new ed({innerType:e,typeName:eN.ZodNullable,...x(t)});class ec extends b{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===n.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ec.create=(e,t)=>new ec({innerType:e,typeName:eN.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...x(t)});class ep extends b{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return g(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ep.create=(e,t)=>new ep({innerType:e,typeName:eN.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...x(t)});class eh extends b{_parse(e){let t=this._getType(e);if(t!==n.nan){let r=this._getOrReturnCtx(e);return u(r,{code:a.invalid_type,expected:n.nan,received:r.parsedType}),c}return{status:"valid",value:e.data}}}eh.create=e=>new eh({typeName:eN.ZodNaN,...x(e)}),Symbol("zod_brand");class ef extends b{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class em extends b{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){let n=async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c:"dirty"===e.status?(t.dirty(),p(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})};return n()}{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?c:"dirty"===i.status?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new em({in:e,out:t,typeName:eN.ZodPipeline})}}W.lazycreate,(eC=eN||(eN={})).ZodString="ZodString",eC.ZodNumber="ZodNumber",eC.ZodNaN="ZodNaN",eC.ZodBigInt="ZodBigInt",eC.ZodBoolean="ZodBoolean",eC.ZodDate="ZodDate",eC.ZodSymbol="ZodSymbol",eC.ZodUndefined="ZodUndefined",eC.ZodNull="ZodNull",eC.ZodAny="ZodAny",eC.ZodUnknown="ZodUnknown",eC.ZodNever="ZodNever",eC.ZodVoid="ZodVoid",eC.ZodArray="ZodArray",eC.ZodObject="ZodObject",eC.ZodUnion="ZodUnion",eC.ZodDiscriminatedUnion="ZodDiscriminatedUnion",eC.ZodIntersection="ZodIntersection",eC.ZodTuple="ZodTuple",eC.ZodRecord="ZodRecord",eC.ZodMap="ZodMap",eC.ZodSet="ZodSet",eC.ZodFunction="ZodFunction",eC.ZodLazy="ZodLazy",eC.ZodLiteral="ZodLiteral",eC.ZodEnum="ZodEnum",eC.ZodEffects="ZodEffects",eC.ZodNativeEnum="ZodNativeEnum",eC.ZodOptional="ZodOptional",eC.ZodNullable="ZodNullable",eC.ZodDefault="ZodDefault",eC.ZodCatch="ZodCatch",eC.ZodPromise="ZodPromise",eC.ZodBranded="ZodBranded",eC.ZodPipeline="ZodPipeline";let ey=I.create,eg=Z.create,ev=(eh.create,R.create,M.create,L.create,D.create,z.create,F.create,$.create,V.create,U.create,B.create,H.create),e_=W.create,ex=(W.strictCreate,q.create,G.create),eb=(X.create,Y.create,J.create,Q.create,ee.create,et.create,er.create,en.create);ea.create,es.create,eo.create,el.create,eu.create,ed.create,el.createWithPreprocess,em.create;var ek,ew,eT,eC,eS,eE,eO,eN,eP=r(1611);let eA=ex("status",[e_({status:eb("unclassified")}),e_({status:eb("published")}),e_({status:eb("release"),release_id:ey()}),e_({status:eb("archived")})]).and(e_({version_id:ey(),tags:ev(ey()),custom_type_label:ey(),preview_summary:ey().optional(),preview_image:ey().optional()})),eI=e_({id:ey(),custom_type_id:ey(),title:ey(),versions:ev(eA)}),ej=e_({total:eg(),cursor:ey().optional(),results:ev(eI)});function eZ(e,t,r,n,i){let a=new URLSearchParams({limit:i.toString(),...t&&{cursor:t}});return(0,eP.WY)(`${e}/documents?${a.toString()}&${n}`,{credentials:(0,eP.xb)(r),okType:ej})}function eR(e){return e.reduce((e,t)=>{let r=t.values.map(e=>[t.name,e]);return e.concat(r)},[])}},52393:function(e,t,r){"use strict";function n(e,t){for(let r of e)if(t(r))return!0;return!1}r.d(t,{G:function(){return n}})},77252:function(e,t,r){"use strict";function n(e){try{return new URL(e)}catch{return}}r.d(t,{j:function(){return n}})},34821:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,(n=r=t.ElementType||(t.ElementType={})).Root="root",n.Text="text",n.Directive="directive",n.Comment="comment",n.Script="script",n.Style="style",n.Tag="tag",n.CDATA="cdata",n.Doctype="doctype",t.isTag=function(e){return e.type===r.Tag||e.type===r.Script||e.type===r.Style},t.Root=r.Root,t.Text=r.Text,t.Directive=r.Directive,t.Comment=r.Comment,t.Script=r.Script,t.Style=r.Style,t.Tag=r.Tag,t.CDATA=r.CDATA,t.Doctype=r.Doctype},79959:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var a=r(34821),s=r(75538);i(r(75538),t);var o={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,r){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(r=t,t=o),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:o,this.elementCB=null!=r?r:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var r=this.options.xmlMode?a.ElementType.Tag:void 0,n=new s.Element(e,t,void 0,r);this.addNode(n),this.tagStack.push(n)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===a.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var r=new s.Text(e);this.addNode(r),this.lastNode=r}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment){this.lastNode.data+=e;return}var t=new s.Comment(e);this.addNode(t),this.lastNode=t},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new s.Text(""),t=new s.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var r=new s.ProcessingInstruction(e,t);this.addNode(r)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],r=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),r&&(e.prev=r,r.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},75538:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.CDATA=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var s=r(34821),o=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),k(this,e)},e}();t.Node=o;var l=function(e){function t(t){var r=e.call(this)||this;return r.data=t,r}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(o);t.DataNode=l;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Text,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(l);t.Text=u;var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Comment,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(l);t.Comment=d;var c=function(e){function t(t,r){var n=e.call(this,r)||this;return n.name=t,n.type=s.ElementType.Directive,n}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(l);t.ProcessingInstruction=c;var p=function(e){function t(t){var r=e.call(this)||this;return r.children=t,r}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(o);t.NodeWithChildren=p;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.CDATA,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=h;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Root,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=f;var m=function(e){function t(t,r,n,i){void 0===n&&(n=[]),void 0===i&&(i="script"===t?s.ElementType.Script:"style"===t?s.ElementType.Style:s.ElementType.Tag);var a=e.call(this,n)||this;return a.name=t,a.attribs=r,a.type=i,a}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){var r,n;return{name:t,value:e.attribs[t],namespace:null===(r=e["x-attribsNamespace"])||void 0===r?void 0:r[t],prefix:null===(n=e["x-attribsPrefix"])||void 0===n?void 0:n[t]}})},enumerable:!1,configurable:!0}),t}(p);function y(e){return(0,s.isTag)(e)}function g(e){return e.type===s.ElementType.CDATA}function v(e){return e.type===s.ElementType.Text}function _(e){return e.type===s.ElementType.Comment}function x(e){return e.type===s.ElementType.Directive}function b(e){return e.type===s.ElementType.Root}function k(e,t){if(void 0===t&&(t=!1),v(e))r=new u(e.data);else if(_(e))r=new d(e.data);else if(y(e)){var r,n=t?w(e.children):[],i=new m(e.name,a({},e.attribs),n);n.forEach(function(e){return e.parent=i}),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=a({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=a({},e["x-attribsPrefix"])),r=i}else if(g(e)){var n=t?w(e.children):[],s=new h(n);n.forEach(function(e){return e.parent=s}),r=s}else if(b(e)){var n=t?w(e.children):[],o=new f(n);n.forEach(function(e){return e.parent=o}),e["x-mode"]&&(o["x-mode"]=e["x-mode"]),r=o}else if(x(e)){var l=new c(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),r=l}else throw Error("Not implemented yet: ".concat(e.type));return r.startIndex=e.startIndex,r.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(r.sourceCodeLocation=e.sourceCodeLocation),r}function w(e){for(var t=e.map(function(e){return k(e,!0)}),r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}t.Element=m,t.isTag=y,t.isCDATA=g,t.isText=v,t.isComment=_,t.isDirective=x,t.isDocument=b,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=k},8401:function(e,t){t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]},58166:function(e){var t,r="html",n="head",i="body",a=/<([a-zA-Z]+[0-9]?)/,s=/<head[^]*>/i,o=/<body[^]*>/i,l=function(){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},u=function(){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},d="object"==typeof window&&window.DOMParser;if("function"==typeof d){var c=new d;l=u=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),c.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var p=document.implementation.createHTMLDocument();l=function(e,t){return t?(p.documentElement.querySelector(t).innerHTML=e,p):(p.documentElement.innerHTML=e,p)}}var h="object"==typeof document?document.createElement("template"):{};h.content&&(t=function(e){return h.innerHTML=e,h.content.childNodes}),e.exports=function(e){var d,c,p,h,f=e.match(a);switch(f&&f[1]&&(d=f[1].toLowerCase()),d){case r:return c=u(e),!s.test(e)&&(p=c.querySelector(n))&&p.parentNode.removeChild(p),!o.test(e)&&(p=c.querySelector(i))&&p.parentNode.removeChild(p),c.querySelectorAll(r);case n:case i:if(h=(c=l(e)).querySelectorAll(d),o.test(e)&&s.test(e))return h[0].parentNode.childNodes;return h;default:if(t)return t(e);return(p=l(e,i).querySelector(i)).childNodes}}},50307:function(e,t,r){var n=r(58166),i=r(41594).formatDOM,a=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw TypeError("First argument must be a string");if(""===e)return[];var t,r=e.match(a);return r&&r[1]&&(t=r[1]),i(n(e),null,t)}},41594:function(e,t,r){for(var n,i=r(79959),a=r(8401).CASE_SENSITIVE_TAG_NAMES,s=i.Comment,o=i.Element,l=i.ProcessingInstruction,u=i.Text,d={},c=0,p=a.length;c<p;c++)d[(n=a[c]).toLowerCase()]=n;function h(e){for(var t,r={},n=0,i=e.length;n<i;n++)r[(t=e[n]).name]=t.value;return r}function f(e){var t,r=d[t=e=e.toLowerCase()];return r||e}t.formatAttributes=h,t.formatDOM=function e(t,r,n){r=r||null;for(var i=[],a=0,d=t.length;a<d;a++){var c,p,m=t[a];switch(m.nodeType){case 1:c=f(m.nodeName),(p=new o(c,h(m.attributes))).children=e("template"===c?m.content.childNodes:m.childNodes,p);break;case 3:p=new u(m.nodeValue);break;case 8:p=new s(m.nodeValue);break;default:continue}var y=i[a-1]||null;y&&(y.next=p),p.parent=r,p.prev=y,p.next=null,i.push(p)}return n&&((p=new l(n.substring(0,n.indexOf(" ")).toLowerCase(),n)).next=i[0]||null,p.parent=r,i.unshift(p),i[1]&&(i[1].prev=i[0])),i}},72670:function(e,t,r){var n=r(79959),i=r(50307),a=r(13683),s=r(69239);i="function"==typeof i.default?i.default:i;var o={lowerCaseAttributeNames:!1};function l(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");return""===e?[]:s(i(e,(t=t||{}).htmlparser2||o),t)}l.domToReact=s,l.htmlToDOM=i,l.attributesToProps=a,l.Comment=n.Comment,l.Element=n.Element,l.ProcessingInstruction=n.ProcessingInstruction,l.Text=n.Text,e.exports=l,l.default=l},13683:function(e,t,r){var n=r(18701),i=r(54848),a=["checked","value"],s=["input","select","textarea"],o={reset:!0,submit:!0};function l(e){return n.possibleStandardNames[e]}e.exports=function(e,t){var r,u,d,c,p,h={},f=(e=e||{}).type&&o[e.type];for(r in e){if(d=e[r],n.isCustomAttribute(r)){h[r]=d;continue}if(c=l(u=r.toLowerCase())){switch(p=n.getPropertyInfo(c),-1===a.indexOf(c)||-1===s.indexOf(t)||f||(c=l("default"+u)),h[c]=d,p&&p.type){case n.BOOLEAN:h[c]=!0;break;case n.OVERLOADED_BOOLEAN:""===d&&(h[c]=!0)}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(h[r]=d)}return i.setStyleProp(e.style,h),h}},69239:function(e,t,r){var n=r(2784),i=r(13683),a=r(54848),s=a.setStyleProp,o=a.canTextBeChildOfNode;function l(e){return a.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&a.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,r){for(var a,u,d,c,p,h=(r=r||{}).library||n,f=h.cloneElement,m=h.createElement,y=h.isValidElement,g=[],v="function"==typeof r.replace,_=r.trim,x=0,b=t.length;x<b;x++){if(a=t[x],v&&y(d=r.replace(a))){b>1&&(d=f(d,{key:d.key||x})),g.push(d);continue}if("text"===a.type){if((u=!a.data.trim().length)&&a.parent&&!o(a.parent)||_&&u)continue;g.push(a.data);continue}switch(c=a.attribs,l(a)?s(c.style,c):c&&(c=i(c,a.name)),p=null,a.type){case"script":case"style":a.children[0]&&(c.dangerouslySetInnerHTML={__html:a.children[0].data});break;case"tag":"textarea"===a.name&&a.children[0]?c.defaultValue=a.children[0].data:a.children&&a.children.length&&(p=e(a.children,r));break;default:continue}b>1&&(c.key=x),g.push(m(a.name,c,p))}return 1===g.length?g[0]:g}},54848:function(e,t,r){var n=r(2784),i=r(91618).default,a={reactCompat:!0},s=n.version.split(".")[0]>=16,o=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:s,invertObject:function(e,t){if(!e||"object"!=typeof e)throw TypeError("First argument must be an object");var r,n,i="function"==typeof t,a={},s={};for(r in e){if(n=e[r],i&&(a=t(r,n))&&2===a.length){s[a[0]]=a[1];continue}"string"==typeof n&&(s[n]=r)}return s},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=i(e,a)}catch(r){t.style={}}},canTextBeChildOfNode:function(e){return!o.has(e.name)},elementsWithNoTextChildren:o}},6299:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,c=1;function p(e){var t=e.match(r);t&&(d+=t.length);var n=e.lastIndexOf("\n");c=~n?e.length-n:c+e.length}function h(){var e={line:d,column:c};return function(t){return t.position=new f(e),v(),t}}function f(e){this.start=e,this.end={line:d,column:c},this.source=l.source}f.prototype.content=e;var m=[];function y(t){var r=Error(l.source+":"+d+":"+c+": "+t);if(r.reason=t,r.filename=l.source,r.line=d,r.column=c,r.source=e,l.silent)m.push(r);else throw r}function g(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function v(){g(n)}function _(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return y("End of comment missing");var n=e.slice(2,r-2);return c+=2,p(n),e=e.slice(r),c+=2,t({type:"comment",comment:n})}}function b(){var e=h(),r=g(i);if(r){if(x(),!g(a))return y("property missing ':'");var n=g(s),l=e({type:"declaration",property:u(r[0].replace(t,"")),value:n?u(n[0].replace(t,"")):""});return g(o),l}}return v(),function(){var e,t=[];for(_(t);e=b();)!1!==e&&(t.push(e),_(t));return t}()}},18701:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,i,a,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}Object.defineProperty(t,"__esModule",{value:!0});var a={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(function(e){a[e]=new i(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t,r,s=function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],s=!0,o=!1;try{for(i=i.call(e);!(s=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(l){o=!0,n=l}finally{try{s||null==i.return||i.return()}finally{if(o)throw n}}return a}}(e,2)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=s[0],l=s[1];a[o]=new i(o,1,!1,l,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){a[e]=new i(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){a[e]=new i(e,2,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(e){a[e]=new i(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){a[e]=new i(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){a[e]=new i(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){a[e]=new i(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){a[e]=new i(e,5,!1,e.toLowerCase(),null,!1,!1)});var s=/[\-\:]([a-z])/g,o=function(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(e){var t=e.replace(s,o);a[t]=new i(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(e){var t=e.replace(s,o);a[t]=new i(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(s,o);a[t]=new i(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){a[e]=new i(e,1,!1,e.toLowerCase(),null,!1,!1)}),a.xlinkHref=new i("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){a[e]=new i(e,1,!1,e.toLowerCase(),null,!0,!0)});var l=r(52558),u=l.CAMELCASE,d=l.SAME,c=l.possibleStandardNames,p=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),h=Object.keys(c).reduce(function(e,t){var r=c[t];return r===d?e[t]=t:r===u?e[t.toLowerCase()]=t:e[t]=r,e},{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return a.hasOwnProperty(e)?a[e]:null},t.isCustomAttribute=p,t.possibleStandardNames=h},52558:function(e,t){t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},91618:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var i=n(r(85653)),a=r(31380);t.default=function(e,t){var r={};return e&&"string"==typeof e&&(0,i.default)(e,function(e,n){e&&n&&(r[(0,a.camelCase)(e,t)]=n)}),r}},31380:function(e,t){"use strict";t.__esModule=!0,t.camelCase=void 0;var r=/^--[a-zA-Z0-9-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")},u=function(e,t){var u;return(void 0===t&&(t={}),!(u=e)||i.test(u)||r.test(u))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(a,l)).replace(n,o))};t.camelCase=u},85653:function(e,t,r){var n=r(6299);function i(e,t){var r,i,a,s=null;if(!e||"string"!=typeof e)return s;for(var o=n(e),l="function"==typeof t,u=0,d=o.length;u<d;u++)i=(r=o[u]).property,a=r.value,l?t(i,a,r):a&&(s||(s={}),s[i]=a);return s}e.exports=i,e.exports.default=i},86741:function(e,t,r){"use strict";r.d(t,{W_:function(){return a},du:function(){return i}});var n=r(72670),i=n.domToReact;n.htmlToDOM,n.attributesToProps,n.Comment;var a=n.Element;n.ProcessingInstruction,n.Text,t.ZP=n},33402:function(e,t,r){"use strict";function n(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}r.d(t,{Z:function(){return n}})}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[777],{44221:function(e,n,t){"use strict";t.d(n,{c:function(){return k}});var i=t(22710),r=t(62230),s=t(85244),c=t(81541),o=t(99267),a=t(52322),l=t(75289),d=t(2784),u=t(36131),m=t(5632),f=t(607),p=t(68780),h=t(88932),v=t(38876),x=t(40147),b=t(82770),y=t(13858);function j(){return(j=(0,i.Z)(function(e){var n,t,i,r,s,c,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:var l;return o.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,l=n,r={id:(0,v.T3)(l),type:"SharedSlice",name:l,description:l,variations:[{id:S,name:(0,v.MP)(S),docURL:"...",version:"initial",description:(0,v.MP)(S),imageUrl:""},]},[4,x.j.slices.createSlice({libraryID:t,model:r})];case 1:if((s=o.sent().errors).length>0)throw s;return b.Xe.track({event:"slice:created",id:(0,v.MP)(n),name:n,library:t}),[4,i(r)];case 2:return o.sent(),h.Am.success((0,y.kQ)({path:"".concat(t,"/").concat(r.name,"/model.json")})),[3,4];case 3:return c=o.sent(),a="Internal Error: Slice not created",console.error(a,c),h.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var S="default",g=t(90374),_=t(78656),C=t(66443),Z=t(70041),T={getBuilderPagePathname:function(e){var n=e.libraryName,t=e.sliceName,i=e.variationId;return"/".concat(n.replace(/\//g,"--"),"/").concat(t,"/").concat(i)}},k=function(e){var n,t=e.onClose,h=e.localLibraries,v=e.remoteSlices,y=e.customType,S=e.tabId,k=(0,m.useRouter)(),w=(0,g.Z)(),I=w.createSliceSuccess,N=w.saveCustomTypeSuccess,L=(0,d.useState)(!1),E=L[0],M=L[1],P=(n=(0,i.Z)(function(e){var n,t;return(0,o.__generator)(this,function(a){switch(a.label){case 0:var l;return n=e.sliceName,t=e.from,M(!0),[4,function(e){return j.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(l=(0,i.Z)(function(e){var i,a,l,d;return(0,o.__generator)(this,function(i){switch(i.label){case 0:return[4,(0,b.y0)()];case 1:if(I(i.sent().libraries),!y)return[3,3];return a=(0,s.Z)((0,r.Z)({},y),{tabs:y.tabs.map(function(n){return n.key===S&&n.sliceZone?(0,s.Z)((0,r.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:(0,c.Z)(n.sliceZone.value).concat([{key:e.id,value:e},])}}):n})}),[4,x.j.customTypes.updateCustomType({model:f.Dc.fromSM(a)})];case 2:i.sent(),N(f.Dc.fromSM(a)),i.label=3;case 3:return l=e.variations[0].id,d=T.getBuilderPagePathname({libraryName:t,sliceName:n,variationId:l}),k.push(d),[2]}})}),function(e){return l.apply(this,arguments)})})];case 1:return a.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,a.jsx)(p.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:E,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){P(e)},initialValues:{sliceName:"",from:h[0].name},validate:function(e){return(0,C.h)(e,h,v)},content:{title:"Create a new slice"},actionMessage:y?_.$[y.format].createSliceFromTypeActionMessage:void 0,children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,c=e.errors;return(0,a.jsxs)(l.xu,{children:[(0,a.jsx)(Z.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?c.sliceName:void 0,dataCy:"slice-name-input"}),(0,a.jsx)(l.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,a.jsx)(u.ZP,{name:"from",options:h.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,s.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,s.Z)((0,r.Z)({},e),{colors:(0,s.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return l}});var i=t(81541),r=t(75329),s=t(96009),c=t.n(s),o=t(74600),a=t.n(o);function l(e,n,t){var s=e.sliceName;if(!s)return{sliceName:"Cannot be empty"};if(!r.xo.exec(s))return{sliceName:"No special characters allowed"};if(a()(c()(s)).replace(/\s/gm,"")!==s.trim())return{sliceName:"Value has to be PascalCased"};if(s.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(s))return{sliceName:"".concat(s," is reserved for Slice Machine use")};var o=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),l=t.map(function(e){return e.name});if((0,i.Z)(o).concat((0,i.Z)(l)).includes(s))return{sliceName:"Slice name is already taken."}}},82777:function(e,n,t){"use strict";t.d(n,{H:function(){return eW}});var i=t(52322),r=t(21658),s=t(97729),c=t.n(s),o=t(5632),a=t(2784),l=t(56580),d=t(32038),u=t(62230),m=t(85244),f=t(98240),p=t(41814);t(75547);var h="_1k08lzu5 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bt _1ecs97d32 _1ecs97daf _1ecs97d9db",v=function(e){return(0,i.jsx)("div",(0,m.Z)((0,u.Z)({},e),{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9bt _1ecs97d18 _1ecs97d8l _1ecs97d268 _1ecs97d2dl _1ecs97d9d7 _1ecs97d9ej _1ecs97d9ex _1ecs97d9c9"}))},x=function(e){return(0,i.jsx)("div",(0,m.Z)((0,u.Z)({},e),{className:"_1k08lzu3 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9bq _1ecs97d9sl",children:(0,i.jsxs)("div",{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9l0",children:[(0,i.jsx)("span",{className:h}),(0,i.jsx)("span",{className:h}),(0,i.jsx)("span",{className:h})]})}))},b=function(e){return(0,i.jsx)(p.fC,(0,m.Z)((0,u.Z)({},e),{activationMode:"manual",className:"_1k08lzu6 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bt _1ecs97d9bv"}))},y=function(e){var n=e.children,t=e.onAddNewTab,s=(0,f.Z)(e,["children","onAddNewTab"]);return(0,i.jsxs)(p.aV,(0,m.Z)((0,u.Z)({},s),{className:"_1k08lzu7 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9c8",children:[n,(0,i.jsx)("div",{className:"_1k08lzuc _1k08lzu8 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9bq _1ecs97d9qq _1ecs97d18 _1ecs97d8l _1ecs97d9si _1ecs97d9ce _1ecs97d9mj",children:(0,i.jsx)(r.hU,{icon:"add",onClick:t})})]}))},j=function(e){var n=e.children,t=e.menu,s=(0,f.Z)(e,["children","menu"]);return(0,i.jsx)(p.xz,(0,m.Z)((0,u.Z)({},s),{asChild:!0,onMouseDown:function(e){for(var n=e.target;null!==n&&n!==e.currentTarget;)n.tabIndex>=0&&e.preventDefault(),n=n.parentElement;n===e.currentTarget&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},children:(0,i.jsxs)("div",{className:"_1k08lzu9 _1k08lzu8 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d9bq _1ecs97d9qq _1ecs97d9bj _1ecs97d6ee _1ecs97d6lr _1ecs97d9gc _1ecs97d9l0 _1ecs97d9sl _1ecs97d9cd",children:[(0,i.jsx)(r.xv,{className:"_1ecs97d9cd _1ecs97d9bv",color:"inherit",component:"span",noWrap:!0,variant:"emphasized",children:n}),Boolean(t)?(0,i.jsx)("div",{className:"_1k08lzub _1ecs97d9cd _1ecs97d9cz",children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.hU,{icon:"moreVert"})}),(0,i.jsx)(r.AW,{align:"start",children:t})]})}):void 0]})}))},S=function(e){return(0,i.jsx)(p.VY,(0,m.Z)((0,u.Z)({},e),{className:"_1ecs97dm _1ecs97d7z _1ecs97d9bv _1ecs97d9f8"}))},g=t(90374),_=t(68780),C=t(63397),Z=t(75289),T=function(e){var n=e.name,t=e.label,r=e.placeholder,s=e.error,c=(0,f.Z)(e,["name","label","placeholder","error"]);return(0,i.jsxs)(Z.xu,{mb:3,children:[(0,i.jsx)(Z.__,{htmlFor:n,mb:2,children:t}),(0,i.jsx)(C.gN,(0,u.Z)({name:n,type:"text",placeholder:r,as:Z.II,autoComplete:"off"},c)),s?(0,i.jsx)(Z.xv,{sx:{color:"error",mt:1},children:s}):null]})},k=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,s=e.tabIds;return(0,i.jsx)(_.Z,{isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,onSubmit:function(e){t(e),r()},initialValues:{id:""},validate:function(e){var n=e.id;return n?s.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:function(e){var n=e.errors;return(0,i.jsx)(T,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id})}})},w=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{},content:{title:"Remove Tab"},children:function(){return(0,i.jsxs)(Z.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(Z.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(Z.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(Z.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:function(){t({}),r()},children:"Yes, remove tab"})]})}})},I=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,s=e.tabIds;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{id:""},validate:function(e){var n=e.id;return n?s.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:function(e){var n=e.errors,s=e.values,c=e.setFieldValue,o=e.isValid;return(0,i.jsxs)(Z.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(T,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id,onBlur:function(e){s.id!==e.target.value&&c("id",e.target.value.trim())},onChange:function(e){c("id",e.target.value)}}),(0,i.jsx)(Z.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!o,onClick:function(){s.id&&s.id.length&&t({id:s.id.trim()}),r()},children:"Save"})]})}})},N=t(13394),L=[N.UID,N.Group,N.StructuredText,N.Image,N.Link,N.LinkToMedia,N.ContentRelationship,N.Select,N.Boolean,N.Date,N.Timestamp,N.Embed,N.Number,N.GeoPoint,N.Color,N.Text,],E=t(47560),M=t(82770),P=t(38876),F=t(43904),D=t(4092),O=t(96377),z=t(22710),A=t(81541),R=t(99267),V=t(65077),K=t(44221),H=t(28173),q=t(2754),U=function(e){var n=e.onCreateNewSlice,t=e.onAddNewSlice,s=e.openSlicesTemplatesModal,c=e.projectHasAvailableSlices,a=e.isSlicesTemplatesSupported,l=(0,o.useRouter)().query;return(0,i.jsx)(r.xu,{justifyContent:"center",height:"100%",children:(0,i.jsx)(q.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(q.T9,{children:[(0,i.jsx)(q._T,{children:"Add slices"}),(0,i.jsx)(q.nf,{children:"Slices are website sections that you can reuse on different pages with different content. Each slice has its own component in your code."}),(0,i.jsx)(q.Qj,{children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{"data-testid":"add-slice-dropdown",children:(0,i.jsx)(r.zx,{variant:"true"===l.newPageType?"primary":"secondary",startIcon:"add",children:"Add"})}),(0,i.jsxs)(r.AW,{align:"start",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"add"}),onSelect:n,children:"Blank slice"}),a?(0,i.jsx)(r.Xi,{onSelect:s,startIcon:(0,i.jsx)(r.I5,{name:"contentCopy"}),children:"From templates"}):void 0,c?(0,i.jsx)(r.Xi,{onSelect:t,startIcon:(0,i.jsx)(r.I5,{name:"folder"}),children:"From library"}):void 0]})]})})]})})})},X=t(75992),B=t(17064),W=t(17329),Y=t(40147);function $(){return G.apply(this,arguments)}function G(){return(G=(0,z.Z)(function(){var e,n,t;return(0,R.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Y.j.sliceTemplateLibrary.readLibrary({})];case 1:if(n=(e=i.sent()).templates,(t=e.errors).length>0)throw t;return[2,n.map(function(e){return{model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(function(e){var n=(0,B.Z)(e,2),t=n[0],i=n[1];return[t,URL.createObjectURL(i),]}))}})];case 2:return i.sent(),[2,[]];case 3:return[2]}})})).apply(this,arguments)}var J=t(88932);function Q(){return(Q=(0,z.Z)(function(e){var n,t,i,r,s,c,o,a;return(0,R.__generator)(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),n=e.templateIDs,t=e.localLibrariesNames,i=e.onSuccess,[4,Y.j.sliceTemplateLibrary.createSlices({templateIDs:n})];case 1:if(s=(r=l.sent()).data,(c=r.errors).length>0||void 0===s)throw c;return s.sliceIDs.forEach(function(e,i){M.Xe.track({event:"slice:created",id:e,name:e,library:t[0],sliceTemplate:n[i]})}),[4,i(s.sliceIDs)];case 2:return l.sent(),[3,4];case 3:return o=l.sent(),a="Internal Error: Slice(s) not created",console.error(a,o),J.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var ee=t(56577),en=t(54132),et=t(25812),ei=function(e){var n=e.isDeleteSliceZoneModalOpen,t=e.deleteSliceZone,r=e.closeDeleteSliceZoneModal;return(0,i.jsx)(et.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:r,children:(0,i.jsx)(en.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){return(0,i.jsxs)(Z.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsx)(Z.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(Z.x8,{type:"button",onClick:r})]})},Footer:function(){return(0,i.jsxs)(Z.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(ee.z,{label:"Cancel",variant:"secondary",onClick:r,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ee.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsx)(Z.nv,{children:"You're about to delete Slice Zone."})})})},er=t(59469),es=t(15996),ec=t(57282),eo=t(78656),ea=function(e){var n=e.slices,t=e.format,s=e.onRemoveSharedSlice,c=n.some(function(e){return"SharedSlice"!==e.type}),o=eo.$[t],l=(0,g.Z)().openToaster;return(0,a.useEffect)(function(){c&&l("This ".concat(o.name({start:!1,plural:!1})," contains Slices that are incompatible."),ec.Jf.WARNING)},[c]),(0,i.jsx)(er.Z,{elems:n,defineElementKey:function(e){return"Slice"===e.type?e.payload.key:e.payload.model.name},renderElem:function(e){return"Slice"===e.type?es.X.render({slice:e.payload}):es.M.render({slice:e.payload,StatusOrCustom:function(){return(0,i.jsx)("div",{onClick:function(e){e.preventDefault()},children:(0,i.jsx)(r.hU,{icon:"close",onClick:function(){s(e.payload.model.id)}})})}})},sx:{padding:"16px"}})},el=function(e){var n=e.availableSlices,t=e.values,r=e.placeholderSlices;return(0,i.jsx)(C.F2,{name:"sliceKeys",render:function(e){return(0,i.jsx)(er.Z,{gridTemplateMinPx:"200px",elems:n,defineElementKey:function(e){return e.model.name},renderElem:function(n){var s=null==r?void 0:r.find(function(e){return e.model.id===n.model.id});return es.M.render({slice:n,Wrapper:function(n){var r=n.slice,c=n.children,o=n.sx;return(0,i.jsx)(Z.xu,{"data-testid":"slicezone-modal-item",onClick:function(){if(!s){if(t.sliceKeys.includes(r.model.id))return e.remove(t.sliceKeys.indexOf(r.model.id));e.push(r.model.id)}},sx:s?(0,u.Z)({opacity:.5},o):(0,u.Z)({cursor:"pointer"},o),children:c},"".concat(r.from,"-").concat(r.model.name))},StatusOrCustom:function(e){var n=e.slice;if(s)return(0,i.jsx)(Z.xv,{sx:{fontSize:12,color:"purpleStrong",fontWeight:"bold"},children:"Coming soon"});var r=t.sliceKeys.includes(n.model.id);return(0,i.jsx)(Z.XZ,{value:r?"true":"false",defaultChecked:r,sx:{mr:0},"data-cy":"check-".concat(n.model.id)})}})}})}})},ed=function(e){var n=e.isOpen,t=e.formId,r=e.close,s=e.onSubmit,c=e.availableSlices;return(0,i.jsx)(_.Z,{buttonLabel:"Add",isOpen:n,formId:t,close:r,onSubmit:function(e){s(e),r()},initialValues:{sliceKeys:[]},content:{title:"Add from library"},dataCy:"update-slices-modal",validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(Z.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(el,{values:n,availableSlices:c})}})},eu=t(67557),em=t(53559),ef=[{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:{id:"video_highlights",name:"VideoHighlights",type:"SharedSlice",variations:[{description:"",docURL:"",id:"default",name:"Default",version:"sktwi1xtmkfgx8626"},]},screenshots:{default:{url:"/videoHighlights.png"}}},],ep=function(e){var n=e.isOpen,t=e.formId,r=e.close,s=e.onSubmit,c=e.availableSlicesTemplates;return(0,i.jsx)(_.Z,{buttonLabel:"Add",isOpen:n,formId:t,close:r,onSubmit:function(e){s(e)},initialValues:{sliceKeys:[]},content:{title:"Add from templates"},validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(Z.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(el,{values:n,placeholderSlices:ef,availableSlices:(0,A.Z)(c.map(function(e){return{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:em.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce(function(e,n){return(0,m.Z)((0,u.Z)({},e),(0,eu.Z)({},n[0],{url:n[1]}))},{})}})).concat((0,A.Z)(ef))})}})},eh=function(e,n){var t,i=(n||[]).reduce(function(e,n){return(0,A.Z)(e).concat((0,A.Z)(n.components))},[]),r=e.value.reduce(function(e,n){var t=n.key,r=n.value;if("SharedSlice"===r.type){var s=i.find(function(e){return e.model.id===t});return s?(0,m.Z)((0,u.Z)({},e),{slicesInSliceZone:(0,A.Z)(e.slicesInSliceZone).concat([{type:"SharedSlice",payload:s},])}):(0,m.Z)((0,u.Z)({},e),{notFound:(0,A.Z)(e.notFound).concat([{key:t}])})}return"Slice"===r.type?(0,m.Z)((0,u.Z)({},e),{slicesInSliceZone:(0,A.Z)(e.slicesInSliceZone).concat([{type:"Slice",payload:{key:t,value:r}},])}):e},{slicesInSliceZone:[],notFound:[]});return{availableSlices:i,slicesInSliceZone:r.slicesInSliceZone,notFound:r.notFound}},ev=function(e){var n=e.customType,t=e.onCreateSliceZone,s=e.onDeleteSliceZone,c=e.onRemoveSharedSlice,d=e.onSelectSharedSlices,u=e.sliceZone,m=e.tabId,f=(0,o.useRouter)(),p=f.query,h=f.replace,v=f.pathname,x=(0,W.QT)($,[]),b=(0,a.useState)(!1),y=b[0],j=b[1],S=(0,a.useState)(!1),_=S[0],C=S[1],Z=(0,a.useState)(!1),T=Z[0],k=Z[1],w=(0,l.v9)(function(e){return{remoteSlices:(0,X.sT)(e),libraries:(0,X.Sd)(e),slices:(0,X.xC)(e)}}),I=w.remoteSlices,N=w.libraries,L=(0,g.Z)().createSliceSuccess,E=N.filter(function(e){return e.isLocal}),P=(0,a.useMemo)(function(){return u?eh(u,N):{availableSlices:[],slicesInSliceZone:[],notFound:[]}},[u,N]),F=P.availableSlices,D=P.slicesInSliceZone,O=P.notFound,A=(0,a.useState)(!1),q=A[0],B=A[1];(0,a.useEffect)(function(){(null==O?void 0:O.length)&&O.forEach(function(e){c(e.key)})},[O]);var Y=D.filter(function(e){return"SharedSlice"===e.type}).map(function(e){return e.payload}),G=D.filter(function(e){return"Slice"===e.type}).map(function(e){return e.payload.key}),J=F.filter(function(e){return!Y.some(function(n){return n.model.id===e.model.id})}),ee=function(){C(!0)},en=function(){k(!0)},et=function(){j(!0),M.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:n.id,customTypeFormat:n.format})},er=function(){"true"===p.newPageType&&h({pathname:v,query:{pageTypeId:p.pageTypeId}},void 0,{shallow:!0})};return(0,i.jsxs)(r.xu,{flexDirection:"column",height:"100%",children:[void 0===p.newPageType?(0,i.jsx)(H.a,{children:(0,i.jsx)(H.B,{actions:u?(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{variant:"secondary",startIcon:"add",children:"Add"})}),(0,i.jsxs)(r.AW,{align:"end",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"add"}),onSelect:en,children:"Blank slice"}),x.length>0?(0,i.jsx)(r.Xi,{onSelect:et,startIcon:(0,i.jsx)(r.I5,{name:"contentCopy"}),children:"From templates"}):void 0,J.length>0?(0,i.jsx)(r.Xi,{onSelect:ee,startIcon:(0,i.jsx)(r.I5,{name:"folder"}),children:"From library"}):void 0]})]}):void 0,toggle:"page"!==n.format||"Main"!==m?(0,i.jsx)(r.rs,{checked:!!u,onCheckedChange:function(e){e?t():B(!0)}}):void 0,children:"Slice Zone"})}):void 0,u?D.length>0?(0,i.jsx)(V.xR,{children:(0,i.jsx)(ea,{slices:D,format:n.format,onRemoveSharedSlice:c})}):(0,i.jsx)(U,{onAddNewSlice:ee,onCreateNewSlice:en,openSlicesTemplatesModal:et,projectHasAvailableSlices:J.length>0,isSlicesTemplatesSupported:x.length>0}):void 0,(0,i.jsx)(ed,{isOpen:_,formId:"tab-slicezone-form-".concat(m),availableSlices:J,onSubmit:function(e){d(e.sliceKeys.concat(Y.map(function(e){return e.model.id})),G),er()},close:function(){return C(!1)}}),(0,i.jsx)(ep,{isOpen:y,formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:x,onSubmit:function(e){var n;!function(e){return Q.apply(this,arguments)}({templateIDs:e.sliceKeys,localLibrariesNames:E.map(function(e){return e.name}),onSuccess:(n=(0,z.Z)(function(e){var n;return(0,R.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,M.y0)()];case 1:return L(n.sent().libraries),d(e.concat(Y.map(function(e){return e.model.id})),G),j(!1),er(),[2]}})}),function(e){return n.apply(this,arguments)})})},close:function(){return j(!1)}}),(0,i.jsx)(ei,{isDeleteSliceZoneModalOpen:q,closeDeleteSliceZoneModal:function(){B(!1)},deleteSliceZone:function(){s(),B(!1)}}),(null==E?void 0:E.length)!==0&&T&&(0,i.jsx)(K.c,{onClose:function(){k(!1)},localLibraries:E,remoteSlices:I,customType:n,tabId:m})]})},ex=function(e){var n=e.customType,t=e.tabId,s=e.fields,c=e.sliceZone,d=(0,g.Z)(),u=d.deleteCustomTypeField,m=d.addCustomTypeField,f=d.reorderCustomTypeField,p=d.replaceCustomTypeField,h=d.createSliceZone,v=d.deleteSliceZone,x=d.deleteCustomTypeSharedSlice,b=d.replaceCustomTypeSharedSlice,y=(0,o.useRouter)().query,j=(0,l.v9)(function(e){return{poolOfFields:(0,F.h2)(e)}}).poolOfFields;if(!j)return null;var S=function(e){u(t,e)},_=function(e){var i=e.id,r=e.label,s=e.widgetTypeName;if(!(0,E.Ss)(N,s)){var c=N[s];M.Xe.track({event:"custom-type:field-added",id:i,name:n.id,type:c.TYPE_NAME,zone:"static"}),m(t,i,c.create(r))}},C=function(e){!(0,E.uS)(e)&&f(t,e.source.index,e.destination.index)},Z=function(e){var n=e.apiId,i=e.newKey,r=e.value;!(0,E.Ss)(N,r.type)&&p(t,n,i,r)},T=function(){h(t)},k=function(){v(t)},w=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];M.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:n.id}),b(t,e,i)},I=function(e){x(t,e)};return(0,i.jsx)(r.xu,{backgroundColor:"grey2",flexDirection:"column",gap:8,height:"100%",children:(0,i.jsx)(r.SV,{children:(0,i.jsxs)(a.Suspense,{fallback:(0,i.jsx)(r.xu,{padding:32,children:(0,i.jsx)(r._3,{})}),children:[void 0===y.newPageType?(0,i.jsx)(O.Z,{zoneType:"customType",tabId:t,title:"Static Zone",dataTip:"",fields:s,poolOfFieldsToCheck:j,showHints:!0,EditModal:D.Z,widgetsArray:L,onDeleteItem:S,onSave:Z,onSaveNewField:_,onDragEnd:C,renderHintBase:function(e){var n=e.item;return"data".concat((0,P.Ti)(n.key))},renderFieldAccessor:function(e){return"data".concat((0,P.Ti)(e))},dataCy:"ct-static-zone",isRepeatableCustomType:n.repeatable}):void 0,(0,i.jsx)(ev,{customType:n,tabId:t,sliceZone:c,onRemoveSharedSlice:I,onCreateSliceZone:T,onDeleteSliceZone:k,onSelectSharedSlices:w})]})})})},eb=function(e){var n,t,s,c=e.customType,l=(0,a.useState)(null===(n=c.tabs[0])||void 0===n?void 0:n.key),d=l[0],u=l[1],m=(0,a.useState)(),f=m[0],p=m[1],h=(0,g.Z)(),_=h.createCustomTypeTab,C=h.updateCustomTypeTab,Z=h.deleteCustomTypeTab,T=(0,o.useRouter)().query,N=(null===(t=c.tabs.find(function(e){return e.key===d}))||void 0===t?void 0:null===(s=t.sliceZone)||void 0===s?void 0:s.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(v,{style:{height:N?"100%":void 0},children:["page"===c.format?(0,i.jsx)(x,{}):void 0,"true"===T.newPageType?(0,i.jsx)(ex,{customType:c,fields:c.tabs[0].value,sliceZone:c.tabs[0].sliceZone,tabId:c.tabs[0].key}):(0,i.jsxs)(b,{onValueChange:u,value:d,children:[(0,i.jsx)(y,{onAddNewTab:function(){p({type:"CREATE_CUSTOM_TYPE"})},children:c.tabs.map(function(e){return(0,i.jsx)(j,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Xi,{onSelect:function(){p({type:"UPDATE_CUSTOM_TYPE",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(r.Xi,{color:"tomato",disabled:c.tabs.length<=1,onSelect:function(){p({type:"DELETE_CUSTOM_TYPE",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key)})}),c.tabs.map(function(e){return(0,i.jsx)(S,{value:e.key,children:(0,i.jsx)(ex,{customType:c,fields:e.value,sliceZone:e.sliceZone,tabId:e.key})},e.key)})]})]}),(null==f?void 0:f.type)==="CREATE_CUSTOM_TYPE"?(0,i.jsx)(k,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;_(n),u(n)},tabIds:c.tabs.map(function(e){return e.key.toLowerCase()})}):void 0,(null==f?void 0:f.type)==="UPDATE_CUSTOM_TYPE"?(0,i.jsx)(I,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;C(f.tabKey,n),d===f.tabKey&&u(n)},tabIds:c.tabs.filter(function(e){return e.key!==f.tabKey}).map(function(e){return e.key.toLowerCase()})}):void 0,(null==f?void 0:f.type)==="DELETE_CUSTOM_TYPE"?(0,i.jsx)(w,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(){if(Z(f.tabKey),d===f.tabKey){var e,n=null===(e=c.tabs.find(function(e){return e.key!==f.tabKey}))||void 0===e?void 0:e.key;void 0!==n&&u(n)}}}):void 0]})},ey=t(607),ej=t(7819),eS=t(67445),eg=t(49471),e_=t(3098),eC=t(32665),eZ=t(19345);t(43756);var eT=function(e){var n=e.tabs,t=(0,f.Z)(e,["tabs"]);return(0,i.jsxs)(p.fC,(0,m.Z)((0,u.Z)({},t),{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9bt _1ecs97dm _1ecs97d7z _1ecs97d9jf",defaultValue:n[0].label,orientation:"vertical",children:[(0,i.jsx)(p.aV,{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9bu _1ecs97d486 _1ecs97d4fj _1ecs97d9ep _1ecs97d9f1 _1ecs97d9sl","aria-label":"content tabs",children:n.map(function(e,n){var t=e.label;return(0,i.jsx)(p.xz,{className:"_76k20u4 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bt _1ecs97d6ee _1ecs97d6lr _1ecs97d9gc _1ecs97d9s3",value:t,children:(0,i.jsx)(r.xv,{className:"_76k20u5",component:"span",color:"inherit",children:t})},"".concat(t,"-trig").concat(n+1))})}),n.map(function(e,n){var t=e.label,s=e.content;return(0,i.jsx)(p.VY,{className:"_76k20u6 _1ecs97d9bi _1ecs97d9bk _1ecs97d9bt _1ecs97d9jf _1ecs97d9f8",value:t,children:(0,i.jsx)(r.xr,{className:"_1ecs97d9q3",children:s})},"".concat(t,"-content").concat(n+1))})]}))},ek=t(88241),ew=t(70863),eI=t(8857),eN=t(49109),eL=t(72757),eE=t(25145),eM=function(){return(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1707 19.1237C17.9629 19.3056 17.9419 19.6214 18.1237 19.8293C18.3056 20.0371 18.6214 20.0581 18.8293 19.8763L22.8293 16.3763C22.9378 16.2814 23 16.1442 23 16C23 15.8558 22.9378 15.7187 22.8293 15.6237L18.8293 12.1237C18.6214 11.9419 18.3056 11.9629 18.1237 12.1708C17.9419 12.3786 17.9629 12.6945 18.1707 12.8763L21.7407 16L18.1707 19.1237ZM13.8293 12.8763C14.0371 12.6945 14.0581 12.3786 13.8763 12.1708C13.6944 11.9629 13.3786 11.9419 13.1707 12.1237L9.17075 15.6237C9.06224 15.7187 9 15.8558 9 16C9 16.1442 9.06224 16.2814 9.17075 16.3763L13.1707 19.8763C13.3786 20.0581 13.6944 20.0371 13.8763 19.8293C14.0581 19.6214 14.0371 19.3056 13.8293 19.1237L10.2593 16L13.8293 12.8763Z",fill:"#6F6E77"})})},eP=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{d:"M21.2388 10H10.7623C10.3415 10 10 10.3415 10 10.7623V21.2377C10 21.6585 10.3415 22 10.7623 22H21.2377C21.6585 22 22 21.6585 22 21.2388V10.7623C22 10.3415 21.6585 10 21.2388 10ZM16.5714 19.1953C16.5714 20.3371 15.9018 20.8571 14.9241 20.8571C14.0402 20.8571 13.4029 20.2645 13.1429 19.7143L14.0413 19.1708C14.2143 19.4777 14.4777 19.7143 14.8571 19.7143C15.2199 19.7143 15.4286 19.5725 15.4286 19.0212V15.4286H16.5714V19.1953ZM19.0502 20.8571C18.0379 20.8571 17.4632 20.3471 17.1429 19.7143L18 19.1429C18.2333 19.5246 18.4877 19.8895 19.0257 19.8895C19.4777 19.8895 19.7143 19.6641 19.7143 19.3516C19.7143 18.9788 19.4688 18.846 18.9721 18.6283L18.6998 18.5112C17.9129 18.1763 17.3895 17.7567 17.3895 16.8683C17.3895 16.0513 18.0134 15.4286 18.9866 15.4286C19.6797 15.4286 20.1775 15.6696 20.5368 16.3013L19.6886 16.8471C19.5011 16.5112 19.3002 16.3795 18.9866 16.3795C18.6674 16.3795 18.4654 16.5826 18.4654 16.8471C18.4654 17.1741 18.6674 17.3058 19.135 17.5089L19.4074 17.6261C20.3348 18.0223 20.8571 18.4275 20.8571 19.3382C20.8571 20.3192 20.0859 20.8571 19.0502 20.8571Z",fill:"#6F6E77"})})},eF=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.1719 10H20.8281C21.4753 10 22 10.5247 22 11.1719V20.8281C22 21.4753 21.4753 22 20.8281 22H11.1719C10.5247 22 10 21.4753 10 20.8281V11.1719C10 10.5247 10.5247 10 11.1719 10ZM17.4283 20.7223V19.549C17.641 19.7275 17.8721 19.8613 18.1215 19.9505C18.371 20.0397 18.6228 20.0843 18.8771 20.0843C19.0263 20.0843 19.1565 20.0709 19.2678 20.044C19.3791 20.0171 19.472 19.9798 19.5466 19.9322C19.6211 19.8845 19.6768 19.8283 19.7135 19.7635C19.7501 19.6987 19.7685 19.6285 19.7685 19.5527C19.7685 19.45 19.7391 19.3583 19.6805 19.2777C19.6217 19.197 19.5417 19.1225 19.4402 19.054C19.3387 18.9856 19.2183 18.9196 19.0789 18.856C18.9395 18.7925 18.7891 18.7277 18.6277 18.6617C18.2169 18.4906 17.9106 18.2816 17.7089 18.0347C17.5071 17.7878 17.4062 17.4896 17.4062 17.1401C17.4062 16.8663 17.4613 16.631 17.5713 16.4343C17.6814 16.2375 17.8311 16.0756 18.0206 15.9484C18.2102 15.8213 18.4296 15.7278 18.6791 15.668C18.9285 15.6081 19.1926 15.5781 19.4714 15.5781C19.7452 15.5781 19.988 15.5946 20.1995 15.6276C20.411 15.6606 20.606 15.7113 20.7845 15.7798V16.8761C20.6965 16.815 20.6005 16.7612 20.4966 16.7148C20.3927 16.6683 20.2857 16.6298 20.1756 16.5992C20.0656 16.5687 19.9562 16.5461 19.8473 16.5314C19.7385 16.5168 19.6352 16.5094 19.5374 16.5094C19.4029 16.5094 19.2806 16.5223 19.1706 16.5479C19.0605 16.5736 18.9676 16.6097 18.8918 16.6561C18.816 16.7025 18.7573 16.7581 18.7157 16.8229C18.6742 16.8877 18.6534 16.9604 18.6534 17.0411C18.6534 17.1291 18.6766 17.2079 18.7231 17.2776C18.7695 17.3472 18.8356 17.4132 18.9212 17.4756C19.0068 17.5379 19.1107 17.599 19.2329 17.6589C19.3552 17.7188 19.4934 17.7805 19.6474 17.8441C19.8577 17.932 20.0466 18.0255 20.2142 18.1245C20.3817 18.2235 20.5253 18.3354 20.6451 18.46C20.765 18.5847 20.8567 18.7271 20.9203 18.8872C20.9838 19.0473 21.0156 19.2337 21.0156 19.4463C21.0156 19.7397 20.96 19.9859 20.8487 20.1851C20.7375 20.3844 20.5865 20.5457 20.3957 20.6691C20.205 20.7926 19.9831 20.8812 19.73 20.935C19.4769 20.9887 19.2097 21.0156 18.9285 21.0156C18.6399 21.0156 18.3655 20.9912 18.105 20.9423C17.8446 20.8934 17.619 20.8201 17.4283 20.7223ZM16.9609 16.6582H15.4558V20.9453H14.2634V16.6582H12.7656V15.6953H16.9609V16.6582Z",fill:"#6F6E77"})})},eD=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.031 11L15.7584 17.8336L16.0831 18.4288L16.4077 17.8336L20.1352 11H22L16.0831 21.4347L10 11H12.031ZM19.2924 11.0006L16.0831 16.8843L12.8737 11.0005L14.2612 11.0001L14.727 11L15.2777 11.9497L16.1319 13.4226L16.9886 11.9512L17.542 11.0006H17.9881H19.2924Z",fill:"#6F6E77"})})};t(69001),eI.Z.registerLanguage("tsx",eN.Z),eI.Z.registerLanguage("markup",eL.Z),eI.Z.alias("markup","vue");var eO=function(e){var n,t=null===(n=e.fileName.split("."))||void 0===n?void 0:n[1];return function(){switch(t){case"ts":case"tsx":return(0,i.jsx)(eF,{});case"js":case"jsx":return(0,i.jsx)(eP,{});case"vue":return(0,i.jsx)(eD,{});default:return(0,i.jsx)(eM,{})}}()},ez=function(e){var n=e.code,t=e.onCopy,s=(0,a.useState)(!1),c=s[0],o=s[1];(0,a.useEffect)(function(){if(c){var e=setTimeout(function(){o(!1)},1200);return function(){clearTimeout(e)}}},[c]);var l=function(){navigator.clipboard.writeText(n).then(function(){o(!0),void 0!==t&&t()})};return(0,i.jsx)(r.hU,{size:"small",onClick:l,icon:c?"check":"contentCopy"})},eA=function(e){var n=e.fileInfo,t=e.className,s=e.copy,c=e.code,o=e.onCopy,a=/language-(\w+)/.exec(null!=t?t:"");return(0,i.jsxs)("div",{className:"_1ecs97d9bi _1ecs97d9bn _1ecs97d9ex _1ecs97d9d7 _1ecs97d9ej _1ecs97d268 _1ecs97d2dl",children:[(0,i.jsxs)("div",{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9bq _1ecs97d9c0 _1ecs97d9e0 _1ecs97d9ea _1ecs97d9ep _1ecs97d9f1 _1ecs97d18 _1ecs97d8l _1ecs97d48s _1ecs97d4g5 _1ecs97d9s1 _1ecs97d9rm",children:[void 0!==n?(0,i.jsxs)("div",{className:"_1ecs97d9bi _1ecs97d9bk _1ecs97d9c0 _1ecs97d9bq",children:[(0,i.jsx)(eO,{fileName:n.fileName}),(0,i.jsx)(r.xv,{className:"_8uty130",color:"grey11",children:n.fileName})]}):(0,i.jsx)("span",{}),!0===s?(0,i.jsx)(ez,{onCopy:o,code:String(c)}):null]}),null!==a&&a[1]?(0,i.jsx)(eI.Z,{showLineNumbers:!0,customStyle:{margin:0,border:"none",fontSize:"12px",lineHeight:"18px",borderRadius:"none",backgroundColor:"#FFF",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"},children:String(c).replace(/\n$/,""),style:eE.MS,language:a[1],PreTag:"div"}):c]})},eR="_1ecs97d9qx",eV=t(36065),eK=function(e){var n=(0,eV.p)();if(!0===e.inline)return(0,i.jsx)("code",(0,m.Z)((0,u.Z)({},e),{className:"_1ecs97d9gh _1ecs97d18 _1ecs97d8l _1ecs97d9d7 _1ecs97d9s0 _1ecs97d9sg"}));var t=function(){var n,t;if((null===(n=e.node)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.meta)!==void 0){var i,r,s,c=null===(i=e.node)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.meta;return{fileName:c.substring(1,c.length-1),language:null===(s=e.className)||void 0===s?void 0:s.split("-")[1]}}return null}(),r=function(){void 0!==n&&M.Xe.track({event:"page-type:copy-snippet",framework:n})};return(0,i.jsx)(eA,(0,u.Z)((0,m.Z)((0,u.Z)({copy:!0},e),{onCopy:r,code:e.children}),null!==t?{fileInfo:t}:{}))},eH=function(e){var n=e.markdown;return(0,i.jsx)(ew.D,{children:n,linkTarget:"_blank",remarkPlugins:[ek.Z],components:{code:function(e){return(0,i.jsx)(eK,(0,u.Z)({},e))},h1:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h1",variant:"h1"})},h2:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h2",variant:"h2"})},h3:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h3",variant:"h3"})},h4:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},h5:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},p:function(e){return(0,i.jsx)(r.xv,{className:eR,children:e.children,component:"p",variant:"normal"})},pre:function(e){return(0,i.jsx)(r.xv,{className:eR,children:e.children,component:"pre",variant:"normal"})}}})};function eq(e){return eU.apply(this,arguments)}function eU(){return(eU=(0,z.Z)(function(e){var n,t,i,r;return(0,R.__generator)(this,function(s){switch(s.label){case 0:return n=JSON.parse(e),[4,Y.j.documentation.read({kind:n.kind,data:n.data})];case 1:if(i=(t=s.sent()).errors,r=t.documentation,i.length>0)throw i;return[2,r]}})})).apply(this,arguments)}t(75317);var eX=function(e){var n,t=e.model,s=(0,eV.p)(),c=(0,W.QT)(eq,[JSON.stringify({kind:"PageSnippet",data:{model:t}})]);if(0===c.length)return null;var o=function(){void 0!==s&&M.Xe.track({event:"page-type:open-snippet",framework:s})};return(0,i.jsxs)(r.Vq,{size:"small",trigger:(0,i.jsx)(r.zx,{variant:"secondary",onClick:o,startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(r.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:"_3uvawd0 _1ecs97d9bk _1ecs97d9bt _1ecs97d9jf _1ecs97d9l2",children:c.length>1?(0,i.jsx)(eT,{style:{flex:1},tabs:c.map(function(e,n){var t=e.label,r=e.content;return{label:null!=t?t:"Tab ".concat(n+1),content:(0,i.jsx)(eH,{markdown:r})}})}):(0,i.jsx)(r.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(eH,{markdown:c[0].content})})})]})},eB=function(e){var n=e.model;return(0,i.jsx)("div",{children:(0,i.jsx)(r.SV,{children:(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)(r.zx,{variant:"secondary",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(eX,{model:n})})})})},eW=function(){var e=(0,o.useRouter)(),n=(0,l.v9)(function(n){return{selectedCustomType:(0,eg.Jk)(n,(0,eS.Ag)(e.query))}}).selectedCustomType,t=(0,g.Z)().cleanupCustomTypeStore;return((0,a.useEffect)(function(){n&&(0,ej.TG)(n)||e.replace("/")},[n,e]),(0,a.useEffect)(function(){return function(){t()}},[]),n&&(0,ej.TG)(n))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c(),{children:(0,i.jsxs)("title",{children:[n.local.label," - Slice Machine"]})}),(0,i.jsx)(eY,{customType:n.local,remoteCustomType:(0,ej.wU)(n)?n.remote:void 0})]}):(0,i.jsx)(d.LN,{})},eY=function(e){var n,t=e.customType,s=e.remoteCustomType,c=(0,g.Z)(),o=c.initCustomTypeStore,u=c.saveCustomType;(0,a.useEffect)(function(){o(t,s)},[]);var m=(0,l.v9)(function(e){return{currentCustomType:(0,F.A3)(e),hasPendingModifications:(0,F.CT)(e),isSavingCustomType:(0,eC.hg)(e,e_.z.SAVE_CUSTOM_TYPE)}}),f=m.currentCustomType,p=m.hasPendingModifications,h=m.isSavingCustomType;if(null===f)return(0,i.jsx)(d.LN,{});var v=eS.cd[f.format],x=eo.$[f.format];return(0,i.jsxs)(d.LN,{children:[(0,i.jsxs)(d.wd,{children:[(0,i.jsx)(d.Xq,{url:v.tablePagePathname}),(0,i.jsx)(d.Cx,{folder:x.name({start:!0,plural:!0}),page:null!==(n=f.label)&&void 0!==n?n:f.id}),(0,i.jsxs)(d.K2,{children:["page"===f.format?(0,i.jsx)(eB,{model:ey.Dc.fromSM(f)}):void 0,(0,i.jsx)(eZ._,{isChangesLocal:!0,format:f.format,customType:ey.Dc.fromSM(f)}),(0,i.jsx)(r.zx,{onClick:u,loading:h,"data-testid":"builder-save-button",disabled:!p||h,children:"Save"})]})]}),(0,i.jsx)(d.RN,{children:(0,i.jsx)(r.xu,{flexDirection:"column",height:"100%",children:(0,i.jsx)(eb,{customType:f})})})]})}},69001:function(){},43756:function(){},75547:function(){},75317:function(){}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[799],{56577:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var r=n(62230),s=n(85244),o=n(98240),a=n(52322),c=n(2784),i=n(75289),l=function(e,t){return e?"".concat(e,"-").concat(t):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,t){var n=e.label,c=e.Icon,d=e.type,m=e.form,p=e.isLoading,h=void 0!==p&&p,f=e.disabled,x=e.onClick,y=e.sx,b=e.iconSize,v=void 0===b?16:b,g=e.iconFill,j=e.variant,_=void 0===j?"primary":j,C=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,a.jsx)(i.zx,(0,s.Z)((0,r.Z)({ref:t,sx:(0,r.Z)((0,s.Z)((0,r.Z)({},void 0===y?{}:y),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),h?{cursor:"wait !important"}:{}),type:d,form:m,disabled:void 0!==f&&f||h,onClick:h?void 0:x,variant:_},C),{children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$j,{size:v,color:u(_),"data-cy":l(C["data-cy"],"spinner")}),c&&n]}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(c,{size:v,fill:g,"data-cy":l(C["data-cy"],"icon")}),n]})}))})},70041:function(e,t,n){"use strict";n.d(t,{W:function(){return c}});var r=n(62230),s=n(52322);n(2784);var o=n(63397),a=n(75289),c=function(e){var t=e.name,n=e.label,c=e.placeholder,i=e.error,l=e.dataCy,u=e.onChange;return(0,s.jsxs)(a.xu,{mb:3,children:[(0,s.jsx)(a.__,{htmlFor:t,mb:2,children:n}),(0,s.jsx)(o.gN,(0,r.Z)({name:t,type:"text",placeholder:c,as:a.II,autoComplete:"off"},u?{onChange:u}:null,l?{"data-cy":l}:null)),i?(0,s.jsx)(a.xv,{"data-cy":l?"".concat(l,"-error"):"input-error",sx:{color:"error",mt:1},children:i}):null]})}},68780:function(e,t,n){"use strict";var r=n(62230),s=n(85244),o=n(52322),a=n(37149),c=n.n(a),i=n(25812),l=n(63397),u=n(75289),d=n(56577),m=n(54132);t.Z=function(e){var t=e.children,n=e.close,a=e.isOpen,p=e.formId,h=e.validate,f=e.onSubmit,x=e.widthInPx,y=e.initialValues,b=e.content.title,v=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,_=e.isLoading,C=void 0!==_&&_,Z=e.buttonLabel,S=void 0===Z?"Save":Z,k=e.dataCy,T=e.actionMessage;return c().setAppElement("#__next"),(0,o.jsx)(i.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:b,style:{content:{width:null!=x?x:"900px"}},children:(0,o.jsx)(l.J9,{validateOnChange:!0,initialValues:y,validate:function(e){return h?h(e):void 0},onSubmit:function(e){f(e)},children:function(e){var a=e.isValid,c=e.isSubmitting,i=e.values,h=e.errors,f=e.touched,x=e.setFieldValue,y=e.setValues;return(0,o.jsx)(l.l0,(0,s.Z)((0,r.Z)({id:p},null!=k?{"data-cy":k}:null),{children:(0,o.jsx)(m.Z,(0,s.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},v),{Header:function(e){var t=e.radius;return(0,o.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:function(e){var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:[(0,o.jsx)(u.X6,{sx:{fontSize:"20px"},children:b}),(0,o.jsx)(u.x8,{type:"button",onClick:n})]})},Footer:j?null:(0,o.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof T?T(e):T}),(0,o.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(u.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:c||C,children:"Cancel"}),(0,o.jsx)(d.z,{label:S,form:p,type:"submit",disabled:!a||c||C,isLoading:c||C,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:a,isSubmitting:c,values:i,errors:h,touched:f,setFieldValue:x,setValues:y})}))}))}})})}},2754:function(e,t,n){"use strict";n.d(t,{R$:function(){return u},Qj:function(){return f},T9:function(){return m},nf:function(){return h},u2:function(){return d},_T:function(){return p}});var r=n(67557),s=n(62230),o=n(85244),a=n(98240),c=n(52322),i=n(6277),l=n(21658);n(57404);var u=function(e){var t=e.backgroundImage,n=e.style,l=(0,a.Z)(e,["backgroundImage","style"]),u=void 0!==t;return(0,c.jsx)("article",(0,o.Z)((0,s.Z)({},l),{className:(0,i.Z)("_18bjhbz0 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9sy _1ecs97d9t0 _1ecs97d9t2 _1ecs97dm _1ecs97d7z _1ecs97d268 _1ecs97d2dl _1ecs97d9d7 _1ecs97d9ej _1ecs97d9ex _1ecs97d9c7",(0,r.Z)({},"_18bjhbz1 _1ecs97d9cf _1ecs97d9h3",u)),style:(0,s.Z)({backgroundImage:u?"url(".concat(t,")"):void 0},n)}))},d=function(e){return(0,c.jsx)("div",(0,o.Z)((0,s.Z)({},e),{className:"_1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d48s _1ecs97d4g5 _1ecs97d9ep _1ecs97d9f1 _1ecs97d9c7"}))},m=function(e){return(0,c.jsx)("div",(0,o.Z)((0,s.Z)({},e),{className:"_18bjhbz3 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9q5"}))},p=function(e){return(0,c.jsx)(l.xv,(0,o.Z)((0,s.Z)({},e),{className:"_18bjhbz4"}))},h=function(e){return(0,c.jsx)(l.xv,(0,o.Z)((0,s.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,c.jsx)(l.hE,(0,o.Z)((0,s.Z)({},e),{className:"_18bjhbz6 _1ecs97d9l3 _1ecs97d9bq _1ecs97d9nl",size:"medium",variant:"secondary"}))}},19345:function(e,t,n){"use strict";n.d(t,{_:function(){return N}});var r=n(22710),s=n(99267),o=n(52322),a=n(2784),c=n(21658),i=n(5632),l=n(90374),u=n(62230),d=n(85244),m=n(88932),p=n(40147),h=n(78656);function f(){return(f=(0,r.Z)(function(e,t){var n,r;return(0,s.__generator)(this,function(s){switch(s.label){case 0:n=h.$[e.format],s.label=1;case 1:return s.trys.push([1,3,,4]),r=(0,d.Z)((0,u.Z)({},e),{format:"page"}),[4,p.j.customTypes.updateCustomType({model:r})];case 2:return s.sent(),t(r),m.Am.success("".concat(n.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s.sent(),m.Am.error("Internal Error: ".concat(n.name({start:!0,plural:!1})," not converted to page type")),[3,4];case 4:return[2]}})})).apply(this,arguments)}var x=n(67445),y=n(75289),b=n(68780),v=n(70041),g=n(56580),j=n(49471);function _(){return(_=(0,r.Z)(function(e){var t,n,r,o,a,c,i;return(0,s.__generator)(this,function(s){switch(s.label){case 0:t=e.model,n=e.newLabel,r=e.onSuccess,o=h.$[t.format],s.label=1;case 1:return s.trys.push([1,3,,4]),a=(0,d.Z)((0,u.Z)({},t),{label:n}),[4,p.j.customTypes.renameCustomType({model:a})];case 2:return s.sent(),r(a),m.Am.success("".concat(o.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return c=s.sent(),i="Internal Error: ".concat(o.name({start:!0,plural:!1})," could not be renamed"),console.error(i,c),m.Am.error(i),[3,4];case 4:return[2]}})})).apply(this,arguments)}var C=function(e){var t,n,c,i=e.isChangesLocal,u=e.customType,d=e.format,m=e.onClose,p=null!==(t=null==u?void 0:u.label)&&void 0!==t?t:"",f=null!==(n=null==u?void 0:u.id)&&void 0!==n?n:"",x=(0,l.Z)(),C=x.renameAvailableCustomTypeSuccess,Z=x.renameSelectedCustomType,S=(0,a.useState)(!1),k=S[0],T=S[1],I=(c=(0,r.Z)(function(e){return(0,s.__generator)(this,function(t){switch(t.label){case 0:if(T(!0),!i)return[3,1];return Z(e.customTypeName),[3,3];case 1:return[4,function(e){return _.apply(this,arguments)}({model:u,newLabel:e.customTypeName,onSuccess:C})];case 2:t.sent(),t.label=3;case 3:return T(!1),m(),[2]}})}),function(e){return c.apply(this,arguments)}),w=(0,g.v9)(function(e){return{customTypeLabels:(0,j.YS)(e)}}).customTypeLabels,z=h.$[d];return(0,o.jsx)(b.Z,{isOpen:!0,dataCy:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:m,onSubmit:function(e){I(e)},initialValues:{customTypeName:p},isLoading:k,content:{title:"Rename a ".concat(z.name({start:!1,plural:!1}))},validate:function(e){var t=e.customTypeName,n={};return t&&t.length||(n.customTypeName="Cannot be empty."),void 0!=n.customTypeName&&w.includes(t)&&p!==t&&(n.customTypeName="".concat(z.name({start:!0,plural:!1})," name is already taken.")),Object.keys(n).length>0?n:void 0},children:function(e){var t=e.errors;return(0,o.jsx)(y.xu,{children:(0,o.jsx)(v.W,{name:"customTypeName",label:"".concat(z.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(z.name({start:!1,plural:!1})),error:t.customTypeName,dataCy:"custom-type-name-input"})})}})},Z=n(25812),S=n(59326),k=n(54132),T=n(65186),I=n(56577);function w(){return(w=(0,r.Z)(function(e){var t,n,r,o,a;return(0,s.__generator)(this,function(s){switch(s.label){case 0:t=e.customType,n=e.onSuccess,r=h.$[t.format],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,p.j.customTypes.deleteCustomType({id:t.id})];case 2:return s.sent(),n(),m.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return o=s.sent(),a="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(a,o),[3,4];case 4:return[2]}})})).apply(this,arguments)}var z=function(e){var t,n=e.customType,c=e.format,i=e.onClose,u=e.onDeleteCustomTypeSuccess,d=h.$[c],m=(0,a.useState)(!1),p=m[0],f=m[1],x=(0,l.Z)().deleteCustomTypeSuccess,b=(t=(0,r.Z)(function(){return(0,s.__generator)(this,function(e){switch(e.label){case 0:return f(!0),[4,function(e){return w.apply(this,arguments)}({customType:n,onSuccess:function(){return x(n.id)}})];case 1:return e.sent(),u(),[2]}})}),function(){return t.apply(this,arguments)}),v=(0,S.B7)().theme;return(0,o.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return i()},children:(0,o.jsx)(k.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,o.jsxs)(y.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,o.jsxs)(y.kC,{sx:{alignItems:"center"},children:[(0,o.jsx)(T.$vK,{size:20,color:null===(e=v.colors)||void 0===e?void 0:e.greyIcon}),(0,o.jsxs)(y.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,o.jsx)(y.x8,{type:"button",onClick:function(){return i()}})]})},Footer:function(){return(0,o.jsxs)(y.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,o.jsx)(I.z,{label:"Cancel",variant:"secondary",onClick:function(){return i()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==n&&(0,o.jsx)(I.z,{label:"Delete",variant:"danger",isLoading:p,onClick:function(){b()},sx:{minHeight:39,minWidth:78}})]})},children:(0,o.jsxs)("div",{children:["This action will immediately make the following change:",(0,o.jsx)("ul",{children:(0,o.jsxs)("li",{children:["Delete the"," ",(0,o.jsxs)(y.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==n?void 0:n.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,o.jsx)("ul",{children:(0,o.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},N=function(e){var t,n=e.format,u=e.customType,d=e.isChangesLocal,m=(0,i.useRouter)(),p=(0,l.Z)().saveCustomTypeSuccess,h=(0,a.useState)(!1),y=h[0],b=h[1],v=(0,a.useState)(!1),g=v[0],j=v[1],_=(0,a.useState)(!1),Z=_[0],S=_[1],k=(t=(0,r.Z)(function(){var e,t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:return S(!0),[4,function(e,t){return f.apply(this,arguments)}(u,p)];case 1:return n.sent(),e=x.cd.custom.getBuilderPagePathname(u.id),m.asPath===e&&(t=x.cd.page.getBuilderPagePathname(u.id),m.replace(t)),S(!1),[2]}})}),function(){return t.apply(this,arguments)}),T=function(){var e,t=x.cd[null!==(e=u.format)&&void 0!==e?e:"custom"].tablePagePathname;m.asPath!==t?m.replace(t):b(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(c.h_,{modal:!0,children:[(0,o.jsx)(c.$F,{disabled:Z,children:(0,o.jsx)(c.zx,{loading:Z,startIcon:"moreVert",variant:"secondary","data-testid":"editDropdown"})}),(0,o.jsxs)(c.AW,{align:"end",children:[(0,o.jsx)(c.Xi,{startIcon:(0,o.jsx)(c.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===n&&!d&&(0,o.jsx)(c.Xi,{startIcon:(0,o.jsx)(c.I5,{name:"driveFileMove"}),onSelect:function(){k()},children:"Convert to page type"}),(0,o.jsx)(c.Xi,{color:"tomato",startIcon:(0,o.jsx)(c.I5,{name:"delete"}),onSelect:function(){b(!0)},children:"Remove"})]})]}),y?(0,o.jsx)(z,{format:n,customType:u,onClose:function(){return b(!1)},onDeleteCustomTypeSuccess:T}):null,g?(0,o.jsx)(C,{format:n,customType:u,isChangesLocal:d,onClose:function(){return j(!1)}}):null]})}},57404:function(){}}]);
@@ -1 +0,0 @@
1
- div.LegacySliceTooltip_legacySliceTooltipContainer__QZCRH{border-radius:6px;width:230px;text-align:center;padding:8px}div.LegacySliceTooltip_legacySliceTooltipContainer__QZCRH>a{color:#fff}._1nkpwww0{border-radius:3px}._18bjhbz0{max-width:498px;min-height:400px}._18bjhbz1{background-size:cover;border-radius:var(--_7j49md3);border-style:var(--_7j49mdd);height:100%;max-width:100%}._18bjhbz1 ._18bjhbz3{padding:64px}._18bjhbz4{font-size:18px;font-weight:600;line-height:32px}._18bjhbz5{font-weight:400;line-height:24px}._18bjhbz1 ._18bjhbz5{max-width:464px;align-self:center}._18bjhbz1 ._18bjhbz6{justify-content:center}.ovkapw0:focus-visible{outline:none;-webkit-text-decoration-line:underline;text-decoration-line:underline}.ovkapw1{font-size:1.2rem;width:18px;height:18px}.ovkapw2{font-size:1rem;width:16px;height:16px}.ovkapw3{font-size:inherit;width:inherit;height:inherit}