/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","./Accessor","./has","./lang","./Logger","./maybe","./accessorSupport/PropertyOrigin","./accessorSupport/utils","./accessorSupport/decorators/subclass"],(function(e,o,n,t,r,s,i,l,c,u,a){"use strict";i.getLogger("esri.core.Clonable");const p=e=>{let t=function(e){function n(){return e.apply(this,arguments)||this}return o._inheritsLoose(n,e),n.prototype.clone=function(){const e=l.unwrapOrThrow(u.getProperties(this),"unable to clone instance of non-accessor class"),o=e.metadatas,n=e.store,t={},r=new Map;for(const l in o){const e=o[l],i=null==n?void 0:n.originOf(l),u=e.clonable;if(e.readOnly||!1===u||i!==c.OriginId.USER&&i!==c.OriginId.DEFAULTS&&i!==c.OriginId.WEB_MAP&&i!==c.OriginId.WEB_SCENE)continue;const a=this[l];let p=null;p="function"==typeof u?u(a):"reference"===u?a:s.tryClone(a),null!=a&&null==p||(i===c.OriginId.DEFAULTS?r.set(l,p):t[l]=p)}const i=new(0,Object.getPrototypeOf(this).constructor)(t);if(r.size){var a;const e=null==(a=u.getProperties(i))?void 0:a.store;if(e)for(const[o,n]of r)e.set(o,n,c.OriginId.DEFAULTS)}return i},n}(e);return t=n.__decorate([a.subclass("esri.core.Clonable")],t),t};e.Clonable=function(e){function n(){return e.apply(this,arguments)||this}return o._inheritsLoose(n,e),n}(p(t)),e.Clonable=n.__decorate([a.subclass("esri.core.Clonable")],e.Clonable),e.ClonableMixin=p,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
