slice-machine-ui 2.7.2-beta.1 → 2.7.2-beta.2
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.
- package/out/404.html +1 -1
- package/out/_next/static/E30Hv5Nt7vNi3zj5fcpLn/_buildManifest.js +1 -0
- package/out/_next/static/chunks/{150-1e09cb4726b8a7a7.js → 150-84da9b485587e8c4.js} +1 -1
- package/out/_next/static/chunks/349-6ad3cca7ea294292.js +31 -0
- package/out/_next/static/chunks/{764-cf90b7301c3b3a9e.js → 764-e040bcebe6027fea.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-6750d78957aee027.js → _app-8405076cd58a41f0.js} +33 -33
- package/out/_next/static/chunks/pages/{changelog-2c26b4f6b5bd1129.js → changelog-f9055af0d38a0c24.js} +1 -1
- package/out/_next/static/chunks/pages/changes-72a49635f1ee5057.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-2065dee71d774cd3.js → [customTypeId]-2eb64c9ea82fcd0a.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-6574554a7f090ccd.js → labs-867606e5aff179cd.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-07052182875ae5dd.js → [pageTypeId]-e5a5e6b345081e0a.js} +1 -1
- package/out/_next/static/chunks/pages/{settings-80462fc1f134572a.js → settings-0edb6f6c78439c20.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-17c7f402037bbcc7.js → [variation]-68074c174d83cf1e.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-6b069bca7b6ecfa8.js → slices-0f6e50acfb5957ed.js} +1 -1
- package/out/_next/static/css/34067e4b880866ca.css +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -3
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +16 -55
- package/src/features/onboarding/OnboardingGuide/OnboardingGuide.tsx +8 -87
- package/src/features/onboarding/OnboardingProgressStepper.tsx +1 -6
- package/src/features/onboarding/OnboardingProvider.tsx +2 -7
- package/src/features/onboarding/OnboardingTutorial/OnboardingTutorial.tsx +2 -5
- package/src/features/onboarding/content.tsx +0 -85
- package/src/pages/changes.tsx +1 -13
- package/out/_next/static/XTNKE9wmTlQ2cFGPxGdBg/_buildManifest.js +0 -1
- package/out/_next/static/chunks/168-c494986647b0f939.js +0 -31
- package/out/_next/static/chunks/543-f8766685f7f451e2.js +0 -1
- package/out/_next/static/chunks/pages/changes-0da6506ff137516c.js +0 -1
- package/out/_next/static/css/a20944a3d66dde5a.css +0 -1
- package/src/features/changes/usePromptToCreateContentExperiment.ts +0 -19
- package/src/features/onboarding/useOnboardingCardVisibilityExperiment.ts +0 -20
- /package/out/_next/static/{XTNKE9wmTlQ2cFGPxGdBg → E30Hv5Nt7vNi3zj5fcpLn}/_ssgManifest.js +0 -0
package/out/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/cc20f7c46912c5dc.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc20f7c46912c5dc.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/cc20f7c46912c5dc.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc20f7c46912c5dc.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-8405076cd58a41f0.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/E30Hv5Nt7vNi3zj5fcpLn/_buildManifest.js" defer=""></script><script src="/_next/static/E30Hv5Nt7vNi3zj5fcpLn/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"E30Hv5Nt7vNi3zj5fcpLn","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,d,n,u,b,f,h,l,k,p,j,g,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[a,k,p,"static/chunks/pages/index-17f953c11b46cb20.js"],"/_error":["static/chunks/pages/_error-1b183d3cf5ea03f9.js"],"/changelog":[s,e,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-f9055af0d38a0c24.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38ab72e6ee071fec.js",c,d,"static/css/34067e4b880866ca.css","static/chunks/pages/changes-72a49635f1ee5057.js"],"/custom-types":[a,k,p,"static/chunks/pages/custom-types-ddc20cfdd8049c04.js"],"/custom-types/[customTypeId]":[s,n,u,b,f,e,i,h,j,c,a,l,g,o,"static/chunks/pages/custom-types/[customTypeId]-2eb64c9ea82fcd0a.js"],"/labs":["static/chunks/pages/labs-867606e5aff179cd.js"],"/page-types/[pageTypeId]":[s,n,u,b,f,e,i,h,j,c,a,l,g,o,"static/chunks/pages/page-types/[pageTypeId]-e5a5e6b345081e0a.js"],"/settings":["static/css/7f2ebc8f03a13272.css","static/chunks/pages/settings-0edb6f6c78439c20.js"],"/slices":[s,t,i,c,d,"static/css/b5323377600915db.css","static/chunks/pages/slices-0f6e50acfb5957ed.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,n,u,b,f,e,i,h,c,l,d,"static/css/4840a6c8541a6625.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-68074c174d83cf1e.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-080f6b8eec027936.js","static/chunks/441-126d623f1b578785.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-783b6577bd4e3728.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-8e544a511d670317.js","static/chunks/772-58d0c8f8ae1c6791.js","static/chunks/372-a86e2c479a721702.js","static/chunks/183-1298bf7953a6f2a0.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/50-586dc7ab5e584e76.js","static/chunks/639-175fa5cb82faf87c.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-642bc2ece03445a4.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/349-6ad3cca7ea294292.js","static/chunks/882-1ccb9dbd9bd4734b.js","static/chunks/764-e040bcebe6027fea.js","static/css/22103e0fe77e9b53.css","static/chunks/479-6205c85aa978fc0b.js","static/chunks/150-84da9b485587e8c4.js","static/css/00e9fba6d8022425.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150],{9150:function(e,t,l){"use strict";l.d(t,{H:function(){return e1}});var i=l(52322),a=l(33760),n=l(97729),r=l.n(n),s=l(5632),o=l(2784),c=l(56580),d=l(23335),u=l(93216),m=l(6697),h=l(63447),x=l(48772),p=l(74217),v=l(93188),y=l(80546),f=l(43874),j=l(41067),b=l(77507);let g=(0,o.createContext)(void 0);function C(e){let{children:t,initialCustomType:l}=e,[a,n]=(0,o.useState)(l),r=(0,u.y6)(a),s=b.$[r],{actionQueueStatus:c,setNextAction:d}=(0,f.c)({errorMessage:s.autoSaveFailed}),{saveCustomTypeSuccess:m}=(0,j.Z)(),h=(0,p.R9)(m),{syncChanges:x}=(0,y.g)(),C=(0,o.useCallback)((e,t)=>{n(e),d(async()=>{let{errors:l}=await (0,v.KA)(e);if(l.length>0)throw l;h(e),x(),null==t||t()})},[d,h,x]),S=(0,o.useMemo)(()=>({actionQueueStatus:c,customType:a,setCustomType:C}),[c,a,C]);return(0,i.jsx)(g.Provider,{value:S,children:"function"==typeof t?t(S):t})}function S(){let e=(0,o.useContext)(g);if(!e)throw Error("CustomTypeProvider not found");return e}var I=l(30195);function w(){var e;let[t,l]=(0,o.useState)(!1),{customType:n,setCustomType:r}=S(),[s,c]=null!==(e=(0,u.j5)(n))&&void 0!==e?e:[],d=c?(0,u.N3)(c):"",[m,h]=(0,o.useState)(null!=d?d:""),[x,v]=(0,o.useState)();(0,p.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let y=(0,o.useCallback)(()=>(0,i.jsx)(a.I5,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,i.jsxs)(a.Vq,{open:t,onOpenChange:l,size:"small",trigger:(0,i.jsx)(a.zx,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:y,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,i.jsx)(a.fK,{title:"Edit the UID label"}),(0,i.jsx)(a.cZ,{children:(0,i.jsxs)(a.l0,{onSubmit:function(){x||(r(c?(0,u.eK)(m,n):(0,u.H8)(m,n)),l(!1))},children:[(0,i.jsx)(a.xu,{flexDirection:"column",padding:16,gap:4,children:(0,i.jsx)(a.yt,{type:"text",label:"Label *",placeholder:"UID",value:m,onValueChange:function(e){h(e),v(function(e){let t=T.safeParse(e,{errorMap:D});if(t.error)return t.error.errors[0].message}(e))},error:x,description:"A label for the UID"})}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",disabled:!!x,children:"Save"})]})]})})]})}let T=I.z.string().max(35).min(1),D=e=>{switch(e.code){case I.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case I.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var k=l(95799),_=l(1490),N=l(63397),A=l(75289);let V=e=>{let{name:t,label:l,placeholder:a,error:n,...r}=e;return(0,i.jsxs)(A.xu,{mb:3,children:[(0,i.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,i.jsx)(N.gN,{name:t,type:"text",placeholder:a,as:A.II,autoComplete:"off",...r}),n?(0,i.jsx)(A.xv,{sx:{color:"error",mt:1},children:n}):null]})};var M=e=>{let{isOpen:t,onSubmit:l,close:a,tabIds:n}=e;return(0,i.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,onSubmit:e=>{l(e),a()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?n.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,i.jsx)(V,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},E=e=>{let{isOpen:t,onSubmit:l,close:a}=e;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),a()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,i.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),a()},children:"Yes, remove tab"})]})})},Z=e=>{let{isOpen:t,onSubmit:l,close:a,tabIds:n,initialTabKey:r}=e;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),a()},initialValues:{id:r},validate:e=>{let{id:t}=e;return t?n.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:n,setFieldValue:r,isValid:s}=e;return(0,i.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(V,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{n.id!==e.target.value&&r("id",e.target.value.trim())},onChange:e=>{r("id",e.target.value)}}),(0,i.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!s,onClick:()=>{n.id&&n.id.length&&l({id:n.id.trim()}),a()},children:"Save"})]})}})},F=l(28316),z=l(88932),L=l(80775),P=l(30988),O=l(94599),K=l(85357),H=l(99510),R=l(46622),U=l(64602),X=l(18183),B=l(65077),G=l(28574);let Y=e=>(0,i.jsxs)("svg",{width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}),$=e=>{let{openCreateSliceModal:t,openUpdateSliceZoneModal:l,openSlicesTemplatesModal:n,projectHasAvailableSlices:r,isSlicesTemplatesSupported:s}=e;return(0,i.jsx)(a.xu,{flexGrow:1,justifyContent:"center","data-testid":"slice-zone-blank-slate",children:(0,i.jsx)(G.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(G.T9,{children:[(0,i.jsx)(a.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(Y,{})}),(0,i.jsx)(G._T,{children:"Add slices"}),(0,i.jsx)(G.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)(G.Qj,{children:(0,i.jsxs)(a.S0,{children:[(0,i.jsx)(a.F8,{startIcon:"add",onClick:t,description:"Start from scratch.",children:"Create new"}),s?(0,i.jsx)(a.F8,{startIcon:"contentCopy",onClick:n,description:"Select from premade examples.",endAdornment:(0,i.jsx)(a.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,r?(0,i.jsx)(a.F8,{startIcon:"folder",onClick:l,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};function q(e){let{customType:t,tabId:l,slices:i}=e,a={...t};return i.forEach(e=>{a={...a,tabs:a.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),a}var W=l(18566),Q=l(70647);async function J(){try{let{templates:e,errors:t}=await Q.j.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var ee=l(17889),et=l(91133),el=l(68916),ei=l(47861),ea=l(76805),en=l(11104);let er=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,i.jsx)(en.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,i.jsx)(ea.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:()=>(0,i.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,i.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(ei.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ei.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,i.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var es=l(61502),eo=l(80218),ec=l(3181),ed=l(99923),eu=l(17766),em=l.n(eu);let eh=e=>{var t;let{isOpen:l,close:n,onSubmit:r,isLoading:s,slice:o,libraries:d}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,el.sT)(e)}));return(0,i.jsxs)(a.Vq,{open:l,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{title:"Upgrade slice"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(N.J9,{validateOnMount:!0,initialValues:{from:null===(t=d[0])||void 0===t?void 0:t.name,sliceName:(0,H.MP)(o.key)},validate:e=>(0,ed.h)(e,d,u,"create"),onSubmit:e=>{r({libraryID:e.from,sliceID:e.sliceName})},children:e=>(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-slice-dialog",children:(0,i.jsxs)(a.xu,{flexDirection:"column",children:[(0,i.jsxs)(a.xr,{className:em().scrollArea,style:{width:448},children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Display name*"}),"string"==typeof e.errors.sliceName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.sliceName}):null]}),(0,i.jsx)(a.yt,{placeholder:"Pascalised Slice API ID (e.g. ".concat((0,H.MP)(o.key),")"),error:"string"==typeof e.errors.sliceName,value:e.values.sliceName,onValueChange:t=>void e.setFieldValue("sliceName",t.slice(0,30)),"data-testid":"slice-name-input"}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Slice library*"}),"string"==typeof e.errors.from?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.from}):null]}),(0,i.jsx)(a.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:e.values.from,onValueChange:t=>t?void e.setFieldValue("from",t):null,children:d.map(e=>(0,i.jsx)(a.Ql,{value:e.name,children:e.name},e.name))}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",loading:s,disabled:!e.isValid,onClick:()=>void e.submitForm(),children:"Upgrade"})]})]})})})})]})};var ex=l(96009),ep=l.n(ex);let ev=e=>{var t,l;let{isOpen:n,close:r,onSubmit:s,isLoading:c,slice:d,sliceName:u,libraries:m,localSharedSlices:h}=e,[x,p]=(0,o.useState)(!0);return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{title:"Convert to slice variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(N.J9,{initialValues:{libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:ep()(d.key),variationName:u},validate:e=>ey(e,m),onSubmit:e=>{s(e)},children:e=>(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-variation-dialog",children:(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(a.xr,{className:em().scrollArea,style:{width:448},children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.libraryID?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.libraryID}):null,"string"==typeof e.errors.sliceID?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.sliceID}):null]}),(0,i.jsx)(a.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(e.values.libraryID,"::").concat(e.values.sliceID),onValueChange:t=>{if(t){let[l,i]=t.split("::");e.setFieldValue("libraryID",l),e.setFieldValue("sliceID",i)}},children:h.map(e=>(0,i.jsxs)(a.Ql,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(a.yt,{placeholder:u,error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:t=>{let l={...e.values,variationName:t.slice(0,30)};x&&(l.variationID=ep()(l.variationName)),e.setValues(l,!0)},"data-testid":"variation-name-input"})]}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"ID*"}),"string"==typeof e.errors.variationID?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationID}):null]}),(0,i.jsx)(a.yt,{placeholder:ep()(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:t=>{p(!1),e.setFieldValue("variationID",ep()(t.slice(0,30)))},"data-testid":"variation-id-input"})]})]}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",loading:c,onClick:()=>{e.submitForm()},disabled:!e.isValid,children:"Convert"})]})]})})})})]})},ey=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let i=t.find(t=>t.path===e.libraryID);l.libraryID||i||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let a=null==i?void 0:i.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||a||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var n;(null!==(n=null==a?void 0:a.model.variations.map(e=>e.id))&&void 0!==n?n:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},ef=e=>{var t,l;let{isOpen:n,close:r,onSubmit:s,isLoading:o,identicalSlices:c}=e;return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(N.J9,{initialValues:{path:null!==(l=null===(t=c[0])||void 0===t?void 0:t.path)&&void 0!==l?l:""},validate:e=>{if(!e.path)return{path:"Cannot be empty."}},onSubmit:e=>{let[t,l,i]=e.path.split("::");s({libraryID:t,sliceID:l,variationID:i})},children:e=>(0,i.jsx)("form",{id:"convert-legacy-slice-merge-with-identical-dialog",children:(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(a.xr,{className:em().scrollArea,children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.path?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.path}):null]}),(0,i.jsx)(a.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:e.values.path,onValueChange:t=>{t&&e.setFieldValue("path",t)},children:c.map(e=>(0,i.jsx)(a.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",loading:o,disabled:!e.isValid,onClick:()=>void e.submitForm(),children:"Merge"})]})]})})})})]})},ej=e=>{var t;let{slice:l,path:n}=e,{refreshState:r}=(0,j.Z)(),[s,d]=(0,o.useState)(!1),[u,m]=(0,o.useState)(),{setCustomType:h}=S(),{libraries:x}=(0,c.v9)(e=>({libraries:(0,el.Sd)(e)})),p="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,y=x.filter(e=>e.isLocal),f=y.map(e=>e.components).flat(),b=eb(l,p,f),g=async e=>{var t,i,a;if(!u)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:u});let{errors:s}=await Q.j.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...n,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(i=e.variationName)&&void 0!==i?i:"Default",variationID:null!==(a=e.variationID)&&void 0!==a?a:"default"}});if(s.length)throw console.error("Could not convert slice `".concat(p,"`"),s),z.Am.error("Could not convert slice `".concat(p,"`")),s;let{model:o,errors:c}=await Q.j.customTypes.readCustomType({id:n.customTypeID});if(c.length||!o){console.error("Could not refresh custom type view `".concat(n.customTypeID,"`"),c),z.Am.error("Could not refresh custom type view `".concat(n.customTypeID,"`"));return}switch(r(await (0,v.y0)()),d(!1),m(void 0),u){case"as_new_slice":z.Am.success("".concat(p," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":z.Am.success("".concat(p," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:z.Am.success("".concat(p," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h(o)},C={path:n,slice:l,sliceName:p,libraries:y,localSharedSlices:f,identicalSlices:b,close:()=>m(void 0),onSubmit:g,isLoading:s};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.h_,{children:[(0,i.jsx)(a.$F,{children:(0,i.jsx)(a.zx,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(a.AW,{align:"start",children:[(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>m("as_new_slice"),children:"Upgrade slice"}),(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>m("as_new_variation"),disabled:!f.length,children:"Convert to slice variation"}),(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>m("merge_with_identical"),disabled:!b.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eh,{...C,isOpen:"as_new_slice"===u}),(0,i.jsx)(ev,{...C,isOpen:"as_new_variation"===u}),(0,i.jsx)(ef,{...C,isOpen:"merge_with_identical"===u})]})},eb=(e,t,l)=>(0,o.useMemo)(()=>{let i=[],a=(0,ec.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,ec.ux)(t,e.model.name);a.primary===l.primary&&a.items===l.items&&i.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return i},[e,t,l]),eg=e=>{let{slice:t,path:l}=e,[n]=(0,es.E)("legacySliceUpgrader"),r=n.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(eo.Zb,{children:[(0,i.jsx)(eo.ZB,{component:"div",children:(0,i.jsx)(a.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(a.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eo.T$,{children:[(0,i.jsx)(a.u,{content:r,side:"bottom",children:(0,i.jsx)(a.Ct,{color:"purple",title:"Legacy Slice"})}),n.enabled?(0,i.jsx)(ej,{slice:t,path:l}):null]}),(0,i.jsx)(eo.eW,{subtitle:"1 variation",title:(0,ec.Dj)(t.value)})]})};var eC=l(53850),eS=l(42849);let eI=e=>{let{slices:t,format:l,path:a,onRemoveSharedSlice:n}=e,r=t.some(e=>"SharedSlice"!==e.type),s=b.$[l],[c]=(0,es.E)("legacySliceUpgrader");return(0,o.useEffect)(()=>{r&&(c.enabled?z.Am.info("This ".concat(s.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):z.Am.warning("This ".concat(s.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[r]),(0,i.jsx)(eS.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,i.jsx)(eg,{slice:t,path:a})}{let t=e.payload;return(0,i.jsx)(eC.b,{action:{type:"remove",onRemove:()=>{n(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,onSuccess:i}=e,{data:a,errors:n}=await Q.j.sliceTemplateLibrary.createSlices({templateIDs:t});if(n.length>0||void 0===a)throw n;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),z.Am.error(e)}}var eT=l(80410);let eD=[{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"}}}];var ek=e=>{let{availableSlices:t,values:l,placeholderSlices:a}=e;return(0,i.jsx)(N.F2,{name:"sliceKeys",render:e=>(0,i.jsx)(eS.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{var n;let r=null!==(n=null==a?void 0:a.some(e=>e.model.id===t.model.id))&&void 0!==n&&n,s=l.sliceKeys.includes(t.model.id);return(0,i.jsx)(eC.b,{action:{type:"checkbox"},isComingSoon:r,mode:"selection",onSelectedChange:i=>{i?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:s,slice:t,variant:"outlined"})}})})};let e_=e=>{let{formId:t,close:l,onSuccess:a,availableSlicesTemplates:n,localLibraries:r}=e,{createSliceSuccess:s}=(0,j.Z)();return(0,i.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:r.map(e=>e.name),onSuccess:async e=>{s((await (0,v.y0)()).libraries),a(await Promise.all(e.map(async e=>(await Q.j.slices.readSlice({libraryID:r[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(ek,{values:t,placeholderSlices:eD,availableSlices:[...n.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eT.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})})),...eD]})}})};var eN=e=>{let{formId:t,close:l,onSubmit:a,availableSlices:n}=e;return(0,i.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;a(t.map(e=>{var t;return null===(t=n.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(ek,{values:t,availableSlices:n})}})};let eA=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:i,notFound:a}=e.value.reduce((e,t)=>{let{key:i,value:a}=t;if("SharedSlice"===a.type){let t=l.find(e=>e.model.id===i);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:i}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:i,value:a}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:i,notFound:a}};var eV=e=>{var t;let{customType:l,onCreateSliceZone:n,onDeleteSliceZone:r,onRemoveSharedSlice:s,sliceZone:d,tabId:u}=e,m=(0,W.QT)(J,[]),[h,x]=(0,o.useState)(!1),[p,y]=(0,o.useState)(!1),[f,j]=(0,o.useState)(!1),{remoteSlices:b,libraries:g}=(0,c.v9)(e=>({remoteSlices:(0,el.sT)(e),libraries:(0,el.Sd)(e),slices:(0,el.xC)(e)})),{setCustomType:C}=S(),I=g.filter(e=>e.isLocal),{availableSlices:w,slicesInSliceZone:T,notFound:D}=(0,o.useMemo)(()=>d?eA(d,g):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,g]),[_,N]=(0,o.useState)(!1);(0,o.useEffect)(()=>{(null==D?void 0:D.length)&&D.forEach(e=>{let{key:t}=e;s(t)})},[D]);let A=T.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),V=w.filter(e=>!A.some(t=>t.model.id===e.model.id)),M=()=>{y(!0)},E=()=>{j(!0)},Z=()=>{x(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},F=()=>{y(!1)},P=()=>{j(!1)},O=()=>{x(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(L.Bu,{actions:d?(0,i.jsxs)(a.h_,{children:[(0,i.jsx)(a.$F,{children:(0,i.jsx)(a.zx,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(a.AW,{align:"end",children:[(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"add",size:"large"}),onSelect:E,description:"Start from scratch.",children:"Create new"}),m.length>0?(0,i.jsx)(a.Xi,{onSelect:Z,startIcon:(0,i.jsx)(a.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",endAdornment:(0,i.jsx)(a.xv,{color:"inherit",component:"kbd",children:(0,i.jsx)(a.Ct,{color:"purple",title:"New"})}),children:"Use template"}):void 0,V.length>0?(0,i.jsx)(a.Xi,{onSelect:M,startIcon:(0,i.jsx)(a.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==u?(0,i.jsx)(a.rs,{checked:!!d,onCheckedChange:e=>{e?n():N(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?T.length>0?(0,i.jsx)(B.xR,{children:(0,i.jsx)(eI,{slices:T,format:l.format,path:{customTypeID:l.id,tabID:u,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:s})}):(0,i.jsx)($,{openUpdateSliceZoneModal:M,openCreateSliceModal:E,openSlicesTemplatesModal:Z,projectHasAvailableSlices:V.length>0,isSlicesTemplatesSupported:m.length>0}):void 0,p&&(0,i.jsx)(eN,{formId:"tab-slicezone-form-".concat(u),availableSlices:V,onSubmit:e=>{let t=q({customType:l,tabId:u,slices:e});C(k.Dc.fromSM(t),()=>{z.Am.success("Slice(s) added to slice zone")}),F()},close:F}),h&&(0,i.jsx)(e_,{formId:"tab-slicezone-form-".concat(u),availableSlicesTemplates:m,localLibraries:I,onSuccess:e=>{let t=q({customType:l,tabId:u,slices:e});C(k.Dc.fromSM(t),()=>{z.Am.success((0,i.jsx)(et.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(I[0].name,"/")}))}),O()},close:O}),_&&(0,i.jsx)(er,{closeDeleteSliceZoneModal:()=>{N(!1)},deleteSliceZone:()=>{r(),N(!1)}}),(null==I?void 0:I.length)!==0&&f&&(0,i.jsx)(ee.c,{onSuccess:e=>{let t=q({customType:l,tabId:u,slices:[e]});C(k.Dc.fromSM(t),()=>{z.Am.success((0,i.jsx)(et.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(I[0].name,"/")}))}),P()},localLibraries:I,remoteSlices:b,onClose:P})]})};let eM=[O.C.UID,O.C.Image,O.C.Text,O.C.StructuredText,O.C.Link,O.C.Select,O.C.Boolean,O.C.Number,O.C.Color,O.C.Date,O.C.Embed,O.C.Timestamp,O.C.GeoPoint,O.C.ContentRelationship,O.C.LinkToMedia,O.C.Group,O.C.NestedGroup];var eE=e=>{var t,l,n,r;let{tabId:s}=e,{customType:c,setCustomType:d}=S(),m=k.Dc.toSM(c),h=null===(t=m.tabs.find(e=>e.key===s))||void 0===t?void 0:t.sliceZone,x=null!==(n=null===(l=m.tabs.find(e=>e.key===s))||void 0===l?void 0:l.value)&&void 0!==n?n:[],p="page"===m.format&&m.repeatable?x.filter(e=>"uid"!==e.key):x,y=m.tabs.reduce((e,t)=>[...e,...t.value],[]),f=e=>{var t;let{apiId:l,value:i}=e,a=null===(t=i.config)||void 0===t?void 0:t.label;if((0,K.Ss)(O.C,i.type)||null==a)return;if("Range"===i.type||"IntegrationFields"===i.type||"Separator"===i.type)throw Error("Unsupported Field Type: ".concat(i.type));let n=O.C[i.type];try{n.schema.validateSync(i,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(i.type,'".'))}let r=k.L$.fromSM(i);d((0,u.xS)({customType:c,newField:r,newFieldId:l,sectionId:s}),()=>{z.Am.success("".concat("Group"===i.type?"Group":"Field"," added"))}),v.Xe.track({event:"field:added",id:l,name:a,type:r.type,isInAGroup:!1,contentType:(0,R.T)(window.location.pathname)})},j=e=>{let{apiId:t,newKey:l,value:i,isNewGroupField:a}=e;if((0,K.Ss)(O.C,i.type))return;let n=k.L$.fromSM(i);d((0,u.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:n,sectionId:s}),()=>{!0===a&&z.Am.success("Field added")})};return(0,i.jsx)(P.S,{children:(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)(a.xu,{padding:32,children:(0,i.jsx)(a._3,{})}),children:(0,i.jsxs)(L.aV,{border:!1,style:{flexGrow:1},children:[(0,i.jsx)(X.Z,{zoneType:"customType",zoneTypeFormat:null!==(r=c.format)&&void 0!==r?r:"custom",tabId:s,title:"Static zone",dataTip:"",fields:p,poolOfFieldsToCheck:y,showHints:!0,EditModal:U.Z,widgetsArray:eM,onDeleteItem:e=>{d((0,u.AK)({customType:c,fieldId:e,sectionId:s}))},onSave:e=>""===e.apiId?f({...e,apiId:e.newKey}):j(e),onDragEnd:e=>{if((0,K.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let i=(0,u.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:s});(0,F.flushSync)(()=>d(i))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,H.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,H.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,i.jsx)(eV,{customType:m,tabId:s,sliceZone:h,onRemoveSharedSlice:e=>{d((0,u.EN)({customType:c,sectionId:s,sliceId:e}))},onCreateSliceZone:()=>{d((0,u.Tr)(c,s))},onDeleteSliceZone:()=>{d((0,u.E3)(c,s))}})]})})})};let eZ=()=>{var e,t,l;let{customType:n,setCustomType:r}=S(),s=k.Dc.toSM(n),[c,d]=(0,o.useState)(null===(e=s.tabs[0])||void 0===e?void 0:e.key),[m,h]=(0,o.useState)(),x=(null===(l=s.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.Rz,{sx:x?{flexGrow:1}:void 0,children:["page"===n.format?(0,i.jsx)(a.py,{title:n.repeatable?(0,i.jsx)(w,{}):void 0}):void 0,(0,i.jsxs)(a.KC,{onValueChange:d,value:c,children:[(0,i.jsx)(a.mY,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:s.tabs.map(e=>(0,i.jsx)(a.wf,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Xi,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(a.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(a.Xi,{color:"tomato",disabled:function(e){if(s.tabs.length<=1)return!0;let t=s.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===n.format&&n.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(a.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),s.tabs.map(e=>(0,i.jsx)(a.e$,{value:e.key,children:(0,i.jsx)(eE,{tabId:e.key})},e.key))]})]}),(null==m?void 0:m.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.vB)(n,t)),d(t)},tabIds:s.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(Z,{close:()=>{h(void 0)},initialTabKey:m.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.HO)(n,m.tabKey,t)),c===m.tabKey&&d(t)},tabIds:s.tabs.filter(e=>e.key!==m.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(E,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(r((0,u.F$)(n,m.tabKey)),c===m.tabKey){var e;let t=null===(e=s.tabs.find(e=>e.key!==m.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eF=l(1744),ez=l(40572),eL=l(64910),eP=l(9975),eO=l(41329),eK=l.n(eO);let eH=e=>{let{tabs:t,...l}=e;return(0,i.jsxs)(eP.fC,{...l,className:eK().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,i.jsx)(eP.aV,{className:eK().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,i.jsx)(eP.xz,{className:eK().trigger,value:l,children:(0,i.jsx)(a.xv,{className:eK().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:n}=e;return(0,i.jsx)(eP.VY,{className:eK().content,value:l,children:(0,i.jsx)(a.xr,{className:eK().scrollArea,children:n})},"".concat(l,"-content").concat(t+1))})]})};var eR=l(11290),eU=l(88241),eX=l(58133),eB=l(37628),eG=l.n(eB);let eY=e=>{var t,l;let{inline:n,...r}=e,s=(0,eX.p)();if(!0===n)return(0,i.jsx)("code",{...r,className:eG().inlineCode});let o=(()=>{var e,t,l,i,a;if((null===(t=r.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(i=r.node)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(a=r.className)||void 0===a?void 0:a.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=r.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,i.jsx)(a.dn,{...r,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:s})},language:c,code:String(r.children).replace(/\n$/,""),title:null==o?void 0:o.fileName})},e$=e=>{let{markdown:t}=e;return(0,i.jsx)(eR.D,{children:t,linkTarget:"_blank",remarkPlugins:[eU.Z],components:{code:e=>(0,i.jsx)(eY,{...e}),h1:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,i.jsx)(a.xv,{className:eG().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,i.jsx)(a.xv,{className:eG().section,children:e.children,component:"pre",variant:"normal"})}})};async function eq(e){let t=JSON.parse(e),{errors:l,documentation:i}=await Q.j.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return i}var eW=l(83321),eQ=l.n(eW);let eJ=e=>{var t;let{model:l}=e,n=(0,eX.p)(),r=(t={kind:"PageSnippet",data:{model:l}},(0,W.QT)(eq,[JSON.stringify(t)]));return 0===r.length?null:(0,i.jsxs)(a.Vq,{size:"small",trigger:(0,i.jsx)(a.zx,{color:"grey",onClick:()=>{v.Xe.track({event:"page-type:open-snippet",framework:n})},startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(a.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:eQ().content,children:r.length>1?(0,i.jsx)(eH,{style:{flex:1},tabs:r.map((e,t)=>{let{label:l,content:a}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,i.jsx)(e$,{markdown:a})}})}):(0,i.jsx)(a.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(e$,{markdown:r[0].content})})})]})},e0=e=>{let{model:t}=e;return(0,i.jsx)("div",{children:(0,i.jsx)(P.S,{children:(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)(a.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(eJ,{model:t})})})})},e1=()=>{let e=(0,s.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,ez.Jk)(t,(0,h.Ag)(e.query))}));return((0,o.useEffect)(()=>{t&&(0,eF.TG)(t)||e.replace("/")},[t,e]),t&&(0,eF.TG)(t))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,i.jsx)(e4,{customType:t.local})]}):(0,i.jsx)(x.LN,{})},e4=e=>{let{customType:t}=e;return null===t?(0,i.jsx)(x.LN,{}):(0,i.jsx)(x.LN,{children:(0,i.jsx)(C,{initialCustomType:k.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:n,customType:r,setCustomType:s}=e,o=(0,u.y6)(r),c=h.cd[t.format],p=b.$[t.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(x.wd,{children:[(0,i.jsx)(x.Xq,{url:c.tablePagePathname}),(0,i.jsxs)(x.Cx,{children:[(0,i.jsx)(d.g,{children:p.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(l=r.label)&&void 0!==l?l:r.id})]}),(0,i.jsxs)(x.K2,{children:[(0,i.jsx)(m.X,{status:n}),"page"===r.format?(0,i.jsx)(e0,{model:r}):void 0,(0,i.jsx)(eL._,{isChangesLocal:!0,format:o,customType:r,setLocalCustomType:s})]})]}),(0,i.jsx)(x.RN,{children:(0,i.jsx)(a.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eZ,{})})})]})}})})}},61502:function(e,t,l){"use strict";l.d(t,{E:function(){return a}});var i=l(29806);function a(e){var t,l;let[a,n]=(0,i.f)(),r=async t=>{let l={...a,labs:{...a.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await n(l)};return[{enabled:null!==(l=null==a?void 0:null===(t=a.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},r]}},29806:function(e,t,l){"use strict";l.d(t,{f:function(){return n}});var i=l(18566),a=l(70647);function n(){return[(0,i.QT)(r,[]),async e=>{await a.j.project.writeSliceMachineConfig({config:e}),(0,i.VA)(r,[],e)}]}async function r(){return a.j.project.getSliceMachineConfig()}},17889:function(e,t,l){"use strict";l.d(t,{c:function(){return f}});var i=l(52322),a=l(2784),n=l(36131),r=l(75289),s=l(93188),o=l(88932),c=l(3181),d=l(99510),u=l(70647);async function m(e){let{sliceName:t,libraryName:l,onSuccess:i}=e;try{let e=(0,c.fo)(t),{errors:a}=await u.j.slices.createSlice({libraryID:l,model:e});if(a.length>0)throw a;s.Xe.track({event:"slice:created",id:(0,d.MP)(t),name:t,library:l}),await i(e)}catch(l){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,l),o.Am.error(e)}}var h=l(80546),x=l(1490),p=l(41067),v=l(28801),y=l(99923);let f=e=>{let{onClose:t,onSuccess:l,localLibraries:o,remoteSlices:c}=e,{createSliceSuccess:d}=(0,p.Z)(),[u,f]=(0,a.useState)(!1),{syncChanges:j}=(0,h.g)(),b=async e=>{let t=e.sliceName,i=e.from;f(!0),await m({sliceName:t,libraryName:i,onSuccess:async e=>{d((await (0,s.y0)()).libraries),l(e,i),j()}})};return(0,i.jsx)(x.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:u,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{b(e)},initialValues:{sliceName:"",from:o[0].name},validate:e=>(0,y.h)(e,o,c,"create"),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:l,setFieldValue:a,errors:s}=e;return(0,i.jsxs)(r.xu,{children:[(0,i.jsx)(v.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?s.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(r.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(n.ZP,{name:"from",options:o.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void a("from",e.value):null,defaultValue:{value:l.from,label:l.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},99923:function(e,t,l){"use strict";l.d(t,{h:function(){return c}});var i=l(96009),a=l.n(i),n=l(74600),r=l.n(n),s=l(93188),o=l(17186);function c(e,t,l,i){let{sliceName:n}=e;return n?o.xo.exec(n)?r()(a()(n)).replace(/\s/gm,"")!==n.trim()?(s.Xe.track({event:"slice-name-error:pascal-case",errorType:i}),{sliceName:"Value has to be PascalCased"}):n.match(/^\d/)?{sliceName:"Value cannot start with a number"}:o.lS.includes(n)?{sliceName:"".concat(n," is reserved for Slice Machine use")}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...l.map(e=>e.name)].includes(n)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed"}:{sliceName:"Cannot be empty"}}},42849:function(e,t,l){"use strict";var i=l(52322),a=l(75289);t.Z=function(e){let{elems:t,renderElem:l,defineElementKey:n,gridTemplateMinPx:r="320px",gridGap:s="16px",sx:o}=e;return(0,i.jsx)(a.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(r,", 1fr))"),gridGap:s,pt:2,...o},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:l(e,t)},"".concat(n(e),"-").concat(t+1)):null)})}},41329:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},83321:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},37628:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},17766:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150],{9150:function(e,t,l){"use strict";l.d(t,{H:function(){return e1}});var i=l(52322),a=l(33760),n=l(97729),r=l.n(n),s=l(5632),o=l(2784),c=l(56580),d=l(23335),u=l(93216),m=l(6697),h=l(63447),x=l(28948),p=l(74217),v=l(93188),y=l(80546),f=l(43874),j=l(41067),b=l(77507);let g=(0,o.createContext)(void 0);function C(e){let{children:t,initialCustomType:l}=e,[a,n]=(0,o.useState)(l),r=(0,u.y6)(a),s=b.$[r],{actionQueueStatus:c,setNextAction:d}=(0,f.c)({errorMessage:s.autoSaveFailed}),{saveCustomTypeSuccess:m}=(0,j.Z)(),h=(0,p.R9)(m),{syncChanges:x}=(0,y.g)(),C=(0,o.useCallback)((e,t)=>{n(e),d(async()=>{let{errors:l}=await (0,v.KA)(e);if(l.length>0)throw l;h(e),x(),null==t||t()})},[d,h,x]),S=(0,o.useMemo)(()=>({actionQueueStatus:c,customType:a,setCustomType:C}),[c,a,C]);return(0,i.jsx)(g.Provider,{value:S,children:"function"==typeof t?t(S):t})}function S(){let e=(0,o.useContext)(g);if(!e)throw Error("CustomTypeProvider not found");return e}var I=l(30195);function w(){var e;let[t,l]=(0,o.useState)(!1),{customType:n,setCustomType:r}=S(),[s,c]=null!==(e=(0,u.j5)(n))&&void 0!==e?e:[],d=c?(0,u.N3)(c):"",[m,h]=(0,o.useState)(null!=d?d:""),[x,v]=(0,o.useState)();(0,p.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let y=(0,o.useCallback)(()=>(0,i.jsx)(a.I5,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,i.jsxs)(a.Vq,{open:t,onOpenChange:l,size:"small",trigger:(0,i.jsx)(a.zx,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:y,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,i.jsx)(a.fK,{title:"Edit the UID label"}),(0,i.jsx)(a.cZ,{children:(0,i.jsxs)(a.l0,{onSubmit:function(){x||(r(c?(0,u.eK)(m,n):(0,u.H8)(m,n)),l(!1))},children:[(0,i.jsx)(a.xu,{flexDirection:"column",padding:16,gap:4,children:(0,i.jsx)(a.yt,{type:"text",label:"Label *",placeholder:"UID",value:m,onValueChange:function(e){h(e),v(function(e){let t=T.safeParse(e,{errorMap:D});if(t.error)return t.error.errors[0].message}(e))},error:x,description:"A label for the UID"})}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",disabled:!!x,children:"Save"})]})]})})]})}let T=I.z.string().max(35).min(1),D=e=>{switch(e.code){case I.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case I.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var k=l(95799),_=l(1490),N=l(63397),A=l(75289);let V=e=>{let{name:t,label:l,placeholder:a,error:n,...r}=e;return(0,i.jsxs)(A.xu,{mb:3,children:[(0,i.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,i.jsx)(N.gN,{name:t,type:"text",placeholder:a,as:A.II,autoComplete:"off",...r}),n?(0,i.jsx)(A.xv,{sx:{color:"error",mt:1},children:n}):null]})};var M=e=>{let{isOpen:t,onSubmit:l,close:a,tabIds:n}=e;return(0,i.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,onSubmit:e=>{l(e),a()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?n.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,i.jsx)(V,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},E=e=>{let{isOpen:t,onSubmit:l,close:a}=e;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),a()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,i.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),a()},children:"Yes, remove tab"})]})})},Z=e=>{let{isOpen:t,onSubmit:l,close:a,tabIds:n,initialTabKey:r}=e;return(0,i.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:a,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),a()},initialValues:{id:r},validate:e=>{let{id:t}=e;return t?n.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:n,setFieldValue:r,isValid:s}=e;return(0,i.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(V,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{n.id!==e.target.value&&r("id",e.target.value.trim())},onChange:e=>{r("id",e.target.value)}}),(0,i.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!s,onClick:()=>{n.id&&n.id.length&&l({id:n.id.trim()}),a()},children:"Save"})]})}})},F=l(28316),z=l(88932),L=l(80775),P=l(30988),O=l(94599),K=l(85357),H=l(99510),R=l(46622),U=l(64602),X=l(18183),B=l(65077),G=l(28574);let Y=e=>(0,i.jsxs)("svg",{width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}),$=e=>{let{openCreateSliceModal:t,openUpdateSliceZoneModal:l,openSlicesTemplatesModal:n,projectHasAvailableSlices:r,isSlicesTemplatesSupported:s}=e;return(0,i.jsx)(a.xu,{flexGrow:1,justifyContent:"center","data-testid":"slice-zone-blank-slate",children:(0,i.jsx)(G.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(G.T9,{children:[(0,i.jsx)(a.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(Y,{})}),(0,i.jsx)(G._T,{children:"Add slices"}),(0,i.jsx)(G.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)(G.Qj,{children:(0,i.jsxs)(a.S0,{children:[(0,i.jsx)(a.F8,{startIcon:"add",onClick:t,description:"Start from scratch.",children:"Create new"}),s?(0,i.jsx)(a.F8,{startIcon:"contentCopy",onClick:n,description:"Select from premade examples.",endAdornment:(0,i.jsx)(a.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,r?(0,i.jsx)(a.F8,{startIcon:"folder",onClick:l,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};function q(e){let{customType:t,tabId:l,slices:i}=e,a={...t};return i.forEach(e=>{a={...a,tabs:a.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),a}var W=l(18566),Q=l(70647);async function J(){try{let{templates:e,errors:t}=await Q.j.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var ee=l(17889),et=l(91133),el=l(68916),ei=l(47861),ea=l(76805),en=l(11104);let er=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,i.jsx)(en.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,i.jsx)(ea.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:()=>(0,i.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,i.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(ei.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ei.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,i.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var es=l(61502),eo=l(80218),ec=l(3181),ed=l(99923),eu=l(17766),em=l.n(eu);let eh=e=>{var t;let{isOpen:l,close:n,onSubmit:r,isLoading:s,slice:o,libraries:d}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,el.sT)(e)}));return(0,i.jsxs)(a.Vq,{open:l,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{title:"Upgrade slice"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(N.J9,{validateOnMount:!0,initialValues:{from:null===(t=d[0])||void 0===t?void 0:t.name,sliceName:(0,H.MP)(o.key)},validate:e=>(0,ed.h)(e,d,u,"create"),onSubmit:e=>{r({libraryID:e.from,sliceID:e.sliceName})},children:e=>(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-slice-dialog",children:(0,i.jsxs)(a.xu,{flexDirection:"column",children:[(0,i.jsxs)(a.xr,{className:em().scrollArea,style:{width:448},children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Display name*"}),"string"==typeof e.errors.sliceName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.sliceName}):null]}),(0,i.jsx)(a.yt,{placeholder:"Pascalised Slice API ID (e.g. ".concat((0,H.MP)(o.key),")"),error:"string"==typeof e.errors.sliceName,value:e.values.sliceName,onValueChange:t=>void e.setFieldValue("sliceName",t.slice(0,30)),"data-testid":"slice-name-input"}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(a.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Slice library*"}),"string"==typeof e.errors.from?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.from}):null]}),(0,i.jsx)(a.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:e.values.from,onValueChange:t=>t?void e.setFieldValue("from",t):null,children:d.map(e=>(0,i.jsx)(a.Ql,{value:e.name,children:e.name},e.name))}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",loading:s,disabled:!e.isValid,onClick:()=>void e.submitForm(),children:"Upgrade"})]})]})})})})]})};var ex=l(96009),ep=l.n(ex);let ev=e=>{var t,l;let{isOpen:n,close:r,onSubmit:s,isLoading:c,slice:d,sliceName:u,libraries:m,localSharedSlices:h}=e,[x,p]=(0,o.useState)(!0);return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{title:"Convert to slice variation"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(N.J9,{initialValues:{libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:ep()(d.key),variationName:u},validate:e=>ey(e,m),onSubmit:e=>{s(e)},children:e=>(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-variation-dialog",children:(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(a.xr,{className:em().scrollArea,style:{width:448},children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.libraryID?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.libraryID}):null,"string"==typeof e.errors.sliceID?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.sliceID}):null]}),(0,i.jsx)(a.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(e.values.libraryID,"::").concat(e.values.sliceID),onValueChange:t=>{if(t){let[l,i]=t.split("::");e.setFieldValue("libraryID",l),e.setFieldValue("sliceID",i)}},children:h.map(e=>(0,i.jsxs)(a.Ql,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(a.yt,{placeholder:u,error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:t=>{let l={...e.values,variationName:t.slice(0,30)};x&&(l.variationID=ep()(l.variationName)),e.setValues(l,!0)},"data-testid":"variation-name-input"})]}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"ID*"}),"string"==typeof e.errors.variationID?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.variationID}):null]}),(0,i.jsx)(a.yt,{placeholder:ep()(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:t=>{p(!1),e.setFieldValue("variationID",ep()(t.slice(0,30)))},"data-testid":"variation-id-input"})]})]}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",loading:c,onClick:()=>{e.submitForm()},disabled:!e.isValid,children:"Convert"})]})]})})})})]})},ey=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let i=t.find(t=>t.path===e.libraryID);l.libraryID||i||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let a=null==i?void 0:i.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||a||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var n;(null!==(n=null==a?void 0:a.model.variations.map(e=>e.id))&&void 0!==n?n:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},ef=e=>{var t,l;let{isOpen:n,close:r,onSubmit:s,isLoading:o,identicalSlices:c}=e;return(0,i.jsxs)(a.Vq,{open:n,onOpenChange:e=>!e&&r(),size:{width:448,height:"auto"},children:[(0,i.jsx)(a.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(a.cZ,{children:(0,i.jsx)(N.J9,{initialValues:{path:null!==(l=null===(t=c[0])||void 0===t?void 0:t.path)&&void 0!==l?l:""},validate:e=>{if(!e.path)return{path:"Cannot be empty."}},onSubmit:e=>{let[t,l,i]=e.path.split("::");s({libraryID:t,sliceID:l,variationID:i})},children:e=>(0,i.jsx)("form",{id:"convert-legacy-slice-merge-with-identical-dialog",children:(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(a.xr,{className:em().scrollArea,children:[(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,i.jsxs)(a.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:em().label,children:[(0,i.jsx)(a.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.path?(0,i.jsx)(a.xv,{variant:"small",color:"tomato10",children:e.errors.path}):null]}),(0,i.jsx)(a.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:e.values.path,onValueChange:t=>{t&&e.setFieldValue("path",t)},children:c.map(e=>(0,i.jsx)(a.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,i.jsx)(a.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsxs)(a.kX,{children:[(0,i.jsx)(a.PO,{size:"medium"}),(0,i.jsx)(a._d,{size:"medium",loading:o,disabled:!e.isValid,onClick:()=>void e.submitForm(),children:"Merge"})]})]})})})})]})},ej=e=>{var t;let{slice:l,path:n}=e,{refreshState:r}=(0,j.Z)(),[s,d]=(0,o.useState)(!1),[u,m]=(0,o.useState)(),{setCustomType:h}=S(),{libraries:x}=(0,c.v9)(e=>({libraries:(0,el.Sd)(e)})),p="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,y=x.filter(e=>e.isLocal),f=y.map(e=>e.components).flat(),b=eb(l,p,f),g=async e=>{var t,i,a;if(!u)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:u});let{errors:s}=await Q.j.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...n,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(i=e.variationName)&&void 0!==i?i:"Default",variationID:null!==(a=e.variationID)&&void 0!==a?a:"default"}});if(s.length)throw console.error("Could not convert slice `".concat(p,"`"),s),z.Am.error("Could not convert slice `".concat(p,"`")),s;let{model:o,errors:c}=await Q.j.customTypes.readCustomType({id:n.customTypeID});if(c.length||!o){console.error("Could not refresh custom type view `".concat(n.customTypeID,"`"),c),z.Am.error("Could not refresh custom type view `".concat(n.customTypeID,"`"));return}switch(r(await (0,v.y0)()),d(!1),m(void 0),u){case"as_new_slice":z.Am.success("".concat(p," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":z.Am.success("".concat(p," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:z.Am.success("".concat(p," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h(o)},C={path:n,slice:l,sliceName:p,libraries:y,localSharedSlices:f,identicalSlices:b,close:()=>m(void 0),onSubmit:g,isLoading:s};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.h_,{children:[(0,i.jsx)(a.$F,{children:(0,i.jsx)(a.zx,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(a.AW,{align:"start",children:[(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>m("as_new_slice"),children:"Upgrade slice"}),(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>m("as_new_variation"),disabled:!f.length,children:"Convert to slice variation"}),(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>m("merge_with_identical"),disabled:!b.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(eh,{...C,isOpen:"as_new_slice"===u}),(0,i.jsx)(ev,{...C,isOpen:"as_new_variation"===u}),(0,i.jsx)(ef,{...C,isOpen:"merge_with_identical"===u})]})},eb=(e,t,l)=>(0,o.useMemo)(()=>{let i=[],a=(0,ec.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,ec.ux)(t,e.model.name);a.primary===l.primary&&a.items===l.items&&i.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return i},[e,t,l]),eg=e=>{let{slice:t,path:l}=e,[n]=(0,es.E)("legacySliceUpgrader"),r=n.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(eo.Zb,{children:[(0,i.jsx)(eo.ZB,{component:"div",children:(0,i.jsx)(a.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(a.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eo.T$,{children:[(0,i.jsx)(a.u,{content:r,side:"bottom",children:(0,i.jsx)(a.Ct,{color:"purple",title:"Legacy Slice"})}),n.enabled?(0,i.jsx)(ej,{slice:t,path:l}):null]}),(0,i.jsx)(eo.eW,{subtitle:"1 variation",title:(0,ec.Dj)(t.value)})]})};var eC=l(53850),eS=l(42849);let eI=e=>{let{slices:t,format:l,path:a,onRemoveSharedSlice:n}=e,r=t.some(e=>"SharedSlice"!==e.type),s=b.$[l],[c]=(0,es.E)("legacySliceUpgrader");return(0,o.useEffect)(()=>{r&&(c.enabled?z.Am.info("This ".concat(s.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):z.Am.warning("This ".concat(s.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[r]),(0,i.jsx)(eS.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,i.jsx)(eg,{slice:t,path:a})}{let t=e.payload;return(0,i.jsx)(eC.b,{action:{type:"remove",onRemove:()=>{n(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,onSuccess:i}=e,{data:a,errors:n}=await Q.j.sliceTemplateLibrary.createSlices({templateIDs:t});if(n.length>0||void 0===a)throw n;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),z.Am.error(e)}}var eT=l(80410);let eD=[{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"}}}];var ek=e=>{let{availableSlices:t,values:l,placeholderSlices:a}=e;return(0,i.jsx)(N.F2,{name:"sliceKeys",render:e=>(0,i.jsx)(eS.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{var n;let r=null!==(n=null==a?void 0:a.some(e=>e.model.id===t.model.id))&&void 0!==n&&n,s=l.sliceKeys.includes(t.model.id);return(0,i.jsx)(eC.b,{action:{type:"checkbox"},isComingSoon:r,mode:"selection",onSelectedChange:i=>{i?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:s,slice:t,variant:"outlined"})}})})};let e_=e=>{let{formId:t,close:l,onSuccess:a,availableSlicesTemplates:n,localLibraries:r}=e,{createSliceSuccess:s}=(0,j.Z)();return(0,i.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:r.map(e=>e.name),onSuccess:async e=>{s((await (0,v.y0)()).libraries),a(await Promise.all(e.map(async e=>(await Q.j.slices.readSlice({libraryID:r[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(ek,{values:t,placeholderSlices:eD,availableSlices:[...n.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eT.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})})),...eD]})}})};var eN=e=>{let{formId:t,close:l,onSubmit:a,availableSlices:n}=e;return(0,i.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;a(t.map(e=>{var t;return null===(t=n.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,i.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,i.jsx)(ek,{values:t,availableSlices:n})}})};let eA=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:i,notFound:a}=e.value.reduce((e,t)=>{let{key:i,value:a}=t;if("SharedSlice"===a.type){let t=l.find(e=>e.model.id===i);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:i}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:i,value:a}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:i,notFound:a}};var eV=e=>{var t;let{customType:l,onCreateSliceZone:n,onDeleteSliceZone:r,onRemoveSharedSlice:s,sliceZone:d,tabId:u}=e,m=(0,W.QT)(J,[]),[h,x]=(0,o.useState)(!1),[p,y]=(0,o.useState)(!1),[f,j]=(0,o.useState)(!1),{remoteSlices:b,libraries:g}=(0,c.v9)(e=>({remoteSlices:(0,el.sT)(e),libraries:(0,el.Sd)(e),slices:(0,el.xC)(e)})),{setCustomType:C}=S(),I=g.filter(e=>e.isLocal),{availableSlices:w,slicesInSliceZone:T,notFound:D}=(0,o.useMemo)(()=>d?eA(d,g):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,g]),[_,N]=(0,o.useState)(!1);(0,o.useEffect)(()=>{(null==D?void 0:D.length)&&D.forEach(e=>{let{key:t}=e;s(t)})},[D]);let A=T.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),V=w.filter(e=>!A.some(t=>t.model.id===e.model.id)),M=()=>{y(!0)},E=()=>{j(!0)},Z=()=>{x(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},F=()=>{y(!1)},P=()=>{j(!1)},O=()=>{x(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(L.Bu,{actions:d?(0,i.jsxs)(a.h_,{children:[(0,i.jsx)(a.$F,{children:(0,i.jsx)(a.zx,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(a.AW,{align:"end",children:[(0,i.jsx)(a.Xi,{startIcon:(0,i.jsx)(a.I5,{name:"add",size:"large"}),onSelect:E,description:"Start from scratch.",children:"Create new"}),m.length>0?(0,i.jsx)(a.Xi,{onSelect:Z,startIcon:(0,i.jsx)(a.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",endAdornment:(0,i.jsx)(a.xv,{color:"inherit",component:"kbd",children:(0,i.jsx)(a.Ct,{color:"purple",title:"New"})}),children:"Use template"}):void 0,V.length>0?(0,i.jsx)(a.Xi,{onSelect:M,startIcon:(0,i.jsx)(a.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==u?(0,i.jsx)(a.rs,{checked:!!d,onCheckedChange:e=>{e?n():N(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?T.length>0?(0,i.jsx)(B.xR,{children:(0,i.jsx)(eI,{slices:T,format:l.format,path:{customTypeID:l.id,tabID:u,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:s})}):(0,i.jsx)($,{openUpdateSliceZoneModal:M,openCreateSliceModal:E,openSlicesTemplatesModal:Z,projectHasAvailableSlices:V.length>0,isSlicesTemplatesSupported:m.length>0}):void 0,p&&(0,i.jsx)(eN,{formId:"tab-slicezone-form-".concat(u),availableSlices:V,onSubmit:e=>{let t=q({customType:l,tabId:u,slices:e});C(k.Dc.fromSM(t),()=>{z.Am.success("Slice(s) added to slice zone")}),F()},close:F}),h&&(0,i.jsx)(e_,{formId:"tab-slicezone-form-".concat(u),availableSlicesTemplates:m,localLibraries:I,onSuccess:e=>{let t=q({customType:l,tabId:u,slices:e});C(k.Dc.fromSM(t),()=>{z.Am.success((0,i.jsx)(et.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(I[0].name,"/")}))}),O()},close:O}),_&&(0,i.jsx)(er,{closeDeleteSliceZoneModal:()=>{N(!1)},deleteSliceZone:()=>{r(),N(!1)}}),(null==I?void 0:I.length)!==0&&f&&(0,i.jsx)(ee.c,{onSuccess:e=>{let t=q({customType:l,tabId:u,slices:[e]});C(k.Dc.fromSM(t),()=>{z.Am.success((0,i.jsx)(et.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(I[0].name,"/")}))}),P()},localLibraries:I,remoteSlices:b,onClose:P})]})};let eM=[O.C.UID,O.C.Image,O.C.Text,O.C.StructuredText,O.C.Link,O.C.Select,O.C.Boolean,O.C.Number,O.C.Color,O.C.Date,O.C.Embed,O.C.Timestamp,O.C.GeoPoint,O.C.ContentRelationship,O.C.LinkToMedia,O.C.Group,O.C.NestedGroup];var eE=e=>{var t,l,n,r;let{tabId:s}=e,{customType:c,setCustomType:d}=S(),m=k.Dc.toSM(c),h=null===(t=m.tabs.find(e=>e.key===s))||void 0===t?void 0:t.sliceZone,x=null!==(n=null===(l=m.tabs.find(e=>e.key===s))||void 0===l?void 0:l.value)&&void 0!==n?n:[],p="page"===m.format&&m.repeatable?x.filter(e=>"uid"!==e.key):x,y=m.tabs.reduce((e,t)=>[...e,...t.value],[]),f=e=>{var t;let{apiId:l,value:i}=e,a=null===(t=i.config)||void 0===t?void 0:t.label;if((0,K.Ss)(O.C,i.type)||null==a)return;if("Range"===i.type||"IntegrationFields"===i.type||"Separator"===i.type)throw Error("Unsupported Field Type: ".concat(i.type));let n=O.C[i.type];try{n.schema.validateSync(i,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(i.type,'".'))}let r=k.L$.fromSM(i);d((0,u.xS)({customType:c,newField:r,newFieldId:l,sectionId:s}),()=>{z.Am.success("".concat("Group"===i.type?"Group":"Field"," added"))}),v.Xe.track({event:"field:added",id:l,name:a,type:r.type,isInAGroup:!1,contentType:(0,R.T)(window.location.pathname)})},j=e=>{let{apiId:t,newKey:l,value:i,isNewGroupField:a}=e;if((0,K.Ss)(O.C,i.type))return;let n=k.L$.fromSM(i);d((0,u.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:n,sectionId:s}),()=>{!0===a&&z.Am.success("Field added")})};return(0,i.jsx)(P.S,{children:(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)(a.xu,{padding:32,children:(0,i.jsx)(a._3,{})}),children:(0,i.jsxs)(L.aV,{border:!1,style:{flexGrow:1},children:[(0,i.jsx)(X.Z,{zoneType:"customType",zoneTypeFormat:null!==(r=c.format)&&void 0!==r?r:"custom",tabId:s,title:"Static zone",dataTip:"",fields:p,poolOfFieldsToCheck:y,showHints:!0,EditModal:U.Z,widgetsArray:eM,onDeleteItem:e=>{d((0,u.AK)({customType:c,fieldId:e,sectionId:s}))},onSave:e=>""===e.apiId?f({...e,apiId:e.newKey}):j(e),onDragEnd:e=>{if((0,K.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let i=(0,u.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:s});(0,F.flushSync)(()=>d(i))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,H.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,H.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,i.jsx)(eV,{customType:m,tabId:s,sliceZone:h,onRemoveSharedSlice:e=>{d((0,u.EN)({customType:c,sectionId:s,sliceId:e}))},onCreateSliceZone:()=>{d((0,u.Tr)(c,s))},onDeleteSliceZone:()=>{d((0,u.E3)(c,s))}})]})})})};let eZ=()=>{var e,t,l;let{customType:n,setCustomType:r}=S(),s=k.Dc.toSM(n),[c,d]=(0,o.useState)(null===(e=s.tabs[0])||void 0===e?void 0:e.key),[m,h]=(0,o.useState)(),x=(null===(l=s.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.Rz,{sx:x?{flexGrow:1}:void 0,children:["page"===n.format?(0,i.jsx)(a.py,{title:n.repeatable?(0,i.jsx)(w,{}):void 0}):void 0,(0,i.jsxs)(a.KC,{onValueChange:d,value:c,children:[(0,i.jsx)(a.mY,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:s.tabs.map(e=>(0,i.jsx)(a.wf,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Xi,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(a.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(a.Xi,{color:"tomato",disabled:function(e){if(s.tabs.length<=1)return!0;let t=s.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===n.format&&n.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(a.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),s.tabs.map(e=>(0,i.jsx)(a.e$,{value:e.key,children:(0,i.jsx)(eE,{tabId:e.key})},e.key))]})]}),(null==m?void 0:m.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.vB)(n,t)),d(t)},tabIds:s.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(Z,{close:()=>{h(void 0)},initialTabKey:m.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;r((0,u.HO)(n,m.tabKey,t)),c===m.tabKey&&d(t)},tabIds:s.tabs.filter(e=>e.key!==m.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==m?void 0:m.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(E,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(r((0,u.F$)(n,m.tabKey)),c===m.tabKey){var e;let t=null===(e=s.tabs.find(e=>e.key!==m.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eF=l(1744),ez=l(40572),eL=l(64910),eP=l(9975),eO=l(41329),eK=l.n(eO);let eH=e=>{let{tabs:t,...l}=e;return(0,i.jsxs)(eP.fC,{...l,className:eK().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,i.jsx)(eP.aV,{className:eK().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,i.jsx)(eP.xz,{className:eK().trigger,value:l,children:(0,i.jsx)(a.xv,{className:eK().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:n}=e;return(0,i.jsx)(eP.VY,{className:eK().content,value:l,children:(0,i.jsx)(a.xr,{className:eK().scrollArea,children:n})},"".concat(l,"-content").concat(t+1))})]})};var eR=l(11290),eU=l(88241),eX=l(58133),eB=l(37628),eG=l.n(eB);let eY=e=>{var t,l;let{inline:n,...r}=e,s=(0,eX.p)();if(!0===n)return(0,i.jsx)("code",{...r,className:eG().inlineCode});let o=(()=>{var e,t,l,i,a;if((null===(t=r.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(i=r.node)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(a=r.className)||void 0===a?void 0:a.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=r.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,i.jsx)(a.dn,{...r,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:s})},language:c,code:String(r.children).replace(/\n$/,""),title:null==o?void 0:o.fileName})},e$=e=>{let{markdown:t}=e;return(0,i.jsx)(eR.D,{children:t,linkTarget:"_blank",remarkPlugins:[eU.Z],components:{code:e=>(0,i.jsx)(eY,{...e}),h1:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,i.jsx)(a.xv,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,i.jsx)(a.xv,{className:eG().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,i.jsx)(a.xv,{className:eG().section,children:e.children,component:"pre",variant:"normal"})}})};async function eq(e){let t=JSON.parse(e),{errors:l,documentation:i}=await Q.j.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return i}var eW=l(83321),eQ=l.n(eW);let eJ=e=>{var t;let{model:l}=e,n=(0,eX.p)(),r=(t={kind:"PageSnippet",data:{model:l}},(0,W.QT)(eq,[JSON.stringify(t)]));return 0===r.length?null:(0,i.jsxs)(a.Vq,{size:"small",trigger:(0,i.jsx)(a.zx,{color:"grey",onClick:()=>{v.Xe.track({event:"page-type:open-snippet",framework:n})},startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(a.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:eQ().content,children:r.length>1?(0,i.jsx)(eH,{style:{flex:1},tabs:r.map((e,t)=>{let{label:l,content:a}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,i.jsx)(e$,{markdown:a})}})}):(0,i.jsx)(a.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(e$,{markdown:r[0].content})})})]})},e0=e=>{let{model:t}=e;return(0,i.jsx)("div",{children:(0,i.jsx)(P.S,{children:(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)(a.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(eJ,{model:t})})})})},e1=()=>{let e=(0,s.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,ez.Jk)(t,(0,h.Ag)(e.query))}));return((0,o.useEffect)(()=>{t&&(0,eF.TG)(t)||e.replace("/")},[t,e]),t&&(0,eF.TG)(t))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,i.jsx)(e4,{customType:t.local})]}):(0,i.jsx)(x.LN,{})},e4=e=>{let{customType:t}=e;return null===t?(0,i.jsx)(x.LN,{}):(0,i.jsx)(x.LN,{children:(0,i.jsx)(C,{initialCustomType:k.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:n,customType:r,setCustomType:s}=e,o=(0,u.y6)(r),c=h.cd[t.format],p=b.$[t.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(x.wd,{children:[(0,i.jsx)(x.Xq,{url:c.tablePagePathname}),(0,i.jsxs)(x.Cx,{children:[(0,i.jsx)(d.g,{children:p.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(l=r.label)&&void 0!==l?l:r.id})]}),(0,i.jsxs)(x.K2,{children:[(0,i.jsx)(m.X,{status:n}),"page"===r.format?(0,i.jsx)(e0,{model:r}):void 0,(0,i.jsx)(eL._,{isChangesLocal:!0,format:o,customType:r,setLocalCustomType:s})]})]}),(0,i.jsx)(x.RN,{children:(0,i.jsx)(a.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eZ,{})})})]})}})})}},61502:function(e,t,l){"use strict";l.d(t,{E:function(){return a}});var i=l(29806);function a(e){var t,l;let[a,n]=(0,i.f)(),r=async t=>{let l={...a,labs:{...a.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await n(l)};return[{enabled:null!==(l=null==a?void 0:null===(t=a.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},r]}},29806:function(e,t,l){"use strict";l.d(t,{f:function(){return n}});var i=l(18566),a=l(70647);function n(){return[(0,i.QT)(r,[]),async e=>{await a.j.project.writeSliceMachineConfig({config:e}),(0,i.VA)(r,[],e)}]}async function r(){return a.j.project.getSliceMachineConfig()}},17889:function(e,t,l){"use strict";l.d(t,{c:function(){return f}});var i=l(52322),a=l(2784),n=l(36131),r=l(75289),s=l(93188),o=l(88932),c=l(3181),d=l(99510),u=l(70647);async function m(e){let{sliceName:t,libraryName:l,onSuccess:i}=e;try{let e=(0,c.fo)(t),{errors:a}=await u.j.slices.createSlice({libraryID:l,model:e});if(a.length>0)throw a;s.Xe.track({event:"slice:created",id:(0,d.MP)(t),name:t,library:l}),await i(e)}catch(l){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,l),o.Am.error(e)}}var h=l(80546),x=l(1490),p=l(41067),v=l(28801),y=l(99923);let f=e=>{let{onClose:t,onSuccess:l,localLibraries:o,remoteSlices:c}=e,{createSliceSuccess:d}=(0,p.Z)(),[u,f]=(0,a.useState)(!1),{syncChanges:j}=(0,h.g)(),b=async e=>{let t=e.sliceName,i=e.from;f(!0),await m({sliceName:t,libraryName:i,onSuccess:async e=>{d((await (0,s.y0)()).libraries),l(e,i),j()}})};return(0,i.jsx)(x.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:u,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{b(e)},initialValues:{sliceName:"",from:o[0].name},validate:e=>(0,y.h)(e,o,c,"create"),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:l,setFieldValue:a,errors:s}=e;return(0,i.jsxs)(r.xu,{children:[(0,i.jsx)(v.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?s.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(r.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(n.ZP,{name:"from",options:o.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void a("from",e.value):null,defaultValue:{value:l.from,label:l.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},99923:function(e,t,l){"use strict";l.d(t,{h:function(){return c}});var i=l(96009),a=l.n(i),n=l(74600),r=l.n(n),s=l(93188),o=l(17186);function c(e,t,l,i){let{sliceName:n}=e;return n?o.xo.exec(n)?r()(a()(n)).replace(/\s/gm,"")!==n.trim()?(s.Xe.track({event:"slice-name-error:pascal-case",errorType:i}),{sliceName:"Value has to be PascalCased"}):n.match(/^\d/)?{sliceName:"Value cannot start with a number"}:o.lS.includes(n)?{sliceName:"".concat(n," is reserved for Slice Machine use")}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...l.map(e=>e.name)].includes(n)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed"}:{sliceName:"Cannot be empty"}}},42849:function(e,t,l){"use strict";var i=l(52322),a=l(75289);t.Z=function(e){let{elems:t,renderElem:l,defineElementKey:n,gridTemplateMinPx:r="320px",gridGap:s="16px",sx:o}=e;return(0,i.jsx)(a.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(r,", 1fr))"),gridGap:s,pt:2,...o},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:l(e,t)},"".concat(n(e),"-").concat(t+1)):null)})}},41329:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},83321:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},37628:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},17766:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[349],{10727:function(t,e,r){"use strict";r.d(e,{Oq:function(){return f},dO:function(){return s},jn:function(){return o},iz:function(){return d},Dz:function(){return n},cv:function(){return l},oc:function(){return c}});var n=function(t){var e=t.top,r=t.right,n=t.bottom,o=t.left;return{top:e,right:r,bottom:n,left:o,width:r-o,height:n-e,x:o,y:e,center:{x:(r+o)/2,y:(n+e)/2}}},o=function(t,e){return{top:t.top-e.top,left:t.left-e.left,bottom:t.bottom+e.bottom,right:t.right+e.right}},i=function(t,e){return{top:t.top+e.top,left:t.left+e.left,bottom:t.bottom-e.bottom,right:t.right-e.right}},a={top:0,right:0,bottom:0,left:0},s=function(t){var e=t.borderBox,r=t.margin,s=void 0===r?a:r,u=t.border,l=void 0===u?a:u,c=t.padding,f=void 0===c?a:c,d=n(o(e,s)),p=n(i(e,l)),h=n(i(p,f));return{marginBox:d,borderBox:n(e),paddingBox:p,contentBox:h,margin:s,border:l,padding:f}},u=function(t){var e=t.slice(0,-2);if("px"!==t.slice(-2))return 0;var r=Number(e);return isNaN(r)&&function(t,e){if(!t)throw Error("Invariant failed")}(!1),r},l=function(t,e){var r=t.borderBox,n=t.border,o=t.margin,i=t.padding;return s({borderBox:{top:r.top+e.y,left:r.left+e.x,bottom:r.bottom+e.y,right:r.right+e.x},border:n,margin:o,padding:i})},c=function(t,e){return void 0===e&&(e={x:window.pageXOffset,y:window.pageYOffset}),l(t,e)},f=function(t,e){return s({borderBox:t,margin:{top:u(e.marginTop),right:u(e.marginRight),bottom:u(e.marginBottom),left:u(e.marginLeft)},padding:{top:u(e.paddingTop),right:u(e.paddingRight),bottom:u(e.paddingBottom),left:u(e.paddingLeft)},border:{top:u(e.borderTopWidth),right:u(e.borderRightWidth),bottom:u(e.borderBottomWidth),left:u(e.borderLeftWidth)}})},d=function(t){return f(t.getBoundingClientRect(),window.getComputedStyle(t))}},32726:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t,r){return null!=t&&e.call(t,r)}},93352:function(t,e,r){var n=r(32726),o=r(1369);t.exports=function(t,e){return null!=t&&o(t,e,n)}},19950:function(t,e,r){var n=r(13940),o=r(26548),i=r(68286);t.exports=function(t,e){var r={};return e=i(e,3),o(t,function(t,o,i){n(r,e(t,o,i),t)}),r}},57370:function(t,e,r){var n=r(34311)(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});t.exports=n},36631:function(t,e){"use strict";var r=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function n(t,e){if(t.length!==e.length)return!1;for(var n,o,i=0;i<t.length;i++)if(!((n=t[i])===(o=e[i])||r(n)&&r(o)))return!1;return!0}e.Z=function(t,e){void 0===e&&(e=n);var r,o,i=[],a=!1;return function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return a&&r===this&&e(n,i)||(o=t.apply(this,n),a=!0,r=this,i=n),o}}},17296:function(t){"use strict";function e(t){this._maxSize=t,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(t){return this._values[t]},e.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),!(t in this._values)&&this._size++,this._values[t]=e};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,o=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,s=new e(512),u=new e(512),l=new e(512);function c(t){return s.get(t)||s.set(t,f(t).map(function(t){return t.replace(a,"$2")}))}function f(t){return t.match(r)||[""]}function d(t){return"string"==typeof t&&t&&-1!==["'",'"'].indexOf(t.charAt(0))}t.exports={Cache:e,split:f,normalizePath:c,setter:function(t){var e=c(t);return u.get(t)||u.set(t,function(t,r){for(var n=0,o=e.length,i=t;n<o-1;){var a=e[n];if("__proto__"===a||"constructor"===a||"prototype"===a)return t;i=i[e[n++]]}i[e[n]]=r})},getter:function(t,e){var r=c(t);return l.get(t)||l.set(t,function(t){for(var n=0,o=r.length;n<o;){if(null==t&&e)return;t=t[r[n++]]}return t})},join:function(t){return t.reduce(function(t,e){return t+(d(e)||n.test(e)?"["+e+"]":(t?".":"")+e)},"")},forEach:function(t,e,r){!function(t,e,r){var a,s,u,l,c,f=t.length;for(u=0;u<f;u++){(s=t[u])&&(!d(a=s)&&(a.match(o)&&!a.match(n)||i.test(a))&&(s='"'+s+'"'),l=!(c=d(s))&&/^\d+$/.test(s),e.call(r,s,c,l,u,t))}}(Array.isArray(t)?t:f(t),e,r)}}},26947:function(t,e){"use strict";e.Z=function(t){var e=[],r=null,n=function(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];e=o,r||(r=requestAnimationFrame(function(){r=null,t.apply(void 0,e)}))};return n.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},n}},34543:function(t,e,r){"use strict";r.d(e,{LFN:function(){return i},SnF:function(){return s},eR7:function(){return a},xqv:function(){return o}});var n=r(68281);function o(t){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"}},{tag:"polyline",attr:{points:"8 6 2 12 8 18"}}]})(t)}function i(t){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}},{tag:"circle",attr:{cx:"8.5",cy:"8.5",r:"1.5"}},{tag:"polyline",attr:{points:"21 15 16 10 5 21"}}]})(t)}function a(t){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(t)}function s(t){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"8",y1:"6",x2:"21",y2:"6"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"21",y2:"12"}},{tag:"line",attr:{x1:"8",y1:"18",x2:"21",y2:"18"}},{tag:"line",attr:{x1:"3",y1:"6",x2:"3.01",y2:"6"}},{tag:"line",attr:{x1:"3",y1:"12",x2:"3.01",y2:"12"}},{tag:"line",attr:{x1:"3",y1:"18",x2:"3.01",y2:"18"}}]})(t)}},92928:function(t,e,r){"use strict";r.d(e,{OK:function(){return F},x4:function(){return C},mQ:function(){return g}});var n,o=r(2784);function i(t){return function(e){return!!e.type&&e.type.tabsRole===t}}var a=i("Tab"),s=i("TabList"),u=i("TabPanel");function l(t,e){return o.Children.map(t,function(t){return null===t?null:a(t)||s(t)||u(t)?e(t):t.props&&t.props.children&&"object"==typeof t.props.children?(0,o.cloneElement)(t,Object.assign({},t.props,{children:l(t.props.children,e)})):t})}var c=r(6277);function f(t){var e=0;return!function t(e,r){return o.Children.forEach(e,function(e){null!==e&&(a(e)||u(e)?r(e):e.props&&e.props.children&&"object"==typeof e.props.children&&(s(e)&&r(e),t(e.props.children,r)))})}(t,function(t){a(t)&&e++}),e}var d=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys","disableLeftRightKeys"];function p(t){return t&&"getAttribute"in t}function h(t){return p(t)&&t.getAttribute("data-rttab")}function m(t){return p(t)&&"true"===t.getAttribute("aria-disabled")}var v=function(t){var e=(0,o.useRef)([]),r=(0,o.useRef)([]),i=(0,o.useRef)();function p(e,r){e<0||e>=b()||(0,t.onSelect)(e,t.selectedIndex,r)}function v(t){for(var e=b(),r=t+1;r<e;r++)if(!m(g(r)))return r;for(var n=0;n<t;n++)if(!m(g(n)))return n;return t}function y(t){for(var e=t;e--;)if(!m(g(e)))return e;for(e=b();e-- >t;)if(!m(g(e)))return e;return t}function b(){return f(t.children)}function g(t){return e.current["tabs-"+t]}function w(t){var e=t.target;do if(E(e)){if(m(e))return;p([].slice.call(e.parentNode.children).filter(h).indexOf(e),t);return}while(null!=(e=e.parentNode))}function E(t){if(!h(t))return!1;var e=t.parentElement;do{if(e===i.current)return!0;if(e.getAttribute("data-rttabs"))break;e=e.parentElement}while(e);return!1}t.children;var x=t.className,T=(t.disabledTabClassName,t.domRef),_=(t.focus,t.forceRenderTabPanel,t.onSelect,t.selectedIndex,t.selectedTabClassName,t.selectedTabPanelClassName,t.environment,t.disableUpDownKeys,t.disableLeftRightKeys,function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,d));return o.createElement("div",Object.assign({},_,{className:(0,c.Z)(x),onClick:w,onKeyDown:function(e){var r=t.direction,n=t.disableUpDownKeys,o=t.disableLeftRightKeys;if(E(e.target)){var i=t.selectedIndex,a=!1,s=!1;("Space"===e.code||32===e.keyCode||"Enter"===e.code||13===e.keyCode)&&(a=!0,s=!1,w(e)),(o||37!==e.keyCode&&"ArrowLeft"!==e.code)&&(n||38!==e.keyCode&&"ArrowUp"!==e.code)?(o||39!==e.keyCode&&"ArrowRight"!==e.code)&&(n||40!==e.keyCode&&"ArrowDown"!==e.code)?35===e.keyCode||"End"===e.code?(i=function(){for(var t=b();t--;)if(!m(g(t)))return t;return null}(),a=!0,s=!0):(36===e.keyCode||"Home"===e.code)&&(i=function(){for(var t=b(),e=0;e<t;e++)if(!m(g(e)))return e;return null}(),a=!0,s=!0):(i="rtl"===r?y(i):v(i),a=!0,s=!0):(i="rtl"===r?v(i):y(i),a=!0,s=!0),a&&e.preventDefault(),s&&p(i,e)}},ref:function(t){i.current=t,T&&T(t)},"data-rttabs":!0}),function(){var i=0,c=t.children,f=t.disabledTabClassName,d=t.focus,p=t.forceRenderTabPanel,h=t.selectedIndex,m=t.selectedTabClassName,v=t.selectedTabPanelClassName,y=t.environment;r.current=r.current||[];for(var w=r.current.length-b(),E=(0,o.useId)();w++<0;)r.current.push(""+E+r.current.length);return l(c,function(t){var c=t;if(s(t)){var b=0,w=!1;null==n&&function(t){var e=t||("undefined"!=typeof window?window:void 0);try{n=!!(void 0!==e&&e.document&&e.document.activeElement)}catch(t){n=!1}}(y);var E=y||("undefined"!=typeof window?window:void 0);n&&E&&(w=o.Children.toArray(t.props.children).filter(a).some(function(t,e){return E.document.activeElement===g(e)})),c=(0,o.cloneElement)(t,{children:l(t.props.children,function(t){var n="tabs-"+b,i=h===b,a={tabRef:function(t){e.current[n]=t},id:r.current[b],selected:i,focus:i&&(d||w)};return m&&(a.selectedClassName=m),f&&(a.disabledClassName=f),b++,(0,o.cloneElement)(t,a)})})}else if(u(t)){var x={id:r.current[i],selected:h===i};p&&(x.forceRender=p),v&&(x.selectedClassName=v),i++,c=(0,o.cloneElement)(t,x)}return c})}())};v.defaultProps={className:"react-tabs",focus:!1},v.propTypes={};var y=function(t,e){},b=function(t){var e=t.children,r=t.defaultFocus,n=t.defaultIndex,i=t.focusTabOnClick,a=t.onSelect,s=(0,o.useState)(r),u=s[0],l=s[1],c=(0,o.useState)(null===t.selectedIndex?1:0)[0],d=(0,o.useState)(1===c?n||0:null),p=d[0],h=d[1];if((0,o.useEffect)(function(){l(!1)},[]),1===c){var m=f(e);(0,o.useEffect)(function(){null!=p&&h(Math.min(p,Math.max(0,m-1)))},[m])}y(t,c);var b=Object.assign({},t);return b.focus=u,b.onSelect=function(t,e,r){("function"!=typeof a||!1!==a(t,e,r))&&(i&&l(!0),1===c&&h(t))},null!=p&&(b.selectedIndex=p),delete b.defaultFocus,delete b.defaultIndex,delete b.focusTabOnClick,o.createElement(v,b,e)};b.propTypes={},b.defaultProps={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1,disableLeftRightKeys:!1},b.tabsRole="Tabs";var g=b,w=["children","className"],E=function(t){var e=t.children,r=t.className,n=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,w);return o.createElement("ul",Object.assign({},n,{className:(0,c.Z)(r),role:"tablist"}),e)};E.tabsRole="TabList",E.propTypes={},E.defaultProps={className:"react-tabs__tab-list"};var x=["children","className","disabled","disabledClassName","focus","id","selected","selectedClassName","tabIndex","tabRef"],T="react-tabs__tab",_=function(t){var e,r=(0,o.useRef)(),n=t.children,i=t.className,a=t.disabled,s=t.disabledClassName,u=t.focus,l=t.id,f=t.selected,d=t.selectedClassName,p=t.tabIndex,h=t.tabRef,m=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,x);return(0,o.useEffect)(function(){f&&u&&r.current.focus()},[f,u]),o.createElement("li",Object.assign({},m,{className:(0,c.Z)(i,((e={})[d]=f,e[s]=a,e)),ref:function(t){r.current=t,h&&h(t)},role:"tab",id:"tab"+l,"aria-selected":f?"true":"false","aria-disabled":a?"true":"false","aria-controls":"panel"+l,tabIndex:p||(f?"0":null),"data-rttab":!0}),n)};_.propTypes={},_.tabsRole="Tab",_.defaultProps={className:T,disabledClassName:T+"--disabled",focus:!1,id:null,selected:!1,selectedClassName:T+"--selected"};var F=_,O=["children","className","forceRender","id","selected","selectedClassName"],S="react-tabs__tab-panel",k=function(t){var e,r=t.children,n=t.className,i=t.forceRender,a=t.id,s=t.selected,u=t.selectedClassName,l=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,O);return o.createElement("div",Object.assign({},l,{className:(0,c.Z)(n,((e={})[u]=s,e)),role:"tabpanel",id:"panel"+a,"aria-labelledby":"tab"+a}),i||s?r:null)};k.tabsRole="TabPanel",k.propTypes={},k.defaultProps={className:S,forceRender:!1,selectedClassName:S+"--selected"};var C=k},33710:function(t,e,r){"use strict";r.d(e,{Z:function(){return r0}});for(var n,o,i,a,s,u,l,c=r(2784),f=r(13980),d=r.n(f),p="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),h=new Uint8Array(16),m=[],v=0;v<256;++v)m[v]=(v+256).toString(16).substr(1);var y=function(t,e){var r=e||0;return[m[t[r++]],m[t[r++]],m[t[r++]],m[t[r++]],"-",m[t[r++]],m[t[r++]],"-",m[t[r++]],m[t[r++]],"-",m[t[r++]],m[t[r++]],"-",m[t[r++]],m[t[r++]],m[t[r++]],m[t[r++]],m[t[r++]],m[t[r++]]].join("")},b=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||function(){if(!p)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(h)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||y(o)};function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach(function(e){x(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function E(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function x(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(){return(T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function F(t,e){return(F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},k=function(t){return t&&t.Math==Math&&t},C=k("object"==typeof globalThis&&globalThis)||k("object"==typeof window&&window)||k("object"==typeof self&&self)||k("object"==typeof S&&S)||function(){return this}()||Function("return this")(),A={},D=function(t){try{return!!t()}catch(t){return!0}},R=!D(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),j=!D(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}),N=Function.prototype.call,L=j?N.bind(N):function(){return N.apply(N,arguments)},I={},P={}.propertyIsEnumerable,$=Object.getOwnPropertyDescriptor,M=$&&!P.call({1:2},1);I.f=M?function(t){var e=$(this,t);return!!e&&e.enumerable}:P;var z=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},U=Function.prototype,B=U.call,V=j&&U.bind.bind(B,B),H=function(t){return j?V(t):function(){return B.apply(t,arguments)}},q=H({}.toString),W=H("".slice),K=function(t){return W(q(t),8,-1)},Y=function(t){if("Function"===K(t))return H(t)},X=Object,Z=Y("".split),J=D(function(){return!X("z").propertyIsEnumerable(0)})?function(t){return"String"==K(t)?Z(t,""):X(t)}:X,G=function(t){return null==t},Q=TypeError,tt=function(t){if(G(t))throw Q("Can't call method on "+t);return t},te=function(t){return J(tt(t))},tr="object"==typeof document&&document.all,tn={all:tr,IS_HTMLDDA:void 0===tr&&void 0!==tr},to=tn.all,ti=tn.IS_HTMLDDA?function(t){return"function"==typeof t||t===to}:function(t){return"function"==typeof t},ta=tn.all,ts=tn.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:ti(t)||t===ta}:function(t){return"object"==typeof t?null!==t:ti(t)},tu=function(t,e){var r;return arguments.length<2?ti(r=C[t])?r:void 0:C[t]&&C[t][e]},tl=Y({}.isPrototypeOf),tc=tu("navigator","userAgent")||"",tf=C.process,td=C.Deno,tp=tf&&tf.versions||td&&td.version,th=tp&&tp.v8;th&&(o=(n=th.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&tc&&(!(n=tc.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=tc.match(/Chrome\/(\d+)/))&&(o=+n[1]);var tm=o,tv=!!Object.getOwnPropertySymbols&&!D(function(){var t=Symbol();return!String(t)||!(Object(t) instanceof Symbol)||!Symbol.sham&&tm&&tm<41}),ty=tv&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tb=Object,tg=ty?function(t){return"symbol"==typeof t}:function(t){var e=tu("Symbol");return ti(e)&&tl(e.prototype,tb(t))},tw=String,tE=function(t){try{return tw(t)}catch(t){return"Object"}},tx=TypeError,tT=function(t){if(ti(t))return t;throw tx(tE(t)+" is not a function")},t_=TypeError,tF={exports:{}},tO=Object.defineProperty,tS=function(t,e){try{tO(C,t,{value:e,configurable:!0,writable:!0})}catch(r){C[t]=e}return e},tk="__core-js_shared__",tC=C[tk]||tS(tk,{});(tF.exports=function(t,e){return tC[t]||(tC[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.5",mode:"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"});var tA=Object,tD=function(t){return tA(tt(t))},tR=Y({}.hasOwnProperty),tj=Object.hasOwn||function(t,e){return tR(tD(t),e)},tN=0,tL=Math.random(),tI=Y(1..toString),tP=function(t){return"Symbol("+(void 0===t?"":t)+")_"+tI(++tN+tL,36)},t$=(0,tF.exports)("wks"),tM=C.Symbol,tz=tM&&tM.for,tU=ty?tM:tM&&tM.withoutSetter||tP,tB=function(t){if(!tj(t$,t)||!(tv||"string"==typeof t$[t])){var e="Symbol."+t;tv&&tj(tM,t)?t$[t]=tM[t]:ty&&tz?t$[t]=tz(e):t$[t]=tU(e)}return t$[t]},tV=function(t,e){var r=t[e];return G(r)?void 0:tT(r)},tH=function(t,e){var r,n;if("string"===e&&ti(r=t.toString)&&!ts(n=L(r,t))||ti(r=t.valueOf)&&!ts(n=L(r,t))||"string"!==e&&ti(r=t.toString)&&!ts(n=L(r,t)))return n;throw t_("Can't convert object to primitive value")},tq=TypeError,tW=tB("toPrimitive"),tK=function(t,e){if(!ts(t)||tg(t))return t;var r,n=tV(t,tW);if(n){if(void 0===e&&(e="default"),!ts(r=L(n,t,e))||tg(r))return r;throw tq("Can't convert object to primitive value")}return void 0===e&&(e="number"),tH(t,e)},tY=function(t){var e=tK(t,"string");return tg(e)?e:e+""},tX=C.document,tZ=ts(tX)&&ts(tX.createElement),tJ=function(t){return tZ?tX.createElement(t):{}},tG=!R&&!D(function(){return 7!=Object.defineProperty(tJ("div"),"a",{get:function(){return 7}}).a}),tQ=Object.getOwnPropertyDescriptor;A.f=R?tQ:function(t,e){if(t=te(t),e=tY(e),tG)try{return tQ(t,e)}catch(t){}if(tj(t,e))return z(!L(I.f,t,e),t[e])};var t0={},t1=R&&D(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),t2=String,t9=TypeError,t3=function(t){if(ts(t))return t;throw t9(t2(t)+" is not an object")},t5=TypeError,t7=Object.defineProperty,t6=Object.getOwnPropertyDescriptor,t4="enumerable",t8="configurable",et="writable";t0.f=R?t1?function(t,e,r){if(t3(t),e=tY(e),t3(r),"function"==typeof t&&"prototype"===e&&"value"in r&&et in r&&!r[et]){var n=t6(t,e);n&&n[et]&&(t[e]=r.value,r={configurable:t8 in r?r[t8]:n[t8],enumerable:t4 in r?r[t4]:n[t4],writable:!1})}return t7(t,e,r)}:t7:function(t,e,r){if(t3(t),e=tY(e),t3(r),tG)try{return t7(t,e,r)}catch(t){}if("get"in r||"set"in r)throw t5("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var ee=R?function(t,e,r){return t0.f(t,e,z(1,r))}:function(t,e,r){return t[e]=r,t},er={exports:{}},en=Function.prototype,eo=R&&Object.getOwnPropertyDescriptor,ei=tj(en,"name")&&(!R||R&&eo(en,"name").configurable),ea=Y(Function.toString);ti(tC.inspectSource)||(tC.inspectSource=function(t){return ea(t)});var es=tC.inspectSource,eu=C.WeakMap,el=ti(eu)&&/native code/.test(String(eu)),ec=(0,tF.exports)("keys"),ef=function(t){return ec[t]||(ec[t]=tP(t))},ed={},ep="Object already initialized",eh=C.TypeError,em=C.WeakMap;if(el||tC.state){var ev=tC.state||(tC.state=new em);ev.get=ev.get,ev.has=ev.has,ev.set=ev.set,i=function(t,e){if(ev.has(t))throw eh(ep);return e.facade=t,ev.set(t,e),e},a=function(t){return ev.get(t)||{}},s=function(t){return ev.has(t)}}else{var ey=ef("state");ed[ey]=!0,i=function(t,e){if(tj(t,ey))throw eh(ep);return e.facade=t,ee(t,ey,e),e},a=function(t){return tj(t,ey)?t[ey]:{}},s=function(t){return tj(t,ey)}}var eb=a,eg=Object.defineProperty,ew=R&&!D(function(){return 8!==eg(function(){},"length",{value:8}).length}),eE=String(String).split("String"),ex=er.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!tj(t,"name")||ei&&t.name!==e)&&(R?eg(t,"name",{value:e,configurable:!0}):t.name=e),ew&&r&&tj(r,"arity")&&t.length!==r.arity&&eg(t,"length",{value:r.arity});try{r&&tj(r,"constructor")&&r.constructor?R&&eg(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n,o=s(n=t)?a(n):i(n,{});return tj(o,"source")||(o.source=eE.join("string"==typeof e?e:"")),t};Function.prototype.toString=ex(function(){return ti(this)&&eb(this).source||es(this)},"toString");var eT=er.exports,e_={},eF=Math.ceil,eO=Math.floor,eS=Math.trunc||function(t){var e=+t;return(e>0?eO:eF)(e)},ek=function(t){var e=+t;return e!=e||0===e?0:eS(e)},eC=Math.max,eA=Math.min,eD=Math.min,eR=function(t){var e;return(e=t.length)>0?eD(ek(e),9007199254740991):0},ej=function(t,e){var r=ek(t);return r<0?eC(r+e,0):eA(r,e)},eN=function(t){return function(e,r,n){var o,i=te(e),a=eR(i),s=ej(n,a);if(t&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},eL={includes:eN(!0),indexOf:eN(!1)}.indexOf,eI=Y([].push),eP=function(t,e){var r,n=te(t),o=0,i=[];for(r in n)!tj(ed,r)&&tj(n,r)&&eI(i,r);for(;e.length>o;)tj(n,r=e[o++])&&(~eL(i,r)||eI(i,r));return i},e$=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],eM=e$.concat("length","prototype");e_.f=Object.getOwnPropertyNames||function(t){return eP(t,eM)};var ez={};ez.f=Object.getOwnPropertySymbols;var eU=Y([].concat),eB=tu("Reflect","ownKeys")||function(t){var e=e_.f(t3(t)),r=ez.f;return r?eU(e,r(t)):e},eV=/#|\.prototype\./,eH=function(t,e){var r=eW[eq(t)];return r==eY||r!=eK&&(ti(e)?D(e):!!e)},eq=eH.normalize=function(t){return String(t).replace(eV,".").toLowerCase()},eW=eH.data={},eK=eH.NATIVE="N",eY=eH.POLYFILL="P",eX=A.f,eZ=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(ti(r)&&eT(r,i,n),n.global)o?t[e]=r:tS(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:t0.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},eJ=function(t,e,r){for(var n=eB(e),o=t0.f,i=A.f,a=0;a<n.length;a++){var s=n[a];tj(t,s)||r&&tj(r,s)||o(t,s,i(e,s))}},eG=Y(Y.bind),eQ=Array.isArray||function(t){return"Array"==K(t)},e0=tB("toStringTag"),e1={};e1[e0]="z";var e2="[object z]"===String(e1),e9=tB("toStringTag"),e3=Object,e5="Arguments"==K(function(){return arguments}()),e7=function(t,e){try{return t[e]}catch(t){}},e6=e2?K:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=e7(e=e3(t),e9))?r:e5?K(e):"Object"==(n=K(e))&&ti(e.callee)?"Arguments":n},e4=function(){},e8=[],rt=tu("Reflect","construct"),re=/^\s*(?:class|function)\b/,rr=Y(re.exec),rn=!re.exec(e4),ro=function(t){if(!ti(t))return!1;try{return rt(e4,e8,t),!0}catch(t){return!1}},ri=function(t){if(!ti(t))return!1;switch(e6(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return rn||!!rr(re,es(t))}catch(t){return!0}};ri.sham=!0;var ra=!rt||D(function(){var t;return ro(ro.call)||!ro(Object)||!ro(function(){t=!0})||t})?ri:ro,rs=tB("species"),ru=Array,rl=function(t){var e;return eQ(t)&&(ra(e=t.constructor)&&(e===ru||eQ(e.prototype))?e=void 0:ts(e)&&null===(e=e[rs])&&(e=void 0)),void 0===e?ru:e},rc=function(t,e){return new(rl(t))(0===e?0:e)},rf=Y([].push),rd=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=7==t,s=5==t||i;return function(u,l,c,f){for(var d,p,h=tD(u),m=J(h),v=(tT(l),void 0===c?l:j?eG(l,c):function(){return l.apply(c,arguments)}),y=eR(m),b=0,g=f||rc,w=e?g(u,y):r||a?g(u,0):void 0;y>b;b++)if((s||b in m)&&(p=v(d=m[b],b,h),t)){if(e)w[b]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return b;case 2:rf(w,d)}else switch(t){case 4:return!1;case 7:rf(w,d)}}return i?-1:n||o?o:w}},rp={forEach:rd(0),map:rd(1),filter:rd(2),some:rd(3),every:rd(4),find:rd(5),findIndex:rd(6),filterReject:rd(7)},rh={},rm=Object.keys||function(t){return eP(t,e$)};rh.f=R&&!t1?Object.defineProperties:function(t,e){t3(t);for(var r,n=te(e),o=rm(e),i=o.length,a=0;i>a;)t0.f(t,r=o[a++],n[r]);return t};var rv=tu("document","documentElement"),ry="prototype",rb="script",rg=ef("IE_PROTO"),rw=function(){},rE=function(t){return"<"+rb+">"+t+"</"+rb+">"},rx=function(t){t.write(rE("")),t.close();var e=t.parentWindow.Object;return t=null,e},rT=function(){var t,e=tJ("iframe");return e.style.display="none",rv.appendChild(e),e.src=String("java"+rb+":"),(t=e.contentWindow.document).open(),t.write(rE("document.F=Object")),t.close(),t.F},r_=function(){try{u=new ActiveXObject("htmlfile")}catch(t){}r_="undefined"!=typeof document?document.domain&&u?rx(u):rT():rx(u);for(var t=e$.length;t--;)delete r_[ry][e$[t]];return r_()};ed[rg]=!0;var rF=Object.create||function(t,e){var r;return null!==t?(rw[ry]=t3(t),r=new rw,rw[ry]=null,r[rg]=t):r=r_(),void 0===e?r:rh.f(r,e)},rO=t0.f,rS=tB("unscopables"),rk=Array.prototype;void 0==rk[rS]&&rO(rk,rS,{configurable:!0,value:rF(null)});var rC=rp.find,rA="find",rD=!0;rA in[]&&[,][rA](function(){rD=!1}),function(t,e){var r,n,o,i,a,s=t.target,u=t.global,l=t.stat;if(r=u?C:l?C[s]||tS(s,{}):(C[s]||{}).prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=eX(r,n))&&a.value:r[n],!eH(u?n:s+(l?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;eJ(i,o)}(t.sham||o&&o.sham)&&ee(i,"sham",!0),eZ(r,n,i,t)}}({target:"Array",proto:!0,forced:rD},{find:function(t){return rC(this,t,arguments.length>1?arguments[1]:void 0)}}),rk[rS][rA]=!0;var rR="__react_tooltip_hide_event",rj="__react_tooltip_rebuild_event",rN="__react_tooltip_show_event",rL=function(t,e){var r;"function"==typeof window.CustomEvent?r=new window.CustomEvent(t,{detail:e}):(r=document.createEvent("Event")).initEvent(t,!1,!0,e),window.dispatchEvent(r)},rI=function(t,e){var r=this.state.show,n=this.props.id,o=this.isCapture(e.currentTarget),i=e.currentTarget.getAttribute("currentItem");o||e.stopPropagation(),r&&"true"===i?t||this.hideTooltip(e):(e.currentTarget.setAttribute("currentItem","true"),rP(e.currentTarget,this.getTargetArray(n)),this.showTooltip(e))},rP=function(t,e){for(var r=0;r<e.length;r++)t!==e[r]?e[r].setAttribute("currentItem","false"):e[r].setAttribute("currentItem","true")},r$={id:"9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf",set:function(t,e,r){this.id in t?t[this.id][e]=r:Object.defineProperty(t,this.id,{configurable:!0,value:x({},e,r)})},get:function(t,e){var r=t[this.id];if(void 0!==r)return r[e]}},rM=function(t){var e={};for(var r in t)"function"==typeof t[r]?e[r]=t[r].bind(t):e[r]=t[r];return e},rz=function(t,e,r){for(var n,o,i=e.respectEffect,a=e.customEvent,s=this.props.id,u=null,l=r.target;null===u&&null!==l;)o=l,u=l.getAttribute("data-tip")||null,n=l.getAttribute("data-for")||null,l=l.parentElement;if(l=o||r.target,!this.isCustomEvent(l)||void 0!==a&&a){var c=null==s&&null==n||n===s;if(null!=u&&(!(void 0!==i&&i)||"float"===this.getEffect(l))&&c){var f=rM(r);f.currentTarget=l,t(f)}}},rU=function(t,e){var r={};return t.forEach(function(t){var n=t.getAttribute(e);n&&n.split(" ").forEach(function(t){return r[t]=!0})}),r},rB=function(){return document.getElementsByTagName("body")[0]};function rV(t,e,r,n,o,i,a){var s,u=rH(r),l=u.width,c=u.height,f=rH(e),d=f.width,p=f.height,h=rq(t,e,i),m=h.mouseX,v=h.mouseY,y=rW(i,d,p,l,c),b=rK(a),g=b.extraOffsetX,w=b.extraOffsetY,E=window.innerWidth,x=window.innerHeight,T=rY(r),_=T.parentTop,F=T.parentLeft,S=function(t){return m+y[t].l+g},k=function(t){return v+y[t].t+w},C=function(t){var e;return!(0>S(e=t)||m+y[e].r+g>E||0>k(e)||v+y[e].b+w>x)},A={top:C("top"),bottom:C("bottom"),left:C("left"),right:C("right")},D=function(){var t,e=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return O(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(t,void 0)}}(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(o.split(",").concat(n,["top","bottom","left","right"]));try{for(e.s();!(t=e.n()).done;){var r=t.value;if(A[r])return r}}catch(t){e.e(t)}finally{e.f()}return n}(),R=!1;return(D&&D!==n&&(R=!0,s=D),R)?{isNewState:!0,newState:{place:s}}:{isNewState:!1,position:{left:parseInt(S(n)-F,10),top:parseInt(k(n)-_,10)}}}var rH=function(t){var e=t.getBoundingClientRect(),r=e.height,n=e.width;return{height:parseInt(r,10),width:parseInt(n,10)}},rq=function(t,e,r){var n=e.getBoundingClientRect(),o=n.top,i=n.left,a=rH(e),s=a.width,u=a.height;return"float"===r?{mouseX:t.clientX,mouseY:t.clientY}:{mouseX:i+s/2,mouseY:o+u/2}},rW=function(t,e,r,n,o){var i,a,s,u;return"float"===t?(i={l:-(n/2),r:n/2,t:-(o+3+2),b:-3},s={l:-(n/2),r:n/2,t:15,b:o+3+2+12},u={l:-(n+3+2),r:-3,t:-(o/2),b:o/2},a={l:3,r:n+3+2,t:-(o/2),b:o/2}):"solid"===t&&(i={l:-(n/2),r:n/2,t:-(r/2+o+2),b:-(r/2)},s={l:-(n/2),r:n/2,t:r/2,b:r/2+o+2},u={l:-(n+e/2+2),r:-(e/2),t:-(o/2),b:o/2},a={l:e/2,r:n+e/2+2,t:-(o/2),b:o/2}),{top:i,bottom:s,left:u,right:a}},rK=function(t){var e=0,r=0;for(var n in"[object String]"===Object.prototype.toString.apply(t)&&(t=JSON.parse(t.toString().replace(/'/g,'"'))),t)"top"===n?r-=parseInt(t[n],10):"bottom"===n?r+=parseInt(t[n],10):"left"===n?e-=parseInt(t[n],10):"right"===n&&(e+=parseInt(t[n],10));return{extraOffsetX:e,extraOffsetY:r}},rY=function(t){for(var e=t;e;){var r=window.getComputedStyle(e);if("none"!==r.getPropertyValue("transform")||"transform"===r.getPropertyValue("will-change"))break;e=e.parentElement}return{parentTop:e&&e.getBoundingClientRect().top||0,parentLeft:e&&e.getBoundingClientRect().left||0}};function rX(t,e,r,n){if(e)return e;if(null!=r)return r;if(null===r)return null;var o=/<br\s*\/?>/;return n&&"false"!==n&&o.test(t)?t.split(o).map(function(t,e){return c.createElement("span",{key:e,className:"multi-line"},t)}):t}function rZ(t){var e={};return Object.keys(t).filter(function(t){return/(^aria-\w+$|^role$)/.test(t)}).forEach(function(r){e[r]=t[r]}),e}function rJ(t){var e=t.length;return t.hasOwnProperty?Array.prototype.slice.call(t):Array(e).fill().map(function(e){return t[e]})}var rG={dark:{text:"#fff",background:"#222",border:"transparent",arrow:"#222"},success:{text:"#fff",background:"#8DC572",border:"transparent",arrow:"#8DC572"},warning:{text:"#fff",background:"#F0AD4E",border:"transparent",arrow:"#F0AD4E"},error:{text:"#fff",background:"#BE6464",border:"transparent",arrow:"#BE6464"},info:{text:"#fff",background:"#337AB7",border:"transparent",arrow:"#337AB7"},light:{text:"#222",background:"#fff",border:"transparent",arrow:"#fff"}},rQ={tooltip:3,arrow:0},r0=((((((((x(l=function(t){(function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&F(t,e)})(i,t);var e,r,n,o=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,r=_(i);return t=e?Reflect.construct(r,arguments,_(this).constructor):r.apply(this,arguments),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t){var e;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).state={uuid:t.uuid||"t"+b(),place:t.place||"top",desiredPlace:t.place||"top",type:t.type||"dark",effect:t.effect||"float",show:!1,border:!1,borderClass:"border",customColors:{},customRadius:{},offset:{},padding:t.padding,extraClass:"",html:!1,delayHide:0,delayShow:0,event:t.event||null,eventOff:t.eventOff||null,currentEvent:null,currentTarget:null,ariaProps:rZ(t),isEmptyTip:!1,disable:!1,possibleCustomEvents:t.possibleCustomEvents||"",possibleCustomEventsOff:t.possibleCustomEventsOff||"",originTooltip:null,isMultiline:!1},e.bind(["showTooltip","updateTooltip","hideTooltip","hideTooltipOnScroll","getTooltipContent","globalRebuild","globalShow","globalHide","onWindowResize","mouseOnToolTip"]),e.mount=!0,e.delayShowLoop=null,e.delayHideLoop=null,e.delayReshow=null,e.intervalUpdateContent=null,e}return r=[{key:"bind",value:function(t){var e=this;t.forEach(function(t){e[t]=e[t].bind(e)})}},{key:"componentDidMount",value:function(){var t=this.props;t.insecure;var e=t.resizeHide,r=t.disableInternalStyle;this.mount=!0,this.bindListener(),this.bindWindowEvents(e),r||this.injectStyles()}},{key:"componentWillUnmount",value:function(){this.mount=!1,this.clearTimer(),this.unbindListener(),this.removeScrollListener(this.state.currentTarget),this.unbindWindowEvents()}},{key:"injectStyles",value:function(){var t,e=this.tooltipRef;if(e){for(var r=e.parentNode;r.parentNode;)r=r.parentNode;switch(r.constructor.name){case"Document":case"HTMLDocument":case void 0:t=r.head;break;default:t=r}if(!t.querySelector("style[data-react-tooltip]")){var n=document.createElement("style");n.textContent='.__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: "";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n bottom: 0;\n left: 50%;\n margin-left: -11px;\n}\n.__react_component_tooltip.place-bottom::before {\n top: 0;\n left: 50%;\n margin-left: -11px;\n}\n.__react_component_tooltip.place-left::before {\n right: 0;\n top: 50%;\n margin-top: -9px;\n}\n.__react_component_tooltip.place-right::before {\n left: 0;\n top: 50%;\n margin-top: -9px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}',n.setAttribute("data-react-tooltip","true"),t.appendChild(n)}}}},{key:"mouseOnToolTip",value:function(){return!!this.state.show&&!!this.tooltipRef&&(this.tooltipRef.matches||(this.tooltipRef.msMatchesSelector?this.tooltipRef.matches=this.tooltipRef.msMatchesSelector:this.tooltipRef.matches=this.tooltipRef.mozMatchesSelector),this.tooltipRef.matches(":hover"))}},{key:"getTargetArray",value:function(t){var e,r=[];if(t){var n=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');e='[data-tip][data-for="'.concat(n,'"]')}else e="[data-tip]:not([data-for])";return rJ(document.getElementsByTagName("*")).filter(function(t){return t.shadowRoot}).forEach(function(t){r=r.concat(rJ(t.shadowRoot.querySelectorAll(e)))}),r.concat(rJ(document.querySelectorAll(e)))}},{key:"bindListener",value:function(){var t=this,e=this.props,r=e.id,n=e.globalEventOff,o=e.isCapture,i=this.getTargetArray(r);i.forEach(function(e){null===e.getAttribute("currentItem")&&e.setAttribute("currentItem","false"),t.unbindBasicListener(e),t.isCustomEvent(e)&&t.customUnbindListener(e)}),this.isBodyMode()?this.bindBodyListener(i):i.forEach(function(e){var r=t.isCapture(e),n=t.getEffect(e);if(t.isCustomEvent(e)){t.customBindListener(e);return}e.addEventListener("mouseenter",t.showTooltip,r),e.addEventListener("focus",t.showTooltip,r),"float"===n&&e.addEventListener("mousemove",t.updateTooltip,r),e.addEventListener("mouseleave",t.hideTooltip,r),e.addEventListener("blur",t.hideTooltip,r)}),n&&(window.removeEventListener(n,this.hideTooltip),window.addEventListener(n,this.hideTooltip,o)),this.bindRemovalTracker()}},{key:"unbindListener",value:function(){var t=this,e=this.props,r=e.id,n=e.globalEventOff;this.isBodyMode()?this.unbindBodyListener():this.getTargetArray(r).forEach(function(e){t.unbindBasicListener(e),t.isCustomEvent(e)&&t.customUnbindListener(e)}),n&&window.removeEventListener(n,this.hideTooltip),this.unbindRemovalTracker()}},{key:"unbindBasicListener",value:function(t){var e=this.isCapture(t);t.removeEventListener("mouseenter",this.showTooltip,e),t.removeEventListener("mousemove",this.updateTooltip,e),t.removeEventListener("mouseleave",this.hideTooltip,e)}},{key:"getTooltipContent",value:function(){var t,e=this.props,r=e.getContent,n=e.children;return r&&(t=Array.isArray(r)?r[0]&&r[0](this.state.originTooltip):r(this.state.originTooltip)),rX(this.state.originTooltip,n,t,this.state.isMultiline)}},{key:"isEmptyTip",value:function(t){return"string"==typeof t&&""===t||null===t}},{key:"showTooltip",value:function(t,e){if(this.tooltipRef&&(!e||this.getTargetArray(this.props.id).some(function(e){return e===t.currentTarget}))){var r=this.props,n=r.multiline,o=r.getContent,i=t.currentTarget.getAttribute("data-tip"),a=t.currentTarget.getAttribute("data-multiline")||n||!1,s=t instanceof window.FocusEvent||e,u=!0;t.currentTarget.getAttribute("data-scroll-hide")?u="true"===t.currentTarget.getAttribute("data-scroll-hide"):null!=this.props.scrollHide&&(u=this.props.scrollHide),t&&t.currentTarget&&t.currentTarget.setAttribute&&t.currentTarget.setAttribute("aria-describedby",this.props.id||this.state.uuid);var l=t.currentTarget.getAttribute("data-place")||this.props.place||"top",c=s&&"solid"||this.getEffect(t.currentTarget),f=t.currentTarget.getAttribute("data-offset")||this.props.offset||{},d=rV(t,t.currentTarget,this.tooltipRef,l.split(",")[0],l,c,f);d.position&&this.props.overridePosition&&(d.position=this.props.overridePosition(d.position,t,t.currentTarget,this.tooltipRef,l,l,c,f));var p=d.isNewState?d.newState.place:l.split(",")[0];this.clearTimer();var h=t.currentTarget,m=this.state.show?h.getAttribute("data-delay-update")||this.props.delayUpdate:0,v=this,y=function(){v.setState({originTooltip:i,isMultiline:a,desiredPlace:l,place:p,type:h.getAttribute("data-type")||v.props.type||"dark",customColors:{text:h.getAttribute("data-text-color")||v.props.textColor||null,background:h.getAttribute("data-background-color")||v.props.backgroundColor||null,border:h.getAttribute("data-border-color")||v.props.borderColor||null,arrow:h.getAttribute("data-arrow-color")||v.props.arrowColor||null},customRadius:{tooltip:h.getAttribute("data-tooltip-radius")||v.props.tooltipRadius||"3",arrow:h.getAttribute("data-arrow-radius")||v.props.arrowRadius||"0"},effect:c,offset:f,padding:h.getAttribute("data-padding")||v.props.padding,html:(h.getAttribute("data-html")?"true"===h.getAttribute("data-html"):v.props.html)||!1,delayShow:h.getAttribute("data-delay-show")||v.props.delayShow||0,delayHide:h.getAttribute("data-delay-hide")||v.props.delayHide||0,delayUpdate:h.getAttribute("data-delay-update")||v.props.delayUpdate||0,border:(h.getAttribute("data-border")?"true"===h.getAttribute("data-border"):v.props.border)||!1,borderClass:h.getAttribute("data-border-class")||v.props.borderClass||"border",extraClass:h.getAttribute("data-class")||v.props.class||v.props.className||"",disable:(h.getAttribute("data-tip-disable")?"true"===h.getAttribute("data-tip-disable"):v.props.disable)||!1,currentTarget:h},function(){u&&v.addScrollListener(v.state.currentTarget),v.updateTooltip(t),o&&Array.isArray(o)&&(v.intervalUpdateContent=setInterval(function(){if(v.mount){var t=rX(i,"",v.props.getContent[0](),a),e=v.isEmptyTip(t);v.setState({isEmptyTip:e}),v.updatePosition()}},o[1]))})};m?this.delayReshow=setTimeout(y,m):y()}}},{key:"updateTooltip",value:function(t){var e=this,r=this.state,n=r.delayShow,o=r.disable,i=this.props,a=i.afterShow,s=i.disable,u=this.getTooltipContent(),l=t.currentTarget||t.target;if(!(this.mouseOnToolTip()||this.isEmptyTip(u)||o||s)){var c=this.state.show?0:parseInt(n,10),f=function(){if(Array.isArray(u)&&u.length>0||u){var r=!e.state.show;e.setState({currentEvent:t,currentTarget:l,show:!0},function(){e.updatePosition(function(){r&&a&&a(t)})})}};this.delayShowLoop&&clearTimeout(this.delayShowLoop),c?this.delayShowLoop=setTimeout(f,c):(this.delayShowLoop=null,f())}}},{key:"listenForTooltipExit",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.addEventListener("mouseleave",this.hideTooltip)}},{key:"removeListenerForTooltipExit",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.removeEventListener("mouseleave",this.hideTooltip)}},{key:"hideTooltip",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isScroll:!1},o=this.state.disable,i=n.isScroll?0:this.state.delayHide,a=this.props,s=a.afterHide,u=a.disable,l=this.getTooltipContent();if(this.mount&&!this.isEmptyTip(l)&&!o&&!u){if(e&&(!this.getTargetArray(this.props.id).some(function(e){return e===t.currentTarget})||!this.state.show))return;t&&t.currentTarget&&t.currentTarget.removeAttribute&&t.currentTarget.removeAttribute("aria-describedby");var c=function(){var e=r.state.show;if(r.mouseOnToolTip()){r.listenForTooltipExit();return}r.removeListenerForTooltipExit(),r.setState({show:!1},function(){r.removeScrollListener(r.state.currentTarget),e&&s&&s(t)})};this.clearTimer(),i?this.delayHideLoop=setTimeout(c,parseInt(i,10)):c()}}},{key:"hideTooltipOnScroll",value:function(t,e){this.hideTooltip(t,e,{isScroll:!0})}},{key:"addScrollListener",value:function(t){var e=this.isCapture(t);window.addEventListener("scroll",this.hideTooltipOnScroll,e)}},{key:"removeScrollListener",value:function(t){var e=this.isCapture(t);window.removeEventListener("scroll",this.hideTooltipOnScroll,e)}},{key:"updatePosition",value:function(t){var e=this,r=this.state,n=r.currentEvent,o=r.currentTarget,i=r.place,a=r.desiredPlace,s=r.effect,u=r.offset,l=this.tooltipRef,c=rV(n,o,l,i,a,s,u);if(c.position&&this.props.overridePosition&&(c.position=this.props.overridePosition(c.position,n,o,l,i,a,s,u)),c.isNewState)return this.setState(c.newState,function(){e.updatePosition(t)});t&&"function"==typeof t&&t(),l.style.left=c.position.left+"px",l.style.top=c.position.top+"px"}},{key:"clearTimer",value:function(){this.delayShowLoop&&(clearTimeout(this.delayShowLoop),this.delayShowLoop=null),this.delayHideLoop&&(clearTimeout(this.delayHideLoop),this.delayHideLoop=null),this.delayReshow&&(clearTimeout(this.delayReshow),this.delayReshow=null),this.intervalUpdateContent&&(clearInterval(this.intervalUpdateContent),this.intervalUpdateContent=null)}},{key:"hasCustomColors",value:function(){var t=this;return!!(Object.keys(this.state.customColors).find(function(e){return"border"!==e&&t.state.customColors[e]})||this.state.border&&this.state.customColors.border)}},{key:"render",value:function(){var t,e,r,n,o,a,s,u,l,f,d,p,h,m,v=this,y=this.state,b=y.extraClass,g=y.html,E=y.ariaProps,x=y.disable,_=y.uuid,F=this.getTooltipContent(),O=this.isEmptyTip(F),S=this.props.disableInternalStyle?"":(l=this.state.uuid,f=this.state.customColors,d=this.state.type,p=this.state.border,h=this.state.padding,m=this.state.customRadius,function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"8px 21px",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rQ,o=e.text,i=e.background,a=e.border,s=e.arrow,u=n.arrow,l=n.tooltip;return"\n .".concat(t," {\n color: ").concat(o,";\n background: ").concat(i,";\n border: 1px solid ").concat(a,";\n border-radius: ").concat(l,"px;\n padding: ").concat(r,";\n }\n\n .").concat(t,".place-top {\n margin-top: -10px;\n }\n .").concat(t,'.place-top::before {\n content: "";\n background-color: inherit;\n position: absolute;\n z-index: 2;\n width: 20px;\n height: 12px;\n }\n .').concat(t,'.place-top::after {\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ').concat(u,"px;\n border: 1px solid ").concat(a,";\n background-color: ").concat(s,";\n z-index: -2;\n bottom: -6px;\n left: 50%;\n margin-left: -6px;\n transform: rotate(135deg);\n }\n\n .").concat(t,".place-bottom {\n margin-top: 10px;\n }\n .").concat(t,'.place-bottom::before {\n content: "";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 18px;\n height: 10px;\n }\n .').concat(t,'.place-bottom::after {\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ').concat(u,"px;\n border: 1px solid ").concat(a,";\n background-color: ").concat(s,";\n z-index: -2;\n top: -6px;\n left: 50%;\n margin-left: -6px;\n transform: rotate(45deg);\n }\n\n .").concat(t,".place-left {\n margin-left: -10px;\n }\n .").concat(t,'.place-left::before {\n content: "";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 10px;\n height: 18px;\n }\n .').concat(t,'.place-left::after {\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ').concat(u,"px;\n border: 1px solid ").concat(a,";\n background-color: ").concat(s,";\n z-index: -2;\n right: -6px;\n top: 50%;\n margin-top: -6px;\n transform: rotate(45deg);\n }\n\n .").concat(t,".place-right {\n margin-left: 10px;\n }\n .").concat(t,'.place-right::before {\n content: "";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 10px;\n height: 18px;\n }\n .').concat(t,'.place-right::after {\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ').concat(u,"px;\n border: 1px solid ").concat(a,";\n background-color: ").concat(s,";\n z-index: -2;\n left: -6px;\n top: 50%;\n margin-top: -6px;\n transform: rotate(-135deg);\n }\n ")}(l,(t=f,e=d,r=p,n=t.text,o=t.background,a=t.border,s=t.arrow?t.arrow:t.background,u=rG[e]?w({},rG[e]):void 0,n&&(u.text=n),o&&(u.background=o),r&&(a?u.border=a:u.border="light"===e?"black":"white"),s&&(u.arrow=s),u),h,m)),k="__react_component_tooltip"+" ".concat(this.state.uuid)+(!this.state.show||x||O?"":" show")+(this.state.border?" "+this.state.borderClass:"")+" place-".concat(this.state.place)+" type-".concat(this.hasCustomColors()?"custom":this.state.type)+(this.props.delayUpdate?" allow_hover":"")+(this.props.clickable?" allow_click":""),C=this.props.wrapper;0>i.supportedWrappers.indexOf(C)&&(C=i.defaultProps.wrapper);var A=[k,b].filter(Boolean).join(" ");if(!g)return c.createElement(C,T({className:"".concat(A),id:this.props.id||_},E,{ref:function(t){return v.tooltipRef=t},"data-id":"tooltip"}),S&&c.createElement("style",{dangerouslySetInnerHTML:{__html:S},"aria-hidden":"true"}),F);var D="".concat(F).concat(S?'\n<style aria-hidden="true">'.concat(S,"</style>"):"");return c.createElement(C,T({className:"".concat(A),id:this.props.id||_,ref:function(t){return v.tooltipRef=t}},E,{"data-id":"tooltip",dangerouslySetInnerHTML:{__html:D}}))}}],n=[{key:"propTypes",get:function(){return{uuid:d().string,children:d().any,place:d().string,type:d().string,effect:d().string,offset:d().object,padding:d().string,multiline:d().bool,border:d().bool,borderClass:d().string,textColor:d().string,backgroundColor:d().string,borderColor:d().string,arrowColor:d().string,arrowRadius:d().string,tooltipRadius:d().string,insecure:d().bool,class:d().string,className:d().string,id:d().string,html:d().bool,delayHide:d().number,delayUpdate:d().number,delayShow:d().number,event:d().string,eventOff:d().string,isCapture:d().bool,globalEventOff:d().string,getContent:d().any,afterShow:d().func,afterHide:d().func,overridePosition:d().func,disable:d().bool,scrollHide:d().bool,resizeHide:d().bool,wrapper:d().string,bodyMode:d().bool,possibleCustomEvents:d().string,possibleCustomEventsOff:d().string,clickable:d().bool,disableInternalStyle:d().bool}}},{key:"getDerivedStateFromProps",value:function(t,e){var r=e.ariaProps,n=rZ(t);return Object.keys(n).some(function(t){return n[t]!==r[t]})?w(w({},e),{},{ariaProps:n}):null}}],r&&E(i.prototype,r),n&&E(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(c.Component),"defaultProps",{insecure:!0,resizeHide:!0,wrapper:"div",clickable:!1}),x(l,"supportedWrappers",["div","span"]),x(l,"displayName","ReactTooltip"),l).prototype.bindRemovalTracker=function(){var t=this,e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(null!=e){var r=new e(function(e){for(var r=0;r<e.length;r++)for(var n=e[r],o=0;o<n.removedNodes.length;o++)if(n.removedNodes[o]===t.state.currentTarget){t.hideTooltip();return}});r.observe(window.document,{childList:!0,subtree:!0}),this.removalTracker=r}},l.prototype.unbindRemovalTracker=function(){this.removalTracker&&(this.removalTracker.disconnect(),this.removalTracker=null)},l).prototype.isBodyMode=function(){return!!this.props.bodyMode},l.prototype.bindBodyListener=function(t){var e=this,r=this.state,n=r.event,o=r.eventOff,i=r.possibleCustomEvents,a=r.possibleCustomEventsOff,s=rB(),u=rU(t,"data-event"),l=rU(t,"data-event-off");null!=n&&(u[n]=!0),null!=o&&(l[o]=!0),i.split(" ").forEach(function(t){return u[t]=!0}),a.split(" ").forEach(function(t){return l[t]=!0}),this.unbindBodyListener(s);var c=this.bodyModeListeners={};for(var f in null==n&&(c.mouseover=rz.bind(this,this.showTooltip,{}),c.mousemove=rz.bind(this,this.updateTooltip,{respectEffect:!0}),c.mouseout=rz.bind(this,this.hideTooltip,{})),u)c[f]=rz.bind(this,function(t){var r=t.currentTarget.getAttribute("data-event-off")||o;rI.call(e,r,t)},{customEvent:!0});for(var d in l)c[d]=rz.bind(this,this.hideTooltip,{customEvent:!0});for(var p in c)s.addEventListener(p,c[p])},l.prototype.unbindBodyListener=function(t){t=t||rB();var e=this.bodyModeListeners;for(var r in e)t.removeEventListener(r,e[r])},l).prototype.getEffect=function(t){return t.getAttribute("data-effect")||this.props.effect||"float"},l).prototype.isCapture=function(t){return t&&"true"===t.getAttribute("data-iscapture")||this.props.isCapture||!1},l).prototype.isCustomEvent=function(t){return this.state.event||!!t.getAttribute("data-event")},l.prototype.customBindListener=function(t){var e=this,r=this.state,n=r.event,o=r.eventOff,i=t.getAttribute("data-event")||n,a=t.getAttribute("data-event-off")||o;i.split(" ").forEach(function(r){t.removeEventListener(r,r$.get(t,r));var n=rI.bind(e,a);r$.set(t,r,n),t.addEventListener(r,n,!1)}),a&&a.split(" ").forEach(function(r){t.removeEventListener(r,e.hideTooltip),t.addEventListener(r,e.hideTooltip,!1)})},l.prototype.customUnbindListener=function(t){var e=this.state,r=e.event,n=e.eventOff,o=r||t.getAttribute("data-event"),i=n||t.getAttribute("data-event-off");t.removeEventListener(o,r$.get(t,r)),i&&t.removeEventListener(i,this.hideTooltip)},l).prototype.bindWindowEvents=function(t){window.removeEventListener(rR,this.globalHide),window.addEventListener(rR,this.globalHide,!1),window.removeEventListener(rj,this.globalRebuild),window.addEventListener(rj,this.globalRebuild,!1),window.removeEventListener(rN,this.globalShow),window.addEventListener(rN,this.globalShow,!1),t&&(window.removeEventListener("resize",this.onWindowResize),window.addEventListener("resize",this.onWindowResize,!1))},l.prototype.unbindWindowEvents=function(){window.removeEventListener(rR,this.globalHide),window.removeEventListener(rj,this.globalRebuild),window.removeEventListener(rN,this.globalShow),window.removeEventListener("resize",this.onWindowResize)},l.prototype.onWindowResize=function(){this.mount&&this.hideTooltip()},l).hide=function(t){rL(rR,{target:t})},l.rebuild=function(){rL(rj)},l.show=function(t){rL(rN,{target:t})},l.prototype.globalRebuild=function(){this.mount&&(this.unbindListener(),this.bindListener())},l.prototype.globalShow=function(t){if(this.mount){var e=t&&t.detail&&t.detail.target&&!0||!1;this.showTooltip({currentTarget:e&&t.detail.target},!0)}},l.prototype.globalHide=function(t){if(this.mount){var e=t&&t.detail&&t.detail.target&&!0||!1;this.hideTooltip({currentTarget:e&&t.detail.target},e)}},l)},95159:function(t){function e(t,e){var r=t.length,n=Array(r),o={},i=r,a=function(t){for(var e=new Map,r=0,n=t.length;r<n;r++){var o=t[r];e.has(o[0])||e.set(o[0],new Set),e.has(o[1])||e.set(o[1],new Set),e.get(o[0]).add(o[1])}return e}(e),s=function(t){for(var e=new Map,r=0,n=t.length;r<n;r++)e.set(t[r],r);return e}(t);for(e.forEach(function(t){if(!s.has(t[0])||!s.has(t[1]))throw Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)o[i]||function t(e,i,u){if(u.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch(t){l=""}throw Error("Cyclic dependency"+l)}if(!s.has(e))throw Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[i]){o[i]=!0;var c=a.get(e)||new Set;if(i=(c=Array.from(c)).length){u.add(e);do{var f=c[--i];t(f,s.get(f),u)}while(i);u.delete(e)}n[--r]=e}}(t[i],i,new Set);return n}t.exports=function(t){return e(function(t){for(var e=new Set,r=0,n=t.length;r<n;r++){var o=t[r];e.add(o[0]),e.add(o[1])}return Array.from(e)}(t),t)},t.exports.array=e},31118:function(t,e,r){"use strict";r.d(e,{I4:function(){return a},Ye:function(){return i}});var n=r(2784);function o(t,e){var r=(0,n.useState)(function(){return{inputs:e,result:t()}})[0],o=(0,n.useRef)(!0),i=(0,n.useRef)(r),a=o.current||e&&i.current.inputs&&function(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}(e,i.current.inputs)?i.current:{inputs:e,result:t()};return(0,n.useEffect)(function(){o.current=!1,i.current=a},[a]),a.result}var i=o,a=function(t,e){return o(function(){return t},e)}},65413:function(t,e,r){"use strict";r.r(e),r.d(e,{ArraySchema:function(){return tk},BaseSchema:function(){return H},BooleanSchema:function(){return X},DateSchema:function(){return tc},MixedSchema:function(){return q},NumberSchema:function(){return ti},ObjectSchema:function(){return t_},StringSchema:function(){return tr},ValidationError:function(){return k},addMethod:function(){return tR},array:function(){return tS},bool:function(){return Y},boolean:function(){return Y},date:function(){return tl},isSchema:function(){return T},lazy:function(){return tC},mixed:function(){return W},number:function(){return to},object:function(){return tF},reach:function(){return U},ref:function(){return L},setLocale:function(){return tD},string:function(){return te}});try{b=Map}catch(t){}try{g=Set}catch(t){}function n(t){return function t(e,r,o){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n);if(b&&e instanceof b)return new Map(Array.from(e.entries()));if(g&&e instanceof g)return new Set(Array.from(e.values()));if(e instanceof Object){r.push(e);var i=Object.create(e);for(var a in o.push(i),e){var s=r.findIndex(function(t){return t===e[a]});i[a]=s>-1?o[s]:t(e[a],r,o)}return i}return e}(t,[],[])}let o=Object.prototype.toString,i=Error.prototype.toString,a=RegExp.prototype.toString,s="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",u=/^Symbol\((.*)\)(.*)$/;function l(t,e=!1){if(null==t||!0===t||!1===t)return""+t;let r=typeof t;if("number"===r)return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t;if("string"===r)return e?`"${t}"`:t;if("function"===r)return"[Function "+(t.name||"anonymous")+"]";if("symbol"===r)return s.call(t).replace(u,"Symbol($1)");let n=o.call(t).slice(8,-1);return"Date"===n?isNaN(t.getTime())?""+t:t.toISOString(t):"Error"===n||t instanceof Error?"["+i.call(t)+"]":"RegExp"===n?a.call(t):null}function c(t,e){let r=l(t,e);return null!==r?r:JSON.stringify(t,function(t,r){let n=l(this[t],e);return null!==n?n:r},2)}let f={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{let o=null!=n&&n!==r,i=`${t} must be a \`${e}\` type, but the final value was: \`${c(r,!0)}\``+(o?` (cast from the value \`${c(n,!0)}\`).`:".");return null===r&&(i+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),i},defined:"${path} must be defined"},d={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},p={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},h={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},m={isValue:"${path} field must be ${value}"},v={noUnknown:"${path} field has unspecified keys: ${unknown}"},y={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};var b,g,w=Object.assign(Object.create(null),{mixed:f,string:d,number:p,date:h,object:v,array:y,boolean:m}),E=r(93352),x=r.n(E),T=t=>t&&t.__isYupSchema__;class _{constructor(t,e){if(this.fn=void 0,this.refs=t,this.refs=t,"function"==typeof e){this.fn=e;return}if(!x()(e,"is"))throw TypeError("`is:` is required for `when()` conditions");if(!e.then&&!e.otherwise)throw TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:o}=e,i="function"==typeof r?r:(...t)=>t.every(t=>t===r);this.fn=function(...t){let e=t.pop(),r=t.pop(),a=i(...t)?n:o;if(a)return"function"==typeof a?a(r):r.concat(a.resolve(e))}}resolve(t,e){let r=this.refs.map(t=>t.getValue(null==e?void 0:e.value,null==e?void 0:e.parent,null==e?void 0:e.context)),n=this.fn.apply(t,r.concat(t,e));if(void 0===n||n===t)return t;if(!T(n))throw TypeError("conditions must return a schema object");return n.resolve(e)}}function F(t){return null==t?[]:[].concat(t)}function O(){return(O=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}let S=/\$\{\s*(\w+)\s*\}/g;class k extends Error{static formatError(t,e){let r=e.label||e.path||"this";return(r!==e.path&&(e=O({},e,{path:r})),"string"==typeof t)?t.replace(S,(t,r)=>c(e[r])):"function"==typeof t?t(e):t}static isError(t){return t&&"ValidationError"===t.name}constructor(t,e,r,n){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=e,this.path=r,this.type=n,this.errors=[],this.inner=[],F(t).forEach(t=>{k.isError(t)?(this.errors.push(...t.errors),this.inner=this.inner.concat(t.inner.length?t.inner:t)):this.errors.push(t)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,k)}}let C=t=>{let e=!1;return(...r)=>{e||(e=!0,t(...r))}};function A(t,e){let{endEarly:r,tests:n,args:o,value:i,errors:a,sort:s,path:u}=t,l=C(e),c=n.length,f=[];if(a=a||[],!c)return a.length?l(new k(a,i,u)):l(null,i);for(let t=0;t<n.length;t++)(0,n[t])(o,function(t){if(t){if(!k.isError(t))return l(t,i);if(r)return t.value=i,l(t,i);f.push(t)}if(--c<=0){if(f.length&&(s&&f.sort(s),a.length&&f.push(...a),a=f),a.length){l(new k(a,i,u),i);return}l(null,i)}})}var D=r(34519),R=r.n(D),j=r(17296);let N={context:"$",value:"."};function L(t,e){return new I(t,e)}class I{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof t)throw TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),""===t)throw TypeError("ref must be a non-empty string");this.isContext=this.key[0]===N.context,this.isValue=this.key[0]===N.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?N.context:this.isValue?N.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&(0,j.getter)(this.path,!0),this.map=e.map}getValue(t,e,r){let n=this.isContext?r:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,null==e?void 0:e.parent,null==e?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}function P(){return(P=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function $(t){function e(e,r){let n,{value:o,path:i="",label:a,options:s,originalValue:u,sync:l}=e,c=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e.indexOf(r=i[n])>=0||(o[r]=t[r]);return o}(e,["value","path","label","options","originalValue","sync"]),{name:f,test:d,params:p,message:h}=t,{parent:m,context:v}=s;function y(t){return I.isRef(t)?t.getValue(o,m,v):t}function b(t={}){let e=R()(P({value:o,originalValue:u,label:a,path:t.path||i},p,t.params),y),r=new k(k.formatError(t.message||h,e),o,e.path,t.type||f);return r.params=e,r}let g=P({path:i,parent:m,type:f,createError:b,resolve:y,options:s,originalValue:u},c);if(!l){try{Promise.resolve(d.call(g,o,g)).then(t=>{k.isError(t)?r(t):t?r(null,t):r(b())}).catch(r)}catch(t){r(t)}return}try{var w;if(n=d.call(g,o,g),"function"==typeof(null==(w=n)?void 0:w.then))throw Error(`Validation test of type: "${g.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(t){r(t);return}k.isError(n)?r(n):n?r(null,n):r(b())}return e.OPTIONS=t,e}I.prototype.__isYupRef=!0;let M=t=>t.substr(0,t.length-1).substr(1);function z(t,e,r,n=r){let o,i,a;return e?((0,j.forEach)(e,(s,u,l)=>{let c=u?M(s):s;if((t=t.resolve({context:n,parent:o,value:r})).innerType){let n=l?parseInt(c,10):0;if(r&&n>=r.length)throw Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${e}. because there is no value at that index. `);o=r,r=r&&r[n],t=t.innerType}if(!l){if(!t.fields||!t.fields[c])throw Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${t._type}")`);o=r,r=r&&r[c],t=t.fields[c]}i=c,a=u?"["+s+"]":"."+s}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}var U=(t,e,r,n)=>z(t,e,r,n).schema;class B{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let t=[];for(let e of this.list)t.push(e);for(let[,e]of this.refs)t.push(e.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(t){return this.toArray().reduce((e,r)=>e.concat(I.isRef(r)?t(r):r),[])}add(t){I.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){I.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}clone(){let t=new B;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,e){let r=this.clone();return t.list.forEach(t=>r.add(t)),t.refs.forEach(t=>r.add(t)),e.list.forEach(t=>r.delete(t)),e.refs.forEach(t=>r.delete(t)),r}}function V(){return(V=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}class H{constructor(t){this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this._typeError=void 0,this._whitelist=new B,this._blacklist=new B,this.exclusiveTests=Object.create(null),this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(f.notType)}),this.type=(null==t?void 0:t.type)||"mixed",this.spec=V({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==t?void 0:t.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;let e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeError=this._typeError,e._whitelistError=this._whitelistError,e._blacklistError=this._blacklistError,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.exclusiveTests=V({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=n(V({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(0===t.length)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=e,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&"mixed"!==this.type)throw TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=t.clone(),r=V({},this.spec,e.spec);return e.spec=r,e._typeError||(e._typeError=this._typeError),e._whitelistError||(e._whitelistError=this._whitelistError),e._blacklistError||(e._blacklistError=this._blacklistError),e._whitelist=this._whitelist.merge(t._whitelist,t._blacklist),e._blacklist=this._blacklist.merge(t._blacklist,t._whitelist),e.tests=this.tests,e.exclusiveTests=this.exclusiveTests,e.withMutation(e=>{t.tests.forEach(t=>{e.test(t.OPTIONS)})}),e.transforms=[...this.transforms,...e.transforms],e}isType(t){return!!this.spec.nullable&&null===t||this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let r=e.conditions;(e=e.clone()).conditions=[],e=(e=r.reduce((e,r)=>r.resolve(e,t),e)).resolve(t)}return e}cast(t,e={}){let r=this.resolve(V({value:t},e)),n=r._cast(t,e);if(void 0!==t&&!1!==e.assert&&!0!==r.isType(n)){let o=c(t),i=c(n);throw TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
|
|
2
|
+
|
|
3
|
+
attempted value: ${o}
|
|
4
|
+
`+(i!==o?`result of cast: ${i}`:""))}return n}_cast(t,e){let r=void 0===t?t:this.transforms.reduce((e,r)=>r.call(this,e,t,this),t);return void 0===r&&(r=this.getDefault()),r}_validate(t,e={},r){let{sync:n,path:o,from:i=[],originalValue:a=t,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=e,l=t;s||(l=this._cast(l,V({assert:!1},e)));let c={value:l,path:o,options:e,originalValue:a,schema:this,label:this.spec.label,sync:n,from:i},f=[];this._typeError&&f.push(this._typeError);let d=[];this._whitelistError&&d.push(this._whitelistError),this._blacklistError&&d.push(this._blacklistError),A({args:c,value:l,path:o,sync:n,tests:f,endEarly:u},t=>{if(t)return void r(t,l);A({tests:this.tests.concat(d),args:c,path:o,sync:n,value:l,endEarly:u},r)})}validate(t,e,r){let n=this.resolve(V({},e,{value:t}));return"function"==typeof r?n._validate(t,e,r):new Promise((r,o)=>n._validate(t,e,(t,e)=>{t?o(t):r(e)}))}validateSync(t,e){let r;return this.resolve(V({},e,{value:t}))._validate(t,V({},e,{sync:!0}),(t,e)=>{if(t)throw t;r=e}),r}isValid(t,e){return this.validate(t,e).then(()=>!0,t=>{if(k.isError(t))return!1;throw t})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(t){if(k.isError(t))return!1;throw t}}_getDefault(){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this):n(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return 0==arguments.length?this._getDefault():this.clone({default:t})}strict(t=!0){let e=this.clone();return e.spec.strict=t,e}_isPresent(t){return null!=t}defined(t=f.defined){return this.test({message:t,name:"defined",exclusive:!0,test:t=>void 0!==t})}required(t=f.required){return this.clone({presence:"required"}).withMutation(e=>e.test({message:t,name:"required",exclusive:!0,test(t){return this.schema._isPresent(t)}}))}notRequired(){let t=this.clone({presence:"optional"});return t.tests=t.tests.filter(t=>"required"!==t.OPTIONS.name),t}nullable(t=!0){return this.clone({nullable:!1!==t})}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(void 0===(e=1===t.length?"function"==typeof t[0]?{test:t[0]}:t[0]:2===t.length?{name:t[0],test:t[1]}:{name:t[0],message:t[1],test:t[2]}).message&&(e.message=f.default),"function"!=typeof e.test)throw TypeError("`test` is a required parameters");let r=this.clone(),n=$(e),o=e.exclusive||e.name&&!0===r.exclusiveTests[e.name];if(e.exclusive&&!e.name)throw TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(r.exclusiveTests[e.name]=!!e.exclusive),r.tests=r.tests.filter(t=>t.OPTIONS.name!==e.name||!o&&t.OPTIONS.test!==n.OPTIONS.test),r.tests.push(n),r}when(t,e){Array.isArray(t)||"string"==typeof t||(e=t,t=".");let r=this.clone(),n=F(t).map(t=>new I(t));return n.forEach(t=>{t.isSibling&&r.deps.push(t.key)}),r.conditions.push(new _(n,e)),r}typeError(t){let e=this.clone();return e._typeError=$({message:t,name:"typeError",test(t){return!!(void 0===t||this.schema.isType(t))||this.createError({params:{type:this.schema._type}})}}),e}oneOf(t,e=f.oneOf){let r=this.clone();return t.forEach(t=>{r._whitelist.add(t),r._blacklist.delete(t)}),r._whitelistError=$({message:e,name:"oneOf",test(t){if(void 0===t)return!0;let e=this.schema._whitelist,r=e.resolveAll(this.resolve);return!!r.includes(t)||this.createError({params:{values:e.toArray().join(", "),resolved:r}})}}),r}notOneOf(t,e=f.notOneOf){let r=this.clone();return t.forEach(t=>{r._blacklist.add(t),r._whitelist.delete(t)}),r._blacklistError=$({message:e,name:"notOneOf",test(t){let e=this.schema._blacklist,r=e.resolveAll(this.resolve);return!r.includes(t)||this.createError({params:{values:e.toArray().join(", "),resolved:r}})}}),r}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(){let t=this.clone(),{label:e,meta:r}=t.spec;return{meta:r,label:e,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(t=>({name:t.OPTIONS.name,params:t.OPTIONS.params})).filter((t,e,r)=>r.findIndex(e=>e.name===t.name)===e)}}}for(let t of(H.prototype.__isYupSchema__=!0,["validate","validateSync"]))H.prototype[`${t}At`]=function(e,r,n={}){let{parent:o,parentPath:i,schema:a}=z(this,e,r,n.context);return a[t](o&&o[i],V({},n,{parent:o,path:e}))};for(let t of["equals","is"])H.prototype[t]=H.prototype.oneOf;for(let t of["not","nope"])H.prototype[t]=H.prototype.notOneOf;H.prototype.optional=H.prototype.notRequired;var q=H;function W(){return new H}W.prototype=H.prototype;var K=t=>null==t;function Y(){return new X}class X extends H{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(t){if(!this.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}_typeCheck(t){return t instanceof Boolean&&(t=t.valueOf()),"boolean"==typeof t}isTrue(t=m.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test:t=>K(t)||!0===t})}isFalse(t=m.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test:t=>K(t)||!1===t})}}Y.prototype=X.prototype;let Z=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,J=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,G=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Q=t=>K(t)||t===t.trim(),tt=({}).toString();function te(){return new tr}class tr extends H{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;let e=null!=t&&t.toString?t.toString():t;return e===tt?t:e})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),"string"==typeof t}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,e=d.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},test(e){return K(e)||e.length===this.resolve(t)}})}min(t,e=d.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test(e){return K(e)||e.length>=this.resolve(t)}})}max(t,e=d.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},test(e){return K(e)||e.length<=this.resolve(t)}})}matches(t,e){let r,n,o=!1;return e&&("object"==typeof e?{excludeEmptyString:o=!1,message:r,name:n}=e:r=e),this.test({name:n||"matches",message:r||d.matches,params:{regex:t},test:e=>K(e)||""===e&&o||-1!==e.search(t)})}email(t=d.email){return this.matches(Z,{name:"email",message:t,excludeEmptyString:!0})}url(t=d.url){return this.matches(J,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=d.uuid){return this.matches(G,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>null===t?"":t)}trim(t=d.trim){return this.transform(t=>null!=t?t.trim():t).test({message:t,name:"trim",test:Q})}lowercase(t=d.lowercase){return this.transform(t=>K(t)?t:t.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:t=>K(t)||t===t.toLowerCase()})}uppercase(t=d.uppercase){return this.transform(t=>K(t)?t:t.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:t=>K(t)||t===t.toUpperCase()})}}te.prototype=tr.prototype;let tn=t=>t!=+t;function to(){return new ti}class ti extends H{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(t){let e=t;if("string"==typeof e){if(""===(e=e.replace(/\s/g,"")))return NaN;e=+e}return this.isType(e)?e:parseFloat(e)})})}_typeCheck(t){return t instanceof Number&&(t=t.valueOf()),"number"==typeof t&&!tn(t)}min(t,e=p.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test(e){return K(e)||e>=this.resolve(t)}})}max(t,e=p.max){return this.test({message:e,name:"max",exclusive:!0,params:{max:t},test(e){return K(e)||e<=this.resolve(t)}})}lessThan(t,e=p.lessThan){return this.test({message:e,name:"max",exclusive:!0,params:{less:t},test(e){return K(e)||e<this.resolve(t)}})}moreThan(t,e=p.moreThan){return this.test({message:e,name:"min",exclusive:!0,params:{more:t},test(e){return K(e)||e>this.resolve(t)}})}positive(t=p.positive){return this.moreThan(0,t)}negative(t=p.negative){return this.lessThan(0,t)}integer(t=p.integer){return this.test({name:"integer",message:t,test:t=>K(t)||Number.isInteger(t)})}truncate(){return this.transform(t=>K(t)?t:0|t)}round(t){var e;let r=["ceil","floor","round","trunc"];if("trunc"===(t=(null==(e=t)?void 0:e.toLowerCase())||"round"))return this.truncate();if(-1===r.indexOf(t.toLowerCase()))throw TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(e=>K(e)?e:Math[t](e))}}to.prototype=ti.prototype;var ta=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let ts=new Date(""),tu=t=>"[object Date]"===Object.prototype.toString.call(t);function tl(){return new tc}class tc extends H{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:isNaN(t=function(t){var e,r,n=[1,4,5,6,7,10,11],o=0;if(r=ta.exec(t)){for(var i,a=0;i=n[a];++a)r[i]=+r[i]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,r[7]=r[7]?String(r[7]).substr(0,3):0,(void 0===r[8]||""===r[8])&&(void 0===r[9]||""===r[9])?e=+new Date(r[1],r[2],r[3],r[4],r[5],r[6],r[7]):("Z"!==r[8]&&void 0!==r[9]&&(o=60*r[10]+r[11],"+"===r[9]&&(o=0-o)),e=Date.UTC(r[1],r[2],r[3],r[4],r[5]+o,r[6],r[7]))}else e=Date.parse?Date.parse(t):NaN;return e}(t))?ts:new Date(t)})})}_typeCheck(t){return tu(t)&&!isNaN(t.getTime())}prepareParam(t,e){let r;if(I.isRef(t))r=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(t,e=h.min){let r=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test(t){return K(t)||t>=this.resolve(r)}})}max(t,e=h.max){let r=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},test(t){return K(t)||t<=this.resolve(r)}})}}tc.INVALID_DATE=ts,tl.prototype=tc.prototype,tl.INVALID_DATE=ts;var tf=r(57370),td=r.n(tf),tp=r(96009),th=r.n(tp),tm=r(19950),tv=r.n(tm),ty=r(95159),tb=r.n(ty);function tg(t,e){let r=1/0;return t.some((t,n)=>{var o;if((null==(o=e.path)?void 0:o.indexOf(t))!==-1)return r=n,!0}),r}function tw(t){return(e,r)=>tg(t,e)-tg(t,r)}function tE(){return(tE=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}let tx=t=>"[object Object]"===Object.prototype.toString.call(t),tT=tw([]);class t_ extends H{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=tT,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t=null}return this.isType(t)?t:null}),t&&this.shape(t)})}_typeCheck(t){return tx(t)||"function"==typeof t}_cast(t,e={}){var r;let n=super._cast(t,e);if(void 0===n)return this.getDefault();if(!this._typeCheck(n))return n;let o=this.fields,i=null!=(r=e.stripUnknown)?r:this.spec.noUnknown,a=this._nodes.concat(Object.keys(n).filter(t=>-1===this._nodes.indexOf(t))),s={},u=tE({},e,{parent:s,__validating:e.__validating||!1}),l=!1;for(let t of a){let r=o[t],a=x()(n,t);if(r){let o;let i=n[t];u.path=(e.path?`${e.path}.`:"")+t;let a="spec"in(r=r.resolve({value:i,context:e.context,parent:s}))?r.spec:void 0,c=null==a?void 0:a.strict;if(null==a?void 0:a.strip){l=l||t in n;continue}void 0!==(o=e.__validating&&c?n[t]:r.cast(n[t],u))&&(s[t]=o)}else a&&!i&&(s[t]=n[t]);s[t]!==n[t]&&(l=!0)}return l?s:n}_validate(t,e={},r){let n=[],{sync:o,from:i=[],originalValue:a=t,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=e;i=[{schema:this,value:a},...i],e.__validating=!0,e.originalValue=a,e.from=i,super._validate(t,e,(t,l)=>{if(t){if(!k.isError(t)||s)return void r(t,l);n.push(t)}if(!u||!tx(l)){r(n[0]||null,l);return}a=a||l,A({sync:o,tests:this._nodes.map(t=>(r,n)=>{let o=-1===t.indexOf(".")?(e.path?`${e.path}.`:"")+t:`${e.path||""}["${t}"]`,s=this.fields[t];if(s&&"validate"in s){s.validate(l[t],tE({},e,{path:o,from:i,strict:!0,parent:l,originalValue:a[t]}),n);return}n(null)}),value:l,errors:n,endEarly:s,sort:this._sortErrors,path:e.path},r)})}clone(t){let e=super.clone(t);return e.fields=tE({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),r=e.fields;for(let[t,e]of Object.entries(this.fields)){let n=r[t];void 0===n?r[t]=e:n instanceof H&&e instanceof H&&(r[t]=e.concat(n))}return e.withMutation(()=>e.shape(r,this._excludedEdges))}getDefaultFromShape(){let t={};return this._nodes.forEach(e=>{let r=this.fields[e];t[e]="default"in r?r.getDefault():void 0}),t}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(t,e=[]){let r=this.clone(),n=Object.assign(r.fields,t);return r.fields=n,r._sortErrors=tw(Object.keys(n)),e.length&&(Array.isArray(e[0])||(e=[e]),r._excludedEdges=[...r._excludedEdges,...e]),r._nodes=function(t,e=[]){let r=[],n=new Set,o=new Set(e.map(([t,e])=>`${t}-${e}`));function i(t,e){let i=(0,j.split)(t)[0];n.add(i),o.has(`${e}-${i}`)||r.push([e,i])}for(let e in t)if(x()(t,e)){let r=t[e];n.add(e),I.isRef(r)&&r.isSibling?i(r.path,e):T(r)&&"deps"in r&&r.deps.forEach(t=>i(t,e))}return tb().array(Array.from(n),r).reverse()}(n,r._excludedEdges),r}pick(t){let e={};for(let r of t)this.fields[r]&&(e[r]=this.fields[r]);return this.clone().withMutation(t=>(t.fields={},t.shape(e)))}omit(t){let e=this.clone(),r=e.fields;for(let n of(e.fields={},t))delete r[n];return e.withMutation(()=>e.shape(r))}from(t,e,r){let n=(0,j.getter)(t,!0);return this.transform(o=>{if(null==o)return o;let i=o;return x()(o,t)&&(i=tE({},o),r||delete i[t],i[e]=n(o)),i})}noUnknown(t=!0,e=v.noUnknown){"string"==typeof t&&(e=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:e,test(e){let r;if(null==e)return!0;let n=(r=Object.keys(this.schema.fields),Object.keys(e).filter(t=>-1===r.indexOf(t)));return!t||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,e=v.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>e&&tv()(e,(e,r)=>t(r)))}camelCase(){return this.transformKeys(th())}snakeCase(){return this.transformKeys(td())}constantCase(){return this.transformKeys(t=>td()(t).toUpperCase())}describe(){let t=super.describe();return t.fields=R()(this.fields,t=>t.describe()),t}}function tF(t){return new t_(t)}function tO(){return(tO=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function tS(t){return new tk(t)}tF.prototype=t_.prototype;class tk extends H{constructor(t){super({type:"array"}),this.innerType=void 0,this.innerType=t,this.withMutation(()=>{this.transform(function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t=null}return this.isType(t)?t:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,e){let r=super._cast(t,e);if(!this._typeCheck(r)||!this.innerType)return r;let n=!1,o=r.map((t,r)=>{let o=this.innerType.cast(t,tO({},e,{path:`${e.path||""}[${r}]`}));return o!==t&&(n=!0),o});return n?o:r}_validate(t,e={},r){var n,o;let i=[],a=e.sync,s=e.path,u=this.innerType,l=null!=(n=e.abortEarly)?n:this.spec.abortEarly,c=null!=(o=e.recursive)?o:this.spec.recursive,f=null!=e.originalValue?e.originalValue:t;super._validate(t,e,(t,n)=>{if(t){if(!k.isError(t)||l)return void r(t,n);i.push(t)}if(!c||!u||!this._typeCheck(n)){r(i[0]||null,n);return}f=f||n;let o=Array(n.length);for(let t=0;t<n.length;t++){let r=n[t],i=`${e.path||""}[${t}]`,a=tO({},e,{path:i,strict:!0,parent:n,index:t,originalValue:f[t]});o[t]=(t,e)=>u.validate(r,a,e)}A({sync:a,path:s,value:n,errors:i,endEarly:l,tests:o},r)})}clone(t){let e=super.clone(t);return e.innerType=this.innerType,e}concat(t){let e=super.concat(t);return e.innerType=this.innerType,t.innerType&&(e.innerType=e.innerType?e.innerType.concat(t.innerType):t.innerType),e}of(t){let e=this.clone();if(!T(t))throw TypeError("`array.of()` sub-schema must be a valid yup schema not: "+c(t));return e.innerType=t,e}length(t,e=y.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},test(e){return K(e)||e.length===this.resolve(t)}})}min(t,e){return e=e||y.min,this.test({message:e,name:"min",exclusive:!0,params:{min:t},test(e){return K(e)||e.length>=this.resolve(t)}})}max(t,e){return e=e||y.max,this.test({message:e,name:"max",exclusive:!0,params:{max:t},test(e){return K(e)||e.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,e)=>this._typeCheck(t)?t:null==e?[]:[].concat(e))}compact(t){let e=t?(e,r,n)=>!t(e,r,n):t=>!!t;return this.transform(t=>null!=t?t.filter(e):t)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}function tC(t){return new tA(t)}tS.prototype=tk.prototype;class tA{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.__inputType=void 0,this.__outputType=void 0,this._resolve=(t,e={})=>{let r=this.builder(t,e);if(!T(r))throw TypeError("lazy() functions must return a valid schema");return r.resolve(e)},this.builder=t}resolve(t){return this._resolve(t.value,t)}cast(t,e){return this._resolve(t,e).cast(t,e)}validate(t,e,r){return this._resolve(t,e).validate(t,e,r)}validateSync(t,e){return this._resolve(t,e).validateSync(t,e)}validateAt(t,e,r){return this._resolve(e,r).validateAt(t,e,r)}validateSyncAt(t,e,r){return this._resolve(e,r).validateSyncAt(t,e,r)}describe(){return null}isValid(t,e){return this._resolve(t,e).isValid(t,e)}isValidSync(t,e){return this._resolve(t,e).isValidSync(t,e)}}function tD(t){Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(r=>{w[e][r]=t[e][r]})})}function tR(t,e,r){if(!t||!T(t.prototype))throw TypeError("You must provide a yup schema constructor function");if("string"!=typeof e)throw TypeError("A Method name must be provided");if("function"!=typeof r)throw TypeError("Method function must be provided");t.prototype[e]=r}},5446:function(t,e,r){"use strict";r.d(e,{v2:function(){return tw},j2:function(){return tE},sN:function(){return tT},qy:function(){return tF}});var n,o=r(2784),i=r.t(o,2);/**
|
|
5
|
+
* @reach/utils v0.18.0
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2018-2022, React Training LLC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
11
|
+
*
|
|
12
|
+
* @license MIT
|
|
13
|
+
*/function a(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}function s(t,e){return r=>{if(t&&t(r),!r.defaultPrevented)return e(r)}}function u(t){return"boolean"==typeof t}function l(t){return!!(t&&"[object Function]"==({}).toString.call(t))}function c(...t){return(0,o.useCallback)(e=>{for(let r of t)!function(t,e){if(null!=t){if(l(t))t(e);else try{t.current=e}catch(r){throw Error(`Cannot assign value "${e}" to ref "${t}"`)}}}(r,e)},t)}function f(t){return a()?t?t.ownerDocument:document:null}function d(t){return"which"in t?3===t.which:"button"in t&&2===t.button}function p(...t){return t.filter(t=>null!=t).join("--")}function h(){}function m(){let[,t]=(0,o.useState)(Object.create(null));return(0,o.useCallback)(()=>{t(Object.create(null))},[])}var v=a()?o.useLayoutEffect:o.useEffect;function y(t){let e=(0,o.useRef)(null);return(0,o.useEffect)(()=>{e.current=t},[t]),e.current}var b=r(28316),g=({children:t,type:e="reach-portal",containerRef:r})=>{let n=o.useRef(null),i=o.useRef(null),a=m();return o.useEffect(()=>{null!=r&&("object"==typeof r&&"current"in r?null==r.current&&console.warn("@reach/portal: A ref was passed to the `containerRef` prop of a `Portal`, but no DOM node was attached to it. Be sure to pass the ref to a DOM component.\n\nIf you are forwarding the ref from another component, be sure to use the React.forwardRef API. See https://reactjs.org/docs/forwarding-refs.html."):console.warn("@reach/portal: Invalid value passed to the `containerRef` of a `Portal`. The portal will be appended to the document body, but if you want to attach it to another DOM node you must pass a valid React ref object to `containerRef`."))},[r]),v(()=>{if(!n.current)return;let t=n.current.ownerDocument,o=r?.current||t.body;return i.current=t?.createElement(e),o.appendChild(i.current),a(),()=>{i.current&&o&&o.removeChild(i.current)}},[e,a,r]),i.current?(0,b.createPortal)(t,i.current):o.createElement("span",{ref:n})},w=({unstable_skipInitialRender:t,...e})=>{let[r,n]=o.useState(!1);return(o.useEffect(()=>{t&&n(!0)},[t]),t&&!r)?null:o.createElement(g,{...e})};w.displayName="Portal";var E=["bottom","height","left","right","top","width"],x=new Map,T=function t(){var e=[];x.forEach(function(t,r){var n,o,i=r.getBoundingClientRect();n=i,o=t.rect,void 0===n&&(n={}),void 0===o&&(o={}),E.some(function(t){return n[t]!==o[t]})&&(t.rect=i,e.push(t))}),e.forEach(function(t){t.callbacks.forEach(function(e){return e(t.rect)})}),n=window.requestAnimationFrame(t)};function _(t,e,r){let i,a;u(e)?i=e:(i=e?.observe??!0,a=e?.onChange),l(r)&&(a=r),o.useEffect(()=>{u(e)&&console.warn("Passing `observe` as the second argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `observe` property as the second argument (`useRect(ref, { observe })`).\nSee https://reach.tech/rect#userect-observe")},[e]),o.useEffect(()=>{l(r)&&console.warn("Passing `onChange` as the third argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `onChange` property as the second argument (`useRect(ref, { onChange })`).\nSee https://reach.tech/rect#userect-onchange")},[r]);let[s,c]=o.useState(t.current),f=o.useRef(!1),d=o.useRef(!1),[p,h]=o.useState(null),m=o.useRef(a);return v(()=>{m.current=a,t.current!==s&&c(t.current)}),v(()=>{s&&!f.current&&(f.current=!0,h(s.getBoundingClientRect()))},[s]),v(()=>{var e,r;if(!i)return;let o=s;if(d.current||(d.current=!0,o=t.current),!o){console.warn("You need to place the ref");return}let a=(e=o,r=t=>{m.current?.(t),h(t)},{observe:function(){var t=0===x.size;x.has(e)?x.get(e).callbacks.push(r):x.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[r]}),t&&T()},unobserve:function(){var t=x.get(e);if(t){var o=t.callbacks.indexOf(r);o>=0&&t.callbacks.splice(o,1),t.callbacks.length||x.delete(e),x.size||cancelAnimationFrame(n)}}});return a.observe(),()=>{a.unobserve()}},[i,s,t]),p}var F='input,select,textarea,a[href],button,[tabindex]:not(slot),audio[controls],video[controls],[contenteditable]:not([contenteditable="false"]),details>summary:first-of-type,details',O="undefined"==typeof Element,S=O?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,k=!O&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},C=function(t,e,r){var n=Array.prototype.slice.apply(t.querySelectorAll(F));return e&&S.call(t,F)&&n.unshift(t),n=n.filter(r)},A=function t(e,r,n){for(var o=[],i=Array.from(e);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),u=t(s.length?s:a.children,!0,n);n.flatten?o.push.apply(o,u):o.push({scope:a,candidates:u})}else{S.call(a,F)&&n.filter(a)&&(r||!e.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),c=!n.shadowRootFilter||n.shadowRootFilter(a);if(l&&c){var f=t(!0===l?a.children:l.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scope:a,candidates:f})}else i.unshift.apply(i,a.children)}}return o},D=function(t,e){return t.tabIndex<0&&(e||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},R=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},j=function(t){return"INPUT"===t.tagName},N=function(t,e){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===e)return t[r]},L=function(t){if(!t.name)return!0;var e,r=t.form||k(t),n=function(t){return r.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=n(window.CSS.escape(t.name));else try{e=n(t.name)}catch(t){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",t.message),!1}var o=N(e,t.form);return!o||o===t},I=function(t){var e=t.getBoundingClientRect(),r=e.width,n=e.height;return 0===r&&0===n},P=function(t,e){var r=e.displayCheck,n=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var o=S.call(t,"details>summary:first-of-type")?t.parentElement:t;if(S.call(o,"details:not([open]) *"))return!0;var i=k(t).host,a=(null==i?void 0:i.ownerDocument.contains(i))||t.ownerDocument.contains(t);if(r&&"full"!==r){if("non-zero-area"===r)return I(t)}else{if("function"==typeof n){for(var s=t;t;){var u=t.parentElement,l=k(t);if(u&&!u.shadowRoot&&!0===n(u))return I(t);t=t.assignedSlot?t.assignedSlot:u||l===t.ownerDocument?u:l.host}t=s}if(a)return!t.getClientRects().length}return!1},$=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var r=0;r<e.children.length;r++){var n=e.children.item(r);if("LEGEND"===n.tagName)return!!S.call(e,"fieldset[disabled] *")||!n.contains(t)}return!0}e=e.parentElement}return!1},M=function(t,e){var r,n,o;return!(j(r=e)&&"radio"===r.type&&!L(r)||0>D(e))&&(n=t,!((o=e).disabled||j(o)&&"hidden"===o.type||P(o,n)||"DETAILS"===o.tagName&&Array.prototype.slice.apply(o.children).some(function(t){return"SUMMARY"===t.tagName})||$(o)))},z=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!isNaN(e)||e>=0},U=function t(e){var r=[],n=[];return e.forEach(function(e,o){var i=!!e.scope,a=i?e.scope:e,s=D(a,i),u=i?t(e.candidates):a;0===s?i?r.push.apply(r,u):r.push(a):n.push({documentOrder:o,tabIndex:s,item:e,isScope:i,content:u})}),n.sort(R).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(r)},B=function(t,e){return U((e=e||{}).getShadowRoot?A([t],e.includeContainer,{filter:M.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:z}):C(t,e.includeContainer,M.bind(null,e)))},V=o.forwardRef(function({unstable_skipInitialPortalRender:t,...e},r){return o.createElement(w,{unstable_skipInitialRender:t},o.createElement(H,{ref:r,...e}))});V.displayName="Popover";var H=o.forwardRef(function({as:t="div",targetRef:e,position:r=q,unstable_observableRefs:n=[],...i},a){let s=o.useRef(null),u=_(s,{observe:!i.hidden}),l=_(e,{observe:!0}),d=c(s,a);return function(t,e){let r=f(t.current);function n(n){("Tab"!==n.key||!e.current||0!==B(e.current).length)&&("Tab"===n.key&&n.shiftKey?function(t){if(!t.shiftKey)return;let e=i();return t.target===e}(n)?function(t){let r=e.current&&B(e.current),n=r&&r[r.length-1];n&&(t.preventDefault(),n.focus())}(n):function(t){let r=e.current&&B(e.current);return!!r&&0!==r.length&&t.target===r[0]}(n)?(n.preventDefault(),t.current?.focus()):n.target===B(r)[0]&&s():"Tab"===n.key&&(t.current&&t.current===r.activeElement?function(t){let r=e.current&&B(e.current);r&&r[0]&&(t.preventDefault(),r[0].focus())}(n):function(){if(e.current&&e.current.contains(r.activeElement||null)){let t=e.current&&B(e.current);return!!(t&&t[t.length-1]===r.activeElement)}return!1}()?function(t){let e=i();e&&(t.preventDefault(),e.focus())}(n):function(t){let n=e.current?B(r).filter(t=>!e.current.contains(t)):null;return!!n&&t.target===n[n.length-1]}(n)&&s()))}function i(){let n=B(r),o=n&&t.current?n.indexOf(t.current):-1,i=n&&n[o+1];return!(e.current&&e.current.contains(i||null))&&i}o.useEffect(()=>(r.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",n)}),[]);let a=[];function s(){let t=e.current&&B(e.current);t&&(t.forEach(t=>{a.push([t,t.tabIndex]),t.tabIndex=-1}),r.addEventListener("focusin",u))}function u(){r.removeEventListener("focusin",u),a.forEach(([t,e])=>{t.tabIndex=e})}}(e,s),o.createElement(t,{"data-reach-popover":"",ref:d,...i,style:{position:"absolute",...function(t,e,r,...n){return r?t(e,r,...n.map(t=>t.current)):{visibility:"hidden"}}(r,l,u,...n),...i.style}})});H.displayName="PopoverImpl";var q=(t,e)=>{if(!t||!e)return{};let{directionRight:r,directionUp:n}=function(t,e,r=0,n=0){let o={top:t.top-e.height<0,right:window.innerWidth<t.left+e.width-r,bottom:window.innerHeight<t.bottom+e.height-n,left:t.left+t.width-e.width<0},i=o.right&&!o.left;return{directionRight:i,directionLeft:o.left&&!o.right,directionUp:o.bottom&&!o.top,directionDown:o.top&&!o.bottom}}(t,e);return{left:r?`${t.right-e.width+window.pageXOffset}px`:`${t.left+window.pageXOffset}px`,top:n?`${t.top-e.height+window.pageYOffset}px`:`${t.top+t.height+window.pageYOffset}px`}},W=!1,K=0,Y=i["useId".toString()];function X({context:t,children:e,items:r,set:n}){let i=o.useCallback(({element:t,index:e,...r})=>t?(n(n=>{if(null!=e&&-1!==e)return J(n,{element:t,index:e,...r},e);if(0===n.length)return[{...r,element:t,index:0}];if(n.find(e=>e.element===t))return console.warn("[reach-ui]: `useDescendant` was called with an element that was already registered.\n\nIf you are using the `@reach/descendants` package directly, make sure to only register descendants once. Registering a descendant more than once will lead to bugs in your app.\n\nIf you are using another `reach-ui` package, this is probably our bug!\n\nTo report a bug, open a new issue:\n\n https://github.com/reach/reach-ui/issues/new?assignees=&labels=&template=Bug_report.md\n\nIMPORTANT: this check will only run in the development build, so if you see this warning please be aware that your app may crash when deployed."),n.sort((t,e)=>t.element&&e.element?Z(t.element,e.element)?-1:1:0).map((t,e)=>({...t,index:e}));let o=function(t,e){if(!e||!t.length)return -1;let r=t.length;for(;r--;){let n=t[r].element;if(n&&Z(n,e))return r+1}return -1}(n,t);return -1===o?[...n,{...r,element:t,index:n.length}]:J(n,{...r,element:t,index:o},o)}),()=>{t&&n(e=>e.filter(e=>t!==e.element))}):h,[]);return o.createElement(t.Provider,{value:o.useMemo(()=>({descendants:r,registerDescendant:i}),[r,i])},e)}function Z(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}function J(t,e,r){return null!=r&&r in t?[...t.slice(0,r),e,...t.slice(r)]:[...t,e]}/**
|
|
14
|
+
* @reach/dropdown v0.18.0
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) 2018-2022, React Training LLC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
20
|
+
*
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/var G="CLEAR_SELECTION_INDEX",Q="CLICK_MENU_ITEM",tt="CLOSE_MENU",te="OPEN_MENU_AT_INDEX",tr="OPEN_MENU_CLEARED",tn="SEARCH_FOR_ITEM",to="SELECT_ITEM_AT_INDEX",ti="SET_BUTTON_ID",ta=/**
|
|
23
|
+
* @reach/descendants v0.18.0
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) 2018-2022, React Training LLC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
29
|
+
*
|
|
30
|
+
* @license MIT
|
|
31
|
+
*/function(t,e={}){let r=o.createContext({descendants:[],registerDescendant:()=>h,...e});return r.displayName=t,r}("DropdownDescendantContext"),[ts,tu]=function(t,e){let r=o.createContext(void 0);function n(t){let{children:e,...n}=t,i=o.useMemo(()=>n,Object.values(n));return o.createElement(r.Provider,{value:i},e)}return r.displayName=`${t}Context`,n.displayName=`${t}Provider`,[n,function(e){let n=o.useContext(r);if(n)return n;throw Error(`${e} must be rendered inside of a ${t} component.`)}]}("Dropdown"),tl={triggerId:null,isExpanded:!1,typeaheadQuery:"",selectionIndex:-1},tc=({id:t,children:e})=>{let r=o.useRef(null),n=o.useRef(null),i=o.useRef(null),[a,s]=o.useState([]),u=function(t){if(void 0!==Y){let e=Y();return t??e}let e=t??(W?++K:null),[r,n]=o.useState(e);return v(()=>{null===r&&n(++K)},[]),o.useEffect(()=>{!1===W&&(W=!0)},[]),t??r??void 0}(t),c=t||p("menu",u),f=p("menu-button",c),[d,h]=o.useReducer(ty,{...tl,triggerId:f}),m=o.useRef(!1),y=o.useRef([]),b=o.useRef(!1),g=o.useRef({x:0,y:0});return o.useEffect(()=>{d.isExpanded?(window.__REACH_DISABLE_TOOLTIPS=!0,window.requestAnimationFrame(()=>{tv(n.current)})):window.__REACH_DISABLE_TOOLTIPS=!1},[d.isExpanded]),o.createElement(X,{context:ta,items:a,set:s},o.createElement(ts,{dispatch:h,dropdownId:c,dropdownRef:n,mouseDownStartPosRef:g,popoverRef:i,readyToSelect:b,selectCallbacks:y,state:d,triggerClickedRef:m,triggerRef:r},l(e)?e({isExpanded:d.isExpanded,isOpen:d.isExpanded}):e))};function tf({onKeyDown:t,onMouseDown:e,id:r,ref:n,...i}){let{dispatch:a,dropdownId:u,mouseDownStartPosRef:l,triggerClickedRef:f,triggerRef:h,state:{triggerId:m,isExpanded:v}}=tu("useDropdownTrigger"),y=c(h,n),b=tb(),g=o.useMemo(()=>b.findIndex(t=>!t.disabled),[b]);return o.useEffect(()=>{null!=r&&r!==m&&a({type:ti,payload:r})},[m,a,r]),o.useEffect(()=>{null==r&&a({type:ti,payload:p("menu-button",u)})},[u,a,r]),{data:{isExpanded:v,controls:u},props:{...i,ref:y,id:m||void 0,onKeyDown:s(t,function(t){switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),a({type:te,payload:{index:g}});break;case"Enter":case" ":a({type:te,payload:{index:g}})}}),onMouseDown:s(e,function(t){d(t.nativeEvent)||(l.current={x:t.clientX,y:t.clientY},v||(f.current=!0),v?a({type:tt}):a({type:tr}))}),type:"button"}}}function td({index:t,isLink:e=!1,onClick:r,onDragStart:n,onMouseDown:i,onMouseEnter:a,onMouseLeave:u,onMouseMove:l,onMouseUp:p,onSelect:h,disabled:y,onFocus:b,valueText:g,ref:w,...E}){let{dispatch:x,dropdownRef:T,mouseDownStartPosRef:_,readyToSelect:F,selectCallbacks:O,triggerRef:S,state:{selectionIndex:k,isExpanded:C}}=tu("useDropdownItem"),A=o.useRef(null),[D,R]=o.useState(g||""),j=o.useCallback(t=>{!g&&t?.textContent&&R(t.textContent)},[g]),N=o.useRef(!1),[L,I]=function(t,e){let[r,n]=(0,o.useState)(null);return[r,(0,o.useCallback)(e=>{t.current=e,n(e)},[])]}(A,0),P=function(t,e,r){let n=m(),{registerDescendant:i,descendants:a}=o.useContext(e),s=r??a.findIndex(e=>e.element===t.element);return v(()=>(t.element||n(),i({...t,index:s})),[t,n,s,i,...Object.values(t)]),s}(o.useMemo(()=>({element:L,key:D,disabled:y,isLink:e}),[y,L,e,D]),ta,t),$=P===k&&!y,M=c(w,I,j);function z(){tv(S.current),h&&h(),x({type:Q})}return O.current[P]=h,o.useEffect(()=>{if(C){let t=window.setTimeout(()=>{F.current=!0},400);return()=>{window.clearTimeout(t)}}F.current=!1},[C,F]),o.useEffect(()=>{let t=f(A.current);return t.addEventListener("mouseup",e),()=>{t.removeEventListener("mouseup",e)};function e(){N.current=!1}},[]),{data:{disabled:y},props:{id:tm(P),tabIndex:-1,...E,ref:M,"data-disabled":y?"":void 0,"data-selected":$?"":void 0,"data-valuetext":D,onClick:s(r,function(t){!d(t.nativeEvent)&&e&&(y?t.preventDefault():z())}),onDragStart:s(n,function(t){e&&t.preventDefault()}),onMouseDown:s(i,function(t){d(t.nativeEvent)||(e?N.current=!0:t.preventDefault())}),onMouseEnter:s(a,function(t){let e=f(T.current);$||null==P||y||(T?.current&&T.current!==e.activeElement&&A.current!==e.activeElement&&T.current.focus(),x({type:to,payload:{index:P}}))}),onMouseLeave:s(u,function(t){x({type:G})}),onMouseMove:s(l,function(t){if(!F.current){let e=Math.abs(t.clientX-_.current.x),r=Math.abs(t.clientY-_.current.y);(e>8||r>8)&&(F.current=!0)}$||null==P||y||x({type:to,payload:{index:P,dropdownRef:T}})}),onFocus:s(b,function(){F.current=!0,$||null==P||y||x({type:to,payload:{index:P}})}),onMouseUp:s(p,function(t){if(!d(t.nativeEvent)){if(!F.current){F.current=!0;return}e?N.current?N.current=!1:A.current&&A.current.click():y||z()}})}}}function tp({id:t,onKeyDown:e,ref:r,...n}){let{dispatch:i,triggerRef:a,dropdownRef:u,selectCallbacks:l,dropdownId:f,state:{isExpanded:d,triggerId:p,selectionIndex:h,typeaheadQuery:m}}=tu("useDropdownItems"),v=tb(),b=c(u,r);o.useEffect(()=>{let t=function(t,e=""){if(!e)return null;let r=t.find(t=>!t.disabled&&t.element?.dataset?.valuetext?.toLowerCase().startsWith(e));return r?t.indexOf(r):null}(v,m);m&&null!=t&&i({type:to,payload:{index:t,dropdownRef:u}});let e=window.setTimeout(()=>m&&i({type:tn,payload:""}),1e3);return()=>window.clearTimeout(e)},[i,v,m,u]);let g=y(v.length),w=y(v[h]),E=y(h);o.useEffect(()=>{h>v.length-1?i({type:to,payload:{index:v.length-1,dropdownRef:u}}):g!==v.length&&h>-1&&w&&E===h&&v[h]!==w&&i({type:to,payload:{index:v.findIndex(t=>t.key===w?.key),dropdownRef:u}})},[u,i,v,g,w,E,h]);let x=s(function(t){let{key:e}=t;if(d)switch(e){case"Enter":case" ":let r=v.find(t=>t.index===h);r&&!r.disabled&&(t.preventDefault(),r.isLink&&r.element?r.element.click():(tv(a.current),l.current[r.index]&&l.current[r.index](),i({type:Q})));break;case"Escape":tv(a.current),i({type:tt});break;case"Tab":t.preventDefault();break;default:"string"==typeof e&&1===e.length&&i({type:tn,payload:m+e.toLowerCase()})}},function(t,e){let{descendants:r}=o.useContext(t),{callback:n,currentIndex:i,filter:a,key:s="index",orientation:u="vertical",rotate:l=!0,rtl:c=!1}=e;return function(t){if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(t.key))return;let e=i??-1,o=a?r.filter(a):r;if(!o.length)return;let f=o.findIndex(t=>t.index===i);function d(){return e===h().index?l?o[0]:o[f]:o[(f+1)%o.length]}function p(){return e===o[0].index?l?h():o[f]:o[(f-1+o.length)%o.length]}function h(){return o[o.length-1]}switch(t.key){case"ArrowDown":if("vertical"===u||"both"===u){t.preventDefault();let e=d();n("option"===s?e:e[s])}break;case"ArrowUp":if("vertical"===u||"both"===u){t.preventDefault();let e=p();n("option"===s?e:e[s])}break;case"ArrowLeft":if("horizontal"===u||"both"===u){t.preventDefault();let e=(c?d:p)();n("option"===s?e:e[s])}break;case"ArrowRight":if("horizontal"===u||"both"===u){t.preventDefault();let e=(c?p:d)();n("option"===s?e:e[s])}break;case"PageUp":t.preventDefault();let m=(t.ctrlKey?p:function(){return o[0]})();n("option"===s?m:m[s]);break;case"Home":t.preventDefault();let v=o[0];n("option"===s?v:v[s]);break;case"PageDown":t.preventDefault();let y=(t.ctrlKey?d:h)();n("option"===s?y:y[s]);break;case"End":t.preventDefault();let b=h();n("option"===s?b:b[s])}}}(ta,{currentIndex:h,orientation:"vertical",rotate:!1,filter:t=>!t.disabled,callback:t=>{i({type:to,payload:{index:t,dropdownRef:u}})},key:"index"}));return{data:{activeDescendant:tm(h)||void 0,triggerId:p},props:{tabIndex:-1,...n,ref:b,id:f,onKeyDown:s(e,x)}}}function th({onBlur:t,portal:e=!0,position:r,ref:n,...i}){let{triggerRef:a,triggerClickedRef:u,dispatch:l,dropdownRef:d,popoverRef:p,state:{isExpanded:h}}=tu("useDropdownPopover"),m=c(p,n);return o.useEffect(()=>{if(!h)return;let t=f(p.current);function e(t){var e,r;u.current?u.current=!1:(e=p.current,r=t.target,!(e&&e.contains(r))&&l({type:tt}))}return t.addEventListener("mousedown",e),()=>{t.removeEventListener("mousedown",e)}},[u,a,l,d,p,h]),{data:{portal:e,position:r,targetRef:a,isExpanded:h},props:{ref:m,hidden:!h,onBlur:s(t,t=>{t.currentTarget.contains(t.relatedTarget)||l({type:tt})}),...i}}}function tm(t){let{dropdownId:e}=tu("useItemId");return null!=t&&t>-1?p(`option-${t}`,e):void 0}function tv(t){t&&t.focus()}function ty(t,e={}){switch(e.type){case Q:case tt:return{...t,isExpanded:!1,selectionIndex:-1};case"OPEN_MENU_AT_FIRST_ITEM":return{...t,isExpanded:!0,selectionIndex:0};case te:return{...t,isExpanded:!0,selectionIndex:e.payload.index};case tr:return{...t,isExpanded:!0,selectionIndex:-1};case to:{let{dropdownRef:r={current:null}}=e.payload;if(e.payload.index>=0&&e.payload.index!==t.selectionIndex){if(r.current){let t=f(r.current);r.current!==t?.activeElement&&r.current.focus()}return{...t,selectionIndex:null!=e.payload.max?Math.min(Math.max(e.payload.index,0),e.payload.max):Math.max(e.payload.index,0)}}return t}case G:return{...t,selectionIndex:-1};case ti:return{...t,triggerId:e.payload};case tn:if(void 0!==e.payload)return{...t,typeaheadQuery:e.payload};return t;default:return t}}function tb(){return o.useContext(ta).descendants}tc.displayName="DropdownProvider",o.forwardRef(({as:t="button",...e},r)=>{let{props:n}=tf({...e,ref:r});return o.createElement(t,{"data-reach-dropdown-trigger":"",...n})}).displayName="DropdownTrigger",o.forwardRef(({as:t="div",...e},r)=>{let{props:n}=td({...e,ref:r});return o.createElement(t,{"data-reach-dropdown-item":"",...n})}).displayName="DropdownItem",o.forwardRef(({as:t="div",...e},r)=>{let{props:n}=tp({...e,ref:r});return o.createElement(t,{"data-reach-dropdown-items":"",...n})}).displayName="DropdownItems",o.forwardRef(({as:t="div",...e},r)=>{let{data:{portal:n,targetRef:i,position:a},props:s}=th({...e,ref:r}),u={"data-reach-dropdown-popover":""};return n?o.createElement(V,{...s,...u,as:t,targetRef:i,position:a,unstable_skipInitialPortalRender:!0}):o.createElement(t,{...s,...u})}).displayName="DropdownPopover";var tg=r(48570),tw=o.forwardRef(({as:t=o.Fragment,id:e,children:r,...n},i)=>{let a=o.useMemo(()=>{try{return(0,tg.isFragment)(o.createElement(t,null))}catch(t){return!1}},[t])?{}:{ref:i,id:e,"data-reach-menu":"",...n};return o.createElement(t,{...a},o.createElement(tc,{id:e,children:r}))});tw.displayName="Menu";var tE=o.forwardRef(({as:t="button",...e},r)=>{let{data:{isExpanded:n,controls:i},props:a}=tf({...e,ref:r});return o.createElement(t,{"aria-expanded":!!n||void 0,"aria-haspopup":!0,"aria-controls":i,...a,"data-reach-menu-button":""})});tE.displayName="MenuButton";var tx=o.forwardRef(({as:t="div",...e},r)=>{let{data:{disabled:n},props:i}=td({...e,ref:r});return o.createElement(t,{role:"menuitem",...i,"aria-disabled":n||void 0,"data-reach-menu-item":""})});tx.displayName="MenuItemImpl";var tT=o.forwardRef(({as:t="div",...e},r)=>o.createElement(tx,{...e,ref:r,as:t}));tT.displayName="MenuItem";var t_=o.forwardRef(({as:t="div",...e},r)=>{let{data:{activeDescendant:n,triggerId:i},props:a}=tp({...e,ref:r});return o.createElement(t,{"aria-activedescendant":n,"aria-labelledby":i||void 0,role:"menu",...a,"data-reach-menu-items":""})});t_.displayName="MenuItems",o.forwardRef(({as:t="a",component:e,onSelect:r,...n},i)=>(o.useEffect(()=>{e&&console.warn("[@reach/menu-button]: Please use the `as` prop instead of `component`")},[e]),o.createElement(tx,{...n,ref:i,"data-reach-menu-link":"",as:t,isLink:!0,onSelect:r||h}))).displayName="MenuLink";var tF=o.forwardRef(({portal:t=!0,...e},r)=>o.createElement(tO,{portal:t},o.createElement(t_,{...e,ref:r,"data-reach-menu-list":""})));tF.displayName="MenuList";var tO=o.forwardRef(({as:t="div",...e},r)=>{let{data:{portal:n,targetRef:i,position:a},props:s}=th({...e,ref:r}),u={"data-reach-menu-popover":""};return n?o.createElement(V,{...s,...u,as:t,targetRef:i,position:a,unstable_skipInitialPortalRender:!0}):o.createElement(t,{...s,...u})});tO.displayName="MenuPopover"}}]);
|