/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../ensureType","./serializableProperty/originAliases","./serializableProperty/reader","./serializableProperty/shorthands","./serializableProperty/writer"],(function(e,r,i,n,t,o){"use strict";function s(e,r){return c(e,"read",r)}function a(e,r){return c(e,"write",r)}function c(e,r,i){let n=e&&e.json;if(e&&e.json&&e.json.origins&&i){const t=e.json.origins[i.origin];t&&("any"===r||r in t)&&(n=t)}return n}function p(e){const r=y(e);if(e.json.origins)for(const i in e.json.origins){const t=e.json.origins[i],s=t.types?f(t):r;n.create(s,t,!1),t.types&&!t.write&&e.json.write&&e.json.write.enabled&&(t.write={...e.json.write}),o.create(s,t)}n.create(r,e.json,!0),o.create(r,e.json)}function y(e){return e.json.types?l(e.json):e.type?u(e):l(e)}function f(e){return e.type?u(e):l(e)}function u(e){if(!e.type)return;let i=0,n=e.type;for(;Array.isArray(n)&&!r.isOneOf(n);)n=n[0],i++;return{type:n,ndimArray:i}}function l(e){if(!e.types)return;let r=0,i=e.types;for(;Array.isArray(i);)i=i[0],r++;return{types:i,ndimArray:r}}function j(e){t.process(e)&&(i.process(e),p(e))}e.originSpecificPropertyDefinition=c,e.originSpecificReadPropertyDefinition=s,e.originSpecificWritePropertyDefinition=a,e.processPrototypePropertyMetadata=j,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
