{"version":3,"sources":["node_modules/@arcgis/core/core/accessorSupport/diffUtils.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nimport t from \"../Accessor.js\";\nimport e from \"../Collection.js\";\nimport { getProperties as n } from \"./utils.js\";\nconst o = new Set([\"esri.Color\", \"esri.portal.Portal\", \"esri.symbols.support.Symbol3DAnchorPosition2D\", \"esri.symbols.support.Symbol3DAnchorPosition3D\"]);\nfunction r(e) {\n return e instanceof t;\n}\nfunction f(t) {\n return t instanceof e ? Object.keys(t.items) : r(t) ? n(t).keys() : t ? Object.keys(t) : [];\n}\nfunction i(t, n) {\n return t instanceof e ? t.items[n] : t[n];\n}\nfunction l(t, e) {\n return !(!Array.isArray(t) || !Array.isArray(e)) && t.length !== e.length;\n}\nfunction u(t) {\n return t ? t.declaredClass : null;\n}\nfunction c(t, e) {\n const n = t.diff;\n if (n && \"function\" == typeof n) return n(t, e);\n const s = f(t),\n p = f(e);\n if (0 === s.length && 0 === p.length) return;\n if (!s.length || !p.length || l(t, e)) return {\n type: \"complete\",\n oldValue: t,\n newValue: e\n };\n const a = p.filter(t => !s.includes(t)),\n y = s.filter(t => !p.includes(t)),\n d = s.filter(n => p.includes(n) && i(t, n) !== i(e, n)).concat(a, y).sort(),\n m = u(t);\n if (m && o.has(m) && d.length) return {\n type: \"complete\",\n oldValue: t,\n newValue: e\n };\n let h;\n const b = r(t) && r(e);\n for (const o of d) {\n const r = i(t, o),\n f = i(e, o);\n let l;\n if ((b || \"function\" != typeof r && \"function\" != typeof f) && r !== f && (null != r || null != f)) {\n if (n && n[o] && \"function\" == typeof n[o]) l = n[o]?.(r, f);else if (r instanceof Date && f instanceof Date) {\n if (r.getTime() === f.getTime()) continue;\n l = {\n type: \"complete\",\n oldValue: r,\n newValue: f\n };\n } else l = \"object\" == typeof r && \"object\" == typeof f && u(r) === u(f) ? c(r, f) : {\n type: \"complete\",\n oldValue: r,\n newValue: f\n };\n null != l && (null != h ? h.diff[o] = l : h = {\n type: \"partial\",\n diff: {\n [o]: l\n }\n });\n }\n }\n return h;\n}\nfunction s(t, e) {\n return p(t, e);\n}\nfunction p(t, e) {\n if (null == t) return !1;\n const n = e.split(\".\");\n let o = t;\n for (const r of n) {\n if (\"complete\" === o.type) return !0;\n if (\"partial\" !== o.type) return !1;\n {\n const t = o.diff[r];\n if (!t) return !1;\n o = t;\n }\n }\n return !0;\n}\nfunction a(t, e) {\n for (const n of e) if (p(t, n)) return !0;\n return !1;\n}\nfunction y(t, e) {\n if (!t) return !1;\n if (\"partial\" === t.type) {\n const n = Object.keys(t.diff);\n return 1 === n.length && n[0] === e;\n }\n return !1;\n}\nfunction d(t, e) {\n if (\"function\" != typeof t && \"function\" != typeof e && (null != t || null != e)) return null == t || null == e || \"object\" == typeof t && \"object\" == typeof e && u(t) !== u(e) ? {\n type: \"complete\",\n oldValue: t,\n newValue: e\n } : c(t, e);\n}\nfunction m(t) {\n if (null == t) return !0;\n switch (t.type) {\n case \"complete\":\n return !1;\n case \"collection\":\n {\n const e = t;\n for (const t of e.added) if (!m(t)) return !1;\n for (const t of e.removed) if (!m(t)) return !1;\n for (const t of e.changed) if (!m(t)) return !1;\n return !0;\n }\n case \"partial\":\n for (const e in t.diff) {\n if (!m(t.diff[e])) return !1;\n }\n return !0;\n }\n}\nexport { d as diff, p as hasDiff, a as hasDiffAny, s as hasRootDiff, y as hasRootDiffOnly, m as isEmpty };"],"mappings":"mHAOA,IAAMA,EAAI,IAAI,IAAI,CAAC,aAAc,qBAAsB,gDAAiD,+CAA+C,CAAC,EACxJ,SAASC,EAAEC,EAAG,CACZ,OAAOA,aAAaC,CACtB,CACA,SAASC,EAAEC,EAAG,CACZ,OAAOA,aAAaC,EAAI,OAAO,KAAKD,EAAE,KAAK,EAAIJ,EAAEI,CAAC,EAAIA,EAAEA,CAAC,EAAE,KAAK,EAAIA,EAAI,OAAO,KAAKA,CAAC,EAAI,CAAC,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AC5B,OAAaC,EAAE,SAAR,GAAkBA,EAAE,CAAC,IAAM,CACpC,CACA,MAAO,EACT,CACA,SAASC,EAAEF,EAAG,EAAG,CACf,GAAkB,OAAOA,GAArB,YAAwC,OAAO,GAArB,aAAmCA,GAAR,MAAqB,GAAR,MAAY,OAAeA,GAAR,MAAqB,GAAR,MAAyB,OAAOA,GAAnB,UAAoC,OAAO,GAAnB,UAAwBG,EAAEH,CAAC,IAAMG,EAAE,CAAC,EAAI,CACjL,KAAM,WACN,SAAUH,EACV,SAAU,CACZ,EAAII,EAAEJ,EAAG,CAAC,CACZ","names":["o","r","e","b","f","t","V","i","n","l","u","c","s","p","a","y","d","m","h","y","t","n","d","u","c"],"x_google_ignoreList":[0]}