You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

json-edit-react

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-edit-react - npm Package Compare versions

Comparing version

to
1.28.0

2

build/index.cjs.js

@@ -1,1 +0,1 @@

"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("object-property-assigner"),r=require("object-property-extractor");function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function a(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const i=({className:t,name:n,value:r,setValue:o,handleKeyPress:a,styles:i,textAreaRef:s})=>{if("string"!=typeof r)return null;const l="\n"===r.slice(-1)?r+".":r;return e.jsxs("div",{style:{display:"grid"},children:[e.jsx("textarea",{id:`${n}_textarea`,ref:s,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},i),rows:1,className:t,name:`${n}_textarea`,value:r,onChange:e=>o(e.target.value),autoFocus:!0,onFocus:e=>{r.length<40&&e.target.select()},onKeyDown:a}),e.jsx("span",{className:t,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},i),children:l})]})},s=e=>null!==e&&"object"==typeof e,l=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!c(r,t,n))return!1}if(!n&&r&&!c(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!d(t,r))return!1}return!0},c=(e="",t,n=d)=>{const r=t.value;return Object.entries(r).some((([o,a])=>{const i=[...t.path,o],l=Object.assign(Object.assign({},t),{key:o,path:i,level:t.level+1,value:a,size:i.length,parentData:r});return s(a)?c(e,l,n):n(l,e)}))},d=(e,t="")=>{const{value:n}=e;if(null===n&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},u=({key:e,path:t},n="")=>!!d({value:e},n)||!!t.some((e=>d({value:e},n))),p=(e,t)=>(null!=t?t:"")+e.map((e=>""===e?String.fromCharCode(0):e)).join("."),g=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,m=(e,t,n)=>{const r=e.key,o=g(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:a,modifier:i}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==a||!(null==i?void 0:i.includes("Shift")))&&(r===a&&(i===o||Array.isArray(i)&&i.includes(o)))},h={key:"Enter"},y={confirm:h,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},h),{modifier:["Meta","Shift","Control"]}),objectLineBreak:h,stringConfirm:h,stringLineBreak:Object.assign(Object.assign({},h),{modifier:["Shift"]}),numberConfirm:h,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:h,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},f=(e,t,n="next",o)=>{const a=t.slice(0,t.length-1),i=t.slice(-1)[0];if(void 0===i)return null;const l=r(e,a),c=j(l);Array.isArray(l)||o(c,(({key:e,value:t})=>[e,t]));const d=c.findIndex((e=>e.key===i)),u=c[d+("next"===n?1:-1)];return u?s(u.value)?0===Object.keys(u.value).length?f(e,[...a,u.key],n,o):b(e,[...a,u.key],n,o):[...a,u.key]:0===a.length?null:f(e,a,n,o)},b=(e,t,n="next",o)=>{const a=r(e,t);if(!s(a))return t;const i=Array.isArray(a)?a.map(((e,t)=>t)):Object.keys(a);o(i,(e=>[e,a]));const l="next"===n?i[0]:i[i.length-1];return b(e,[...t,l],n,o)},j=e=>Array.isArray(e)?e.map(((e,t)=>({index:t,value:e,key:t}))):Object.entries(e).map((([e,t],n)=>({key:e,value:t,index:n}))),v=(e,t)=>{var n,r,o,a;const i=e.current,s=null!==(n=null==i?void 0:i.selectionStart)&&void 0!==n?n:1/0,l=null!==(r=null==i?void 0:i.selectionEnd)&&void 0!==r?r:1/0,c=(null===(o=null==i?void 0:i.textContent)||void 0===o?void 0:o.slice(0,s))+t+(null===(a=null==i?void 0:i.textContent)||void 0===a?void 0:a.slice(l));return i.value=c,null==i||i.setSelectionRange(s+1,s+1),c},x=e=>{if(e!==E){if(Array.isArray(e))return e.map((e=>x(e)));if(e&&"object"==typeof e)for(const t in e)e[t]=x(e[t]);return e}},E="__​undefined__",C={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},D=t.createContext({getStyles:()=>({}),icons:{}}),w=({theme:t=C,icons:n={},docRoot:r,children:o})=>{const a=O(t,r);return e.jsx(D.Provider,{value:{getStyles:(e,t)=>"function"==typeof a[e]?a[e](t):a[e],icons:n},children:o})},k=()=>t.useContext(D),O=(e,t)=>{var n,r,o,a;const i={},s=(Array.isArray(e)?e:[e]).map((e=>N(e)?S({fragments:{},styles:e},i):S(e,i))),l=S(C,{});Object.keys(l).forEach((e=>{const t=e;s.forEach((e=>{e[t]&&(l[t]=Object.assign(Object.assign({},l[t]),e[t]))}))}));const c=Object.assign({},l);return Object.entries(i).forEach((([e,t])=>{const n=e;c[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},l[n]),r)}})),"function"!=typeof(null==c?void 0:c.inputHighlight)&&(null===(n=null==c?void 0:c.inputHighlight)||void 0===n?void 0:n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",null===(r=null==c?void 0:c.inputHighlight)||void 0===r?void 0:r.backgroundColor),"function"!=typeof(null==c?void 0:c.iconCopy)&&(null===(o=null==c?void 0:c.iconCopy)||void 0===o?void 0:o.color)&&t.style.setProperty("--jer-icon-copy-color",null===(a=null==c?void 0:c.iconCopy)||void 0===a?void 0:a.color),c},S=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const a=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var a,i;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(a=null==n?void 0:n[o])&&void 0!==a?a:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(i=T[e])&&void 0!==i?i:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=a})),o},N=e=>!("styles"in e),T={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},A=t.createContext(null),R=({children:n,onEditEvent:r,onCollapse:o})=>{const[a,i]=t.useState(null),[s,l]=t.useState(null),[c,d]=t.useState(null),[u,g]=t.useState({path:null,pathString:null}),m=t.useRef(null),h=t.useRef("next"),y=t.useRef(null);return e.jsx(A.Provider,{value:{collapseState:a,setCollapseState:e=>{i(e),o&&null!==e&&(Array.isArray(e)?e.forEach((e=>o(e))):o(e)),null!==e&&setTimeout((()=>i(null)),2e3)},getMatchingCollapseState:e=>{if(Array.isArray(a)){for(const t of a)if(P(e,t))return t;return null}return P(e,a)?a:null},currentlyEditingElement:s,setCurrentlyEditingElement:(e,t)=>{const n="string"==typeof e||null===e?e:p(e,"key"===t?"key_":void 0);null!==s&&null!==n&&null!==m.current&&m.current(),l(n),r&&r(e,"key"===t),m.current="function"==typeof t?t:null},areChildrenBeingEdited:e=>null!==s&&s.includes(e),previouslyEditedElement:y.current,setPreviouslyEditedElement:e=>{y.current=e},tabDirection:h.current,setTabDirection:e=>{h.current=e},previousValue:c,setPreviousValue:d,dragSource:u,setDragSource:g},children:n})},K=()=>{const e=t.useContext(A);if(!e)throw new Error("Missing Context Provider");return e},P=(e,t)=>{if(null===t)return!1;if(!t.includeChildren)return t.path.every(((t,n)=>e[n]===t))&&t.path.length===e.length;for(const[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},V="**INVALID_FUNCTION**",M=({nodeData:n,showStringQuotes:r=!0,stringTruncate:o=200,pathString:a,canEdit:i,setIsEditing:s,styles:l,translate:c,value:d,TextWrapper:u=({children:e})=>e})=>{const p=null!=d?d:n.value,[g,m]=t.useState(!1),h=r?'"':"",y=p.length>o,f=()=>{i?s(!0):m(!g)};return e.jsxs("div",{id:`${a}_display`,onDoubleClick:f,onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&f()},className:"jer-value-string",style:l,children:[h,y?g?e.jsxs(e.Fragment,{children:[e.jsx(u,{children:e.jsxs("span",{children:[p,h]})}),e.jsxs("span",{className:"jer-string-expansion jer-show-less",onClick:()=>m(!1),children:[" ",c("SHOW_LESS",n)]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx("span",{children:p.slice(0,o-2).trimEnd()})," "]}),e.jsx("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>m(!0),children:"..."}),h]}):e.jsx(u,{children:`${p}${h}`})]})},_=({styles:n,pathString:r,value:o,setValue:a,handleEdit:s,handleKeyboard:l,keyboardCommon:c})=>{const d=t.useRef(null);return e.jsx(i,{className:"jer-input-text",textAreaRef:d,name:r,value:o,setValue:a,handleKeyPress:e=>{l(e,Object.assign({stringConfirm:s,stringLineBreak:()=>{const e=v(d,"\n");a(e)}},c))},styles:n})},F=t=>{var{isEditing:n,path:r,enumType:a}=t,i=o(t,["isEditing","path","enumType"]);const{getStyles:s}=k(),l=p(r),{value:c,setValue:d,nodeData:u,handleEdit:g,handleKeyboard:m,keyboardCommon:h}=i;return n&&a?e.jsxs("div",{className:"jer-select jer-select-enums",children:[e.jsx("select",{name:`${l}-value-select`,className:"jer-select-inner",onChange:e=>d(e.target.value),value:c,autoFocus:!0,onKeyDown:e=>{m(e,Object.assign({stringConfirm:g},h))},children:a.values.map((t=>e.jsx("option",{value:t,children:t},t)))}),e.jsx("span",{className:"focus"})]}):n?e.jsx(_,Object.assign({styles:s("input",u),pathString:l},i,{setValue:i.setValue})):e.jsx(M,Object.assign({pathString:l,styles:s("string",u)},i))},z=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:d}=k();return r?e.jsx("input",{className:"jer-input-number",type:"text",name:p(o),value:t,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>setTimeout((()=>e.target.select()),10),onKeyDown:e=>l(e,Object.assign({numberConfirm:i,numberUp:()=>n(Number(t)+1),numberDown:()=>n(Number(t)-1)},c)),style:Object.assign({width:String(t).length/1.5+2+"em"},d("input",s))}):e.jsx("span",{onDoubleClick:()=>a(!0),className:"jer-value-number",style:d("number",s),children:t})},I=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:d}=k();return"boolean"!=typeof t?null:r?e.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:p(o),checked:t,onChange:()=>n(!t),onKeyDown:e=>{" "===e.key&&e.preventDefault(),l(e,Object.assign({booleanConfirm:i,booleanToggle:()=>n(!t)},c))},autoFocus:!0}):e.jsx("span",{onDoubleClick:()=>a(!0),className:"jer-value-boolean",style:d("boolean",s),children:String(t)})},L=(e,n)=>{const r=t.useRef(void 0),o=t.useRef(n);t.useEffect((()=>{o.current=n}),[n]);const a=e=>{o.current(e)};t.useEffect((()=>{if(window.clearTimeout(r.current),e)return r.current=window.setTimeout((()=>{window.addEventListener("keydown",a)}),100),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",a)}}),[e])},B=({value:t,isEditing:n,setIsEditing:r,handleEdit:o,nodeData:a,handleKeyboard:i,keyboardCommon:s})=>{const{getStyles:l}=k();return L(n,(e=>i(e,Object.assign({confirm:o},s)))),e.jsx("div",{onDoubleClick:()=>r(!0),className:"jer-value-null",style:l("null",a),children:String(t)})},W=({value:t})=>{let n="Error!";switch(typeof t){case"string":t===V&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return e.jsx("span",{className:"jer-value-invalid",children:n})},G=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),e.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),Y=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,transform:"translate(0, 0.5)",children:[e.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),e.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),H=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),U=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),e.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),e.jsx("path",{d:"M15 10l-4 4 4 4"})]}),$=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),e.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),Z=({size:t,style:n,className:r})=>e.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),J=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),X=({name:t,nodeData:n})=>{var r,o,a,i,s,l,c;const{getStyles:d,icons:u}=k(),p={size:"1.4em",className:"jer-icon"};switch(t){case"add":return null!==(r=null==u?void 0:u.add)&&void 0!==r?r:e.jsx(G,Object.assign({},p,{style:d("iconAdd",n)}));case"edit":return null!==(o=null==u?void 0:u.edit)&&void 0!==o?o:e.jsx(Y,Object.assign({},p,{style:d("iconEdit",n)}));case"delete":return null!==(a=null==u?void 0:u.delete)&&void 0!==a?a:e.jsx(H,Object.assign({},p,{style:d("iconDelete",n),size:"1.45em"}));case"copy":return null!==(i=null==u?void 0:u.copy)&&void 0!==i?i:e.jsx(U,Object.assign({},p,{style:d("iconCopy",n),size:"1.2em"}));case"ok":return null!==(s=null==u?void 0:u.ok)&&void 0!==s?s:e.jsx($,Object.assign({},p,{style:Object.assign({fontSize:"90%"},d("iconOk",n))}));case"cancel":return null!==(l=null==u?void 0:u.cancel)&&void 0!==l?l:e.jsx(Z,Object.assign({},p,{style:Object.assign({fontSize:"130%"},d("iconCancel",n))}));case"chevron":return null!==(c=null==u?void 0:u.chevron)&&void 0!==c?c:e.jsx(J,{size:"1em",style:d("iconCollection",n)});default:return e.jsx(e.Fragment,{})}},q=({startEdit:n,handleDelete:o,handleAdd:a,enableClipboard:i,type:s,customButtons:l,nodeData:c,translate:d,keyboardControls:u,handleKeyboard:p,editConfirmRef:m,getNewKeyOptions:h,jsonStringify:y})=>{const{getStyles:f}=k(),b=d("KEY_NEW",c),[j,v]=t.useState(b),[x,E]=t.useState(!1),{key:C,path:D,value:w}=c,O=Array.isArray(x),S=e=>{var t;if(!e)return void E(!1);const n=Object.keys(r(c.fullData,D)),o=h?null===(t=h(c))||void 0===t?void 0:t.filter((e=>!n.includes(e))):null;o&&v(""),E(null==o||o)};return e.jsxs("div",{className:"jer-edit-buttons",style:{opacity:x?1:void 0},onClick:e=>e.stopPropagation(),children:[i&&e.jsx("div",{onClick:e=>{var t;e.stopPropagation();let n,r,o="value",a="",s=null;if(i){const l=g(e);if(l&&u.clipboardModifier.includes(l)?(n=ee(D),a=n,o="path"):(n=w,a="object"==typeof n?y(w):String(n)),!navigator.clipboard)return void("function"==typeof i&&i({success:!1,value:n,stringValue:a,path:D,key:C,type:o,errorMessage:"Can't access clipboard API"}));null===(t=navigator.clipboard)||void 0===t||t.writeText(a).then((()=>r=!0)).catch((e=>{r=!1,s=e.message})).finally((()=>{"function"==typeof i&&i({success:r,errorMessage:s,value:n,stringValue:a,path:D,key:C,type:o})}))}},className:"jer-copy-pulse",children:e.jsx(X,{name:"copy",nodeData:c})}),n&&e.jsx("div",{onClick:n,children:e.jsx(X,{name:"edit",nodeData:c})}),o&&e.jsx("div",{onClick:o,children:e.jsx(X,{name:"delete",nodeData:c})}),a&&e.jsx("div",{onClick:()=>{"object"===s?S(!0):a("")},children:e.jsx(X,{name:"add",nodeData:c})}),null==l?void 0:l.map((({Element:t,onClick:n},r)=>e.jsx("div",{onClick:e=>n&&n(c,e),children:e.jsx(t,{nodeData:c})},r))),x&&a&&"object"===s&&e.jsxs(e.Fragment,{children:[O?e.jsxs("div",{className:"jer-select jer-select-keys",children:[e.jsxs("select",{name:"new-key-select",className:"jer-select-inner",onChange:e=>{a(e.target.value),S(!1)},defaultValue:"",autoFocus:!0,onKeyDown:e=>{p(e,{cancel:()=>S(!1)})},children:[e.jsx("option",{value:"",disabled:!0,children:x.length>0?d("KEY_SELECT",c):d("NO_KEY_OPTIONS",c)}),x.map((t=>e.jsx("option",{value:t,children:t},t)))]}),e.jsx("span",{className:"focus"})]}):e.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:j,onChange:e=>v(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{p(e,{stringConfirm:()=>{a&&(S(!1),a(j),v(b))},cancel:()=>{S(!1),v(b)}})},style:f("input",c)}),e.jsx(Q,{onOk:()=>{O&&!j||(S(!1),a(j))},onCancel:()=>{S(!1)},nodeData:c,editConfirmRef:m,hideOk:O})]})]})},Q=({onOk:t,onCancel:n,nodeData:r,editConfirmRef:o,hideOk:a=!1})=>e.jsxs("div",{className:"jer-confirm-buttons",children:[!a&&e.jsx("div",{onClick:t,ref:o,children:e.jsx(X,{name:"ok",nodeData:r})}),e.jsx("div",{onClick:n,children:e.jsx(X,{name:"cancel",nodeData:r})})]}),ee=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),te=["string","number","boolean","null","object","array"],ne=({props:e,collapsed:n})=>{const{data:r,nodeData:o,parentData:a,onEdit:i,onError:s,showErrorMessages:l,restrictEditFilter:c,restrictDeleteFilter:d,restrictAddFilter:u,restrictDragFilter:g,translate:m,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:f}=K(),[b,j]=t.useState(null),v=Object.assign(Object.assign({},o),{collapsed:n}),{path:x,key:E,size:C}=v,D=p(x),w=!c(v),k=!d(v),O=!u(v),S=!g(v)&&k&&null===y,N=e=>{l&&(j(e),setTimeout((()=>j(null)),h)),console.warn("Error",e)},T=t.useCallback(((e,t)=>{N(e.message),s&&s({currentData:v.fullData,errorValue:t,currentValue:r,name:E,path:x,error:e})}),[s,l]),A=y===D,R=y===`key_${D}`,P="number"==typeof x.slice(-1)[0],V={isEditing:A,isEditingKey:R,isArray:P,canEditKey:null!==a&&w&&O&&k&&!P},M=""===E&&x.length>0?m("EMPTY_STRING",v):null;return{pathString:D,nodeData:v,path:x,name:E,size:C,canEdit:w,canDelete:k,canAdd:O,canDrag:S,error:b,showError:N,onError:T,setError:j,handleEditKey:e=>{if(f(null),E===e)return;if(!a)return;const t=x.slice(0,-1);if(Object.keys(a).includes(e))return void T({code:"KEY_EXISTS",message:m("ERROR_KEY_EXISTS",v)},e);const n=Object.fromEntries(Object.entries(a).map((([t,n])=>t===E?[e,n]:[t,n])));i(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:V,emptyStringKey:M}},re=({canDrag:n,canDragOnto:r,path:o,nodeData:a,onMove:i,onError:s,translate:l})=>{const{getStyles:c}=k(),{dragSource:d,setDragSource:u}=K(),[g,m]=t.useState(!1),h=p(o),y=t.useMemo((()=>n?{onDragStart:e=>{e.stopPropagation(),u({path:o,pathString:h})},onDragEnd:e=>{e.stopPropagation(),u({path:null,pathString:null})}}:{}),[n,h]),f=t.useMemo((()=>e=>r?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),j(e),u({path:null,pathString:null}),m(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=d.pathString)&&void 0!==n?n:"")||m(e)},onDragExit:e=>{e.stopPropagation(),m(!1)}}:{}),[d,r,h]),b=t.useMemo((()=>r&&null!==d.pathString?e.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:o.length}},f("below"))):null),[d,r,o.length]),j=e=>{var t,n;const r=null===(t=d.path)||void 0===t?void 0:t.slice(-1)[0],c=null===(n=d.path)||void 0===n?void 0:n.slice(0,-1).join("."),u=o.slice(0,-1).join(""),{parentData:p}=a;"string"==typeof r&&p&&!Array.isArray(p)&&Object.keys(p).includes(r)&&r in p&&c!==u?s({code:"KEY_EXISTS",message:l("ERROR_KEY_EXISTS",a)},r):i(d.path,o,e).then((e=>{e&&s({code:"UPDATE_ERROR",message:e},a.value)}))};return{dragSourceProps:y,getDropTargetProps:f,BottomDropTarget:b,DropTargetPadding:({position:t,nodeData:n})=>g===t?e.jsx("div",{className:"jer-drag-n-drop-padding",style:c("dropZone",n)}):null,handleDrop:j}},oe=(e,t,n,r)=>{var o,a,i;if(!t.current)return 0;const s=parseInt(null!==(o=getComputedStyle(n.current).getPropertyValue("line-height"))&&void 0!==o?o:"16px"),l=(null!==(i=null===(a=t.current)||void 0===a?void 0:a.offsetWidth)&&void 0!==i?i:0)/(.5*s),c=r(e).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/l))).reduce(((e,t)=>e+t),0)*s;return Math.min(c+30,window.innerHeight-50)},ae=({isEditingKey:t,canEditKey:n,pathString:r,path:o,name:a,handleKeyboard:i,handleEditKey:s,handleCancel:l,handleClick:c,keyValueArray:d,styles:u,getNextOrPrevious:p,emptyStringKey:g})=>{const{setCurrentlyEditingElement:m}=K();return t?e.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:r,defaultValue:a,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>i(e,{stringConfirm:()=>s(e.target.value),cancel:l,tabForward:()=>{if(s(e.target.value),d){const e=null==d?void 0:d[0][0];m(e?[...o,e]:p("next"))}else m(o)},tabBack:()=>{s(e.target.value),m(p("prev"))}}),style:{width:String(a).length/1.5+.5+"em"}}):e.jsxs("span",{className:"jer-key-text",style:Object.assign(Object.assign({},u),{minWidth:`${Math.min(String(a).length+1,5)}ch`,flexShrink:a.length>10?1:0}),onDoubleClick:()=>n&&m(o,"key"),onClick:c,children:[g?e.jsx("span",{className:"jer-empty-string",children:g}):a,""!==a||g?e.jsx("span",{className:"jer-key-colon",children:":"}):null]})},ie=n=>{const{data:r,parentData:o,onEdit:a,onDelete:i,onChange:s,onMove:c,enableClipboard:d,canDragOnto:u,restrictTypeSelection:p,searchFilter:g,searchText:m,showLabel:h,stringTruncate:y,showStringQuotes:b,indent:j,translate:v,customNodeDefinitions:x,customNodeData:E,handleKeyboard:C,keyboardControls:D,sort:w,editConfirmRef:O,jsonStringify:S}=n,{getStyles:N}=k(),{setCurrentlyEditingElement:T,setCollapseState:A,previouslyEditedElement:R,setPreviouslyEditedElement:P,tabDirection:M,setTabDirection:_,previousValue:F,setPreviousValue:z}=K(),[I,L]=t.useState("function"==typeof r?V:r),{pathString:B,nodeData:W,path:G,name:Y,canEdit:H,canDelete:U,canDrag:$,error:Z,onError:J,handleEditKey:X,emptyStringKey:ee,derivedValues:oe}=ne({props:n}),{dragSourceProps:ie,getDropTargetProps:de,BottomDropTarget:ue,DropTargetPadding:pe}=re({canDrag:$,canDragOnto:u,path:G,nodeData:W,onMove:c,onError:J,translate:v}),[ge,me]=t.useState(se(r,E)),he=t.useCallback((e=>{if(!s)return void L(e);const t=s({currentData:W.fullData,newValue:e,currentValue:I,name:Y,path:G});L(t)}),[s]);t.useEffect((()=>{L("function"==typeof r?V:r),me(se(r,E))}),[r,Z]);const{CustomNode:ye,customNodeProps:fe,hideKey:be,showEditTools:je=!0,showOnEdit:ve,showOnView:xe,passOriginalNode:Ee}=E,Ce=[...te,...x.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],De=t.useMemo((()=>{if("boolean"==typeof p)return p?[]:Ce;if(Array.isArray(p))return p;const e=p(W);return"boolean"==typeof e?e?[]:Ce:e}),[W,p]),[we,ke]=t.useState(((e,t)=>{var n;if("string"!=typeof e)return null;const r=t.filter((t=>t instanceof Object&&t.enum&&t.values.includes(e)&&t.matchPriority));return r.sort(((e,t)=>{var n,r;return(null!==(n=t.matchPriority)&&void 0!==n?n:0)-(null!==(r=e.matchPriority)&&void 0!==r?r:0)})),null!==(n=r[0])&&void 0!==n?n:null})(I,De)),{isEditing:Oe}=oe,Se=l("value",W,g,m);if(Oe&&(!Se||!H)){const e=f(W.fullData,G,M,w);T(e||R)}if(!Se)return null;const Ne=e=>{let t;if(T(null),z(null),void 0===e||(e=>e&&"object"==typeof e&&"type"in e&&"target"in e&&"preventDefault"in e&&"function"==typeof e.preventDefault)(e))switch(ge){case"object":t={[v("DEFAULT_NEW_KEY",W)]:I};break;case"array":t=null!=I?I:[];break;case"number":{const e=Number(I);t=isNaN(e)?0:e;break}default:t=I}else t=e;a(t,G).then((e=>{e&&J({code:"UPDATE_ERROR",message:e},t)}))},Te=()=>{T(null),null===F?(L(r),z(null)):a(F,G)},{isEditingKey:Ae,canEditKey:Re}=oe,Ke=!Oe&&Z,Pe=Oe&&De.length>1,Ve=("invalid"!==ge||ye)&&!Z&&je,Me=h&&!be,_e=ye&&(Oe&&ve||!Oe&&xe),Fe={value:I,parentData:o,setValue:he,isEditing:Oe,canEdit:H,setIsEditing:H?()=>T(G):()=>{},handleEdit:Ne,handleCancel:Te,path:G,stringTruncate:y,showStringQuotes:b,nodeData:W,enumType:we,translate:v,handleKeyboard:C,keyboardCommon:{cancel:Te,tabForward:()=>{_("next"),P(B);const e=f(W.fullData,G,"next",w);e&&(Ne(),T(e))},tabBack:()=>{_("prev"),P(B);const e=f(W.fullData,G,"prev",w);e&&(Ne(),T(e))}}},ze={canEditKey:Re,isEditingKey:Ae,pathString:B,path:G,name:Y,handleKeyboard:C,handleEditKey:X,handleCancel:Te,styles:N("property",W),getNextOrPrevious:e=>f(W.fullData,G,e,w),emptyStringKey:ee},Ie=_e?e.jsx(ye,Object.assign({},n,{value:I,customNodeProps:fe,setValue:he,handleEdit:Ne,handleCancel:Te,handleKeyPress:e=>C(e,{stringConfirm:Ne,cancel:Te}),isEditing:Oe,setIsEditing:()=>T(G),getStyles:N,originalNode:Ee?le(r,Fe):void 0,originalNodeKey:Ee?e.jsx(ae,Object.assign({},ze)):void 0,canEdit:H,keyboardCommon:Fe.keyboardCommon,onError:J})):le(r,Fe);return e.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:j/2+"em",position:"relative"},draggable:$},ie,de("above"),{children:[ue,e.jsx(pe,{position:"above",nodeData:W}),e.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:Y.length>10?"wrap":"nowrap"},children:[Me&&e.jsx(ae,Object.assign({},ze)),e.jsxs("div",{className:"jer-value-and-buttons",children:[e.jsx("div",{className:"jer-input-component",children:Ie}),Oe?e.jsx(Q,{onOk:Ne,onCancel:Te,nodeData:W,editConfirmRef:O}):Ve&&e.jsx(q,{startEdit:H?()=>{z(F),T(G,Te)}:void 0,handleDelete:U?()=>{i(I,G).then((e=>{e&&J({code:"DELETE_ERROR",message:e},I)}))}:void 0,enableClipboard:d,translate:v,customButtons:n.customButtons,nodeData:W,handleKeyboard:C,keyboardControls:D,editConfirmRef:O,jsonStringify:S}),Pe&&e.jsxs("div",{className:"jer-select jer-select-types",children:[e.jsx("select",{name:`${Y}-type-select`,className:"jer-select-inner",onChange:e=>(e=>{const t=x.find((t=>t.name===e));if(t)return a(t.defaultValue,G),me(e),ke(null),T(null),void A({path:G,collapsed:!1,includeChildren:!1});const n=De.find((t=>t instanceof Object&&t.enum===e));if(n)return"string"==typeof I&&n.values.includes(I)||a(n.values[0],G).then((e=>{e&&(J({code:"UPDATE_ERROR",message:e},r),T(null))})),void ke(n);const r=ce(I,e,v("DEFAULT_NEW_KEY",W),(null==E?void 0:E.CustomNode)?v("DEFAULT_STRING",W):void 0);a(r,G).then((e=>{e?(J({code:"UPDATE_ERROR",message:e},r),T(null)):ke(null)}))})(e.target.value),value:we?we.enum:ge,children:De.map((t=>t instanceof Object&&"enum"in t?e.jsx("option",{value:t.enum,children:t.enum},t.enum):e.jsx("option",{value:t,children:t},t)))}),e.jsx("span",{className:"focus"})]}),Ke&&e.jsx("span",{className:"jer-error-slug",style:N("error",W),children:Z})]})]}),e.jsx(pe,{position:"below",nodeData:W})]}))},se=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",le=(t,n)=>{const r=se(t),{value:o}=n;switch(r){case"string":return e.jsx(F,Object.assign({},n,{value:o}));case"number":return e.jsx(z,Object.assign({},n,{value:o}));case"boolean":return e.jsx(I,Object.assign({},n,{value:o}));case"null":return e.jsx(B,Object.assign({},n));default:return e.jsx(W,Object.assign({},n))}},ce=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},de=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:a,wrapperElement:i,customNodeProps:s,wrapperProps:l,hideKey:c=!1,showEditTools:d=!0,showOnEdit:u=!1,showOnView:p=!0,showCollectionWrapper:g=!0}=r,m=o(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:a,CustomWrapper:i,customNodeProps:s,wrapperProps:l,hideKey:c,showEditTools:d,showOnEdit:u,showOnView:p,showCollectionWrapper:g},m)},ue=n=>{const{getStyles:r}=k(),{collapseState:o,setCollapseState:c,getMatchingCollapseState:d,currentlyEditingElement:u,setCurrentlyEditingElement:p,areChildrenBeingEdited:m,previousValue:h,setPreviousValue:y}=K(),{mainContainerRef:b,data:j,nodeData:x,parentData:E,showCollectionCount:C,onEdit:D,onAdd:w,onDelete:O,canDragOnto:S,collapseFilter:N,collapseAnimationTime:T,onMove:A,enableClipboard:R,searchFilter:P,searchText:V,indent:M,sort:_,showArrayIndices:F,defaultValue:z,newKeyOptions:I,translate:L,customNodeDefinitions:B,customNodeData:W,jsonParse:G,jsonStringify:Y,TextEditor:H,keyboardControls:U,handleKeyboard:$,insertAtTop:Z,onCollapse:J,editConfirmRef:ee,collapseClickZones:te}=n,[se,le]=t.useState(Y(j)),ce=N(x),{contentRef:pe,isAnimating:ge,maxHeight:me,collapsed:he,animateCollapse:ye,cssTransitionValue:fe}=((e,n,r,o,a)=>{const[i,s]=t.useState(r?0:void 0),[l,c]=t.useState(r),d=t.useRef(!1),u=t.useRef(null),p=t.useRef(0),g=t.useRef(0),m=n/1e3+"s",h=t.useCallback((t=>{var r,i;if(l!==t){switch(window.clearTimeout(g.current),d.current=!0,t){case!0:{const e=null!==(i=null===(r=u.current)||void 0===r?void 0:r.offsetHeight)&&void 0!==i?i:0;p.current=e,s(e),setTimeout((()=>{s(0)}),5);break}case!1:s(p.current||oe(e,u,o,a))}c(!l),g.current=window.setTimeout((()=>{d.current=!1,t||s(void 0)}),n)}}),[n,l,e,o,a]);return{contentRef:u,isAnimating:d.current,animateCollapse:h,maxHeight:i,collapsed:l,cssTransitionValue:m}})(j,T,ce,b,Y),{pathString:be,nodeData:je,path:ve,name:xe,size:Ee,canEdit:Ce,canDelete:De,canAdd:we,canDrag:ke,error:Oe,setError:Se,onError:Ne,handleEditKey:Te,emptyStringKey:Ae,derivedValues:Re}=ne({props:n,collapsed:he}),{dragSourceProps:Ke,getDropTargetProps:Pe,BottomDropTarget:Ve,DropTargetPadding:Me}=re({canDrag:ke,canDragOnto:S,path:ve,nodeData:je,onMove:A,onError:Ne,translate:L}),_e=t.useRef(!ce),{isEditing:Fe,isEditingKey:ze,isArray:Ie,canEditKey:Le}=Re;t.useEffect((()=>{le(Y(j))}),[j,Y]),t.useEffect((()=>{const e=N(je)&&!Fe;_e.current=!e,ye(e)}),[N]),t.useEffect((()=>{if(null!==o){const e=d(ve);e&&(_e.current=!0,ye(e.collapsed))}}),[o]);const Be=t.useRef(null),We=t.useCallback(((e,t)=>{if("function"!=typeof z)return z;const n=z(e,t);return void 0!==n?n:null}),[z]),Ge=t.useCallback((e=>I?"function"!=typeof I?I:I(e):null),[I]),{CustomNode:Ye,customNodeProps:He,CustomWrapper:Ue,wrapperProps:$e={},hideKey:Ze,showEditTools:Je=!0,showOnEdit:Xe,showOnView:qe,showCollectionWrapper:Qe=!0}=W,et=m(be);et&&he&&ye(!1);if(!(l("collection",je,P,V)||0===je.level)&&!et)return null;const tt=Array.isArray(j)?"array":"object",nt="array"===tt?{open:"[",close:"]"}:{open:"{",close:"}"},rt=e=>{if("Tab"!==e.key||e.getModifierState("Shift"))$(e,{objectConfirm:at,cancel:st});else{e.preventDefault();const t=v(Be,"\t");le(t)}},ot=e=>{e.stopPropagation();const t=g(e);if(t&&U.collapseModifier.includes(t))return _e.current=!0,void c({collapsed:!he,path:ve,includeChildren:!0});u&&u.includes(be)||(_e.current=!0,c(null),J&&J({path:ve,collapsed:!he,includeChildren:!1}),ye(!he))},at=()=>{try{const e=G(se);if(p(null),y(null),Se(null),Y(e)===Y(j))return;D(e,ve).then((t=>{t&&Ne({code:"UPDATE_ERROR",message:t},e)}))}catch(e){Ne({code:"INVALID_JSON",message:L("ERROR_INVALID_JSON",je)},se)}},it=ve.length>0?()=>{O(j,ve).then((e=>{e&&Ne({code:"DELETE_ERROR",message:e},j)}))}:void 0,st=()=>{p(null),null===h?(Se(null),le(Y(j)),y(null)):D(h,ve)},lt="when-closed"===C?he:C,ct=!Fe&&Je,dt=(F||!Ie)&&!Ze&&void 0!==xe,ut=Ye&&(Fe&&Xe||!Fe&&qe),pt=Object.entries(j).map((([e,t])=>["array"===tt?Number(e):e,t]));"object"===tt&&_(pt,(e=>e));const gt=_e.current?Fe?e.jsxs("div",{className:"jer-collection-text-edit",children:[H?e.jsx(H,{value:se,onChange:le,onKeyDown:e=>$(e,{objectConfirm:at,cancel:st})}):e.jsx(i,{textAreaRef:Be,className:"jer-collection-text-area",name:be,value:se,setValue:le,handleKeyPress:rt,styles:r("input",je)}),e.jsx("div",{className:"jer-collection-input-button-row",children:e.jsx(Q,{onOk:at,onCancel:st,nodeData:je,editConfirmRef:ee})})]}):pt.map((([t,o],a)=>{const i={key:t,value:o,path:[...ve,t],level:ve.length+1,index:a,size:s(o)?Object.keys(o).length:null,parentData:j,fullData:je.fullData},l=de(B,i);return e.jsx("div",{className:"jer-collection-element",style:r("collectionElement",i),children:s(o)&&!(null==l?void 0:l.renderCollectionAsValue)?e.jsx(ue,Object.assign({},n,{data:o,parentData:j,nodeData:i,showCollectionCount:C,canDragOnto:Ce,customNodeData:l}),t):e.jsx(ie,Object.assign({},n,{data:o,parentData:j,nodeData:i,canDragOnto:Ce,showLabel:"object"===tt||F,customNodeData:l}),t)},t)})):null,mt=!!Qe&&(he&&!et);mt||(_e.current=!0);const ht=Object.assign(Object.assign({},n),{data:j,value:j,parentData:E,nodeData:je,setValue:e=>a(void 0,void 0,void 0,(function*(){return yield D(e,ve)})),handleEdit:at,handleCancel:st,handleKeyPress:rt,isEditing:Fe,setIsEditing:()=>p(ve),getStyles:r,canDragOnto:Ce,canEdit:Ce,keyboardCommon:{},onError:Ne}),yt=ut?e.jsx(Ye,Object.assign({customNodeProps:He},ht,{children:gt})):gt,ft=ct&&e.jsx(q,{startEdit:Ce?()=>{_e.current=!0,y(null),p(ve)}:void 0,handleAdd:we?e=>{ye(!1);const t=We(je,e);if("array"===tt){const e=Z.array?0:j.length,n=Z.array?{insert:!0}:{};w(t,[...ve,e],n).then((e=>{e&&Ne({code:"ADD_ERROR",message:e},t)}))}else if(e in j)Ne({code:"KEY_EXISTS",message:L("ERROR_KEY_EXISTS",je)},e);else{const n=Z.object?{insertBefore:0}:{};w(t,[...ve,e],n).then((e=>{e&&Ne({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:De?it:void 0,enableClipboard:R,type:tt,nodeData:je,translate:L,customButtons:n.customButtons,keyboardControls:U,handleKeyboard:$,getNewKeyOptions:Ge,editConfirmRef:ee,jsonStringify:Y}),bt={canEditKey:Le,isEditingKey:ze,pathString:be,path:ve,name:xe,handleKeyboard:$,handleEditKey:Te,handleCancel:st,keyValueArray:pt,styles:r("property",je),getNextOrPrevious:e=>f(je.fullData,ve,e,_),handleClick:te.includes("property")?ot:e=>e.stopPropagation(),emptyStringKey:Ae},jt=e.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===ve.length?0:M/2)+"em"},r("collection",je)),{position:"relative"}),draggable:ke},Ke,Pe("above"),{children:[e.jsx("div",{className:"jer-clickzone",style:{width:M/2+1+"em",zIndex:10+2*je.level},onClick:te.includes("left")?ot:void 0}),!Fe&&Ve,e.jsx(Me,{position:"above",nodeData:je}),Qe?e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:te.includes("header")?ot:void 0,children:[e.jsxs("div",{className:"jer-collection-name",children:[e.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(he?" jer-rotate-90":""),style:{zIndex:11+2*je.level,transition:fe},onClick:ot,children:e.jsx(X,{name:"chevron",rotate:he,nodeData:je})}),dt&&e.jsx(ae,Object.assign({},bt)),!Fe&&e.jsx("span",{className:"jer-brackets jer-bracket-open",style:r("bracket",je),children:nt.open})]}),!Fe&&lt&&e.jsx("div",{className:"jer-collection-item-count"+(lt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},r("itemCount",je)),{transition:fe}),children:1===Ee?L("ITEM_SINGLE",Object.assign(Object.assign({},je),{size:1}),1):L("ITEMS_MULTIPLE",je,Ee)}),e.jsx("div",{className:"jer-brackets"+(mt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},r("bracket",je)),{transition:fe}),children:nt.close}),ft]}):Ze?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[e.jsx(ae,Object.assign({},bt)),ft]}),e.jsxs("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:mt||ge?"clip":"visible",maxHeight:et?void 0:me},r("collectionInner",je)),{transition:fe}),ref:pe,children:[yt,e.jsx("div",{className:Fe?"jer-collection-error-row":"jer-collection-error-row-edit",children:Oe&&e.jsx("span",{className:"jer-error-slug",style:r("error",je),children:Oe})}),!Fe&&Qe&&e.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},r("bracket",je)),{marginLeft:(M<3?-1:M<6?-.5:0)+"em"}),children:nt.close})]}),e.jsx(Me,{position:"below",nodeData:je})]}));return Ue?e.jsx(Ue,Object.assign({customNodeProps:$e},ht,{children:jt})):jt},pe={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",KEY_SELECT:"Select key",NO_KEY_OPTIONS:"No key options",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key",SHOW_LESS:"(Show less)",EMPTY_STRING:"<empty string>"},ge=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const a=r in e?e[r]:pe[r];return void 0===o?a:null==a?void 0:a.replace("{{count}}",String(o))})(e,t,r,n,o);var me=[],he=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,a="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var i=me.indexOf(a);-1===i&&(i=me.push(a)-1,he[i]={}),n=he[i]&&he[i][r]?he[i][r]:he[i][r]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var i="prepend"===r?"afterbegin":"beforeend";return a.insertAdjacentElement(i,e),e}}(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const ye=({data:n,setData:r,rootName:o="root",onUpdate:i=()=>{},onEdit:l=i,onDelete:c=i,onAdd:d=i,onChange:u,onError:g,showErrorMessages:h=!0,enableClipboard:f=!0,indent:b=2,collapse:j=!1,collapseAnimationTime:v=300,showCollectionCount:E=!0,restrictEdit:C=!1,restrictDelete:D=!1,restrictAdd:w=!1,restrictTypeSelection:O=!1,restrictDrag:S=!0,viewOnly:N,searchFilter:T,searchText:A,searchDebounceTime:R=350,keySort:P=!1,showArrayIndices:V=!0,showStringQuotes:M=!0,defaultValue:_=null,newKeyOptions:F,minWidth:z=250,maxWidth:I="min(600px, 90vw)",rootFontSize:L,stringTruncate:B=250,translations:W={},className:G,id:Y,customText:H={},customNodeDefinitions:U=[],customButtons:$=[],jsonParse:Z=JSON.parse,jsonStringify:J=(e,t)=>JSON.stringify(e,t,2),TextEditor:X,errorMessageTimeout:q=2500,keyboardControls:Q={},externalTriggers:ee,insertAtTop:te=!1,onCollapse:ne,collapseClickZones:re=["header","left"]})=>{const{getStyles:oe}=k(),{setCurrentlyEditingElement:ae}=K(),se=t.useMemo((()=>be(j)),[j]),le=t.useMemo((()=>ge(W,H)),[W,H]),[ce,pe]=t.useState(A),[me,he]=(({setData:e,data:n})=>{const[r,o]=t.useState(e?void 0:n),a=t.useCallback((t=>{e?e(t):o(t)}),[e]);return t.useEffect((()=>{e||o(n)}),[n]),[e?n:r,a]})({setData:r,data:n}),ye=t.useRef(null);t.useEffect((()=>{ae(null);const e=setTimeout((()=>pe(A)),R);return()=>clearTimeout(e)}),[A,R]);const Ee={key:o,path:[],level:0,index:0,value:me,size:"object"==typeof me&&null!==me?Object.keys(me).length:1,parentData:null,fullData:me},Ce=(e,t)=>a(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void he(t.newData);const r=ve(n)?n:["error",n],[o,a]=r;if("error"===o)return he(t.currentData),!1===a?le("ERROR_UPDATE",Ee):String(a);he(a)})),De=t.useMemo((()=>be(C,N)),[C,N]),we=t.useMemo((()=>be(D,N)),[D,N]),ke=t.useMemo((()=>be(w,N)),[w,N]),Oe=t.useMemo((()=>be(S,N)),[S,N]),Se=t.useMemo((()=>je(T)),[T]),Ne=t.useMemo((()=>(e=>{const t=Object.assign({},y);for(const n of Object.keys(y)){const r=n;if(e[r]){const o=e[r],a=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=a,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(Q)),[Q]),Te=t.useCallback(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(m(n,e[t],t)){n.preventDefault(),o();break}})(Ne,t,e)),[Ne]),Ae=t.useMemo((()=>{const e=xe(U,"stringifyReplacer");return t=>J(t,e)}),[U,J]),Re=t.useMemo((()=>{const e=xe(U,"parseReviver");return t=>{const n=Z(t,e);return x(n)}}),[U,Z]),Ke=t.useRef(null);((e,n)=>{const{setCurrentlyEditingElement:r,currentlyEditingElement:o,setCollapseState:a}=K();t.useEffect((()=>{if(!e)return;const{collapse:t,edit:i}=e;t&&a(t);const s=!(null==i?void 0:i.path)||p(i.path)===o;switch(null==i?void 0:i.action){case"accept":s&&(n.current&&n.current.click(),r(null));break;case"cancel":s&&r(null);break;default:(null==i?void 0:i.path)&&r(i.path)}}),[e])})(ee,Ke);const Pe=t.useCallback(((e,t)=>{!1!==P&&("function"!=typeof P?e.sort(((e,n)=>{const r=t(e)[0],o=t(n)[0];return r<o?-1:r>o?1:0})):e.sort(((e,n)=>P(t(e),t(n)))))}),[P]),Ve=de(U,Ee),Me={mainContainerRef:ye,name:o,nodeData:Ee,onEdit:(e,t)=>a(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=fe(me,t,e,"update");if(o!==a)return yield Ce(l,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>a(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=fe(me,t,e,"delete");return yield Ce(c,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>a(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:a,newValue:i}=fe(me,t,e,"add",n);return yield Ce(d,{currentData:r,newData:o,currentValue:a,newValue:i,name:t.slice(-1)[0],path:t})})),onChange:u,onError:g,showErrorMessages:h,onMove:(e,t,n)=>a(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:a}=fe(me,e,"","delete"),i=e.slice(-1)[0],s=t.slice(0,-1),c=t.slice(-1)[0];let d="number"==typeof c?"above"===n?c:c+1:"number"==typeof i?`arr_${i}`:i;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof i&&"number"==typeof d&&i<d&&(d-=1);const u="number"==typeof d?{insert:!0}:"above"===n?{insertBefore:c}:{insertAfter:c},{newData:p,newValue:g}=fe(o,[...s,d],a,"add",u);return yield Ce(l,{currentData:r,newData:p,currentValue:a,newValue:g,name:t.slice(-1)[0],path:t})})),showCollectionCount:E,collapseFilter:se,collapseAnimationTime:v,restrictEditFilter:De,restrictDeleteFilter:we,restrictAddFilter:ke,restrictTypeSelection:O,restrictDragFilter:Oe,canDragOnto:!1,searchFilter:Se,searchText:ce,enableClipboard:f,keySort:P,sort:Pe,showArrayIndices:V,showStringQuotes:M,indent:b,defaultValue:_,newKeyOptions:F,stringTruncate:B,translate:le,customNodeDefinitions:U,customNodeData:Ve,customButtons:$,parentData:null,jsonParse:Re,jsonStringify:Ae,TextEditor:X,errorMessageTimeout:q,handleKeyboard:Te,keyboardControls:Ne,insertAtTop:{object:!0===te||"object"===te,array:!0===te||"array"===te},onCollapse:ne,editConfirmRef:Ke,collapseClickZones:re},_e=Object.assign(Object.assign({},oe("container",Ee)),{minWidth:z,maxWidth:I});return _e.fontSize=null!=L?L:_e.fontSize,e.jsx("div",{id:Y,ref:ye,className:`jer-editor-container ${null!=G?G:""}`,style:_e,children:s(me)&&!Ve.renderCollectionAsValue?e.jsx(ue,Object.assign({data:me},Me)):e.jsx(ie,Object.assign({data:me,showLabel:!0},Me))})},fe=(e,t,o,a,i={})=>{if(0===t.length)return{currentData:e,newData:o,currentValue:e,newValue:o};const s=Object.assign({remove:"delete"===a},i),l="add"!==a?r(e,t):void 0;return{currentData:e,newData:n(e,t,o,s),currentValue:l,newValue:"delete"!==a?o:void 0}},be=(e,t)=>t?()=>!0:"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,je=e=>{if(void 0!==e)return"value"===e?d:"key"===e?u:"all"===e?(e,t)=>d(e,t)||u(e,t):e},ve=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),xe=(e,t)=>{const n="stringifyReplacer"===t?[e=>void 0===e?E:e]:[];if(n.push(...e.map((e=>e[t])).filter((e=>!!e))),0!==n.length)return(e,t)=>{let r=t;for(const e of n)r=e(r);return r}},Ee=t=>{var n;const{value:r,setIsEditing:o,getStyles:a,nodeData:i}=t,s=a("string",i);return e.jsx("div",{onDoubleClick:()=>o(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&o(!0)},className:"jer-value-string jer-hyperlink",style:s,children:e.jsx("a",{href:r,target:"_blank",rel:"noreferrer",style:{color:null!==(n=s.color)&&void 0!==n?n:void 0},children:e.jsx(M,Object.assign({},t,{pathString:p(i.path),styles:s,value:i.value}))})})},Ce={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:Ee,showOnView:!0,showOnEdit:!1};exports.assign=n,exports.extract=r,exports.IconAdd=G,exports.IconCancel=Z,exports.IconChevron=J,exports.IconCopy=U,exports.IconDelete=H,exports.IconEdit=Y,exports.IconOk=$,exports.JsonEditor=n=>{var r;const[o,a]=t.useState();return t.useEffect((()=>{const e=document.documentElement;a(e)}),[]),o?e.jsx(w,{theme:null!==(r=n.theme)&&void 0!==r?r:C,icons:n.icons,docRoot:o,children:e.jsx(R,{onEditEvent:n.onEditEvent,onCollapse:n.onCollapse,children:e.jsx(ye,Object.assign({},n))})}):null},exports.LinkCustomComponent=Ee,exports.LinkCustomNodeDefinition=Ce,exports.StringDisplay=M,exports.StringEdit=_,exports.candyWrapperTheme={displayName:"Candy Wrapper",fragments:{minty:{backgroundColor:"#F1FAEE"},pale:{color:"#A8DADC"},mid:{color:"#457B9D"},dark:{color:"#1D3557"},pop:{color:"#E63946"},darkBlue:{color:"#2B2D42"}},styles:{container:"minty",property:"pop",dropZone:"#eb121217",bracket:"dark",itemCount:"pale",string:"mid",number:["darkBlue",{fontSize:"85%"}],boolean:["mid",{fontStyle:"italic",fontWeight:"bold",fontSize:"80%"}],null:["#cccccc",{fontWeight:"bold"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},exports.defaultTheme=C,exports.githubDarkTheme={displayName:"Github Dark",styles:{container:{backgroundColor:"#0d1117",color:"white"},dropZone:"rgba(165, 214, 255, 0.17)",property:"#E6EDF3",bracket:"#56d364",itemCount:"#8B949E",string:"#A5D6FF",number:"#D2A8FF",boolean:{color:"#FF7B72",fontSize:"90%",fontWeight:"bold"},null:"green",iconCollection:"#D2A8FF",iconEdit:"#D2A8FF",iconDelete:"rgb(203, 75, 22)",iconAdd:"rgb(203, 75, 22)",iconCopy:"#A5D6FF",iconOk:"#56d364",iconCancel:"rgb(203, 75, 22)"}},exports.githubLightTheme={displayName:"Github Light",styles:{container:"white",property:"#1F2328",bracket:"#00802e",itemCount:"#8B949E",string:"#0A3069",number:"#953800",boolean:{color:"#CF222E",fontSize:"90%",fontWeight:"bold"},null:"#FF7B72",iconCollection:"#8250DF",iconEdit:"#8250DF",iconDelete:"rgb(203, 75, 22)",iconAdd:"#8250DF",iconCopy:"#57606A"}},exports.isCollection=s,exports.matchNode=d,exports.matchNodeKey=u,exports.monoDarkTheme={displayName:"Black & White",fragments:{lightText:{color:"white"},midGrey:"#5c5c5c"},styles:{container:["lightText",{backgroundColor:"black"}],dropZone:"#e0e0e029",property:"lightText",bracket:"midGrey",itemCount:"#4a4a4a",string:"#a8a8a8",number:"#666666",boolean:{color:"#848484",fontStyle:"italic"},null:"#333333",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},exports.monoLightTheme={fragments:{midGrey:"#a3a3a3"},displayName:"White & Black",styles:{container:"white",property:"black",bracket:"midGrey",itemCount:"#b5b5b5",string:"#575757",number:"#999999",boolean:{color:"#7b7b7b",fontStyle:"italic"},null:"#cccccc",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},exports.psychedelicTheme={displayName:"Psychedelic",fragments:{pale:{color:"#A8DADC"},fluroYellow:"rgb(242, 228, 21)",fluroGreen:"rgb(68, 255, 62)",hotPink:"#f7379a"},styles:{container:{backgroundColor:"unset",background:"linear-gradient(90deg, hsla(333, 100%, 53%, 1) 0%, hsla(33, 94%, 57%, 1) 100%)",color:"black"},dropZone:"fluroYellow",property:"black",bracket:"fluroYellow",itemCount:["pale",{opacity:.7}],string:"white",number:["#33d9ff",{fontSize:"90%",fontWeight:"bold"}],boolean:["fluroGreen",{fontWeight:"bold",fontSize:"80%"}],null:["black",{fontWeight:"bold",opacity:.3,backgroundColor:"rgb(255, 255, 255, 0.5)",padding:"0 0.4em",borderRadius:"0.4em"}],iconCollection:"fluroYellow",iconEdit:["black"],iconDelete:["white",{opacity:.5}],iconAdd:["white",{opacity:.5}],iconCopy:"rgb(32, 84, 242)",iconOk:"fluroGreen",iconCancel:"hotPink"}},exports.standardDataTypes=te,exports.toPathString=p,exports.useKeyboardListener=L;
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("object-property-assigner"),r=require("object-property-extractor");function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const a=({className:t,name:n,value:r,setValue:o,handleKeyPress:i,styles:a,textAreaRef:s})=>{if("string"!=typeof r)return null;const l="\n"===r.slice(-1)?r+".":r;return e.jsxs("div",{style:{display:"grid"},children:[e.jsx("textarea",{id:`${n}_textarea`,ref:s,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},a),rows:1,className:t,name:`${n}_textarea`,value:r,onChange:e=>o(e.target.value),autoFocus:!0,onFocus:e=>{r.length<40&&e.target.select()},onKeyDown:i}),e.jsx("span",{className:t,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},a),children:l})]})},s=e=>null!==e&&"object"==typeof e,l=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!c(r,t,n))return!1}if(!n&&r&&!c(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!d(t,r))return!1}return!0},c=(e="",t,n=d)=>{const r=t.value;return Object.entries(r).some((([o,i])=>{const a=[...t.path,o],l=Object.assign(Object.assign({},t),{key:o,path:a,level:t.level+1,value:i,size:a.length,parentData:r});return s(i)?c(e,l,n):n(l,e)}))},d=(e,t="")=>{const{value:n}=e;if(null===n&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},u=({key:e,path:t},n="")=>!!d({value:e},n)||!!t.some((e=>d({value:e},n))),p=(e,t)=>(null!=t?t:"")+e.map((e=>""===e?String.fromCharCode(0):e)).join("."),g=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,m=(e,t,n)=>{const r=e.key,o=g(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:i,modifier:a}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==i||!(null==a?void 0:a.includes("Shift")))&&(r===i&&(a===o||Array.isArray(a)&&a.includes(o)))},h={key:"Enter"},y={confirm:h,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},h),{modifier:["Meta","Shift","Control"]}),objectLineBreak:h,stringConfirm:h,stringLineBreak:Object.assign(Object.assign({},h),{modifier:["Shift"]}),numberConfirm:h,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:h,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},f=(e,t,n="next",o)=>{const i=t.slice(0,t.length-1),a=t.slice(-1)[0];if(void 0===a)return null;const l=r(e,i),c=j(l);Array.isArray(l)||o(c,(({key:e,value:t})=>[e,t]));const d=c.findIndex((e=>e.key===a)),u=c[d+("next"===n?1:-1)];return u?s(u.value)?0===Object.keys(u.value).length?f(e,[...i,u.key],n,o):b(e,[...i,u.key],n,o):[...i,u.key]:0===i.length?null:f(e,i,n,o)},b=(e,t,n="next",o)=>{const i=r(e,t);if(!s(i))return t;const a=Array.isArray(i)?i.map(((e,t)=>t)):Object.keys(i);o(a,(e=>[e,i]));const l="next"===n?a[0]:a[a.length-1];return b(e,[...t,l],n,o)},j=e=>Array.isArray(e)?e.map(((e,t)=>({index:t,value:e,key:t}))):Object.entries(e).map((([e,t],n)=>({key:e,value:t,index:n}))),v=(e,t)=>{var n,r,o,i;const a=e.current,s=null!==(n=null==a?void 0:a.selectionStart)&&void 0!==n?n:1/0,l=null!==(r=null==a?void 0:a.selectionEnd)&&void 0!==r?r:1/0,c=(null===(o=null==a?void 0:a.textContent)||void 0===o?void 0:o.slice(0,s))+t+(null===(i=null==a?void 0:a.textContent)||void 0===i?void 0:i.slice(l));return a.value=c,null==a||a.setSelectionRange(s+1,s+1),c},E=e=>{if(e!==x){if(Array.isArray(e))return e.map((e=>E(e)));if(e&&"object"==typeof e)for(const t in e)e[t]=E(e[t]);return e}},x="__​undefined__",C={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},D=t.createContext({getStyles:()=>({}),icons:{}}),w=({theme:t=C,icons:n={},docRoot:r,children:o})=>{const i=O(t,r);return e.jsx(D.Provider,{value:{getStyles:(e,t)=>"function"==typeof i[e]?i[e](t):i[e],icons:n},children:o})},k=()=>t.useContext(D),O=(e,t)=>{var n,r,o,i;const a={},s=(Array.isArray(e)?e:[e]).map((e=>N(e)?S({fragments:{},styles:e},a):S(e,a))),l=S(C,{});Object.keys(l).forEach((e=>{const t=e;s.forEach((e=>{e[t]&&(l[t]=Object.assign(Object.assign({},l[t]),e[t]))}))}));const c=Object.assign({},l);return Object.entries(a).forEach((([e,t])=>{const n=e;c[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},l[n]),r)}})),"function"!=typeof(null==c?void 0:c.inputHighlight)&&(null===(n=null==c?void 0:c.inputHighlight)||void 0===n?void 0:n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",null===(r=null==c?void 0:c.inputHighlight)||void 0===r?void 0:r.backgroundColor),"function"!=typeof(null==c?void 0:c.iconCopy)&&(null===(o=null==c?void 0:c.iconCopy)||void 0===o?void 0:o.color)&&t.style.setProperty("--jer-icon-copy-color",null===(i=null==c?void 0:c.iconCopy)||void 0===i?void 0:i.color),c},S=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const i=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var i,a;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(i=null==n?void 0:n[o])&&void 0!==i?i:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(a=T[e])&&void 0!==a?a:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=i})),o},N=e=>!("styles"in e),T={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},A=t.createContext(null),R=({children:n,onEditEvent:r,onCollapse:o})=>{const[i,a]=t.useState(null),[s,l]=t.useState(null),[c,d]=t.useState(null),[u,g]=t.useState({path:null,pathString:null}),m=t.useRef(null),h=t.useRef("next"),y=t.useRef(null);return e.jsx(A.Provider,{value:{collapseState:i,setCollapseState:e=>{a(e),o&&null!==e&&(Array.isArray(e)?e.forEach((e=>o(e))):o(e)),null!==e&&setTimeout((()=>a(null)),2e3)},getMatchingCollapseState:e=>{if(Array.isArray(i)){for(const t of i)if(K(e,t))return t;return null}return K(e,i)?i:null},currentlyEditingElement:s,setCurrentlyEditingElement:(e,t)=>{const n="string"==typeof e||null===e?e:p(e,"key"===t?"key_":void 0);null!==s&&null!==n&&null!==m.current&&m.current(),l(n),r&&(Array.isArray(e)||null===e)&&r(e,"key"===t),m.current="function"==typeof t?t:null},areChildrenBeingEdited:e=>null!==s&&s.includes(e),previouslyEditedElement:y.current,setPreviouslyEditedElement:e=>{y.current=e},tabDirection:h.current,setTabDirection:e=>{h.current=e},previousValue:c,setPreviousValue:d,dragSource:u,setDragSource:g},children:n})},P=()=>{const e=t.useContext(A);if(!e)throw new Error("Missing Context Provider");return e},K=(e,t)=>{if(null===t)return!1;if(!t.includeChildren)return t.path.every(((t,n)=>e[n]===t))&&t.path.length===e.length;for(const[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},I="**INVALID_FUNCTION**",V=({nodeData:n,showStringQuotes:r=!0,stringTruncate:o=200,pathString:i,canEdit:a,setIsEditing:s,styles:l,translate:c,value:d,TextWrapper:u=({children:e})=>e})=>{const p=null!=d?d:n.value,[g,m]=t.useState(!1),h=r?'"':"",y=p.length>o,f=()=>{a?s(!0):m(!g)};return e.jsxs("div",{id:`${i}_display`,onDoubleClick:f,onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&f()},className:"jer-value-string",style:l,children:[h,y?g?e.jsxs(e.Fragment,{children:[e.jsx(u,{children:e.jsxs("span",{children:[p,h]})}),e.jsxs("span",{className:"jer-string-expansion jer-show-less",onClick:()=>m(!1),children:[" ",c("SHOW_LESS",n)]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx("span",{children:p.slice(0,o-2).trimEnd()})," "]}),e.jsx("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>m(!0),children:"..."}),h]}):e.jsx(u,{children:`${p}${h}`})]})},M=({styles:n,pathString:r,value:o,setValue:i,handleEdit:s,handleKeyboard:l,keyboardCommon:c})=>{const d=t.useRef(null);return e.jsx(a,{className:"jer-input-text",textAreaRef:d,name:r,value:o,setValue:i,handleKeyPress:e=>{l(e,Object.assign({stringConfirm:s,stringLineBreak:()=>{const e=v(d,"\n");i(e)}},c))},styles:n})},_=t=>{var{isEditing:n,path:r,enumType:i}=t,a=o(t,["isEditing","path","enumType"]);const{getStyles:s}=k(),l=p(r),{value:c,setValue:d,nodeData:u,handleEdit:g,handleKeyboard:m,keyboardCommon:h}=a;return n&&i?e.jsxs("div",{className:"jer-select jer-select-enums",children:[e.jsx("select",{name:`${l}-value-select`,className:"jer-select-inner",onChange:e=>d(e.target.value),value:c,autoFocus:!0,onKeyDown:e=>{m(e,Object.assign({stringConfirm:g},h))},children:i.values.map((t=>e.jsx("option",{value:t,children:t},t)))}),e.jsx("span",{className:"focus"})]}):n?e.jsx(M,Object.assign({styles:s("input",u),pathString:l},a,{setValue:a.setValue})):e.jsx(V,Object.assign({pathString:l,styles:s("string",u)},a))},L=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:a,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:d}=k();return r?e.jsx("input",{className:"jer-input-number",type:"text",name:p(o),value:t,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>setTimeout((()=>e.target.select()),10),onKeyDown:e=>l(e,Object.assign({numberConfirm:a,numberUp:()=>n(Number(t)+1),numberDown:()=>n(Number(t)-1)},c)),style:Object.assign({width:String(t).length/1.5+2+"em"},d("input",s))}):e.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:d("number",s),children:t})},F=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:a,nodeData:s,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:d}=k();return"boolean"!=typeof t?null:r?e.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:p(o),checked:t,onChange:()=>n(!t),onKeyDown:e=>{" "===e.key&&e.preventDefault(),l(e,Object.assign({booleanConfirm:a,booleanToggle:()=>n(!t)},c))},autoFocus:!0}):e.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:d("boolean",s),children:String(t)})},z=(e,n)=>{const r=t.useRef(void 0),o=t.useRef(n);t.useEffect((()=>{o.current=n}),[n]);const i=e=>{o.current(e)};t.useEffect((()=>{if(window.clearTimeout(r.current),e)return r.current=window.setTimeout((()=>{window.addEventListener("keydown",i)}),100),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",i)}}),[e])},B=({value:t,isEditing:n,setIsEditing:r,handleEdit:o,nodeData:i,handleKeyboard:a,keyboardCommon:s})=>{const{getStyles:l}=k();return z(n,(e=>a(e,Object.assign({confirm:o},s)))),e.jsx("div",{onDoubleClick:()=>r(!0),className:"jer-value-null",style:l("null",i),children:String(t)})},W=({value:t})=>{let n="Error!";switch(typeof t){case"string":t===I&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return e.jsx("span",{className:"jer-value-invalid",children:n})},G=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),e.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),Y=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,transform:"translate(0, 0.5)",children:[e.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),e.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),H=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),U=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),e.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),e.jsx("path",{d:"M15 10l-4 4 4 4"})]}),$=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),e.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),Z=({size:t,style:n,className:r})=>e.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),J=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),X=({name:t,nodeData:n})=>{var r,o,i,a,s,l,c;const{getStyles:d,icons:u}=k(),p={size:"1.4em",className:"jer-icon"};switch(t){case"add":return null!==(r=null==u?void 0:u.add)&&void 0!==r?r:e.jsx(G,Object.assign({},p,{style:d("iconAdd",n)}));case"edit":return null!==(o=null==u?void 0:u.edit)&&void 0!==o?o:e.jsx(Y,Object.assign({},p,{style:d("iconEdit",n)}));case"delete":return null!==(i=null==u?void 0:u.delete)&&void 0!==i?i:e.jsx(H,Object.assign({},p,{style:d("iconDelete",n),size:"1.45em"}));case"copy":return null!==(a=null==u?void 0:u.copy)&&void 0!==a?a:e.jsx(U,Object.assign({},p,{style:d("iconCopy",n),size:"1.2em"}));case"ok":return null!==(s=null==u?void 0:u.ok)&&void 0!==s?s:e.jsx($,Object.assign({},p,{style:Object.assign({fontSize:"90%"},d("iconOk",n))}));case"cancel":return null!==(l=null==u?void 0:u.cancel)&&void 0!==l?l:e.jsx(Z,Object.assign({},p,{style:Object.assign({fontSize:"130%"},d("iconCancel",n))}));case"chevron":return null!==(c=null==u?void 0:u.chevron)&&void 0!==c?c:e.jsx(J,{size:"1em",style:d("iconCollection",n)});default:return e.jsx(e.Fragment,{})}},q=({startEdit:n,handleDelete:o,handleAdd:i,enableClipboard:a,type:s,customButtons:l,nodeData:c,translate:d,keyboardControls:u,handleKeyboard:p,editConfirmRef:m,getNewKeyOptions:h,jsonStringify:y,onEditEvent:f,showIconTooltips:b})=>{const{getStyles:j}=k(),v=d("KEY_NEW",c),[E,x]=t.useState(v),[C,D]=t.useState(!1),{key:w,path:O,value:S}=c,N=Array.isArray(C),T=e=>{var t;if(f&&f(e?[...O,null]:null,e),!e)return void D(!1);const n=Object.keys(r(c.fullData,O)),o=h?null===(t=h(c))||void 0===t?void 0:t.filter((e=>!n.includes(e))):null;o&&x(""),D(null==o||o)};return e.jsxs("div",{className:"jer-edit-buttons",style:{opacity:C?1:void 0},onClick:e=>e.stopPropagation(),children:[a&&e.jsx("div",{onClick:e=>{var t;e.stopPropagation();let n,r,o="value",i="",s=null;if(a){const l=g(e);if(l&&u.clipboardModifier.includes(l)?(n=ee(O),i=n,o="path"):(n=S,i="object"==typeof n?y(S):String(n)),!navigator.clipboard)return void("function"==typeof a&&a({success:!1,value:n,stringValue:i,path:O,key:w,type:o,errorMessage:"Can't access clipboard API"}));null===(t=navigator.clipboard)||void 0===t||t.writeText(i).then((()=>r=!0)).catch((e=>{r=!1,s=e.message})).finally((()=>{"function"==typeof a&&a({success:r,errorMessage:s,value:n,stringValue:i,path:O,key:w,type:o})}))}},className:"jer-copy-pulse",title:b?d("TOOLTIP_COPY",c):"",children:e.jsx(X,{name:"copy",nodeData:c})}),n&&e.jsx("div",{onClick:n,title:b?d("TOOLTIP_EDIT",c):"",children:e.jsx(X,{name:"edit",nodeData:c})}),o&&e.jsx("div",{onClick:o,title:b?d("TOOLTIP_DELETE",c):"",children:e.jsx(X,{name:"delete",nodeData:c})}),i&&e.jsx("div",{onClick:()=>{"object"===s?T(!0):i("")},title:b?d("TOOLTIP_ADD",c):"",children:e.jsx(X,{name:"add",nodeData:c})}),null==l?void 0:l.map((({Element:t,onClick:n},r)=>e.jsx("div",{onClick:e=>n&&n(c,e),children:e.jsx(t,{nodeData:c})},r))),C&&i&&"object"===s&&e.jsxs(e.Fragment,{children:[N?e.jsxs("div",{className:"jer-select jer-select-keys",children:[e.jsxs("select",{name:"new-key-select",className:"jer-select-inner",onChange:e=>{i(e.target.value),T(!1)},defaultValue:"",autoFocus:!0,onKeyDown:e=>{p(e,{cancel:()=>T(!1)})},children:[e.jsx("option",{value:"",disabled:!0,children:C.length>0?d("KEY_SELECT",c):d("NO_KEY_OPTIONS",c)}),C.map((t=>e.jsx("option",{value:t,children:t},t)))]}),e.jsx("span",{className:"focus"})]}):e.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:E,onChange:e=>x(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{p(e,{stringConfirm:()=>{i&&(T(!1),i(E),x(v))},cancel:()=>{T(!1),x(v)}})},style:j("input",c)}),e.jsx(Q,{onOk:()=>{N&&!E||(T(!1),i(E))},onCancel:()=>{T(!1)},nodeData:c,editConfirmRef:m,hideOk:N})]})]})},Q=({onOk:t,onCancel:n,nodeData:r,editConfirmRef:o,hideOk:i=!1})=>e.jsxs("div",{className:"jer-confirm-buttons",children:[!i&&e.jsx("div",{onClick:t,ref:o,children:e.jsx(X,{name:"ok",nodeData:r})}),e.jsx("div",{onClick:n,children:e.jsx(X,{name:"cancel",nodeData:r})})]}),ee=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),te=["string","number","boolean","null","object","array"],ne=({props:e,collapsed:n})=>{const{data:r,nodeData:o,parentData:i,onEdit:a,onError:s,showErrorMessages:l,restrictEditFilter:c,restrictDeleteFilter:d,restrictAddFilter:u,restrictDragFilter:g,translate:m,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:f}=P(),[b,j]=t.useState(null),v=Object.assign(Object.assign({},o),{collapsed:n}),{path:E,key:x,size:C}=v,D=p(E),w=!c(v),k=!d(v),O=!u(v),S=!g(v)&&k&&null===y,N=e=>{l&&(j(e),setTimeout((()=>j(null)),h)),console.warn("Error",e)},T=t.useCallback(((e,t)=>{N(e.message),s&&s({currentData:v.fullData,errorValue:t,currentValue:r,name:x,path:E,error:e})}),[s,l]),A=y===D,R=y===`key_${D}`,K="number"==typeof E.slice(-1)[0],I={isEditing:A,isEditingKey:R,isArray:K,canEditKey:null!==i&&w&&O&&k&&!K},V=""===x&&E.length>0?m("EMPTY_STRING",v):null;return{pathString:D,nodeData:v,path:E,name:x,size:C,canEdit:w,canDelete:k,canAdd:O,canDrag:S,error:b,showError:N,onError:T,setError:j,handleEditKey:e=>{if(f(null),x===e)return;if(!i)return;const t=E.slice(0,-1);if(Object.keys(i).includes(e))return void T({code:"KEY_EXISTS",message:m("ERROR_KEY_EXISTS",v)},e);const n=Object.fromEntries(Object.entries(i).map((([t,n])=>t===x?[e,n]:[t,n])));a(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:I,emptyStringKey:V}},re=({canDrag:n,canDragOnto:r,path:o,nodeData:i,onMove:a,onError:s,translate:l})=>{const{getStyles:c}=k(),{dragSource:d,setDragSource:u}=P(),[g,m]=t.useState(!1),h=p(o),y=t.useMemo((()=>n?{onDragStart:e=>{e.stopPropagation(),u({path:o,pathString:h})},onDragEnd:e=>{e.stopPropagation(),u({path:null,pathString:null})}}:{}),[n,h]),f=t.useMemo((()=>e=>r?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),j(e),u({path:null,pathString:null}),m(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=d.pathString)&&void 0!==n?n:"")||m(e)},onDragExit:e=>{e.stopPropagation(),m(!1)}}:{}),[d,r,h]),b=t.useMemo((()=>r&&null!==d.pathString?e.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:o.length}},f("below"))):null),[d,r,o.length]),j=e=>{var t,n;const r=null===(t=d.path)||void 0===t?void 0:t.slice(-1)[0],c=null===(n=d.path)||void 0===n?void 0:n.slice(0,-1).join("."),u=o.slice(0,-1).join(""),{parentData:p}=i;"string"==typeof r&&p&&!Array.isArray(p)&&Object.keys(p).includes(r)&&r in p&&c!==u?s({code:"KEY_EXISTS",message:l("ERROR_KEY_EXISTS",i)},r):a(d.path,o,e).then((e=>{e&&s({code:"UPDATE_ERROR",message:e},i.value)}))};return{dragSourceProps:y,getDropTargetProps:f,BottomDropTarget:b,DropTargetPadding:({position:t,nodeData:n})=>g===t?e.jsx("div",{className:"jer-drag-n-drop-padding",style:c("dropZone",n)}):null,handleDrop:j}},oe=(e,t,n,r)=>{var o,i,a;if(!t.current)return 0;const s=parseInt(null!==(o=getComputedStyle(n.current).getPropertyValue("line-height"))&&void 0!==o?o:"16px"),l=(null!==(a=null===(i=t.current)||void 0===i?void 0:i.offsetWidth)&&void 0!==a?a:0)/(.5*s),c=r(e).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/l))).reduce(((e,t)=>e+t),0)*s;return Math.min(c+30,window.innerHeight-50)},ie=({isEditingKey:t,canEditKey:n,pathString:r,path:o,name:i,handleKeyboard:a,handleEditKey:s,handleCancel:l,handleClick:c,keyValueArray:d,styles:u,getNextOrPrevious:p,emptyStringKey:g})=>{const{setCurrentlyEditingElement:m}=P();return t?e.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:r,defaultValue:i,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>a(e,{stringConfirm:()=>s(e.target.value),cancel:l,tabForward:()=>{if(s(e.target.value),d){const e=null==d?void 0:d[0][0];m(e?[...o,e]:p("next"))}else m(o)},tabBack:()=>{s(e.target.value),m(p("prev"))}}),style:{width:String(i).length/1.5+.5+"em"}}):e.jsxs("span",{className:"jer-key-text",style:Object.assign(Object.assign({},u),{minWidth:`${Math.min(String(i).length+1,5)}ch`,flexShrink:i.length>10?1:0}),onDoubleClick:()=>n&&m(o,"key"),onClick:c,children:[g?e.jsx("span",{className:"jer-empty-string",children:g}):i,""!==i||g?e.jsx("span",{className:"jer-key-colon",children:":"}):null]})},ae=n=>{const{data:r,parentData:o,onEdit:i,onDelete:a,onChange:s,onMove:c,enableClipboard:d,canDragOnto:u,restrictTypeSelection:p,searchFilter:g,searchText:m,showLabel:h,stringTruncate:y,showStringQuotes:b,indent:j,translate:v,customNodeDefinitions:E,customNodeData:x,handleKeyboard:C,keyboardControls:D,sort:w,editConfirmRef:O,jsonStringify:S,showIconTooltips:N}=n,{getStyles:T}=k(),{setCurrentlyEditingElement:A,setCollapseState:R,previouslyEditedElement:K,setPreviouslyEditedElement:V,tabDirection:M,setTabDirection:_,previousValue:L,setPreviousValue:F}=P(),[z,B]=t.useState("function"==typeof r?I:r),{pathString:W,nodeData:G,path:Y,name:H,canEdit:U,canDelete:$,canDrag:Z,error:J,onError:X,handleEditKey:ee,emptyStringKey:oe,derivedValues:ae}=ne({props:n}),{dragSourceProps:de,getDropTargetProps:ue,BottomDropTarget:pe,DropTargetPadding:ge}=re({canDrag:Z,canDragOnto:u,path:Y,nodeData:G,onMove:c,onError:X,translate:v}),[me,he]=t.useState(se(r,x)),ye=t.useCallback((e=>{if(!s)return void B(e);const t=s({currentData:G.fullData,newValue:e,currentValue:z,name:H,path:Y});B(t)}),[s]);t.useEffect((()=>{B("function"==typeof r?I:r),he(se(r,x))}),[r,J]);const{CustomNode:fe,customNodeProps:be,hideKey:je,showEditTools:ve=!0,showOnEdit:Ee,showOnView:xe,passOriginalNode:Ce}=x,De=[...te,...E.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],we=t.useMemo((()=>{if("boolean"==typeof p)return p?[]:De;if(Array.isArray(p))return p;const e=p(G);return"boolean"==typeof e?e?[]:De:e}),[G,p]),[ke,Oe]=t.useState(((e,t)=>{var n;if("string"!=typeof e)return null;const r=t.filter((t=>t instanceof Object&&t.enum&&t.values.includes(e)&&t.matchPriority));return r.sort(((e,t)=>{var n,r;return(null!==(n=t.matchPriority)&&void 0!==n?n:0)-(null!==(r=e.matchPriority)&&void 0!==r?r:0)})),null!==(n=r[0])&&void 0!==n?n:null})(z,we)),{isEditing:Se}=ae,Ne=l("value",G,g,m);if(Se&&(!Ne||!U)){const e=f(G.fullData,Y,M,w);A(e||K)}if(!Ne)return null;const Te=e=>{let t;if(A(null),F(null),void 0===e||(e=>e&&"object"==typeof e&&"type"in e&&"target"in e&&"preventDefault"in e&&"function"==typeof e.preventDefault)(e))switch(me){case"object":t={[v("DEFAULT_NEW_KEY",G)]:z};break;case"array":t=null!=z?z:[];break;case"number":{const e=Number(z);t=isNaN(e)?0:e;break}default:t=z}else t=e;i(t,Y).then((e=>{e&&X({code:"UPDATE_ERROR",message:e},t)}))},Ae=()=>{A(null),null===L?(B(r),F(null)):i(L,Y)},{isEditingKey:Re,canEditKey:Pe}=ae,Ke=!Se&&J,Ie=Se&&we.length>1,Ve=("invalid"!==me||fe)&&!J&&ve,Me=h&&!je,_e=fe&&(Se&&Ee||!Se&&xe),Le={value:z,parentData:o,setValue:ye,isEditing:Se,canEdit:U,setIsEditing:U?()=>A(Y):()=>{},handleEdit:Te,handleCancel:Ae,path:Y,stringTruncate:y,showStringQuotes:b,nodeData:G,enumType:ke,translate:v,handleKeyboard:C,keyboardCommon:{cancel:Ae,tabForward:()=>{_("next"),V(W);const e=f(G.fullData,Y,"next",w);e&&(Te(),A(e))},tabBack:()=>{_("prev"),V(W);const e=f(G.fullData,Y,"prev",w);e&&(Te(),A(e))}}},Fe={canEditKey:Pe,isEditingKey:Re,pathString:W,path:Y,name:H,handleKeyboard:C,handleEditKey:ee,handleCancel:Ae,styles:T("property",G),getNextOrPrevious:e=>f(G.fullData,Y,e,w),emptyStringKey:oe},ze=_e?e.jsx(fe,Object.assign({},n,{value:z,customNodeProps:be,setValue:ye,handleEdit:Te,handleCancel:Ae,handleKeyPress:e=>C(e,{stringConfirm:Te,cancel:Ae}),isEditing:Se,setIsEditing:()=>A(Y),getStyles:T,originalNode:Ce?le(r,Le):void 0,originalNodeKey:Ce?e.jsx(ie,Object.assign({},Fe)):void 0,canEdit:U,keyboardCommon:Le.keyboardCommon,onError:X})):le(r,Le);return e.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:j/2+"em",position:"relative"},draggable:Z},de,ue("above"),{children:[pe,e.jsx(ge,{position:"above",nodeData:G}),e.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:H.length>10?"wrap":"nowrap"},children:[Me&&e.jsx(ie,Object.assign({},Fe)),e.jsxs("div",{className:"jer-value-and-buttons",children:[e.jsx("div",{className:"jer-input-component",children:ze}),Se?e.jsx(Q,{onOk:Te,onCancel:Ae,nodeData:G,editConfirmRef:O}):Ve&&e.jsx(q,{startEdit:U?()=>{F(L),A(Y,Ae)}:void 0,handleDelete:$?()=>{a(z,Y).then((e=>{e&&X({code:"DELETE_ERROR",message:e},z)}))}:void 0,enableClipboard:d,translate:v,customButtons:n.customButtons,nodeData:G,handleKeyboard:C,keyboardControls:D,editConfirmRef:O,jsonStringify:S,showIconTooltips:N}),Ie&&e.jsxs("div",{className:"jer-select jer-select-types",children:[e.jsx("select",{name:`${H}-type-select`,className:"jer-select-inner",onChange:e=>(e=>{const t=E.find((t=>t.name===e));if(t)return i(t.defaultValue,Y),he(e),Oe(null),A(null),void R({path:Y,collapsed:!1,includeChildren:!1});const n=we.find((t=>t instanceof Object&&t.enum===e));if(n)return"string"==typeof z&&n.values.includes(z)||i(n.values[0],Y).then((e=>{e&&(X({code:"UPDATE_ERROR",message:e},r),A(null))})),void Oe(n);const r=ce(z,e,v("DEFAULT_NEW_KEY",G),(null==x?void 0:x.CustomNode)?v("DEFAULT_STRING",G):void 0);i(r,Y).then((e=>{e?(X({code:"UPDATE_ERROR",message:e},r),A(null)):Oe(null)}))})(e.target.value),value:ke?ke.enum:me,children:we.map((t=>t instanceof Object&&"enum"in t?e.jsx("option",{value:t.enum,children:t.enum},t.enum):e.jsx("option",{value:t,children:t},t)))}),e.jsx("span",{className:"focus"})]}),Ke&&e.jsx("span",{className:"jer-error-slug",style:T("error",G),children:J})]})]}),e.jsx(ge,{position:"below",nodeData:G})]}))},se=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",le=(t,n)=>{const r=se(t),{value:o}=n;switch(r){case"string":return e.jsx(_,Object.assign({},n,{value:o}));case"number":return e.jsx(L,Object.assign({},n,{value:o}));case"boolean":return e.jsx(F,Object.assign({},n,{value:o}));case"null":return e.jsx(B,Object.assign({},n));default:return e.jsx(W,Object.assign({},n))}},ce=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},de=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:i,wrapperElement:a,customNodeProps:s,wrapperProps:l,hideKey:c=!1,showEditTools:d=!0,showOnEdit:u=!1,showOnView:p=!0,showCollectionWrapper:g=!0}=r,m=o(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:a,customNodeProps:s,wrapperProps:l,hideKey:c,showEditTools:d,showOnEdit:u,showOnView:p,showCollectionWrapper:g},m)},ue=n=>{const{getStyles:r}=k(),{collapseState:o,setCollapseState:c,getMatchingCollapseState:d,currentlyEditingElement:u,setCurrentlyEditingElement:p,areChildrenBeingEdited:m,previousValue:h,setPreviousValue:y}=P(),{mainContainerRef:b,data:j,nodeData:E,parentData:x,showCollectionCount:C,onEdit:D,onAdd:w,onDelete:O,canDragOnto:S,collapseFilter:N,collapseAnimationTime:T,onMove:A,enableClipboard:R,onEditEvent:K,showIconTooltips:I,searchFilter:V,searchText:M,indent:_,sort:L,showArrayIndices:F,defaultValue:z,newKeyOptions:B,translate:W,customNodeDefinitions:G,customNodeData:Y,jsonParse:H,jsonStringify:U,TextEditor:$,keyboardControls:Z,handleKeyboard:J,insertAtTop:ee,onCollapse:te,editConfirmRef:se,collapseClickZones:le}=n,[ce,pe]=t.useState(U(j)),ge=N(E),{contentRef:me,isAnimating:he,maxHeight:ye,collapsed:fe,animateCollapse:be,cssTransitionValue:je}=((e,n,r,o,i)=>{const[a,s]=t.useState(r?0:void 0),[l,c]=t.useState(r),d=t.useRef(!1),u=t.useRef(null),p=t.useRef(0),g=t.useRef(0),m=n/1e3+"s",h=t.useCallback((t=>{var r,a;if(l!==t){switch(window.clearTimeout(g.current),d.current=!0,t){case!0:{const e=null!==(a=null===(r=u.current)||void 0===r?void 0:r.offsetHeight)&&void 0!==a?a:0;p.current=e,s(e),setTimeout((()=>{s(0)}),5);break}case!1:s(p.current||oe(e,u,o,i))}c(!l),g.current=window.setTimeout((()=>{d.current=!1,t||s(void 0)}),n)}}),[n,l,e,o,i]);return{contentRef:u,isAnimating:d.current,animateCollapse:h,maxHeight:a,collapsed:l,cssTransitionValue:m}})(j,T,ge,b,U),{pathString:ve,nodeData:Ee,path:xe,name:Ce,size:De,canEdit:we,canDelete:ke,canAdd:Oe,canDrag:Se,error:Ne,setError:Te,onError:Ae,handleEditKey:Re,emptyStringKey:Pe,derivedValues:Ke}=ne({props:n,collapsed:fe}),{dragSourceProps:Ie,getDropTargetProps:Ve,BottomDropTarget:Me,DropTargetPadding:_e}=re({canDrag:Se,canDragOnto:S,path:xe,nodeData:Ee,onMove:A,onError:Ae,translate:W}),Le=t.useRef(!ge),{isEditing:Fe,isEditingKey:ze,isArray:Be,canEditKey:We}=Ke;t.useEffect((()=>{pe(U(j))}),[j,U]),t.useEffect((()=>{const e=N(Ee)&&!Fe;Le.current=!e,be(e)}),[N]),t.useEffect((()=>{if(null!==o){const e=d(xe);e&&(Le.current=!0,be(e.collapsed))}}),[o]);const Ge=t.useRef(null),Ye=t.useCallback(((e,t)=>{if("function"!=typeof z)return z;const n=z(e,t);return void 0!==n?n:null}),[z]),He=t.useCallback((e=>B?"function"!=typeof B?B:B(e):null),[B]),{CustomNode:Ue,customNodeProps:$e,CustomWrapper:Ze,wrapperProps:Je={},hideKey:Xe,showEditTools:qe=!0,showOnEdit:Qe,showOnView:et,showCollectionWrapper:tt=!0}=Y,nt=m(ve);nt&&fe&&be(!1);if(!(l("collection",Ee,V,M)||0===Ee.level)&&!nt)return null;const rt=Array.isArray(j)?"array":"object",ot="array"===rt?{open:"[",close:"]"}:{open:"{",close:"}"},it=e=>{if("Tab"!==e.key||e.getModifierState("Shift"))J(e,{objectConfirm:st,cancel:ct});else{e.preventDefault();const t=v(Ge,"\t");pe(t)}},at=e=>{e.stopPropagation();const t=g(e);if(t&&Z.collapseModifier.includes(t))return Le.current=!0,void c({collapsed:!fe,path:xe,includeChildren:!0});u&&u.includes(ve)||(Le.current=!0,c(null),te&&te({path:xe,collapsed:!fe,includeChildren:!1}),be(!fe))},st=()=>{try{const e=H(ce);if(p(null),y(null),Te(null),U(e)===U(j))return;D(e,xe).then((t=>{t&&Ae({code:"UPDATE_ERROR",message:t},e)}))}catch(e){Ae({code:"INVALID_JSON",message:W("ERROR_INVALID_JSON",Ee)},ce)}},lt=xe.length>0?()=>{O(j,xe).then((e=>{e&&Ae({code:"DELETE_ERROR",message:e},j)}))}:void 0,ct=()=>{p(null),null===h?(Te(null),pe(U(j)),y(null)):D(h,xe)},dt="when-closed"===C?fe:C,ut=!Fe&&qe,pt=(F||!Be)&&!Xe&&void 0!==Ce,gt=Ue&&(Fe&&Qe||!Fe&&et),mt=Object.entries(j).map((([e,t])=>["array"===rt?Number(e):e,t]));"object"===rt&&L(mt,(e=>e));const ht=Le.current?Fe?e.jsxs("div",{className:"jer-collection-text-edit",children:[$?e.jsx($,{value:ce,onChange:pe,onKeyDown:e=>J(e,{objectConfirm:st,cancel:ct})}):e.jsx(a,{textAreaRef:Ge,className:"jer-collection-text-area",name:ve,value:ce,setValue:pe,handleKeyPress:it,styles:r("input",Ee)}),e.jsx("div",{className:"jer-collection-input-button-row",children:e.jsx(Q,{onOk:st,onCancel:ct,nodeData:Ee,editConfirmRef:se})})]}):mt.map((([t,o],i)=>{const a={key:t,value:o,path:[...xe,t],level:xe.length+1,index:i,size:s(o)?Object.keys(o).length:null,parentData:j,fullData:Ee.fullData},l=de(G,a);return e.jsx("div",{className:"jer-collection-element",style:r("collectionElement",a),children:s(o)&&!(null==l?void 0:l.renderCollectionAsValue)?e.jsx(ue,Object.assign({},n,{data:o,parentData:j,nodeData:a,showCollectionCount:C,canDragOnto:we,customNodeData:l}),t):e.jsx(ae,Object.assign({},n,{data:o,parentData:j,nodeData:a,canDragOnto:we,showLabel:"object"===rt||F,customNodeData:l}),t)},t)})):null,yt=!!tt&&(fe&&!nt);yt||(Le.current=!0);const ft=Object.assign(Object.assign({},n),{data:j,value:j,parentData:x,nodeData:Ee,setValue:e=>i(void 0,void 0,void 0,(function*(){return yield D(e,xe)})),handleEdit:st,handleCancel:ct,handleKeyPress:it,isEditing:Fe,setIsEditing:()=>p(xe),getStyles:r,canDragOnto:we,canEdit:we,keyboardCommon:{},onError:Ae}),bt=gt?e.jsx(Ue,Object.assign({customNodeProps:$e},ft,{children:ht})):ht,jt=ut&&e.jsx(q,{startEdit:we?()=>{Le.current=!0,y(null),p(xe)}:void 0,handleAdd:Oe?e=>{be(!1);const t=Ye(Ee,e);if("array"===rt){const e=ee.array?0:j.length,n=ee.array?{insert:!0}:{};w(t,[...xe,e],n).then((e=>{e&&Ae({code:"ADD_ERROR",message:e},t)}))}else if(e in j)Ae({code:"KEY_EXISTS",message:W("ERROR_KEY_EXISTS",Ee)},e);else{const n=ee.object?{insertBefore:0}:{};w(t,[...xe,e],n).then((e=>{e&&Ae({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:ke?lt:void 0,enableClipboard:R,type:rt,nodeData:Ee,translate:W,customButtons:n.customButtons,keyboardControls:Z,handleKeyboard:J,getNewKeyOptions:He,editConfirmRef:se,jsonStringify:U,onEditEvent:K,showIconTooltips:I}),vt={canEditKey:We,isEditingKey:ze,pathString:ve,path:xe,name:Ce,handleKeyboard:J,handleEditKey:Re,handleCancel:ct,keyValueArray:mt,styles:r("property",Ee),getNextOrPrevious:e=>f(Ee.fullData,xe,e,L),handleClick:le.includes("property")?at:e=>e.stopPropagation(),emptyStringKey:Pe},Et=e.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===xe.length?0:_/2)+"em"},r("collection",Ee)),{position:"relative"}),draggable:Se},Ie,Ve("above"),{children:[e.jsx("div",{className:"jer-clickzone",style:{width:_/2+1+"em",zIndex:10+2*Ee.level},onClick:le.includes("left")?at:void 0}),!Fe&&Me,e.jsx(_e,{position:"above",nodeData:Ee}),tt?e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:le.includes("header")?at:void 0,children:[e.jsxs("div",{className:"jer-collection-name",children:[e.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(fe?" jer-rotate-90":""),style:{zIndex:11+2*Ee.level,transition:je},onClick:at,children:e.jsx(X,{name:"chevron",rotate:fe,nodeData:Ee})}),pt&&e.jsx(ie,Object.assign({},vt)),!Fe&&e.jsx("span",{className:"jer-brackets jer-bracket-open",style:r("bracket",Ee),children:ot.open})]}),!Fe&&dt&&e.jsx("div",{className:"jer-collection-item-count"+(dt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},r("itemCount",Ee)),{transition:je}),children:1===De?W("ITEM_SINGLE",Object.assign(Object.assign({},Ee),{size:1}),1):W("ITEMS_MULTIPLE",Ee,De)}),e.jsx("div",{className:"jer-brackets"+(yt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},r("bracket",Ee)),{transition:je}),children:ot.close}),jt]}):Xe?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[e.jsx(ie,Object.assign({},vt)),jt]}),e.jsxs("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:yt||he?"clip":"visible",maxHeight:nt?void 0:ye},r("collectionInner",Ee)),{transition:je}),ref:me,children:[bt,e.jsx("div",{className:Fe?"jer-collection-error-row":"jer-collection-error-row-edit",children:Ne&&e.jsx("span",{className:"jer-error-slug",style:r("error",Ee),children:Ne})}),!Fe&&tt&&e.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},r("bracket",Ee)),{marginLeft:(_<3?-1:_<6?-.5:0)+"em"}),children:ot.close})]}),e.jsx(_e,{position:"below",nodeData:Ee})]}));return Ze?e.jsx(Ze,Object.assign({customNodeProps:Je},ft,{children:Et})):Et},pe={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",KEY_SELECT:"Select key",NO_KEY_OPTIONS:"No key options",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key",SHOW_LESS:"(Show less)",EMPTY_STRING:"<empty string>",TOOLTIP_COPY:"Copy to clipboard",TOOLTIP_EDIT:"Edit",TOOLTIP_DELETE:"Delete",TOOLTIP_ADD:"Add"},ge=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const i=r in e?e[r]:pe[r];return void 0===o?i:null==i?void 0:i.replace("{{count}}",String(o))})(e,t,r,n,o);var me=[],he=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=me.indexOf(i);-1===a&&(a=me.push(i)-1,he[a]={}),n=he[a]&&he[a][r]?he[a][r]:he[a][r]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var a="prepend"===r?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const ye=({data:n,setData:r,rootName:o="root",onUpdate:a=()=>{},onEdit:l=a,onDelete:c=a,onAdd:d=a,onChange:u,onError:g,onEditEvent:h,showErrorMessages:f=!0,enableClipboard:b=!0,indent:j=2,collapse:v=!1,collapseAnimationTime:x=300,showCollectionCount:C=!0,restrictEdit:D=!1,restrictDelete:w=!1,restrictAdd:O=!1,restrictTypeSelection:S=!1,restrictDrag:N=!0,viewOnly:T,searchFilter:A,searchText:R,searchDebounceTime:K=350,keySort:I=!1,showArrayIndices:V=!0,showStringQuotes:M=!0,showIconTooltips:_=!1,defaultValue:L=null,newKeyOptions:F,minWidth:z=250,maxWidth:B="min(600px, 90vw)",rootFontSize:W,stringTruncate:G=250,translations:Y={},className:H,id:U,customText:$={},customNodeDefinitions:Z=[],customButtons:J=[],jsonParse:X=JSON.parse,jsonStringify:q=(e,t)=>JSON.stringify(e,t,2),TextEditor:Q,errorMessageTimeout:ee=2500,keyboardControls:te={},externalTriggers:ne,insertAtTop:re=!1,onCollapse:oe,collapseClickZones:ie=["header","left"]})=>{const{getStyles:se}=k(),{setCurrentlyEditingElement:le}=P(),ce=t.useMemo((()=>be(v)),[v]),pe=t.useMemo((()=>ge(Y,$)),[Y,$]),[me,he]=t.useState(R),[ye,xe]=(({setData:e,data:n})=>{const[r,o]=t.useState(e?void 0:n),i=t.useCallback((t=>{e?e(t):o(t)}),[e]);return t.useEffect((()=>{e||o(n)}),[n]),[e?n:r,i]})({setData:r,data:n}),Ce=t.useRef(null);t.useEffect((()=>{le(null);const e=setTimeout((()=>he(R)),K);return()=>clearTimeout(e)}),[R,K]);const De={key:o,path:[],level:0,index:0,value:ye,size:"object"==typeof ye&&null!==ye?Object.keys(ye).length:1,parentData:null,fullData:ye},we=(e,t)=>i(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void xe(t.newData);const r=ve(n)?n:["error",n],[o,i]=r;if("error"===o)return xe(t.currentData),!1===i?pe("ERROR_UPDATE",De):String(i);xe(i)})),ke=t.useMemo((()=>be(D,T)),[D,T]),Oe=t.useMemo((()=>be(w,T)),[w,T]),Se=t.useMemo((()=>be(O,T)),[O,T]),Ne=t.useMemo((()=>be(N,T)),[N,T]),Te=t.useMemo((()=>je(A)),[A]),Ae=t.useMemo((()=>(e=>{const t=Object.assign({},y);for(const n of Object.keys(y)){const r=n;if(e[r]){const o=e[r],i=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=i,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(te)),[te]),Re=t.useCallback(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(m(n,e[t],t)){n.preventDefault(),o();break}})(Ae,t,e)),[Ae]),Pe=t.useMemo((()=>{const e=Ee(Z,"stringifyReplacer");return t=>q(t,e)}),[Z,q]),Ke=t.useMemo((()=>{const e=Ee(Z,"parseReviver");return t=>{const n=X(t,e);return E(n)}}),[Z,X]),Ie=t.useRef(null);((e,n)=>{const{setCurrentlyEditingElement:r,currentlyEditingElement:o,setCollapseState:i}=P();t.useEffect((()=>{if(!e)return;const{collapse:t,edit:a}=e;t&&i(t);const s=!(null==a?void 0:a.path)||p(a.path)===o;switch(null==a?void 0:a.action){case"accept":s&&(n.current&&n.current.click(),r(null));break;case"cancel":s&&r(null);break;default:(null==a?void 0:a.path)&&r(a.path)}}),[e])})(ne,Ie);const Ve=t.useCallback(((e,t)=>{!1!==I&&("function"!=typeof I?e.sort(((e,n)=>{const r=t(e)[0],o=t(n)[0];return r<o?-1:r>o?1:0})):e.sort(((e,n)=>I(t(e),t(n)))))}),[I]),Me=de(Z,De),_e={mainContainerRef:Ce,name:o,nodeData:De,onEdit:(e,t)=>i(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:i}=fe(ye,t,e,"update");if(o!==i)return yield we(l,{currentData:n,newData:r,currentValue:o,newValue:i,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>i(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:i}=fe(ye,t,e,"delete");return yield we(c,{currentData:n,newData:r,currentValue:o,newValue:i,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>i(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:i,newValue:a}=fe(ye,t,e,"add",n);return yield we(d,{currentData:r,newData:o,currentValue:i,newValue:a,name:t.slice(-1)[0],path:t})})),onChange:u,onError:g,onEditEvent:h,showErrorMessages:f,onMove:(e,t,n)=>i(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:i}=fe(ye,e,"","delete"),a=e.slice(-1)[0],s=t.slice(0,-1),c=t.slice(-1)[0];let d="number"==typeof c?"above"===n?c:c+1:"number"==typeof a?`arr_${a}`:a;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof a&&"number"==typeof d&&a<d&&(d-=1);const u="number"==typeof d?{insert:!0}:"above"===n?{insertBefore:c}:{insertAfter:c},{newData:p,newValue:g}=fe(o,[...s,d],i,"add",u);return yield we(l,{currentData:r,newData:p,currentValue:i,newValue:g,name:t.slice(-1)[0],path:t})})),showCollectionCount:C,collapseFilter:ce,collapseAnimationTime:x,restrictEditFilter:ke,restrictDeleteFilter:Oe,restrictAddFilter:Se,restrictTypeSelection:S,restrictDragFilter:Ne,canDragOnto:!1,searchFilter:Te,searchText:me,enableClipboard:b,keySort:I,sort:Ve,showArrayIndices:V,showStringQuotes:M,showIconTooltips:_,indent:j,defaultValue:L,newKeyOptions:F,stringTruncate:G,translate:pe,customNodeDefinitions:Z,customNodeData:Me,customButtons:J,parentData:null,jsonParse:Ke,jsonStringify:Pe,TextEditor:Q,errorMessageTimeout:ee,handleKeyboard:Re,keyboardControls:Ae,insertAtTop:{object:!0===re||"object"===re,array:!0===re||"array"===re},onCollapse:oe,editConfirmRef:Ie,collapseClickZones:ie},Le=Object.assign(Object.assign({},se("container",De)),{minWidth:z,maxWidth:B});return Le.fontSize=null!=W?W:Le.fontSize,e.jsx("div",{id:U,ref:Ce,className:`jer-editor-container ${null!=H?H:""}`,style:Le,children:s(ye)&&!Me.renderCollectionAsValue?e.jsx(ue,Object.assign({data:ye},_e)):e.jsx(ae,Object.assign({data:ye,showLabel:!0},_e))})},fe=(e,t,o,i,a={})=>{if(0===t.length)return{currentData:e,newData:o,currentValue:e,newValue:o};const s=Object.assign({remove:"delete"===i},a),l="add"!==i?r(e,t):void 0;return{currentData:e,newData:n(e,t,o,s),currentValue:l,newValue:"delete"!==i?o:void 0}},be=(e,t)=>t?()=>!0:"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,je=e=>{if(void 0!==e)return"value"===e?d:"key"===e?u:"all"===e?(e,t)=>d(e,t)||u(e,t):e},ve=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),Ee=(e,t)=>{const n="stringifyReplacer"===t?[e=>void 0===e?x:e]:[];if(n.push(...e.map((e=>e[t])).filter((e=>!!e))),0!==n.length)return(e,t)=>{let r=t;for(const e of n)r=e(r);return r}},xe=t=>{var n;const{value:r,setIsEditing:o,getStyles:i,nodeData:a}=t,s=i("string",a);return e.jsx("div",{onDoubleClick:()=>o(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&o(!0)},className:"jer-value-string jer-hyperlink",style:s,children:e.jsx("a",{href:r,target:"_blank",rel:"noreferrer",style:{color:null!==(n=s.color)&&void 0!==n?n:void 0},children:e.jsx(V,Object.assign({},t,{pathString:p(a.path),styles:s,value:a.value}))})})},Ce={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:xe,showOnView:!0,showOnEdit:!1};exports.assign=n,exports.extract=r,exports.IconAdd=G,exports.IconCancel=Z,exports.IconChevron=J,exports.IconCopy=U,exports.IconDelete=H,exports.IconEdit=Y,exports.IconOk=$,exports.JsonEditor=n=>{var r;const[o,i]=t.useState();return t.useEffect((()=>{const e=document.documentElement;i(e)}),[]),o?e.jsx(w,{theme:null!==(r=n.theme)&&void 0!==r?r:C,icons:n.icons,docRoot:o,children:e.jsx(R,{onEditEvent:n.onEditEvent,onCollapse:n.onCollapse,children:e.jsx(ye,Object.assign({},n))})}):null},exports.LinkCustomComponent=xe,exports.LinkCustomNodeDefinition=Ce,exports.StringDisplay=V,exports.StringEdit=M,exports.candyWrapperTheme={displayName:"Candy Wrapper",fragments:{minty:{backgroundColor:"#F1FAEE"},pale:{color:"#A8DADC"},mid:{color:"#457B9D"},dark:{color:"#1D3557"},pop:{color:"#E63946"},darkBlue:{color:"#2B2D42"}},styles:{container:"minty",property:"pop",dropZone:"#eb121217",bracket:"dark",itemCount:"pale",string:"mid",number:["darkBlue",{fontSize:"85%"}],boolean:["mid",{fontStyle:"italic",fontWeight:"bold",fontSize:"80%"}],null:["#cccccc",{fontWeight:"bold"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},exports.defaultTheme=C,exports.githubDarkTheme={displayName:"Github Dark",styles:{container:{backgroundColor:"#0d1117",color:"white"},dropZone:"rgba(165, 214, 255, 0.17)",property:"#E6EDF3",bracket:"#56d364",itemCount:"#8B949E",string:"#A5D6FF",number:"#D2A8FF",boolean:{color:"#FF7B72",fontSize:"90%",fontWeight:"bold"},null:"green",iconCollection:"#D2A8FF",iconEdit:"#D2A8FF",iconDelete:"rgb(203, 75, 22)",iconAdd:"rgb(203, 75, 22)",iconCopy:"#A5D6FF",iconOk:"#56d364",iconCancel:"rgb(203, 75, 22)"}},exports.githubLightTheme={displayName:"Github Light",styles:{container:"white",property:"#1F2328",bracket:"#00802e",itemCount:"#8B949E",string:"#0A3069",number:"#953800",boolean:{color:"#CF222E",fontSize:"90%",fontWeight:"bold"},null:"#FF7B72",iconCollection:"#8250DF",iconEdit:"#8250DF",iconDelete:"rgb(203, 75, 22)",iconAdd:"#8250DF",iconCopy:"#57606A"}},exports.isCollection=s,exports.matchNode=d,exports.matchNodeKey=u,exports.monoDarkTheme={displayName:"Black & White",fragments:{lightText:{color:"white"},midGrey:"#5c5c5c"},styles:{container:["lightText",{backgroundColor:"black"}],dropZone:"#e0e0e029",property:"lightText",bracket:"midGrey",itemCount:"#4a4a4a",string:"#a8a8a8",number:"#666666",boolean:{color:"#848484",fontStyle:"italic"},null:"#333333",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},exports.monoLightTheme={fragments:{midGrey:"#a3a3a3"},displayName:"White & Black",styles:{container:"white",property:"black",bracket:"midGrey",itemCount:"#b5b5b5",string:"#575757",number:"#999999",boolean:{color:"#7b7b7b",fontStyle:"italic"},null:"#cccccc",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},exports.psychedelicTheme={displayName:"Psychedelic",fragments:{pale:{color:"#A8DADC"},fluroYellow:"rgb(242, 228, 21)",fluroGreen:"rgb(68, 255, 62)",hotPink:"#f7379a"},styles:{container:{backgroundColor:"unset",background:"linear-gradient(90deg, hsla(333, 100%, 53%, 1) 0%, hsla(33, 94%, 57%, 1) 100%)",color:"black"},dropZone:"fluroYellow",property:"black",bracket:"fluroYellow",itemCount:["pale",{opacity:.7}],string:"white",number:["#33d9ff",{fontSize:"90%",fontWeight:"bold"}],boolean:["fluroGreen",{fontWeight:"bold",fontSize:"80%"}],null:["black",{fontWeight:"bold",opacity:.3,backgroundColor:"rgb(255, 255, 255, 0.5)",padding:"0 0.4em",borderRadius:"0.4em"}],iconCollection:"fluroYellow",iconEdit:["black"],iconDelete:["white",{opacity:.5}],iconAdd:["white",{opacity:.5}],iconCopy:"rgb(32, 84, 242)",iconOk:"fluroGreen",iconCancel:"hotPink"}},exports.standardDataTypes=te,exports.toPathString=p,exports.useKeyboardListener=z;

@@ -21,2 +21,6 @@ import React$1, { JSX } from 'react';

EMPTY_STRING: string;
TOOLTIP_COPY: string;
TOOLTIP_EDIT: string;
TOOLTIP_DELETE: string;
TOOLTIP_ADD: string;
};

@@ -85,2 +89,3 @@ type LocalisedStrings = typeof localisedStrings;

showStringQuotes?: boolean;
showIconTooltips?: boolean;
defaultValue?: string | number | boolean | null | object | DefaultValueFunction;

@@ -179,3 +184,3 @@ newKeyOptions?: string[] | NewKeyOptionsFunction;

type SortFunction = <T>(arr: T[], nodeMap: (input: T) => [string | number, unknown]) => void;
type OnEditEventFunction = (path: CollectionKey[] | string | null, isKey: boolean) => void;
type OnEditEventFunction = (path: (CollectionKey | null)[] | null, isKey: boolean) => void;
interface CollapseState {

@@ -236,4 +241,6 @@ path: CollectionKey[];

showErrorMessages: boolean;
showIconTooltips: boolean;
onMove: InternalMoveFunction;
enableClipboard: boolean | CopyFunction;
onEditEvent?: OnEditEventFunction;
restrictEditFilter: FilterFunction;

@@ -240,0 +247,0 @@ restrictDeleteFilter: FilterFunction;

@@ -1,1 +0,1 @@

import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{createContext as r,useContext as o,useState as i,useRef as a,useEffect as l,useCallback as s,useMemo as c}from"react";import d from"object-property-assigner";export{default as assign}from"object-property-assigner";import u from"object-property-extractor";export{default as extract}from"object-property-extractor";function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function g(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const m=({className:n,name:r,value:o,setValue:i,handleKeyPress:a,styles:l,textAreaRef:s})=>{if("string"!=typeof o)return null;const c="\n"===o.slice(-1)?o+".":o;return e("div",{style:{display:"grid"},children:[t("textarea",{id:`${r}_textarea`,ref:s,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},l),rows:1,className:n,name:`${r}_textarea`,value:o,onChange:e=>i(e.target.value),autoFocus:!0,onFocus:e=>{o.length<40&&e.target.select()},onKeyDown:a}),t("span",{className:n,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},l),children:c})]})},h=e=>null!==e&&"object"==typeof e,y=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!f(r,t,n))return!1}if(!n&&r&&!f(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!b(t,r))return!1}return!0},f=(e="",t,n=b)=>{const r=t.value;return Object.entries(r).some((([o,i])=>{const a=[...t.path,o],l=Object.assign(Object.assign({},t),{key:o,path:a,level:t.level+1,value:i,size:a.length,parentData:r});return h(i)?f(e,l,n):n(l,e)}))},b=(e,t="")=>{const{value:n}=e;if(null===n&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},v=({key:e,path:t},n="")=>!!b({value:e},n)||!!t.some((e=>b({value:e},n))),j=(e,t)=>(null!=t?t:"")+e.map((e=>""===e?String.fromCharCode(0):e)).join("."),E=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,w=(e,t,n)=>{const r=e.key,o=E(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:i,modifier:a}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==i||!(null==a?void 0:a.includes("Shift")))&&(r===i&&(a===o||Array.isArray(a)&&a.includes(o)))},D={key:"Enter"},C={confirm:D,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},D),{modifier:["Meta","Shift","Control"]}),objectLineBreak:D,stringConfirm:D,stringLineBreak:Object.assign(Object.assign({},D),{modifier:["Shift"]}),numberConfirm:D,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:D,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},k=(e,t,n="next",r)=>{const o=t.slice(0,t.length-1),i=t.slice(-1)[0];if(void 0===i)return null;const a=u(e,o),l=S(a);Array.isArray(a)||r(l,(({key:e,value:t})=>[e,t]));const s=l.findIndex((e=>e.key===i)),c=l[s+("next"===n?1:-1)];return c?h(c.value)?0===Object.keys(c.value).length?k(e,[...o,c.key],n,r):O(e,[...o,c.key],n,r):[...o,c.key]:0===o.length?null:k(e,o,n,r)},O=(e,t,n="next",r)=>{const o=u(e,t);if(!h(o))return t;const i=Array.isArray(o)?o.map(((e,t)=>t)):Object.keys(o);r(i,(e=>[e,o]));const a="next"===n?i[0]:i[i.length-1];return O(e,[...t,a],n,r)},S=e=>Array.isArray(e)?e.map(((e,t)=>({index:t,value:e,key:t}))):Object.entries(e).map((([e,t],n)=>({key:e,value:t,index:n}))),N=(e,t)=>{var n,r,o,i;const a=e.current,l=null!==(n=null==a?void 0:a.selectionStart)&&void 0!==n?n:1/0,s=null!==(r=null==a?void 0:a.selectionEnd)&&void 0!==r?r:1/0,c=(null===(o=null==a?void 0:a.textContent)||void 0===o?void 0:o.slice(0,l))+t+(null===(i=null==a?void 0:a.textContent)||void 0===i?void 0:i.slice(s));return a.value=c,null==a||a.setSelectionRange(l+1,l+1),c},x=e=>{if(e!==A){if(Array.isArray(e))return e.map((e=>x(e)));if(e&&"object"==typeof e)for(const t in e)e[t]=x(e[t]);return e}},A="__​undefined__",T={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},R=r({getStyles:()=>({}),icons:{}}),K=({theme:e=T,icons:n={},docRoot:r,children:o})=>{const i=V(e,r);return t(R.Provider,{value:{getStyles:(e,t)=>"function"==typeof i[e]?i[e](t):i[e],icons:n},children:o})},P=()=>o(R),V=(e,t)=>{var n,r,o,i;const a={},l=(Array.isArray(e)?e:[e]).map((e=>z(e)?_({fragments:{},styles:e},a):_(e,a))),s=_(T,{});Object.keys(s).forEach((e=>{const t=e;l.forEach((e=>{e[t]&&(s[t]=Object.assign(Object.assign({},s[t]),e[t]))}))}));const c=Object.assign({},s);return Object.entries(a).forEach((([e,t])=>{const n=e;c[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},s[n]),r)}})),"function"!=typeof(null==c?void 0:c.inputHighlight)&&(null===(n=null==c?void 0:c.inputHighlight)||void 0===n?void 0:n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",null===(r=null==c?void 0:c.inputHighlight)||void 0===r?void 0:r.backgroundColor),"function"!=typeof(null==c?void 0:c.iconCopy)&&(null===(o=null==c?void 0:c.iconCopy)||void 0===o?void 0:o.color)&&t.style.setProperty("--jer-icon-copy-color",null===(i=null==c?void 0:c.iconCopy)||void 0===i?void 0:i.color),c},_=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const i=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var i,a;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(i=null==n?void 0:n[o])&&void 0!==i?i:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(a=M[e])&&void 0!==a?a:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=i})),o},z=e=>!("styles"in e),M={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},F=r(null),I=({children:e,onEditEvent:n,onCollapse:r})=>{const[o,l]=i(null),[s,c]=i(null),[d,u]=i(null),[p,g]=i({path:null,pathString:null}),m=a(null),h=a("next"),y=a(null);return t(F.Provider,{value:{collapseState:o,setCollapseState:e=>{l(e),r&&null!==e&&(Array.isArray(e)?e.forEach((e=>r(e))):r(e)),null!==e&&setTimeout((()=>l(null)),2e3)},getMatchingCollapseState:e=>{if(Array.isArray(o)){for(const t of o)if(B(e,t))return t;return null}return B(e,o)?o:null},currentlyEditingElement:s,setCurrentlyEditingElement:(e,t)=>{const r="string"==typeof e||null===e?e:j(e,"key"===t?"key_":void 0);null!==s&&null!==r&&null!==m.current&&m.current(),c(r),n&&n(e,"key"===t),m.current="function"==typeof t?t:null},areChildrenBeingEdited:e=>null!==s&&s.includes(e),previouslyEditedElement:y.current,setPreviouslyEditedElement:e=>{y.current=e},tabDirection:h.current,setTabDirection:e=>{h.current=e},previousValue:d,setPreviousValue:u,dragSource:p,setDragSource:g},children:e})},L=()=>{const e=o(F);if(!e)throw new Error("Missing Context Provider");return e},B=(e,t)=>{if(null===t)return!1;if(!t.includeChildren)return t.path.every(((t,n)=>e[n]===t))&&t.path.length===e.length;for(const[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},W="**INVALID_FUNCTION**",G=({nodeData:r,showStringQuotes:o=!0,stringTruncate:a=200,pathString:l,canEdit:s,setIsEditing:c,styles:d,translate:u,value:p,TextWrapper:g=({children:e})=>e})=>{const m=null!=p?p:r.value,[h,y]=i(!1),f=o?'"':"",b=m.length>a,v=()=>{s?c(!0):y(!h)};return e("div",{id:`${l}_display`,onDoubleClick:v,onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&v()},className:"jer-value-string",style:d,children:[f,b?e(n,h?{children:[t(g,{children:e("span",{children:[m,f]})}),e("span",{className:"jer-string-expansion jer-show-less",onClick:()=>y(!1),children:[" ",u("SHOW_LESS",r)]})]}:{children:[e(g,{children:[t("span",{children:m.slice(0,a-2).trimEnd()})," "]}),t("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>y(!0),children:"..."}),f]}):t(g,{children:`${m}${f}`})]})},Y=({styles:e,pathString:n,value:r,setValue:o,handleEdit:i,handleKeyboard:l,keyboardCommon:s})=>{const c=a(null);return t(m,{className:"jer-input-text",textAreaRef:c,name:n,value:r,setValue:o,handleKeyPress:e=>{l(e,Object.assign({stringConfirm:i,stringLineBreak:()=>{const e=N(c,"\n");o(e)}},s))},styles:e})},H=n=>{var{isEditing:r,path:o,enumType:i}=n,a=p(n,["isEditing","path","enumType"]);const{getStyles:l}=P(),s=j(o),{value:c,setValue:d,nodeData:u,handleEdit:g,handleKeyboard:m,keyboardCommon:h}=a;return r&&i?e("div",{className:"jer-select jer-select-enums",children:[t("select",{name:`${s}-value-select`,className:"jer-select-inner",onChange:e=>d(e.target.value),value:c,autoFocus:!0,onKeyDown:e=>{m(e,Object.assign({stringConfirm:g},h))},children:i.values.map((e=>t("option",{value:e,children:e},e)))}),t("span",{className:"focus"})]}):r?t(Y,Object.assign({styles:l("input",u),pathString:s},a,{setValue:a.setValue})):t(G,Object.assign({pathString:s,styles:l("string",u)},a))},U=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:a,nodeData:l,handleKeyboard:s,keyboardCommon:c})=>{const{getStyles:d}=P();return r?t("input",{className:"jer-input-number",type:"text",name:j(o),value:e,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>setTimeout((()=>e.target.select()),10),onKeyDown:t=>s(t,Object.assign({numberConfirm:a,numberUp:()=>n(Number(e)+1),numberDown:()=>n(Number(e)-1)},c)),style:Object.assign({width:String(e).length/1.5+2+"em"},d("input",l))}):t("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:d("number",l),children:e})},$=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:a,nodeData:l,handleKeyboard:s,keyboardCommon:c})=>{const{getStyles:d}=P();return"boolean"!=typeof e?null:r?t("input",{className:"jer-input-boolean",type:"checkbox",name:j(o),checked:e,onChange:()=>n(!e),onKeyDown:t=>{" "===t.key&&t.preventDefault(),s(t,Object.assign({booleanConfirm:a,booleanToggle:()=>n(!e)},c))},autoFocus:!0}):t("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:d("boolean",l),children:String(e)})},Z=(e,t)=>{const n=a(void 0),r=a(t);l((()=>{r.current=t}),[t]);const o=e=>{r.current(e)};l((()=>{if(window.clearTimeout(n.current),e)return n.current=window.setTimeout((()=>{window.addEventListener("keydown",o)}),100),()=>{window.clearTimeout(n.current),window.removeEventListener("keydown",o)}}),[e])},X=({value:e,isEditing:n,setIsEditing:r,handleEdit:o,nodeData:i,handleKeyboard:a,keyboardCommon:l})=>{const{getStyles:s}=P();return Z(n,(e=>a(e,Object.assign({confirm:o},l)))),t("div",{onDoubleClick:()=>r(!0),className:"jer-value-null",style:s("null",i),children:String(e)})},J=({value:e})=>{let n="Error!";switch(typeof e){case"string":e===W&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return t("span",{className:"jer-value-invalid",children:n})},Q=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,children:[t("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),t("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),q=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,transform:"translate(0, 0.5)",children:[t("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),t("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),ee=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),te=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),t("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),t("path",{d:"M15 10l-4 4 4 4"})]}),ne=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),t("path",{d:"M22 4L12 14.01l-3-3"})]}),re=({size:e,style:n,className:r})=>t("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),oe=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),ie=({name:e,nodeData:r})=>{var o,i,a,l,s,c,d;const{getStyles:u,icons:p}=P(),g={size:"1.4em",className:"jer-icon"};switch(e){case"add":return null!==(o=null==p?void 0:p.add)&&void 0!==o?o:t(Q,Object.assign({},g,{style:u("iconAdd",r)}));case"edit":return null!==(i=null==p?void 0:p.edit)&&void 0!==i?i:t(q,Object.assign({},g,{style:u("iconEdit",r)}));case"delete":return null!==(a=null==p?void 0:p.delete)&&void 0!==a?a:t(ee,Object.assign({},g,{style:u("iconDelete",r),size:"1.45em"}));case"copy":return null!==(l=null==p?void 0:p.copy)&&void 0!==l?l:t(te,Object.assign({},g,{style:u("iconCopy",r),size:"1.2em"}));case"ok":return null!==(s=null==p?void 0:p.ok)&&void 0!==s?s:t(ne,Object.assign({},g,{style:Object.assign({fontSize:"90%"},u("iconOk",r))}));case"cancel":return null!==(c=null==p?void 0:p.cancel)&&void 0!==c?c:t(re,Object.assign({},g,{style:Object.assign({fontSize:"130%"},u("iconCancel",r))}));case"chevron":return null!==(d=null==p?void 0:p.chevron)&&void 0!==d?d:t(oe,{size:"1em",style:u("iconCollection",r)});default:return t(n,{})}},ae=({startEdit:r,handleDelete:o,handleAdd:a,enableClipboard:l,type:s,customButtons:c,nodeData:d,translate:p,keyboardControls:g,handleKeyboard:m,editConfirmRef:h,getNewKeyOptions:y,jsonStringify:f})=>{const{getStyles:b}=P(),v=p("KEY_NEW",d),[j,w]=i(v),[D,C]=i(!1),{key:k,path:O,value:S}=d,N=Array.isArray(D),x=e=>{var t;if(!e)return void C(!1);const n=Object.keys(u(d.fullData,O)),r=y?null===(t=y(d))||void 0===t?void 0:t.filter((e=>!n.includes(e))):null;r&&w(""),C(null==r||r)};return e("div",{className:"jer-edit-buttons",style:{opacity:D?1:void 0},onClick:e=>e.stopPropagation(),children:[l&&t("div",{onClick:e=>{var t;e.stopPropagation();let n,r,o="value",i="",a=null;if(l){const s=E(e);if(s&&g.clipboardModifier.includes(s)?(n=se(O),i=n,o="path"):(n=S,i="object"==typeof n?f(S):String(n)),!navigator.clipboard)return void("function"==typeof l&&l({success:!1,value:n,stringValue:i,path:O,key:k,type:o,errorMessage:"Can't access clipboard API"}));null===(t=navigator.clipboard)||void 0===t||t.writeText(i).then((()=>r=!0)).catch((e=>{r=!1,a=e.message})).finally((()=>{"function"==typeof l&&l({success:r,errorMessage:a,value:n,stringValue:i,path:O,key:k,type:o})}))}},className:"jer-copy-pulse",children:t(ie,{name:"copy",nodeData:d})}),r&&t("div",{onClick:r,children:t(ie,{name:"edit",nodeData:d})}),o&&t("div",{onClick:o,children:t(ie,{name:"delete",nodeData:d})}),a&&t("div",{onClick:()=>{"object"===s?x(!0):a("")},children:t(ie,{name:"add",nodeData:d})}),null==c?void 0:c.map((({Element:e,onClick:n},r)=>t("div",{onClick:e=>n&&n(d,e),children:t(e,{nodeData:d})},r))),D&&a&&"object"===s&&e(n,{children:[N?e("div",{className:"jer-select jer-select-keys",children:[e("select",{name:"new-key-select",className:"jer-select-inner",onChange:e=>{a(e.target.value),x(!1)},defaultValue:"",autoFocus:!0,onKeyDown:e=>{m(e,{cancel:()=>x(!1)})},children:[t("option",{value:"",disabled:!0,children:D.length>0?p("KEY_SELECT",d):p("NO_KEY_OPTIONS",d)}),D.map((e=>t("option",{value:e,children:e},e)))]}),t("span",{className:"focus"})]}):t("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:j,onChange:e=>w(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{m(e,{stringConfirm:()=>{a&&(x(!1),a(j),w(v))},cancel:()=>{x(!1),w(v)}})},style:b("input",d)}),t(le,{onOk:()=>{N&&!j||(x(!1),a(j))},onCancel:()=>{x(!1)},nodeData:d,editConfirmRef:h,hideOk:N})]})]})},le=({onOk:n,onCancel:r,nodeData:o,editConfirmRef:i,hideOk:a=!1})=>e("div",{className:"jer-confirm-buttons",children:[!a&&t("div",{onClick:n,ref:i,children:t(ie,{name:"ok",nodeData:o})}),t("div",{onClick:r,children:t(ie,{name:"cancel",nodeData:o})})]}),se=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),ce=["string","number","boolean","null","object","array"],de=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:o,onEdit:a,onError:l,showErrorMessages:c,restrictEditFilter:d,restrictDeleteFilter:u,restrictAddFilter:p,restrictDragFilter:g,translate:m,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:f}=L(),[b,v]=i(null),E=Object.assign(Object.assign({},r),{collapsed:t}),{path:w,key:D,size:C}=E,k=j(w),O=!d(E),S=!u(E),N=!p(E),x=!g(E)&&S&&null===y,A=e=>{c&&(v(e),setTimeout((()=>v(null)),h)),console.warn("Error",e)},T=s(((e,t)=>{A(e.message),l&&l({currentData:E.fullData,errorValue:t,currentValue:n,name:D,path:w,error:e})}),[l,c]),R=y===k,K=y===`key_${k}`,P="number"==typeof w.slice(-1)[0],V={isEditing:R,isEditingKey:K,isArray:P,canEditKey:null!==o&&O&&N&&S&&!P},_=""===D&&w.length>0?m("EMPTY_STRING",E):null;return{pathString:k,nodeData:E,path:w,name:D,size:C,canEdit:O,canDelete:S,canAdd:N,canDrag:x,error:b,showError:A,onError:T,setError:v,handleEditKey:e=>{if(f(null),D===e)return;if(!o)return;const t=w.slice(0,-1);if(Object.keys(o).includes(e))return void T({code:"KEY_EXISTS",message:m("ERROR_KEY_EXISTS",E)},e);const n=Object.fromEntries(Object.entries(o).map((([t,n])=>t===D?[e,n]:[t,n])));a(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:V,emptyStringKey:_}},ue=({canDrag:e,canDragOnto:n,path:r,nodeData:o,onMove:a,onError:l,translate:s})=>{const{getStyles:d}=P(),{dragSource:u,setDragSource:p}=L(),[g,m]=i(!1),h=j(r),y=c((()=>e?{onDragStart:e=>{e.stopPropagation(),p({path:r,pathString:h})},onDragEnd:e=>{e.stopPropagation(),p({path:null,pathString:null})}}:{}),[e,h]),f=c((()=>e=>n?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),v(e),p({path:null,pathString:null}),m(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=u.pathString)&&void 0!==n?n:"")||m(e)},onDragExit:e=>{e.stopPropagation(),m(!1)}}:{}),[u,n,h]),b=c((()=>n&&null!==u.pathString?t("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:r.length}},f("below"))):null),[u,n,r.length]),v=e=>{var t,n;const i=null===(t=u.path)||void 0===t?void 0:t.slice(-1)[0],c=null===(n=u.path)||void 0===n?void 0:n.slice(0,-1).join("."),d=r.slice(0,-1).join(""),{parentData:p}=o;"string"==typeof i&&p&&!Array.isArray(p)&&Object.keys(p).includes(i)&&i in p&&c!==d?l({code:"KEY_EXISTS",message:s("ERROR_KEY_EXISTS",o)},i):a(u.path,r,e).then((e=>{e&&l({code:"UPDATE_ERROR",message:e},o.value)}))};return{dragSourceProps:y,getDropTargetProps:f,BottomDropTarget:b,DropTargetPadding:({position:e,nodeData:n})=>g===e?t("div",{className:"jer-drag-n-drop-padding",style:d("dropZone",n)}):null,handleDrop:v}},pe=(e,t,n,r)=>{var o,i,a;if(!t.current)return 0;const l=parseInt(null!==(o=getComputedStyle(n.current).getPropertyValue("line-height"))&&void 0!==o?o:"16px"),s=(null!==(a=null===(i=t.current)||void 0===i?void 0:i.offsetWidth)&&void 0!==a?a:0)/(.5*l),c=r(e).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/s))).reduce(((e,t)=>e+t),0)*l;return Math.min(c+30,window.innerHeight-50)},ge=({isEditingKey:n,canEditKey:r,pathString:o,path:i,name:a,handleKeyboard:l,handleEditKey:s,handleCancel:c,handleClick:d,keyValueArray:u,styles:p,getNextOrPrevious:g,emptyStringKey:m})=>{const{setCurrentlyEditingElement:h}=L();return n?t("input",{className:"jer-input-text jer-key-edit",type:"text",name:o,defaultValue:a,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>l(e,{stringConfirm:()=>s(e.target.value),cancel:c,tabForward:()=>{if(s(e.target.value),u){const e=null==u?void 0:u[0][0];h(e?[...i,e]:g("next"))}else h(i)},tabBack:()=>{s(e.target.value),h(g("prev"))}}),style:{width:String(a).length/1.5+.5+"em"}}):e("span",{className:"jer-key-text",style:Object.assign(Object.assign({},p),{minWidth:`${Math.min(String(a).length+1,5)}ch`,flexShrink:a.length>10?1:0}),onDoubleClick:()=>r&&h(i,"key"),onClick:d,children:[m?t("span",{className:"jer-empty-string",children:m}):a,""!==a||m?t("span",{className:"jer-key-colon",children:":"}):null]})},me=n=>{const{data:r,parentData:o,onEdit:a,onDelete:d,onChange:u,onMove:p,enableClipboard:g,canDragOnto:m,restrictTypeSelection:h,searchFilter:f,searchText:b,showLabel:v,stringTruncate:j,showStringQuotes:E,indent:w,translate:D,customNodeDefinitions:C,customNodeData:O,handleKeyboard:S,keyboardControls:N,sort:x,editConfirmRef:A,jsonStringify:T}=n,{getStyles:R}=P(),{setCurrentlyEditingElement:K,setCollapseState:V,previouslyEditedElement:_,setPreviouslyEditedElement:z,tabDirection:M,setTabDirection:F,previousValue:I,setPreviousValue:B}=L(),[G,Y]=i("function"==typeof r?W:r),{pathString:H,nodeData:U,path:$,name:Z,canEdit:X,canDelete:J,canDrag:Q,error:q,onError:ee,handleEditKey:te,emptyStringKey:ne,derivedValues:re}=de({props:n}),{dragSourceProps:oe,getDropTargetProps:ie,BottomDropTarget:se,DropTargetPadding:pe}=ue({canDrag:Q,canDragOnto:m,path:$,nodeData:U,onMove:p,onError:ee,translate:D}),[me,be]=i(he(r,O)),ve=s((e=>{if(!u)return void Y(e);const t=u({currentData:U.fullData,newValue:e,currentValue:G,name:Z,path:$});Y(t)}),[u]);l((()=>{Y("function"==typeof r?W:r),be(he(r,O))}),[r,q]);const{CustomNode:je,customNodeProps:Ee,hideKey:we,showEditTools:De=!0,showOnEdit:Ce,showOnView:ke,passOriginalNode:Oe}=O,Se=[...ce,...C.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],Ne=c((()=>{if("boolean"==typeof h)return h?[]:Se;if(Array.isArray(h))return h;const e=h(U);return"boolean"==typeof e?e?[]:Se:e}),[U,h]),[xe,Ae]=i(((e,t)=>{var n;if("string"!=typeof e)return null;const r=t.filter((t=>t instanceof Object&&t.enum&&t.values.includes(e)&&t.matchPriority));return r.sort(((e,t)=>{var n,r;return(null!==(n=t.matchPriority)&&void 0!==n?n:0)-(null!==(r=e.matchPriority)&&void 0!==r?r:0)})),null!==(n=r[0])&&void 0!==n?n:null})(G,Ne)),{isEditing:Te}=re,Re=y("value",U,f,b);if(Te&&(!Re||!X)){const e=k(U.fullData,$,M,x);K(e||_)}if(!Re)return null;const Ke=e=>{let t;if(K(null),B(null),void 0===e||(e=>e&&"object"==typeof e&&"type"in e&&"target"in e&&"preventDefault"in e&&"function"==typeof e.preventDefault)(e))switch(me){case"object":t={[D("DEFAULT_NEW_KEY",U)]:G};break;case"array":t=null!=G?G:[];break;case"number":{const e=Number(G);t=isNaN(e)?0:e;break}default:t=G}else t=e;a(t,$).then((e=>{e&&ee({code:"UPDATE_ERROR",message:e},t)}))},Pe=()=>{K(null),null===I?(Y(r),B(null)):a(I,$)},{isEditingKey:Ve,canEditKey:_e}=re,ze=!Te&&q,Me=Te&&Ne.length>1,Fe=("invalid"!==me||je)&&!q&&De,Ie=v&&!we,Le=je&&(Te&&Ce||!Te&&ke),Be={value:G,parentData:o,setValue:ve,isEditing:Te,canEdit:X,setIsEditing:X?()=>K($):()=>{},handleEdit:Ke,handleCancel:Pe,path:$,stringTruncate:j,showStringQuotes:E,nodeData:U,enumType:xe,translate:D,handleKeyboard:S,keyboardCommon:{cancel:Pe,tabForward:()=>{F("next"),z(H);const e=k(U.fullData,$,"next",x);e&&(Ke(),K(e))},tabBack:()=>{F("prev"),z(H);const e=k(U.fullData,$,"prev",x);e&&(Ke(),K(e))}}},We={canEditKey:_e,isEditingKey:Ve,pathString:H,path:$,name:Z,handleKeyboard:S,handleEditKey:te,handleCancel:Pe,styles:R("property",U),getNextOrPrevious:e=>k(U.fullData,$,e,x),emptyStringKey:ne},Ge=Le?t(je,Object.assign({},n,{value:G,customNodeProps:Ee,setValue:ve,handleEdit:Ke,handleCancel:Pe,handleKeyPress:e=>S(e,{stringConfirm:Ke,cancel:Pe}),isEditing:Te,setIsEditing:()=>K($),getStyles:R,originalNode:Oe?ye(r,Be):void 0,originalNodeKey:Oe?t(ge,Object.assign({},We)):void 0,canEdit:X,keyboardCommon:Be.keyboardCommon,onError:ee})):ye(r,Be);return e("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:w/2+"em",position:"relative"},draggable:Q},oe,ie("above"),{children:[se,t(pe,{position:"above",nodeData:U}),e("div",{className:"jer-value-main-row",style:{flexWrap:Z.length>10?"wrap":"nowrap"},children:[Ie&&t(ge,Object.assign({},We)),e("div",{className:"jer-value-and-buttons",children:[t("div",{className:"jer-input-component",children:Ge}),Te?t(le,{onOk:Ke,onCancel:Pe,nodeData:U,editConfirmRef:A}):Fe&&t(ae,{startEdit:X?()=>{B(I),K($,Pe)}:void 0,handleDelete:J?()=>{d(G,$).then((e=>{e&&ee({code:"DELETE_ERROR",message:e},G)}))}:void 0,enableClipboard:g,translate:D,customButtons:n.customButtons,nodeData:U,handleKeyboard:S,keyboardControls:N,editConfirmRef:A,jsonStringify:T}),Me&&e("div",{className:"jer-select jer-select-types",children:[t("select",{name:`${Z}-type-select`,className:"jer-select-inner",onChange:e=>(e=>{const t=C.find((t=>t.name===e));if(t)return a(t.defaultValue,$),be(e),Ae(null),K(null),void V({path:$,collapsed:!1,includeChildren:!1});const n=Ne.find((t=>t instanceof Object&&t.enum===e));if(n)return"string"==typeof G&&n.values.includes(G)||a(n.values[0],$).then((e=>{e&&(ee({code:"UPDATE_ERROR",message:e},r),K(null))})),void Ae(n);const r=fe(G,e,D("DEFAULT_NEW_KEY",U),(null==O?void 0:O.CustomNode)?D("DEFAULT_STRING",U):void 0);a(r,$).then((e=>{e?(ee({code:"UPDATE_ERROR",message:e},r),K(null)):Ae(null)}))})(e.target.value),value:xe?xe.enum:me,children:Ne.map((e=>e instanceof Object&&"enum"in e?t("option",{value:e.enum,children:e.enum},e.enum):t("option",{value:e,children:e},e)))}),t("span",{className:"focus"})]}),ze&&t("span",{className:"jer-error-slug",style:R("error",U),children:q})]})]}),t(pe,{position:"below",nodeData:U})]}))},he=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",ye=(e,n)=>{const r=he(e),{value:o}=n;switch(r){case"string":return t(H,Object.assign({},n,{value:o}));case"number":return t(U,Object.assign({},n,{value:o}));case"boolean":return t($,Object.assign({},n,{value:o}));case"null":return t(X,Object.assign({},n));default:return t(J,Object.assign({},n))}},fe=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},be=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:o,wrapperElement:i,customNodeProps:a,wrapperProps:l,hideKey:s=!1,showEditTools:c=!0,showOnEdit:d=!1,showOnView:u=!0,showCollectionWrapper:g=!0}=r,m=p(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:o,CustomWrapper:i,customNodeProps:a,wrapperProps:l,hideKey:s,showEditTools:c,showOnEdit:d,showOnView:u,showCollectionWrapper:g},m)},ve=r=>{const{getStyles:o}=P(),{collapseState:c,setCollapseState:d,getMatchingCollapseState:u,currentlyEditingElement:p,setCurrentlyEditingElement:f,areChildrenBeingEdited:b,previousValue:v,setPreviousValue:j}=L(),{mainContainerRef:w,data:D,nodeData:C,parentData:O,showCollectionCount:S,onEdit:x,onAdd:A,onDelete:T,canDragOnto:R,collapseFilter:K,collapseAnimationTime:V,onMove:_,enableClipboard:z,searchFilter:M,searchText:F,indent:I,sort:B,showArrayIndices:W,defaultValue:G,newKeyOptions:Y,translate:H,customNodeDefinitions:U,customNodeData:$,jsonParse:Z,jsonStringify:X,TextEditor:J,keyboardControls:Q,handleKeyboard:q,insertAtTop:ee,onCollapse:te,editConfirmRef:ne,collapseClickZones:re}=r,[oe,se]=i(X(D)),ce=K(C),{contentRef:he,isAnimating:ye,maxHeight:fe,collapsed:je,animateCollapse:Ee,cssTransitionValue:we}=((e,t,n,r,o)=>{const[l,c]=i(n?0:void 0),[d,u]=i(n),p=a(!1),g=a(null),m=a(0),h=a(0),y=t/1e3+"s",f=s((n=>{var i,a;if(d!==n){switch(window.clearTimeout(h.current),p.current=!0,n){case!0:{const e=null!==(a=null===(i=g.current)||void 0===i?void 0:i.offsetHeight)&&void 0!==a?a:0;m.current=e,c(e),setTimeout((()=>{c(0)}),5);break}case!1:c(m.current||pe(e,g,r,o))}u(!d),h.current=window.setTimeout((()=>{p.current=!1,n||c(void 0)}),t)}}),[t,d,e,r,o]);return{contentRef:g,isAnimating:p.current,animateCollapse:f,maxHeight:l,collapsed:d,cssTransitionValue:y}})(D,V,ce,w,X),{pathString:De,nodeData:Ce,path:ke,name:Oe,size:Se,canEdit:Ne,canDelete:xe,canAdd:Ae,canDrag:Te,error:Re,setError:Ke,onError:Pe,handleEditKey:Ve,emptyStringKey:_e,derivedValues:ze}=de({props:r,collapsed:je}),{dragSourceProps:Me,getDropTargetProps:Fe,BottomDropTarget:Ie,DropTargetPadding:Le}=ue({canDrag:Te,canDragOnto:R,path:ke,nodeData:Ce,onMove:_,onError:Pe,translate:H}),Be=a(!ce),{isEditing:We,isEditingKey:Ge,isArray:Ye,canEditKey:He}=ze;l((()=>{se(X(D))}),[D,X]),l((()=>{const e=K(Ce)&&!We;Be.current=!e,Ee(e)}),[K]),l((()=>{if(null!==c){const e=u(ke);e&&(Be.current=!0,Ee(e.collapsed))}}),[c]);const Ue=a(null),$e=s(((e,t)=>{if("function"!=typeof G)return G;const n=G(e,t);return void 0!==n?n:null}),[G]),Ze=s((e=>Y?"function"!=typeof Y?Y:Y(e):null),[Y]),{CustomNode:Xe,customNodeProps:Je,CustomWrapper:Qe,wrapperProps:qe={},hideKey:et,showEditTools:tt=!0,showOnEdit:nt,showOnView:rt,showCollectionWrapper:ot=!0}=$,it=b(De);it&&je&&Ee(!1);if(!(y("collection",Ce,M,F)||0===Ce.level)&&!it)return null;const at=Array.isArray(D)?"array":"object",lt="array"===at?{open:"[",close:"]"}:{open:"{",close:"}"},st=e=>{if("Tab"!==e.key||e.getModifierState("Shift"))q(e,{objectConfirm:dt,cancel:pt});else{e.preventDefault();const t=N(Ue,"\t");se(t)}},ct=e=>{e.stopPropagation();const t=E(e);if(t&&Q.collapseModifier.includes(t))return Be.current=!0,void d({collapsed:!je,path:ke,includeChildren:!0});p&&p.includes(De)||(Be.current=!0,d(null),te&&te({path:ke,collapsed:!je,includeChildren:!1}),Ee(!je))},dt=()=>{try{const e=Z(oe);if(f(null),j(null),Ke(null),X(e)===X(D))return;x(e,ke).then((t=>{t&&Pe({code:"UPDATE_ERROR",message:t},e)}))}catch(e){Pe({code:"INVALID_JSON",message:H("ERROR_INVALID_JSON",Ce)},oe)}},ut=ke.length>0?()=>{T(D,ke).then((e=>{e&&Pe({code:"DELETE_ERROR",message:e},D)}))}:void 0,pt=()=>{f(null),null===v?(Ke(null),se(X(D)),j(null)):x(v,ke)},gt="when-closed"===S?je:S,mt=!We&&tt,ht=(W||!Ye)&&!et&&void 0!==Oe,yt=Xe&&(We&&nt||!We&&rt),ft=Object.entries(D).map((([e,t])=>["array"===at?Number(e):e,t]));"object"===at&&B(ft,(e=>e));const bt=Be.current?We?e("div",{className:"jer-collection-text-edit",children:[J?t(J,{value:oe,onChange:se,onKeyDown:e=>q(e,{objectConfirm:dt,cancel:pt})}):t(m,{textAreaRef:Ue,className:"jer-collection-text-area",name:De,value:oe,setValue:se,handleKeyPress:st,styles:o("input",Ce)}),t("div",{className:"jer-collection-input-button-row",children:t(le,{onOk:dt,onCancel:pt,nodeData:Ce,editConfirmRef:ne})})]}):ft.map((([e,n],i)=>{const a={key:e,value:n,path:[...ke,e],level:ke.length+1,index:i,size:h(n)?Object.keys(n).length:null,parentData:D,fullData:Ce.fullData},l=be(U,a);return t("div",{className:"jer-collection-element",style:o("collectionElement",a),children:h(n)&&!(null==l?void 0:l.renderCollectionAsValue)?t(ve,Object.assign({},r,{data:n,parentData:D,nodeData:a,showCollectionCount:S,canDragOnto:Ne,customNodeData:l}),e):t(me,Object.assign({},r,{data:n,parentData:D,nodeData:a,canDragOnto:Ne,showLabel:"object"===at||W,customNodeData:l}),e)},e)})):null,vt=!!ot&&(je&&!it);vt||(Be.current=!0);const jt=Object.assign(Object.assign({},r),{data:D,value:D,parentData:O,nodeData:Ce,setValue:e=>g(void 0,void 0,void 0,(function*(){return yield x(e,ke)})),handleEdit:dt,handleCancel:pt,handleKeyPress:st,isEditing:We,setIsEditing:()=>f(ke),getStyles:o,canDragOnto:Ne,canEdit:Ne,keyboardCommon:{},onError:Pe}),Et=yt?t(Xe,Object.assign({customNodeProps:Je},jt,{children:bt})):bt,wt=mt&&t(ae,{startEdit:Ne?()=>{Be.current=!0,j(null),f(ke)}:void 0,handleAdd:Ae?e=>{Ee(!1);const t=$e(Ce,e);if("array"===at){const e=ee.array?0:D.length,n=ee.array?{insert:!0}:{};A(t,[...ke,e],n).then((e=>{e&&Pe({code:"ADD_ERROR",message:e},t)}))}else if(e in D)Pe({code:"KEY_EXISTS",message:H("ERROR_KEY_EXISTS",Ce)},e);else{const n=ee.object?{insertBefore:0}:{};A(t,[...ke,e],n).then((e=>{e&&Pe({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:xe?ut:void 0,enableClipboard:z,type:at,nodeData:Ce,translate:H,customButtons:r.customButtons,keyboardControls:Q,handleKeyboard:q,getNewKeyOptions:Ze,editConfirmRef:ne,jsonStringify:X}),Dt={canEditKey:He,isEditingKey:Ge,pathString:De,path:ke,name:Oe,handleKeyboard:q,handleEditKey:Ve,handleCancel:pt,keyValueArray:ft,styles:o("property",Ce),getNextOrPrevious:e=>k(Ce.fullData,ke,e,B),handleClick:re.includes("property")?ct:e=>e.stopPropagation(),emptyStringKey:_e},Ct=e("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===ke.length?0:I/2)+"em"},o("collection",Ce)),{position:"relative"}),draggable:Te},Me,Fe("above"),{children:[t("div",{className:"jer-clickzone",style:{width:I/2+1+"em",zIndex:10+2*Ce.level},onClick:re.includes("left")?ct:void 0}),!We&&Ie,t(Le,{position:"above",nodeData:Ce}),ot?e("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:re.includes("header")?ct:void 0,children:[e("div",{className:"jer-collection-name",children:[t("div",{className:"jer-collapse-icon jer-accordion-icon"+(je?" jer-rotate-90":""),style:{zIndex:11+2*Ce.level,transition:we},onClick:ct,children:t(ie,{name:"chevron",rotate:je,nodeData:Ce})}),ht&&t(ge,Object.assign({},Dt)),!We&&t("span",{className:"jer-brackets jer-bracket-open",style:o("bracket",Ce),children:lt.open})]}),!We&&gt&&t("div",{className:"jer-collection-item-count"+(gt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},o("itemCount",Ce)),{transition:we}),children:1===Se?H("ITEM_SINGLE",Object.assign(Object.assign({},Ce),{size:1}),1):H("ITEMS_MULTIPLE",Ce,Se)}),t("div",{className:"jer-brackets"+(vt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},o("bracket",Ce)),{transition:we}),children:lt.close}),wt]}):et?t(n,{}):e("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[t(ge,Object.assign({},Dt)),wt]}),e("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:vt||ye?"clip":"visible",maxHeight:it?void 0:fe},o("collectionInner",Ce)),{transition:we}),ref:he,children:[Et,t("div",{className:We?"jer-collection-error-row":"jer-collection-error-row-edit",children:Re&&t("span",{className:"jer-error-slug",style:o("error",Ce),children:Re})}),!We&&ot&&t("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},o("bracket",Ce)),{marginLeft:(I<3?-1:I<6?-.5:0)+"em"}),children:lt.close})]}),t(Le,{position:"below",nodeData:Ce})]}));return Qe?t(Qe,Object.assign({customNodeProps:qe},jt,{children:Ct})):Ct},je={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",KEY_SELECT:"Select key",NO_KEY_OPTIONS:"No key options",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key",SHOW_LESS:"(Show less)",EMPTY_STRING:"<empty string>"},Ee=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const i=r in e?e[r]:je[r];return void 0===o?i:null==i?void 0:i.replace("{{count}}",String(o))})(e,t,r,n,o);var we=[],De=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=we.indexOf(i);-1===a&&(a=we.push(i)-1,De[a]={}),n=De[a]&&De[a][r]?De[a][r]:De[a][r]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var a="prepend"===r?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const Ce=({data:e,setData:n,rootName:r="root",onUpdate:o=()=>{},onEdit:d=o,onDelete:u=o,onAdd:p=o,onChange:m,onError:y,showErrorMessages:f=!0,enableClipboard:b=!0,indent:v=2,collapse:E=!1,collapseAnimationTime:D=300,showCollectionCount:k=!0,restrictEdit:O=!1,restrictDelete:S=!1,restrictAdd:N=!1,restrictTypeSelection:A=!1,restrictDrag:T=!0,viewOnly:R,searchFilter:K,searchText:V,searchDebounceTime:_=350,keySort:z=!1,showArrayIndices:M=!0,showStringQuotes:F=!0,defaultValue:I=null,newKeyOptions:B,minWidth:W=250,maxWidth:G="min(600px, 90vw)",rootFontSize:Y,stringTruncate:H=250,translations:U={},className:$,id:Z,customText:X={},customNodeDefinitions:J=[],customButtons:Q=[],jsonParse:q=JSON.parse,jsonStringify:ee=(e,t)=>JSON.stringify(e,t,2),TextEditor:te,errorMessageTimeout:ne=2500,keyboardControls:re={},externalTriggers:oe,insertAtTop:ie=!1,onCollapse:ae,collapseClickZones:le=["header","left"]})=>{const{getStyles:se}=P(),{setCurrentlyEditingElement:ce}=L(),de=c((()=>Se(E)),[E]),ue=c((()=>Ee(U,X)),[U,X]),[pe,ge]=i(V),[he,ye]=(({setData:e,data:t})=>{const[n,r]=i(e?void 0:t),o=s((t=>{e?e(t):r(t)}),[e]);return l((()=>{e||r(t)}),[t]),[e?t:n,o]})({setData:n,data:e}),fe=a(null);l((()=>{ce(null);const e=setTimeout((()=>ge(V)),_);return()=>clearTimeout(e)}),[V,_]);const je={key:r,path:[],level:0,index:0,value:he,size:"object"==typeof he&&null!==he?Object.keys(he).length:1,parentData:null,fullData:he},we=(e,t)=>g(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void ye(t.newData);const r=xe(n)?n:["error",n],[o,i]=r;if("error"===o)return ye(t.currentData),!1===i?ue("ERROR_UPDATE",je):String(i);ye(i)})),De=c((()=>Se(O,R)),[O,R]),Ce=c((()=>Se(S,R)),[S,R]),ke=c((()=>Se(N,R)),[N,R]),Te=c((()=>Se(T,R)),[T,R]),Re=c((()=>Ne(K)),[K]),Ke=c((()=>(e=>{const t=Object.assign({},C);for(const n of Object.keys(C)){const r=n;if(e[r]){const o=e[r],i=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=i,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(re)),[re]),Pe=s(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(w(n,e[t],t)){n.preventDefault(),o();break}})(Ke,t,e)),[Ke]),Ve=c((()=>{const e=Ae(J,"stringifyReplacer");return t=>ee(t,e)}),[J,ee]),_e=c((()=>{const e=Ae(J,"parseReviver");return t=>{const n=q(t,e);return x(n)}}),[J,q]),ze=a(null);((e,t)=>{const{setCurrentlyEditingElement:n,currentlyEditingElement:r,setCollapseState:o}=L();l((()=>{if(!e)return;const{collapse:i,edit:a}=e;i&&o(i);const l=!(null==a?void 0:a.path)||j(a.path)===r;switch(null==a?void 0:a.action){case"accept":l&&(t.current&&t.current.click(),n(null));break;case"cancel":l&&n(null);break;default:(null==a?void 0:a.path)&&n(a.path)}}),[e])})(oe,ze);const Me=s(((e,t)=>{!1!==z&&("function"!=typeof z?e.sort(((e,n)=>{const r=t(e)[0],o=t(n)[0];return r<o?-1:r>o?1:0})):e.sort(((e,n)=>z(t(e),t(n)))))}),[z]),Fe=be(J,je),Ie={mainContainerRef:fe,name:r,nodeData:je,onEdit:(e,t)=>g(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:i}=Oe(he,t,e,"update");if(o!==i)return yield we(d,{currentData:n,newData:r,currentValue:o,newValue:i,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>g(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:i}=Oe(he,t,e,"delete");return yield we(u,{currentData:n,newData:r,currentValue:o,newValue:i,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>g(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:i,newValue:a}=Oe(he,t,e,"add",n);return yield we(p,{currentData:r,newData:o,currentValue:i,newValue:a,name:t.slice(-1)[0],path:t})})),onChange:m,onError:y,showErrorMessages:f,onMove:(e,t,n)=>g(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:i}=Oe(he,e,"","delete"),a=e.slice(-1)[0],l=t.slice(0,-1),s=t.slice(-1)[0];let c="number"==typeof s?"above"===n?s:s+1:"number"==typeof a?`arr_${a}`:a;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof a&&"number"==typeof c&&a<c&&(c-=1);const u="number"==typeof c?{insert:!0}:"above"===n?{insertBefore:s}:{insertAfter:s},{newData:p,newValue:g}=Oe(o,[...l,c],i,"add",u);return yield we(d,{currentData:r,newData:p,currentValue:i,newValue:g,name:t.slice(-1)[0],path:t})})),showCollectionCount:k,collapseFilter:de,collapseAnimationTime:D,restrictEditFilter:De,restrictDeleteFilter:Ce,restrictAddFilter:ke,restrictTypeSelection:A,restrictDragFilter:Te,canDragOnto:!1,searchFilter:Re,searchText:pe,enableClipboard:b,keySort:z,sort:Me,showArrayIndices:M,showStringQuotes:F,indent:v,defaultValue:I,newKeyOptions:B,stringTruncate:H,translate:ue,customNodeDefinitions:J,customNodeData:Fe,customButtons:Q,parentData:null,jsonParse:_e,jsonStringify:Ve,TextEditor:te,errorMessageTimeout:ne,handleKeyboard:Pe,keyboardControls:Ke,insertAtTop:{object:!0===ie||"object"===ie,array:!0===ie||"array"===ie},onCollapse:ae,editConfirmRef:ze,collapseClickZones:le},Le=Object.assign(Object.assign({},se("container",je)),{minWidth:W,maxWidth:G});return Le.fontSize=null!=Y?Y:Le.fontSize,t("div",{id:Z,ref:fe,className:`jer-editor-container ${null!=$?$:""}`,style:Le,children:h(he)&&!Fe.renderCollectionAsValue?t(ve,Object.assign({data:he},Ie)):t(me,Object.assign({data:he,showLabel:!0},Ie))})},ke=e=>{var n;const[r,o]=i();return l((()=>{const e=document.documentElement;o(e)}),[]),r?t(K,{theme:null!==(n=e.theme)&&void 0!==n?n:T,icons:e.icons,docRoot:r,children:t(I,{onEditEvent:e.onEditEvent,onCollapse:e.onCollapse,children:t(Ce,Object.assign({},e))})}):null},Oe=(e,t,n,r,o={})=>{if(0===t.length)return{currentData:e,newData:n,currentValue:e,newValue:n};const i=Object.assign({remove:"delete"===r},o),a="add"!==r?u(e,t):void 0;return{currentData:e,newData:d(e,t,n,i),currentValue:a,newValue:"delete"!==r?n:void 0}},Se=(e,t)=>t?()=>!0:"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,Ne=e=>{if(void 0!==e)return"value"===e?b:"key"===e?v:"all"===e?(e,t)=>b(e,t)||v(e,t):e},xe=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),Ae=(e,t)=>{const n="stringifyReplacer"===t?[e=>void 0===e?A:e]:[];if(n.push(...e.map((e=>e[t])).filter((e=>!!e))),0!==n.length)return(e,t)=>{let r=t;for(const e of n)r=e(r);return r}},Te=e=>{var n;const{value:r,setIsEditing:o,getStyles:i,nodeData:a}=e,l=i("string",a);return t("div",{onDoubleClick:()=>o(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&o(!0)},className:"jer-value-string jer-hyperlink",style:l,children:t("a",{href:r,target:"_blank",rel:"noreferrer",style:{color:null!==(n=l.color)&&void 0!==n?n:void 0},children:t(G,Object.assign({},e,{pathString:j(a.path),styles:l,value:a.value}))})})},Re={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:Te,showOnView:!0,showOnEdit:!1},Ke={displayName:"Github Dark",styles:{container:{backgroundColor:"#0d1117",color:"white"},dropZone:"rgba(165, 214, 255, 0.17)",property:"#E6EDF3",bracket:"#56d364",itemCount:"#8B949E",string:"#A5D6FF",number:"#D2A8FF",boolean:{color:"#FF7B72",fontSize:"90%",fontWeight:"bold"},null:"green",iconCollection:"#D2A8FF",iconEdit:"#D2A8FF",iconDelete:"rgb(203, 75, 22)",iconAdd:"rgb(203, 75, 22)",iconCopy:"#A5D6FF",iconOk:"#56d364",iconCancel:"rgb(203, 75, 22)"}},Pe={displayName:"Github Light",styles:{container:"white",property:"#1F2328",bracket:"#00802e",itemCount:"#8B949E",string:"#0A3069",number:"#953800",boolean:{color:"#CF222E",fontSize:"90%",fontWeight:"bold"},null:"#FF7B72",iconCollection:"#8250DF",iconEdit:"#8250DF",iconDelete:"rgb(203, 75, 22)",iconAdd:"#8250DF",iconCopy:"#57606A"}},Ve={displayName:"Black & White",fragments:{lightText:{color:"white"},midGrey:"#5c5c5c"},styles:{container:["lightText",{backgroundColor:"black"}],dropZone:"#e0e0e029",property:"lightText",bracket:"midGrey",itemCount:"#4a4a4a",string:"#a8a8a8",number:"#666666",boolean:{color:"#848484",fontStyle:"italic"},null:"#333333",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},_e={fragments:{midGrey:"#a3a3a3"},displayName:"White & Black",styles:{container:"white",property:"black",bracket:"midGrey",itemCount:"#b5b5b5",string:"#575757",number:"#999999",boolean:{color:"#7b7b7b",fontStyle:"italic"},null:"#cccccc",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},ze={displayName:"Candy Wrapper",fragments:{minty:{backgroundColor:"#F1FAEE"},pale:{color:"#A8DADC"},mid:{color:"#457B9D"},dark:{color:"#1D3557"},pop:{color:"#E63946"},darkBlue:{color:"#2B2D42"}},styles:{container:"minty",property:"pop",dropZone:"#eb121217",bracket:"dark",itemCount:"pale",string:"mid",number:["darkBlue",{fontSize:"85%"}],boolean:["mid",{fontStyle:"italic",fontWeight:"bold",fontSize:"80%"}],null:["#cccccc",{fontWeight:"bold"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},Me={displayName:"Psychedelic",fragments:{pale:{color:"#A8DADC"},fluroYellow:"rgb(242, 228, 21)",fluroGreen:"rgb(68, 255, 62)",hotPink:"#f7379a"},styles:{container:{backgroundColor:"unset",background:"linear-gradient(90deg, hsla(333, 100%, 53%, 1) 0%, hsla(33, 94%, 57%, 1) 100%)",color:"black"},dropZone:"fluroYellow",property:"black",bracket:"fluroYellow",itemCount:["pale",{opacity:.7}],string:"white",number:["#33d9ff",{fontSize:"90%",fontWeight:"bold"}],boolean:["fluroGreen",{fontWeight:"bold",fontSize:"80%"}],null:["black",{fontWeight:"bold",opacity:.3,backgroundColor:"rgb(255, 255, 255, 0.5)",padding:"0 0.4em",borderRadius:"0.4em"}],iconCollection:"fluroYellow",iconEdit:["black"],iconDelete:["white",{opacity:.5}],iconAdd:["white",{opacity:.5}],iconCopy:"rgb(32, 84, 242)",iconOk:"fluroGreen",iconCancel:"hotPink"}};export{Q as IconAdd,re as IconCancel,oe as IconChevron,te as IconCopy,ee as IconDelete,q as IconEdit,ne as IconOk,ke as JsonEditor,Te as LinkCustomComponent,Re as LinkCustomNodeDefinition,G as StringDisplay,Y as StringEdit,ze as candyWrapperTheme,T as defaultTheme,Ke as githubDarkTheme,Pe as githubLightTheme,h as isCollection,b as matchNode,v as matchNodeKey,Ve as monoDarkTheme,_e as monoLightTheme,Me as psychedelicTheme,ce as standardDataTypes,j as toPathString,Z as useKeyboardListener};
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{createContext as r,useContext as o,useState as i,useRef as a,useEffect as l,useCallback as s,useMemo as c}from"react";import d from"object-property-assigner";export{default as assign}from"object-property-assigner";import u from"object-property-extractor";export{default as extract}from"object-property-extractor";function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function g(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const h=({className:n,name:r,value:o,setValue:i,handleKeyPress:a,styles:l,textAreaRef:s})=>{if("string"!=typeof o)return null;const c="\n"===o.slice(-1)?o+".":o;return e("div",{style:{display:"grid"},children:[t("textarea",{id:`${r}_textarea`,ref:s,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},l),rows:1,className:n,name:`${r}_textarea`,value:o,onChange:e=>i(e.target.value),autoFocus:!0,onFocus:e=>{o.length<40&&e.target.select()},onKeyDown:a}),t("span",{className:n,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},l),children:c})]})},m=e=>null!==e&&"object"==typeof e,y=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!f(r,t,n))return!1}if(!n&&r&&!f(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!b(t,r))return!1}return!0},f=(e="",t,n=b)=>{const r=t.value;return Object.entries(r).some((([o,i])=>{const a=[...t.path,o],l=Object.assign(Object.assign({},t),{key:o,path:a,level:t.level+1,value:i,size:a.length,parentData:r});return m(i)?f(e,l,n):n(l,e)}))},b=(e,t="")=>{const{value:n}=e;if(null===n&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},v=({key:e,path:t},n="")=>!!b({value:e},n)||!!t.some((e=>b({value:e},n))),j=(e,t)=>(null!=t?t:"")+e.map((e=>""===e?String.fromCharCode(0):e)).join("."),E=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,w=(e,t,n)=>{const r=e.key,o=E(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:i,modifier:a}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==i||!(null==a?void 0:a.includes("Shift")))&&(r===i&&(a===o||Array.isArray(a)&&a.includes(o)))},D={key:"Enter"},C={confirm:D,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},D),{modifier:["Meta","Shift","Control"]}),objectLineBreak:D,stringConfirm:D,stringLineBreak:Object.assign(Object.assign({},D),{modifier:["Shift"]}),numberConfirm:D,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:D,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},k=(e,t,n="next",r)=>{const o=t.slice(0,t.length-1),i=t.slice(-1)[0];if(void 0===i)return null;const a=u(e,o),l=S(a);Array.isArray(a)||r(l,(({key:e,value:t})=>[e,t]));const s=l.findIndex((e=>e.key===i)),c=l[s+("next"===n?1:-1)];return c?m(c.value)?0===Object.keys(c.value).length?k(e,[...o,c.key],n,r):O(e,[...o,c.key],n,r):[...o,c.key]:0===o.length?null:k(e,o,n,r)},O=(e,t,n="next",r)=>{const o=u(e,t);if(!m(o))return t;const i=Array.isArray(o)?o.map(((e,t)=>t)):Object.keys(o);r(i,(e=>[e,o]));const a="next"===n?i[0]:i[i.length-1];return O(e,[...t,a],n,r)},S=e=>Array.isArray(e)?e.map(((e,t)=>({index:t,value:e,key:t}))):Object.entries(e).map((([e,t],n)=>({key:e,value:t,index:n}))),N=(e,t)=>{var n,r,o,i;const a=e.current,l=null!==(n=null==a?void 0:a.selectionStart)&&void 0!==n?n:1/0,s=null!==(r=null==a?void 0:a.selectionEnd)&&void 0!==r?r:1/0,c=(null===(o=null==a?void 0:a.textContent)||void 0===o?void 0:o.slice(0,l))+t+(null===(i=null==a?void 0:a.textContent)||void 0===i?void 0:i.slice(s));return a.value=c,null==a||a.setSelectionRange(l+1,l+1),c},T=e=>{if(e!==x){if(Array.isArray(e))return e.map((e=>T(e)));if(e&&"object"==typeof e)for(const t in e)e[t]=T(e[t]);return e}},x="__​undefined__",A={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},P=r({getStyles:()=>({}),icons:{}}),R=({theme:e=A,icons:n={},docRoot:r,children:o})=>{const i=V(e,r);return t(P.Provider,{value:{getStyles:(e,t)=>"function"==typeof i[e]?i[e](t):i[e],icons:n},children:o})},K=()=>o(P),V=(e,t)=>{var n,r,o,i;const a={},l=(Array.isArray(e)?e:[e]).map((e=>I(e)?_({fragments:{},styles:e},a):_(e,a))),s=_(A,{});Object.keys(s).forEach((e=>{const t=e;l.forEach((e=>{e[t]&&(s[t]=Object.assign(Object.assign({},s[t]),e[t]))}))}));const c=Object.assign({},s);return Object.entries(a).forEach((([e,t])=>{const n=e;c[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},s[n]),r)}})),"function"!=typeof(null==c?void 0:c.inputHighlight)&&(null===(n=null==c?void 0:c.inputHighlight)||void 0===n?void 0:n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",null===(r=null==c?void 0:c.inputHighlight)||void 0===r?void 0:r.backgroundColor),"function"!=typeof(null==c?void 0:c.iconCopy)&&(null===(o=null==c?void 0:c.iconCopy)||void 0===o?void 0:o.color)&&t.style.setProperty("--jer-icon-copy-color",null===(i=null==c?void 0:c.iconCopy)||void 0===i?void 0:i.color),c},_=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const i=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var i,a;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(i=null==n?void 0:n[o])&&void 0!==i?i:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(a=L[e])&&void 0!==a?a:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=i})),o},I=e=>!("styles"in e),L={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},z=r(null),M=({children:e,onEditEvent:n,onCollapse:r})=>{const[o,l]=i(null),[s,c]=i(null),[d,u]=i(null),[p,g]=i({path:null,pathString:null}),h=a(null),m=a("next"),y=a(null);return t(z.Provider,{value:{collapseState:o,setCollapseState:e=>{l(e),r&&null!==e&&(Array.isArray(e)?e.forEach((e=>r(e))):r(e)),null!==e&&setTimeout((()=>l(null)),2e3)},getMatchingCollapseState:e=>{if(Array.isArray(o)){for(const t of o)if(B(e,t))return t;return null}return B(e,o)?o:null},currentlyEditingElement:s,setCurrentlyEditingElement:(e,t)=>{const r="string"==typeof e||null===e?e:j(e,"key"===t?"key_":void 0);null!==s&&null!==r&&null!==h.current&&h.current(),c(r),n&&(Array.isArray(e)||null===e)&&n(e,"key"===t),h.current="function"==typeof t?t:null},areChildrenBeingEdited:e=>null!==s&&s.includes(e),previouslyEditedElement:y.current,setPreviouslyEditedElement:e=>{y.current=e},tabDirection:m.current,setTabDirection:e=>{m.current=e},previousValue:d,setPreviousValue:u,dragSource:p,setDragSource:g},children:e})},F=()=>{const e=o(z);if(!e)throw new Error("Missing Context Provider");return e},B=(e,t)=>{if(null===t)return!1;if(!t.includeChildren)return t.path.every(((t,n)=>e[n]===t))&&t.path.length===e.length;for(const[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},W="**INVALID_FUNCTION**",G=({nodeData:r,showStringQuotes:o=!0,stringTruncate:a=200,pathString:l,canEdit:s,setIsEditing:c,styles:d,translate:u,value:p,TextWrapper:g=({children:e})=>e})=>{const h=null!=p?p:r.value,[m,y]=i(!1),f=o?'"':"",b=h.length>a,v=()=>{s?c(!0):y(!m)};return e("div",{id:`${l}_display`,onDoubleClick:v,onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&v()},className:"jer-value-string",style:d,children:[f,b?e(n,m?{children:[t(g,{children:e("span",{children:[h,f]})}),e("span",{className:"jer-string-expansion jer-show-less",onClick:()=>y(!1),children:[" ",u("SHOW_LESS",r)]})]}:{children:[e(g,{children:[t("span",{children:h.slice(0,a-2).trimEnd()})," "]}),t("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>y(!0),children:"..."}),f]}):t(g,{children:`${h}${f}`})]})},Y=({styles:e,pathString:n,value:r,setValue:o,handleEdit:i,handleKeyboard:l,keyboardCommon:s})=>{const c=a(null);return t(h,{className:"jer-input-text",textAreaRef:c,name:n,value:r,setValue:o,handleKeyPress:e=>{l(e,Object.assign({stringConfirm:i,stringLineBreak:()=>{const e=N(c,"\n");o(e)}},s))},styles:e})},H=n=>{var{isEditing:r,path:o,enumType:i}=n,a=p(n,["isEditing","path","enumType"]);const{getStyles:l}=K(),s=j(o),{value:c,setValue:d,nodeData:u,handleEdit:g,handleKeyboard:h,keyboardCommon:m}=a;return r&&i?e("div",{className:"jer-select jer-select-enums",children:[t("select",{name:`${s}-value-select`,className:"jer-select-inner",onChange:e=>d(e.target.value),value:c,autoFocus:!0,onKeyDown:e=>{h(e,Object.assign({stringConfirm:g},m))},children:i.values.map((e=>t("option",{value:e,children:e},e)))}),t("span",{className:"focus"})]}):r?t(Y,Object.assign({styles:l("input",u),pathString:s},a,{setValue:a.setValue})):t(G,Object.assign({pathString:s,styles:l("string",u)},a))},U=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:a,nodeData:l,handleKeyboard:s,keyboardCommon:c})=>{const{getStyles:d}=K();return r?t("input",{className:"jer-input-number",type:"text",name:j(o),value:e,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>setTimeout((()=>e.target.select()),10),onKeyDown:t=>s(t,Object.assign({numberConfirm:a,numberUp:()=>n(Number(e)+1),numberDown:()=>n(Number(e)-1)},c)),style:Object.assign({width:String(e).length/1.5+2+"em"},d("input",l))}):t("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:d("number",l),children:e})},$=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:a,nodeData:l,handleKeyboard:s,keyboardCommon:c})=>{const{getStyles:d}=K();return"boolean"!=typeof e?null:r?t("input",{className:"jer-input-boolean",type:"checkbox",name:j(o),checked:e,onChange:()=>n(!e),onKeyDown:t=>{" "===t.key&&t.preventDefault(),s(t,Object.assign({booleanConfirm:a,booleanToggle:()=>n(!e)},c))},autoFocus:!0}):t("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:d("boolean",l),children:String(e)})},Z=(e,t)=>{const n=a(void 0),r=a(t);l((()=>{r.current=t}),[t]);const o=e=>{r.current(e)};l((()=>{if(window.clearTimeout(n.current),e)return n.current=window.setTimeout((()=>{window.addEventListener("keydown",o)}),100),()=>{window.clearTimeout(n.current),window.removeEventListener("keydown",o)}}),[e])},X=({value:e,isEditing:n,setIsEditing:r,handleEdit:o,nodeData:i,handleKeyboard:a,keyboardCommon:l})=>{const{getStyles:s}=K();return Z(n,(e=>a(e,Object.assign({confirm:o},l)))),t("div",{onDoubleClick:()=>r(!0),className:"jer-value-null",style:s("null",i),children:String(e)})},J=({value:e})=>{let n="Error!";switch(typeof e){case"string":e===W&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return t("span",{className:"jer-value-invalid",children:n})},Q=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,children:[t("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),t("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),q=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,transform:"translate(0, 0.5)",children:[t("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),t("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),ee=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),te=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),t("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),t("path",{d:"M15 10l-4 4 4 4"})]}),ne=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),t("path",{d:"M22 4L12 14.01l-3-3"})]}),re=({size:e,style:n,className:r})=>t("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),oe=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),ie=({name:e,nodeData:r})=>{var o,i,a,l,s,c,d;const{getStyles:u,icons:p}=K(),g={size:"1.4em",className:"jer-icon"};switch(e){case"add":return null!==(o=null==p?void 0:p.add)&&void 0!==o?o:t(Q,Object.assign({},g,{style:u("iconAdd",r)}));case"edit":return null!==(i=null==p?void 0:p.edit)&&void 0!==i?i:t(q,Object.assign({},g,{style:u("iconEdit",r)}));case"delete":return null!==(a=null==p?void 0:p.delete)&&void 0!==a?a:t(ee,Object.assign({},g,{style:u("iconDelete",r),size:"1.45em"}));case"copy":return null!==(l=null==p?void 0:p.copy)&&void 0!==l?l:t(te,Object.assign({},g,{style:u("iconCopy",r),size:"1.2em"}));case"ok":return null!==(s=null==p?void 0:p.ok)&&void 0!==s?s:t(ne,Object.assign({},g,{style:Object.assign({fontSize:"90%"},u("iconOk",r))}));case"cancel":return null!==(c=null==p?void 0:p.cancel)&&void 0!==c?c:t(re,Object.assign({},g,{style:Object.assign({fontSize:"130%"},u("iconCancel",r))}));case"chevron":return null!==(d=null==p?void 0:p.chevron)&&void 0!==d?d:t(oe,{size:"1em",style:u("iconCollection",r)});default:return t(n,{})}},ae=({startEdit:r,handleDelete:o,handleAdd:a,enableClipboard:l,type:s,customButtons:c,nodeData:d,translate:p,keyboardControls:g,handleKeyboard:h,editConfirmRef:m,getNewKeyOptions:y,jsonStringify:f,onEditEvent:b,showIconTooltips:v})=>{const{getStyles:j}=K(),w=p("KEY_NEW",d),[D,C]=i(w),[k,O]=i(!1),{key:S,path:N,value:T}=d,x=Array.isArray(k),A=e=>{var t;if(b&&b(e?[...N,null]:null,e),!e)return void O(!1);const n=Object.keys(u(d.fullData,N)),r=y?null===(t=y(d))||void 0===t?void 0:t.filter((e=>!n.includes(e))):null;r&&C(""),O(null==r||r)};return e("div",{className:"jer-edit-buttons",style:{opacity:k?1:void 0},onClick:e=>e.stopPropagation(),children:[l&&t("div",{onClick:e=>{var t;e.stopPropagation();let n,r,o="value",i="",a=null;if(l){const s=E(e);if(s&&g.clipboardModifier.includes(s)?(n=se(N),i=n,o="path"):(n=T,i="object"==typeof n?f(T):String(n)),!navigator.clipboard)return void("function"==typeof l&&l({success:!1,value:n,stringValue:i,path:N,key:S,type:o,errorMessage:"Can't access clipboard API"}));null===(t=navigator.clipboard)||void 0===t||t.writeText(i).then((()=>r=!0)).catch((e=>{r=!1,a=e.message})).finally((()=>{"function"==typeof l&&l({success:r,errorMessage:a,value:n,stringValue:i,path:N,key:S,type:o})}))}},className:"jer-copy-pulse",title:v?p("TOOLTIP_COPY",d):"",children:t(ie,{name:"copy",nodeData:d})}),r&&t("div",{onClick:r,title:v?p("TOOLTIP_EDIT",d):"",children:t(ie,{name:"edit",nodeData:d})}),o&&t("div",{onClick:o,title:v?p("TOOLTIP_DELETE",d):"",children:t(ie,{name:"delete",nodeData:d})}),a&&t("div",{onClick:()=>{"object"===s?A(!0):a("")},title:v?p("TOOLTIP_ADD",d):"",children:t(ie,{name:"add",nodeData:d})}),null==c?void 0:c.map((({Element:e,onClick:n},r)=>t("div",{onClick:e=>n&&n(d,e),children:t(e,{nodeData:d})},r))),k&&a&&"object"===s&&e(n,{children:[x?e("div",{className:"jer-select jer-select-keys",children:[e("select",{name:"new-key-select",className:"jer-select-inner",onChange:e=>{a(e.target.value),A(!1)},defaultValue:"",autoFocus:!0,onKeyDown:e=>{h(e,{cancel:()=>A(!1)})},children:[t("option",{value:"",disabled:!0,children:k.length>0?p("KEY_SELECT",d):p("NO_KEY_OPTIONS",d)}),k.map((e=>t("option",{value:e,children:e},e)))]}),t("span",{className:"focus"})]}):t("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:D,onChange:e=>C(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{h(e,{stringConfirm:()=>{a&&(A(!1),a(D),C(w))},cancel:()=>{A(!1),C(w)}})},style:j("input",d)}),t(le,{onOk:()=>{x&&!D||(A(!1),a(D))},onCancel:()=>{A(!1)},nodeData:d,editConfirmRef:m,hideOk:x})]})]})},le=({onOk:n,onCancel:r,nodeData:o,editConfirmRef:i,hideOk:a=!1})=>e("div",{className:"jer-confirm-buttons",children:[!a&&t("div",{onClick:n,ref:i,children:t(ie,{name:"ok",nodeData:o})}),t("div",{onClick:r,children:t(ie,{name:"cancel",nodeData:o})})]}),se=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),ce=["string","number","boolean","null","object","array"],de=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:o,onEdit:a,onError:l,showErrorMessages:c,restrictEditFilter:d,restrictDeleteFilter:u,restrictAddFilter:p,restrictDragFilter:g,translate:h,errorMessageTimeout:m}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:f}=F(),[b,v]=i(null),E=Object.assign(Object.assign({},r),{collapsed:t}),{path:w,key:D,size:C}=E,k=j(w),O=!d(E),S=!u(E),N=!p(E),T=!g(E)&&S&&null===y,x=e=>{c&&(v(e),setTimeout((()=>v(null)),m)),console.warn("Error",e)},A=s(((e,t)=>{x(e.message),l&&l({currentData:E.fullData,errorValue:t,currentValue:n,name:D,path:w,error:e})}),[l,c]),P=y===k,R=y===`key_${k}`,K="number"==typeof w.slice(-1)[0],V={isEditing:P,isEditingKey:R,isArray:K,canEditKey:null!==o&&O&&N&&S&&!K},_=""===D&&w.length>0?h("EMPTY_STRING",E):null;return{pathString:k,nodeData:E,path:w,name:D,size:C,canEdit:O,canDelete:S,canAdd:N,canDrag:T,error:b,showError:x,onError:A,setError:v,handleEditKey:e=>{if(f(null),D===e)return;if(!o)return;const t=w.slice(0,-1);if(Object.keys(o).includes(e))return void A({code:"KEY_EXISTS",message:h("ERROR_KEY_EXISTS",E)},e);const n=Object.fromEntries(Object.entries(o).map((([t,n])=>t===D?[e,n]:[t,n])));a(n,t).then((t=>{t&&A({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:V,emptyStringKey:_}},ue=({canDrag:e,canDragOnto:n,path:r,nodeData:o,onMove:a,onError:l,translate:s})=>{const{getStyles:d}=K(),{dragSource:u,setDragSource:p}=F(),[g,h]=i(!1),m=j(r),y=c((()=>e?{onDragStart:e=>{e.stopPropagation(),p({path:r,pathString:m})},onDragEnd:e=>{e.stopPropagation(),p({path:null,pathString:null})}}:{}),[e,m]),f=c((()=>e=>n?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),v(e),p({path:null,pathString:null}),h(!1)},onDragEnter:t=>{var n;t.stopPropagation(),m.startsWith(null!==(n=u.pathString)&&void 0!==n?n:"")||h(e)},onDragExit:e=>{e.stopPropagation(),h(!1)}}:{}),[u,n,m]),b=c((()=>n&&null!==u.pathString?t("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:r.length}},f("below"))):null),[u,n,r.length]),v=e=>{var t,n;const i=null===(t=u.path)||void 0===t?void 0:t.slice(-1)[0],c=null===(n=u.path)||void 0===n?void 0:n.slice(0,-1).join("."),d=r.slice(0,-1).join(""),{parentData:p}=o;"string"==typeof i&&p&&!Array.isArray(p)&&Object.keys(p).includes(i)&&i in p&&c!==d?l({code:"KEY_EXISTS",message:s("ERROR_KEY_EXISTS",o)},i):a(u.path,r,e).then((e=>{e&&l({code:"UPDATE_ERROR",message:e},o.value)}))};return{dragSourceProps:y,getDropTargetProps:f,BottomDropTarget:b,DropTargetPadding:({position:e,nodeData:n})=>g===e?t("div",{className:"jer-drag-n-drop-padding",style:d("dropZone",n)}):null,handleDrop:v}},pe=(e,t,n,r)=>{var o,i,a;if(!t.current)return 0;const l=parseInt(null!==(o=getComputedStyle(n.current).getPropertyValue("line-height"))&&void 0!==o?o:"16px"),s=(null!==(a=null===(i=t.current)||void 0===i?void 0:i.offsetWidth)&&void 0!==a?a:0)/(.5*l),c=r(e).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/s))).reduce(((e,t)=>e+t),0)*l;return Math.min(c+30,window.innerHeight-50)},ge=({isEditingKey:n,canEditKey:r,pathString:o,path:i,name:a,handleKeyboard:l,handleEditKey:s,handleCancel:c,handleClick:d,keyValueArray:u,styles:p,getNextOrPrevious:g,emptyStringKey:h})=>{const{setCurrentlyEditingElement:m}=F();return n?t("input",{className:"jer-input-text jer-key-edit",type:"text",name:o,defaultValue:a,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>l(e,{stringConfirm:()=>s(e.target.value),cancel:c,tabForward:()=>{if(s(e.target.value),u){const e=null==u?void 0:u[0][0];m(e?[...i,e]:g("next"))}else m(i)},tabBack:()=>{s(e.target.value),m(g("prev"))}}),style:{width:String(a).length/1.5+.5+"em"}}):e("span",{className:"jer-key-text",style:Object.assign(Object.assign({},p),{minWidth:`${Math.min(String(a).length+1,5)}ch`,flexShrink:a.length>10?1:0}),onDoubleClick:()=>r&&m(i,"key"),onClick:d,children:[h?t("span",{className:"jer-empty-string",children:h}):a,""!==a||h?t("span",{className:"jer-key-colon",children:":"}):null]})},he=n=>{const{data:r,parentData:o,onEdit:a,onDelete:d,onChange:u,onMove:p,enableClipboard:g,canDragOnto:h,restrictTypeSelection:m,searchFilter:f,searchText:b,showLabel:v,stringTruncate:j,showStringQuotes:E,indent:w,translate:D,customNodeDefinitions:C,customNodeData:O,handleKeyboard:S,keyboardControls:N,sort:T,editConfirmRef:x,jsonStringify:A,showIconTooltips:P}=n,{getStyles:R}=K(),{setCurrentlyEditingElement:V,setCollapseState:_,previouslyEditedElement:I,setPreviouslyEditedElement:L,tabDirection:z,setTabDirection:M,previousValue:B,setPreviousValue:G}=F(),[Y,H]=i("function"==typeof r?W:r),{pathString:U,nodeData:$,path:Z,name:X,canEdit:J,canDelete:Q,canDrag:q,error:ee,onError:te,handleEditKey:ne,emptyStringKey:re,derivedValues:oe}=de({props:n}),{dragSourceProps:ie,getDropTargetProps:se,BottomDropTarget:pe,DropTargetPadding:he}=ue({canDrag:q,canDragOnto:h,path:Z,nodeData:$,onMove:p,onError:te,translate:D}),[be,ve]=i(me(r,O)),je=s((e=>{if(!u)return void H(e);const t=u({currentData:$.fullData,newValue:e,currentValue:Y,name:X,path:Z});H(t)}),[u]);l((()=>{H("function"==typeof r?W:r),ve(me(r,O))}),[r,ee]);const{CustomNode:Ee,customNodeProps:we,hideKey:De,showEditTools:Ce=!0,showOnEdit:ke,showOnView:Oe,passOriginalNode:Se}=O,Ne=[...ce,...C.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],Te=c((()=>{if("boolean"==typeof m)return m?[]:Ne;if(Array.isArray(m))return m;const e=m($);return"boolean"==typeof e?e?[]:Ne:e}),[$,m]),[xe,Ae]=i(((e,t)=>{var n;if("string"!=typeof e)return null;const r=t.filter((t=>t instanceof Object&&t.enum&&t.values.includes(e)&&t.matchPriority));return r.sort(((e,t)=>{var n,r;return(null!==(n=t.matchPriority)&&void 0!==n?n:0)-(null!==(r=e.matchPriority)&&void 0!==r?r:0)})),null!==(n=r[0])&&void 0!==n?n:null})(Y,Te)),{isEditing:Pe}=oe,Re=y("value",$,f,b);if(Pe&&(!Re||!J)){const e=k($.fullData,Z,z,T);V(e||I)}if(!Re)return null;const Ke=e=>{let t;if(V(null),G(null),void 0===e||(e=>e&&"object"==typeof e&&"type"in e&&"target"in e&&"preventDefault"in e&&"function"==typeof e.preventDefault)(e))switch(be){case"object":t={[D("DEFAULT_NEW_KEY",$)]:Y};break;case"array":t=null!=Y?Y:[];break;case"number":{const e=Number(Y);t=isNaN(e)?0:e;break}default:t=Y}else t=e;a(t,Z).then((e=>{e&&te({code:"UPDATE_ERROR",message:e},t)}))},Ve=()=>{V(null),null===B?(H(r),G(null)):a(B,Z)},{isEditingKey:_e,canEditKey:Ie}=oe,Le=!Pe&&ee,ze=Pe&&Te.length>1,Me=("invalid"!==be||Ee)&&!ee&&Ce,Fe=v&&!De,Be=Ee&&(Pe&&ke||!Pe&&Oe),We={value:Y,parentData:o,setValue:je,isEditing:Pe,canEdit:J,setIsEditing:J?()=>V(Z):()=>{},handleEdit:Ke,handleCancel:Ve,path:Z,stringTruncate:j,showStringQuotes:E,nodeData:$,enumType:xe,translate:D,handleKeyboard:S,keyboardCommon:{cancel:Ve,tabForward:()=>{M("next"),L(U);const e=k($.fullData,Z,"next",T);e&&(Ke(),V(e))},tabBack:()=>{M("prev"),L(U);const e=k($.fullData,Z,"prev",T);e&&(Ke(),V(e))}}},Ge={canEditKey:Ie,isEditingKey:_e,pathString:U,path:Z,name:X,handleKeyboard:S,handleEditKey:ne,handleCancel:Ve,styles:R("property",$),getNextOrPrevious:e=>k($.fullData,Z,e,T),emptyStringKey:re},Ye=Be?t(Ee,Object.assign({},n,{value:Y,customNodeProps:we,setValue:je,handleEdit:Ke,handleCancel:Ve,handleKeyPress:e=>S(e,{stringConfirm:Ke,cancel:Ve}),isEditing:Pe,setIsEditing:()=>V(Z),getStyles:R,originalNode:Se?ye(r,We):void 0,originalNodeKey:Se?t(ge,Object.assign({},Ge)):void 0,canEdit:J,keyboardCommon:We.keyboardCommon,onError:te})):ye(r,We);return e("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:w/2+"em",position:"relative"},draggable:q},ie,se("above"),{children:[pe,t(he,{position:"above",nodeData:$}),e("div",{className:"jer-value-main-row",style:{flexWrap:X.length>10?"wrap":"nowrap"},children:[Fe&&t(ge,Object.assign({},Ge)),e("div",{className:"jer-value-and-buttons",children:[t("div",{className:"jer-input-component",children:Ye}),Pe?t(le,{onOk:Ke,onCancel:Ve,nodeData:$,editConfirmRef:x}):Me&&t(ae,{startEdit:J?()=>{G(B),V(Z,Ve)}:void 0,handleDelete:Q?()=>{d(Y,Z).then((e=>{e&&te({code:"DELETE_ERROR",message:e},Y)}))}:void 0,enableClipboard:g,translate:D,customButtons:n.customButtons,nodeData:$,handleKeyboard:S,keyboardControls:N,editConfirmRef:x,jsonStringify:A,showIconTooltips:P}),ze&&e("div",{className:"jer-select jer-select-types",children:[t("select",{name:`${X}-type-select`,className:"jer-select-inner",onChange:e=>(e=>{const t=C.find((t=>t.name===e));if(t)return a(t.defaultValue,Z),ve(e),Ae(null),V(null),void _({path:Z,collapsed:!1,includeChildren:!1});const n=Te.find((t=>t instanceof Object&&t.enum===e));if(n)return"string"==typeof Y&&n.values.includes(Y)||a(n.values[0],Z).then((e=>{e&&(te({code:"UPDATE_ERROR",message:e},r),V(null))})),void Ae(n);const r=fe(Y,e,D("DEFAULT_NEW_KEY",$),(null==O?void 0:O.CustomNode)?D("DEFAULT_STRING",$):void 0);a(r,Z).then((e=>{e?(te({code:"UPDATE_ERROR",message:e},r),V(null)):Ae(null)}))})(e.target.value),value:xe?xe.enum:be,children:Te.map((e=>e instanceof Object&&"enum"in e?t("option",{value:e.enum,children:e.enum},e.enum):t("option",{value:e,children:e},e)))}),t("span",{className:"focus"})]}),Le&&t("span",{className:"jer-error-slug",style:R("error",$),children:ee})]})]}),t(he,{position:"below",nodeData:$})]}))},me=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",ye=(e,n)=>{const r=me(e),{value:o}=n;switch(r){case"string":return t(H,Object.assign({},n,{value:o}));case"number":return t(U,Object.assign({},n,{value:o}));case"boolean":return t($,Object.assign({},n,{value:o}));case"null":return t(X,Object.assign({},n));default:return t(J,Object.assign({},n))}},fe=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},be=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:o,wrapperElement:i,customNodeProps:a,wrapperProps:l,hideKey:s=!1,showEditTools:c=!0,showOnEdit:d=!1,showOnView:u=!0,showCollectionWrapper:g=!0}=r,h=p(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:o,CustomWrapper:i,customNodeProps:a,wrapperProps:l,hideKey:s,showEditTools:c,showOnEdit:d,showOnView:u,showCollectionWrapper:g},h)},ve=r=>{const{getStyles:o}=K(),{collapseState:c,setCollapseState:d,getMatchingCollapseState:u,currentlyEditingElement:p,setCurrentlyEditingElement:f,areChildrenBeingEdited:b,previousValue:v,setPreviousValue:j}=F(),{mainContainerRef:w,data:D,nodeData:C,parentData:O,showCollectionCount:S,onEdit:T,onAdd:x,onDelete:A,canDragOnto:P,collapseFilter:R,collapseAnimationTime:V,onMove:_,enableClipboard:I,onEditEvent:L,showIconTooltips:z,searchFilter:M,searchText:B,indent:W,sort:G,showArrayIndices:Y,defaultValue:H,newKeyOptions:U,translate:$,customNodeDefinitions:Z,customNodeData:X,jsonParse:J,jsonStringify:Q,TextEditor:q,keyboardControls:ee,handleKeyboard:te,insertAtTop:ne,onCollapse:re,editConfirmRef:oe,collapseClickZones:se}=r,[ce,me]=i(Q(D)),ye=R(C),{contentRef:fe,isAnimating:je,maxHeight:Ee,collapsed:we,animateCollapse:De,cssTransitionValue:Ce}=((e,t,n,r,o)=>{const[l,c]=i(n?0:void 0),[d,u]=i(n),p=a(!1),g=a(null),h=a(0),m=a(0),y=t/1e3+"s",f=s((n=>{var i,a;if(d!==n){switch(window.clearTimeout(m.current),p.current=!0,n){case!0:{const e=null!==(a=null===(i=g.current)||void 0===i?void 0:i.offsetHeight)&&void 0!==a?a:0;h.current=e,c(e),setTimeout((()=>{c(0)}),5);break}case!1:c(h.current||pe(e,g,r,o))}u(!d),m.current=window.setTimeout((()=>{p.current=!1,n||c(void 0)}),t)}}),[t,d,e,r,o]);return{contentRef:g,isAnimating:p.current,animateCollapse:f,maxHeight:l,collapsed:d,cssTransitionValue:y}})(D,V,ye,w,Q),{pathString:ke,nodeData:Oe,path:Se,name:Ne,size:Te,canEdit:xe,canDelete:Ae,canAdd:Pe,canDrag:Re,error:Ke,setError:Ve,onError:_e,handleEditKey:Ie,emptyStringKey:Le,derivedValues:ze}=de({props:r,collapsed:we}),{dragSourceProps:Me,getDropTargetProps:Fe,BottomDropTarget:Be,DropTargetPadding:We}=ue({canDrag:Re,canDragOnto:P,path:Se,nodeData:Oe,onMove:_,onError:_e,translate:$}),Ge=a(!ye),{isEditing:Ye,isEditingKey:He,isArray:Ue,canEditKey:$e}=ze;l((()=>{me(Q(D))}),[D,Q]),l((()=>{const e=R(Oe)&&!Ye;Ge.current=!e,De(e)}),[R]),l((()=>{if(null!==c){const e=u(Se);e&&(Ge.current=!0,De(e.collapsed))}}),[c]);const Ze=a(null),Xe=s(((e,t)=>{if("function"!=typeof H)return H;const n=H(e,t);return void 0!==n?n:null}),[H]),Je=s((e=>U?"function"!=typeof U?U:U(e):null),[U]),{CustomNode:Qe,customNodeProps:qe,CustomWrapper:et,wrapperProps:tt={},hideKey:nt,showEditTools:rt=!0,showOnEdit:ot,showOnView:it,showCollectionWrapper:at=!0}=X,lt=b(ke);lt&&we&&De(!1);if(!(y("collection",Oe,M,B)||0===Oe.level)&&!lt)return null;const st=Array.isArray(D)?"array":"object",ct="array"===st?{open:"[",close:"]"}:{open:"{",close:"}"},dt=e=>{if("Tab"!==e.key||e.getModifierState("Shift"))te(e,{objectConfirm:pt,cancel:ht});else{e.preventDefault();const t=N(Ze,"\t");me(t)}},ut=e=>{e.stopPropagation();const t=E(e);if(t&&ee.collapseModifier.includes(t))return Ge.current=!0,void d({collapsed:!we,path:Se,includeChildren:!0});p&&p.includes(ke)||(Ge.current=!0,d(null),re&&re({path:Se,collapsed:!we,includeChildren:!1}),De(!we))},pt=()=>{try{const e=J(ce);if(f(null),j(null),Ve(null),Q(e)===Q(D))return;T(e,Se).then((t=>{t&&_e({code:"UPDATE_ERROR",message:t},e)}))}catch(e){_e({code:"INVALID_JSON",message:$("ERROR_INVALID_JSON",Oe)},ce)}},gt=Se.length>0?()=>{A(D,Se).then((e=>{e&&_e({code:"DELETE_ERROR",message:e},D)}))}:void 0,ht=()=>{f(null),null===v?(Ve(null),me(Q(D)),j(null)):T(v,Se)},mt="when-closed"===S?we:S,yt=!Ye&&rt,ft=(Y||!Ue)&&!nt&&void 0!==Ne,bt=Qe&&(Ye&&ot||!Ye&&it),vt=Object.entries(D).map((([e,t])=>["array"===st?Number(e):e,t]));"object"===st&&G(vt,(e=>e));const jt=Ge.current?Ye?e("div",{className:"jer-collection-text-edit",children:[q?t(q,{value:ce,onChange:me,onKeyDown:e=>te(e,{objectConfirm:pt,cancel:ht})}):t(h,{textAreaRef:Ze,className:"jer-collection-text-area",name:ke,value:ce,setValue:me,handleKeyPress:dt,styles:o("input",Oe)}),t("div",{className:"jer-collection-input-button-row",children:t(le,{onOk:pt,onCancel:ht,nodeData:Oe,editConfirmRef:oe})})]}):vt.map((([e,n],i)=>{const a={key:e,value:n,path:[...Se,e],level:Se.length+1,index:i,size:m(n)?Object.keys(n).length:null,parentData:D,fullData:Oe.fullData},l=be(Z,a);return t("div",{className:"jer-collection-element",style:o("collectionElement",a),children:m(n)&&!(null==l?void 0:l.renderCollectionAsValue)?t(ve,Object.assign({},r,{data:n,parentData:D,nodeData:a,showCollectionCount:S,canDragOnto:xe,customNodeData:l}),e):t(he,Object.assign({},r,{data:n,parentData:D,nodeData:a,canDragOnto:xe,showLabel:"object"===st||Y,customNodeData:l}),e)},e)})):null,Et=!!at&&(we&&!lt);Et||(Ge.current=!0);const wt=Object.assign(Object.assign({},r),{data:D,value:D,parentData:O,nodeData:Oe,setValue:e=>g(void 0,void 0,void 0,(function*(){return yield T(e,Se)})),handleEdit:pt,handleCancel:ht,handleKeyPress:dt,isEditing:Ye,setIsEditing:()=>f(Se),getStyles:o,canDragOnto:xe,canEdit:xe,keyboardCommon:{},onError:_e}),Dt=bt?t(Qe,Object.assign({customNodeProps:qe},wt,{children:jt})):jt,Ct=yt&&t(ae,{startEdit:xe?()=>{Ge.current=!0,j(null),f(Se)}:void 0,handleAdd:Pe?e=>{De(!1);const t=Xe(Oe,e);if("array"===st){const e=ne.array?0:D.length,n=ne.array?{insert:!0}:{};x(t,[...Se,e],n).then((e=>{e&&_e({code:"ADD_ERROR",message:e},t)}))}else if(e in D)_e({code:"KEY_EXISTS",message:$("ERROR_KEY_EXISTS",Oe)},e);else{const n=ne.object?{insertBefore:0}:{};x(t,[...Se,e],n).then((e=>{e&&_e({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:Ae?gt:void 0,enableClipboard:I,type:st,nodeData:Oe,translate:$,customButtons:r.customButtons,keyboardControls:ee,handleKeyboard:te,getNewKeyOptions:Je,editConfirmRef:oe,jsonStringify:Q,onEditEvent:L,showIconTooltips:z}),kt={canEditKey:$e,isEditingKey:He,pathString:ke,path:Se,name:Ne,handleKeyboard:te,handleEditKey:Ie,handleCancel:ht,keyValueArray:vt,styles:o("property",Oe),getNextOrPrevious:e=>k(Oe.fullData,Se,e,G),handleClick:se.includes("property")?ut:e=>e.stopPropagation(),emptyStringKey:Le},Ot=e("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===Se.length?0:W/2)+"em"},o("collection",Oe)),{position:"relative"}),draggable:Re},Me,Fe("above"),{children:[t("div",{className:"jer-clickzone",style:{width:W/2+1+"em",zIndex:10+2*Oe.level},onClick:se.includes("left")?ut:void 0}),!Ye&&Be,t(We,{position:"above",nodeData:Oe}),at?e("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:se.includes("header")?ut:void 0,children:[e("div",{className:"jer-collection-name",children:[t("div",{className:"jer-collapse-icon jer-accordion-icon"+(we?" jer-rotate-90":""),style:{zIndex:11+2*Oe.level,transition:Ce},onClick:ut,children:t(ie,{name:"chevron",rotate:we,nodeData:Oe})}),ft&&t(ge,Object.assign({},kt)),!Ye&&t("span",{className:"jer-brackets jer-bracket-open",style:o("bracket",Oe),children:ct.open})]}),!Ye&&mt&&t("div",{className:"jer-collection-item-count"+(mt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},o("itemCount",Oe)),{transition:Ce}),children:1===Te?$("ITEM_SINGLE",Object.assign(Object.assign({},Oe),{size:1}),1):$("ITEMS_MULTIPLE",Oe,Te)}),t("div",{className:"jer-brackets"+(Et?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},o("bracket",Oe)),{transition:Ce}),children:ct.close}),Ct]}):nt?t(n,{}):e("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[t(ge,Object.assign({},kt)),Ct]}),e("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:Et||je?"clip":"visible",maxHeight:lt?void 0:Ee},o("collectionInner",Oe)),{transition:Ce}),ref:fe,children:[Dt,t("div",{className:Ye?"jer-collection-error-row":"jer-collection-error-row-edit",children:Ke&&t("span",{className:"jer-error-slug",style:o("error",Oe),children:Ke})}),!Ye&&at&&t("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},o("bracket",Oe)),{marginLeft:(W<3?-1:W<6?-.5:0)+"em"}),children:ct.close})]}),t(We,{position:"below",nodeData:Oe})]}));return et?t(et,Object.assign({customNodeProps:tt},wt,{children:Ot})):Ot},je={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",KEY_SELECT:"Select key",NO_KEY_OPTIONS:"No key options",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key",SHOW_LESS:"(Show less)",EMPTY_STRING:"<empty string>",TOOLTIP_COPY:"Copy to clipboard",TOOLTIP_EDIT:"Edit",TOOLTIP_DELETE:"Delete",TOOLTIP_ADD:"Add"},Ee=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const i=r in e?e[r]:je[r];return void 0===o?i:null==i?void 0:i.replace("{{count}}",String(o))})(e,t,r,n,o);var we=[],De=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=we.indexOf(i);-1===a&&(a=we.push(i)-1,De[a]={}),n=De[a]&&De[a][r]?De[a][r]:De[a][r]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var a="prepend"===r?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const Ce=({data:e,setData:n,rootName:r="root",onUpdate:o=()=>{},onEdit:d=o,onDelete:u=o,onAdd:p=o,onChange:h,onError:y,onEditEvent:f,showErrorMessages:b=!0,enableClipboard:v=!0,indent:E=2,collapse:D=!1,collapseAnimationTime:k=300,showCollectionCount:O=!0,restrictEdit:S=!1,restrictDelete:N=!1,restrictAdd:x=!1,restrictTypeSelection:A=!1,restrictDrag:P=!0,viewOnly:R,searchFilter:V,searchText:_,searchDebounceTime:I=350,keySort:L=!1,showArrayIndices:z=!0,showStringQuotes:M=!0,showIconTooltips:B=!1,defaultValue:W=null,newKeyOptions:G,minWidth:Y=250,maxWidth:H="min(600px, 90vw)",rootFontSize:U,stringTruncate:$=250,translations:Z={},className:X,id:J,customText:Q={},customNodeDefinitions:q=[],customButtons:ee=[],jsonParse:te=JSON.parse,jsonStringify:ne=(e,t)=>JSON.stringify(e,t,2),TextEditor:re,errorMessageTimeout:oe=2500,keyboardControls:ie={},externalTriggers:ae,insertAtTop:le=!1,onCollapse:se,collapseClickZones:ce=["header","left"]})=>{const{getStyles:de}=K(),{setCurrentlyEditingElement:ue}=F(),pe=c((()=>Se(D)),[D]),ge=c((()=>Ee(Z,Q)),[Z,Q]),[me,ye]=i(_),[fe,je]=(({setData:e,data:t})=>{const[n,r]=i(e?void 0:t),o=s((t=>{e?e(t):r(t)}),[e]);return l((()=>{e||r(t)}),[t]),[e?t:n,o]})({setData:n,data:e}),we=a(null);l((()=>{ue(null);const e=setTimeout((()=>ye(_)),I);return()=>clearTimeout(e)}),[_,I]);const De={key:r,path:[],level:0,index:0,value:fe,size:"object"==typeof fe&&null!==fe?Object.keys(fe).length:1,parentData:null,fullData:fe},Ce=(e,t)=>g(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void je(t.newData);const r=Te(n)?n:["error",n],[o,i]=r;if("error"===o)return je(t.currentData),!1===i?ge("ERROR_UPDATE",De):String(i);je(i)})),ke=c((()=>Se(S,R)),[S,R]),Ae=c((()=>Se(N,R)),[N,R]),Pe=c((()=>Se(x,R)),[x,R]),Re=c((()=>Se(P,R)),[P,R]),Ke=c((()=>Ne(V)),[V]),Ve=c((()=>(e=>{const t=Object.assign({},C);for(const n of Object.keys(C)){const r=n;if(e[r]){const o=e[r],i=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=i,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(ie)),[ie]),_e=s(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(w(n,e[t],t)){n.preventDefault(),o();break}})(Ve,t,e)),[Ve]),Ie=c((()=>{const e=xe(q,"stringifyReplacer");return t=>ne(t,e)}),[q,ne]),Le=c((()=>{const e=xe(q,"parseReviver");return t=>{const n=te(t,e);return T(n)}}),[q,te]),ze=a(null);((e,t)=>{const{setCurrentlyEditingElement:n,currentlyEditingElement:r,setCollapseState:o}=F();l((()=>{if(!e)return;const{collapse:i,edit:a}=e;i&&o(i);const l=!(null==a?void 0:a.path)||j(a.path)===r;switch(null==a?void 0:a.action){case"accept":l&&(t.current&&t.current.click(),n(null));break;case"cancel":l&&n(null);break;default:(null==a?void 0:a.path)&&n(a.path)}}),[e])})(ae,ze);const Me=s(((e,t)=>{!1!==L&&("function"!=typeof L?e.sort(((e,n)=>{const r=t(e)[0],o=t(n)[0];return r<o?-1:r>o?1:0})):e.sort(((e,n)=>L(t(e),t(n)))))}),[L]),Fe=be(q,De),Be={mainContainerRef:we,name:r,nodeData:De,onEdit:(e,t)=>g(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:i}=Oe(fe,t,e,"update");if(o!==i)return yield Ce(d,{currentData:n,newData:r,currentValue:o,newValue:i,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>g(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:i}=Oe(fe,t,e,"delete");return yield Ce(u,{currentData:n,newData:r,currentValue:o,newValue:i,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>g(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:i,newValue:a}=Oe(fe,t,e,"add",n);return yield Ce(p,{currentData:r,newData:o,currentValue:i,newValue:a,name:t.slice(-1)[0],path:t})})),onChange:h,onError:y,onEditEvent:f,showErrorMessages:b,onMove:(e,t,n)=>g(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:i}=Oe(fe,e,"","delete"),a=e.slice(-1)[0],l=t.slice(0,-1),s=t.slice(-1)[0];let c="number"==typeof s?"above"===n?s:s+1:"number"==typeof a?`arr_${a}`:a;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof a&&"number"==typeof c&&a<c&&(c-=1);const u="number"==typeof c?{insert:!0}:"above"===n?{insertBefore:s}:{insertAfter:s},{newData:p,newValue:g}=Oe(o,[...l,c],i,"add",u);return yield Ce(d,{currentData:r,newData:p,currentValue:i,newValue:g,name:t.slice(-1)[0],path:t})})),showCollectionCount:O,collapseFilter:pe,collapseAnimationTime:k,restrictEditFilter:ke,restrictDeleteFilter:Ae,restrictAddFilter:Pe,restrictTypeSelection:A,restrictDragFilter:Re,canDragOnto:!1,searchFilter:Ke,searchText:me,enableClipboard:v,keySort:L,sort:Me,showArrayIndices:z,showStringQuotes:M,showIconTooltips:B,indent:E,defaultValue:W,newKeyOptions:G,stringTruncate:$,translate:ge,customNodeDefinitions:q,customNodeData:Fe,customButtons:ee,parentData:null,jsonParse:Le,jsonStringify:Ie,TextEditor:re,errorMessageTimeout:oe,handleKeyboard:_e,keyboardControls:Ve,insertAtTop:{object:!0===le||"object"===le,array:!0===le||"array"===le},onCollapse:se,editConfirmRef:ze,collapseClickZones:ce},We=Object.assign(Object.assign({},de("container",De)),{minWidth:Y,maxWidth:H});return We.fontSize=null!=U?U:We.fontSize,t("div",{id:J,ref:we,className:`jer-editor-container ${null!=X?X:""}`,style:We,children:m(fe)&&!Fe.renderCollectionAsValue?t(ve,Object.assign({data:fe},Be)):t(he,Object.assign({data:fe,showLabel:!0},Be))})},ke=e=>{var n;const[r,o]=i();return l((()=>{const e=document.documentElement;o(e)}),[]),r?t(R,{theme:null!==(n=e.theme)&&void 0!==n?n:A,icons:e.icons,docRoot:r,children:t(M,{onEditEvent:e.onEditEvent,onCollapse:e.onCollapse,children:t(Ce,Object.assign({},e))})}):null},Oe=(e,t,n,r,o={})=>{if(0===t.length)return{currentData:e,newData:n,currentValue:e,newValue:n};const i=Object.assign({remove:"delete"===r},o),a="add"!==r?u(e,t):void 0;return{currentData:e,newData:d(e,t,n,i),currentValue:a,newValue:"delete"!==r?n:void 0}},Se=(e,t)=>t?()=>!0:"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,Ne=e=>{if(void 0!==e)return"value"===e?b:"key"===e?v:"all"===e?(e,t)=>b(e,t)||v(e,t):e},Te=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),xe=(e,t)=>{const n="stringifyReplacer"===t?[e=>void 0===e?x:e]:[];if(n.push(...e.map((e=>e[t])).filter((e=>!!e))),0!==n.length)return(e,t)=>{let r=t;for(const e of n)r=e(r);return r}},Ae=e=>{var n;const{value:r,setIsEditing:o,getStyles:i,nodeData:a}=e,l=i("string",a);return t("div",{onDoubleClick:()=>o(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&o(!0)},className:"jer-value-string jer-hyperlink",style:l,children:t("a",{href:r,target:"_blank",rel:"noreferrer",style:{color:null!==(n=l.color)&&void 0!==n?n:void 0},children:t(G,Object.assign({},e,{pathString:j(a.path),styles:l,value:a.value}))})})},Pe={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:Ae,showOnView:!0,showOnEdit:!1},Re={displayName:"Github Dark",styles:{container:{backgroundColor:"#0d1117",color:"white"},dropZone:"rgba(165, 214, 255, 0.17)",property:"#E6EDF3",bracket:"#56d364",itemCount:"#8B949E",string:"#A5D6FF",number:"#D2A8FF",boolean:{color:"#FF7B72",fontSize:"90%",fontWeight:"bold"},null:"green",iconCollection:"#D2A8FF",iconEdit:"#D2A8FF",iconDelete:"rgb(203, 75, 22)",iconAdd:"rgb(203, 75, 22)",iconCopy:"#A5D6FF",iconOk:"#56d364",iconCancel:"rgb(203, 75, 22)"}},Ke={displayName:"Github Light",styles:{container:"white",property:"#1F2328",bracket:"#00802e",itemCount:"#8B949E",string:"#0A3069",number:"#953800",boolean:{color:"#CF222E",fontSize:"90%",fontWeight:"bold"},null:"#FF7B72",iconCollection:"#8250DF",iconEdit:"#8250DF",iconDelete:"rgb(203, 75, 22)",iconAdd:"#8250DF",iconCopy:"#57606A"}},Ve={displayName:"Black & White",fragments:{lightText:{color:"white"},midGrey:"#5c5c5c"},styles:{container:["lightText",{backgroundColor:"black"}],dropZone:"#e0e0e029",property:"lightText",bracket:"midGrey",itemCount:"#4a4a4a",string:"#a8a8a8",number:"#666666",boolean:{color:"#848484",fontStyle:"italic"},null:"#333333",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},_e={fragments:{midGrey:"#a3a3a3"},displayName:"White & Black",styles:{container:"white",property:"black",bracket:"midGrey",itemCount:"#b5b5b5",string:"#575757",number:"#999999",boolean:{color:"#7b7b7b",fontStyle:"italic"},null:"#cccccc",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},Ie={displayName:"Candy Wrapper",fragments:{minty:{backgroundColor:"#F1FAEE"},pale:{color:"#A8DADC"},mid:{color:"#457B9D"},dark:{color:"#1D3557"},pop:{color:"#E63946"},darkBlue:{color:"#2B2D42"}},styles:{container:"minty",property:"pop",dropZone:"#eb121217",bracket:"dark",itemCount:"pale",string:"mid",number:["darkBlue",{fontSize:"85%"}],boolean:["mid",{fontStyle:"italic",fontWeight:"bold",fontSize:"80%"}],null:["#cccccc",{fontWeight:"bold"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},Le={displayName:"Psychedelic",fragments:{pale:{color:"#A8DADC"},fluroYellow:"rgb(242, 228, 21)",fluroGreen:"rgb(68, 255, 62)",hotPink:"#f7379a"},styles:{container:{backgroundColor:"unset",background:"linear-gradient(90deg, hsla(333, 100%, 53%, 1) 0%, hsla(33, 94%, 57%, 1) 100%)",color:"black"},dropZone:"fluroYellow",property:"black",bracket:"fluroYellow",itemCount:["pale",{opacity:.7}],string:"white",number:["#33d9ff",{fontSize:"90%",fontWeight:"bold"}],boolean:["fluroGreen",{fontWeight:"bold",fontSize:"80%"}],null:["black",{fontWeight:"bold",opacity:.3,backgroundColor:"rgb(255, 255, 255, 0.5)",padding:"0 0.4em",borderRadius:"0.4em"}],iconCollection:"fluroYellow",iconEdit:["black"],iconDelete:["white",{opacity:.5}],iconAdd:["white",{opacity:.5}],iconCopy:"rgb(32, 84, 242)",iconOk:"fluroGreen",iconCancel:"hotPink"}};export{Q as IconAdd,re as IconCancel,oe as IconChevron,te as IconCopy,ee as IconDelete,q as IconEdit,ne as IconOk,ke as JsonEditor,Ae as LinkCustomComponent,Pe as LinkCustomNodeDefinition,G as StringDisplay,Y as StringEdit,Ie as candyWrapperTheme,A as defaultTheme,Re as githubDarkTheme,Ke as githubLightTheme,m as isCollection,b as matchNode,v as matchNodeKey,Ve as monoDarkTheme,_e as monoLightTheme,Le as psychedelicTheme,ce as standardDataTypes,j as toPathString,Z as useKeyboardListener};
{
"name": "json-edit-react",
"version": "1.27.2",
"version": "1.28.0",
"description": "React component for editing or viewing JSON/object data",

@@ -5,0 +5,0 @@ "main": "build/index.cjs.js",