@ohif/extension-default 3.14.0-beta.42 → 3.14.0-beta.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ohif/core/src/utils/thumbnailNoImageModalities"),require("@ohif/core/src/utils/isDisplaySetReconstructable"),require("@cornerstonejs/tools/utilities"),require("@cornerstonejs/tools"),require("@cornerstonejs/dicom-image-loader"),require("@ohif/app"),require("@ohif/i18n"),require("@ohif/core/src/classes/ImageSet"),require("@ohif/core/src"),require("@cornerstonejs/core"),require("@ohif/core/src/hooks/useToolbar"),require("@ohif/core/src/utils/sortStudy"),require("@cornerstonejs/calculate-suv"),require("@ohif/core"),require("@ohif/core/src/utils/toNumber"),require("@ohif/core/src/utils/sortInstancesByPosition"),require("dcmjs"),require("gl-matrix"),require("@ohif/extension-cornerstone"),require("@ohif/ui-next")):"function"==typeof define&&define.amd?define(["@ohif/core/src/utils/thumbnailNoImageModalities","@ohif/core/src/utils/isDisplaySetReconstructable","@cornerstonejs/tools/utilities","@cornerstonejs/tools","@cornerstonejs/dicom-image-loader","@ohif/app","@ohif/i18n","@ohif/core/src/classes/ImageSet","@ohif/core/src","@cornerstonejs/core","@ohif/core/src/hooks/useToolbar","@ohif/core/src/utils/sortStudy","@cornerstonejs/calculate-suv","@ohif/core","@ohif/core/src/utils/toNumber","@ohif/core/src/utils/sortInstancesByPosition","dcmjs","gl-matrix","@ohif/extension-cornerstone","@ohif/ui-next"],t):"object"==typeof exports?exports["ohif-extension-default"]=t(require("@ohif/core/src/utils/thumbnailNoImageModalities"),require("@ohif/core/src/utils/isDisplaySetReconstructable"),require("@cornerstonejs/tools/utilities"),require("@cornerstonejs/tools"),require("@cornerstonejs/dicom-image-loader"),require("@ohif/app"),require("@ohif/i18n"),require("@ohif/core/src/classes/ImageSet"),require("@ohif/core/src"),require("@cornerstonejs/core"),require("@ohif/core/src/hooks/useToolbar"),require("@ohif/core/src/utils/sortStudy"),require("@cornerstonejs/calculate-suv"),require("@ohif/core"),require("@ohif/core/src/utils/toNumber"),require("@ohif/core/src/utils/sortInstancesByPosition"),require("dcmjs"),require("gl-matrix"),require("@ohif/extension-cornerstone"),require("@ohif/ui-next")):e["ohif-extension-default"]=t(e["@ohif/core/src/utils/thumbnailNoImageModalities"],e["@ohif/core/src/utils/isDisplaySetReconstructable"],e["@cornerstonejs/tools/utilities"],e["@cornerstonejs/tools"],e["@cornerstonejs/dicom-image-loader"],e["@ohif/app"],e["@ohif/i18n"],e["@ohif/core/src/classes/ImageSet"],e["@ohif/core/src"],e["@cornerstonejs/core"],e["@ohif/core/src/hooks/useToolbar"],e["@ohif/core/src/utils/sortStudy"],e["@cornerstonejs/calculate-suv"],e["@ohif/core"],e["@ohif/core/src/utils/toNumber"],e["@ohif/core/src/utils/sortInstancesByPosition"],e.dcmjs,e["gl-matrix"],e["@ohif/extension-cornerstone"],e["@ohif/ui-next"])}(globalThis,(e,t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b)=>(()=>{var x,S,w={1810(e,t,r){"use strict";var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};t.A=function(e){var t=e.fill,r=e.width,n=e.height,o=e.style,s=function(e,t){var r={};for(var n in e)!(t.indexOf(n)>=0)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return i.default.createElement("svg",a({viewBox:"0 0 24 24",style:a({fill:void 0===t?"currentColor":t,width:void 0===r?24:r,height:void 0===n?24:n},void 0===o?{}:o)},s),i.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},9767(e,t,r){"use strict";var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};t.A=function(e){var t=e.fill,r=e.width,n=e.height,o=e.style,s=function(e,t){var r={};for(var n in e)!(t.indexOf(n)>=0)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return i.default.createElement("svg",a({viewBox:"0 0 24 24",style:a({fill:void 0===t?"currentColor":t,width:void 0===r?24:r,height:void 0===n?24:n},void 0===o?{}:o)},s),i.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},5956(e){"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),n=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},a=n.exec(e);a;){try{t[a[0]]=decodeURIComponent(a[0])}catch(e){var i=function(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=(function e(t,r){try{return[decodeURIComponent(t.join(""))]}catch(e){}if(1===t.length)return t;r=r||1;var n=t.slice(0,r),a=t.slice(r);return Array.prototype.concat.call([],e(n),e(a))})(t,n).join("")).match(r)||[];return e}}(a[0]);i!==a[0]&&(t[a[0]]=i)}a=n.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];e=e.replace(RegExp(l,"g"),t[l])}return e}(e)}}},9913(e){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),a=Array.isArray(t),i=0;i<n.length;i++){var o=n[i],s=e[o];(a?-1!==t.indexOf(o):t(o,s,e))&&(r[o]=s)}return r}},2051(e,t,r){var n=0/0,a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=u||c||Function("return this")(),f=Object.prototype.toString,p=Math.max,h=Math.min,g=function(){return d.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==f.call(t))return n;if(m(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=m(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var u=o.test(e);return u||s.test(e)?l(e.slice(2),u?2:8):i.test(e)?n:+e}e.exports=function(e,t,r){var n,a,i,o,s,l,u=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var r=n,i=a;return n=a=void 0,u=t,o=e.apply(i,r)}function b(e){var r=e-l,n=e-u;return void 0===l||r>=t||r<0||d&&n>=i}function x(){var e,r,n,a=g();if(b(a))return S(a);s=setTimeout(x,(e=a-l,r=a-u,n=t-e,d?h(n,i-r):n))}function S(e){return(s=void 0,f&&n)?v(e):(n=a=void 0,o)}function w(){var e,r=g(),i=b(r);if(n=arguments,a=this,l=r,i){if(void 0===s)return u=e=l,s=setTimeout(x,t),c?v(e):o;if(d)return s=setTimeout(x,t),v(l)}return void 0===s&&(s=setTimeout(x,t)),o}return t=y(t)||0,m(r)&&(c=!!r.leading,i=(d="maxWait"in r)?p(y(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),w.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=l=a=s=void 0},w.flush=function(){return void 0===s?o:S(g())},w}},3008(e,t,r){var n,a="__lodash_hash_undefined__",i=1/0,o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/,l=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,p="object"==typeof self&&self&&self.Object===Object&&self,h=f||p||Function("return this")(),g=Array.prototype,m=Function.prototype,y=Object.prototype,v=h["__core-js_shared__"],b=(n=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",x=m.toString,S=y.hasOwnProperty,w=y.toString,_=RegExp("^"+x.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=h.Symbol,D=g.splice,O=N(h,"Map"),k=N(Object,"create"),C=I?I.prototype:void 0,j=C?C.toString:void 0;function E(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function M(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function R(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function P(e,t){for(var r,n,a=e.length;a--;){if(r=e[a][0],r===(n=t)||r!=r&&n!=n)return a}return -1}function A(e,t){var r,n,a=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?a["string"==typeof t?"string":"hash"]:a.map}function N(e,t){var r,n,a,i=null==e?void 0:e[t];return!(!F(i)||(r=i,b&&b in r))&&("[object Function]"==(a=F(n=i)?w.call(n):"")||"[object GeneratorFunction]"==a||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(i)?_:d).test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(i))?i:void 0}E.prototype.clear=function(){this.__data__=k?k(null):{}},E.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},E.prototype.get=function(e){var t=this.__data__;if(k){var r=t[e];return r===a?void 0:r}return S.call(t,e)?t[e]:void 0},E.prototype.has=function(e){var t=this.__data__;return k?void 0!==t[e]:S.call(t,e)},E.prototype.set=function(e,t){return this.__data__[e]=k&&void 0===t?a:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,r=P(t,e);return!(r<0)&&(r==t.length-1?t.pop():D.call(t,r,1),!0)},M.prototype.get=function(e){var t=this.__data__,r=P(t,e);return r<0?void 0:t[r][1]},M.prototype.has=function(e){return P(this.__data__,e)>-1},M.prototype.set=function(e,t){var r=this.__data__,n=P(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new E,map:new(O||M),string:new E}},R.prototype.delete=function(e){return A(this,e).delete(e)},R.prototype.get=function(e){return A(this,e).get(e)},R.prototype.has=function(e){return A(this,e).has(e)},R.prototype.set=function(e,t){return A(this,e).set(e,t),this};var T=U(function(e){e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(B(e))return j?j.call(e):"";var t=e+"";return"0"==t&&1/e==-i?"-0":t}(t);var t,r=[];return l.test(e)&&r.push(""),e.replace(u,function(e,t,n,a){r.push(n?a.replace(c,"$1"):t||e)}),r});function U(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o),o};return r.cache=new(U.Cache||R),r}U.Cache=R;var L=Array.isArray;function F(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function B(e){return"symbol"==typeof e||!!e&&"object"==typeof e&&"[object Symbol]"==w.call(e)}e.exports=function(e,t,r){var n=null==e?void 0:function(e,t){var r;t=!function(e,t){if(L(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||B(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}(t,e)?L(r=t)?r:T(r):[t];for(var n=0,a=t.length;null!=e&&n<a;)e=e[function(e){if("string"==typeof e||B(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}(t[n++])];return n&&n==a?e:void 0}(e,t);return void 0===n?r:n}},3424(e,t,r){e=r.nmd(e);var n,a,i,o="__lodash_hash_undefined__",s=1/0,l="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",h="[object Map]",g="[object Number]",m="[object Object]",y="[object Promise]",v="[object RegExp]",b="[object Set]",x="[object String]",S="[object Symbol]",w="[object WeakMap]",_="[object ArrayBuffer]",I="[object DataView]",D=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,k=/^\./,C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/\\(\\)?/g,E=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[l]=R[u]=R[_]=R[c]=R[I]=R[d]=R[f]=R[p]=R[h]=R[g]=R[m]=R[v]=R[b]=R[x]=R[w]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,A="object"==typeof self&&self&&self.Object===Object&&self,N=P||A||Function("return this")(),T=t&&!t.nodeType&&t,U=T&&e&&!e.nodeType&&e,L=U&&U.exports===T&&P.process,F=function(){try{return L&&L.binding("util")}catch(e){}}(),B=F&&F.isTypedArray;function V(e,t){return!!(e?e.length:0)&&function(e,t){if(t!=t){for(var r=z,n=e.length,a=-1;++a<n;)if(r(e[a],a,e))return a;return -1}for(var i=-1,o=e.length;++i<o;)if(e[i]===t)return i;return -1}(e,t)>-1}function z(e){return e!=e}function H(e,t){return e.has(t)}function W(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function $(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Y(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var G=Array.prototype,q=Function.prototype,X=Object.prototype,K=N["__core-js_shared__"],J=(n=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Z=q.toString,Q=X.hasOwnProperty,ee=X.toString,et=RegExp("^"+Z.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),er=N.Symbol,en=N.Uint8Array,ea=X.propertyIsEnumerable,ei=G.splice,eo=(a=Object.keys,i=Object,function(e){return a(i(e))}),es=eP(N,"DataView"),el=eP(N,"Map"),eu=eP(N,"Promise"),ec=eP(N,"Set"),ed=eP(N,"WeakMap"),ef=eP(Object,"create"),ep=eB(es),eh=eB(el),eg=eB(eu),em=eB(ec),ey=eB(ed),ev=er?er.prototype:void 0,eb=ev?ev.valueOf:void 0,ex=ev?ev.toString:void 0;function eS(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ew(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function e_(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function eI(e){var t=-1,r=e?e.length:0;for(this.__data__=new e_;++t<r;)this.add(e[t])}function eD(e){this.__data__=new ew(e)}function eO(e,t){for(var r=e.length;r--;)if(ez(e[r][0],t))return r;return -1}function ek(e,t){var r;t=eT(t,e)?[t]:eW(r=t)?r:eL(r);for(var n=0,a=t.length;null!=e&&n<a;)e=e[eF(t[n++])];return n&&n==a?e:void 0}function eC(e,t){return null!=e&&t in Object(e)}function ej(e,t,r,n,a){return e===t||(null!=e&&null!=t&&(eq(e)||eX(t))?function(e,t,r,n,a,i){var o=eW(e),s=eW(t),p=u,y=u;o||(p=(p=eA(e))==l?m:p),s||(y=(y=eA(t))==l?m:y);var w=p==m&&!W(e),D=y==m&&!W(t),O=p==y;if(O&&!w)return i||(i=new eD),o||eJ(e)?eM(e,t,r,n,a,i):function(e,t,r,n,a,i,o){switch(r){case I:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case _:if(e.byteLength!=t.byteLength||!n(new en(e),new en(t)))break;return!0;case c:case d:case g:return ez(+e,+t);case f:return e.name==t.name&&e.message==t.message;case v:case x:return e==t+"";case h:var s=$;case b:var l=2&i;if(s||(s=Y),e.size!=t.size&&!l)break;var u=o.get(e);if(u)return u==t;i|=1,o.set(e,t);var p=eM(s(e),s(t),n,a,i,o);return o.delete(e),p;case S:if(eb)return eb.call(e)==eb.call(t)}return!1}(e,t,p,r,n,a,i);if(!(2&a)){var k=w&&Q.call(e,"__wrapped__"),C=D&&Q.call(t,"__wrapped__");if(k||C){var j=k?e.value():e,E=C?t.value():t;return i||(i=new eD),r(j,E,n,a,i)}}return!!O&&(i||(i=new eD),function(e,t,r,n,a,i){var o=2&a,s=eZ(e),l=s.length;if(l!=eZ(t).length&&!o)return!1;for(var u=l;u--;){var c=s[u];if(!(o?c in t:Q.call(t,c)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var f=!0;i.set(e,t),i.set(t,e);for(var p=o;++u<l;){var h=e[c=s[u]],g=t[c];if(n)var m=o?n(g,h,c,t,e,i):n(h,g,c,e,t,i);if(!(void 0===m?h===g||r(h,g,n,a,i):m)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var y=e.constructor,v=t.constructor;y!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v)&&(f=!1)}return i.delete(e),i.delete(t),f}(e,t,r,n,a,i))}(e,t,ej,r,n,a):e!=e&&t!=t)}eS.prototype.clear=function(){this.__data__=ef?ef(null):{}},eS.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},eS.prototype.get=function(e){var t=this.__data__;if(ef){var r=t[e];return r===o?void 0:r}return Q.call(t,e)?t[e]:void 0},eS.prototype.has=function(e){var t=this.__data__;return ef?void 0!==t[e]:Q.call(t,e)},eS.prototype.set=function(e,t){return this.__data__[e]=ef&&void 0===t?o:t,this},ew.prototype.clear=function(){this.__data__=[]},ew.prototype.delete=function(e){var t=this.__data__,r=eO(t,e);return!(r<0)&&(r==t.length-1?t.pop():ei.call(t,r,1),!0)},ew.prototype.get=function(e){var t=this.__data__,r=eO(t,e);return r<0?void 0:t[r][1]},ew.prototype.has=function(e){return eO(this.__data__,e)>-1},ew.prototype.set=function(e,t){var r=this.__data__,n=eO(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},e_.prototype.clear=function(){this.__data__={hash:new eS,map:new(el||ew),string:new eS}},e_.prototype.delete=function(e){return eR(this,e).delete(e)},e_.prototype.get=function(e){return eR(this,e).get(e)},e_.prototype.has=function(e){return eR(this,e).has(e)},e_.prototype.set=function(e,t){return eR(this,e).set(e,t),this},eI.prototype.add=eI.prototype.push=function(e){return this.__data__.set(e,o),this},eI.prototype.has=function(e){return this.__data__.has(e)},eD.prototype.clear=function(){this.__data__=new ew},eD.prototype.delete=function(e){return this.__data__.delete(e)},eD.prototype.get=function(e){return this.__data__.get(e)},eD.prototype.has=function(e){return this.__data__.has(e)},eD.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ew){var n=r.__data__;if(!el||n.length<199)return n.push([e,t]),this;r=this.__data__=new e_(n)}return r.set(e,t),this};var eE=ec&&1/Y(new ec([,-0]))[1]==s?function(e){return new ec(e)}:function(){};function eM(e,t,r,n,a,i){var o=2&a,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var c=-1,d=!0,f=1&a?new eI:void 0;for(i.set(e,t),i.set(t,e);++c<s;){var p=e[c],h=t[c];if(n)var g=o?n(h,p,c,t,e,i):n(p,h,c,e,t,i);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!function(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!f.has(t)&&(p===e||r(p,e,n,a,i)))return f.add(t)})){d=!1;break}}else if(!(p===h||r(p,h,n,a,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function eR(e,t){var r,n,a=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?a["string"==typeof t?"string":"hash"]:a.map}function eP(e,t){var r,n=null==e?void 0:e[t];return!(!eq(n)||(r=n,J&&J in r))&&(eY(n)||W(n)?et:E).test(eB(n))?n:void 0}var eA=function(e){return ee.call(e)};function eN(e,t){return!!(t=null==t?0x1fffffffffffff:t)&&("number"==typeof e||M.test(e))&&e>-1&&e%1==0&&e<t}function eT(e,t){if(eW(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||eK(e))||O.test(e)||!D.test(e)||null!=t&&e in Object(t)}(es&&eA(new es(new ArrayBuffer(1)))!=I||el&&eA(new el)!=h||eu&&eA(eu.resolve())!=y||ec&&eA(new ec)!=b||ed&&eA(new ed)!=w)&&(eA=function(e){var t=ee.call(e),r=t==m?e.constructor:void 0,n=r?eB(r):void 0;if(n)switch(n){case ep:return I;case eh:return h;case eg:return y;case em:return b;case ey:return w}return t});function eU(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}var eL=eV(function(e){e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(eK(e))return ex?ex.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var t,r=[];return k.test(e)&&r.push(""),e.replace(C,function(e,t,n,a){r.push(n?a.replace(j,"$1"):t||e)}),r});function eF(e){if("string"==typeof e||eK(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function eB(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eV(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o),o};return r.cache=new(eV.Cache||e_),r}function ez(e,t){return e===t||e!=e&&t!=t}function eH(e){var t;return eX(t=e)&&e$(t)&&Q.call(e,"callee")&&(!ea.call(e,"callee")||ee.call(e)==l)}eV.Cache=e_;var eW=Array.isArray;function e$(e){return null!=e&&eG(e.length)&&!eY(e)}function eY(e){var t=eq(e)?ee.call(e):"";return t==p||"[object GeneratorFunction]"==t}function eG(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function eq(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eX(e){return!!e&&"object"==typeof e}function eK(e){return"symbol"==typeof e||eX(e)&&ee.call(e)==S}var eJ=B?function(e){return B(e)}:function(e){return eX(e)&&eG(e.length)&&!!R[ee.call(e)]};function eZ(e){return e$(e)?function(e){var t=eW(e)||eH(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],r=t.length,n=!!r;for(var a in e)Q.call(e,a)&&!(n&&("length"==a||eN(a,r)))&&t.push(a);return t}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||X))return eo(e);var t,r,n=[];for(var a in Object(e))Q.call(e,a)&&"constructor"!=a&&n.push(a);return n}(e)}function eQ(e){return e}e.exports=function(e,t){var r,n,a,i,o;return e&&e.length?function(e,t){var r=-1,n=V,a=e.length,i=!0,o=[],s=o;if(a>=200){var l=t?null:eE(e);if(l)return Y(l);i=!1,n=H,s=new eI}else s=t?[]:o;e:for(;++r<a;){var u=e[r],c=t?t(u):u;if(u=0!==u?u:0,i&&c==c){for(var d=s.length;d--;)if(s[d]===c)continue e;t&&s.push(c),o.push(u)}else n(s,c,void 0)||(s!==o&&s.push(c),o.push(u))}return o}(e,"function"==typeof t?t:null==t?eQ:"object"==typeof t?eW(t)?(r=t[0],n=t[1],eT(r)&&(a=n)==a&&!eq(a)?eU(eF(r),n):function(e){var t,a,i,o,s,l=(t=e,a=r,void 0===(i=null==t?void 0:ek(t,a))?void 0:i);return void 0===l&&l===n?(o=e,s=r,null!=o&&function(e,t,r){t=eT(t,e)?[t]:eW(n=t)?n:eL(n);for(var n,a,i=-1,o=t.length;++i<o;){var s=eF(t[i]);if(!(a=null!=e&&r(e,s)))break;e=e[s]}if(a)return a;var o=e?e.length:0;return!!o&&eG(o)&&eN(s,o)&&(eW(e)||eH(e))}(o,s,eC)):ej(n,l,void 0,3)}):1==(o=function(e){for(var t=eZ(e),r=t.length;r--;){var n,a=t[r],i=e[a];t[r]=[a,i,(n=i)==n&&!eq(n)]}return t}(i=t)).length&&o[0][2]?eU(o[0][0],o[0][1]):function(e){return e===i||function(e,t){var r=t.length,n=r;if(null==e)return!n;for(e=Object(e);r--;){var a=t[r];if((0,a[2])?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<n;){var i=(a=t[r])[0],o=e[i],s=a[1];if(0,a[2]){if(void 0===o&&!(i in e))return!1}else{var l,u=new eD;if(!(void 0===l?ej(s,o,void 0,3,u):l))return!1}}return!0}(e,o)}:function(e){var t;return eT(e)?(t=eF(e),function(e){return null==e?void 0:e[t]}):function(t){return ek(t,e)}}(t)):[]}},5178(e,t,r){e.exports=r(3188)(r(7183),"DataView")},3615(e,t,r){var n=r(8342),a=r(9184),i=r(128),o=r(4287),s=r(7);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,e.exports=l},789(e,t,r){var n=r(7752),a=r(718),i=r(7849),o=r(3957),s=r(845);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,e.exports=l},8561(e,t,r){e.exports=r(3188)(r(7183),"Map")},1451(e,t,r){var n=r(5674),a=r(1036),i=r(31),o=r(1907),s=r(971);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,e.exports=l},1490(e,t,r){e.exports=r(3188)(r(7183),"Promise")},6775(e,t,r){e.exports=r(3188)(r(7183),"Set")},8869(e,t,r){var n=r(1451),a=r(6810),i=r(5813);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=a,o.prototype.has=i,e.exports=o},2823(e,t,r){var n=r(789),a=r(8926),i=r(2680),o=r(3851),s=r(8423),l=r(3967);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=a,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=l,e.exports=u},7187(e,t,r){e.exports=r(7183).Symbol},6846(e,t,r){e.exports=r(7183).Uint8Array},1366(e,t,r){e.exports=r(3188)(r(7183),"WeakMap")},607(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},836(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}},661(e,t,r){var n=r(142),a=r(5962),i=r(4383),o=r(8098),s=r(4683),l=r(3905),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),c=!r&&a(e),d=!r&&!c&&o(e),f=!r&&!c&&!d&&l(e),p=r||c||d||f,h=p?n(e.length,String):[],g=h.length;for(var m in e)(t||u.call(e,m))&&!(p&&("length"==m||d&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g)))&&h.push(m);return h}},6138(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}},5862(e){e.exports=function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}},7938(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},2177(e,t,r){var n=r(9142),a=r(9830),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];i.call(e,t)&&a(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},435(e,t,r){var n=r(9830);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return -1}},267(e,t,r){var n=r(6837),a=r(8420);e.exports=function(e,t){return e&&n(t,a(t),e)}},5240(e,t,r){var n=r(6837),a=r(3435);e.exports=function(e,t){return e&&n(t,a(t),e)}},9142(e,t,r){var n=r(3733);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9557(e,t,r){var n=r(2823),a=r(607),i=r(2177),o=r(267),s=r(5240),l=r(6064),u=r(8601),c=r(2881),d=r(6186),f=r(3300),p=r(4667),h=r(8355),g=r(6203),m=r(7981),y=r(235),v=r(4383),b=r(8098),x=r(4024),S=r(6015),w=r(8802),_=r(8420),I=r(3435),D="[object Arguments]",O="[object Function]",k="[object Object]",C={};C[D]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[k]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[O]=C["[object WeakMap]"]=!1,e.exports=function e(t,r,j,E,M,R){var P,A=1&r,N=2&r,T=4&r;if(j&&(P=M?j(t,E,M,R):j(t)),void 0!==P)return P;if(!S(t))return t;var U=v(t);if(U){if(P=g(t),!A)return u(t,P)}else{var L=h(t),F=L==O||"[object GeneratorFunction]"==L;if(b(t))return l(t,A);if(L==k||L==D||F&&!M){if(P=N||F?{}:y(t),!A)return N?d(t,s(P,t)):c(t,o(P,t))}else{if(!C[L])return M?t:{};P=m(t,L,A)}}R||(R=new n);var B=R.get(t);if(B)return B;R.set(t,P),w(t)?t.forEach(function(n){P.add(e(n,r,j,n,t,R))}):x(t)&&t.forEach(function(n,a){P.set(a,e(n,r,j,a,t,R))});var V=T?N?p:f:N?I:_,z=U?void 0:V(t);return a(z||t,function(n,a){z&&(n=t[a=n]),i(P,a,e(n,r,j,a,t,R))}),P}},1534(e,t,r){var n=r(6015),a=Object.create;e.exports=function(){function e(){}return function(t){if(!n(t))return{};if(a)return a(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}()},4183(e,t,r){var n=r(6895);e.exports=r(9835)(n)},1311(e,t,r){e.exports=r(7747)()},6895(e,t,r){var n=r(1311),a=r(8420);e.exports=function(e,t){return e&&n(e,t,a)}},2748(e,t,r){var n=r(4679),a=r(4671);e.exports=function(e,t){t=n(t,e);for(var r=0,i=t.length;null!=e&&r<i;)e=e[a(t[r++])];return r&&r==i?e:void 0}},9169(e,t,r){var n=r(5862),a=r(4383);e.exports=function(e,t,r){var i=t(e);return a(e)?i:n(i,r(e))}},6990(e,t,r){var n=r(7187),a=r(1029),i=r(8704),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?a(e):i(e)}},1607(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},6252(e,t,r){var n=r(6990),a=r(6184);e.exports=function(e){return a(e)&&"[object Arguments]"==n(e)}},3028(e,t,r){var n=r(7114),a=r(6184);e.exports=function e(t,r,i,o,s){return t===r||(null!=t&&null!=r&&(a(t)||a(r))?n(t,r,i,o,e,s):t!=t&&r!=r)}},7114(e,t,r){var n=r(2823),a=r(5237),i=r(3728),o=r(5355),s=r(8355),l=r(4383),u=r(8098),c=r(3905),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,g,m,y){var v=l(e),b=l(t),x=v?f:s(e),S=b?f:s(t);x=x==d?p:x,S=S==d?p:S;var w=x==p,_=S==p,I=x==S;if(I&&u(e)){if(!u(t))return!1;v=!0,w=!1}if(I&&!w)return y||(y=new n),v||c(e)?a(e,t,r,g,m,y):i(e,t,x,r,g,m,y);if(!(1&r)){var D=w&&h.call(e,"__wrapped__"),O=_&&h.call(t,"__wrapped__");if(D||O){var k=D?e.value():e,C=O?t.value():t;return y||(y=new n),m(k,C,r,g,y)}}return!!I&&(y||(y=new n),o(e,t,r,g,m,y))}},162(e,t,r){var n=r(8355),a=r(6184);e.exports=function(e){return a(e)&&"[object Map]"==n(e)}},9121(e,t,r){var n=r(2823),a=r(3028);e.exports=function(e,t,r,i){var o=r.length,s=o,l=!i;if(null==e)return!s;for(e=Object(e);o--;){var u=r[o];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=r[o])[0],d=e[c],f=u[1];if(l&&u[2]){if(void 0===d&&!(c in e))return!1}else{var p=new n;if(i)var h=i(d,f,c,e,t,p);if(!(void 0===h?a(f,d,3,i,p):h))return!1}}return!0}},3829(e,t,r){var n=r(4360),a=r(7234),i=r(6015),o=r(275),s=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,d=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||a(e))&&(n(e)?d:s).test(o(e))}},8344(e,t,r){var n=r(8355),a=r(6184);e.exports=function(e){return a(e)&&"[object Set]"==n(e)}},4271(e,t,r){var n=r(6990),a=r(1784),i=r(6184),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&a(e.length)&&!!o[n(e)]}},4207(e,t,r){var n=r(2801),a=r(2208),i=r(9090),o=r(4383),s=r(3681);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?o(e)?a(e[0],e[1]):n(e):s(e)}},9966(e,t,r){var n=r(8089),a=r(6128),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},7641(e,t,r){var n=r(6015),a=r(8089),i=r(5567),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=a(e),r=[];for(var s in e)"constructor"==s&&(t||!o.call(e,s))||r.push(s);return r}},5218(e,t,r){var n=r(4183),a=r(9592);e.exports=function(e,t){var r=-1,i=a(e)?Array(e.length):[];return n(e,function(e,n,a){i[++r]=t(e,n,a)}),i}},2801(e,t,r){var n=r(9121),a=r(9406),i=r(6459);e.exports=function(e){var t=a(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},2208(e,t,r){var n=r(3028),a=r(9650),i=r(2993),o=r(9668),s=r(8938),l=r(6459),u=r(4671);e.exports=function(e,t){return o(e)&&s(t)?l(u(e),t):function(r){var o=a(r,e);return void 0===o&&o===t?i(r,e):n(t,o,3)}}},5351(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},4953(e,t,r){var n=r(2748);e.exports=function(e){return function(t){return n(t,e)}}},142(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},4742(e,t,r){var n=r(7187),a=r(6138),i=r(4383),o=r(3536),s=1/0,l=n?n.prototype:void 0,u=l?l.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return a(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-s?"-0":r}},6143(e){e.exports=function(e){return function(t){return e(t)}}},7773(e){e.exports=function(e,t){return e.has(t)}},4420(e,t,r){var n=r(9090);e.exports=function(e){return"function"==typeof e?e:n}},4679(e,t,r){var n=r(4383),a=r(9668),i=r(412),o=r(2832);e.exports=function(e,t){return n(e)?e:a(e,t)?[e]:i(o(e))}},3911(e,t,r){var n=r(6846);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},6064(e,t,r){e=r.nmd(e);var n=r(7183),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,o=i&&i.exports===a?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},3887(e,t,r){var n=r(3911);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},1871(e){var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},5938(e,t,r){var n=r(7187),a=n?n.prototype:void 0,i=a?a.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},1671(e,t,r){var n=r(3911);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},8601(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},6837(e,t,r){var n=r(2177),a=r(9142);e.exports=function(e,t,r,i){var o=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=i?i(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?a(r,u,c):n(r,u,c)}return r}},2881(e,t,r){var n=r(6837),a=r(9946);e.exports=function(e,t){return n(e,a(e),t)}},6186(e,t,r){var n=r(6837),a=r(1693);e.exports=function(e,t){return n(e,a(e),t)}},5171(e,t,r){e.exports=r(7183)["__core-js_shared__"]},9835(e,t,r){var n=r(9592);e.exports=function(e,t){return function(r,a){if(null==r)return r;if(!n(r))return e(r,a);for(var i=r.length,o=t?i:-1,s=Object(r);(t?o--:++o<i)&&!1!==a(s[o],o,s););return r}}},7747(e){e.exports=function(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(!1===r(i[l],l,i))break}return t}}},3733(e,t,r){var n=r(3188);e.exports=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},5237(e,t,r){var n=r(8869),a=r(7938),i=r(7773);e.exports=function(e,t,r,o,s,l){var u=1&r,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var h=-1,g=!0,m=2&r?new n:void 0;for(l.set(e,t),l.set(t,e);++h<c;){var y=e[h],v=t[h];if(o)var b=u?o(v,y,h,t,e,l):o(y,v,h,e,t,l);if(void 0!==b){if(b)continue;g=!1;break}if(m){if(!a(t,function(e,t){if(!i(m,t)&&(y===e||s(y,e,r,o,l)))return m.push(t)})){g=!1;break}}else if(!(y===v||s(y,v,r,o,l))){g=!1;break}}return l.delete(e),l.delete(t),g}},3728(e,t,r){var n=r(7187),a=r(6846),i=r(9830),o=r(5237),s=r(8887),l=r(8629),u=n?n.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,r,n,u,d,f){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new a(e),new a(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var h=1&n;if(p||(p=l),e.size!=t.size&&!h)break;var g=f.get(e);if(g)return g==t;n|=2,f.set(e,t);var m=o(p(e),p(t),n,u,d,f);return f.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},5355(e,t,r){var n=r(3300),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,o,s){var l=1&r,u=n(e),c=u.length;if(c!=n(t).length&&!l)return!1;for(var d=c;d--;){var f=u[d];if(!(l?f in t:a.call(t,f)))return!1}var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d<c;){var y=e[f=u[d]],v=t[f];if(i)var b=l?i(v,y,f,t,e,s):i(y,v,f,e,t,s);if(!(void 0===b?y===v||o(y,v,r,i,s):b)){g=!1;break}m||(m="constructor"==f)}if(g&&!m){var x=e.constructor,S=t.constructor;x!=S&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof S&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}},5194(e,t,r){e.exports="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g},3300(e,t,r){var n=r(9169),a=r(9946),i=r(8420);e.exports=function(e){return n(e,i,a)}},4667(e,t,r){var n=r(9169),a=r(1693),i=r(3435);e.exports=function(e){return n(e,i,a)}},8037(e,t,r){var n=r(5912);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},9406(e,t,r){var n=r(8938),a=r(8420);e.exports=function(e){for(var t=a(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,n(o)]}return t}},3188(e,t,r){var n=r(3829),a=r(1870);e.exports=function(e,t){var r=a(e,t);return n(r)?r:void 0}},9637(e,t,r){e.exports=r(1429)(Object.getPrototypeOf,Object)},1029(e,t,r){var n=r(7187),a=Object.prototype,i=a.hasOwnProperty,o=a.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var a=o.call(e);return n&&(t?e[s]=r:delete e[s]),a}},9946(e,t,r){var n=r(836),a=r(6499),i=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;e.exports=o?function(e){return null==e?[]:n(o(e=Object(e)),function(t){return i.call(e,t)})}:a},1693(e,t,r){var n=r(5862),a=r(9637),i=r(9946),o=r(6499);e.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=a(e);return t}:o},8355(e,t,r){var n=r(5178),a=r(8561),i=r(1490),o=r(6775),s=r(1366),l=r(6990),u=r(275),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",g=u(n),m=u(a),y=u(i),v=u(o),b=u(s),x=l;(n&&x(new n(new ArrayBuffer(1)))!=h||a&&x(new a)!=c||i&&x(i.resolve())!=d||o&&x(new o)!=f||s&&x(new s)!=p)&&(x=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case g:return h;case m:return c;case y:return d;case v:return f;case b:return p}return t}),e.exports=x},1870(e){e.exports=function(e,t){return null==e?void 0:e[t]}},3852(e,t,r){var n=r(4679),a=r(5962),i=r(4383),o=r(4683),s=r(1784),l=r(4671);e.exports=function(e,t,r){t=n(t,e);for(var u=-1,c=t.length,d=!1;++u<c;){var f=l(t[u]);if(!(d=null!=e&&r(e,f)))break;e=e[f]}return d||++u!=c?d:!!(c=null==e?0:e.length)&&s(c)&&o(f,c)&&(i(e)||a(e))}},8342(e,t,r){var n=r(1960);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},9184(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},128(e,t,r){var n=r(1960),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return a.call(t,e)?t[e]:void 0}},4287(e,t,r){var n=r(1960),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:a.call(t,e)}},7(e,t,r){var n=r(1960);e.exports=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},6203(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},7981(e,t,r){var n=r(3911),a=r(3887),i=r(1871),o=r(5938),s=r(1671);e.exports=function(e,t,r){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return a(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return i(e);case"[object Symbol]":return o(e)}}},235(e,t,r){var n=r(1534),a=r(9637),i=r(8089);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(a(e))}},4683(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9668(e,t,r){var n=r(4383),a=r(3536),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||a(e))||o.test(e)||!i.test(e)||null!=t&&e in Object(t)}},5912(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7234(e,t,r){var n,a=r(5171),i=(n=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},8089(e){var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},8938(e,t,r){var n=r(6015);e.exports=function(e){return e==e&&!n(e)}},7752(e){e.exports=function(){this.__data__=[],this.size=0}},718(e,t,r){var n=r(435),a=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():a.call(t,r,1),--this.size,!0)}},7849(e,t,r){var n=r(435);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},3957(e,t,r){var n=r(435);e.exports=function(e){return n(this.__data__,e)>-1}},845(e,t,r){var n=r(435);e.exports=function(e,t){var r=this.__data__,a=n(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}},5674(e,t,r){var n=r(3615),a=r(789),i=r(8561);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||a),string:new n}}},1036(e,t,r){var n=r(8037);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=!!t,t}},31(e,t,r){var n=r(8037);e.exports=function(e){return n(this,e).get(e)}},1907(e,t,r){var n=r(8037);e.exports=function(e){return n(this,e).has(e)}},971(e,t,r){var n=r(8037);e.exports=function(e,t){var r=n(this,e),a=r.size;return r.set(e,t),this.size+=+(r.size!=a),this}},8887(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},6459(e){e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},2110(e,t,r){var n=r(9098);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},1960(e,t,r){e.exports=r(3188)(Object,"create")},6128(e,t,r){e.exports=r(1429)(Object.keys,Object)},5567(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},3271(e,t,r){e=r.nmd(e);var n=r(5194),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,o=i&&i.exports===a&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},8704(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1429(e){e.exports=function(e,t){return function(r){return e(t(r))}}},7183(e,t,r){var n=r(5194),a="object"==typeof self&&self&&self.Object===Object&&self;e.exports=n||a||Function("return this")()},6810(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},5813(e){e.exports=function(e){return this.__data__.has(e)}},8629(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},8926(e,t,r){var n=r(789);e.exports=function(){this.__data__=new n,this.size=0}},2680(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3851(e){e.exports=function(e){return this.__data__.get(e)}},8423(e){e.exports=function(e){return this.__data__.has(e)}},3967(e,t,r){var n=r(789),a=r(8561),i=r(1451);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!a||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(o)}return r.set(e,t),this.size=r.size,this}},412(e,t,r){var n=r(2110),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;e.exports=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(a,function(e,r,n,a){t.push(n?a.replace(i,"$1"):r||e)}),t})},4671(e,t,r){var n=r(3536),a=1/0;e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}},275(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1285(e,t,r){var n=r(9557);e.exports=function(e){return n(e,5)}},9830(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2122(e,t,r){var n=r(6895),a=r(4420);e.exports=function(e,t){return e&&n(e,a(t))}},9650(e,t,r){var n=r(2748);e.exports=function(e,t,r){var a=null==e?void 0:n(e,t);return void 0===a?r:a}},2993(e,t,r){var n=r(1607),a=r(3852);e.exports=function(e,t){return null!=e&&a(e,t,n)}},9090(e){e.exports=function(e){return e}},5962(e,t,r){var n=r(6252),a=r(6184),i=Object.prototype,o=i.hasOwnProperty,s=i.propertyIsEnumerable;e.exports=n(function(){return arguments}())?n:function(e){return a(e)&&o.call(e,"callee")&&!s.call(e,"callee")}},4383(e){e.exports=Array.isArray},9592(e,t,r){var n=r(4360),a=r(1784);e.exports=function(e){return null!=e&&a(e.length)&&!n(e)}},8098(e,t,r){e=r.nmd(e);var n=r(7183),a=r(1329),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||a},4360(e,t,r){var n=r(6990),a=r(6015);e.exports=function(e){if(!a(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1784(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},4024(e,t,r){var n=r(162),a=r(6143),i=r(3271),o=i&&i.isMap;e.exports=o?a(o):n},6015(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},6184(e){e.exports=function(e){return null!=e&&"object"==typeof e}},5229(e,t,r){var n=r(6990),a=r(9637),i=r(6184),o=Object.prototype,s=Function.prototype.toString,l=o.hasOwnProperty,u=s.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=a(e);if(null===t)return!0;var r=l.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==u}},8802(e,t,r){var n=r(8344),a=r(6143),i=r(3271),o=i&&i.isSet;e.exports=o?a(o):n},7561(e,t,r){var n=r(6990),a=r(4383),i=r(6184);e.exports=function(e){return"string"==typeof e||!a(e)&&i(e)&&"[object String]"==n(e)}},3536(e,t,r){var n=r(6990),a=r(6184);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==n(e)}},3905(e,t,r){var n=r(4271),a=r(6143),i=r(3271),o=i&&i.isTypedArray;e.exports=o?a(o):n},8420(e,t,r){var n=r(661),a=r(9966),i=r(9592);e.exports=function(e){return i(e)?n(e):a(e)}},3435(e,t,r){var n=r(661),a=r(7641),i=r(9592);e.exports=function(e){return i(e)?n(e,!0):a(e)}},764(e,t,r){var n=r(6138),a=r(4207),i=r(5218),o=r(4383);e.exports=function(e,t){return(o(e)?n:i)(e,a(t,3))}},9098(e,t,r){var n=r(1451);function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(a.Cache||n),r}a.Cache=n,e.exports=a},3681(e,t,r){var n=r(5351),a=r(4953),i=r(9668),o=r(4671);e.exports=function(e){return i(e)?n(o(e)):a(e)}},6499(e){e.exports=function(){return[]}},1329(e){e.exports=function(){return!1}},2832(e,t,r){var n=r(4742);e.exports=function(e){return null==e?"":n(e)}},4867(e,t,r){e=r.nmd(e),e.exports=function(){"use strict";function t(){return V.apply(null,arguments)}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){var t;if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(t in e)if(i(e,t))return!1;return!0}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var r,n=[],a=e.length;for(r=0;r<a;++r)n.push(t(e[r],r));return n}function d(e,t){for(var r in t)i(t,r)&&(e[r]=t[r]);return i(t,"toString")&&(e.toString=t.toString),i(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,r,n){return ti(e,t,r,n,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function h(e){var t=null,r=!1,n=e._d&&!isNaN(e._d.getTime());return(n&&(t=p(e),r=z.call(t.parsedDateParts,function(e){return null!=e}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e))?n:(e._isValid=n,e._isValid)}function g(e){var t=f(NaN);return null!=e?d(p(t),e):p(t).userInvalidated=!0,t}z=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var m,y,v=t.momentProperties=[],b=!1;function x(e,t){var r,n,a,i=v.length;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=p(t)),s(t._locale)||(e._locale=t._locale),i>0)for(r=0;r<i;r++)s(a=t[n=v[r]])||(e[n]=a);return e}function S(e){x(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,t.updateOffset(this),b=!1)}function w(e){return e instanceof S||null!=e&&null!=e._isAMomentObject}function _(e){!1===t.suppressDeprecationWarnings&&"u">typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function I(e,r){var n=!0;return d(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){var a,o,s,l=[],u=arguments.length;for(o=0;o<u;o++){if(a="","object"==typeof arguments[o]){for(s in a+="\n["+o+"] ",arguments[0])i(arguments[0],s)&&(a+=s+": "+arguments[0][s]+", ");a=a.slice(0,-2)}else a=arguments[o];l.push(a)}_(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+Error().stack),n=!1}return r.apply(this,arguments)},r)}var D={};function O(e,r){null!=t.deprecationHandler&&t.deprecationHandler(e,r),D[e]||(_(r),D[e]=!0)}function k(e){return"u">typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var r,n=d({},e);for(r in t)i(t,r)&&(a(e[r])&&a(t[r])?(n[r]={},d(n[r],e[r]),d(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)i(e,r)&&!i(t,r)&&a(e[r])&&(n[r]=d({},n[r]));return n}function j(e){null!=e&&this.set(e)}function E(e,t,r){var n=""+Math.abs(e);return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,t-n.length)).toString().substr(1)+n}t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var M=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},A={};function N(e,t,r,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),e&&(A[e]=a),t&&(A[t[0]]=function(){return E(a.apply(this,arguments),t[1],t[2])}),r&&(A[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function T(e,t){return e.isValid()?(P[t=U(t,e.localeData())]=P[t]||function(e){var t,r,n,a=e.match(M);for(r=0,n=a.length;r<n;r++)A[a[r]]?a[r]=A[a[r]]:a[r]=(t=a[r]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=k(a[r])?a[r].call(t,e):a[r];return i}}(t),P[t](e)):e.localeData().invalidDate()}function U(e,t){var r=5;function n(e){return t.longDateFormat(e)||e}for(R.lastIndex=0;r>=0&&R.test(e);)e=e.replace(R,n),R.lastIndex=0,r-=1;return e}var L={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function F(e){return"string"==typeof e?L[e]||L[e.toLowerCase()]:void 0}function B(e){var t,r,n={};for(r in e)i(e,r)&&(t=F(r))&&(n[t]=e[r]);return n}var V,z,H,W={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},$=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)i(e,t)&&r.push(t);return r},Y=/\d/,G=/\d\d/,q=/\d{3}/,X=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Z=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,ee=/\d{1,3}/,et=/\d{1,4}/,er=/[+-]?\d{1,6}/,en=/\d+/,ea=/[+-]?\d+/,ei=/Z|[+-]\d\d:?\d\d/gi,eo=/Z|[+-]\d\d(?::?\d\d)?/gi,es=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,el=/^[1-9]\d?/,eu=/^([1-9]\d|\d)/;function ec(e,t,r){H[e]=k(t)?t:function(e,n){return e&&r?r:t}}function ed(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ef(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ep(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=ef(t)),r}H={};var eh={};function eg(e,t){var r,n,a=t;for("string"==typeof e&&(e=[e]),l(t)&&(a=function(e,r){r[t]=ep(e)}),n=e.length,r=0;r<n;r++)eh[e[r]]=a}function em(e,t){eg(e,function(e,r,n,a){n._w=n._w||{},t(e,n._w,n,a)})}function ey(e){return e%4==0&&e%100!=0||e%400==0}function ev(e){return ey(e)?366:365}N("Y",0,0,function(){var e=this.year();return e<=9999?E(e,4):"+"+e}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),ec("Y",ea),ec("YY",J,G),ec("YYYY",et,X),ec("YYYYY",er,K),ec("YYYYYY",er,K),eg(["YYYYY","YYYYYY"],0),eg("YYYY",function(e,r){r[0]=2===e.length?t.parseTwoDigitYear(e):ep(e)}),eg("YY",function(e,r){r[0]=t.parseTwoDigitYear(e)}),eg("Y",function(e,t){t[0]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return ep(e)+(ep(e)>68?1900:2e3)};var eb=ex("FullYear",!0);function ex(e,r){return function(n){return null!=n?(ew(this,e,n),t.updateOffset(this,r),this):eS(this,e)}}function eS(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function ew(e,t,r){var n,a,i,o;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(a?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(a?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(a?n.setUTCHours(r):n.setHours(r));case"Date":return void(a?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=e.month(),o=29!==(o=e.date())||1!==i||ey(r)?o:28,a?n.setUTCFullYear(r,i,o):n.setFullYear(r,i,o)}}function e_(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=(t%12+12)%12;return e+=(t-r)/12,1===r?ey(e)?29:28:31-r%7%2}eH=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return -1},N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),N("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ec("M",J,el),ec("MM",J,G),ec("MMM",function(e,t){return t.monthsShortRegex(e)}),ec("MMMM",function(e,t){return t.monthsRegex(e)}),eg(["M","MM"],function(e,t){t[1]=ep(e)-1}),eg(["MMM","MMMM"],function(e,t,r,n){var a=r._locale.monthsParse(e,n,r._strict);null!=a?t[1]=a:p(r).invalidMonth=e});var eI="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),eD=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;function eO(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();if(r)if("MMM"===t)return -1!==(a=eH.call(this._shortMonthsParse,o))?a:null;else return -1!==(a=eH.call(this._longMonthsParse,o))?a:null;return"MMM"===t?-1!==(a=eH.call(this._shortMonthsParse,o))||-1!==(a=eH.call(this._longMonthsParse,o))?a:null:-1!==(a=eH.call(this._longMonthsParse,o))||-1!==(a=eH.call(this._shortMonthsParse,o))?a:null}function ek(e,t){if(!e.isValid())return e;if("string"==typeof t){if(/^\d+$/.test(t))t=ep(t);else if(!l(t=e.localeData().monthsParse(t)))return e}var r=t,n=e.date();return n=n<29?n:Math.min(n,e_(e.year(),r)),e._isUTC?e._d.setUTCMonth(r,n):e._d.setMonth(r,n),e}function eC(e){return null!=e?(ek(this,e),t.updateOffset(this,!0),this):eS(this,"Month")}function ej(){function e(e,t){return t.length-e.length}var t,r,n,a,i=[],o=[],s=[];for(t=0;t<12;t++)r=f([2e3,t]),n=ed(this.monthsShort(r,"")),a=ed(this.months(r,"")),i.push(n),o.push(a),s.push(a),s.push(n);i.sort(e),o.sort(e),s.sort(e),this._monthsRegex=RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=RegExp("^("+i.join("|")+")","i")}function eE(e,t,r,n,a,i,o){var s;return e<100&&e>=0?isFinite((s=new Date(e+400,t,r,n,a,i,o)).getFullYear())&&s.setFullYear(e):s=new Date(e,t,r,n,a,i,o),s}function eM(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,isFinite((t=new Date(Date.UTC.apply(null,r))).getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function eR(e,t,r){var n=7+t-r;return-((7+eM(e,0,n).getUTCDay()-t)%7)+n-1}function eP(e,t,r,n,a){var i,o,s=1+7*(t-1)+(7+r-n)%7+eR(e,n,a);return s<=0?o=ev(i=e-1)+s:s>ev(e)?(i=e+1,o=s-ev(e)):(i=e,o=s),{year:i,dayOfYear:o}}function eA(e,t,r){var n,a,i=eR(e.year(),t,r),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?n=o+eN(a=e.year()-1,t,r):o>eN(e.year(),t,r)?(n=o-eN(e.year(),t,r),a=e.year()+1):(a=e.year(),n=o),{week:n,year:a}}function eN(e,t,r){var n=eR(e,t,r),a=eR(e+1,t,r);return(ev(e)-n+a)/7}function eT(e,t){return e.slice(t,7).concat(e.slice(0,t))}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),ec("w",J,el),ec("ww",J,G),ec("W",J,el),ec("WW",J,G),em(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=ep(e)}),N("d",0,"do","day"),N("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),N("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),N("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),ec("d",J),ec("e",J),ec("E",J),ec("dd",function(e,t){return t.weekdaysMinRegex(e)}),ec("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ec("dddd",function(e,t){return t.weekdaysRegex(e)}),em(["dd","ddd","dddd"],function(e,t,r,n){var a=r._locale.weekdaysParse(e,n,r._strict);null!=a?t.d=a:p(r).invalidWeekday=e}),em(["d","e","E"],function(e,t,r,n){t[n]=ep(e)});var eU="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function eL(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();if(r)if("dddd"===t)return -1!==(a=eH.call(this._weekdaysParse,o))?a:null;else if("ddd"===t)return -1!==(a=eH.call(this._shortWeekdaysParse,o))?a:null;else return -1!==(a=eH.call(this._minWeekdaysParse,o))?a:null;return"dddd"===t?-1!==(a=eH.call(this._weekdaysParse,o))||-1!==(a=eH.call(this._shortWeekdaysParse,o))||-1!==(a=eH.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=eH.call(this._shortWeekdaysParse,o))||-1!==(a=eH.call(this._weekdaysParse,o))||-1!==(a=eH.call(this._minWeekdaysParse,o))?a:null:-1!==(a=eH.call(this._minWeekdaysParse,o))||-1!==(a=eH.call(this._weekdaysParse,o))||-1!==(a=eH.call(this._shortWeekdaysParse,o))?a:null}function eF(){function e(e,t){return t.length-e.length}var t,r,n,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)r=f([2e3,1]).day(t),n=ed(this.weekdaysMin(r,"")),a=ed(this.weekdaysShort(r,"")),i=ed(this.weekdays(r,"")),o.push(n),s.push(a),l.push(i),u.push(n),u.push(a),u.push(i);o.sort(e),s.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=RegExp("^("+o.join("|")+")","i")}function eB(){return this.hours()%12||12}function eV(e,t){N(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ez(e,t){return t._meridiemParse}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,eB),N("k",["kk",2],0,function(){return this.hours()||24}),N("hmm",0,0,function(){return""+eB.apply(this)+E(this.minutes(),2)}),N("hmmss",0,0,function(){return""+eB.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),eV("a",!0),eV("A",!1),ec("a",ez),ec("A",ez),ec("H",J,eu),ec("h",J,el),ec("k",J,el),ec("HH",J,G),ec("hh",J,G),ec("kk",J,G),ec("hmm",Z),ec("hmmss",Q),ec("Hmm",Z),ec("Hmmss",Q),eg(["H","HH"],3),eg(["k","kk"],function(e,t,r){var n=ep(e);t[3]=24===n?0:n}),eg(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e}),eg(["h","hh"],function(e,t,r){t[3]=ep(e),p(r).bigHour=!0}),eg("hmm",function(e,t,r){var n=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n)),p(r).bigHour=!0}),eg("hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n,2)),t[5]=ep(e.substr(a)),p(r).bigHour=!0}),eg("Hmm",function(e,t,r){var n=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n))}),eg("Hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n,2)),t[5]=ep(e.substr(a))});var eH,eW,e$=ex("Hours",!0),eY={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:eI,week:{dow:0,doy:6},weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysShort:eU,meridiemParse:/[ap]\.?m?\.?/i},eG={},eq={};function eX(e){return e?e.toLowerCase().replace("_","-"):e}function eK(t){var n=null;if(void 0===eG[t]&&e&&e.exports&&t&&t.match("^[^/\\\\]*$"))try{n=eW._abbr,r(3118)("./locale/"+t),eJ(n)}catch(e){eG[t]=null}return eG[t]}function eJ(e,t){var r;return e&&((r=s(t)?eQ(e):eZ(e,t))?eW=r:"u">typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),eW._abbr}function eZ(e,t){if(null===t)return delete eG[e],null;var r,n=eY;if(t.abbr=e,null!=eG[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=eG[e]._config;else if(null!=t.parentLocale)if(null!=eG[t.parentLocale])n=eG[t.parentLocale]._config;else{if(null==(r=eK(t.parentLocale)))return eq[t.parentLocale]||(eq[t.parentLocale]=[]),eq[t.parentLocale].push({name:e,config:t}),null;n=r._config}return eG[e]=new j(C(n,t)),eq[e]&&eq[e].forEach(function(e){eZ(e.name,e.config)}),eJ(e),eG[e]}function eQ(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return eW;if(!n(e)){if(t=eK(e))return t;e=[e]}return function(e){for(var t,r,n,a,i=0;i<e.length;){for(t=(a=eX(e[i]).split("-")).length,r=(r=eX(e[i+1]))?r.split("-"):null;t>0;){if(n=eK(a.slice(0,t).join("-")))return n;if(r&&r.length>=t&&function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}(a,r)>=t-1)break;t--}i++}return eW}(e)}function e0(e){var t,r=e._a;return r&&-2===p(e).overflow&&(t=r[1]<0||r[1]>11?1:r[2]<1||r[2]>e_(r[0],r[1])?2:r[3]<0||r[3]>24||24===r[3]&&(0!==r[4]||0!==r[5]||0!==r[6])?3:r[4]<0||r[4]>59?4:r[5]<0||r[5]>59?5:r[6]<0||r[6]>999?6:-1,p(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),p(e)._overflowWeeks&&-1===t&&(t=7),p(e)._overflowWeekday&&-1===t&&(t=8),p(e).overflow=t),e}var e1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e2=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e3=/Z|[+-]\d\d(?::?\d\d)?/,e4=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],e5=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],e8=/^\/?Date\((-?\d+)/i,e6=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,e9={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function e7(e){var t,r,n,a,i,o,s=e._i,l=e1.exec(s)||e2.exec(s),u=e4.length,c=e5.length;if(l){for(p(e).iso=!0,t=0,r=u;t<r;t++)if(e4[t][1].exec(l[1])){a=e4[t][0],n=!1!==e4[t][2];break}if(null==a){e._isValid=!1;return}if(l[3]){for(t=0,r=c;t<r;t++)if(e5[t][1].exec(l[3])){i=(l[2]||" ")+e5[t][0];break}if(null==i){e._isValid=!1;return}}if(!n&&null!=i){e._isValid=!1;return}if(l[4])if(e3.exec(l[4]))o="Z";else{e._isValid=!1;return}e._f=a+(i||"")+(o||""),tn(e)}else e._isValid=!1}function te(e){var t,r,n,a,i,o,s,l,u,c,d,f=e6.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(f){if(i=f[4],o=f[3],s=f[2],l=f[5],u=f[6],c=f[7],d=[(t=parseInt(i,10))<=49?2e3+t:t<=999?1900+t:t,eI.indexOf(o),parseInt(s,10),parseInt(l,10),parseInt(u,10)],c&&d.push(parseInt(c,10)),r=f[1],n=d,a=e,r&&eU.indexOf(r)!==new Date(n[0],n[1],n[2]).getDay()&&(p(a).weekdayMismatch=!0,a._isValid=!1,1))return;e._a=d,e._tzm=function(e,t,r){if(e)return e9[e];if(t)return 0;var n=parseInt(r,10),a=n%100;return(n-a)/100*60+a}(f[8],f[9],f[10]),e._d=eM.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function tt(e,t,r){return null!=e?e:null!=t?t:r}function tr(e){var r,n,a,i,o,s,l,u,c,d,f,h,g,m,y,v,b=[];if(!e._d){for(f=new Date(t.now()),m=e._useUTC?[f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()]:[f.getFullYear(),f.getMonth(),f.getDate()],e._w&&null==e._a[2]&&null==e._a[1]&&(null!=(n=(r=e)._w).GG||null!=n.W||null!=n.E?(s=1,l=4,a=tt(n.GG,r._a[0],eA(to(),1,4).year),i=tt(n.W,1),((o=tt(n.E,1))<1||o>7)&&(c=!0)):(s=r._locale._week.dow,l=r._locale._week.doy,d=eA(to(),s,l),a=tt(n.gg,r._a[0],d.year),i=tt(n.w,d.week),null!=n.d?((o=n.d)<0||o>6)&&(c=!0):null!=n.e?(o=n.e+s,(n.e<0||n.e>6)&&(c=!0)):o=s),i<1||i>eN(a,s,l)?p(r)._overflowWeeks=!0:null!=c?p(r)._overflowWeekday=!0:(u=eP(a,i,o,s,l),r._a[0]=u.year,r._dayOfYear=u.dayOfYear)),null!=e._dayOfYear&&(v=tt(e._a[0],m[0]),(e._dayOfYear>ev(v)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),g=eM(v,0,e._dayOfYear),e._a[1]=g.getUTCMonth(),e._a[2]=g.getUTCDate()),h=0;h<3&&null==e._a[h];++h)e._a[h]=b[h]=m[h];for(;h<7;h++)e._a[h]=b[h]=null==e._a[h]?+(2===h):e._a[h];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?eM:eE).apply(null,b),y=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==y&&(p(e).weekdayMismatch=!0)}}function tn(e){if(e._f===t.ISO_8601)return void e7(e);if(e._f===t.RFC_2822)return void te(e);e._a=[],p(e).empty=!0;var r,n,a,o,s,l,u,c,d,f,h,g=""+e._i,m=g.length,y=0;for(h=(u=U(e._f,e._locale).match(M)||[]).length,s=0;s<h;s++)if(c=u[s],(l=(g.match(!i(H,c)?new RegExp(ed(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,r,n,a){return t||r||n||a}))):H[c](e._strict,e._locale))||[])[0])&&((d=g.substr(0,g.indexOf(l))).length>0&&p(e).unusedInput.push(d),g=g.slice(g.indexOf(l)+l.length),y+=l.length),A[c])l?p(e).empty=!1:p(e).unusedTokens.push(c),null!=l&&i(eh,c)&&eh[c](l,e._a,e,c);else e._strict&&!l&&p(e).unusedTokens.push(c);p(e).charsLeftOver=m-y,g.length>0&&p(e).unusedInput.push(g),e._a[3]<=12&&!0===p(e).bigHour&&e._a[3]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[3]=(r=e._locale,n=e._a[3],null==(a=e._meridiem)?n:null!=r.meridiemHour?r.meridiemHour(n,a):(null!=r.isPM&&((o=r.isPM(a))&&n<12&&(n+=12),o||12!==n||(n=0)),n)),null!==(f=p(e).era)&&(e._a[0]=e._locale.erasConvertYear(f,e._a[0])),tr(e),e0(e)}function ta(e){var r=e._i,i=e._f;return(e._locale=e._locale||eQ(e._l),null===r||void 0===i&&""===r)?g({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),w(r))?new S(e0(r)):(u(r)?e._d=r:n(i)?!function(e){var t,r,n,a,i,o,s=!1,l=e._f.length;if(0===l){p(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<l;a++)i=0,o=!1,t=x({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],tn(t),h(t)&&(o=!0),i+=p(t).charsLeftOver,i+=10*p(t).unusedTokens.length,p(t).score=i,s?i<n&&(n=i,r=t):(null==n||i<n||o)&&(n=i,r=t,o&&(s=!0));d(e,r||t)}(e):i?tn(e):function(e){var r=e._i;if(s(r))e._d=new Date(t.now());else if(u(r))e._d=new Date(r.valueOf());else if("string"==typeof r)!function(e){var r=e8.exec(e._i);if(null!==r){e._d=new Date(+r[1]);return}e7(e),!1!==e._isValid||(delete e._isValid,te(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:t.createFromInputFallback(e)))}(e);else if(n(r))e._a=c(r.slice(0),function(e){return parseInt(e,10)}),tr(e);else if(a(r)){if(!e._d){var i=B(e._i),o=void 0===i.day?i.date:i.day;e._a=c([i.year,i.month,o,i.hour,i.minute,i.second,i.millisecond],function(e){return e&&parseInt(e,10)}),tr(e)}}else l(r)?e._d=new Date(r):t.createFromInputFallback(e)}(e),h(e)||(e._d=null),e)}function ti(e,t,r,i,s){var l,u={};return(!0===t||!1===t)&&(i=t,t=void 0),(!0===r||!1===r)&&(i=r,r=void 0),(a(e)&&o(e)||n(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=s,u._l=r,u._i=e,u._f=t,u._strict=i,(l=new S(e0(ta(u))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function to(e,t,r,n){return ti(e,t,r,n,!1)}t.createFromInputFallback=I("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var ts=I("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=to.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),tl=I("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=to.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()});function tu(e,t){var r,a;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return to();for(r=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](r))&&(r=t[a]);return r}var tc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function td(e){var t=B(e),r=t.year||0,n=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,s=t.day||0,l=t.hour||0,u=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,r,n=!1,a=tc.length;for(t in e)if(i(e,t)&&!(-1!==eH.call(tc,t)&&(null==e[t]||!isNaN(e[t]))))return!1;for(r=0;r<a;++r)if(e[tc[r]]){if(n)return!1;parseFloat(e[tc[r]])!==ep(e[tc[r]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*3600,this._days=+s+7*o,this._months=+a+3*n+12*r,this._data={},this._locale=eQ(),this._bubble()}function tf(e){return e instanceof td}function tp(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function th(e,t){N(e,0,0,function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+E(~~(e/60),2)+t+E(~~e%60,2)})}th("Z",":"),th("ZZ",""),ec("Z",eo),ec("ZZ",eo),eg(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=tm(eo,e)});var tg=/([\+\-]|\d\d)/gi;function tm(e,t){var r,n,a=(t||"").match(e);return null===a?null:0===(n=+(60*(r=((a[a.length-1]||[])+"").match(tg)||["-",0,0])[1])+ep(r[2]))?0:"+"===r[0]?n:-n}function ty(e,r){var n,a;return r._isUTC?(n=r.clone(),a=(w(e)||u(e)?e.valueOf():to(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),t.updateOffset(n,!1),n):to(e).local()}function tv(e){return-Math.round(e._d.getTimezoneOffset())}function tb(){return!!this.isValid()&&this._isUTC&&0===this._offset}t.updateOffset=function(){};var tx=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tS=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tw(e,t){var r,n,a,o,s,u,c=e,d=null;return tf(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=tx.exec(e))?(o="-"===d[1]?-1:1,c={y:0,d:ep(d[2])*o,h:ep(d[3])*o,m:ep(d[4])*o,s:ep(d[5])*o,ms:ep(tp(1e3*d[6]))*o}):(d=tS.exec(e))?(o="-"===d[1]?-1:1,c={y:t_(d[2],o),M:t_(d[3],o),w:t_(d[4],o),d:t_(d[5],o),h:t_(d[6],o),m:t_(d[7],o),s:t_(d[8],o)}):null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(r=to(c.from),n=to(c.to),u=r.isValid()&&n.isValid()?(n=ty(n,r),r.isBefore(n)?a=tI(r,n):((a=tI(n,r)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0},(c={}).ms=u.milliseconds,c.M=u.months),s=new td(c),tf(e)&&i(e,"_locale")&&(s._locale=e._locale),tf(e)&&i(e,"_isValid")&&(s._isValid=e._isValid),s}function t_(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function tI(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=t-e.clone().add(r.months,"M"),r}function tD(e,t){return function(r,n){var a;return null===n||isNaN(+n)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=r,r=n,n=a),tO(this,tw(r,n),e),this}}function tO(e,r,n,a){var i=r._milliseconds,o=tp(r._days),s=tp(r._months);e.isValid()&&(a=null==a||a,s&&ek(e,eS(e,"Month")+s*n),o&&ew(e,"Date",eS(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),a&&t.updateOffset(e,o||s))}tw.fn=td.prototype,tw.invalid=function(){return tw(NaN)};var tk=tD(1,"add"),tC=tD(-1,"subtract");function tj(e){return"string"==typeof e||e instanceof String}function tE(e,t){if(e.date()<t.date())return-tE(t,e);var r,n=(t.year()-e.year())*12+(t.month()-e.month()),a=e.clone().add(n,"months");return r=t-a<0?(t-a)/(a-e.clone().add(n-1,"months")):(t-a)/(e.clone().add(n+1,"months")-a),-(n+r)||0}function tM(e){var t;return void 0===e?this._locale._abbr:(null!=(t=eQ(e))&&(this._locale=t),this)}t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var tR=I("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function tP(){return this._locale}function tA(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-126227808e5:new Date(e,t,r).valueOf()}function tN(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-126227808e5:Date.UTC(e,t,r)}function tT(e,t){return t.erasAbbrRegex(e)}function tU(){var e,t,r,n,a,i=[],o=[],s=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)r=ed(u[e].name),n=ed(u[e].abbr),a=ed(u[e].narrow),o.push(r),i.push(n),s.push(a),l.push(r),l.push(n),l.push(a);this._erasRegex=RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=RegExp("^("+s.join("|")+")","i")}function tL(e,t){N(0,[e,e.length],0,t)}function tF(e,t,r,n,a){var i;return null==e?eA(this,n,a).year:(t>(i=eN(e,n,a))&&(t=i),tB.call(this,e,t,r,n,a))}function tB(e,t,r,n,a){var i=eP(e,t,r,n,a),o=eM(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),ec("N",tT),ec("NN",tT),ec("NNN",tT),ec("NNNN",function(e,t){return t.erasNameRegex(e)}),ec("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),eg(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var a=r._locale.erasParse(e,n,r._strict);a?p(r).era=a:p(r).invalidEra=e}),ec("y",en),ec("yy",en),ec("yyy",en),ec("yyyy",en),ec("yo",function(e,t){return t._eraYearOrdinalRegex||en}),eg(["y","yy","yyy","yyyy"],0),eg(["yo"],function(e,t,r,n){var a;r._locale._eraYearOrdinalRegex&&(a=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[0]=r._locale.eraYearOrdinalParse(e,a):t[0]=parseInt(e,10)}),N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tL("gggg","weekYear"),tL("ggggg","weekYear"),tL("GGGG","isoWeekYear"),tL("GGGGG","isoWeekYear"),ec("G",ea),ec("g",ea),ec("GG",J,G),ec("gg",J,G),ec("GGGG",et,X),ec("gggg",et,X),ec("GGGGG",er,K),ec("ggggg",er,K),em(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,n){t[n.substr(0,2)]=ep(e)}),em(["gg","GG"],function(e,r,n,a){r[a]=t.parseTwoDigitYear(e)}),N("Q",0,"Qo","quarter"),ec("Q",Y),eg("Q",function(e,t){t[1]=(ep(e)-1)*3}),N("D",["DD",2],"Do","date"),ec("D",J,el),ec("DD",J,G),ec("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),eg(["D","DD"],2),eg("Do",function(e,t){t[2]=ep(e.match(J)[0])});var tV=ex("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),ec("DDD",ee),ec("DDDD",q),eg(["DDD","DDDD"],function(e,t,r){r._dayOfYear=ep(e)}),N("m",["mm",2],0,"minute"),ec("m",J,eu),ec("mm",J,G),eg(["m","mm"],4);var tz=ex("Minutes",!1);N("s",["ss",2],0,"second"),ec("s",J,eu),ec("ss",J,G),eg(["s","ss"],5);var tH=ex("Seconds",!1);for(N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ec("S",ee,Y),ec("SS",ee,G),ec("SSS",ee,q),m="SSSS";m.length<=9;m+="S")ec(m,en);function tW(e,t){t[6]=ep(("0."+e)*1e3)}for(m="S";m.length<=9;m+="S")eg(m,tW);y=ex("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var t$=S.prototype;function tY(e){return e}t$.add=tk,t$.calendar=function(e,r){if(1==arguments.length)if(arguments[0]){var s,c,d,f;if(s=arguments[0],w(s)||u(s)||tj(s)||l(s)||(d=n(c=s),f=!1,d&&(f=0===c.filter(function(e){return!l(e)&&tj(c)}).length),d&&f)||function(e){var t,r,n=a(e)&&!o(e),s=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=l.length;for(t=0;t<u;t+=1)r=l[t],s=s||i(e,r);return n&&s}(s)||null==s)e=arguments[0],r=void 0;else(function(e){var t,r,n=a(e)&&!o(e),s=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)r=l[t],s=s||i(e,r);return n&&s})(arguments[0])&&(r=arguments[0],e=void 0)}else e=void 0,r=void 0;var p=e||to(),h=ty(p,this).startOf("day"),g=t.calendarFormat(this,h)||"sameElse",m=r&&(k(r[g])?r[g].call(this,p):r[g]);return this.format(m||this.localeData().calendar(g,this,to(p)))},t$.clone=function(){return new S(this)},t$.diff=function(e,t,r){var n,a,i;if(!this.isValid()||!(n=ty(e,this)).isValid())return NaN;switch(a=(n.utcOffset()-this.utcOffset())*6e4,t=F(t)){case"year":i=tE(this,n)/12;break;case"month":i=tE(this,n);break;case"quarter":i=tE(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-a)/864e5;break;case"week":i=(this-n-a)/6048e5;break;default:i=this-n}return r?i:ef(i)},t$.endOf=function(e){var r,n;if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?tN:tA,e){case"year":r=n(this.year()+1,0,1)-1;break;case"quarter":r=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":r=n(this.year(),this.month()+1,1)-1;break;case"week":r=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":r=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":r=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":r=this._d.valueOf(),r+=36e5-((r+(this._isUTC?0:6e4*this.utcOffset()))%36e5+36e5)%36e5-1;break;case"minute":r=this._d.valueOf(),r+=6e4-(r%6e4+6e4)%6e4-1;break;case"second":r=this._d.valueOf(),r+=1e3-(r%1e3+1e3)%1e3-1}return this._d.setTime(r),t.updateOffset(this,!0),this},t$.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var r=T(this,e);return this.localeData().postformat(r)},t$.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||to(e).isValid())?tw({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},t$.fromNow=function(e){return this.from(to(),e)},t$.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||to(e).isValid())?tw({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},t$.toNow=function(e){return this.to(to(),e)},t$.get=function(e){return k(this[e=F(e)])?this[e]():this},t$.invalidAt=function(){return p(this).overflow},t$.isAfter=function(e,t){var r=w(e)?e:to(e);return!!(this.isValid()&&r.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())},t$.isBefore=function(e,t){var r=w(e)?e:to(e);return!!(this.isValid()&&r.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())},t$.isBetween=function(e,t,r,n){var a=w(e)?e:to(e),i=w(t)?t:to(t);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(n=n||"()")[0]?this.isAfter(a,r):!this.isBefore(a,r))&&(")"===n[1]?this.isBefore(i,r):!this.isAfter(i,r))},t$.isSame=function(e,t){var r,n=w(e)?e:to(e);return!!(this.isValid()&&n.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))},t$.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},t$.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},t$.isValid=function(){return h(this)},t$.lang=tR,t$.locale=tM,t$.localeData=tP,t$.max=tl,t$.min=ts,t$.parsingFlags=function(){return d({},p(this))},t$.set=function(e,t){if("object"==typeof e){var r,n=function(e){var t,r=[];for(t in e)i(e,t)&&r.push({unit:t,priority:W[t]});return r.sort(function(e,t){return e.priority-t.priority}),r}(e=B(e)),a=n.length;for(r=0;r<a;r++)this[n[r].unit](e[n[r].unit])}else if(k(this[e=F(e)]))return this[e](t);return this},t$.startOf=function(e){var r,n;if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?tN:tA,e){case"year":r=n(this.year(),0,1);break;case"quarter":r=n(this.year(),this.month()-this.month()%3,1);break;case"month":r=n(this.year(),this.month(),1);break;case"week":r=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":r=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":r=n(this.year(),this.month(),this.date());break;case"hour":r=this._d.valueOf(),r-=((r+(this._isUTC?0:6e4*this.utcOffset()))%36e5+36e5)%36e5;break;case"minute":r=this._d.valueOf(),r-=(r%6e4+6e4)%6e4;break;case"second":r=this._d.valueOf(),r-=(r%1e3+1e3)%1e3}return this._d.setTime(r),t.updateOffset(this,!0),this},t$.subtract=tC,t$.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]},t$.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}},t$.toDate=function(){return new Date(this.valueOf())},t$.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;if(0>r.year()||r.year()>9999)return T(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ");if(k(Date.prototype.toISOString))if(t)return this.toDate().toISOString();else return new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",T(r,"Z"));return T(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},t$.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r,n="moment",a="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+n+'("]',t=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",r=a+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+r)},"u">typeof Symbol&&null!=Symbol.for&&(t$[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),t$.toJSON=function(){return this.isValid()?this.toISOString():null},t$.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},t$.unix=function(){return Math.floor(this.valueOf()/1e3)},t$.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},t$.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},t$.eraName=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].name;return""},t$.eraNarrow=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].narrow;return""},t$.eraAbbr=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].abbr;return""},t$.eraYear=function(){var e,r,n,a,i=this.localeData().eras();for(e=0,r=i.length;e<r;++e)if(n=i[e].since<=i[e].until?1:-1,a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until||i[e].until<=a&&a<=i[e].since)return(this.year()-t(i[e].since).year())*n+i[e].offset;return this.year()},t$.year=eb,t$.isLeapYear=function(){return ey(this.year())},t$.weekYear=function(e){return tF.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},t$.isoWeekYear=function(e){return tF.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},t$.quarter=t$.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)},t$.month=eC,t$.daysInMonth=function(){return e_(this.year(),this.month())},t$.week=t$.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add((e-t)*7,"d")},t$.isoWeek=t$.isoWeeks=function(e){var t=eA(this,1,4).week;return null==e?t:this.add((e-t)*7,"d")},t$.weeksInYear=function(){var e=this.localeData()._week;return eN(this.year(),e.dow,e.doy)},t$.weeksInWeekYear=function(){var e=this.localeData()._week;return eN(this.weekYear(),e.dow,e.doy)},t$.isoWeeksInYear=function(){return eN(this.year(),1,4)},t$.isoWeeksInISOWeekYear=function(){return eN(this.isoWeekYear(),1,4)},t$.date=tV,t$.day=t$.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,r,n=eS(this,"Day");return null==e?n:(t=e,r=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=r.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-n,"d"))},t$.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},t$.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,r=(t=this.localeData(),"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e);return this.day(this.day()%7?r:r-7)},t$.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},t$.hour=t$.hours=e$,t$.minute=t$.minutes=tz,t$.second=t$.seconds=tH,t$.millisecond=t$.milliseconds=y,t$.utcOffset=function(e,r,n){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:tv(this);if("string"==typeof e){if(null===(e=tm(eo,e)))return this}else 16>Math.abs(e)&&!n&&(e*=60);return!this._isUTC&&r&&(a=tv(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!r||this._changeInProgress?tO(this,tw(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this},t$.utc=function(e){return this.utcOffset(0,e)},t$.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(tv(this),"m")),this},t$.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=tm(ei,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},t$.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?to(e).utcOffset():0,(this.utcOffset()-e)%60==0)},t$.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},t$.isLocal=function(){return!!this.isValid()&&!this._isUTC},t$.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},t$.isUtc=tb,t$.isUTC=tb,t$.zoneAbbr=function(){return this._isUTC?"UTC":""},t$.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},t$.dates=I("dates accessor is deprecated. Use date instead.",tV),t$.months=I("months accessor is deprecated. Use month instead",eC),t$.years=I("years accessor is deprecated. Use year instead",eb),t$.zone=I("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),t$.isDSTShifted=I("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,t={};return x(t,this),(t=ta(t))._a?(e=t._isUTC?f(t._a):to(t._a),this._isDSTShifted=this.isValid()&&function(e,t){var r,n=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),i=0;for(r=0;r<n;r++)ep(e[r])!==ep(t[r])&&i++;return i+a}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var tG=j.prototype;function tq(e,t,r,n){var a=eQ(),i=f().set(n,t);return a[r](i,e)}function tX(e,t,r){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return tq(e,t,r,"month");var n,a=[];for(n=0;n<12;n++)a[n]=tq(e,n,r,"month");return a}function tK(e,t,r,n){"boolean"==typeof e||(r=t=e,e=!1),l(t)&&(r=t,t=void 0),t=t||"";var a,i=eQ(),o=e?i._week.dow:0,s=[];if(null!=r)return tq(t,(r+o)%7,n,"day");for(a=0;a<7;a++)s[a]=tq(t,(a+o)%7,n,"day");return s}tG.calendar=function(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return k(n)?n.call(t,r):n},tG.longDateFormat=function(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(M).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},tG.invalidDate=function(){return this._invalidDate},tG.ordinal=function(e){return this._ordinal.replace("%d",e)},tG.preparse=tY,tG.postformat=tY,tG.relativeTime=function(e,t,r,n){var a=this._relativeTime[r];return k(a)?a(e,t,r,n):a.replace(/%d/i,e)},tG.pastFuture=function(e,t){var r=this._relativeTime[e>0?"future":"past"];return k(r)?r(t):r.replace(/%s/i,t)},tG.set=function(e){var t,r;for(r in e)i(e,r)&&(k(t=e[r])?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},tG.eras=function(e,r){var n,a,i,o=this._eras||eQ("en")._eras;for(n=0,a=o.length;n<a;++n)switch("string"==typeof o[n].since&&(i=t(o[n].since).startOf("day"),o[n].since=i.valueOf()),typeof o[n].until){case"undefined":o[n].until=Infinity;break;case"string":i=t(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf()}return o},tG.erasParse=function(e,t,r){var n,a,i,o,s,l=this.eras();for(e=e.toUpperCase(),n=0,a=l.length;n<a;++n)if(i=l[n].name.toUpperCase(),o=l[n].abbr.toUpperCase(),s=l[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[n];break;case"NNNN":if(i===e)return l[n];break;case"NNNNN":if(s===e)return l[n]}else if([i,o,s].indexOf(e)>=0)return l[n]},tG.erasConvertYear=function(e,r){var n=e.since<=e.until?1:-1;return void 0===r?t(e.since).year():t(e.since).year()+(r-e.offset)*n},tG.erasAbbrRegex=function(e){return i(this,"_erasAbbrRegex")||tU.call(this),e?this._erasAbbrRegex:this._erasRegex},tG.erasNameRegex=function(e){return i(this,"_erasNameRegex")||tU.call(this),e?this._erasNameRegex:this._erasRegex},tG.erasNarrowRegex=function(e){return i(this,"_erasNarrowRegex")||tU.call(this),e?this._erasNarrowRegex:this._erasRegex},tG.months=function(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||eD).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone},tG.monthsShort=function(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[eD.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},tG.monthsParse=function(e,t,r){var n,a,i;if(this._monthsParseExact)return eO.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=f([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=RegExp(i.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}},tG.monthsRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||ej.call(this),e)?this._monthsStrictRegex:this._monthsRegex:(i(this,"_monthsRegex")||(this._monthsRegex=es),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},tG.monthsShortRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||ej.call(this),e)?this._monthsShortStrictRegex:this._monthsShortRegex:(i(this,"_monthsShortRegex")||(this._monthsShortRegex=es),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},tG.week=function(e){return eA(e,this._week.dow,this._week.doy).week},tG.firstDayOfYear=function(){return this._week.doy},tG.firstDayOfWeek=function(){return this._week.dow},tG.weekdays=function(e,t){var r=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?eT(r,this._week.dow):e?r[e.day()]:r},tG.weekdaysMin=function(e){return!0===e?eT(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},tG.weekdaysShort=function(e){return!0===e?eT(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},tG.weekdaysParse=function(e,t,r){var n,a,i;if(this._weekdaysParseExact)return eL.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=RegExp(i.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;else if(!r&&this._weekdaysParse[n].test(e))return n}},tG.weekdaysRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eF.call(this),e)?this._weekdaysStrictRegex:this._weekdaysRegex:(i(this,"_weekdaysRegex")||(this._weekdaysRegex=es),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},tG.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eF.call(this),e)?this._weekdaysShortStrictRegex:this._weekdaysShortRegex:(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=es),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},tG.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eF.call(this),e)?this._weekdaysMinStrictRegex:this._weekdaysMinRegex:(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=es),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},tG.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},tG.meridiem=function(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"},eJ("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=1===ep(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+r}}),t.lang=I("moment.lang is deprecated. Use moment.locale instead.",eJ),t.langData=I("moment.langData is deprecated. Use moment.localeData instead.",eQ);var tJ=Math.abs;function tZ(e,t,r,n){var a=tw(t,r);return e._milliseconds+=n*a._milliseconds,e._days+=n*a._days,e._months+=n*a._months,e._bubble()}function tQ(e){return e<0?Math.floor(e):Math.ceil(e)}function t0(e){return 4800*e/146097}function t1(e){return 146097*e/4800}function t2(e){return function(){return this.as(e)}}var t3=t2("ms"),t4=t2("s"),t5=t2("m"),t8=t2("h"),t6=t2("d"),t9=t2("w"),t7=t2("M"),re=t2("Q"),rt=t2("y");function rr(e){return function(){return this.isValid()?this._data[e]:NaN}}var rn=rr("milliseconds"),ra=rr("seconds"),ri=rr("minutes"),ro=rr("hours"),rs=rr("days"),rl=rr("months"),ru=rr("years"),rc=Math.round,rd={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rf(e,t,r,n,a){return a.relativeTime(t||1,!!r,e,n)}var rp=Math.abs;function rh(e){return(e>0)-(e<0)||+e}function rg(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,a,i,o,s,l=rp(this._milliseconds)/1e3,u=rp(this._days),c=rp(this._months),d=this.asSeconds();return d?(e=ef(l/60),t=ef(e/60),l%=60,e%=60,r=ef(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",i=rh(this._months)!==rh(d)?"-":"",o=rh(this._days)!==rh(d)?"-":"",s=rh(this._milliseconds)!==rh(d)?"-":"",a+"P"+(r?i+r+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+n+"S":"")):"P0D"}var rm=td.prototype;return rm.isValid=function(){return this._isValid},rm.abs=function(){var e=this._data;return this._milliseconds=tJ(this._milliseconds),this._days=tJ(this._days),this._months=tJ(this._months),e.milliseconds=tJ(e.milliseconds),e.seconds=tJ(e.seconds),e.minutes=tJ(e.minutes),e.hours=tJ(e.hours),e.months=tJ(e.months),e.years=tJ(e.years),this},rm.add=function(e,t){return tZ(this,e,t,1)},rm.subtract=function(e,t){return tZ(this,e,t,-1)},rm.as=function(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=F(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+t0(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(t1(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw Error("Unknown unit "+e)}},rm.asMilliseconds=t3,rm.asSeconds=t4,rm.asMinutes=t5,rm.asHours=t8,rm.asDays=t6,rm.asWeeks=t9,rm.asMonths=t7,rm.asQuarters=re,rm.asYears=rt,rm.valueOf=t3,rm._bubble=function(){var e,t,r,n,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*tQ(t1(s)+o),o=0,s=0),l.milliseconds=i%1e3,l.seconds=(e=ef(i/1e3))%60,l.minutes=(t=ef(e/60))%60,l.hours=(r=ef(t/60))%24,o+=ef(r/24),s+=a=ef(t0(o)),o-=tQ(t1(a)),n=ef(s/12),s%=12,l.days=o,l.months=s,l.years=n,this},rm.clone=function(){return tw(this)},rm.get=function(e){return e=F(e),this.isValid()?this[e+"s"]():NaN},rm.milliseconds=rn,rm.seconds=ra,rm.minutes=ri,rm.hours=ro,rm.days=rs,rm.weeks=function(){return ef(this.days()/7)},rm.months=rl,rm.years=ru,rm.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,a,i,o,s,l,u,c,d,f,p,h,g=!1,m=rd;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(g=e),"object"==typeof t&&(m=Object.assign({},rd,t),null!=t.s&&null==t.ss&&(m.ss=t.s-1)),p=this.localeData(),r=!g,n=m,a=tw(this).abs(),i=rc(a.as("s")),o=rc(a.as("m")),s=rc(a.as("h")),l=rc(a.as("d")),u=rc(a.as("M")),c=rc(a.as("w")),d=rc(a.as("y")),f=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||o<=1&&["m"]||o<n.m&&["mm",o]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l],null!=n.w&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),(f=f||u<=1&&["M"]||u<n.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=r,f[3]=+this>0,f[4]=p,h=rf.apply(null,f),g&&(h=p.pastFuture(+this,h)),p.postformat(h)},rm.toISOString=rg,rm.toString=rg,rm.toJSON=rg,rm.locale=tM,rm.localeData=tP,rm.toIsoString=I("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rg),rm.lang=tR,N("X",0,0,"unix"),N("x",0,0,"valueOf"),ec("x",ea),ec("X",/[+-]?\d+(\.\d{1,3})?/),eg("X",function(e,t,r){r._d=new Date(1e3*parseFloat(e))}),eg("x",function(e,t,r){r._d=new Date(ep(e))}),t.version="2.30.1",V=to,t.fn=t$,t.min=function(){var e=[].slice.call(arguments,0);return tu("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return tu("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=f,t.unix=function(e){return to(1e3*e)},t.months=function(e,t){return tX(e,t,"months")},t.isDate=u,t.locale=eJ,t.invalid=g,t.duration=tw,t.isMoment=w,t.weekdays=function(e,t,r){return tK(e,t,r,"weekdays")},t.parseZone=function(){return to.apply(null,arguments).parseZone()},t.localeData=eQ,t.isDuration=tf,t.monthsShort=function(e,t){return tX(e,t,"monthsShort")},t.weekdaysMin=function(e,t,r){return tK(e,t,r,"weekdaysMin")},t.defineLocale=eZ,t.updateLocale=function(e,t){if(null!=t){var r,n,a=eY;null!=eG[e]&&null!=eG[e].parentLocale?eG[e].set(C(eG[e]._config,t)):(null!=(n=eK(e))&&(a=n._config),t=C(a,t),null==n&&(t.abbr=e),(r=new j(t)).parentLocale=eG[e],eG[e]=r),eJ(e)}else null!=eG[e]&&(null!=eG[e].parentLocale?(eG[e]=eG[e].parentLocale,e===eJ()&&eJ(e)):null!=eG[e]&&delete eG[e]);return eG[e]},t.locales=function(){return $(eG)},t.weekdaysShort=function(e,t,r){return tK(e,t,r,"weekdaysShort")},t.normalizeUnits=F,t.relativeTimeRounding=function(e){return void 0===e?rc:"function"==typeof e&&(rc=e,!0)},t.relativeTimeThreshold=function(e,t){return void 0!==rd[e]&&(void 0===t?rd[e]:(rd[e]=t,"s"===e&&(rd.ss=t-1),!0))},t.calendarFormat=function(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},t.prototype=t$,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t}()},3118(e){function t(e){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=3118,e.exports=t},856(e,t,r){"use strict";var n=r(9564);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,i,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},7598(e,t,r){e.exports=r(856)()},9564(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8985(e,t,r){"use strict";let n=r(3182),a=r(5956),i=r(9646),o=r(9913);function s(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function u(e,t){return t.decode?a(e):e}function c(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=c(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let a="string"==typeof r&&r.includes(e.arrayFormatSeparator),i="string"==typeof r&&!a&&u(r,e).includes(e.arrayFormatSeparator);r=i?u(r,e):r;let o=a||i?r.split(e.arrayFormatSeparator).map(t=>u(t,e)):null===r?r:u(r,e);n[t]=o};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let a of e.split("&")){if(""===a)continue;let[e,o]=i(t.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator"].includes(t.arrayFormat)?o:u(o,t),r(u(e,t),o,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=f(r[e],t);else n[e]=f(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=d,t.parse=p,t.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",a,"]"].join("")]:[...r,[l(t,e),"[",l(a,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[l(t,e),"=",l(n,e)].join("")]:[[r,l(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),a={};for(let t of Object.keys(e))r(t)||(a[t]=e[t]);let i=Object.keys(a);return!1!==t.sort&&i.sort(t.sort),i.map(r=>{let a=e[r];return void 0===a?"":null===a?l(r,t):Array.isArray(a)?a.reduce(n(r),[]).join("&"):l(r,t)+"="+l(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,n]=i(e,"#");return Object.assign({url:r.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,t)}:{})},t.stringifyUrl=(e,r)=>{var n;let a,i;r=Object.assign({encode:!0,strict:!0},r);let o=c(e.url).split("?")[0]||"",s=t.extract(e.url),u=Object.assign(t.parse(s,{sort:!1}),e.query),d=t.stringify(u,r);d&&(d=`?${d}`);let f=(n=e.url,a="",-1!==(i=n.indexOf("#"))&&(a=n.slice(i)),a);return e.fragmentIdentifier&&(f=`#${l(e.fragmentIdentifier,r)}`),`${o}${d}${f}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);let{url:a,query:i,fragmentIdentifier:s}=t.parseUrl(e,n);return t.stringifyUrl({url:a,query:o(i,r),fragmentIdentifier:s},n)},t.exclude=(e,r,n)=>{let a=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,a,n)}},76(e,t,r){"use strict";var n=r(6326).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.c=function(e){return n.H.useMemoCache(e)}},3060(e,t){"use strict";var r=Symbol.for("react.transitional.element");function n(e,t,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),"key"in t)for(var i in n={},t)"key"!==i&&(n[i]=t[i]);else n=t;return{$$typeof:r,type:e,key:a,ref:void 0!==(t=n.ref)?t:null,props:n}}t.Fragment=Symbol.for("react.fragment"),t.jsx=n,t.jsxs=n},8391(e,t){"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator,g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,y={};function v(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||g}function b(){}function x(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||g}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var S=x.prototype=new b;S.constructor=x,m(S,v.prototype),S.isPureReactComponent=!0;var w=Array.isArray;function _(){}var I={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function O(e,t,n){var a=n.ref;return{$$typeof:r,type:e,key:t,ref:void 0!==a?a:null,props:n}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var C=/\/+/g;function j(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function E(e,t,a){if(null==e)return e;var i=[],o=0;return!function e(t,a,i,o,s){var l,u,c,d=typeof t;("undefined"===d||"boolean"===d)&&(t=null);var p=!1;if(null===t)p=!0;else switch(d){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case r:case n:p=!0;break;case f:return e((p=t._init)(t._payload),a,i,o,s)}}if(p)return s=s(t),p=""===o?"."+j(t,0):o,w(s)?(i="",null!=p&&(i=p.replace(C,"$&/")+"/"),e(s,a,i,"",function(e){return e})):null!=s&&(k(s)&&(l=s,u=i+(null==s.key||t&&t.key===s.key?"":(""+s.key).replace(C,"$&/")+"/")+p,s=O(l.type,u,l.props)),a.push(s)),1;p=0;var g=""===o?".":o+":";if(w(t))for(var m=0;m<t.length;m++)d=g+j(o=t[m],m),p+=e(o,a,i,d,s);else if("function"==typeof(m=null===(c=t)||"object"!=typeof c?null:"function"==typeof(c=h&&c[h]||c["@@iterator"])?c:null))for(t=m.call(t),m=0;!(o=t.next()).done;)d=g+j(o=o.value,m++),p+=e(o,a,i,d,s);else if("object"===d){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),a,i,o,s);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(a=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.")}return p}(e,i,"","",function(e){return t.call(a,e,o++)}),i}function M(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};t.Activity=p,t.Children={map:E,forEach:function(e,t,r){E(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return E(e,function(){t++}),t},toArray:function(e){return E(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=a,t.Profiler=o,t.PureComponent=x,t.StrictMode=i,t.Suspense=c,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return I.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=m({},e.props),a=e.key;if(null!=t)for(i in void 0!==t.key&&(a=""+t.key),t)D.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&("ref"!==i||void 0!==t.ref)&&(n[i]=t[i]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var o=Array(i),s=0;s<i;s++)o[s]=arguments[s+2];n.children=o}return O(e.type,a,n)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,r){var n,a={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)D.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(a[n]=t[n]);var o=arguments.length-2;if(1===o)a.children=r;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];a.children=s}if(e&&e.defaultProps)for(n in o=e.defaultProps)void 0===a[n]&&(a[n]=o[n]);return O(e,i,a)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=I.T,r={};I.T=r;try{var n=e(),a=I.S;null!==a&&a(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(_,R)}catch(e){R(e)}finally{null!==t&&null!==r.types&&(t.types=r.types),I.T=t}},t.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},t.use=function(e){return I.H.use(e)},t.useActionState=function(e,t,r){return I.H.useActionState(e,t,r)},t.useCallback=function(e,t){return I.H.useCallback(e,t)},t.useContext=function(e){return I.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return I.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return I.H.useEffect(e,t)},t.useEffectEvent=function(e){return I.H.useEffectEvent(e)},t.useId=function(){return I.H.useId()},t.useImperativeHandle=function(e,t,r){return I.H.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return I.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.H.useMemo(e,t)},t.useOptimistic=function(e,t){return I.H.useOptimistic(e,t)},t.useReducer=function(e,t,r){return I.H.useReducer(e,t,r)},t.useRef=function(e){return I.H.useRef(e)},t.useState=function(e){return I.H.useState(e)},t.useSyncExternalStore=function(e,t,r){return I.H.useSyncExternalStore(e,t,r)},t.useTransition=function(){return I.H.useTransition()},t.version="19.2.7"},2184(e,t,r){"use strict";e.exports=r(76)},6326(e,t,r){"use strict";e.exports=r(8391)},6870(e,t,r){"use strict";e.exports=r(3060)},7002(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.autoprefix=void 0;var n,a=(n=r(2122))&&n.__esModule?n:{default:n},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(" ");return{position:"absolute",top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){var r=t[e];return r||{extend:e}}},s=t.autoprefix=function(e){var t={};return(0,a.default)(e,function(e,r){var n={};(0,a.default)(e,function(e,t){var r=o[t];r?n=i({},n,r(e)):n[t]=e}),t[r]=n}),t};t.default=s},2990(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.active=void 0;var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};function o(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var s=t.active=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span",r=i.default.Component;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function, not "+typeof r);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var r,s,l,u=arguments.length,c=Array(u),d=0;d<u;d++)c[d]=arguments[d];return s=l=o(this,(r=n.__proto__||Object.getPrototypeOf(n)).call.apply(r,[this].concat(c))),l.state={active:!1},l.handleMouseDown=function(){return l.setState({active:!0})},l.handleMouseUp=function(){return l.setState({active:!1})},l.render=function(){return i.default.createElement(t,{onMouseDown:l.handleMouseDown,onMouseUp:l.handleMouseUp},i.default.createElement(e,a({},l.props,l.state)))},o(l,s)}return n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r),n};t.default=s},7136(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hover=void 0;var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};function o(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var s=t.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span",r=i.default.Component;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function, not "+typeof r);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var r,s,l,u=arguments.length,c=Array(u),d=0;d<u;d++)c[d]=arguments[d];return s=l=o(this,(r=n.__proto__||Object.getPrototypeOf(n)).call.apply(r,[this].concat(c))),l.state={hover:!1},l.handleMouseOver=function(){return l.setState({hover:!0})},l.handleMouseOut=function(){return l.setState({hover:!1})},l.render=function(){return i.default.createElement(t,{onMouseOver:l.handleMouseOver,onMouseOut:l.handleMouseOut},i.default.createElement(e,a({},l.props,l.state)))},o(l,s)}return n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r),n};t.default=s},3003(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenNames=void 0;var n=s(r(7561)),a=s(r(2122)),i=s(r(5229)),o=s(r(764));function s(e){return e&&e.__esModule?e:{default:e}}var l=t.flattenNames=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=[];return(0,o.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return r.push(e)}):(0,i.default)(t)?(0,a.default)(t,function(e,t){!0===e&&r.push(t),r.push(t+"-"+e)}):(0,n.default)(t)&&r.push(t)}),r};t.default=l},6457(e,t,r){"use strict";t.H8=void 0;var n=u(r(3003)),a=u(r(101)),i=u(r(7002)),o=u(r(7136)),s=u(r(2990)),l=u(r(6431));function u(e){return e&&e.__esModule?e:{default:e}}o.default,t.H8=o.default,s.default,l.default,t.Ay=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var s=(0,n.default)(r),l=(0,a.default)(e,s);return(0,i.default)(l)}},6431(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r={},n=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];r[e]=t};return 0===e&&n("first-child"),e===t-1&&n("last-child"),(0===e||e%2==0)&&n("even"),1===Math.abs(e%2)&&n("odd"),n("nth-child",e),r}},101(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeClasses=void 0;var n=o(r(2122)),a=o(r(1285)),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function o(e){return e&&e.__esModule?e:{default:e}}var s=t.mergeClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.default&&(0,a.default)(e.default)||{};return t.map(function(t){var a=e[t];return a&&(0,n.default)(a,function(e,t){r[t]||(r[t]={}),r[t]=i({},r[t],a[t])}),t}),r};t.default=s},9646(e){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},3182(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},9741(e){e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},4774(e,t,r){"use strict";var n=r(6326),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,o=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),a=n[0].inst,c=n[1];return s(function(){a.value=r,a.getSnapshot=t,u(a)&&c({inst:a})},[e,r,t]),o(function(){return u(a)&&c({inst:a}),e(function(){u(a)&&c({inst:a})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},9449(e,t,r){"use strict";var n=r(6326),a=r(3391),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=a.useSyncExternalStore,s=n.useRef,l=n.useEffect,u=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var p=o(e,(d=u(function(){function e(e){if(!l){if(l=!0,o=e,e=n(e),void 0!==a&&f.hasValue){var t=f.value;if(a(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var r=n(e);return void 0!==a&&a(t,r)?t:(o=e,s=r)}var o,s,l=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,a]))[0],d[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}},3391(e,t,r){"use strict";e.exports=r(4774)},4413(e,t,r){"use strict";e.exports=r(9449)},3425(e){"use strict";e.exports=f},6557(e){"use strict";e.exports=u},2302(e){"use strict";e.exports=a},4713(e){"use strict";e.exports=n},3154(e){"use strict";e.exports=r},8500(e){"use strict";e.exports=i},1002(e){"use strict";e.exports=p},1459(e){"use strict";e.exports=l},7238(e){"use strict";e.exports=s},4687(e){"use strict";e.exports=c},3110(e){"use strict";e.exports=t},2220(e){"use strict";e.exports=g},2323(e){"use strict";e.exports=d},1357(t){"use strict";t.exports=e},534(e){"use strict";e.exports=h},4669(e){"use strict";e.exports=v},3545(e){"use strict";e.exports=o},55(e){"use strict";e.exports=b},2111(e){"use strict";e.exports=m},7155(e){"use strict";e.exports=y},5530(e){!function(){"use strict";var t={}.hasOwnProperty;function r(){for(var e="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var a="";for(var i in e)t.call(e,i)&&e[i]&&(a=n(a,i));return a}(i)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return r}):window.classNames=r}()}},_={};function I(e){var t=_[e];if(void 0!==t)return t.exports;var r=_[e]={exports:{}};return w[e].call(r.exports,r,r.exports,I),r.exports}I.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return I.d(t,{a:t}),t},S=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,I.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);I.r(r);var n={};x=x||[null,S({}),S([]),S(S)];for(var a=2&t&&e;("object"==typeof a||"function"==typeof a)&&!~x.indexOf(a);a=S(a))Object.getOwnPropertyNames(a).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,I.d(r,n),r},I.d=(e,t)=>{for(var r in t)I.o(t,r)&&!I.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},I.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),I.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),I.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},I.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var D={};return(()=>{"use strict";I.r(D),I.d(D,{ContextMenuController:()=>aj,CustomizableContextMenuTypes:()=>T,MoreDropdownMenu:()=>r1,PanelStudyBrowserHeader:()=>rK,StaticWadoClient:()=>ew,Toolbar:()=>t0,Toolbox:()=>pw,callInputDialog:()=>lc,callInputDialogAutoComplete:()=>ld,cleanDenaturalizedDataset:()=>la,colorPickerDialog:()=>pb,createReportAsync:()=>i_,createReportDialogPrompt:()=>ns,default:()=>pI,dicomWebUtils:()=>U,getStudiesForPatientByMRN:()=>na,promptLabelAnnotation:()=>px,promptSaveReport:()=>ik,requestDisplaySetCreationForStudy:()=>ni,useDisplaySetSelectorStore:()=>ig,useHangingProtocolStageIndexStore:()=>im,usePatientInfo:()=>sZ,useToggleHangingProtocolStore:()=>iS,useToggleOneUpViewportGridStore:()=>iw,useUIStateStore:()=>ls,useViewportGridStore:()=>ih,useViewportsByPositionStore:()=>ib,utils:()=>L});var e,t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,O,k,C,j,E,M,R,P,A,N,T={};I.r(T);var U={};I.r(U),I.d(U,{cleanDenaturalizedDataset:()=>la,fixBulkDataURI:()=>eI,fixMultiValueKeys:()=>lo,transferDenaturalizedDataset:()=>li});var L={};function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(n.key),n)}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function z(e){for(var t=new Uint8Array(e.length),r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t}function H(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,a=e.length;n&&(a=Math.min(r+n,e.length));for(var i=r;i<a;i++)if(e[i]===t[0]&&function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r+t.length>e.length)return!1;for(var n=r,a=0;a<t.length;a++){if(t[a]!==e[n])return!1;n+=1}return!0}(e,t,i))return i;return -1}function W(e){return"object"===F(e)&&null!==e}function $(e){return 0===Object.keys(e).length&&e.constructor===Object}I.r(L),I.d(L,{Toolbox:()=>pw,addIcon:()=>pS});var Y=function(e){return e[0]},G={DICOM:"application/dicom",DICOM_JSON:"application/dicom+json",OCTET_STREAM:"application/octet-stream",PDF:"application/pdf",JPEG:"image/jpeg",PNG:"image/png"},q=function(){},X={DICOMwebClient:function(){var e,t;function r(e){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");this.baseURL=e.url,this.baseURL||console.error("no DICOMweb base url provided - calls that require a URL will fail"),"username"in e&&(this.username=e.username,"password"in e||console.error("no password provided to authenticate with DICOMweb service"),this.password=e.password),"qidoURLPrefix"in e?(q("use URL prefix for QIDO-RS: ".concat(e.qidoURLPrefix)),this.qidoURL="".concat(this.baseURL,"/").concat(e.qidoURLPrefix)):this.qidoURL=this.baseURL,"wadoURLPrefix"in e?(q("use URL prefix for WADO-RS: ".concat(e.wadoURLPrefix)),this.wadoURL="".concat(this.baseURL,"/").concat(e.wadoURLPrefix)):this.wadoURL=this.baseURL,"stowURLPrefix"in e?(q("use URL prefix for STOW-RS: ".concat(e.stowURLPrefix)),this.stowURL="".concat(this.baseURL,"/").concat(e.stowURLPrefix)):this.stowURL=this.baseURL,e.singlepart?(q("use singlepart",e.singlepart),this.singlepart=!0===e.singlepart?"bulkdata,video,image":e.singlepart):this.singlepart="","requestHooks"in e&&(this.requestHooks=e.requestHooks),this.headers=e.headers||{},this.errorInterceptor=e.errorInterceptor||function(){},this.verbose=!1!==e.verbose,this.setDebug(e.debug)}return e=[{key:"setDebug",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.debugLevel=!!e,q=t||e?console.log:function(){}}},{key:"getDebug",value:function(){return this.debugLevel}},{key:"setVerbose",value:function(e){this.verbose=e}},{key:"getVerbose",value:function(){return this.verbose}},{key:"_httpRequest",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.errorInterceptor,o=this.requestHooks;return new Promise(function(s,l){var u=a.request?a.request:new XMLHttpRequest;u.open(t,e,!0),"responseType"in a&&(u.responseType=a.responseType),"object"===F(n)&&Object.keys(n).forEach(function(e){u.setRequestHeader(e,n[e])});var c=r.headers;if(Object.keys(c).forEach(function(e){u.setRequestHeader(e,c[e])}),u.onloadstart=function(){q("upload started: ",e)},u.onloadend=function(){q("upload finished")},u.onreadystatechange=function(){if(4===u.readyState)if(200===u.status){var e=u.getResponseHeader("Content-Type");e&&-1!==e.indexOf("multipart")?s(function(e){var t,r=ArrayBuffer.isView(e)?e:new Uint8Array(e),n=z("\r\n\r\n"),a=H(r,n,0,1e3);if(-1===a)throw Error("Response message has no multipart mime header");var i=function(e){for(var t=e.split("\r\n"),r=0;r<t.length;r++)if("--"===t[r].substr(0,2))return t[r];return null}(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=r||e.length-t,a="",i=t;i<t+n;i++)a+=String.fromCharCode(e[i]);return a}(r,0,a));if(!i)throw Error("Header of response message does not specify boundary");for(var o=z(i),s=o.length,l=[],u=s;-1!==t&&-1!==(t=H(r,o,u));){var c=H(r,n,u,1e3);if(-1===c)throw Error("Response message part has no mime header");u=c+n.length;var d=e.slice(u,t-2);l.push(d),u=t+s}return l}(u.response)):"arraybuffer"===u.responseType?s([u.response]):s(u.response)}else if(202===u.status)r.verbose&&console.warn("some resources already existed: ",u),s(u.response);else if(204===u.status)r.verbose&&console.warn("empty response for request: ",u),s([]);else{var t=Error("request failed");t.request=u,t.response=u.response,t.status=u.status,r.verbose&&(console.error("request failed: ",u),console.error(t),console.error(t.response)),i(t),l(t)}},"progressCallback"in a&&"function"==typeof a.progressCallback&&(u.onprogress=a.progressCallback),o&&((d=Array.isArray(o)&&o.every(function(e){return"function"==typeof e&&2===e.length}))||console.warn("Request hooks should have the following signature: function requestHook(request, metadata) { return request; }"),d)){var d,f={method:t,url:e,headers:Object.assign({},n,r.headers)};u=function(e){return o.reduce(function(e,t){return t(e,f)},e)}(u)}"withCredentials"in a&&a.withCredentials&&(u.withCredentials=!0),"data"in a?u.send(a.data):u.send()})}},{key:"_httpGet",value:function(e,t,r,n,a){return this._httpRequest(e,"get",t,{responseType:r,progressCallback:n,withCredentials:a})}},{key:"_httpGetApplicationJson",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=e;"object"!==F(t)||$(t)||(i+=r._parseQueryParameters(t));var o={Accept:G.DICOM_JSON};return this._httpGet(i,o,"json",n,a)}},{key:"_httpGetApplicationPdf",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=e;"object"!==F(t)||$(t)||(i+=r._parseQueryParameters(t));var o={Accept:G.PDF};return this._httpGet(i,o,"json",n,a)}},{key:"_httpGetImage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=e;"object"!==F(n)||$(n)||(o+=r._parseQueryParameters(n));var s=r._buildAcceptHeaderFieldValue(t,["image/","image/*","image/jpeg","image/jp2","image/gif","image/png"]);return this._httpGet(o,{Accept:s},"arraybuffer",a,i)}},{key:"_httpGetText",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=e;"object"!==F(n)||$(n)||(o+=r._parseQueryParameters(n));var s=r._buildAcceptHeaderFieldValue(t,["text/","text/*","text/html","text/plain","text/rtf","text/xml"]);return this._httpGet(o,{Accept:s},"arraybuffer",a,i)}},{key:"_httpGetVideo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=e;"object"!==F(n)||$(n)||(o+=r._parseQueryParameters(n));var s=r._buildAcceptHeaderFieldValue(t,["video/","video/*","video/mpeg","video/mp4","video/H265"]);return this._httpGet(o,{Accept:s},"arraybuffer",a,i)}},{key:"_httpGetMultipartImage",value:function(e,t,n,a){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,u={};return o?i=["image/jpeg","image/gif","image/png","image/jp2"]:(i={"1.2.840.10008.1.2.5":["image/x-dicom-rle"],"1.2.840.10008.1.2.4.50":["image/jpeg"],"1.2.840.10008.1.2.4.51":["image/jpeg"],"1.2.840.10008.1.2.4.57":["image/jpeg"],"1.2.840.10008.1.2.4.70":["image/jpeg"],"1.2.840.10008.1.2.4.80":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.81":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.90":["image/jp2"],"1.2.840.10008.1.2.4.91":["image/jp2"],"1.2.840.10008.1.2.4.92":["image/jpx"],"1.2.840.10008.1.2.4.93":["image/jpx"]},n&&(u.Range=r._buildRangeHeaderFieldValue(n))),u.Accept=r._buildMultipartAcceptHeaderFieldValue(t,i),this._httpGet(e,u,"arraybuffer",s,l)}},{key:"_httpGetMultipartVideo",value:function(e,t,n,a){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,u={};return o?i=["video/","video/*","video/mpeg2","video/mp4","video/H265"]:(i={"1.2.840.10008.1.2.4.100":["video/mpeg2"],"1.2.840.10008.1.2.4.101":["video/mpeg2"],"1.2.840.10008.1.2.4.102":["video/mp4"],"1.2.840.10008.1.2.4.103":["video/mp4"],"1.2.840.10008.1.2.4.104":["video/mp4"],"1.2.840.10008.1.2.4.105":["video/mp4"],"1.2.840.10008.1.2.4.106":["video/mp4"]},n&&(u.Range=r._buildRangeHeaderFieldValue(n))),u.Accept=r._buildMultipartAcceptHeaderFieldValue(t,i),this._httpGet(e,u,"arraybuffer",s,l)}},{key:"_httpGetMultipartApplicationDicom",value:function(e,t,n,a,i){var o={},s="application/dicom",l=t;return t||(l=[{mediaType:s}]),o.Accept=r._buildMultipartAcceptHeaderFieldValue(l,{"1.2.840.10008.1.2.1":[s],"1.2.840.10008.1.2.5":[s],"1.2.840.10008.1.2.4.50":[s],"1.2.840.10008.1.2.4.51":[s],"1.2.840.10008.1.2.4.57":[s],"1.2.840.10008.1.2.4.70":[s],"1.2.840.10008.1.2.4.80":[s],"1.2.840.10008.1.2.4.81":[s],"1.2.840.10008.1.2.4.90":[s],"1.2.840.10008.1.2.4.91":[s],"1.2.840.10008.1.2.4.92":[s],"1.2.840.10008.1.2.4.93":[s],"1.2.840.10008.1.2.4.100":[s],"1.2.840.10008.1.2.4.101":[s],"1.2.840.10008.1.2.4.102":[s],"1.2.840.10008.1.2.4.103":[s],"1.2.840.10008.1.2.4.104":[s],"1.2.840.10008.1.2.4.105":[s],"1.2.840.10008.1.2.4.106":[s]}),this._httpGet(e,o,"arraybuffer",a,i)}},{key:"_httpGetMultipartApplicationOctetStream",value:function(e,t,n,a,i,o){var s,l={},u={"1.2.840.10008.1.2.1":function(e){if(Array.isArray(e))return V(e)}(s=Object.values(G))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e){if(e){if("string"==typeof e)return V(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V(e,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},c=t;return t||(c=[{mediaType:"application/octet-stream"}]),n&&(l.Range=r._buildRangeHeaderFieldValue(n)),l.Accept=r._buildMultipartAcceptHeaderFieldValue(c,u),this._httpGet(e,l,"arraybuffer",i,o)}},{key:"_httpPost",value:function(e,t,r,n,a,i){return this._httpRequest(e,"post",t,{data:r,progressCallback:n,withCredentials:a,request:i})}},{key:"_httpPostApplicationJson",value:function(e,t,r,n){var a={"Content-Type":G.DICOM_JSON};return this._httpPost(e,a,t,r,n)}},{key:"searchForStudies",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q("search for studies");var t=!1,n="".concat(this.qidoURL,"/studies");return"queryParams"in e&&(n+=r._parseQueryParameters(e.queryParams)),"withCredentials"in e&&e.withCredentials&&(t=e.withCredentials),this._httpGetApplicationJson(n,{},!1,t)}},{key:"retrieveStudyMetadata",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of study metadata");q("retrieve metadata of study ".concat(e.studyInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/metadata"),r=!1;return"withCredentials"in e&&e.withCredentials&&(r=e.withCredentials),this._httpGetApplicationJson(t,{},!1,r)}},{key:"searchForSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.qidoURL;"studyInstanceUID"in e&&(q("search series of study ".concat(e.studyInstanceUID)),t+="/studies/".concat(e.studyInstanceUID)),t+="/series","queryParams"in e&&(t+=r._parseQueryParameters(e.queryParams));var n=!1;return"withCredentials"in e&&e.withCredentials&&(n=e.withCredentials),this._httpGetApplicationJson(t,{},!1,n)}},{key:"retrieveSeriesMetadata",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of series metadata");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of series metadata");q("retrieve metadata of series ".concat(e.seriesInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/metadata"),r=!1;return"withCredentials"in e&&e.withCredentials&&(r=e.withCredentials),this._httpGetApplicationJson(t,{},!1,r)}},{key:"searchForInstances",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.qidoURL,n=!1;return"studyInstanceUID"in e?(t+="/studies/".concat(e.studyInstanceUID),"seriesInstanceUID"in e?(q("search for instances of series ".concat(e.seriesInstanceUID)),t+="/series/".concat(e.seriesInstanceUID)):q("search for instances of study ".concat(e.studyInstanceUID))):q("search for instances"),t+="/instances","queryParams"in e&&(t+=r._parseQueryParameters(e.queryParams)),"withCredentials"in e&&e.withCredentials&&(n=e.withCredentials),this._httpGetApplicationJson(t,{},!1,n)}},{key:"buildInstanceWadoURIUrl",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required.");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required.");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required.");var t=e.contentType||G.DICOM,r=e.transferSyntax||"*",n=[];n.push("requestType=WADO"),n.push("studyUID=".concat(e.studyInstanceUID)),n.push("seriesUID=".concat(e.seriesInstanceUID)),n.push("objectUID=".concat(e.sopInstanceUID)),n.push("contentType=".concat(t)),n.push("transferSyntax=".concat(r));var a=n.join("&");return"".concat(this.wadoURL,"?").concat(a)}},{key:"retrieveInstanceMetadata",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of instance metadata");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of instance metadata");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of instance metadata");q("retrieve metadata of instance ".concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/metadata"),r=!1;return"withCredentials"in e&&e.withCredentials&&(r=e.withCredentials),this._httpGetApplicationJson(t,{},!1,r)}},{key:"retrieveInstanceFrames",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of instance frames");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of instance frames");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of instance frames");if(!("frameNumbers"in e))throw Error("frame numbers are required for retrieval of instance frames");q("retrieve frames ".concat(e.frameNumbers.toString()," of instance ").concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/frames/").concat(e.frameNumbers.toString()),n=e.mediaTypes,a=!1;"withCredentials"in e&&e.withCredentials&&(a=e.withCredentials);var i=!1;if("progressCallback"in e&&(i=e.progressCallback),!n)return this._httpGetMultipartApplicationOctetStream(t,!1,!1,!1,i,a);if(r._getSharedMediaTypes(n).length>1){var o={Accept:r._buildMultipartAcceptHeaderFieldValue(n,{"1.2.840.10008.1.2.1":["application/octet-stream"],"1.2.840.10008.1.2.5":["image/x-dicom-rle"],"1.2.840.10008.1.2.4.50":["image/jpeg"],"1.2.840.10008.1.2.4.51":["image/jpeg"],"1.2.840.10008.1.2.4.57":["image/jpeg"],"1.2.840.10008.1.2.4.70":["image/jpeg"],"1.2.840.10008.1.2.4.80":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.81":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.90":["image/jp2"],"1.2.840.10008.1.2.4.91":["image/jp2"],"1.2.840.10008.1.2.4.92":["image/jpx"],"1.2.840.10008.1.2.4.93":["image/jpx"],"1.2.840.10008.1.2.4.201":["image/jhc"],"1.2.840.10008.1.2.4.202":["image/jhc"]})};return this._httpGet(t,o,"arraybuffer",i,a)}var s=r._getCommonMediaType(n);if(s.startsWith("application"))return this._httpGetMultipartApplicationOctetStream(t,n,!1,!1,i,a);if(s.startsWith("image"))return this._httpGetMultipartImage(t,n,!1,!1,!1,i,a);if(s.startsWith("video"))return this._httpGetMultipartVideo(t,n,!1,!1,!1,i,a);throw Error("Media type ".concat(s," is not supported for retrieval of frames."))}},{key:"retrieveInstanceRendered",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/rendered"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",o,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);if(s.startsWith("video"))return this._httpGetVideo(t,n,a,o,i);if(s.startsWith("text"))return this._httpGetText(t,n,a,o,i);if(s===G.PDF)return this._httpGetApplicationPdf(t,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered instance.")}},{key:"retrieveInstanceThumbnail",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/thumbnail"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",o,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered instance.")}},{key:"retrieveInstanceFramesRendered",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance frames");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance frames");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance frames");if(!("frameNumbers"in e))throw Error("frame numbers are required for retrieval of rendered instance frames");q("retrieve rendered frames ".concat(e.frameNumbers.toString()," of instance ").concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/frames/").concat(e.frameNumbers.toString(),"/rendered"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",!1,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);if(s.startsWith("video"))return this._httpGetVideo(t,n,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered frame.")}},{key:"retrieveInstanceFramesThumbnail",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance frames");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance frames");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance frames");if(!("frameNumbers"in e))throw Error("frame numbers are required for retrieval of rendered instance frames");console.debug("retrieve rendered frames ".concat(e.frameNumbers.toString()," of instance ").concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/frames/").concat(e.frameNumbers.toString(),"/thumbnail"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",o,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered frame.")}},{key:"retrieveInstance",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID),n=e.mediaTypes,a=e.withCredentials,i=void 0!==a&&a,o=e.progressCallback,s=void 0!==o&&o;if(!n)return this._httpGetMultipartApplicationDicom(t,!1,!1,s,i).then(Y);var l=r._getCommonMediaType(n);if(l===G.DICOM)return this._httpGetMultipartApplicationDicom(t,n,!1,s,i).then(Y);throw Error("Media type ".concat(l," is not supported for retrieval of instance."))}},{key:"retrieveSeries",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID),n=e.mediaTypes,a=!1;"withCredentials"in e&&e.withCredentials&&(a=e.withCredentials);var i=!1;if("progressCallback"in e&&(i=e.progressCallback),!n)return this._httpGetMultipartApplicationDicom(t,!1,!1,i,a);var o=r._getCommonMediaType(n);if(o===G.DICOM)return this._httpGetMultipartApplicationDicom(t,n,!1,i,a);throw Error("Media type ".concat(o," is not supported for retrieval of series."))}},{key:"retrieveStudy",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID),n=e.mediaTypes,a=e.withCredentials,i=void 0!==a&&a,o=e.progressCallback,s=void 0!==o&&o;if(!n)return this._httpGetMultipartApplicationDicom(t,!1,!1,s,i);var l=r._getCommonMediaType(n);if(l===G.DICOM)return this._httpGetMultipartApplicationDicom(t,n,!1,s,i);throw Error("Media type ".concat(l," is not supported for retrieval of study."))}},{key:"retrieveBulkData",value:function(e){if(!("BulkDataURI"in e))throw Error("BulkDataURI is required.");var t=e.BulkDataURI,n=e.mediaTypes,a=e.byteRange,i=e.withCredentials,o=void 0!==i&&i,s=e.progressCallback,l=void 0!==s&&s;if(-1!==this.singlepart.indexOf("bulkdata"))return this._httpGet(t,e.headers,"arraybuffer",null,o);if(n)try{var u=r._getCommonMediaType(n);if("image/"===u)return this._httpGetMultipartImage(t,n,a,!1,!1,l,o)}catch(e){}return this._httpGetMultipartApplicationOctetStream(t,n,a,!1,l,o)}},{key:"storeInstances",value:function(e){if(!("datasets"in e))throw Error("datasets are required for storing");var t="".concat(this.stowURL,"/studies");"studyInstanceUID"in e&&(t+="/".concat(e.studyInstanceUID));var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return"".concat(e()+e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/dicom",n=z("\r\n--".concat(t,"\r\n").concat("Content-Type: ".concat(r),"\r\n\r\n")),a=z("\r\n--".concat(t,"--")),i=n.length,o=a.length,s=0,l=e.map(function(e){var t=new Uint8Array(e),r=t.length;return s+=i+r+o,t}),u=new Uint8Array(s);u.set(n,0);var c=0;return l.forEach(function(e){u.set(n,c),u.set(e,c+i),c+=i+e.length}),u.set(a,c),{data:u.buffer,boundary:t}}(e.datasets),n=r.data,a=r.boundary,i=e.withCredentials;return this._httpPost(t,{"Content-Type":'multipart/related; type="application/dicom"; boundary="'.concat(a,'"')},n,e.progressCallback,void 0!==i&&i,e.request)}}],t=[{key:"_parseQueryParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="?";return Object.keys(e).forEach(function(r,n){0!==n&&(t+="&"),t+="".concat(r,"=").concat(encodeURIComponent(e[r]))}),t}},{key:"_assertMediaTypeIsValid",value:function(e){if(!e)throw Error("Not a valid media type: ".concat(e));var t=e.indexOf("/");if(-1===t||!["application","image","text","video"].includes(e.slice(0,t))||e.slice(t+1).includes("/"))throw Error("Not a valid media type: ".concat(e))}},{key:"_parseMediaType",value:function(e){return r._assertMediaTypeIsValid(e),e.split("/")}},{key:"_buildAcceptHeaderFieldValue",value:function(e,t){if(!Array.isArray(e))throw Error("Acceptable media types must be provided as an Array");return e.map(function(e){var n=e.mediaType;if(r._assertMediaTypeIsValid(n),!t.includes(n))throw Error("Media type ".concat(n," is not supported for requested resource"));return n}).join(", ")}},{key:"_buildMultipartAcceptHeaderFieldValue",value:function(e,t){var n=this;if(!Array.isArray(e))throw Error("Acceptable media types must be provided as an Array");if(!Array.isArray(t)&&!W(t))throw Error("Supported media types must be provided as an Array or an Object");var a=[];if(e.forEach(function(e){var i=e.transferSyntaxUID,o=e.mediaType;r._assertMediaTypeIsValid(o);var s='multipart/related; type="'.concat(o,'"');if(W(t)){if(!Object.values(t).flat(1).includes(o)&&(!o.endsWith("/*")||!o.endsWith("/")))return void q("Media type ".concat(o," is not supported for requested resource"));if(i){if("*"!==i){if(!Object.keys(t).includes(i))throw Error("Transfer syntax ".concat(i," is not supported for requested resource"));var l=t[i];if(!l.includes(o)){var u=r._parseMediaType(o)[0];l.map(function(e){if(!(u===r._parseMediaType(e)[0]&&(o.endsWith("/*")||o.endsWith("/"))))throw Error("Transfer syntax ".concat(i," is not supported for requested resource"))})}}s+="; transfer-syntax=".concat(i)}}else if(Array.isArray(t)&&!t.includes(o)){n.verbose&&console.warn("Media type ".concat(o," is not supported for requested resource"));return}a.push(s)}),!a.length)throw Error("No acceptable media types found among ".concat(JSON.stringify(e)));return a.join(", ")}},{key:"_buildRangeHeaderFieldValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return 1===e.length?"bytes=".concat(e[0],"-"):2===e.length?"bytes=".concat(e[0],"-").concat(e[1]):"bytes=0-"}},{key:"_getSharedMediaTypes",value:function(e){var t=new Set;return e&&e.length?(e.forEach(function(e){var n=e.mediaType,a=r._parseMediaType(n)[0];t.add("".concat(a,"/"))}),Array.from(t)):t}},{key:"_getCommonMediaType",value:function(e){if(!e||!e.length)throw Error("No acceptable media types provided");var t=r._getSharedMediaTypes(e);if(0===t.length)throw Error("No common acceptable media type could be identified.");if(t.length>1)throw Error("Acceptable media types must have the same type.");return t[0]}}],e&&B(r.prototype,e),t&&B(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}()},K=I(1002),J=I.n(K),Z=I(2323);let{getString:Q,getName:ee,getModalities:et}=K.DICOMWeb;function er(e){if(!e||!e.length)return[];let t=[];return e.forEach(e=>t.push({studyInstanceUid:Q(e["0020000D"]),date:Q(e["00080020"]),time:Q(e["00080030"]),accession:Q(e["00080050"])||"",mrn:Q(e["00100020"])||"",patientName:K.utils.formatPN(ee(e["00100010"]))||"",patientBirthDate:Q(e["00100030"])||"",instances:Number(Q(e["00201208"]))||0,description:Q(e["00081030"])||"",modalities:Q(et(e["00080060"],e["00080061"]))||"",referringPhysicianName:K.utils.formatPN(ee(e["00080090"]))||""})),t}async function en(e,t,r,n){return await e.searchForStudies({studyInstanceUid:void 0,queryParams:n})}function ea(e,t={}){if(!e)return;let r=e?.disableWildcard!==void 0?!e.disableWildcard:t.supportsWildcard,n=e=>r&&e?`*${e}*`:e,a={PatientName:n(e.patientName),"00100020":n(e.patientId),AccessionNumber:n(e.accessionNumber),StudyDescription:n(e.studyDescription),ModalitiesInStudy:e.modalitiesInStudy,limit:e.limit||101,offset:e.offset||0,fuzzymatching:!0===t.supportsFuzzyMatching,includefield:"00081030,00080060,00080090,00100030"};if(e.startDate&&e.endDate)a.StudyDate=`${e.startDate}-${e.endDate}`;else if(e.startDate){let t=new Date,r=String(t.getDate()).padStart(2,"0"),n=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear(),o=`${i}${n}${r}`;a.StudyDate=`${e.startDate}-${o}`}else e.endDate&&(a.StudyDate=`19700102-${e.endDate}`);if(e.studyInstanceUid){let t=e.studyInstanceUid;a.StudyInstanceUID=t=(t=Array.isArray(t)?t.join():t).replace(/[^0-9.]+/g,"\\")}let i={};return Object.keys(a).forEach(e=>{void 0!==a[e]&&""!==a[e]&&(i[e]=a[e])}),i}function ei({instance:e,frame:t,config:r,thumbnail:n=!1}){if(!e)return;if(e.imageId&&void 0===t)return e.imageId;if(e.url)return e.url;let a=n?"thumbnailRendering":"imageRendering";if(r[a]&&"wadouri"!==r[a])return function(e,t,r){var n;let a,i=(n=r,a=function(e,t){let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a}=e;return`${t.wadoRoot}/studies/${r}/series/${n}/instances/${a}`}(e,t),n=n||1,`${a}/frames/${n}`);if(i)return`wadors:${i}`}(e,r,t);{let n="dicomweb:"+function(e,t){let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a}=t,i=[];i.push("requestType=WADO"),i.push(`studyUID=${r}`),i.push(`seriesUID=${n}`),i.push(`objectUID=${a}`),i.push("contentType=application/dicom"),i.push("transferSyntax=*");let o=i.join("&");return`${e.wadoUriRoot}?${o}`}(r,e);return void 0!==t&&(n+="&frame="+t),n}}var eo=I(2111),es=I.n(eo),el=I(2302),eu=I.n(el);class ec{constructor(e,t,r={},n,a){this.client=e,this.studyInstanceUID=t,this.filters=r,this.sortCriteria=n,this.sortFunction=a}async execLoad(){let e=await this.preLoad(),t=await this.load(e);return await this.posLoad(t)}async runLoaders(e){let t;for(let r of e)if((t=await r())&&t.length)break;if(e.next().done&&!t)throw Error("RetrieveMetadataLoader failed");return t}async configLoad(){}async preLoad(){}async load(e){}async posLoad(e){}}class ed extends ec{getOptions(){let{studyInstanceUID:e,filters:t}=this,r={studyInstanceUID:e},{seriesInstanceUID:n}=t;return n&&(r.seriesInstanceUID=n),r}*getLoaders(){let e=[],{studyInstanceUID:t,filters:{seriesInstanceUID:r}={},client:n}=this;r&&e.push(n.retrieveSeriesMetadata.bind(n,{studyInstanceUID:t,seriesInstanceUID:r})),e.push(n.retrieveStudyMetadata.bind(n,{studyInstanceUID:t})),yield*e}async load(e){let t=this.getLoaders();return this.runLoaders(t)}async posLoad(e){return e}}class ef{constructor(){this.metadata=void 0,this.processFunction=void 0,this.internalPromise=void 0,this.thenFunction=void 0,this.rejectFunction=void 0}setMetadata(e){this.metadata=e}setProcessFunction(e){this.processFunction=e}getPromise(){return this.start()}start(){return this.internalPromise||(this.internalPromise=this.processFunction(),this.thenFunction&&(this.then(this.thenFunction),this.thenFunction=void 0),this.rejectFunction&&(this.reject(this.rejectFunction),this.rejectFunction=void 0)),this.internalPromise}then(e){if(this.internalPromise)return this.internalPromise.then(e);this.thenFunction=e}reject(e){if(this.internalPromise)return this.internalPromise.reject(e);this.rejectFunction=e}}class ep extends ec{*getPreLoaders(){let e=[],{studyInstanceUID:t,filters:{seriesInstanceUID:r}={},client:n}=this,a={studyInstanceUID:t,queryParams:{includefield:"00080021,00080031,0008103E,00200011"}};r&&(a.queryParams.SeriesInstanceUID=r,e.push(n.searchForSeries.bind(n,a))),e.push(n.searchForSeries.bind(n,a)),yield*e}async preLoad(){let e=this.getPreLoaders(),t=await this.runLoaders(e),r=this.sortCriteria,n=this.sortFunction,{naturalizeDataset:a}=es().data.DicomMetaDictionary,i=t.map(a);return(0,Z.sortStudySeries)(i,r,n)}async load(e){let{client:t,studyInstanceUID:r}=this,n=e.map(e=>({seriesInstanceUID:e.SeriesInstanceUID,metadata:e})),a=Object.freeze({hasNext:()=>n.length>0,next(){let{seriesInstanceUID:e,metadata:a}=n.shift(),i=new ef;return i.setMetadata(a),i.setProcessFunction(()=>t.retrieveSeriesMetadata({studyInstanceUID:r,seriesInstanceUID:e})),i}}),i=[];for(;a.hasNext();){let e=a.next();i.push(e)}return{preLoadData:e,promises:i}}async posLoad({preLoadData:e,promises:t}){return{preLoadData:e,promises:t}}}async function eh(e,t,r,n={},a,i){let o=new(!1!==r?ep:ed)(e,t,n,a,i);return await o.execLoad()}let eg=function(e,t,r,n,a,i){let{seriesInstanceUID:o}=n;return new Promise((s,l)=>{let u=o.map(o=>eh(e,t,r,Object.assign({},n,{seriesInstanceUID:o}),a,i));!0===r?Promise.all(u).then(e=>{let t={preLoadData:[],promises:[]};e.forEach(({preLoadData:e,promises:r})=>{t.preLoadData=t.preLoadData.concat(e),t.promises=t.promises.concat(r)}),s(t)},l):Promise.all(u).then(e=>{s(e.flat())},l)})},em="RetrieveStudyMetadata",ey=new Map;function ev(e,t,r,n,a,i,o={}){let s;if(!e)throw Error(`${em}: Required 'dicomWebClient' parameter not provided.`);if(!t)throw Error(`${em}: Required 'StudyInstanceUID' parameter not provided.`);let l=`${o.name}:${t}`;return ey.has(l)?ey.get(l):(s=n&&n.seriesInstanceUID&&Array.isArray(n.seriesInstanceUID)?eg(e,t,r,n,a,i):new Promise((o,s)=>{eh(e,t,r,n,a,i).then(function(e){o(e)},s)}),ey.set(l,s),s)}function eb(e){if(!e)return;let t=`:${e}`;for(let r of[...ey.keys()])(r===e||r.endsWith(t))&&ey.delete(r)}let ex=function(e,t,r){r=r||0;let n=function(e){let t=new Uint8Array(e.length);for(let r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t}(t);for(let t=r;t<e.length;t++)if(n[0]===e[t]&&function(e,t,r){if(r+e.length>t.length)return!1;let n=r;for(let r=0;r<e.length;r++)if(e[r]!==t[n++])return!1;return!0}(n,e,t))return t;return -1},{DICOMwebClient:eS}=X;eS._orig_buildMultipartAcceptHeaderFieldValue||(eS._orig_buildMultipartAcceptHeaderFieldValue=eS._buildMultipartAcceptHeaderFieldValue,eS._buildMultipartAcceptHeaderFieldValue=function(e,t){return 1===e.length&&e[0].mediaType.endsWith("/*")?"*/*":eS._orig_buildMultipartAcceptHeaderFieldValue(e,t)});class ew extends X.DICOMwebClient{constructor(e){super(e),this.config=void 0,this.staticWado=void 0,this.staticWado=e.staticWado,this.config=e}retrieveBulkData(e){let t=!1!==this.config.fixBulkdataMultipart,r={...e};return this.staticWado&&(r.mediaTypes=[{mediaType:"application/*"}]),super.retrieveBulkData(r).then(e=>t?function(e){let t=new Uint8Array(e[0]);if(t.length<25)return e;let r=ex(t,"--");if(r>6)return e;let n=ex(t,"\r\n\r\n",r);if(n>512)return e;let a=function(e){for(let t=0;t<e.length;t++)if("--"===e[t].substr(0,2))return e[t]}((function(e,t,r){t=t||0,r=r||e.length-t;let n="";for(let a=t;a<t+r;a++)n+=String.fromCharCode(e[a]);return n})(t,0,n).split("\r\n"));if(!a)return e;let i=n+4,o=ex(t,a,i);return -1===o?e:[t.slice(i,o-2).buffer]}(e):e)}retrieveInstanceFrames(e){return this.staticWado?super.retrieveInstanceFrames({...e,mediaTypes:[{mediaType:"image/*"}]}):super.retrieveInstanceFrames(e)}async searchForStudies(e){if(!this.staticWado)return super.searchForStudies(e);let t=await super.searchForStudies(e),{queryParams:r}=e;if(!r)return t;let n=this.toLowerParams(r);return t.filter(e=>{for(let t of Object.keys(ew.studyFilterKeys))if(!this.filterItem(t,n,e,ew.studyFilterKeys))return!1;return!0})}async searchForSeries(e){if(!this.staticWado)return super.searchForSeries(e);let t=await super.searchForSeries(e),{queryParams:r}=e;if(!r)return t;let n=this.toLowerParams(r);return t.filter(e=>{for(let t of Object.keys(ew.seriesFilterKeys))if(!this.filterItem(t,n,e,ew.seriesFilterKeys))return!1;return!0})}compareValues(e,t,r){let{fuzzyMatching:n}=r;if(Array.isArray(e))return e.find(e=>this.compareValues(e,t,r));if(Array.isArray(t))return t.find(t=>this.compareValues(e,t,r));if(t?.Alphabetic&&(t=t.Alphabetic),n&&"string"==typeof t&&"string"==typeof e){let r=e.toLowerCase(),n=t.toLowerCase(),a=e=>e.split(/[\s^]+/).filter(Boolean),i=a(r),o=a(n);return i.every(e=>o.some(t=>t.startsWith(e)))}if("string"==typeof t){if(0===t.length||0===e.length||"*"===e)return!0;if("*"===e[0]&&"*"===e[e.length-1])return -1!=t.indexOf(e.substring(1,e.length-1));if("*"===e[e.length-1])return -1!=t.indexOf(e.substring(0,e.length-1));if("*"===e[0])return t.indexOf(e.substring(1))===t.length-e.length+1}return e===t}compareDateRange(e,t){if(!t)return!0;let r=e.indexOf("-");if(-1===r)return this.compareValues(e,t,{});let n=e.substring(0,r),a=e.substring(r+1);return(!n||t>=n)&&(!a||t<=a)}filterItem(e,t,r,n){let{supportsFuzzyMatching:a=!1}=this.config,i={fuzzyMatching:-1!==e.indexOf("name")&&a},o=n[e]||e;if(!t)return!0;let s=t[e]||t[o];if(!s)return!0;let l=r[e]||r[o];if(!l)return!1;if("DA"===l.vr&&l.Value?.[0])return this.compareDateRange(s,l.Value[0]);let u=l.Value;return this.compareValues(s,u,i)}toLowerParams(e){let t={};return Object.entries(e).forEach(([e,r])=>{t[e.toLowerCase()]=r}),t}}ew.studyFilterKeys={studyinstanceuid:"0020000D",patientname:"00100010","00100020":"mrn",studydescription:"00081030",studydate:"00080020",modalitiesinstudy:"00080061",accessionnumber:"00080050"},ew.seriesFilterKeys={seriesinstanceuid:"0020000E",seriesnumber:"00200011",modality:"00080060"};let e_=(e,t)=>{let{singlepart:r}=e,{instance:n,tag:a="PixelData",defaultType:i="video/mp4",singlepart:o="video",url:s=null}=t;if(s)return s;let l=n[a];if(l){if(l.DirectRetrieveURL)return l.DirectRetrieveURL;if(l.InlineBinary){let e=K.utils.b64toBlob(l.InlineBinary,i);return l.DirectRetrieveURL=URL.createObjectURL(e),l.DirectRetrieveURL}if(!r||!0!==r&&-1===r.indexOf(o))return l.retrieveBulkData?l.retrieveBulkData({mediaType:i}).then(e=>(l.DirectRetrieveURL=URL.createObjectURL(new Blob([e],{type:i})),l.DirectRetrieveURL)):void console.warn("Unable to retrieve",a,"from",n)}return((e,t)=>{let{wadoRoot:r}=e,{instance:n,tag:a="PixelData"}=t,{StudyInstanceUID:i,SeriesInstanceUID:o,SOPInstanceUID:s}=n,l=n[a]?.BulkDataURI??"";if(l?.indexOf("?")===-1&&("PixelData"===a||"EncapsulatedDocument"===a))return`${r}/studies/${i}/series/${o}/instances/${s}/rendered`})(e,t)||((e,t)=>{let{instance:r,tag:n="PixelData",defaultPath:a="/pixeldata",defaultType:i="video/mp4"}=t,o=r[n],{StudyInstanceUID:s,SeriesInstanceUID:l,SOPInstanceUID:u}=r,c=o&&o.BulkDataURI||`series/${l}/instances/${u}${a}`,d=-1!==c.indexOf("?"),f=-1!==c.indexOf("accept="),p=c+(f?"":(d?"&":"?")+`accept=${i}`);if(p.startsWith("series/")){let{wadoRoot:t}=e;return`${t}/studies/${s}/${p}`}return p})(e,t)};function eI(e,t,r){let{BulkDataURI:n}=e,{bulkDataURI:a={}}=r;n=a.transform?.(n)||n;let{startsWith:i,prefixWith:o=""}=a;if(i&&n.startsWith(i)&&(e.BulkDataURI=n=o+n.substring(i.length)),!n.startsWith("http")&&!e.BulkDataURI.startsWith("/")){let{StudyInstanceUID:i,SeriesInstanceUID:o}=t,s=n.startsWith("instances/")||n.startsWith("../");n.startsWith("series/")||n.startsWith("bulkdata/")||"studies"===a.relativeResolution&&!s?e.BulkDataURI=`${r.wadoRoot}/studies/${i}/${n}`:(s||"series"===a.relativeResolution||!a.relativeResolution)&&(e.BulkDataURI=`${r.wadoRoot}/studies/${i}/series/${o}/${n}`);return}if("/"===n[0]&&r.wadoRoot.startsWith("http")){let t=new URL(r.wadoRoot);e.BulkDataURI=`${t.origin}${n}`}}let eD={allowInvalidVRLength:!1,fragmentMultiframe:!1},eO=["url","wadorsuri","wadouri","wadoRoot","wadoUri","wadoUriRoot","imageRendering","imageId","_parentInstance","frameNumber"];function ek(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function eC(e){for(let t of eO){if(!Object.prototype.hasOwnProperty.call(e,t))continue;let r=Object.getOwnPropertyDescriptor(e,t);r&&!1!==r.enumerable&&ek(e,t,r.value)}}function ej(e){let t=e?._meta?.TransferSyntaxUID;return"string"==typeof t?t:Array.isArray(t?.Value)?t.Value[0]:"string"==typeof e?.TransferSyntaxUID?e.TransferSyntaxUID:"1.2.840.10008.1.2.1"}function eE(e){let t,r;return new Blob([(eC(e),t=ej(e),r=es().data.datasetToDict(e),t&&r?.meta&&(r.meta["00020010"]={vr:"UI",Value:[t]}),r.write(eD))],{type:"application/dicom"})}function eM(e,t,r){let{StudyInstanceUID:n,SeriesInstanceUID:a,SOPInstanceUID:i}=e,o=a&&i?`/studies/${n}/series/${a}/instances/${i}/${t}`:a?`/studies/${n}/series/${a}/${t}`:`/studies/${n}/${t}`;if(!r)return o;let s=r.toString();return s?`${o}?${s}`:o}async function eR(e,t,r,n,a){let i,o=(i=eM(e,t,new URLSearchParams({viewport:"256,256"})),{url:`${r}${i}`,endpointPath:i,headers:{...n(),Accept:"image/jpeg"}});try{let e=await fetch(o.url,{method:"GET",headers:o.headers,signal:a});if(!e.ok)return console.warn(`thumbnail fetch failed with status ${e.status} for ${o.endpointPath}`),null;let t=await e.blob();return URL.createObjectURL(t)}catch(e){if(e?.name==="AbortError")return null;return console.warn("thumbnail fetch failed",e),null}}async function eP(e,t,r,n,a,i){let o="00080018",s=await eR(e,t,r,n,i);if(s)return s;if(i?.aborted||e.SOPInstanceUID||!e.StudyInstanceUID||!e.SeriesInstanceUID)return null;try{a.headers=n();let s=await a.searchForInstances({studyInstanceUID:e.StudyInstanceUID,seriesInstanceUID:e.SeriesInstanceUID,queryParams:{limit:1,includefield:o}});if(i?.aborted)return null;let l=s?.[0],u=l?.[o],c=u?.Value,d=Array.isArray(c)&&c.length?String(c[0]):void 0;if(!d)return null;return eR({...e,SOPInstanceUID:d},t,r,n,i)}catch(e){return console.warn("thumbnail fetch QIDO fallback failed",e),null}}async function eA({url:e,wadoRoot:t,headers:r,signal:n,userAuthenticationService:a}){if(!e||n?.aborted)return{url:null};if(!r?.Authorization||!function(e,t){if(!t)return!1;try{let r=new URL(e,window.location.href),n=new URL(t,window.location.href),a="http:"===r.protocol||"https:"===r.protocol,i="http:"===n.protocol||"https:"===n.protocol;return a&&i&&r.origin===n.origin}catch{return!1}}(e,t))return{url:e};try{var i;let t,o=await fetch(e,{method:"GET",headers:r,signal:n});if(!o.ok)return(401===o.status||403===o.status)&&a?.handleUnauthenticated?.(),console.warn(`rendered media fetch failed with status ${o.status}`),{url:null};let s=await o.blob(),l=URL.createObjectURL(s);if(n?.aborted)return URL.revokeObjectURL(l),{url:null};return{url:l,revoke:(i=l,t=!1,()=>{t||(URL.revokeObjectURL(i),t=!0)})}}catch(e){if(e?.name==="AbortError")return{url:null};return console.warn("rendered media fetch failed",e),{url:null}}}function eN(e,t={}){let{mediaType:r}=t,n={multipart:!1,BulkDataURI:e.BulkDataURI,mediaTypes:r?[{mediaType:r},{mediaType:"application/octet-stream"}]:void 0,...t};return this.retrieveBulkData(n).then(t=>{let r=Array.isArray(t)?t.find(e=>e?.byteLength):t?.byteLength?t:void 0;return e.Value=r,r})}let{DicomMetaDictionary:eT,DicomDict:eU}=es().data,{naturalizeDataset:eL,denaturalizeDataset:eF}=eT,eB=K.classes.MetadataProvider,eV={includeTransferSyntax:!1};function ez(e,t){var r,n;let a,i,o,s,l,{userAuthenticationService:u}=t.services;e.bulkDataURI||={enabled:!0};let c=(t,r=t)=>{if(!t)return t;for(let n of Object.keys(t)){let a=t[n];if(Array.isArray(a)&&"object"==typeof a[0]){a.filter(Boolean).forEach(e=>c(e,r));continue}a&&a.BulkDataURI&&!a.Value&&(eI(a,r,e),a.retrieveBulkData=eN.bind(o,a))}return t},d=t=>{let r=eL(t);return e.bulkDataURI?.enabled?c(r):r},f={initialize:({params:t,query:r})=>{e.onConfiguration&&"function"==typeof e.onConfiguration&&(e=e.onConfiguration(e,{params:t,query:r})),a=JSON.parse(JSON.stringify(e)),s=()=>{let e={},t=u.getAuthorizationHeader();return t&&t.Authorization&&(e.Authorization=t.Authorization),e},l=t=>{let r=s();if(t?.includeTransferSyntax===!1)return{...r};{let t=K.utils.generateAcceptHeader(e.acceptHeader,e.requestTransferSyntaxUID,e.omitQuotationForMultipartRequest);return{...r,Accept:t}}};let n=e.qidoRoot??e.wadoRoot,c=e.wadoRoot??e.qidoRoot,d=e.stowRoot??c;i={url:c,staticWado:e.staticWado,singlepart:e.singlepart,headers:u.getAuthorizationHeader(),errorInterceptor:K.errorHandler.getHTTPErrorHandler(),supportsFuzzyMatching:e.supportsFuzzyMatching},(o=e.staticWado?new ew(i):new X.DICOMwebClient(i)).qidoURL=n,o.wadoURL=c,o.stowURL=d},query:{studies:{mapParams:ea.bind(),search:async function(t){o.headers=s();let{studyInstanceUid:r,seriesInstanceUid:n,...a}=ea(t,{supportsFuzzyMatching:e.supportsFuzzyMatching,supportsWildcard:e.supportsWildcard})||{};return er(await en(o,void 0,void 0,a))},processResults:er.bind()},series:{search:async function(e){var t;let r;return o.headers=s(),r=[],(t=await o.searchForSeries({studyInstanceUID:e,queryParams:{includefield:"0008103E,00080021"}}))&&t.length&&t.forEach(e=>r.push({studyInstanceUid:Q(e["0020000D"]),seriesInstanceUid:Q(e["0020000E"]),modality:Q(e["00080060"]),seriesNumber:Q(e["00200011"]),seriesDate:Q(e["00080021"]),numSeriesInstances:Number(Q(e["00201209"])),description:Q(e["0008103E"])})),(0,Z.sortStudySeries)(r),r.map(e=>({...e,seriesDate:K.utils.formatDate(e.seriesDate)}))}},instances:{search:(e,t)=>(o.headers=s(),en.call(void 0,o,e,null,t))}},retrieve:{getGetThumbnailSrc:function(t,r){return function({thumbnailContext:e,imageId:t,config:r,getAuthorizationHeader:n,qidoDicomWebClient:a,retrieve:i}){let o=r.thumbnailRendering;return o?"wadors"===o?function(e){return!t||!e?.getImageSrc||e?.signal?.aborted?null:e.getImageSrc(t)}:"thumbnailDirect"===o?function(){return i.directURL({instance:e,defaultPath:"/thumbnail",defaultType:"image/jpeg",singlepart:!0,tag:"Absent"})}:"fetch"===(r.thumbnailRequestStrategy||"bulkDataRetrieve")?async function(t){return eP(e,o,r.wadoRoot,n,a,t?.signal)}:"thumbnail"===o||"rendered"===o?async function(t){if(t?.signal?.aborted)return null;let n=eM(e,o,new URLSearchParams({accept:"image/jpeg"})),a=`${r.wadoRoot}${n}`;return URL.createObjectURL(new Blob([await i.bulkDataURI({BulkDataURI:a.replace("wadors:",""),defaultType:"image/jpeg",mediaTypes:["image/jpeg"],thumbnail:!0})],{type:"image/jpeg"}))}:function(){return console.warn(`Unsupported thumbnailRendering "${o}"; returning null thumbnail src.`),null}:function(){return console.warn("thumbnailRendering is not configured; returning null thumbnail src."),null}}({thumbnailContext:t,imageId:r,config:e,getAuthorizationHeader:s,qidoDicomWebClient:o,retrieve:this})},directURL:t=>e_({wadoRoot:e.wadoRoot,singlepart:e.singlepart},t),renderedURL:(t,r)=>(function({config:e,getAuthorizationHeader:t,retrieve:r,userAuthenticationService:n}){return async function(a,i={}){return eA({url:await r.directURL(a),wadoRoot:e.wadoRoot,headers:t(),signal:i.signal,userAuthenticationService:n})}})({config:e,getAuthorizationHeader:s,retrieve:f.retrieve,userAuthenticationService:u})(t,r),getWadoDicomWebClient:()=>o,prefetchInstanceFrames:({instance:e,imageId:t})=>{let r={done:Promise.resolve(!1),cancel:()=>{}};if(!e||!t)return r;let n=e.StudyInstanceUID,a=e.SeriesInstanceUID,i=e.SOPInstanceUID||e.SopInstanceUID;if(!n||!a||!i)return r;let l=!1,u=async()=>{o.headers=s();let e=await o.retrieveInstance({studyInstanceUID:n,seriesInstanceUID:a,sopInstanceUID:i});if(l)throw Error("prefetchInstanceFrames cancelled");if(e instanceof ArrayBuffer)return e;if(Array.isArray(e)&&e[0]instanceof ArrayBuffer)return e[0];if(e&&e.buffer instanceof ArrayBuffer)return e.buffer;throw Error("Unexpected retrieveInstance result for instance prefetch")};return{done:(async()=>{try{return await eu().prefetchPart10Instance(t,u),!l}catch(e){return console.warn("[prefetchInstanceFrames] full-instance prefetch failed; falling back to per-frame loads",e),!1}})(),cancel:()=>{l=!0}}},bulkDataURI:async({StudyInstanceUID:e,BulkDataURI:t})=>(o.headers=s(),o.retrieveBulkData({multipart:!1,BulkDataURI:t,StudyInstanceUID:e}).then(e=>e&&e[0]||void 0)),series:{metadata:async({StudyInstanceUID:t,filters:r,sortCriteria:n,sortFunction:a,madeInClient:i=!1,returnPromises:o=!1}={})=>{if(!t)throw Error("Unable to query for SeriesMetadata without StudyInstanceUID");return e.enableStudyLazyLoad?f._retrieveSeriesMetadataAsync(t,r,n,a,i,o):f._retrieveSeriesMetadataSync(t,r,n,a,i)}}},store:{dicom:async(e,t,r)=>{if(o.headers=s(),e instanceof ArrayBuffer)await o.storeInstances({datasets:[e],request:t});else{let n=r;if(!r){let t=new eU(eF({FileMetaInformationVersion:e._meta?.FileMetaInformationVersion?.Value,MediaStorageSOPClassUID:e.SOPClassUID,MediaStorageSOPInstanceUID:e.SOPInstanceUID,TransferSyntaxUID:ej(e),ImplementationClassUID:"2.25.270695996825855179949881587723571202391.2.0.0",ImplementationVersionName:"OHIF-3.11.0"}));t.dict=eF(e),n=t}let a=n.write(eD);await o.storeInstances({datasets:[a],request:t})}}},_retrieveSeriesMetadataSync:async(t,r,n,a,i)=>{o.headers=l(eV);let u=(await ev(o,t,!1,r,n,a,e)).map(d);o.headers=s(),await K.utils.resolveBulkDataTags(u);let c={},p={};u.forEach(r=>{c[r.SeriesInstanceUID]||(c[r.SeriesInstanceUID]={StudyInstanceUID:r.StudyInstanceUID,StudyDescription:r.StudyDescription,SeriesInstanceUID:r.SeriesInstanceUID,SeriesDescription:r.SeriesDescription,SeriesNumber:r.SeriesNumber,SeriesTime:r.SeriesTime,SOPClassUID:r.SOPClassUID,ProtocolName:r.ProtocolName,Modality:r.Modality}),p[r.SeriesInstanceUID]||(p[r.SeriesInstanceUID]=[]);let n=f.getImageIdsForInstance({instance:r});ek(r,"imageId",n),ek(r,"wadoRoot",e.wadoRoot),ek(r,"wadoUri",e.wadoUri),eB.addImageIdToUIDs(n,{StudyInstanceUID:t,SeriesInstanceUID:r.SeriesInstanceUID,SOPInstanceUID:r.SOPInstanceUID}),p[r.SeriesInstanceUID].push(r)});let h=Object.values(c);return K.DicomMetadataStore.addSeriesMetadata(h,i),Object.keys(p).forEach(e=>K.DicomMetadataStore.addInstances(p[e],i)),c},_retrieveSeriesMetadataAsync:async(t,r,n,a,i=!1,u=!1)=>{o.headers=l(eV);let{preLoadData:c,promises:p}=await ev(o,t,!0,r,n,a,e);async function h(t){let r=t.map(d);o.headers=s(),await K.utils.resolveBulkDataTags(r),r.forEach(t=>{ek(t,"wadoRoot",e.wadoRoot),ek(t,"wadoUri",e.wadoUri);let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a}=t,i=t.NumberOfFrames||1;for(let e=0;e<i;e++){let o=e+1,s=f.getImageIdsForInstance({instance:t,frame:o});eB.addImageIdToUIDs(s,{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a,frameNumber:i>1?o:void 0})}let o=f.getImageIdsForInstance({instance:t});ek(t,"imageId",o)}),K.DicomMetadataStore.addInstances(r,i)}function g(){let e=K.DicomMetadataStore.getStudy(t);e&&(e.isLoaded=!0)}c.forEach(e=>{e.StudyInstanceUID=t}),K.DicomMetadataStore.addSeriesMetadata(c,i);let m=0,y=p.map(e=>{let t;return{metadata:e.metadata,start:()=>(t||(t=e.start().then(async e=>(await h(e),m++,u&&m===p.length&&g(),e))),t)}});return u?(y.length||g(),y):(await Promise.all(y.map(e=>e.start())),g(),c)},deleteStudyMetadataPromise:eb,getImageIdsForDisplaySet(e){let t=e.images,r=[];return t&&e.images.forEach(e=>{let t=e.NumberOfFrames;if(t>1)for(let n=1;n<=t;n++){let t=this.getImageIdsForInstance({instance:e,frame:n});r.push(t)}else{let t=this.getImageIdsForInstance({instance:e});r.push(t)}}),r},getImageIdsForInstance:({instance:t,frame:r})=>ei({instance:t,frame:r,config:e}),getConfig:()=>a,getStudyInstanceUIDs({params:e,query:t}){let r=e.StudyInstanceUIDs||e.studyInstanceUIDs,n=K.utils.splitComma(t.getAll("StudyInstanceUIDs").concat(t.getAll("studyInstanceUIDs"))),a=n.length&&n||r;return a&&Array.isArray(a)?a:[a]}};return e.supportsReject&&(r=e.wadoRoot,n=s,f.reject={series:(e,t)=>new Promise((a,i)=>{let o=`${r}/studies/${e}/series/${t}/reject/113001%5EDCM`,s=new XMLHttpRequest;s.open("POST",o,!0);let l=n();for(let e in l)s.setRequestHeader(e,l[e]);console.log(s),s.onreadystatechange=function(){if(4==s.readyState)switch(s.status){case 200:case 204:a(s.responseText);break;case 404:i("Your dataSource does not support reject functionality");default:i(`Unexpected status code: ${s.status}`)}},s.send()})}),K.IWebApiDataSource.create(f)}var eH=I(8985);function eW(e,t={}){let{allowedOrigins:r=[],userAuthenticationService:n}=t,a=function(e){if(!e||"string"!=typeof e)throw Error('Missing required "url" query parameter');try{return new URL(e,window.location.href)}catch{throw Error('Invalid URL in "url" query parameter')}}(e),i=a.protocol.toLowerCase(),o=a.origin===window.location.origin;if(!["http:","https:"].includes(i))throw Error("Only HTTP(S) URLs are allowed for dynamic datasource configuration");if(a.hash)throw Error("URL fragments are not allowed for dynamic datasource configuration");if(a.username||a.password)throw Error("URL userinfo is not allowed for dynamic datasource configuration");let s=!!n?.getAuthorizationHeader?.()?.Authorization;if(s&&!o){let e=function(e=[]){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).map(e=>{try{let t=new URL(e);if(!["http:","https:"].includes(t.protocol))return console.error(`[secureConfigFetch] Ignoring misconfigured allowed origin "${e}". Entries must use http:// or https://.`),null;if(t.username||t.password||"/"!==t.pathname||t.search||t.hash)return console.error(`[secureConfigFetch] Ignoring misconfigured allowed origin "${e}". Entries must be bare origins only (scheme + host + optional port), with no username/password, path, query, or hash.`),null;return t.origin}catch{return console.error(`[secureConfigFetch] Ignoring misconfigured allowed origin "${e}". Entry is not a valid URL.`),null}}).filter(Boolean):[]}(r);if(!e.length||!e.includes(a.origin))throw Error(`Blocked remote configuration origin "${a.origin}" in authenticated environment`)}return{parsedUrl:a,normalizedUrl:a.toString(),isAuthenticated:s,isSameOrigin:o}}async function e$(e){let{normalizedUrl:t}=e,r=await fetch(t,{method:"GET",mode:"cors",credentials:"same-origin",redirect:"error",referrerPolicy:"no-referrer"});if(!r.ok)throw Error(`Failed to fetch dynamic datasource configuration (${r.status})`);return r.json()}let eY=J().classes.MetadataProvider,eG={studyInstanceUid:"StudyInstanceUID",patientId:"PatientID"},eq={urls:[],studyInstanceUIDMap:new Map},eX=(e,t)=>{let r=[];return eq.urls.map(n=>{n.studies.map(n=>{n[e]===t&&r.push(n)})}),r};function eK(e,t){let{userAuthenticationService:r}=t.services,n={initialize:async({query:t,url:n})=>{let a,i,o;n||(n=t.get("url"));let s=eW(n,{allowedOrigins:e.dangerouslyAllowedOriginsForAuthenticatedEnvironments,userAuthenticationService:r}),l=(o=s.normalizedUrl,eq.urls.find(e=>e.url===o));if(l)return l.studies.map(e=>e.StudyInstanceUID);let u=await e$(s);u.studies.forEach(t=>{a=t.StudyInstanceUID,t.series.forEach(t=>{i=t.SeriesInstanceUID,t.instances.forEach(t=>{let{metadata:r}=t,n=ei({instance:t,config:e}),{query:o}=eH.parseUrl(t.url);eY.addImageIdToUIDs(n,{StudyInstanceUID:a,SeriesInstanceUID:i,SOPInstanceUID:r.SOPInstanceUID,frameNumber:o.frame?parseInt(o.frame):void 0})})})}),eq.urls.push({url:s.normalizedUrl,studies:[...u.studies]}),eq.studyInstanceUIDMap.set(s.normalizedUrl,u.studies.map(e=>e.StudyInstanceUID))},query:{studies:{mapParams:()=>{},search:async e=>{let[t,r]=Object.entries(e)[0];return eX(eG[t],r).map(e=>({accession:e.AccessionNumber,date:e.StudyDate,description:e.StudyDescription,instances:e.NumInstances,modalities:e.Modalities,mrn:e.PatientID,patientName:e.PatientName,studyInstanceUid:e.StudyInstanceUID,NumInstances:e.NumInstances,time:e.StudyTime}))},processResults:()=>{console.warn(" DICOMJson QUERY processResults not implemented")}},series:{search:()=>{console.warn(" DICOMJson QUERY SERIES SEARCH not implemented")}},instances:{search:()=>{console.warn(" DICOMJson QUERY instances SEARCH not implemented")}}},retrieve:{directURL:t=>e_(e,t),series:{metadata:async({filters:t,StudyInstanceUID:r,madeInClient:n=!1,customSort:a}={})=>{let i;if(!r)throw Error("Unable to query for SeriesMetadata without StudyInstanceUID");let o=eX("StudyInstanceUID",r)[0];i=a?a(o.series):o.series;let s=["SeriesInstanceUID","SeriesInstanceUIDs","seriesInstanceUID","seriesInstanceUIDs"].find(e=>t[e]);if(s){let e=t[s];i=i.filter(t=>e.includes(t.SeriesInstanceUID))}let l=i.map(e=>{let t={StudyInstanceUID:o.StudyInstanceUID,...e};return delete t.instances,t});K.DicomMetadataStore.addSeriesMetadata(l,n);let u=i.length;i.forEach((t,a)=>{var i;i=t.instances.map(r=>{let n={...function e(t){return Object.keys(t).reduce((r,n)=>("object"==typeof t[n]&&null!==t[n]?r[n]=e(t[n]):r[n]=t[n],n.endsWith("Sequence")&&(r[n]=J().utils.addAccessors(r[n])),r),Array.isArray(t)?[]:{})}(r.metadata),url:r.url,imageId:ei({instance:r,config:e}),...t,...o};return delete n.instances,delete n.series,n}),K.DicomMetadataStore.addInstances(i,n),a===u-1&&(K.DicomMetadataStore.getStudy(r,n).isLoaded=!0)})}}},store:{dicom:()=>{console.warn(" DICOMJson store dicom not implemented")}},reject:{},deleteStudyMetadataPromise:()=>{},getImageIdsForDisplaySet(t){let r=t.images,n=[];if(!r)return n;let{StudyInstanceUID:a,SeriesInstanceUID:i}=t,o=eX("StudyInstanceUID",a)[0].series.find(e=>e.SeriesInstanceUID===i)||{},s=new Map;return o.instances&&o.instances.forEach(e=>{if(e?.metadata?.SOPInstanceUID){let{metadata:t,url:r}=e,n=s.get(t.SOPInstanceUID)||[];n.push({...t,url:r}),s.set(t.SOPInstanceUID,n)}}),t.images.forEach(t=>{let r=t.NumberOfFrames||1,a=s.get(t.SOPInstanceUID)||[t];for(let t=0;t<r;t++){let i=ei({instance:a[Math.min(t,a.length-1)],frame:r>1?t:void 0,config:e});n.push(i)}}),n},getImageIdsForInstance:({instance:e,frame:t})=>ei({instance:e,frame:t}),getStudyInstanceUIDs:({params:t,query:n})=>{let a=n.get("url");if(a)try{let t=eW(a,{allowedOrigins:e.dangerouslyAllowedOriginsForAuthenticatedEnvironments,userAuthenticationService:r});return eq.studyInstanceUIDMap.get(t.normalizedUrl)}catch{return}},getConfig:()=>e};return K.IWebApiDataSource.create(n)}function eJ(e,t){let r=e.split("&frame=")[0].split("?frame=")[0],n=r.includes("?")?"&":"?";return`${r}${n}frame=${t}`}let eZ=J().classes.MetadataProvider,{EVENTS:eQ}=K.DicomMetadataStore,e0={SR:!0,SEG:!0,DOC:!0},e1=(e,t,r=0)=>e===t?r:e<t?-1:1,e2=(e,t)=>{let r=e.instances[0],n=t.instances[0],a=r.Modality,i=n.Modality,o=e0[a],s=e0[i];return o&&s?e1(r.SeriesNumber,n.SeriesNumber):o||s?o?-1:1:e1(n.SeriesNumber,r.SeriesNumber)};function e3(e){let{name:t}=e;return K.IWebApiDataSource.create({initialize:({params:e,query:t})=>{},query:{studies:{mapParams:()=>{},search:e=>K.DicomMetadataStore.getStudyInstanceUIDs().map(e=>{let t=0,r=new Set,n=K.DicomMetadataStore.getStudy(e);n.series.forEach(e=>{t+=e.instances.length,r.add(e.instances[0].Modality)});let a=n?.series[0]?.instances[0];if(a)return{accession:a.AccessionNumber,date:a.StudyDate,description:a.StudyDescription,mrn:a.PatientID,patientName:K.utils.formatPN(a.PatientName),studyInstanceUid:a.StudyInstanceUID,time:a.StudyTime,instances:t,modalities:Array.from(r).join("/"),NumInstances:t}}),processResults:()=>{console.warn(" DICOMLocal QUERY processResults not implemented")}},series:{search:e=>K.DicomMetadataStore.getStudy(e).series.map(t=>{let r=t?.instances[0];return{studyInstanceUid:e,seriesInstanceUid:r.SeriesInstanceUID,modality:r.Modality,seriesNumber:r.SeriesNumber,seriesDate:r.SeriesDate,numSeriesInstances:t.instances.length,description:r.SeriesDescription}})},instances:{search:()=>{console.warn(" DICOMLocal QUERY instances SEARCH not implemented")}}},retrieve:{directURL:e=>{let{instance:t,tag:r,defaultType:n}=e,a=t[r];if(a instanceof Array&&a[0]instanceof ArrayBuffer)return URL.createObjectURL(new Blob([a[0]],{type:n}))},series:{metadata:async({StudyInstanceUID:e,madeInClient:t=!1}={})=>{if(!e)throw Error("Unable to query for SeriesMetadata without StudyInstanceUID");let r=K.DicomMetadataStore.getStudy(e,t);K.DicomMetadataStore._broadcastEvent(eQ.SERIES_ADDED,{StudyInstanceUID:e,madeInClient:t}),r.series.forEach(r=>{let{SeriesInstanceUID:n}=r,a=r.instances[0].NumberOfFrames>1;r.instances.forEach((e,t)=>{let{url:r,StudyInstanceUID:n,SeriesInstanceUID:i,SOPInstanceUID:o}=e;ek(e,"imageId",r),eC(e),eZ.addImageIdToUIDs(r,{StudyInstanceUID:n,SeriesInstanceUID:i,SOPInstanceUID:o,frameNumber:a?t+1:1})}),K.DicomMetadataStore._broadcastEvent(eQ.INSTANCES_ADDED,{StudyInstanceUID:e,SeriesInstanceUID:n,madeInClient:t})})}}},store:{dicom:e=>{let t=eE(e);var r=URL.createObjectURL(t);window.location.assign(r)}},getImageIdsForDisplaySet(e){let t=e.images,r=[];return t&&e.images.forEach(e=>{let t=e.NumberOfFrames;if(t>1)for(let n=1;n<=t;n++){let t=this.getImageIdsForInstance({instance:e,frame:n});r.push(t)}else{let t=this.getImageIdsForInstance({instance:e});r.push(t)}}),r},getImageIdsForInstance({instance:e,frame:t}){let{StudyInstanceUID:r,SeriesInstanceUID:n}=e,a=e.SOPInstanceUID||e.SopInstanceUID,i=K.DicomMetadataStore.getInstance(r,n,a),o=i?.url||e.url;return o?(Number(i?.NumberOfFrames||e.NumberOfFrames)||1)>1?eJ(o,void 0!==t?t:1):o:void 0},deleteStudyMetadataPromise(){console.log("deleteStudyMetadataPromise not implemented")},getStudyInstanceUIDs:({params:e,query:t})=>{let{StudyInstanceUIDs:r}=e,n=t.getAll("StudyInstanceUIDs")||r,a=n&&Array.isArray(n)?n:[n],i=!1;return a.forEach(e=>{let t=K.DicomMetadataStore.getStudy(e);t&&(t.series=t.series.sort(e2),i=!0)}),i?a:[]}})}function e4(e,t){let r,{name:n}=e,{userAuthenticationService:a}=t.services;return K.IWebApiDataSource.create({initialize:async({params:i,query:o})=>{let s=o.get("url");if(s){let n=eW(s,{allowedOrigins:e.dangerouslyAllowedOriginsForAuthenticatedEnvironments,userAuthenticationService:a}),l=await e$(n);if(!l.servers?.dicomWeb?.[0])throw Error("Invalid configuration returned by url");(r=ez(l.servers.dicomWeb[0].configuration||l.servers.dicomWeb[0],t)).initialize({params:i,query:o})}else throw Error(`No url for '${n}'`)},query:{studies:{search:e=>r.query.studies.search(e)},series:{search:(...e)=>r.query.series.search(...e)},instances:{search:(e,t)=>r.query.instances.search(e,t)}},retrieve:{getGetThumbnailSrc:(...e)=>r.retrieve.getGetThumbnailSrc(...e),directURL:(...e)=>r.retrieve.directURL(...e),renderedURL:(...e)=>r.retrieve.renderedURL(...e),series:{metadata:async(...e)=>r.retrieve.series.metadata(...e)}},store:{dicom:(...e)=>r.store.dicom(...e)},reject:{series:(...e)=>r?.reject?.series?.(...e)},deleteStudyMetadataPromise:(...e)=>r?.deleteStudyMetadataPromise?.(...e),getImageIdsForDisplaySet:(...e)=>r?.getImageIdsForDisplaySet?.(...e),getImageIdsForInstance:(...e)=>r?.getImageIdsForInstance?.(...e),getConfig:(...e)=>r?.getConfig?.(...e)??{dicomUploadEnabled:!1},getStudyInstanceUIDs({params:e,query:t}){let r=t.get("studyInstanceUIDs")||t.get("studyInstanceUids");if(!r)throw Error(`No studyInstanceUids in request for '${n}'`);return r.split(";")}})}var e5=I(3008),e8=I.n(e5),e6=I(3424),e9=I.n(e6);let e7={"query.studies.search":{mergeKey:"studyInstanceUid",tagFunc:e=>e},"query.series.search":{mergeKey:"seriesInstanceUid",tagFunc:(e,t)=>(e.forEach(e=>{e.RetrieveAETitle=t,K.DicomMetadataStore.updateSeriesMetadata(e)}),e)}},te=async({mergeMap:e,path:t,args:r,extensionManager:n,dataSourceNames:a,defaultDataSourceName:i})=>{let{mergeKey:o,tagFunc:s}=e[t]||{tagFunc:e=>e},l=Object.values(n.dataSourceDefs),u=l.find(e=>e.sourceName===i),c=l.filter(e=>e.sourceName!==i);u&&c.unshift(u);let d=[],f=[];for(let e of c){let{configuration:i,sourceName:o}=e;if(i&&a.includes(o)){let[e]=n.getDataSources(o),a=e8()(e,t).apply(e,r);d.push(a),f.push(o)}}let p=(await Promise.allSettled(d)).map((e,t)=>s(e.value,f[t]));return o?e9()(p.flat(),e=>e8()(e,o)):p.flat()},tt=({path:e,args:t,extensionManager:r,dataSourceNames:n,defaultDataSourceName:a})=>{let i=Object.values(r.dataSourceDefs),o=i.find(e=>e.sourceName===a),s=i.filter(e=>e.sourceName!==a);o&&s.unshift(o);let l=[];for(let a of s){let{configuration:i,sourceName:o}=a;if(i&&n.includes(o)){let[n]=r.getDataSources(o),a=e8()(n,e).apply(n,t);l.push(a)}}return l.flat()},tr=({path:e,args:t,defaultDataSourceName:r,extensionManager:n})=>{let[a]=n.getDataSources(r);return e8()(a,e).apply(a,t)},tn=({path:e,args:t,defaultDataSourceName:r,extensionManager:n})=>{let[a]=t,i=K.DicomMetadataStore.getSeries(a.StudyInstanceUID,a.SeriesInstanceUID),[o]=n.getDataSources(i.RetrieveAETitle||r);return o[e](...t)};function ta(e,t,r){let{seriesMerge:n}=e,{dataSourceNames:a,defaultDataSourceName:i}=n;return K.IWebApiDataSource.create({initialize:(...e)=>tt({path:"initialize",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i}),query:{studies:{search:(...e)=>te({mergeMap:e7,path:"query.studies.search",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})},series:{search:(...e)=>te({mergeMap:e7,path:"query.series.search",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})},instances:{search:(...e)=>te({mergeMap:e7,path:"query.instances.search",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})}},retrieve:{getGetThumbnailSrc:(...e)=>tr({path:"retrieve.getGetThumbnailSrc",args:e,defaultDataSourceName:i,extensionManager:r}),bulkDataURI:(...e)=>te({mergeMap:e7,path:"retrieve.bulkDataURI",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i}),directURL:(...e)=>tr({path:"retrieve.directURL",args:e,defaultDataSourceName:i,extensionManager:r}),renderedURL:(...e)=>{let[t]=r.getDataSources(i),n=e8()(t,"retrieve.renderedURL");if(n)return n.apply(t,e);let a=e8()(t,"retrieve.directURL");return a?Promise.resolve(a.apply(t,[e[0]])).then(e=>({url:e||null})):Promise.resolve({url:null})},series:{metadata:(...e)=>te({mergeMap:e7,path:"retrieve.series.metadata",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})}},store:{dicom:(...e)=>tr({path:"store.dicom",args:e,defaultDataSourceName:i,extensionManager:r})},deleteStudyMetadataPromise:(...e)=>tt({path:"deleteStudyMetadataPromise",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i}),getImageIdsForDisplaySet:(...e)=>tn({path:"getImageIdsForDisplaySet",args:e,defaultDataSourceName:i,extensionManager:r}),getImageIdsForInstance:(...e)=>tn({path:"getImageIdsForDisplaySet",args:e,defaultDataSourceName:i,extensionManager:r}),getStudyInstanceUIDs:(...e)=>tt({path:"getStudyInstanceUIDs",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})})}var ti=I(2184),to=I(6326),ts=I.t(to,2),tl=I(55),tu=I(6870);let tc=(0,to.createContext)(null),{Provider:td}=tc,tf=()=>(0,to.useContext)(tc);function tp(){return(tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function th(e,t){if(!1===e||null==e)throw Error(t)}function tg(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}(r=P||(P={})).Pop="POP",r.Push="PUSH",r.Replace="REPLACE",(n=A||(A={})).data="data",n.deferred="deferred",n.redirect="redirect",n.error="error";let tm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ty(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function tv(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field [")+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function tb(){return(tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}Symbol("deferred");let tx=to.createContext(null),tS=to.createContext(null),tw=to.createContext(null),t_=to.createContext({outlet:null,matches:[],isDataRoute:!1});function tI(){return null!=to.useContext(tw)}function tD(){return tI()||th(!1),to.useContext(tw).location}function tO(e){to.useContext(tS).static||to.useLayoutEffect(e)}function tk(){let{isDataRoute:e}=to.useContext(t_);return e?function(){let e,t,r,n,{router:a}=(tC.UseNavigateStable,(e=to.useContext(tx))||th(!1),e),i=(tj.UseNavigateStable,(n=((t=to.useContext(t_))||th(!1),r=t).matches[r.matches.length-1]).route.id||th(!1),n.route.id),o=to.useRef(!1);return tO(()=>{o.current=!0}),to.useCallback(function(e,t){void 0===t&&(t={}),o.current&&("number"==typeof e?a.navigate(e):a.navigate(e,tb({fromRouteId:i},t)))},[a,i])}():function(){var e,t;let r;tI()||th(!1);let n=to.useContext(tx),{basename:a,future:i,navigator:o}=to.useContext(tS),{matches:s}=to.useContext(t_),{pathname:l}=tD(),u=JSON.stringify((e=s,t=i.v7_relativeSplatPath,r=e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0),t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase))),c=to.useRef(!1);return tO(()=>{c.current=!0}),to.useCallback(function(e,t){if(void 0===t&&(t={}),!c.current)return;if("number"==typeof e)return void o.go(e);let r=function(e,t,r,n){let a,i;void 0===n&&(n=!1),"string"==typeof e?a=tg(e):(th(!(a=tp({},e)).pathname||!a.pathname.includes("?"),tv("?","pathname","search",a)),th(!a.pathname||!a.pathname.includes("#"),tv("#","pathname","hash",a)),th(!a.search||!a.search.includes("#"),tv("#","search","hash",a)));let o=""===e||""===a.pathname,s=o?"/":a.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t){let r,n,a;void 0===t&&(t="/");let{pathname:i,search:o="",hash:s=""}="string"==typeof e?tg(e):e;if(i){let e;if(e=i,tm.test(e))r=i;else{if(i.includes("//")){var l="Pathnames cannot have embedded double slashes - normalizing "+i+" -> "+(i=i.replace(/\/\/+/g,"/"));"u">typeof console&&console.warn(l);try{throw Error(l)}catch(e){}}r=i.startsWith("/")?ty(i.substring(1),"/"):ty(i,t)}}else r=t;return{pathname:r,search:(n=o)&&"?"!==n?n.startsWith("?")?n:"?"+n:"",hash:(a=s)&&"#"!==a?a.startsWith("#")?a:"#"+a:""}}(a,i),u=s&&"/"!==s&&s.endsWith("/"),c=(o||"."===s)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}(e,JSON.parse(u),l,"path"===t.relative);null==n&&"/"!==a&&(r.pathname="/"===r.pathname?a:[a,r.pathname].join("/").replace(/\/\/+/g,"/")),(t.replace?o.replace:o.push)(r,t.state,t)},[a,o,u,l,n])}()}to.Component;var tC=((a=tC||{}).UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a),tj=((i=tj||{}).UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i);ts.startTransition;var tE=((o=tE||{})[o.pending=0]="pending",o[o.success=1]="success",o[o.error=2]="error",o);function tM(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function tR(e){return(tR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tP(e){var t=function(e,t){if("object"!=tR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=tR(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tR(t)?t:t+""}function tA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tP(n.key),n)}}function tN(e,t,r){return t&&tA(e.prototype,t),r&&tA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}new Promise(()=>{}),to.Component,I(9741),Object.create(null);var tT=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,tU={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},tL=function(e){return tU[e]},tF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(tT,tL)}},tB=(0,to.createContext)(),tV=function(){function e(){tM(this,e),this.usedNamespaces={}}return tN(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach(function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function tz(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tH(e,t,r){return(t=tP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tW(){if(console&&console.warn){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var t$={};function tY(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&t$[t[0]]||("string"==typeof t[0]&&(t$[t[0]]=new Date),tW.apply(void 0,t))}var tG=function(e,t){return function(){e.isInitialized?t():e.on("initialized",function r(){setTimeout(function(){e.off("initialized",r)},0),t()})}};function tq(e,t,r){e.loadNamespaces(t,tG(e,r))}function tX(e,t,r,n){"string"==typeof r&&(r=[r]),r.forEach(function(t){0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,tG(e,n))}function tK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tK(Object(r),!0).forEach(function(t){tH(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tK(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var tZ=function(e,t){var r=(0,to.useRef)();return(0,to.useEffect)(function(){r.current=t?r.current:e},[e,t]),r.current};function tQ(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.i18n,a=(0,to.useContext)(tB)||{},i=a.i18n,o=a.defaultNS,s=n||i||N;if(s&&!s.reportNamespaces&&(s.reportNamespaces=new tV),!s){tY("You will need to pass in an i18next instance by using initReactI18next");var l=function(e,t){return"string"==typeof t?t:t&&"object"===tR(t)&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},u=[l,{},!1];return u.t=l,u.i18n={},u.ready=!1,u}s.options.react&&void 0!==s.options.react.wait&&tY("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=tJ(tJ(tJ({},tF),s.options.react),r),d=c.useSuspense,f=c.keyPrefix,p=e||o||s.options&&s.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);var h=(s.isInitialized||s.initializedStoreOnce)&&p.every(function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0===t.options.ignoreJSONStructure?function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],a=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return -1===n||2===n};return(!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1)||!t.services.backendConnector.backend||!t.isLanguageChangingTo||!!o(t.isLanguageChangingTo,e))&&!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!a||o(i,e)))}(e,t,r):t.hasLoadedNamespace(e,{lng:r.lng,precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(tY("i18n.languages were undefined or empty",t.languages),!0)}(e,s,c)});function g(){return s.getFixedT(r.lng||null,"fallback"===c.nsMode?p:p[0],f)}var m=function(e){if(Array.isArray(e))return e}(t=(0,to.useState)(g))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,a,i,o=[],s=!0,l=!1;try{a=(t=t.call(e)).next,!1;for(;!(s=(r=a.call(t)).done)&&(o.push(r.value),2!==o.length);s=!0);}catch(e){l=!0,n=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return tz(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?tz(e,2):void 0}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=m[0],v=m[1],b=p.join();r.lng&&(b="".concat(r.lng).concat(b));var x=tZ(b),S=(0,to.useRef)(!0);(0,to.useEffect)(function(){var e=c.bindI18n,t=c.bindI18nStore;function n(){S.current&&v(g)}return S.current=!0,h||d||(r.lng?tX(s,r.lng,p,function(){S.current&&v(g)}):tq(s,p,function(){S.current&&v(g)})),h&&x&&x!==b&&S.current&&v(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){S.current=!1,e&&s&&e.split(" ").forEach(function(e){return s.off(e,n)}),t&&s&&t.split(" ").forEach(function(e){return s.store.off(e,n)})}},[s,b]);var w=(0,to.useRef)(!0);(0,to.useEffect)(function(){S.current&&!w.current&&v(g),w.current=!1},[s,f]);var _=[y,s,h];if(_.t=y,_.i18n=s,_.ready=h,h||!h&&!d)return _;throw new Promise(function(e){r.lng?tX(s,r.lng,p,function(){return e()}):tq(s,p,function(){return e()})})}function t0(e){let t,r,n,a=(0,ti.c)(14),{buttonSection:i,viewportId:o,location:s}=e,l=void 0===i?"primary":i;a[0]!==l?(t={buttonSection:l},a[0]=l,a[1]=t):t=a[1];let{toolbarButtons:u,onInteraction:c,isItemOpen:d,isItemLocked:f,openItem:p,closeItem:h,toggleLock:g}=(0,K.useToolbar)(t);return u.length?(a[2]!==h||a[3]!==f||a[4]!==d||a[5]!==s||a[6]!==c||a[7]!==p||a[8]!==g||a[9]!==u||a[10]!==o?(r=u?.map(e=>{if(!e)return null;let{id:t,Component:r,componentProps:n}=e,a={...n,isOpen:d(t,o),isLocked:f(t,o),onOpen:()=>p(t,o),onClose:()=>h(t,o),onToggleLock:()=>g(t,o),viewportId:o},i=(0,tu.jsx)(r,{id:t,location:s,onInteraction:e=>{c({...e,itemId:t,viewportId:o})},...a},t);return(0,tu.jsx)("div",{className:"contents",children:i},t)}),a[2]=h,a[3]=f,a[4]=d,a[5]=s,a[6]=c,a[7]=p,a[8]=g,a[9]=u,a[10]=o,a[11]=r):r=a[11],a[12]!==r?(n=(0,tu.jsx)(tu.Fragment,{children:r}),a[12]=r,a[13]=n):n=a[13],n):null}var t1=I(8500);function t2(e,t){return(0,tu.jsx)(e,{},t)}let t3=function(e){let t,r,n,a,i,o,s,l,u,c,d=(0,ti.c)(37),{appConfig:f}=e,{servicesManager:p,extensionManager:h}=(0,K.useSystem)(),{customizationService:g}=p.services,m=tk(),y=tD();d[0]!==g||d[1]!==h||d[2]!==y||d[3]!==m?(t=()=>{let{pathname:e}=y,t=e.indexOf("/",1),r=e.substring(t+1),n=h.getDataSources(r),a=new URLSearchParams;-1!==t&&n&&a.append("datasources",e.substring(t+1)),(0,t1.preserveQueryParameters)(a,g),m({pathname:"/",search:decodeURIComponent(a.toString())})},d[0]=g,d[1]=h,d[2]=y,d[3]=m,d[4]=t):t=d[4];let v=t,{t:b}=tQ(),{show:x}=(0,tl.useModal)();if(d[5]!==f.oidc||d[6]!==f.showStudyList||d[7]!==f.whiteLabeling||d[8]!==g||d[9]!==m||d[10]!==v||d[11]!==x||d[12]!==b){let e=g.getCustomization("ohif.aboutModal"),t=g.getCustomization("ohif.appearanceModal"),u=g.getCustomization("ohif.userPreferencesModal"),c=g.getCustomization("ohif.headerRightSide")?.items??[],p=[{title:e?.menuTitle??b("Header:About"),icon:"info",onClick:()=>x({content:e,title:e?.title??b("AboutModal:About OHIF Viewer"),containerClassName:e?.containerClassName??"max-w-md"})},{title:u.menuTitle??b("Header:Preferences"),icon:"settings",onClick:()=>x({content:u,title:u.title??b("UserPreferencesModal:User preferences"),containerClassName:u?.containerClassName??"flex max-w-4xl p-6 flex-col"})}];if(t&&p.splice(1,0,{title:t.menuTitle??b("Header:Appearance"),icon:"ColorChange",onClick:()=>x({content:t,title:t.title??b("AppearanceModal:Appearance"),containerClassName:t.containerClassName??"max-w-md"})}),f.oidc){let e,t,r;d[20]!==b?(e=b("Header:Logout"),d[20]=b,d[21]=e):e=d[21],d[22]!==m?(t=async()=>{m(`/logout?redirect_uri=${encodeURIComponent(window.location.href)}`)},d[22]=m,d[23]=t):t=d[23],d[24]!==e||d[25]!==t?(r={title:e,icon:"power-off",onClick:t},d[24]=e,d[25]=t,d[26]=r):r=d[26],p.push(r)}r=tl.Header,n=p,a=!!f.showStudyList,i=v,o=f.whiteLabeling,d[27]===Symbol.for("react.memo_cache_sentinel")?(s=(0,tu.jsx)(t0,{buttonSection:"secondary"}),d[27]=s):s=d[27],l=c.map(t2),d[5]=f.oidc,d[6]=f.showStudyList,d[7]=f.whiteLabeling,d[8]=g,d[9]=m,d[10]=v,d[11]=x,d[12]=b,d[13]=r,d[14]=n,d[15]=a,d[16]=i,d[17]=o,d[18]=s,d[19]=l}else r=d[13],n=d[14],a=d[15],i=d[16],o=d[17],s=d[18],l=d[19];return d[28]===Symbol.for("react.memo_cache_sentinel")?(u=(0,tu.jsx)("div",{className:"relative flex justify-center gap-[4px]",children:(0,tu.jsx)(t0,{buttonSection:"primary"})}),d[28]=u):u=d[28],d[29]!==r||d[30]!==n||d[31]!==a||d[32]!==i||d[33]!==o||d[34]!==s||d[35]!==l?(c=(0,tu.jsx)(r,{menuOptions:n,isReturnEnabled:a,onClickReturnButton:i,WhiteLabeling:o,Secondary:s,RightSide:l,children:u}),d[29]=r,d[30]=n,d[31]=a,d[32]=i,d[33]=o,d[34]=s,d[35]=l,d[36]=c):c=d[36],c},t4=e=>{let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w=(0,ti.c)(45);w[0]!==e?({servicesManager:o,side:s,activeTabIndex:t,isExpanded:r,tabs:l,onOpen:a,onClose:n,...i}=e,w[0]=e,w[1]=t,w[2]=r,w[3]=n,w[4]=a,w[5]=i,w[6]=o,w[7]=s,w[8]=l):(t=w[1],r=w[2],n=w[3],a=w[4],i=w[5],o=w[6],s=w[7],l=w[8]);let{panelService:_,toolbarService:I,viewportGridService:D}=o.services,[O,k]=(0,to.useState)(r),[C,j]=(0,to.useState)(t??0),[E,M]=(0,to.useState)(!1);w[9]!==_||w[10]!==s||w[11]!==l?(u=l??_.getPanels(s),w[9]=_,w[10]=s,w[11]=l,w[12]=u):u=w[12];let[R,P]=(0,to.useState)(u);w[13]!==I||w[14]!==D?(c=e=>{let{activeTabIndex:t}=e,{activeViewportId:r}=D.getState();I.refreshToolbarState({viewportId:r}),j(t)},w[13]=I,w[14]=D,w[15]=c):c=w[15];let A=c;w[16]!==a?(d=()=>{k(!0),a?.()},w[16]=a,w[17]=d):d=w[17];let N=d;w[18]!==n?(f=()=>{k(!1),M(!0),n?.()},w[18]=n,w[19]=f):f=w[19];let T=f;return w[20]!==r?(p=()=>{k(r)},h=[r],w[20]=r,w[21]=p,w[22]=h):(p=w[21],h=w[22]),(0,to.useEffect)(p,h),w[23]!==t?(g=()=>{j(t??0)},m=[t],w[23]=t,w[24]=g,w[25]=m):(g=w[24],m=w[25]),(0,to.useEffect)(g,m),w[26]!==_||w[27]!==s?(v=()=>{let{unsubscribe:e}=_.subscribe(_.EVENTS.PANELS_CHANGED,e=>{e.position===s&&P(_.getPanels(s))});return()=>{e()}},y=[_,s],w[26]=_,w[27]=s,w[28]=y,w[29]=v):(y=w[28],v=w[29]),(0,to.useEffect)(v,y),w[30]!==E||w[31]!==_||w[32]!==O||w[33]!==R?(b=()=>{let e=_.subscribe(_.EVENTS.ACTIVATE_PANEL,e=>{if(O||e.forceActive){let t=R.findIndex(t=>t.id===e.panelId);-1!==t&&(E||k(!0),j(t))}});return()=>{e.unsubscribe()}},x=[R,O,_,E],w[30]=E,w[31]=_,w[32]=O,w[33]=R,w[34]=b,w[35]=x):(b=w[34],x=w[35]),(0,to.useEffect)(b,x),w[36]!==C||w[37]!==A||w[38]!==T||w[39]!==N||w[40]!==i||w[41]!==s||w[42]!==O||w[43]!==R?(S=(0,tu.jsx)(tl.SidePanel,{...i,side:s,tabs:R,activeTabIndex:C,isExpanded:O,onOpen:N,onClose:T,onActiveTabIndexChange:A}),w[36]=C,w[37]=A,w[38]=T,w[39]=N,w[40]=i,w[41]=s,w[42]=O,w[43]=R,w[44]=S):S=w[44],S},t5=(0,to.createContext)(null);t5.displayName="PanelGroupContext";let t8="data-panel-group-id",t6="data-panel-resize-handle-id",t9=to.useLayoutEffect,t7=ts["useId".toString()],re="function"==typeof t7?t7:()=>null,rt=0;function rr(e=null){let t=re(),r=(0,to.useRef)(e||t||null);return null===r.current&&(r.current=""+rt++),null!=e?e:r.current}function rn({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:i,id:o,maxSize:s,minSize:l,onCollapse:u,onExpand:c,onResize:d,order:f,style:p,tagName:h="div",...g}){let m=(0,to.useContext)(t5);if(null===m)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:y,expandPanel:v,getPanelSize:b,getPanelStyle:x,groupId:S,isPanelCollapsed:w,reevaluatePanelConstraints:_,registerPanel:I,resizePanel:D,unregisterPanel:O}=m,k=rr(o),C=(0,to.useRef)({callbacks:{onCollapse:u,onExpand:c,onResize:d},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:s,minSize:l},id:k,idIsFromProps:void 0!==o,order:f});(0,to.useRef)({didLogMissingDefaultSizeWarning:!1}),t9(()=>{let{callbacks:e,constraints:t}=C.current,i={...t};C.current.id=k,C.current.idIsFromProps=void 0!==o,C.current.order=f,e.onCollapse=u,e.onExpand=c,e.onResize=d,t.collapsedSize=r,t.collapsible=n,t.defaultSize=a,t.maxSize=s,t.minSize=l,(i.collapsedSize!==t.collapsedSize||i.collapsible!==t.collapsible||i.maxSize!==t.maxSize||i.minSize!==t.minSize)&&_(C.current,i)}),t9(()=>{let e=C.current;return I(e),()=>{O(e)}},[f,k,I,O]),(0,to.useImperativeHandle)(i,()=>({collapse:()=>{y(C.current)},expand:e=>{v(C.current,e)},getId:()=>k,getSize:()=>b(C.current),isCollapsed:()=>w(C.current),isExpanded:()=>!w(C.current),resize:e=>{D(C.current,e)}}),[y,v,b,w,k,D]);let j=x(C.current,a);return(0,to.createElement)(h,{...g,children:e,className:t,id:k,style:{...j,...p},[t8]:S,"data-panel":"","data-panel-collapsible":n||void 0,"data-panel-id":k,"data-panel-size":parseFloat(""+j.flexGrow).toFixed(1)})}let ra=(0,to.forwardRef)((e,t)=>(0,to.createElement)(rn,{...e,forwardedRef:t}));rn.displayName="Panel",ra.displayName="forwardRef(Panel)";function ri(e){return"keydown"===e.type}function ro(e){return e.type.startsWith("pointer")}function rs(e){return e.type.startsWith("mouse")}function rl(e){if(ro(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(rs(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let ru=1,rc=2,rd=4,rf=8,rp="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),rh=new Map,rg=new Map,rm=new Set;new AbortController;function ry(e,t){if(!e)throw console.error(t),Error(t)}function rv(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function rb(e,t,r=10){return 0===rv(e,t,r)}function rx(e,t,r){return 0===rv(e,t,r)}function rS({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];ry(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,maxSize:o=100,minSize:s=0}=n;return 0>rv(r,s)&&(r=i&&0>rv(r,(a+s)/2)?a:s),r=parseFloat((r=Math.min(o,r)).toFixed(10))}function rw({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(rx(e,0))return t;let o=[...t],[s,l]=n;ry(null!=s,"Invalid first pivot index"),ry(null!=l,"Invalid second pivot index");let u=0;if("keyboard"===i){{let n=e<0?l:s,a=r[n];ry(a,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:u=0}=a;if(o){let r=t[n];if(ry(null!=r,`Previous layout not found for panel index ${n}`),rx(r,i)){let t=u-r;rv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,a=r[n];ry(a,`No panel constraints found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:u=0}=a;if(o){let r=t[n];if(ry(null!=r,`Previous layout not found for panel index ${n}`),rx(r,u)){let t=r-i;rv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?l:s,i=0;for(;;){let e=t[a];if(ry(null!=e,`Previous layout not found for panel index ${a}`),i+=rS({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let o=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-o:o}{let n=e<0?s:l;for(;n>=0&&n<r.length;){let a=Math.abs(e)-Math.abs(u),i=t[n];ry(null!=i,`Previous layout not found for panel index ${n}`);let s=rS({panelConstraints:r,panelIndex:n,size:i-a});if(!rx(i,s)&&(u+=i-s,o[n]=s,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?n--:n++}}if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!rx(e[r],t[r],void 0))return!1;return!0}(a,o))return a;{let n=e<0?l:s,a=t[n];ry(null!=a,`Previous layout not found for panel index ${n}`);let i=a+u,c=rS({panelConstraints:r,panelIndex:n,size:i});if(o[n]=c,!rx(c,i)){let t=i-c,n=e<0?l:s;for(;n>=0&&n<r.length;){let a=o[n];ry(null!=a,`Previous layout not found for panel index ${n}`);let i=rS({panelConstraints:r,panelIndex:n,size:a+t});if(rx(a,i)||(t-=i-a,o[n]=i),rx(t,0))break;e>0?n--:n++}}}return rx(o.reduce((e,t)=>t+e,0),100)?o:a}function r_(e,t=document){return Array.from(t.querySelectorAll(`[${t6}][data-panel-group-id="${e}"]`))}function rI(e,t,r){let n=function(e,t,r=document){let n=r_(e,r).findIndex(e=>e.getAttribute(t6)===t);return null!=n?n:null}(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function rD(e,t=document){var r;if(t instanceof HTMLElement&&(null==t||null==(r=t.dataset)?void 0:r.panelGroupId)==e)return t;let n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function rO(e,t=document){let r=t.querySelector(`[${t6}="${e}"]`);return r||null}function rk(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function rC(e,t){let{x:r,y:n}=rl(t);return"horizontal"===e?r:n}function rj(e,t,r){t.forEach((t,n)=>{let a=e[n];ry(a,`Panel data not found for index ${n}`);let{callbacks:i,constraints:o,id:s}=a,{collapsedSize:l=0,collapsible:u}=o,c=r[s];if(null==c||t!==c){r[s]=t;let{onCollapse:e,onExpand:n,onResize:a}=i;a&&a(t,c),u&&(e||n)&&(n&&(null==c||rb(c,l))&&!rb(t,l)&&n(),e&&(null==c||!rb(c,l))&&rb(t,l)&&e())}})}function rE(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function rM(e){try{if("u">typeof localStorage)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function rR(e){return`react-resizable-panels:${e}`}function rP(e){return e.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function rA(e,t){try{let r=rR(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}function rN(e,t,r,n,a){var i;let o=rR(e),s=rP(t),l=null!=(i=rA(e,a))?i:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(o,JSON.stringify(l))}catch(e){console.error(e)}}function rT({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!rx(n,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];ry(null!=t,`No layout data found for index ${e}`);let a=100/n*t;r[e]=a}let a=0;for(let e=0;e<t.length;e++){let n=r[e];ry(null!=n,`No layout data found for index ${e}`);let i=rS({panelConstraints:t,panelIndex:e,size:n});n!=i&&(a+=n-i,r[e]=i)}if(!rx(a,0))for(let e=0;e<t.length;e++){let n=r[e];ry(null!=n,`No layout data found for index ${e}`);let i=rS({panelConstraints:t,panelIndex:e,size:n+a});if(n!==i&&(a-=i-n,r[e]=i,rx(a,0)))break}return r}let rU={getItem:e=>(rM(rU),rU.getItem(e)),setItem:(e,t)=>{rM(rU),rU.setItem(e,t)}},rL={};function rF({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:i=null,onLayout:o=null,keyboardResizeBy:s=null,storage:l=rU,style:u,tagName:c="div",...d}){let f=rr(i),p=(0,to.useRef)(null),[h,g]=(0,to.useState)(null),[m,y]=(0,to.useState)([]),v=function(){let[e,t]=(0,to.useState)(0);return(0,to.useCallback)(()=>t(e=>e+1),[])}(),b=(0,to.useRef)({}),x=(0,to.useRef)(new Map),S=(0,to.useRef)(0),w=(0,to.useRef)({autoSaveId:e,direction:n,dragState:h,id:f,keyboardResizeBy:s,onLayout:o,storage:l}),_=(0,to.useRef)({layout:m,panelDataArray:[],panelDataArrayChanged:!1});(0,to.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,to.useImperativeHandle)(a,()=>({getId:()=>w.current.id,getLayout:()=>{let{layout:e}=_.current;return e},setLayout:e=>{let{onLayout:t}=w.current,{layout:r,panelDataArray:n}=_.current,a=rT({layout:e,panelConstraints:n.map(e=>e.constraints)});rk(r,a)||(y(a),_.current.layout=a,t&&t(a),rj(n,a,b.current))}}),[]),t9(()=>{w.current.autoSaveId=e,w.current.direction=n,w.current.dragState=h,w.current.id=f,w.current.onLayout=o,w.current.storage=l}),function({committedValuesRef:e,eagerValuesRef:t,groupId:r,layout:n,panelDataArray:a,panelGroupElement:i,setLayout:o}){(0,to.useRef)({didWarnAboutMissingResizeHandle:!1}),t9(()=>{if(!i)return;let e=r_(r,i);for(let t=0;t<a.length-1;t++){let{valueMax:r,valueMin:i,valueNow:o}=function({layout:e,panelsArray:t,pivotIndices:r}){let n=0,a=100,i=0,o=0,s=r[0];return ry(null!=s,"No pivot index found"),t.forEach((e,t)=>{let{constraints:r}=e,{maxSize:l=100,minSize:u=0}=r;t===s?(n=u,a=l):(i+=u,o+=l)}),{valueMax:Math.min(a,100-i),valueMin:Math.max(n,100-o),valueNow:e[s]}}({layout:n,panelsArray:a,pivotIndices:[t,t+1]}),s=e[t];if(null==s);else{let e=a[t];ry(e,`No panel data found for index "${t}"`),s.setAttribute("aria-controls",e.id),s.setAttribute("aria-valuemax",""+Math.round(r)),s.setAttribute("aria-valuemin",""+Math.round(i)),s.setAttribute("aria-valuenow",null!=o?""+Math.round(o):"")}}return()=>{e.forEach((e,t)=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-valuemax"),e.removeAttribute("aria-valuemin"),e.removeAttribute("aria-valuenow")})}},[r,n,a,i]),(0,to.useEffect)(()=>{if(!i)return;let e=t.current;ry(e,"Eager values not found");let{panelDataArray:a}=e;ry(null!=rD(r,i),`No group found for id "${r}"`);let s=r_(r,i);ry(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute(t6);ry(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var a,i,o,s;let l=rO(t,n),u=r_(e,n),c=l?u.indexOf(l):-1;return[null!=(a=null==(i=r[c])?void 0:i.id)?a:null,null!=(o=null==(s=r[c+1])?void 0:s.id)?o:null]}(r,t,a,i);if(null==s||null==l)return()=>{};let u=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=a.findIndex(e=>e.id===s);if(l>=0){let e=a[l];ry(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:u=0,collapsible:c,minSize:d=0}=e.constraints;if(null!=s&&c){let e=rw({delta:rx(s,u)?d-u:u-s,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:rI(r,t,i),prevLayout:n,trigger:"keyboard"});n!==e&&o(e)}}}};return e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}});return()=>{l.forEach(e=>e())}},[i,e,t,r,n,a,o])}({committedValuesRef:w,eagerValuesRef:_,groupId:f,layout:m,panelDataArray:_.current.panelDataArray,setLayout:y,panelGroupElement:p.current}),(0,to.useEffect)(()=>{let{panelDataArray:t}=_.current;if(e){if(0===m.length||m.length!==t.length)return;let r=rL[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(rN,100),rL[e]=r),r(e,[...t],new Map(x.current),m,l)}},[e,m,l]),(0,to.useEffect)(()=>{});let I=(0,to.useCallback)(e=>{let{onLayout:t}=w.current,{layout:r,panelDataArray:n}=_.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:i=0,panelSize:o,pivotIndices:s}=rz(n,e,r);if(ry(null!=o,`Panel size not found for panel "${e.id}"`),!rb(o,i)){x.current.set(e.id,o);let l=rw({delta:rV(n,e)===n.length-1?o-i:i-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});rE(r,l)||(y(l),_.current.layout=l,t&&t(l),rj(n,l,b.current))}}},[]),D=(0,to.useCallback)((e,t)=>{let{onLayout:r}=w.current,{layout:n,panelDataArray:a}=_.current;if(e.constraints.collapsible){let i=a.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:l=0,pivotIndices:u}=rz(a,e,n),c=null!=t?t:l;if(rb(s,o)){let t=x.current.get(e.id),o=null!=t&&t>=c?t:c,l=rw({delta:rV(a,e)===a.length-1?s-o:o-s,initialLayout:n,panelConstraints:i,pivotIndices:u,prevLayout:n,trigger:"imperative-api"});rE(n,l)||(y(l),_.current.layout=l,r&&r(l),rj(a,l,b.current))}}},[]),O=(0,to.useCallback)(e=>{let{layout:t,panelDataArray:r}=_.current,{panelSize:n}=rz(r,e,t);return ry(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),k=(0,to.useCallback)((e,t)=>{let{panelDataArray:r}=_.current,n=rV(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:i=3}){let o=r[a];return{flexBasis:0,flexGrow:null==o?void 0!=e?e.toPrecision(i):"1":1===n.length?"1":o.toPrecision(i),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:h,layout:m,panelData:r,panelIndex:n})},[h,m]),C=(0,to.useCallback)(e=>{let{layout:t,panelDataArray:r}=_.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=rz(r,e,t);return ry(null!=i,`Panel size not found for panel "${e.id}"`),!0===a&&rb(i,n)},[]),j=(0,to.useCallback)(e=>{let{layout:t,panelDataArray:r}=_.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=rz(r,e,t);return ry(null!=i,`Panel size not found for panel "${e.id}"`),!a||rv(i,n)>0},[]),E=(0,to.useCallback)(e=>{let{panelDataArray:t}=_.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),_.current.panelDataArrayChanged=!0,v()},[v]);t9(()=>{if(_.current.panelDataArrayChanged){_.current.panelDataArrayChanged=!1;let{autoSaveId:r,onLayout:n,storage:a}=w.current,{layout:i,panelDataArray:o}=_.current,s=null;if(r){var e,t;let n=null!=(t=(null!=(e=rA(r,a))?e:{})[rP(o)])?t:null;n&&(x.current=new Map(Object.entries(n.expandToSizes)),s=n.layout)}null==s&&(s=function({panelDataArray:e}){let t=Array(e.length),r=e.map(e=>e.constraints),n=0,a=100;for(let i=0;i<e.length;i++){let e=r[i];ry(e,`Panel constraints not found for index ${i}`);let{defaultSize:o}=e;null!=o&&(n++,t[i]=o,a-=o)}for(let i=0;i<e.length;i++){let o=r[i];ry(o,`Panel constraints not found for index ${i}`);let{defaultSize:s}=o;if(null!=s)continue;let l=a/(e.length-n);n++,t[i]=l,a-=l}return t}({panelDataArray:o}));let l=rT({layout:s,panelConstraints:o.map(e=>e.constraints)});rk(i,l)||(y(l),_.current.layout=l,n&&n(l),rj(o,l,b.current))}}),t9(()=>{let e=_.current;return()=>{e.layout=[]}},[]);let M=(0,to.useCallback)(e=>{let t=!1,r=p.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let i=p.current;if(!i)return()=>null;let{direction:o,dragState:s,id:l,keyboardResizeBy:u,onLayout:c}=w.current,{layout:d,panelDataArray:f}=_.current,{initialLayout:h}=null!=s?s:{},g=rI(l,e,i),m=function(e,t,r,n,a,i){if(ri(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let i=0;switch(e.key){case"ArrowDown":i=t?0:n;break;case"ArrowLeft":i=t?-n:0;break;case"ArrowRight":i=t?n:0;break;case"ArrowUp":i=t?0:-n;break;case"End":i=100;break;case"Home":i=-100}return i}return null==n?0:function(e,t,r,n,a){let i="horizontal"===r,o=rO(t,a);ry(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(t8);ry(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,u=rC(r,e),c=rD(s,a);ry(c,`No group element found for id "${s}"`);let d=c.getBoundingClientRect();return(u-l)/(i?d.width:d.height)*100}(e,t,r,n,i)}(r,e,o,s,u,i),v="horizontal"===o;v&&t&&(m=-m);let x=rw({delta:m,initialLayout:null!=h?h:d,panelConstraints:f.map(e=>e.constraints),pivotIndices:g,prevLayout:d,trigger:ri(r)?"keyboard":"mouse-or-touch"}),I=!rE(d,x);(ro(r)||rs(r))&&S.current!=m&&((S.current=m,I||0===m)?rg.set(e,0):v?(n=m<0?ru:rc,rg.set(e,n)):(a=m<0?rd:rf,rg.set(e,a))),I&&(y(x),_.current.layout=x,c&&c(x),rj(f,x,b.current))}},[]),R=(0,to.useCallback)((e,t)=>{let{onLayout:r}=w.current,{layout:n,panelDataArray:a}=_.current,i=a.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=rz(a,e,n);ry(null!=o,`Panel size not found for panel "${e.id}"`);let l=rw({delta:rV(a,e)===a.length-1?o-t:t-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});rE(n,l)||(y(l),_.current.layout=l,r&&r(l),rj(a,l,b.current))},[]),P=(0,to.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=_.current,{collapsedSize:a=0,collapsible:i}=t,{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:u=0}=e.constraints,{panelSize:c}=rz(n,e,r);null!=c&&(i&&s&&rb(c,a)?rb(a,o)||R(e,o):c<u?R(e,u):c>l&&R(e,l))},[R]),A=(0,to.useCallback)((e,t)=>{let{direction:r}=w.current,{layout:n}=_.current;if(!p.current)return;let a=rO(e,p.current);ry(a,`Drag handle element not found for id "${e}"`);let i=rC(r,t);g({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:i,initialLayout:n})},[]),N=(0,to.useCallback)(()=>{g(null)},[]),T=(0,to.useCallback)(e=>{let{panelDataArray:t}=_.current,r=rV(t,e);r>=0&&(t.splice(r,1),delete b.current[e.id],_.current.panelDataArrayChanged=!0,v())},[v]),U=(0,to.useMemo)(()=>({collapsePanel:I,direction:n,dragState:h,expandPanel:D,getPanelSize:O,getPanelStyle:k,groupId:f,isPanelCollapsed:C,isPanelExpanded:j,reevaluatePanelConstraints:P,registerPanel:E,registerResizeHandle:M,resizePanel:R,startDragging:A,stopDragging:N,unregisterPanel:T,panelGroupElement:p.current}),[I,h,n,D,O,k,f,C,j,P,E,M,R,A,N,T]);return(0,to.createElement)(t5.Provider,{value:U},(0,to.createElement)(c,{...d,children:t,className:r,id:i,ref:p,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...u},"data-panel-group":"","data-panel-group-direction":n,[t8]:f}))}let rB=(0,to.forwardRef)((e,t)=>(0,to.createElement)(rF,{...e,forwardedRef:t}));function rV(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function rz(e,t,r){let n=rV(e,t),a=n===e.length-1,i=r[n];return{...t.constraints,panelSize:i,pivotIndices:a?[n-1,n]:[n,n+1]}}function rH(e,t=document){let r=t.querySelector(`[data-panel-id="${e}"]`);return r||null}rF.displayName="PanelGroup",rB.displayName="forwardRef(PanelGroup)";let rW=(e,t)=>{e&&(e.style.minWidth=void 0===t?"":`${t}px`,e.style.maxWidth=e.style.minWidth)},r$="mt-[1px] bg-background";function rY(){return document.body.classList.add("bg-background"),document.body.classList.add("overflow-hidden"),rG}function rG(){document.body.classList.remove("bg-background"),document.body.classList.remove("overflow-hidden")}function rq(){document.activeElement?.blur()}let rX=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I=(0,ti.c)(71),{extensionManager:D,servicesManager:O,hotkeysManager:k,commandsManager:C,viewports:j,ViewportGridComp:E,leftPanelClosed:M,rightPanelClosed:R,leftPanelResizable:P,rightPanelResizable:A,leftPanelInitialExpandedWidth:N,rightPanelInitialExpandedWidth:T,leftPanelMinimumExpandedWidth:U,rightPanelMinimumExpandedWidth:L}=e,F=void 0!==M&&M,B=void 0!==R&&R,V=void 0!==P&&P,z=void 0!==A&&A,[H]=tf(),{panelService:W,hangingProtocolService:$,customizationService:Y}=O.services,[G,q]=(0,to.useState)(H.showLoadingIndicator);I[0]!==W?(t=e=>!!W.getPanels(e).length,I[0]=W,I[1]=t):t=I[1];let X=t,[J,Z]=(0,to.useState)(X("right")),[Q,ee]=(0,to.useState)(X("left")),[et,er]=(0,to.useState)(F),[en,ea]=(0,to.useState)(B),[ei,eo,es,el,eu,ec,ed]=((e,t,r,n,a,i,o,s,l,u)=>{let c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k,C,j,E,M,R,P,A,N=(0,ti.c)(96);N[0]!==o||N[1]!==l||N[2]!==s||N[3]!==u?(c=(({leftPanelInitialExpandedWidth:e=282,rightPanelInitialExpandedWidth:t=280,leftPanelMinimumExpandedWidth:r=145,rightPanelMinimumExpandedWidth:n=280})=>({groupId:"viewerLayoutResizablePanelGroup",shared:{expandedInsideBorderSize:0,collapsedInsideBorderSize:4,collapsedOutsideBorderSize:4,collapsedWidth:25},left:{panelId:"viewerLayoutResizableLeftPanel",initialExpandedWidth:e,minimumExpandedOffsetWidth:r+0,initialExpandedOffsetWidth:e+0,collapsedOffsetWidth:33},right:{panelId:"viewerLayoutResizableRightPanel",initialExpandedWidth:t,minimumExpandedOffsetWidth:n+0,initialExpandedOffsetWidth:t+0,collapsedOffsetWidth:33}}))({leftPanelInitialExpandedWidth:o,rightPanelInitialExpandedWidth:s,leftPanelMinimumExpandedWidth:l,rightPanelMinimumExpandedWidth:u}),N[0]=o,N[1]=l,N[2]=s,N[3]=u,N[4]=c):c=N[4];let[T]=(0,to.useState)(c),[U,L]=(0,to.useState)(T.left.initialExpandedWidth),[F,B]=(0,to.useState)(T.right.initialExpandedWidth),[V,z]=(0,to.useState)(0),[H,W]=(0,to.useState)(0),[$,Y]=(0,to.useState)(0),[G,q]=(0,to.useState)(0),X=(0,to.useRef)(null),K=(0,to.useRef)(null),J=(0,to.useRef)(null),Z=(0,to.useRef)(null),Q=(0,to.useRef)(null),ee=(0,to.useRef)(!1),et=(0,to.useRef)(null);N[5]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{let{width:t}=X.current?.getBoundingClientRect();return e/(t-et.current)*100},N[5]=d):d=N[5];let er=d;N[6]!==T.shared.expandedInsideBorderSize?(f=e=>{let{width:t}=X.current?.getBoundingClientRect();return e/100*(t-et.current)-T.shared.expandedInsideBorderSize},N[6]=T.shared.expandedInsideBorderSize,N[7]=f):f=N[7];let en=f;N[8]!==e||N[9]!==T.groupId||N[10]!==T.left.initialExpandedOffsetWidth||N[11]!==T.left.panelId||N[12]!==T.right.initialExpandedOffsetWidth||N[13]!==T.right.panelId||N[14]!==r?(p=()=>{X.current=rD(T.groupId);let t=rH(T.left.panelId);K.current=t;let n=rH(T.right.panelId);J.current=n;let a=document.querySelectorAll("[data-panel-resize-handle-id]");if(et.current=0,a.forEach(e=>{et.current=et.current+e.offsetWidth}),!e){let e=er(T.left.initialExpandedOffsetWidth);Z?.current?.expand(e),rW(t,T.left.initialExpandedOffsetWidth)}if(!r){let e=er(T.right.initialExpandedOffsetWidth);Q?.current?.expand(e),rW(n,T.right.initialExpandedOffsetWidth)}},N[8]=e,N[9]=T.groupId,N[10]=T.left.initialExpandedOffsetWidth,N[11]=T.left.panelId,N[12]=T.right.initialExpandedOffsetWidth,N[13]=T.right.panelId,N[14]=r,N[15]=p):p=N[15],N[16]===Symbol.for("react.memo_cache_sentinel")?(h=[],N[16]=h):h=N[16],(0,to.useLayoutEffect)(p,h),N[17]!==U||N[18]!==T.left.collapsedOffsetWidth||N[19]!==T.left.minimumExpandedOffsetWidth||N[20]!==T.right.collapsedOffsetWidth||N[21]!==T.right.minimumExpandedOffsetWidth||N[22]!==T.shared.expandedInsideBorderSize||N[23]!==F?(g=()=>{if(!Z.current?.isCollapsed()){let e=er(U+T.shared.expandedInsideBorderSize);Z.current?.resize(e)}if(!Q?.current?.isCollapsed()){let e=er(F+T.shared.expandedInsideBorderSize);Q?.current?.resize(e)}let e=new ResizeObserver(()=>{let e=er(T.left.minimumExpandedOffsetWidth),t=er(T.right.minimumExpandedOffsetWidth);z(e),W(t),Y(er(T.left.collapsedOffsetWidth)),q(er(T.right.collapsedOffsetWidth))});return e.observe(X.current),()=>{e.disconnect()}},N[17]=U,N[18]=T.left.collapsedOffsetWidth,N[19]=T.left.minimumExpandedOffsetWidth,N[20]=T.right.collapsedOffsetWidth,N[21]=T.right.minimumExpandedOffsetWidth,N[22]=T.shared.expandedInsideBorderSize,N[23]=F,N[24]=g):g=N[24],N[25]!==a||N[26]!==i||N[27]!==U||N[28]!==V||N[29]!==F||N[30]!==H?(m=[U,F,V,H,a,i],N[25]=a,N[26]=i,N[27]=U,N[28]=V,N[29]=F,N[30]=H,N[31]=m):m=N[31],(0,to.useLayoutEffect)(g,m),N[32]!==U||N[33]!==T.shared.expandedInsideBorderSize||N[34]!==F?(y=e=>{e?(ee.current=!0,rW(K.current),rW(J.current)):(ee.current=!1,Z?.current?.isExpanded()&&rW(K.current,U+T.shared.expandedInsideBorderSize),Q?.current?.isExpanded()&&rW(J.current,F+T.shared.expandedInsideBorderSize))},N[32]=U,N[33]=T.shared.expandedInsideBorderSize,N[34]=F,N[35]=y):y=N[35];let ea=y;N[36]!==t?(v=()=>{t(!0),rW(K.current),Z?.current?.collapse()},N[36]=t,N[37]=v):v=N[37];let ei=v;N[38]!==T.left.initialExpandedOffsetWidth||N[39]!==t?(b=()=>{Z?.current?.expand(er(T.left.initialExpandedOffsetWidth)),t(!1)},N[38]=T.left.initialExpandedOffsetWidth,N[39]=t,N[40]=b):b=N[40];let eo=b;N[41]!==en?(x=e=>{if(!X?.current||Z.current?.isCollapsed())return;let t=en(e);L(t),ee.current||rW(K.current,t)},N[41]=en,N[42]=x):x=N[42];let es=x;N[43]!==n?(S=()=>{n(!0),rW(J.current),Q?.current?.collapse()},N[43]=n,N[44]=S):S=N[44];let el=S;N[45]!==T.right.initialExpandedOffsetWidth||N[46]!==n?(w=()=>{Q?.current?.expand(er(T.right.initialExpandedOffsetWidth)),n(!1)},N[45]=T.right.initialExpandedOffsetWidth,N[46]=n,N[47]=w):w=N[47];let eu=w;N[48]!==en?(_=e=>{if(!X?.current||Q?.current?.isCollapsed())return;let t=en(e);B(t),ee.current||rW(J.current,t)},N[48]=en,N[49]=_):_=N[49];let ec=_;return N[50]!==U||N[51]!==ei||N[52]!==eo||N[53]!==T.shared.collapsedInsideBorderSize||N[54]!==T.shared.collapsedOutsideBorderSize||N[55]!==T.shared.collapsedWidth||N[56]!==T.shared.expandedInsideBorderSize?(I={expandedWidth:U,collapsedWidth:T.shared.collapsedWidth,collapsedInsideBorderSize:T.shared.collapsedInsideBorderSize,collapsedOutsideBorderSize:T.shared.collapsedOutsideBorderSize,expandedInsideBorderSize:T.shared.expandedInsideBorderSize,onClose:ei,onOpen:eo},N[50]=U,N[51]=ei,N[52]=eo,N[53]=T.shared.collapsedInsideBorderSize,N[54]=T.shared.collapsedOutsideBorderSize,N[55]=T.shared.collapsedWidth,N[56]=T.shared.expandedInsideBorderSize,N[57]=I):I=N[57],N[58]!==el||N[59]!==eu||N[60]!==T.shared.collapsedInsideBorderSize||N[61]!==T.shared.collapsedOutsideBorderSize||N[62]!==T.shared.collapsedWidth||N[63]!==T.shared.expandedInsideBorderSize||N[64]!==F?(D={expandedWidth:F,collapsedWidth:T.shared.collapsedWidth,collapsedInsideBorderSize:T.shared.collapsedInsideBorderSize,collapsedOutsideBorderSize:T.shared.collapsedOutsideBorderSize,expandedInsideBorderSize:T.shared.expandedInsideBorderSize,onClose:el,onOpen:eu},N[58]=el,N[59]=eu,N[60]=T.shared.collapsedInsideBorderSize,N[61]=T.shared.collapsedOutsideBorderSize,N[62]=T.shared.collapsedWidth,N[63]=T.shared.expandedInsideBorderSize,N[64]=F,N[65]=D):D=N[65],N[66]!==T.groupId?(O={direction:"horizontal",id:T.groupId},N[66]=T.groupId,N[67]=O):O=N[67],N[68]!==t?(k=()=>t(!0),C=()=>t(!1),N[68]=t,N[69]=k,N[70]=C):(k=N[69],C=N[70]),N[71]!==$||N[72]!==V||N[73]!==es||N[74]!==T.left.panelId||N[75]!==k||N[76]!==C?(j={defaultSize:V,minSize:V,onResize:es,collapsible:!0,collapsedSize:$,onCollapse:k,onExpand:C,ref:Z,order:0,id:T.left.panelId},N[71]=$,N[72]=V,N[73]=es,N[74]=T.left.panelId,N[75]=k,N[76]=C,N[77]=j):j=N[77],N[78]===Symbol.for("react.memo_cache_sentinel")?(E={order:1,id:"viewerLayoutResizableViewportGridPanel"},N[78]=E):E=N[78],N[79]!==n?(M=()=>n(!0),R=()=>n(!1),N[79]=n,N[80]=M,N[81]=R):(M=N[80],R=N[81]),N[82]!==ec||N[83]!==T.right.panelId||N[84]!==H||N[85]!==G||N[86]!==M||N[87]!==R?(P={defaultSize:H,minSize:H,onResize:ec,collapsible:!0,collapsedSize:G,onCollapse:M,onExpand:R,ref:Q,order:2,id:T.right.panelId},N[82]=ec,N[83]=T.right.panelId,N[84]=H,N[85]=G,N[86]=M,N[87]=R,N[88]=P):P=N[88],N[89]!==ea||N[90]!==I||N[91]!==D||N[92]!==O||N[93]!==j||N[94]!==P?(A=[I,D,O,j,E,P,ea],N[89]=ea,N[90]=I,N[91]=D,N[92]=O,N[93]=j,N[94]=P,N[95]=A):A=N[95],A})(F,er,B,ea,Q,J,N,T,U,L);I[2]!==Y?(r=Y.getCustomization("ui.loadingIndicatorProgress"),I[2]=Y,I[3]=r):r=I[3];let ef=r;I[4]===Symbol.for("react.memo_cache_sentinel")?(n=[],I[4]=n):n=I[4],(0,to.useEffect)(rY,n),I[5]!==D?(a=e=>{let t=D.getModuleEntry(e);if(!t||!t.component)throw Error(`${e} is not valid for an extension module or no component found from extension ${e}. Please verify your configuration or ensure that the extension is properly registered. It's also possible that your mode is utilizing a module from an extension that hasn't been included in its dependencies (add the extension to the "extensionDependencies" array in your mode's index.js file). Check the reference string to the extension in your Mode configuration`);return{entry:t}},I[5]=D,I[6]=a):a=I[6];let ep=a;I[7]!==$?(o=()=>{let{unsubscribe:e}=$.subscribe(K.HangingProtocolService.EVENTS.PROTOCOL_CHANGED,()=>{q(!1)});return()=>{e()}},i=[$],I[7]=$,I[8]=i,I[9]=o):(i=I[8],o=I[9]),(0,to.useEffect)(o,i),I[10]!==ep?(s=e=>{let{entry:t}=ep(e.namespace);return{component:t.component,isReferenceViewable:t.isReferenceViewable,displaySetsToDisplay:e.displaySetsToDisplay}},I[10]=ep,I[11]=s):s=I[11];let eh=s;I[12]!==X||I[13]!==W?(l=()=>{let{unsubscribe:e}=W.subscribe(W.EVENTS.PANELS_CHANGED,e=>{let{options:t}=e;ee(X("left")),Z(X("right")),t?.leftPanelClosed!==void 0&&er(t.leftPanelClosed),t?.rightPanelClosed!==void 0&&ea(t.rightPanelClosed)});return()=>{e()}},u=[W,X],I[12]=X,I[13]=W,I[14]=l,I[15]=u):(l=I[14],u=I[15]),(0,to.useEffect)(l,u),I[16]!==eh||I[17]!==j?(c=j.map(eh),I[16]=eh,I[17]=j,I[18]=c):c=I[18];let eg=c;I[19]!==H||I[20]!==D||I[21]!==k||I[22]!==O?(d=(0,tu.jsx)(t3,{hotkeysManager:k,extensionManager:D,servicesManager:O,appConfig:H}),I[19]=H,I[20]=D,I[21]=k,I[22]=O,I[23]=d):d=I[23],I[24]===Symbol.for("react.memo_cache_sentinel")?(f={height:"calc(100vh - 52px)"},I[24]=f):f=I[24],I[25]!==ef||I[26]!==G?(p=G&&(0,tu.jsx)(ef,{className:"h-full w-full bg-background"}),I[25]=ef,I[26]=G,I[27]=p):p=I[27],I[28]!==Q||I[29]!==et||I[30]!==ei||I[31]!==V||I[32]!==ed||I[33]!==el||I[34]!==O?(h=Q?(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.ResizablePanel,{...el,children:(0,tu.jsx)(t4,{side:"left",isExpanded:!et,servicesManager:O,...ei})}),(0,tu.jsx)(tl.ResizableHandle,{onDragging:ed,disabled:!V,className:r$})]}):null,I[28]=Q,I[29]=et,I[30]=ei,I[31]=V,I[32]=ed,I[33]=el,I[34]=O,I[35]=h):h=I[35],I[36]!==E||I[37]!==C||I[38]!==O||I[39]!==eg?(g=(0,tu.jsx)("div",{className:"flex h-full flex-1 flex-col",children:(0,tu.jsx)("div",{className:"relative flex h-full flex-1 items-center justify-center overflow-hidden bg-background",onMouseEnter:rq,children:(0,tu.jsx)(E,{servicesManager:O,viewportComponents:eg,commandsManager:C})})}),I[36]=E,I[37]=C,I[38]=O,I[39]=eg,I[40]=g):g=I[40],I[41]!==eu||I[42]!==g?(m=(0,tu.jsx)(tl.ResizablePanel,{...eu,children:g}),I[41]=eu,I[42]=g,I[43]=m):m=I[43],I[44]!==J||I[45]!==ed||I[46]!==ec||I[47]!==en||I[48]!==eo||I[49]!==z||I[50]!==O?(y=J?(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.ResizableHandle,{onDragging:ed,disabled:!z,className:r$}),(0,tu.jsx)(tl.ResizablePanel,{...ec,children:(0,tu.jsx)(t4,{side:"right",isExpanded:!en,servicesManager:O,...eo})})]}):null,I[44]=J,I[45]=ed,I[46]=ec,I[47]=en,I[48]=eo,I[49]=z,I[50]=O,I[51]=y):y=I[51],I[52]!==es||I[53]!==h||I[54]!==m||I[55]!==y?(v=(0,tu.jsxs)(tl.ResizablePanelGroup,{...es,children:[h,m,y]}),I[52]=es,I[53]=h,I[54]=m,I[55]=y,I[56]=v):v=I[56],I[57]!==p||I[58]!==v?(b=(0,tu.jsx)("div",{className:"relative flex w-full flex-row flex-nowrap items-stretch overflow-hidden bg-background",style:f,children:(0,tu.jsxs)(to.Fragment,{children:[p,v]})}),I[57]=p,I[58]=v,I[59]=b):b=I[59],I[60]!==Y?(x=Y.getCustomization("ohif.tours"),I[60]=Y,I[61]=x):x=I[61],I[62]!==x?(S=(0,tu.jsx)(tl.Onboarding,{tours:x}),I[62]=x,I[63]=S):S=I[63];let em=H?.investigationalUseDialog;return I[64]!==em?(w=(0,tu.jsx)(tl.InvestigationalUseDialog,{dialogConfiguration:em}),I[64]=em,I[65]=w):w=I[65],I[66]!==d||I[67]!==b||I[68]!==S||I[69]!==w?(_=(0,tu.jsxs)("div",{children:[d,b,S,w]}),I[66]=d,I[67]=b,I[68]=S,I[69]=w,I[70]=_):_=I[70],_};function rK(e){let t,r,n,a,i,o,s,l=(0,ti.c)(21),{viewPresets:u,updateViewPresetValue:c,actionIcons:d,updateActionIconValue:f}=e;if(l[0]!==d||l[1]!==f){let e;l[3]!==f?(e=(e,t)=>to.createElement(tl.Icons[e.iconName]||tl.Icons.MissingIcon,{key:t,onClick:()=>f(e),className:"cursor-pointer"}),l[3]=f,l[4]=e):e=l[4],t=d.map(e),l[0]=d,l[1]=f,l[2]=t}else t=l[2];l[5]!==t?(r=(0,tu.jsx)("div",{className:"flex items-center justify-center",children:(0,tu.jsx)("div",{className:"text-primary flex items-center space-x-1",children:t})}),l[5]=t,l[6]=r):r=l[6],l[7]!==u?(n=u.filter(rZ),l[7]=u,l[8]=n):n=l[8];let p=n[0].id;return l[9]!==c||l[10]!==u?(a=e=>{c(u.find(t=>t.id===e))},l[9]=c,l[10]=u,l[11]=a):a=l[11],l[12]!==u?(i=u.map(rJ),l[12]=u,l[13]=i):i=l[13],l[14]!==n[0].id||l[15]!==a||l[16]!==i?(o=(0,tu.jsx)("div",{className:"ml-auto flex h-full items-center justify-center",children:(0,tu.jsx)(tl.ToggleGroup,{type:"single",value:p,onValueChange:a,children:i})}),l[14]=n[0].id,l[15]=a,l[16]=i,l[17]=o):o=l[17],l[18]!==r||l[19]!==o?(s=(0,tu.jsx)(tu.Fragment,{children:(0,tu.jsx)("div",{className:"bg-muted flex h-[40px] select-none rounded-t p-2",children:(0,tu.jsx)("div",{className:"flex h-[24px] w-full select-none justify-center self-center text-[14px]",children:(0,tu.jsxs)("div",{className:"flex w-full items-center gap-[10px]",children:[r,o]})})})}),l[18]=r,l[19]=o,l[20]=s):s=l[20],s}function rJ(e,t){return(0,tu.jsx)(tl.ToggleGroupItem,{"aria-label":e.id,value:e.id,className:"text-primary",children:to.createElement(tl.Icons[e.iconName]||tl.Icons.MissingIcon)},t)}function rZ(e){return e.selected}let rQ=[{id:"settings",iconName:"Settings",value:!1}],r0=({commandsManager:e,items:t,...r})=>{let{servicesManager:n}=(0,K.useSystem)(),{customizationService:a}=n.services,i=a.getCustomization("ohif.menuContent")??(t=>{let a,i,o,s,l,u=(0,ti.c)(12),{item:c}=t;return u[0]!==c?(a=()=>c.onClick({commandsManager:e,servicesManager:n,...r}),u[0]=c,u[1]=a):a=u[1],u[2]!==c.iconName?(i=c.iconName&&(0,tu.jsx)(tl.Icons.ByName,{name:c.iconName}),u[2]=c.iconName,u[3]=i):i=u[3],u[4]!==c.label?(o=(0,tu.jsx)("span",{children:c.label}),u[4]=c.label,u[5]=o):o=u[5],u[6]!==i||u[7]!==o?(s=(0,tu.jsxs)("div",{className:"flex items-center gap-2",children:[i,o]}),u[6]=i,u[7]=o,u[8]=s):s=u[8],u[9]!==a||u[10]!==s?(l=(0,tu.jsx)(tl.DropdownMenuItem,{onClick:a,children:s}),u[9]=a,u[10]=s,u[11]=l):l=u[11],l});return(0,tu.jsx)(tl.DropdownMenuContent,{hideWhenDetached:!0,align:"start",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:t?.map((t,a)=>(0,tu.jsx)(i,{item:t,commandsManager:e,servicesManager:n,...r},t.id||`menu-item-${a}`))})};function r1(e){let t,r,n=(0,ti.c)(8),{menuItemsKey:a,getMenuItems:i,commandsManager:o}=e,s=void 0===i?r0:i,{servicesManager:l}=(0,K.useSystem)(),{customizationService:u}=l.services;n[0]!==u||n[1]!==a?(t=u.getCustomization(a),n[0]=u,n[1]=a,n[2]=t):t=n[2];let c=t;return c?.length?(n[3]!==o||n[4]!==s||n[5]!==c||n[6]!==l?(r=function(e){return(0,tu.jsxs)(tl.DropdownMenu,{children:[(0,tu.jsx)(tl.DropdownMenuTrigger,{asChild:!0,children:(0,tu.jsx)(tl.Button,{variant:"ghost",size:"icon",className:"hidden group-hover:inline-flex data-[state=open]:inline-flex",onClick:r2,children:(0,tu.jsx)(tl.Icons.More,{})})}),s({...e,commandsManager:o,servicesManager:l,items:c})]})},n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=r):r=n[7],r):null}function r2(e){e.preventDefault(),e.stopPropagation()}var r3=I(1357);let{formatValue:r4}=K.utils,r5=new Set,{sortStudyInstances:r8,formatDate:r6,formatTime:r9,createStudyBrowserTabs:r7}=K.utils,ne=function({getImageSrc:e,getStudiesForPatientByMRN:t,requestDisplaySetCreationForStudy:r,dataSource:n,customMapDisplaySets:a,onClickUntrack:i,onDoubleClickThumbnailHandlerCallBack:o}){let{servicesManager:s,commandsManager:l,extensionManager:u}=(0,K.useSystem)(),{displaySetService:c,customizationService:d}=s.services,f=tk(),p=d.getCustomization("studyBrowser.studyMode")||"all",h=(0,tl.useImageViewer)().StudyInstanceUIDs,g=(0,to.useRef)(new Set),[{activeViewportId:m,viewports:y,isHangingProtocolLayout:v}]=(0,tl.useViewportGrid)(),[b,x]=(0,to.useState)(p),[S,w]=(0,to.useState)("primary"===p&&h.length>0?[h[0]]:[...h]),[_,I]=(0,to.useState)(!1),[D,O]=(0,to.useState)([]),[k,C]=(0,to.useState)([]),[j,E]=(0,to.useState)({}),[M,R]=(0,to.useState)({}),[P,A]=(0,to.useState)(null),[N,T]=(0,to.useState)(d.getCustomization("studyBrowser.viewPresets")),[U,L]=(0,to.useState)(rQ),F=a||nt,B=(0,to.useCallback)((e,...t)=>{let r=F(e,...t),n=d.getCustomization("studyBrowser.thumbnailDetails"),a=d.getCustomization("studyBrowser.thumbnailDetailSources"),i=d.getCustomization("studyBrowser.thumbnailDetailTests");return r.map(e=>{let t=c.getDisplaySetByUID(e.displaySetInstanceUID);return t?{...e,details:function({items:e,displaySet:t,sources:r,tests:n,formatters:a}){if(!Array.isArray(e))return;let i={displaySet:t,instance:t?.instance,formatters:a},o=[],s=!1,l=(e,t,r,n)=>{if("string"!=typeof e)return e;let a=t?.[e];if(!a){let t=`${n}|${r}|${e}`;r5.has(t)||(r5.add(t),console.warn(`Thumbnail detail item "${n}" names an unknown ${r} "${e}"`)),s=!0}return a};for(let t of e){let e;if(!t)continue;let{id:a,condition:s,contentF:u,source:c,attribute:d,iconName:f}=t;if(void 0!==s){let e=l(s,n,"condition",a);if("function"!=typeof e||!e(i))continue}if("function"==typeof u)e=u(i);else if(void 0!==c){let t=l(c,r,"source",a);e="function"==typeof t?t(i):void 0}else d&&(e=i.instance?.[d]);let p=r4(e);if(!p)continue;let h="function"==typeof f?f(i):f;o.push({id:a,label:t.label??"",title:t.title??"",value:p,iconName:h||void 0})}if(o.length||!s)return o}({items:n,displaySet:t,sources:a,tests:i,formatters:{formatDate:r6,formatTime:r9}})}:e})},[F,d,c]),V=(0,to.useCallback)(async e=>{let t=d.getCustomization("studyBrowser.thumbnailDoubleClickCallback"),r={activeViewportId:m,commandsManager:l,servicesManager:s,isHangingProtocolLayout:v,appConfig:u.appConfig};for(let n of t?.callbacks.map(e=>e(r)))await n(e);o?.(e)},[m,l,s,v,d,u.appConfig,o]);(0,to.useEffect)(()=>{async function e(e){if(g.current.has(e))return;g.current.add(e);let r=await n.query.studies.search({studyInstanceUid:e}),a=r;try{a=await t(r)}catch(e){console.warn(e)}let i=a.map(e=>({AccessionNumber:e.accession,StudyDate:e.date,StudyDescription:e.description,NumInstances:e.instances,ModalitiesInStudy:e.modalities,PatientID:e.mrn,PatientName:e.patientName,StudyInstanceUID:e.studyInstanceUid,StudyTime:e.time})).map(e=>({studyInstanceUid:e.StudyInstanceUID,date:r6(e.StudyDate)||"",description:e.StudyDescription,modalities:e.ModalitiesInStudy,numInstances:Number(e.NumInstances)}));O(e=>{let t=[...e];for(let r of i)e.find(e=>e.studyInstanceUid===r.studyInstanceUid)||t.push(r);return t})}h.forEach(t=>e(t))},[h,n,t,f]),(0,to.useEffect)(()=>{if(!_){if(m){let e=250+10*c.getActiveDisplaySets().length;window.setTimeout(()=>I(!0),e)}return}let t=c.activeDisplaySets;(t=t.filter(e=>!r3.thumbnailNoImageModalities.includes(e.Modality)||null===e.thumbnailSrc)).length&&t.forEach(async t=>{let r={},a=c.getDisplaySetByUID(t.displaySetInstanceUID),i=nr(a,n.getImageIdsForDisplaySet(t));if(a?.unsupported)return;let{thumbnailSrc:o}=a;!o&&a.getThumbnailSrc&&(o=await a.getThumbnailSrc({getImageSrc:e})),!o&&i&&(a.thumbnailSrc=await e(i)),r[t.displaySetInstanceUID]=o,R(e=>({...e,...r}))})},[c,n,e,m,_]),(0,to.useEffect)(()=>{let e=c.activeDisplaySets;if(!e.length)return;let t=B(e,j,M,y);a||r8(t),C(t)},[c.activeDisplaySets,j,y,M,a,B]),(0,to.useEffect)(()=>{let t=c.subscribe(c.EVENTS.DISPLAY_SETS_ADDED,t=>{if(!_)return;let{displaySetsAdded:r,options:a}=t;r.forEach(async t=>{let r=t.displaySetInstanceUID,i={},o=c.getDisplaySetByUID(r);if(o?.unsupported)return;a?.madeInClient&&A(r);let s=n.getImageIdsForDisplaySet(o),l=nr(o,s);if(!l)return;let{thumbnailSrc:u}=o;!u&&o.getThumbnailSrc&&(u=await o.getThumbnailSrc({getImageSrc:e})),u||(o.thumbnailSrc=u=await e(l)),i[r]=u,R(e=>({...e,...i}))})});return()=>{t.unsubscribe()}},[c,n,e,_]),(0,to.useEffect)(()=>{let e=c.subscribe(c.EVENTS.DISPLAY_SETS_CHANGED,e=>{let t=B(e,j,M,y);a||r8(t),C(t)}),t=c.subscribe(c.EVENTS.DISPLAY_SET_SERIES_METADATA_INVALIDATED,()=>{let e=B(c.getActiveDisplaySets(),j,M,y);a||r8(e),C(e)});return()=>{e.unsubscribe(),t.unsubscribe()}},[j,M,y,c,a,B]);let z=r7(h,D,k);(0,to.useEffect)(()=>{if(P){let e=document.getElementById(`thumbnail-${P}`);e&&"function"==typeof e.scrollIntoView&&(e.scrollIntoView({behavior:"smooth"}),A(null))}},[P,S,b]),(0,to.useEffect)(()=>{if(!P)return;let e=function(e,t,r){let n=[t.find(e=>e.name===r)||t[0],...t];for(let t=0;t<n.length;t++){let r=n[t].studies.find(t=>t.displaySets.find(t=>t.displaySetInstanceUID===e));if(r)return{tabName:n[t].name,StudyInstanceUID:r.studyInstanceUid}}}(P,z,b);if(!e)return;let{tabName:t,StudyInstanceUID:r}=e;x(t),S.includes(r)||w([...S,r])},[S,P,z]);let H=y.get(m)?.displaySetInstanceUIDs;return(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(rK,{viewPresets:N,updateViewPresetValue:e=>{e&&T(N.map(t=>(t.selected=t.id===e.id,t)))},actionIcons:U,updateActionIconValue:e=>{e.value=!e.value,L([...U])}}),(0,tu.jsx)(tl.Separator,{orientation:"horizontal",className:"bg-background",thickness:"2px"})]}),(0,tu.jsx)(tl.StudyBrowser,{tabs:z,servicesManager:s,activeTabName:b,expandedStudyInstanceUIDs:S,onClickStudy:function(e){let t=S.includes(e);w(t?[...S.filter(t=>t!==e)]:[...S,e]),t||r(c,e,!0)},onClickTab:e=>{x(e)},onClickUntrack:i,onClickThumbnail:()=>{},onDoubleClickThumbnail:V,activeDisplaySetInstanceUIDs:H,showSettings:U.find(e=>"settings"===e.id)?.value,viewPresets:N,ThumbnailMenuItems:r1({commandsManager:l,servicesManager:s,menuItemsKey:"studyBrowser.thumbnailMenuItems"}),StudyMenuItems:r1({commandsManager:l,servicesManager:s,menuItemsKey:"studyBrowser.studyMenuItems"})})]})};function nt(e,t,r,n){let a=[],i=[];return e.filter(e=>!e.excludeFromThumbnailBrowser).forEach(e=>{var n;let{thumbnailSrc:o,displaySetInstanceUID:s}=e,l=(n=e,r3.thumbnailNoImageModalities.includes(n.Modality)||n?.unsupported||null===n.thumbnailSrc?"thumbnailNoImage":"thumbnail"),u="thumbnail"===l?a:i,c=t?.[s];u.push({displaySetInstanceUID:s,description:e.SeriesDescription||"",seriesNumber:e.SeriesNumber,modality:e.Modality,seriesDate:r6(e.SeriesDate),numInstances:e.numImageFrames??e.instances?.length,loadingProgress:c,countIcon:e.countIcon,messages:e.messages,StudyInstanceUID:e.StudyInstanceUID,componentType:l,imageSrc:o||r[s],dragData:{type:"displayset",displaySetInstanceUID:s},isHydratedForDerivedDisplaySet:e.isHydrated})}),[...a,...i]}function nr(e,t){let r;if(e.isDynamicVolume){let t=e.dynamicVolumeInfo.timePoints,n=Math.floor(t.length/2),a=t[n];r=a[Math.floor(a.length/2)]}else r=t[Math.floor(t.length/2)];return r}let nn=function(e,t){return new Promise((r,n)=>{let a=document.createElement("canvas");e.utilities.loadImageToCanvas({canvas:a,imageId:t,thumbnail:!0}).then(e=>{r(a.toDataURL())}).catch(n)})},na=async function(e,t){if(!t?.length)return[];let r=t[0].mrn;return r?e.query.studies.search({patientId:r,disableWildcard:!0}):t},ni=function(e,t,r,n){if(!t.activeDisplaySets.some(e=>e.StudyInstanceUID===r))return e.retrieve.series.metadata({StudyInstanceUID:r,madeInClient:n})},no=function(){let e,t,r,n,a,i=(0,ti.c)(10),{extensionManager:o}=(0,K.useSystem)();i[0]!==o?([r]=o.getActiveDataSource(),t=na.bind(null,r),e=function(e){let t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common");try{let{cornerstone:e}=t.exports.getCornerstoneLibraries();return nn.bind(null,e)}catch(e){throw Error("Required command not found")}}(o),n=ni.bind(null,r),i[0]=o,i[1]=e,i[2]=t,i[3]=r,i[4]=n):(e=i[1],t=i[2],r=i[3],n=i[4]);let s=n;return i[5]!==e||i[6]!==t||i[7]!==s||i[8]!==r?(a=(0,tu.jsx)(ne,{dataSource:r,getImageSrc:e,getStudiesForPatientByMRN:t,requestDisplaySetCreationForStudy:s}),i[5]=e,i[6]=t,i[7]=s,i[8]=r,i[9]=a):a=i[9],a};function ns({title:e="Save Measurements",modality:t="SR",minSeriesNumber:r=0,predecessorImageId:n,itemName:a="",defaultSeriesDescription:i="",itemType:o,rememberedDescriptionCount:s=5,extensionManager:l,servicesManager:u,enableDownload:c=!1}){let{uiDialogService:d,customizationService:f}=u.services,p=l.getDataSourcesForUI(),h=f.getCustomization("ohif.createReportDialog"),g=window.config.allowMultiSelectExport;return r||="SR"===t&&3e3||"SEG"===t&&3100||"RTSTRUCT"===t&&3200||4e3,new Promise(function(l){d.show({id:"report-dialog",title:e,containerClassName:"max-w-lg",content:h,contentProps:{dataSources:g?p:void 0,predecessorImageId:n,minSeriesNumber:r,itemName:a,defaultSeriesDescription:i,itemType:o,rememberedDescriptionCount:s,modality:t,enableDownload:c,onSave:async({reportName:e,dataSource:t,series:r,seriesNumber:n,priorSeriesNumber:a})=>{l({value:e,dataSourceName:t,series:r,seriesNumber:n,priorSeriesNumber:a,action:1})},onCancel:()=>{l({action:0,value:void 0,series:void 0,dataSourceName:void 0})},defaultValue:e}})})}function nl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.forEach(function(t){tH(e,t,r[t])})}return e}function nu(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nc(e,t){if(t&&("object"==tR(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return nu(e)}function nd(e){return(nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nf(e,t){return(nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function np(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nf(e,t)}var nh={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},ng=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tM(this,e),this.init(t,r)}return tN(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||nh,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,nl({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),nm=function(){function e(){tM(this,e),this.observers={}}return tN(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach(function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)}),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e]=this.observers[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(r))})}}]),e}();function ny(){var e,t,r=new Promise(function(r,n){e=r,t=n});return r.resolve=e,r.reject=t,r}function nv(e){return null==e?"":""+e}function nb(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function a(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(a())return{};var o=n(i.shift());!e[o]&&r&&(e[o]=new r),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return a()?{}:{obj:e,k:n(i.shift())}}function nx(e,t,r){var n=nb(e,t,Object);n.obj[n.k]=r}function nS(e,t){var r=nb(e,t),n=r.obj,a=r.k;if(n)return n[a]}function nw(e,t,r){var n=nS(e,r);return void 0!==n?n:nS(t,r)}function n_(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var nI={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function nD(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return nI[e]}):e}var nO="u">typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,nk=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return tM(this,t),r=nc(this,nd(t).call(this)),nO&&nm.call(nu(r)),r.data=e||{},r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r}return np(t,e),tN(t,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,i=[e,t];return r&&"string"!=typeof r&&(i=i.concat(r)),r&&"string"==typeof r&&(i=i.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(i=e.split(".")),nS(this.data,i)}},{key:"addResource",value:function(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var o=[e,t];r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),nx(this.data,o,n),a.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var a in r)("string"==typeof r[a]||"[object Array]"===Object.prototype.toString.apply(r[a]))&&this.addResource(e,t,a,r[a],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),n=r,r=t,t=o[1]),this.addNamespaces(t);var s=nS(this.data,o)||{};n?function e(t,r,n){for(var a in r)"__proto__"!==a&&"constructor"!==a&&(a in t?"string"==typeof t[a]||t[a]instanceof String||"string"==typeof r[a]||r[a]instanceof String?n&&(t[a]=r[a]):e(t[a],r[a],n):t[a]=r[a]);return t}(s,r,a):s=nl({},s,r),nx(this.data,o,s),i.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?nl({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(nm),nC={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,a){var i=this;return e.forEach(function(e){i.processors[e]&&(t=i.processors[e].process(t,r,n,a))}),t}},nj={},nE=function(e){function t(e){var r,n,a,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return tM(this,t),a=nc(this,nd(t).call(this)),nO&&nm.call(nu(a)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n=nu(a),r.forEach(function(t){e[t]&&(n[t]=e[t])}),a.options=i,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=ng.create("translator"),a}return np(t,e),tN(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=t.ns||this.options.defaultNS;if(r&&e.indexOf(r)>-1){var i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:a};var o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(a=o.shift()),e=o.join(n)}return"string"==typeof a&&(a=[a]),{key:e,namespaces:a}}},{key:"translate",value:function(e,r,n){var a=this;if("object"!==tR(r)&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],r),s=o.key,l=o.namespaces,u=l[l.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase())return d?u+(r.nsSeparator||this.options.nsSeparator)+s:s;var f=this.resolve(e,r),p=f&&f.res,h=f&&f.usedKey||s,g=f&&f.exactUsedKey||s,m=Object.prototype.toString.apply(p),y=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b="string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p;if(v&&p&&b&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(m)&&("string"!=typeof y||"[object Array]"!==m)){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,r):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var x="[object Array]"===m,S=x?[]:{},w=x?g:h;for(var _ in p)if(Object.prototype.hasOwnProperty.call(p,_)){var I="".concat(w).concat(i).concat(_);S[_]=this.translate(I,nl({},r,{joinArrays:!1,ns:l})),S[_]===I&&(S[_]=p[_])}p=S}}else if(v&&"string"==typeof y&&"[object Array]"===m)(p=p.join(y))&&(p=this.extendTranslation(p,e,r,n));else{var D=!1,O=!1,k=void 0!==r.count&&"string"!=typeof r.count,C=t.hasDefaultValue(r),j=k?this.pluralResolver.getSuffix(c,r.count):"",E=r["defaultValue".concat(j)]||r.defaultValue;!this.isValidLookup(p)&&C&&(D=!0,p=E),this.isValidLookup(p)||(O=!0,p=s);var M=C&&E!==p&&this.options.updateMissing;if(O||D||M){if(this.logger.log(M?"updateKey":"missingKey",c,u,s,M?E:p),i){var R=this.resolve(s,nl({},r,{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var P=[],A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&A&&A[0])for(var N=0;N<A.length;N++)P.push(A[N]);else"all"===this.options.saveMissingTo?P=this.languageUtils.toResolveHierarchy(r.lng||this.language):P.push(r.lng||this.language);var T=function(e,t,n){a.options.missingKeyHandler?a.options.missingKeyHandler(e,u,t,M?n:p,M,r):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(e,u,t,M?n:p,M,r),a.emit("missingKey",e,u,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?P.forEach(function(e){a.pluralResolver.getSuffixes(e).forEach(function(t){T([e],s+t,r["defaultValue".concat(t)]||E)})}):T(P,s,E))}p=this.extendTranslation(p,e,r,f,n),O&&p===s&&this.options.appendNamespaceToMissingKey&&(p="".concat(u,":").concat(s)),O&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(p))}return p}},{key:"extendTranslation",value:function(e,t,r,n,a){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,r,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(nl({},r,{interpolation:nl({},this.options.interpolation,r.interpolation)}));var o,s=r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var l=e.match(this.interpolator.nestingRegexp);o=l&&l.length}var u=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(u=nl({},this.options.interpolation.defaultVariables,u)),e=this.interpolator.interpolate(e,u,r.lng||this.language,r),s){var c=e.match(this.interpolator.nestingRegexp);o<(c&&c.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return a&&a[0]===n[0]&&!r.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):i.translate.apply(i,n.concat([t]))},r)),r.interpolation&&this.interpolator.reset()}var d=r.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==r.applyPostProcessor&&(e=nC.handle(f,e,t,this.options&&this.options.postProcessPassResolved?nl({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,a,i,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!o.isValidLookup(t)){var l=o.extractFromKey(e,s),u=l.key;r=u;var c=l.namespaces;o.options.fallbackNS&&(c=c.concat(o.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);c.forEach(function(e){o.isValidLookup(t)||(i=e,!nj["".concat(p[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(i)&&(nj["".concat(p[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(function(r){if(!o.isValidLookup(t)){a=r;var i,l,c=u,p=[c];for(o.i18nFormat&&o.i18nFormat.addLookupKeys?o.i18nFormat.addLookupKeys(p,u,r,e,s):(d&&(i=o.pluralResolver.getSuffix(r,s.count)),d&&f&&p.push(c+i),f&&p.push(c+="".concat(o.options.contextSeparator).concat(s.context)),d&&p.push(c+=i));l=p.pop();)o.isValidLookup(t)||(n=l,t=o.getResource(r,e,l,s))}}))})}}),{res:t,usedKey:r,exactUsedKey:n,usedLng:a,usedNS:i}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),t}(nm);function nM(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nR=function(){function e(t){tM(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ng.create("languageUtils")}return tN(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map(function(e){return e.toLowerCase()}):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=nM(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=nM(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=nM(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach(function(e){if(!t){var n=r.formatLanguageCode(e);(!r.options.supportedLngs||r.isSupportedCode(n))&&(t=n)}}),!t&&this.options.supportedLngs&&e.forEach(function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find(function(e){if(0===e.indexOf(n))return e})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),a=[],i=function(e){e&&(r.isSupportedCode(e)?a.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),n.forEach(function(e){0>a.indexOf(e)&&i(r.formatLanguageCode(e))}),a}}]),e}(),nP=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],nA={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(+(1!=e&&(e%10!=1||e%100==11)))},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:3*(e%100==3||e%100==4))},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},nN=function(){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tM(this,e),this.languageUtils=t,this.options=n,this.logger=ng.create("pluralResolver"),this.rules=(r={},nP.forEach(function(e){e.lngs.forEach(function(t){r[t]={numbers:e.nr,plurals:nA[e.fc]}})}),r)}return tN(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map(function(e){return t+e})}},{key:"getSuffixes",value:function(e){var t=this,r=this.getRule(e);return r?r.numbers.map(function(r){return t.getSuffix(e,r)}):[]}},{key:"getSuffix",value:function(e,t){var r=this,n=this.getRule(e);if(n){var a=n.noAbs?n.plurals(t):n.plurals(Math.abs(t)),i=n.numbers[a];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON?o():this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?o():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),nT=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tM(this,e),this.logger=ng.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return tN(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:nD,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?n_(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?n_(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?n_(t.nestingPrefix):t.nestingPrefixEscaped||n_("$t("),this.nestingSuffix=t.nestingSuffix?n_(t.nestingSuffix):t.nestingSuffixEscaped||n_(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var a,i,o,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(0>e.indexOf(s.formatSeparator)){var a=nw(t,l,e);return s.alwaysFormat?s.format(a,void 0,r):a}var i=e.split(s.formatSeparator),o=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(nw(t,l,o),u,r,n)};this.resetRegExp();var d=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,f=n&&n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}].forEach(function(t){for(o=0;a=t.regex.exec(e);){if(void 0===(i=c(a[1].trim())))if("function"==typeof d){var r=d(e,a,n);i="string"==typeof r?r:""}else if(f){i=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(a[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||s.useRawValueToEscape||(i=nv(i));if(e=e.replace(a[0],t.safeValue(i)),t.regex.lastIndex=0,++o>=s.maxReplaces)break}}),e}},{key:"nest",value:function(e,t){var r,n,a=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=nl({},i);function s(e,t){var r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),a="{".concat(n[1]);e=n[0],a=(a=this.interpolate(a,o)).replace(/'/g,'"');try{o=JSON.parse(a),t&&(o=nl({},t,o))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(a)}return delete o.defaultValue,e}for(o.applyPostProcessor=!1,delete o.defaultValue;r=this.nestingRegexp.exec(e);){var l=[],u=!1;if(r[0].includes(this.formatSeparator)&&!/{.*}/.test(r[1])){var c=r[1].split(this.formatSeparator).map(function(e){return e.trim()});r[1]=c.shift(),l=c,u=!0}if((n=t(s.call(this,r[1].trim(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=nv(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),u&&(n=l.reduce(function(e,t){return a.format(e,t,i.lng,i)},n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}(),nU=function(e){function t(e,r,n){var a,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return tM(this,t),a=nc(this,nd(t).call(this)),nO&&nm.call(nu(a)),a.backend=e,a.store=r,a.services=n,a.languageUtils=n.languageUtils,a.options=i,a.logger=ng.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(n,i.backend,i),a}return np(t,e),tN(t,[{key:"queueLoad",value:function(e,t,r,n){var a=this,i=[],o=[],s=[],l=[];return e.forEach(function(e){var n=!0;t.forEach(function(t){var s="".concat(e,"|").concat(t);!r.reload&&a.store.hasResourceBundle(e,t)?a.state[s]=2:a.state[s]<0||(1===a.state[s]?0>o.indexOf(s)&&o.push(s):(a.state[s]=1,n=!1,0>o.indexOf(s)&&o.push(s),0>i.indexOf(s)&&i.push(s),0>l.indexOf(t)&&l.push(t)))}),n||s.push(e)}),(i.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:n}),{toLoad:i,pending:o,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),a=n[0],i=n[1];t&&this.emit("failedLoading",a,i,t),r&&this.store.addResourceBundle(a,i,r),this.state[e]=t?-1:2;var o={};this.queue.forEach(function(r){n=r.loaded,(l=(s=nb(n,[a],Object)).obj)[u=s.k]=l[u]||[],l[u].push(i);for(var n,s,l,u,c=r.pending,d=c.indexOf(e);-1!==d;)c.splice(d,1),d=c.indexOf(e);t&&r.errors.push(t),0!==r.pending.length||r.done||(Object.keys(r.loaded).forEach(function(e){o[e]||(o[e]=[]),r.loaded[e].length&&r.loaded[e].forEach(function(t){0>o[e].indexOf(t)&&o[e].push(t)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,r){var n=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,o=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[r](e,t,function(s,l){s&&l&&a<5?setTimeout(function(){n.read.call(n,e,t,r,a+1,2*i,o)},i):o(s,l)}):o(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,n,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(function(e){r.loadOne(e)})}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),a=n[0],i=n[1];this.read(a,i,"read",void 0,void 0,function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(i," for language ").concat(a," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(i," for language ").concat(a),o),t.loaded(e,n,o)})}},{key:"saveMissing",value:function(e,t,r,n,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==r||""===r||(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,nl({},i,{isUpdate:a})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),t}(nm);function nL(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&0>e.whitelist.indexOf("cimode")&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function nF(){}var nB=new(function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(tM(this,t),e=nc(this,nd(t).call(this)),nO&&nm.call(nu(e)),e.options=nL(r),e.services={},e.logger=ng,e.modules={external:[]},n&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,n),nc(e,nu(e));setTimeout(function(){e.init(r,n)},0)}return e}return np(t,e),tN(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;function n(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(r=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=nl({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===tR(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===tR(e[2])||"object"===tR(e[3])){var r=e[3]||e[2];Object.keys(r).forEach(function(e){t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,nL(t)),this.format=this.options.interpolation.format,r||(r=nF),!this.options.isClone){this.modules.logger?ng.init(n(this.modules.logger),this.options):ng.init(null,this.options);var a=new nR(this.options);this.store=new nk(this.options.resources,this.options);var i=this.services;i.logger=ng,i.resourceStore=this.store,i.languageUtils=a,i.pluralResolver=new nN(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new nT(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new nU(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];e.emit.apply(e,[t].concat(n))}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new nE(this.services,this.options),this.translator.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];e.emit.apply(e,[t].concat(n))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.length>0&&"dev"!==o[0]&&(this.options.lng=o[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}});var s=ny(),l=function(){var t=function(t,n){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),s.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),s}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nF,n=r,a="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&"cimode"===a.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach(function(e){0>i.indexOf(e)&&i.push(e)})};a?o(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return o(e)}),this.options.preload&&this.options.preload.forEach(function(e){return o(e)}),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=ny();return e||(e=this.languages),t||(t=this.options.ns),r||(r=nF),this.services.backendConnector.reload(e,t,function(e){n.resolve(),r(e)}),n}},{key:"use",value:function(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&nC.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=ny();this.emit("languageChanging",e);var a=function(e,a){a?(r.language=a,r.languages=r.services.languageUtils.toResolveHierarchy(a),r.translator.changeLanguage(a),r.isLanguageChangingTo=void 0,r.emit("languageChanged",a),r.logger.log("languageChanged",a)):r.isLanguageChangingTo=void 0,n.resolve(function(){return r.t.apply(r,arguments)}),t&&t(e,function(){return r.t.apply(r,arguments)})},i=function(e){var t="string"==typeof e?e:r.services.languageUtils.getBestMatchFromCodes(e);t&&(r.language||(r.language=t,r.languages=r.services.languageUtils.toResolveHierarchy(t)),r.translator.language||r.translator.changeLanguage(t),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(t)),r.loadResources(t,function(e){a(e,t)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t){var r=this,n=function e(t,n){var a;if("object"!==tR(n)){for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];a=r.options.overloadTranslationOptionHandler([t,n].concat(o))}else a=nl({},n);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,r.t(t,a)};return"string"==typeof e?n.lng=e:n.lngs=e,n.ns=t,n}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],a=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return -1===n||2===n};if(r.precheck){var s=r.precheck(this,o);if(void 0!==s)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||o(n,e)&&(!a||o(i,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=ny();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>r.options.ns.indexOf(e)&&r.options.ns.push(e)}),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=ny();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],a=e.filter(function(e){return 0>n.indexOf(e)});return a.length?(this.options.preload=n.concat(a),this.loadResources(function(e){r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nF,a=nl({},this.options,r,{isClone:!0}),i=new t(a);return["store","services","language"].forEach(function(t){i[t]=e[t]}),i.services=nl({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new nE(i.services,i.options),i.translator.on("*",function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];i.emit.apply(i,[e].concat(r))}),i.init(a,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}}]),t}(nm)),nV=I(3545),nz=I.n(nV);let nH=JSON.parse('{"UU":"@ohif/extension-default"}').UU;var nW=I(2220),n$=I.n(nW),nY=I(3110);let{toNumber:nG}=K.utils;var nq=I(534),nX=I.n(nq),nK=I(7155);let{calculateScanAxisNormal:nJ}=K.utils,{areAllImageOrientationsEqual:nZ}=K.utils;var nQ=I(7238),n0=I.n(nQ);function n1(e){let t=new(n0())(e),r=new K.DisplaySetMessageList,n=e[0];if(e.length){let e=n.SOPClassUID;e?r.addMessage(K.DisplaySetMessage.CODES.UNSUPPORTED_SOP_CLASS_UID,{sopClassUid:e}):r.addMessage(K.DisplaySetMessage.CODES.MISSING_SOP_CLASS_UID)}else r.addMessage(K.DisplaySetMessage.CODES.NO_VALID_INSTANCES);return t.setAttributes({displaySetInstanceUID:t.uid,SeriesDate:n.SeriesDate,SeriesTime:n.SeriesTime,SeriesInstanceUID:n.SeriesInstanceUID,StudyInstanceUID:n.StudyInstanceUID,SeriesNumber:n.SeriesNumber||0,FrameRate:n.FrameTime,SOPClassUID:n.SOPClassUID,SeriesDescription:n.SeriesDescription||"",Modality:n.Modality,instances:e,instance:e[n.length-1],unsupported:!0,SOPClassHandlerId:"unsupported",isReconstructable:!1,messages:r}),[t]}let n2="chart",n3=["1.9.451.13215.7.3.2.7.6.1"],n4=e=>(function(e){let t;if(!e||!e.length)throw Error("No instances were provided");let r=(t=new Set,e.forEach(e=>{t.add(e.SOPClassUID)}),Array.from(t));return e.map(e=>{if("CHT"===e.Modality)return((e,t)=>{let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a,SeriesDescription:i,SeriesNumber:o,SOPClassUID:s}=e,{SeriesDate:l,SeriesTime:u}=K.utils.getLatestInstanceDateTime(e);return{Modality:"CHT",loading:!1,isReconstructable:!1,displaySetInstanceUID:K.utils.guid(),SeriesDescription:i,SeriesNumber:o,SeriesDate:l,SeriesTime:u,SOPInstanceUID:a,SeriesInstanceUID:n,StudyInstanceUID:r,SOPClassHandlerId:`${nH}.sopClassHandlerModule.${n2}`,SOPClassUID:s,isDerivedDisplaySet:!0,isLoaded:!0,sopClassUids:t,instance:e,instances:[e],addInstances:function(e,t){this.instances.push(...e),this.instance=this.instances[this.instances.length-1];let{SeriesDate:r,SeriesTime:n}=K.utils.getLatestInstanceDateTime(this.instance);return this.SeriesDate=r,this.SeriesTime=n,this}}})(e,r);throw Error("Unsupported modality")})})(e);var n5=I(6557);let{isImage:n8,sortStudyInstances:n6,sopClassDictionary:n9,isDisplaySetReconstructable:n7}=K.utils,{ImageSet:ae}=K.classes,at="stack",ar={},an=(e,t)=>{n6(e);let r=e[0],n=new ae(e),{extensionManager:a}=ar,i=a.getActiveDataSource()[0],o=i.getImageIdsForDisplaySet(n),{isDynamicVolume:s,value:l,averageSpacingBetweenFrames:u,dynamicVolumeInfo:c}=function(e,t){let r,n=(e=>{let{extensionManager:t}=ar;if(!t)throw Error("extensionManager is not available");let{getDynamicVolumeInfo:r}=t.getModuleEntry("@ohif/extension-cornerstone.utilityModule.volumeLoader").exports;return r(e)})(t),{isDynamicVolume:a,timePoints:i}=n,{appConfig:o}=ar;if(a){let t,n=i[0],a=new Map;e[0].NumberOfFrames>1&&i.length>1?(t=i[0].map(e=>n5.metaData.get("instance",e)).filter(Boolean)).length||(t=[e[0]]):(e.forEach(e=>a.set(e.imageId,e)),t=n.map(e=>a.get(e)).filter(Boolean)),r=n7(t,o)}else r=n7(e,o);return{isDynamicVolume:a,...r,dynamicVolumeInfo:n}}(e,o),d=s?"cornerstoneStreamingDynamicImageVolume":"cornerstoneStreamingImageVolume",f=function(e,t,r){var n;let a=new K.DisplaySetMessageList;if(r)return a;if(!e.length)return void a.addMessage(K.DisplaySetMessage.CODES.NO_VALID_INSTANCES);let{Modality:i,ImageType:o,NumberOfFrames:s}=e[0];if(o?.includes("LOCALIZER")||!nY.constructableModalities.includes(i))return a;let l=s>1;l||e.every(e=>e.ImagePositionPatient)||a.addMessage(K.DisplaySetMessage.CODES.NO_POSITION_INFORMATION);let u=n$()(e);return l?(n=u[0],(0,nY.hasPixelMeasurements)(n)||a.addMessage(K.DisplaySetMessage.CODES.MULTIFRAME_NO_PIXEL_MEASUREMENTS),(0,nY.hasOrientation)(n)||a.addMessage(K.DisplaySetMessage.CODES.MULTIFRAME_NO_ORIENTATION),(0,nY.hasPosition)(n)||a.addMessage(K.DisplaySetMessage.CODES.MULTIFRAME_NO_POSITION_INFORMATION)):u.length>2&&(!function(e){if(!e?.length)return!1;let t=e[0],r=nG(t.Rows),n=nG(t.Columns);for(let t=1;t<e.length;t++){let{Rows:a,Columns:i}=e[t];if(nG(a)!==r||nG(i)!==n)return!1}return!0}(u)&&a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_DIMENSIONS),!function(e){if(!e?.length)return!1;let t=e[0],r=nX()(t.SamplesPerPixel);for(let t=1;t<e.length;t++){let{SamplesPerPixel:n}=e[t];if(n!==r)return!1}return!0}(u)&&a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_COMPONENTS),nZ(u)||a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_ORIENTATIONS),!function(e){if(!e?.length)return!1;let t=nX()(e[0].ImageOrientationPatient);if(!t)return!1;let r=nJ(t),n=nX()(e[0].ImagePositionPatient),a=nX()(e[e.length-1].ImagePositionPatient);if(!n||!a)return!1;let i=(0,nY._getPerpendicularDistance)(n,a)/(e.length-1),o=n;for(let t=1;t<e.length;t++){let n=e[t],a=nX()(n.ImagePositionPatient);if(function(e,t,r,n){let a=nK.vec3.scaleAndAdd(nK.vec3.create(),e,r,n);return nK.vec3.distance(t,a)>n}(o,a,r,i))return!1;o=a}return!0}(u)&&a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_POSITION_INFORMATION),function(e,t){if(!e?.length)return;let r=nX()(e[0].ImagePositionPatient);if(!r)return;let n=nX()(e[e.length-1].ImagePositionPatient);if(!n)return;let a=(0,nY._getPerpendicularDistance)(r,n)/(e.length-1),i=r,o=[];for(let r=1;r<e.length;r++){let n=e[r],s=nX()(n.ImagePositionPatient),l=(0,nY._getPerpendicularDistance)(s,i),u=(0,nY._getSpacingIssue)(l,a);if(u){let e=u.issue;if(o.includes(e)||(o.push(e),e===nY.reconstructionIssues.MISSING_FRAMES?t.addMessage(K.DisplaySetMessage.CODES.MISSING_FRAMES):e===nY.reconstructionIssues.IRREGULAR_SPACING&&t.addMessage(K.DisplaySetMessage.CODES.IRREGULAR_SPACING)),o.length>1)break}i=s}}(u,a)),t||a.addMessage(K.DisplaySetMessage.CODES.NOT_RECONSTRUCTABLE),a}(e,l,s);n.setAttributes({volumeLoaderSchema:d,displaySetInstanceUID:n.uid,SeriesDate:r.SeriesDate,SeriesTime:r.SeriesTime,SeriesInstanceUID:r.SeriesInstanceUID,StudyInstanceUID:r.StudyInstanceUID,SeriesNumber:r.SeriesNumber||0,FrameRate:r.FrameTime,SOPClassUID:r.SOPClassUID,SeriesDescription:r.SeriesDescription||"",Modality:r.Modality,isMultiFrame:r.NumberOfFrames>1,countIcon:l?"icon-mpr":void 0,numImageFrames:e.length,SOPClassHandlerId:`${nH}.sopClassHandlerModule.${at}`,isReconstructable:l,messages:f,averageSpacingBetweenFrames:u||null,isDynamicVolume:s,dynamicVolumeInfo:c,supportsWindowLevel:!0,label:r.SeriesDescription||`${nz().t("Series")} ${r.SeriesNumber} - ${nz().t(r.Modality)}`,FrameOfReferenceUID:r.FrameOfReferenceUID});let p=o[Math.floor(o.length/2)],h=e[Math.floor(e.length/2)];if(s){let e=c.timePoints,t=Math.floor(e.length/2),r=e[t];p=r[Math.floor(r.length/2)]}n.setAttributes({getThumbnailSrc:i.retrieve.getGetThumbnailSrc?.(h,p)});let{servicesManager:g}=ar,{customizationService:m}=g.services;return n.sort(m),n};function aa(e){let t;if(!e||!e.length)throw Error("No instances were provided");let r=[],n=(t=new Set,e.forEach(e=>{t.add(e.SOPClassUID)}),Array.from(t)),a=[];if(e.forEach((e,t)=>{let i;if(n8(e.SOPClassUID)||e.Rows)if(e.NumberOfFrames>1)(i=an([e],t)).setAttributes({sopClassUids:n,numImageFrames:e.NumberOfFrames,instanceNumber:e.InstanceNumber,acquisitionDatetime:e.AcquisitionDateTime}),r.push(i);else{let o;"CR"===(o=e.Modality)||"MG"===o||"DX"===o?((i=an([e],t)).setAttributes({sopClassUids:n,instanceNumber:e.InstanceNumber,acquisitionDatetime:e.AcquisitionDateTime}),r.push(i)):a.push(e)}}),a.length){let t=an(a,r.length);t.setAttribute("studyInstanceUid",e[0].StudyInstanceUID),t.setAttributes({sopClassUids:n}),r.push(t)}return r}let ai=[n9.ComputedRadiographyImageStorage,n9.DigitalXRayImageStorageForPresentation,n9.DigitalXRayImageStorageForProcessing,n9.DigitalMammographyXRayImageStorageForPresentation,n9.DigitalMammographyXRayImageStorageForProcessing,n9.DigitalIntraOralXRayImageStorageForPresentation,n9.DigitalIntraOralXRayImageStorageForProcessing,n9.CTImageStorage,n9.EnhancedCTImageStorage,n9.LegacyConvertedEnhancedCTImageStorage,n9.UltrasoundMultiframeImageStorage,n9.MRImageStorage,n9.EnhancedMRImageStorage,n9.EnhancedMRColorImageStorage,n9.LegacyConvertedEnhancedMRImageStorage,n9.UltrasoundImageStorage,n9.UltrasoundImageStorageRET,n9.SecondaryCaptureImageStorage,n9.MultiframeSingleBitSecondaryCaptureImageStorage,n9.MultiframeGrayscaleByteSecondaryCaptureImageStorage,n9.MultiframeGrayscaleWordSecondaryCaptureImageStorage,n9.MultiframeTrueColorSecondaryCaptureImageStorage,n9.XRayAngiographicImageStorage,n9.EnhancedXAImageStorage,n9.XRayRadiofluoroscopicImageStorage,n9.EnhancedXRFImageStorage,n9.XRay3DAngiographicImageStorage,n9.XRay3DCraniofacialImageStorage,n9.BreastTomosynthesisImageStorage,n9.CornealTopographyMapStorage,n9.BreastProjectionXRayImageStorageForPresentation,n9.BreastProjectionXRayImageStorageForProcessing,n9.IntravascularOpticalCoherenceTomographyImageStorageForPresentation,n9.IntravascularOpticalCoherenceTomographyImageStorageForProcessing,n9.NuclearMedicineImageStorage,n9.VLEndoscopicImageStorage,n9.VideoEndoscopicImageStorage,n9.VLMicroscopicImageStorage,n9.VideoMicroscopicImageStorage,n9.VLSlideCoordinatesMicroscopicImageStorage,n9.VLPhotographicImageStorage,n9.VideoPhotographicImageStorage,n9.OphthalmicPhotography8BitImageStorage,n9.OphthalmicPhotography16BitImageStorage,n9.OphthalmicTomographyImageStorage,n9.PositronEmissionTomographyImageStorage,n9.EnhancedPETImageStorage,n9.LegacyConvertedEnhancedPETImageStorage,n9.RTImageStorage,n9.EnhancedUSVolumeStorage,n9.RTDoseStorage];function ao(e,t){return(0,tu.jsx)(tl.LayoutSelector.Preset,{title:e.title,icon:e.icon,commandOptions:e.commandOptions,disabled:e.disabled,isPreset:!0},`advanced-preset-${t}`)}function as(e,t){return(0,tu.jsx)(tl.LayoutSelector.Preset,{icon:e.icon,commandOptions:e.commandOptions,isPreset:!1},`common-preset-${t}`)}let al=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k=(0,ti.c)(62);k[0]!==e?({commandsManager:t,servicesManager:n,rows:a,columns:i,...r}=e,k[0]=e,k[1]=t,k[2]=r,k[3]=n,k[4]=a,k[5]=i):(t=k[1],r=k[2],n=k[3],a=k[4],i=k[5]);let C=void 0===a?3:a,j=void 0===i?4:i,{customizationService:E}=n.services,{t:M}=tQ("ToolbarLayoutSelector");if(k[6]!==t||k[7]!==E||k[8]!==r||k[9]!==n||k[10]!==M){let e,a,i=E?.getCustomization("layoutSelector.commonPresets")||[{icon:"layout-single",commandOptions:{numRows:1,numCols:1}},{icon:"layout-side-by-side",commandOptions:{numRows:1,numCols:2}},{icon:"layout-four-up",commandOptions:{numRows:2,numCols:2}},{icon:"layout-three-row",commandOptions:{numRows:3,numCols:1}}],h=E?.getCustomization("layoutSelector.advancedPresetGenerator"),g=h?h({servicesManager:n}):[{title:"MPR",icon:"layout-three-col",commandOptions:{protocolId:"mpr"}},{title:"3D four up",icon:"layout-four-up",commandOptions:{protocolId:"3d-four-up"}},{title:"3D main",icon:"layout-three-row",commandOptions:{protocolId:"3d-main"}},{title:"Axial Primary",icon:"layout-side-by-side",commandOptions:{protocolId:"axial-primary"}},{title:"3D only",icon:"layout-single",commandOptions:{protocolId:"3d-only"}},{title:"3D primary",icon:"layout-side-by-side",commandOptions:{protocolId:"3d-primary"}},{title:"Frame View",icon:"icon-stack",commandOptions:{protocolId:"frame-view"}}];k[19]!==t?(e=(e,r)=>{r?t.run({commandName:"setHangingProtocol",commandOptions:{...e,restoreCachedLayout:!1}}):t.run({commandName:"setViewportGridLayout",commandOptions:e})},k[19]=t,k[20]=e):e=k[20];let m=e;f="Layout",p="Layout",s=tl.LayoutSelector,u=m,c=r,k[21]!==M?(a=M("Change layout"),k[21]=M,k[22]=a):a=k[22],k[23]!==a?(d=(0,tu.jsx)(tl.LayoutSelector.Trigger,{tooltip:a}),k[23]=a,k[24]=d):d=k[24],o=tl.LayoutSelector.Content,l=(i.length>0||g.length>0)&&(0,tu.jsxs)("div",{className:"bg-popover flex flex-col gap-2.5 rounded-lg p-2",children:[i.length>0&&(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.LayoutSelector.PresetSection,{title:M("Common"),children:i.map(as)}),(0,tu.jsx)(tl.LayoutSelector.Divider,{})]}),g.length>0&&(0,tu.jsx)(tl.LayoutSelector.PresetSection,{title:M("Advanced"),children:g.map(ao)})]}),k[6]=t,k[7]=E,k[8]=r,k[9]=n,k[10]=M,k[11]=o,k[12]=s,k[13]=l,k[14]=u,k[15]=c,k[16]=d,k[17]=f,k[18]=p}else o=k[11],s=k[12],l=k[13],u=k[14],c=k[15],d=k[16],f=k[17],p=k[18];return k[25]!==M?(h=M("Custom"),k[25]=M,k[26]=h):h=k[26],k[27]!==h?(g=(0,tu.jsx)("div",{className:"text-muted-foreground text-xs",children:h}),k[27]=h,k[28]=g):g=k[28],k[29]!==j||k[30]!==C?(m=(0,tu.jsx)(tl.LayoutSelector.GridSelector,{rows:C,columns:j}),k[29]=j,k[30]=C,k[31]=m):m=k[31],k[32]!==M?(y=M("Hover to select"),k[32]=M,k[33]=y):y=k[33],k[34]===Symbol.for("react.memo_cache_sentinel")?(v=(0,tu.jsx)("br",{}),k[34]=v):v=k[34],k[35]!==M?(b=M("rows and columns"),k[35]=M,k[36]=b):b=k[36],k[37]===Symbol.for("react.memo_cache_sentinel")?(x=(0,tu.jsx)("br",{}),k[37]=x):x=k[37],k[38]!==M?(S=M("Click to apply"),k[38]=M,k[39]=S):S=k[39],k[40]!==y||k[41]!==b||k[42]!==S?(w=(0,tu.jsxs)(tl.LayoutSelector.HelpText,{children:[y," ",v,b," ",x,S]}),k[40]=y,k[41]=b,k[42]=S,k[43]=w):w=k[43],k[44]!==g||k[45]!==m||k[46]!==w?(_=(0,tu.jsxs)("div",{className:"bg-muted flex flex-col gap-2.5 border-l-2 border-solid border-background p-2",children:[g,m,w]}),k[44]=g,k[45]=m,k[46]=w,k[47]=_):_=k[47],k[48]!==o||k[49]!==_||k[50]!==l?(I=(0,tu.jsxs)(o,{children:[l,_]}),k[48]=o,k[49]=_,k[50]=l,k[51]=I):I=k[51],k[52]!==s||k[53]!==I||k[54]!==u||k[55]!==c||k[56]!==d?(D=(0,tu.jsxs)(s,{onSelectionChange:u,...c,children:[d,I]}),k[52]=s,k[53]=I,k[54]=u,k[55]=c,k[56]=d,k[57]=D):D=k[57],k[58]!==D||k[59]!==f||k[60]!==p?(O=(0,tu.jsx)("div",{id:f,"data-cy":p,children:D}),k[58]=D,k[59]=f,k[60]=p,k[61]=O):O=k[61],O},au=(e=[])=>e.map(e=>({label:e.name,value:e.id,info:e.info,activated:!1,completed:!1}));function ac(){let e,t,r,n,a,i,o,s=(0,ti.c)(15),{servicesManager:l}=(0,K.useSystem)(),{workflowStepsService:u}=l.services,[c,d]=(0,to.useState)(u.activeWorkflowStep?.id);s[0]!==u.workflowSteps?(e=au(u.workflowSteps),s[0]=u.workflowSteps,s[1]=e):e=s[1];let[f,p]=(0,to.useState)(e);s[2]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let{selectedOption:t}=e;t&&(t.completed||p(e=>{let r=[...e],n=r.findIndex(e=>e.value===t.value);for(let e=n;e>=0;e--){let t=r[e];if(t.completed)break;r[e]={...t,completed:!0}}return r}),d(t.value))},s[2]=t):t=s[2];let h=t;return s[3]!==c||s[4]!==u?(r=()=>{let e;return c&&u.setActiveWorkflowStep(c),()=>clearTimeout(e)},n=[c,u],s[3]=c,s[4]=u,s[5]=r,s[6]=n):(r=s[5],n=s[6]),(0,to.useEffect)(r,n),s[7]!==u?(a=()=>{let{unsubscribe:e}=u.subscribe(u.EVENTS.STEPS_CHANGED,()=>p(au(u.workflowSteps))),{unsubscribe:t}=u.subscribe(u.EVENTS.ACTIVE_STEP_CHANGED,()=>d(u.activeWorkflowStep.id));return()=>{e(),t()}},s[7]=u,s[8]=a):a=s[8],s[9]!==l||s[10]!==u?(i=[l,u],s[9]=l,s[10]=u,s[11]=i):i=s[11],(0,to.useEffect)(a,i),s[12]!==c||s[13]!==f?(o=(0,tu.jsx)(tl.ProgressDropdown,{options:f,value:c,onChange:h}),s[12]=c,s[13]=f,s[14]=o):o=s[14],o}var ad=I(1459);function af(e){let t,r,n,a,i,o,s,l,u,c,d,f=(0,ti.c)(42),{buttonSection:p,id:h}=e;f[0]!==p?(t={buttonSection:p},f[0]=p,f[1]=t):t=f[1];let{onInteraction:g,toolbarButtons:m}=(0,ad.useToolbar)(t);if(!m?.length)return null;f[2]!==m?(r=m.find(ah)?.componentProps||m[0].componentProps,f[2]=m,f[3]=r):r=f[3];let y=r;if(f[4]!==h||f[5]!==g||f[6]!==y||f[7]!==m){let e,t,r,u=m.map(ap);a=tl.ToolButtonList;let c=`${h}-split-button-primary`;f[14]!==h||f[15]!==g||f[16]!==y.commands?(e=e=>{let{itemId:t}=e;return g?.({id:h,itemId:t,commands:y.commands})},f[14]=h,f[15]=g,f[16]=y.commands,f[17]=e):e=f[17],f[18]!==y||f[19]!==e?(t=(0,tu.jsx)(tl.ToolButton,{...y,onInteraction:e,className:y.className}),f[18]=y,f[19]=e,f[20]=t):t=f[20],f[21]!==y.id||f[22]!==y.isActive||f[23]!==c||f[24]!==t?(s=(0,tu.jsx)(tl.ToolButtonListDefault,{children:(0,tu.jsx)("div",{"data-cy":c,"data-tool":y.id,"data-active":y.isActive,children:t})}),f[21]=y.id,f[22]=y.isActive,f[23]=c,f[24]=t,f[25]=s):s=f[25];let d=y.isActive?"opacity-0":"opacity-100";f[26]!==d?(l=(0,tu.jsx)(tl.ToolButtonListDivider,{className:d}),f[26]=d,f[27]=l):l=f[27],o=`${h}-split-button-secondary`,n=tl.ToolButtonListDropDown,f[28]!==h||f[29]!==g?(r=e=>(0,tu.jsx)(tl.ToolButtonListItem,{...e,"data-cy":e.id,"data-tool":e.id,"data-active":e.isActive,onSelect:()=>g?.({id:h,itemId:e.id,commands:e.commands}),children:(0,tu.jsx)("span",{className:"pl-1",children:e.label||e.tooltip||e.id})},e.id),f[28]=h,f[29]=g,f[30]=r):r=f[30],i=u.map(r),f[4]=h,f[5]=g,f[6]=y,f[7]=m,f[8]=n,f[9]=a,f[10]=i,f[11]=o,f[12]=s,f[13]=l}else n=f[8],a=f[9],i=f[10],o=f[11],s=f[12],l=f[13];return f[31]!==n||f[32]!==i?(u=(0,tu.jsx)(n,{children:i}),f[31]=n,f[32]=i,f[33]=u):u=f[33],f[34]!==o||f[35]!==u?(c=(0,tu.jsx)("div",{"data-cy":o,children:u}),f[34]=o,f[35]=u,f[36]=c):c=f[36],f[37]!==a||f[38]!==s||f[39]!==l||f[40]!==c?(d=(0,tu.jsxs)(a,{children:[s,l,c]}),f[37]=a,f[38]=s,f[39]=l,f[40]=c,f[41]=d):d=f[41],d}function ap(e){return e.componentProps}function ah(e){return e.componentProps.isActive}let ag=function(e){let t,r,n,a=(0,ti.c)(12),{buttonSection:i,className:o,show:s}=e;a[0]!==i?(t={buttonSection:i},a[0]=i,a[1]=t):t=a[1];let{onInteraction:l,toolbarButtons:u}=(0,K.useToolbar)(t);if(!u?.length)return null;let c=`space-x-1} flex flex-row items-center ${void 0===o?"":o}`;if(a[2]!==i||a[3]!==l||a[4]!==u){let e;a[6]!==i||a[7]!==l?(e=(e,t)=>{let{id:r,Component:n,componentProps:a}=e;return(0,tu.jsx)("div",{className:"flex-shrink-0",children:(0,tu.jsx)(n,{...a,onInteraction:l,location:a.location||i})},r||t)},a[6]=i,a[7]=l,a[8]=e):e=a[8],r=u.map(e),a[2]=i,a[3]=l,a[4]=u,a[5]=r}else r=a[5];return a[9]!==c||a[10]!==r?(n=(0,tu.jsx)("div",{className:c,children:r}),a[9]=c,a[10]=r,a[11]=n):n=a[11],n};var am=I(5530),ay=I.n(am),av=I(4687);function ab(e){let t,r,n,a,i=(0,ti.c)(13),{buttonSection:o,id:s}=e;i[0]!==o?(t={buttonSection:o},i[0]=o,i[1]=t):t=i[1];let{onInteraction:l,toolbarButtons:u}=(0,av.useToolbar)(t);if(!o)return null;if(i[2]!==s||i[3]!==l||i[4]!==u){let e,t=u.map(ax);r="bg-popover flex flex-row space-x-1 rounded-md px-0 py-0",i[7]!==s||i[8]!==l?(e=e=>(0,to.createElement)(tl.ToolButton,{...e,key:e.id,size:"small",className:e.disabled&&"text-foreground/70",onInteraction:t=>{l?.({event:t,id:s,commands:e.commands,itemId:e.id,item:e})}}),i[7]=s,i[8]=l,i[9]=e):e=i[9],n=t.map(e),i[2]=s,i[3]=l,i[4]=u,i[5]=r,i[6]=n}else r=i[5],n=i[6];return i[10]!==r||i[11]!==n?(a=(0,tu.jsx)("div",{className:r,children:n}),i[10]=r,i[11]=n,i[12]=a):a=i[12],a}function ax(e){return e.componentProps}function aS(e){let t,r,n,a,i,o,s,l,u,c,d,f,p=(0,ti.c)(24);if(p[0]!==e){let{onInteraction:c,className:d,options:f,...h}=e;r=c,n=f,a=h,u="bg-popover flex flex-row rounded-md px-0 py-0",t=tl.ToolButton,i=a,o=a.id,s="small",l=ay()(a.disabled&&"text-foreground/70",d),p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=a,p[5]=i,p[6]=o,p[7]=s,p[8]=l,p[9]=u}else t=p[1],r=p[2],n=p[3],a=p[4],i=p[5],o=p[6],s=p[7],l=p[8],u=p[9];return p[10]!==r||p[11]!==n||p[12]!==a?(c=e=>{r?.({event:e,itemId:a.id,commands:a.commands,options:n})},p[10]=r,p[11]=n,p[12]=a,p[13]=c):c=p[13],p[14]!==t||p[15]!==i||p[16]!==o||p[17]!==s||p[18]!==l||p[19]!==c?(d=(0,tu.jsx)(t,{...i,id:o,size:s,className:l,onInteraction:c}),p[14]=t,p[15]=i,p[16]=o,p[17]=s,p[18]=l,p[19]=c,p[20]=d):d=p[20],p[21]!==u||p[22]!==d?(f=(0,tu.jsx)("div",{className:u,children:d}),p[21]=u,p[22]=d,p[23]=f):f=p[23],f}function aw(e){let t,r,n=(0,ti.c)(7),{IconContainer:a,containerProps:i}=(0,tl.useIconPresentation)();n[0]!==e.icon?(t=(0,tu.jsx)(tl.Icons.ByName,{name:e.icon}),n[0]=e.icon,n[1]=t):t=n[1];let o=t;return n[2]!==o||n[3]!==a||n[4]!==i||n[5]!==e?(r=(0,tu.jsx)("div",{children:a?(0,tu.jsx)(a,{disabled:e.disabled,...e,...i,children:o}):(0,tu.jsx)(tl.Button,{variant:"ghost",size:"icon",disabled:e.disabled,children:o})}),n[2]=o,n[3]=a,n[4]=i,n[5]=e,n[6]=r):r=n[6],r}let a_=J().classes.MetadataProvider,aI="[SEG register]",aD=new Set;function aO(e,t={}){let r=Array.isArray(e)?e:[e],{referencedImageIds:n=[]}=t;return r.forEach(e=>(function(e,t={}){let{referencedImageIds:r=[]}=t;if(void 0===e.PixelData&&!Array.isArray(e.PerFrameFunctionalGroupsSequence))return void J().log.debug(aI,"Skipping local wadouri registration (no pixel data)",{SOPClassUID:e.SOPClassUID,SOPInstanceUID:e.SOPInstanceUID});let n=eE(e),a=eu().wadouri.fileManager.add(n);aD.add(a),ek(e,"url",a);let{StudyInstanceUID:i,SeriesInstanceUID:o}=e,s=e.SOPInstanceUID||e.SopInstanceUID,l=e.PerFrameFunctionalGroupsSequence;Array.isArray(l)&&!e.NumberOfFrames&&(e.NumberOfFrames=l.length);let u=Math.max(Number(e.NumberOfFrames)||0,Array.isArray(l)?l.length:0,1),c=[];if(i&&o&&s){let e=(e,t=1)=>{a_.addImageIdToUIDs(e,{StudyInstanceUID:i,SeriesInstanceUID:o,SOPInstanceUID:s,frameNumber:t})};for(let t=1;t<=u;t++){let r=u>1?eJ(a,t):a;c.push(r),e(r,t)}}return eC(e),J().log.debug(aI,"Registered local wadouri instance",{StudyInstanceUID:i,SeriesInstanceUID:o,SOPInstanceUID:s,numberOfFrames:u,baseImageId:a,frameImageIds:c,blobSizeBytes:n.size,referencedImageIdCount:r.length,SegmentationType:e.SegmentationType,SOPClassUID:e.SOPClassUID}),a})(e,{referencedImageIds:n})),r}let ak=J().classes.MetadataProvider;var aC=I(4713);class aj{constructor(e,t){this.commandsManager=void 0,this.services=void 0,this.menuItems=void 0,this.services=e.services,this.commandsManager=t}closeContextMenu(){this.services.uiDialogService.hide("context-menu")}showContextMenu(e,t,r){if(!this.services.uiDialogService)return void console.warn("Unable to show dialog; no UI Dialog Service available.");let{event:n,subMenu:a,menuId:i,menus:o,selectorProps:s}=e;if(!o)return void console.warn("No menus found for",i);let{locking:l,visibility:u}=aC.annotation,c=s?.nearbyToolData?.annotationUID;if(c){let e=l.isAnnotationLocked(c),t=u.isAnnotationVisible(c);if(e||!t)return void console.warn(`Annotation is ${e?"locked":"not visible"}.`)}let d=function e(t,r,n,a){let i={selectorProps:t,event:r},o=function(e,t,r){let{subMenu:n}=t,a=function*(){yield function(e,t){if(t)return e.find(e=>e.id===t)}(e,r||n),yield!e?null:e.find(e=>!e.selector||e.selector(t.selectorProps))}(),i=a.next(),o=i.value;for(;!i.done;)(o=i.value)&&a.return(),i=a.next();return o}(n,i,a);if(!o)return;if(!o.items)return console.warn("Must define items in menu",o),[];let s=[];return o.items.forEach(a=>{let{delegating:o,selector:l,subMenu:u}=a;if(!l||l(t))if(o)s=[...s,...e(t,r,n,u)];else{var c,d;let e,t=(c=a,d=i,e={...c,value:d.selectorProps?.value},"ShowSubMenu"!==c.actionType||e.iconRight||(e.iconRight="chevron-down"),c.action||(e.action=(t,r)=>{let{event:n={}}=r,{detail:a={}}=n;e.element=a.element,r.onClose();let i=r[`on${t.actionType||"Default"}`];i?i.call(r,e,t,d):console.warn("No action defined for",t)}),e);s.push(t)}}),s}(s||e,n,o,i);if(!d)return;let f=this.services.customizationService.getCustomization("ui.contextMenu");this.services.uiDialogService.hide("context-menu"),this.services.uiDialogService.show({id:"context-menu",showOverlay:!1,defaultPosition:aj._getDefaultPosition(r,n?.detail||n,t),content:f,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,unstyled:!0,contentProps:{items:d,selectorProps:s,menus:o,event:n,subMenu:a,eventData:n?.detail||n,onClose:()=>{this.services.uiDialogService.hide("context-menu")},onShowSubMenu:(n,a,i)=>{a.subMenu?this.showContextMenu({...e,menuId:a.subMenu},t,r):console.warn("No submenu defined for",n,a,i)},onDefault:(e,t,r)=>{this.commandsManager.run(e,{...s,...t,subProps:r})}}})}}aj.getDefaultPosition=()=>({x:0,y:0}),aj._getEventDefaultPosition=e=>({x:e?.currentPoints?.client[0]??e?.pageX,y:e?.currentPoints?.client[1]??e?.pageY}),aj._getElementDefaultPosition=e=>{if(e){let t=e.getBoundingClientRect();return{x:t.x,y:t.y}}return{x:void 0,y:void 0}},aj._getCanvasPointsPosition=(e=[],t)=>{let r=aj._getElementDefaultPosition(t);for(let t=0;t<e.length;t++){let n={x:e[t][0]||e[t].x,y:e[t][1]||e[t].y};if(aj._isValidPosition(n)&&aj._isValidPosition(r))return{x:n.x+r.x,y:n.y+r.y}}},aj._isValidPosition=e=>e&&"number"==typeof e.x&&"number"==typeof e.y,aj._getDefaultPosition=(e,t,r)=>{let n=function*(){yield aj._getCanvasPointsPosition(e,r),yield aj._getEventDefaultPosition(t),yield aj._getElementDefaultPosition(r),yield aj.getDefaultPosition()}(),a=n.next(),i=a.value;for(;!a.done;)i=a.value,aj._isValidPosition(i)&&n.return(),a=n.next();return i};var aE=I(4867),aM=I.n(aE);function aR(){return(aR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}var aP=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function aA(e,t){if(e.length!==t.length)return!1;for(var r,n,a=0;a<e.length;a++)if(!((r=e[a])===(n=t[a])||aP(r)&&aP(n))&&1)return!1;return!0}let aN=function(e,t){void 0===t&&(t=aA);var r,n,a=[],i=!1;return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return i&&r===this&&t(o,a)||(n=e.apply(this,o),i=!0,r=this,a=o),n}};var aT="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function aU(e){cancelAnimationFrame(e.id)}var aL=-1;function aF(e){if(void 0===e&&(e=!1),-1===aL||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),aL=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return aL}var aB=null;function aV(e){if(void 0===e&&(e=!1),null===aB||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),a=n.style;a.width="100px",a.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?aB="positive-descending":(t.scrollLeft=1,aB=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t)}return aB}var az=function(e,t){return e},aH=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},aW=function(e,t,r){var n=e.itemSize,a=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var o=0;if(i>=0){var s=a[i];o=s.offset+s.size}for(var l=i+1;l<=t;l++){var u=n(l);a[l]={offset:o,size:u},o+=u}r.lastMeasuredIndex=t}return a[t]},a$=function(e,t,r){var n=t.itemMetadataMap,a=t.lastMeasuredIndex;return(a>0?n[a].offset:0)>=r?aY(e,t,a,0,r):aG(e,t,Math.max(0,a),r)},aY=function(e,t,r,n,a){for(;n<=r;){var i=n+Math.floor((r-n)/2),o=aW(e,i,t).offset;if(o===a)return i;o<a?n=i+1:o>a&&(r=i-1)}return n>0?n-1:0},aG=function(e,t,r,n){for(var a=e.itemCount,i=1;r<a&&aW(e,r,t).offset<n;)r+=i,i*=2;return aY(e,t,Math.min(r,a-1),Math.floor(r/2),n)},aq=function(e,t){var r=e.itemCount,n=t.itemMetadataMap,a=t.estimatedItemSize,i=t.lastMeasuredIndex,o=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];o=s.offset+s.size}return o+(r-i-1)*a},aX=(u=(s={getItemOffset:function(e,t,r){return aW(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:aq,getOffsetForIndexAndAlignment:function(e,t,r,n,a,i){var o=e.direction,s=e.height,l=e.layout,u=e.width,c="horizontal"===o||"horizontal"===l?u:s,d=aW(e,t,a),f=Math.max(0,Math.min(aq(e,a)-c,d.offset)),p=Math.max(0,d.offset-c+d.size+i);switch("smart"===r&&(r=n>=p-c&&n<=f+c?"auto":"center"),r){case"start":return f;case"end":return p;case"center":return Math.round(p+(f-p)/2);default:if(n>=p&&n<=f)return n;if(n<p)return p;return f}},getStartIndexForOffset:function(e,t,r){return a$(e,r,t)},getStopIndexForStartIndex:function(e,t,r,n){for(var a=e.direction,i=e.height,o=e.itemCount,s=e.layout,l=e.width,u=aW(e,t,n),c=r+("horizontal"===a||"horizontal"===s?l:i),d=u.offset+u.size,f=t;f<o-1&&d<c;)d+=aW(e,++f,n).size;return f},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,n){void 0===n&&(n=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),n&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}).getItemOffset,c=s.getEstimatedTotalSize,d=s.getItemSize,f=s.getOffsetForIndexAndAlignment,p=s.getStartIndexForOffset,h=s.getStopIndexForStartIndex,g=s.initInstanceProps,m=s.shouldResetStyleCacheOnItemSizeChange,y=s.validateProps,(l=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=g(r.props,nu(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:nu(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=aN(function(e,t,n,a){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:a})}),r._callOnScroll=void 0,r._callOnScroll=aN(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,n=r.props,a=n.direction,i=n.itemSize,o=n.layout,s=r._getItemStyleCache(m&&i,m&&o,m&&a);if(s.hasOwnProperty(e))t=s[e];else{var l=u(r.props,e,r._instanceProps),c=d(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===o,p="rtl"===a,h=f?l:0;s[e]=t={position:"absolute",left:p?void 0:h,right:p?h:void 0,top:f?0:l,height:f?"100%":c,width:f?c:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=aN(function(e,t,r){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,a=t.scrollLeft,i=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===a)return null;var t=r.props.direction,o=a;if("rtl"===t)switch(aV()){case"negative":o=-a;break;case"positive-descending":o=i-n-a}return o=Math.max(0,Math.min(o,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,a=t.scrollHeight,i=t.scrollTop;r.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,a-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n;null!==r._resetIsScrollingTimeoutId&&aU(r._resetIsScrollingTimeoutId),e=r._resetIsScrolling,t=aT(),r._resetIsScrollingTimeoutId=n={id:requestAnimationFrame(function r(){aT()-t>=150?e.call(null):n.id=requestAnimationFrame(r)})}},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,nf(t,e),t.getDerivedStateFromProps=function(e,t){return aH(e,t),y(e),null};var r=t.prototype;return r.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},r.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,n=r.itemCount,a=r.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var o=0;if(this._outerRef){var s=this._outerRef;o="vertical"===a?s.scrollWidth>s.clientWidth?aF():0:s.scrollHeight>s.clientHeight?aF():0}this.scrollTo(f(this.props,e,t,i,this._instanceProps,o))},r.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var a=this._outerRef;"horizontal"===t||"horizontal"===n?a.scrollLeft=r:a.scrollTop=r}this._callPropsCallbacks()},r.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,a=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(aV()){case"negative":i.scrollLeft=-a;break;case"positive-ascending":i.scrollLeft=a;break;default:var o=i.clientWidth,s=i.scrollWidth;i.scrollLeft=s-o-a}else i.scrollLeft=a;else i.scrollTop=a}this._callPropsCallbacks()},r.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&aU(this._resetIsScrollingTimeoutId)},r.render=function(){var e=this.props,t=e.children,r=e.className,n=e.direction,a=e.height,i=e.innerRef,o=e.innerElementType,s=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,f=void 0===d?az:d,p=e.layout,h=e.outerElementType,g=e.outerTagName,m=e.style,y=e.useIsScrolling,v=e.width,b=this.state.isScrolling,x="horizontal"===n||"horizontal"===p,S=x?this._onScrollHorizontal:this._onScrollVertical,w=this._getRangeToRender(),_=w[0],I=w[1],D=[];if(l>0)for(var O=_;O<=I;O++)D.push((0,to.createElement)(t,{data:u,key:f(O,u),index:O,isScrolling:y?b:void 0,style:this._getItemStyle(O)}));var k=c(this.props,this._instanceProps);return(0,to.createElement)(h||g||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:aR({position:"relative",height:a,width:v,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:n},m)},(0,to.createElement)(o||s||"div",{children:D,ref:i,style:{height:x?"100%":k,pointerEvents:b?"none":void 0,width:x?k:"100%"}}))},r._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],a=e[3];this._callOnItemsRendered(t,r,n,a)}if("function"==typeof this.props.onScroll){var i=this.state,o=i.scrollDirection,s=i.scrollOffset,l=i.scrollUpdateWasRequested;this._callOnScroll(o,s,l)}},r._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,a=n.isScrolling,i=n.scrollDirection,o=n.scrollOffset;if(0===t)return[0,0,0,0];var s=p(this.props,o,this._instanceProps),l=h(this.props,s,o,this._instanceProps);return[Math.max(0,s-(a&&"backward"!==i?1:Math.max(1,r))),Math.max(0,Math.min(t-1,l+(a&&"forward"!==i?1:Math.max(1,r)))),s,l]},t}(to.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},l),aK=I(2051),aJ=I.n(aK);let aZ={padding:"10px 0"},aQ={borderBottomWidth:"1px",...aZ},a0=e=>{let t,r,n,a,i,o,s,l,u,c=(0,ti.c)(28),{row:d,style:f,keyPrefix:p,onToggle:h}=e;c[0]!==h||c[1]!==d.areChildrenVisible?(t=()=>{h(!d.areChildrenVisible)},c[0]=h,c[1]=d.areChildrenVisible,c[2]=t):t=c[2];let g=t,m=d.children&&d.children.length>0||d.depth>0,y=8*(1+2*d.depth);return c[3]!==f?(r={...f,...aQ},c[3]=f,c[4]=r):r=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(n=ay()("hover:bg-primary/25 border-input text-foreground bg-background flex w-full flex-row items-center break-all text-base","leading-[20px]"),c[5]=n):n=c[5],c[6]!==g||c[7]!==m||c[8]!==h||c[9]!==y||c[10]!==d.areChildrenVisible?(a=m&&(0,tu.jsx)("div",{style:{paddingLeft:`${y}px`,opacity:+!!h},children:d.areChildrenVisible?(0,tu.jsx)("div",{className:"cursor-pointer p-1",onClick:g,children:(0,tu.jsx)(tl.Icons.ChevronDown,{})}):(0,tu.jsx)("div",{className:"cursor-pointer p-1",onClick:g,children:(0,tu.jsx)(tl.Icons.ChevronRight,{})})}),c[6]=g,c[7]=m,c[8]=h,c[9]=y,c[10]=d.areChildrenVisible,c[11]=a):a=c[11],c[12]!==d.tag?(i=(0,tu.jsx)("div",{className:"w-4/24 px-3",children:d.tag}),c[12]=d.tag,c[13]=i):i=c[13],c[14]!==d.valueRepresentation?(o=(0,tu.jsx)("div",{className:"w-2/24 px-3",children:d.valueRepresentation}),c[14]=d.valueRepresentation,c[15]=o):o=c[15],c[16]!==d.keyword?(s=(0,tu.jsx)("div",{className:"w-6/24 px-3",children:d.keyword}),c[16]=d.keyword,c[17]=s):s=c[17],c[18]!==d.value?(l=(0,tu.jsx)("div",{className:"w-5/24 grow px-3",children:d.value}),c[18]=d.value,c[19]=l):l=c[19],c[20]!==p||c[21]!==r||c[22]!==a||c[23]!==i||c[24]!==o||c[25]!==s||c[26]!==l?(u=(0,tu.jsxs)("div",{style:r,className:n,children:[a,i,o,s,l]},p),c[20]=p,c[21]=r,c[22]=a,c[23]=i,c[24]=o,c[25]=s,c[26]=l,c[27]=u):u=c[27],u};function a1(e){let t,r,n,a,i,o,s,l,u,c,d=(0,ti.c)(18),{tagRef:f,vrRef:p,keywordRef:h,valueRef:g}=e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=ay()("bg-popover ohif-scrollbar flex w-full flex-row overflow-y-scroll"),d[0]=t):t=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"Tag"}),d[1]=r):r=d[1],d[2]!==f?(n=(0,tu.jsx)("div",{className:"w-4/24 px-3",children:(0,tu.jsx)("label",{ref:f,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:r})}),d[2]=f,d[3]=n):n=d[3],d[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"VR"}),d[4]=a):a=d[4],d[5]!==p?(i=(0,tu.jsx)("div",{className:"w-2/24 px-3",children:(0,tu.jsx)("label",{ref:p,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:a})}),d[5]=p,d[6]=i):i=d[6],d[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"Keyword"}),d[7]=o):o=d[7],d[8]!==h?(s=(0,tu.jsx)("div",{className:"w-6/24 px-3",children:(0,tu.jsx)("label",{ref:h,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:o})}),d[8]=h,d[9]=s):s=d[9],d[10]===Symbol.for("react.memo_cache_sentinel")?(l=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"Value"}),d[10]=l):l=d[10],d[11]!==g?(u=(0,tu.jsx)("div",{className:"w-5/24 grow px-3",children:(0,tu.jsx)("label",{ref:g,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:l})}),d[11]=g,d[12]=u):u=d[12],d[13]!==n||d[14]!==i||d[15]!==s||d[16]!==u?(c=(0,tu.jsxs)("div",{className:t,style:aZ,children:[n,i,s,u]}),d[13]=n,d[14]=i,d[15]=s,d[16]=u,d[17]=c):c=d[17],c}function a2(e){return e.isVisible}let a3=to.memo(function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S=(0,ti.c)(35),{rows:w}=e,_=(0,to.useRef)(null),I=(0,to.useRef)(null),[D,O]=(0,to.useState)(null),[k,C]=(0,to.useState)(null),[j,E]=(0,to.useState)(null),[M,R]=(0,to.useState)(null),[P,A]=(0,to.useState)(w);S[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{e&&O(e)},S[0]=t):t=S[0];let N=t;S[1]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{e&&C(e)},S[1]=r):r=S[1];let T=r;S[2]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{e&&E(e)},S[2]=n):n=S[2];let U=n;S[3]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{e&&R(e)},S[3]=a):a=S[3];let L=a;S[4]!==w?(i=()=>{A(w)},o=[w],S[4]=w,S[5]=i,S[6]=o):(i=S[5],o=S[6]),(0,to.useEffect)(i,o),S[7]!==P?(s=P.filter(a2),S[7]=P,S[8]=s):s=S[8];let F=s;S[9]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{_?.current&&(_.current.scrollTo(0),_.current.resetAfterIndex(0))},S[9]=l):l=S[9],S[10]!==w?(u=[w],S[10]=w,S[11]=u):u=S[11],(0,to.useEffect)(l,u),S[12]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{let e=aJ()(()=>_.current.resetAfterIndex(0),100);return window.addEventListener("resize",e),()=>{e.cancel(),window.removeEventListener("resize",e)}},d=[],S[12]=c,S[13]=d):(c=S[12],d=S[13]),(0,to.useEffect)(c,d),S[14]!==j||S[15]!==D||S[16]!==M||S[17]!==k?(f=e=>t=>(function(e,t,r){if(!r||t.some(e=>!e))return 0;let n=t.map(e=>e.offsetWidth),a=r.getContext("2d");a.font=getComputedStyle(r).font;let i=["tag","valueRepresentation","keyword","value"];return Object.entries(e).filter(([e])=>i.includes(e)).map(([,e],t)=>20*Math.ceil(a.measureText(e).width/n[t])+20+1).reduce((e,t)=>Math.max(e,t),0)})(e[t],[D,k,j,M],I.current),S[14]=j,S[15]=D,S[16]=M,S[17]=k,S[18]=f):f=S[18];let B=f;S[19]!==P?(p=e=>{if(e.children)return t=>{A(P.map(r=>e.uid===r.uid?{...r,areChildrenVisible:t}:e.children.includes(r.uid)?{...r,isVisible:t,areChildrenVisible:t}:r)),_?.current?.resetAfterIndex(0)}},S[19]=P,S[20]=p):p=S[20];let V=p;S[21]!==V?(h=e=>{let{rows:t}=e;return function(e){let{index:r,style:n}=e,a=t[r];return(0,tu.jsx)(a0,{style:n,row:a,keyPrefix:`DICOMTagRow-${r}`,onToggle:V(a)})}},S[21]=V,S[22]=h):h=S[22];let z=h;S[23]!==D?(g=()=>null!==D,S[23]=D,S[24]=g):g=S[24];let H=g;return S[25]===Symbol.for("react.memo_cache_sentinel")?(m=(0,tu.jsx)("canvas",{style:{visibility:"hidden",position:"absolute"},className:"text-base",ref:I}),y=(0,tu.jsx)(a1,{tagRef:N,vrRef:T,keywordRef:U,valueRef:L}),S[25]=m,S[26]=y):(m=S[25],y=S[26]),S[27]===Symbol.for("react.memo_cache_sentinel")?(v={height:"32rem"},S[27]=v):v=S[27],S[28]!==B||S[29]!==z||S[30]!==H||S[31]!==F?(b=H()&&(0,tu.jsx)(aX,{ref:_,height:500,itemCount:F.length,itemSize:B(F),width:"100%",className:"ohif-scrollbar text-foreground",children:z({rows:F})}),S[28]=B,S[29]=z,S[30]=H,S[31]=F,S[32]=b):b=S[32],S[33]!==b?(x=(0,tu.jsxs)("div",{children:[m,y,(0,tu.jsx)("div",{className:"border-background bg-background relative m-auto border-2",style:v,children:b})]}),S[33]=b,S[34]=x):x=S[34],x}),a4=0,a5=()=>`row_${++a4}`,{ImageSet:a8}=K.classes,{DicomMetaDictionary:a6}=es().data,{nameMap:a9}=a6;function a7(e){e.sort((e,t)=>e.tag<t.tag?-1:1)}let ie=e=>{let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x=(0,ti.c)(51),{displaySets:S,displaySetInstanceUID:w}=e,[_,I]=(0,to.useState)(w),[D,O]=(0,to.useState)(1),[k,C]=(0,to.useState)("");x[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{I(e.value),O(1)},x[0]=t):t=x[0];let j=t;if(x[1]!==S||x[2]!==_){let e;x[4]!==_?(e=e=>e.displaySetInstanceUID===_,x[4]=_,x[5]=e):e=x[5],r=S.find(e),x[1]=S,x[2]=_,x[3]=r}else r=x[3];let E=r;S.sort(it),x[6]!==S?(n=S.map(ir),x[6]=S,x[7]=n):n=x[7];let M=n;x[8]!==E||x[9]!==D?(a=e=>e?E.images[D-1]:E.instance||E,x[8]=E,x[9]=D,x[10]=a):a=x[10];let R=a,P=E instanceof a8&&E.images.length>1,A=E instanceof a8;if(x[11]!==R||x[12]!==A){let e,t=R(A);i=function({tags:e,metadata:t}){let r=[],n=[{tags:e,depth:0,parents:null,index:0,children:[]}],a=new Map;for(;n.length>0;){let{tags:e,depth:i,parents:o,index:s,children:l}=n.pop();for(let u=s;u<e.length;u++){let s=e[u],c=s.uid??a5();if(o?.length>0&&o.forEach(e=>{a.get(e).push(c)}),"SQ"===s.vr){let t={uid:c,tag:s.tag,valueRepresentation:s.vr,keyword:s.keyword,value:"",depth:i,isVisible:!0,areChildrenVisible:!0,children:[],parents:o};r.push(t),a.set(c,t.children);let d=o?[...o,c]:[c];if(s.values.length>0){n.push({tags:e,depth:i,parents:o,index:u+1,children:l});for(let e=s.values.length-1,t=s.values[e];e>=0;t=s.values[--e]){let r=a5();n.push({tags:t,depth:i+2,parents:[...d,r],index:0,children:[]});let o={tags:[{tag:"(FFFE,E000)",vr:"",keyword:`Item #${e}`,value:"",uid:r}],depth:i+1,parents:d,index:0,children:[]};n.push(o),a.set(r,o.children)}break}}else{if("xs"===s.vr)try{let e=t[es().data.Tag.fromPString(s.tag).toCleanString()];s.vr=e.vr}catch(e){console.warn(`Failed to parse value representation for tag '${s.keyword}'`)}let e={uid:c,tag:s.tag,valueRepresentation:s.vr,keyword:s.keyword,value:s.value,depth:i,isVisible:!0,parents:o};r.push(e),"(FFFE,E000)"===e.tag&&(e.areChildrenVisible=!0,e.children=[])}}}return r}({tags:(e=function e(t,r=0){if(!t)return[];let n=Object.keys(t),a=[];for(let o=0;o<n.length;o++){let s=n[o];if("_vrMap"===s)continue;let l=a9[s],u=t[s];if(l&&"SQ"===l.vr){var i;let t=Array.isArray(i=u)?i:[i],n={tag:l.tag,vr:l.vr,keyword:s,values:[]};if(a.push(n),null===u)continue;t.forEach(t=>{let a=e(t,r+1);a.length&&(a7(a),n.values.push(a))});continue}if(Array.isArray(u)&&u.length>0&&"object"!=typeof u[0]&&(u=u.join("\\")),"number"==typeof u&&(u=u.toString()),"string"!=typeof u&&(null===u?u=" ":"object"==typeof u?u.InlineBinary?u="Inline Binary":u.BulkDataURI?u="Bulk Data URI":u.Alphabetic?u=u.Alphabetic:(console.warn(`Unrecognised Value: ${u} for ${s}:`),console.warn(u),u=" "):(console.warn(`Unrecognised Value: ${u} for ${s}:`),u=" ")),s=s.replace("RETIRED_",""),l)a.push({tag:l.tag,vr:l.vr,keyword:s,value:u});else{let e=/[0-9A-Fa-f]{6}/g;if(s.match(e)){let e=`(${s.substring(0,4)},${s.substring(4,8)})`;a.push({tag:e,vr:"",keyword:"Private Tag",value:u})}}}return a}(t),a7(e),e),metadata:t}),x[11]=R,x[12]=A,x[13]=i}else i=x[13];let N=i;t:{let e,t;if(!k){o=N;break t}if(x[14]!==k||x[15]!==N){e=new Set;let t=["tag","valueRepresentation","keyword","value"],r=k.toLowerCase();N.forEach(n=>{t.some(e=>n[e]?.toLowerCase().includes(r))&&(e.add(n.uid),[...n.parents??[],...n.children??[]].forEach(t=>e.add(t)))}),x[14]=k,x[15]=N,x[16]=e}else e=x[16];if(x[17]!==e||x[18]!==N){let r;x[20]!==e?(r=t=>e.has(t.uid),x[20]=e,x[21]=r):r=x[21],t=N.filter(r),x[17]=e,x[18]=N,x[19]=t}else t=x[19];o=t}let T=o;return x[22]===Symbol.for("react.memo_cache_sentinel")?(s=(0,tu.jsx)("span",{className:"text-muted-foreground flex h-6 items-center pb-2 text-base",children:"Series"}),x[22]=s):s=x[22],x[23]===Symbol.for("react.memo_cache_sentinel")?(l=e=>j({value:e}),x[23]=l):l=x[23],x[24]!==M||x[25]!==_?(u=M.find(e=>e.value===_)?.label||"Select Series",x[24]=M,x[25]=_,x[26]=u):u=x[26],x[27]!==u?(c=(0,tu.jsx)(tl.SelectTrigger,{"data-cy":"dicom-tag-series-select-trigger",children:(0,tu.jsx)(tl.SelectValue,{"data-cy":"dicom-tag-series-select-value",children:u})}),x[27]=u,x[28]=c):c=x[28],x[29]!==M?(d=M.map(ia),x[29]=M,x[30]=d):d=x[30],x[31]!==d?(f=(0,tu.jsx)(tl.SelectContent,{children:d}),x[31]=d,x[32]=f):f=x[32],x[33]!==_||x[34]!==c||x[35]!==f?(p=(0,tu.jsxs)("div",{className:"flex w-1/3 flex-col",children:[s,(0,tu.jsxs)(tl.Select,{value:_,onValueChange:l,children:[c,f]})]}),x[33]=_,x[34]=c,x[35]=f,x[36]=p):p=x[36],x[37]!==E.images?.length||x[38]!==D||x[39]!==P?(h=P&&(0,tu.jsxs)("div",{className:"mx-auto mt-0.5 flex w-1/4 flex-col",children:[(0,tu.jsxs)("span",{className:"text-muted-foreground flex h-6 min-w-0 items-center whitespace-nowrap pb-2 text-base",children:[(0,tu.jsx)("span",{className:"truncate",children:"Instance Number"}),(0,tu.jsxs)("span",{className:"shrink-0",children:[" (",D," of ",E?.images?.length,")"]})]}),(0,tu.jsx)(tl.Slider,{value:[D],onValueChange:e=>{let[t]=e;O(t)},min:1,max:E?.images?.length,step:1,className:"pt-3"})]}),x[37]=E.images?.length,x[38]=D,x[39]=P,x[40]=h):h=x[40],x[41]===Symbol.for("react.memo_cache_sentinel")?(g=(0,tu.jsx)("span",{className:"text-muted-foreground flex h-6 items-center pb-2 text-base",children:"Search metadata"}),x[41]=g):g=x[41],x[42]===Symbol.for("react.memo_cache_sentinel")?(m=(0,tu.jsxs)("div",{className:"ml-auto mr-1 flex w-1/3 flex-col",children:[g,(0,tu.jsxs)(tl.InputFilter,{className:"text-muted-foreground",onChange:C,children:[(0,tu.jsx)(tl.InputFilter.SearchIcon,{}),(0,tu.jsx)(tl.InputFilter.Input,{placeholder:"Search metadata",className:"pl-9 pr-9"}),(0,tu.jsx)(tl.InputFilter.ClearButton,{className:"text-primary mr-0.5 p-0.5"})]})]}),x[42]=m):m=x[42],x[43]!==p||x[44]!==h?(y=(0,tu.jsx)("div",{className:"mb-6 flex flex-row items-start pl-1",children:(0,tu.jsxs)("div",{className:"flex w-full flex-row items-start gap-6",children:[p,h,m]})}),x[43]=p,x[44]=h,x[45]=y):y=x[45],x[46]!==T?(v=(0,tu.jsx)(a3,{rows:T}),x[46]=T,x[47]=v):v=x[47],x[48]!==y||x[49]!==v?(b=(0,tu.jsxs)("div",{className:"dicom-tag-browser-content bg-muted",children:[y,v]}),x[48]=y,x[49]=v,x[50]=b):b=x[50],b};function it(e,t){return e.SeriesNumber-t.SeriesNumber}function ir(e){let{displaySetInstanceUID:t,SeriesDate:r,SeriesTime:n,SeriesNumber:a,SeriesDescription:i,Modality:o}=e,s=`${r}:${n}`.split(".")[0];return{value:t,label:`${a} (${o}): ${i}`,description:aM()(s,"YYYYMMDD:HHmmss").format("ddd, MMM Do YYYY")}}function ia(e){return(0,tu.jsxs)(tl.SelectItem,{value:e.value,children:[e.label,(0,tu.jsx)("span",{className:"text-muted-foreground ml-1 text-xs",children:e.description})]},e.value)}let ii=e=>{let t,r=new Set,n=(e,n)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,i={setState:n,getState:a,getInitialState:()=>o,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},o=t=e(n,a,i);return i};var io=I(4413);let{useDebugValue:is}=to,{useSyncExternalStoreWithSelector:il}=io,iu=!1,ic=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t="function"==typeof e?e?ii(e):ii:e,r=(e,r)=>(function(e,t=e=>e,r){r&&!iu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),iu=!0);let n=il(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return is(n),n})(t,e,r);return Object.assign(r,t),r},id=e=>e?ic(e):ic,ip=new Map,ih=id()(e=>({type:"viewportGridId",viewportGridState:{},setViewportGridState:(t,r)=>e(e=>({viewportGridState:{...e.viewportGridState,[t]:r}}),!1,"setViewportGridState"),clearViewportGridState:()=>e({viewportGridState:{}},!1,"clearViewportGridState")})),ig=id()(e=>({type:"displaySetSelectorId",displaySetSelectorMap:{},setDisplaySetSelector:(t,r)=>e(e=>({displaySetSelectorMap:{...e.displaySetSelectorMap,[t]:r}}),!1,"setDisplaySetSelector"),clearDisplaySetSelectorMap:()=>e({displaySetSelectorMap:{}},!1,"clearDisplaySetSelectorMap")})),im=id()(e=>({hangingProtocolStageIndexMap:{},type:"hangingProtocolStageIndexId",setHangingProtocolStageIndex:(t,r)=>e(e=>({hangingProtocolStageIndexMap:{...e.hangingProtocolStageIndexMap,[t]:r}}),!1,"setHangingProtocolStageIndex"),clearHangingProtocolStageIndexMap:()=>e({hangingProtocolStageIndexMap:{}},!1,"clearHangingProtocolStageIndexMap")}));var iy=I(4669);let iv=["SEG","RTSTRUCT"],ib=id()(e=>({type:"viewportsByPositionId",viewportsByPosition:{},initialInDisplay:[],setViewportsByPosition:(t,r)=>e(e=>({viewportsByPosition:{...e.viewportsByPosition,[t]:r}}),!1,"setViewportsByPosition"),clearViewportsByPosition:()=>e({viewportsByPosition:{}},!1,"clearViewportsByPosition"),addInitialInDisplay:t=>e(e=>({initialInDisplay:[...e.initialInDisplay,t]}),!1,"addInitialInDisplay")})),ix=(e,t,r,n,a,i)=>{let o=r?.[a];if(o)return{...o};let{protocolId:s,stageIndex:l}=e.getState();i.inDisplay||(i.inDisplay=[...r.initialInDisplay]);let u=e.getMissingViewport(t?s:"default",l,i);if(u){let e=u.displaySetsInfo.map(e=>e.displaySetInstanceUID);return i.inDisplay.push(...e),{displaySetInstanceUIDs:e,displaySetOptions:u.displaySetsInfo.map(e=>e.displaySetOptions),viewportOptions:{...u.viewportOptions}}}return{}},iS=id()(e=>({toggleHangingProtocol:{},type:"toggleHangingProtocolId",setToggleHangingProtocol:(t,r)=>e(e=>({toggleHangingProtocol:{...e.toggleHangingProtocol,[t]:r}}),!1,"setToggleHangingProtocol"),clearToggleHangingProtocol:()=>e({toggleHangingProtocol:{}},!1,"clearToggleHangingProtocol")})),iw=id(e=>({toggleOneUpViewportGridStore:null,type:"toggleOneUpViewportGridId",setToggleOneUpViewportGridStore:t=>e({toggleOneUpViewportGridStore:t}),clearToggleOneUpViewportGridStore:()=>e({toggleOneUpViewportGridStore:null})})),i_=async function({servicesManager:e,getReport:t,reportType:r="Measurements",successMessage:n}){let{displaySetService:a,uiNotificationService:i,uiDialogService:o}=e.services;try{if(!await t())return;let e=a.getMostRecentDisplaySet().displaySetInstanceUID;return i.show({title:"Create Report",message:n??`${r} saved successfully`,type:"success"}),[e]}catch(e){throw i.show({title:"Create Report",message:e.message||`Failed to store ${r}`,type:"error"}),Error(`Failed to store ${r}. Error: ${e.message||"Unknown error"}`)}finally{o.hide("loading-dialog")}},{filterAnd:iI,filterMeasurementsByStudyUID:iD,filterMeasurementsBySeriesUID:iO}=K.utils.MeasurementFilters,ik=async function e({servicesManager:t,commandsManager:r,extensionManager:n},a,i){let o,{measurementService:s,displaySetService:l}=t.services,u=void 0===i.viewportId?i.data.viewportId:i.viewportId,c=void 0===i.isBackupSave?i.data.isBackupSave:i.isBackupSave,d=i?.data?.StudyInstanceUID||a.trackedStudy,f=i?.data?.SeriesInstanceUID,{displaySetInstanceUID:p}=i.data??i,{trackedSeries:h,measurementFilter:g=iI(iD(d),iO(h)),defaultSaveTitle:m="Save Measurements",defaultSeriesDescription:y="Measurements"}=a,v=s.getMeasurements(g),b=function(e){let t;for(let r of e){if(t&&r.predecessorImageId&&r.predecessorImageId!==t)return void console.warn("Found multiple source predecessors, not defaulting to same series");t||=r.predecessorImageId}return t}(v);try{let e=await ns({title:m,predecessorImageId:b,defaultSeriesDescription:y,minSeriesNumber:3e3,extensionManager:n,servicesManager:t,enableDownload:!0});if(1===e.action){let{series:n,seriesNumber:a,value:i,dataSourceName:s}=e,u=i||y,c=async()=>r.runCommand("storeMeasurements",{measurementData:v,dataSource:s,additionalFindingTypes:["ArrowAnnotate"],options:{SeriesDescription:u,SeriesNumber:a,predecessorImageId:n}},"CORNERSTONE_STRUCTURED_REPORT");o=await i_({servicesManager:t,getReport:c});let d=o?.length?l.getDisplaySetByUID(o[0]):void 0;d?.predecessorImageId&&r.runCommand("recordMeasurementsPredecessor",{measurements:v,predecessorImageId:d.predecessorImageId})}else e.action;return{userResponse:e.action,createdDisplaySetInstanceUIDs:o,StudyInstanceUID:d,SeriesInstanceUID:f,viewportId:u,isBackupSave:c,displaySetInstanceUID:p}}catch(e){return console.warn("Unable to save report",e),null}},{downloadBlob:iC}=K.utils,ij={toolGroupId:"default",allowUnmatchedView:!0,syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0,options:{matchingRules:["sameFOR"]}}]},iE={id:"@ohif/mnGrid",description:"Has various hanging protocol grid layouts",name:"2x2",protocolMatchingRules:[{id:"OneOrMoreSeries",weight:25,attribute:"numberOfDisplaySetsWithImages",constraint:{greaterThan:0}}],toolGroupIds:["default"],displaySetSelectors:{defaultDisplaySetId:{allowUnmatchedView:!0,seriesMatchingRules:[{attribute:"numImageFrames",constraint:{greaterThan:{value:0}},weight:1,required:!0},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0,options:{matchingRules:["sameFOR"]}}]},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},stages:[{id:"2x2",name:"2x2",stageActivation:{enabled:{minViewportsMatched:4}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:2}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:2,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:3,id:"defaultDisplaySetId"}]}]},{name:"3x1",stageActivation:{enabled:{minViewportsMatched:3}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:3}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:1}]},{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:2}]}]},{name:"2x1",stageActivation:{enabled:{minViewportsMatched:2}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:2}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]}]},{name:"1x1",stageActivation:{enabled:{minViewportsMatched:1}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]}]}],numberOfPriorsReferenced:-1},iM={...iE,id:"@ohif/mnGrid8",description:"Has various hanging protocol grid layouts up to 4x2",name:"4x2",stages:[{id:"4x2",name:"4x2",stageActivation:{enabled:{minViewportsMatched:7}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:4}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:2,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:3,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:4,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:5,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:6,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:7,id:"defaultDisplaySetId"}]}]},{id:"3x2",name:"3x2",stageActivation:{enabled:{minViewportsMatched:5}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:3}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:2,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:3,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:4,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:5,id:"defaultDisplaySetId"}]}]},...iE.stages]},iR={id:"defaultDisplaySetId"},iP={id:"priorDisplaySetId"},iA={viewportOptions:{toolGroupId:"default",allowUnmatchedView:!0},displaySets:[iR]},iN={...iA,displaySets:[{...iR,matchedDisplaySetsIndex:1}]},iT={...iA,displaySets:[iP]},iU={...iT,displaySets:[{...iP,matchedDisplaySetsIndex:1}]},iL={id:"@ohif/hpCompare",description:nB.t("Hps:Compare two studies in various layouts"),name:nB.t("Hps:Compare Two Studies"),numberOfPriorsReferenced:1,protocolMatchingRules:[{id:"Two Studies",weight:1e3,attribute:"StudyInstanceUID",from:"prior",required:!0,constraint:{notNull:!0}}],toolGroupIds:["default"],displaySetSelectors:{defaultDisplaySetId:{studyMatchingRules:[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:0}}}],seriesMatchingRules:[{attribute:"numImageFrames",constraint:{greaterThan:{value:0}}},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]},priorDisplaySetId:{studyMatchingRules:[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:1}}}],seriesMatchingRules:[{attribute:"numImageFrames",constraint:{greaterThan:{value:0}}},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",allowUnmatchedView:!0},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},stages:[{name:"2x2",stageActivation:{enabled:{minViewportsMatched:4}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:2}},viewports:[iA,iT,iN,iU]},{name:"2x1",stageActivation:{enabled:{minViewportsMatched:2}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:2}},viewports:[iA,iT]}]},iF=[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:1}}}],iB=[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:0}}}],iV=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399162004"}},{weight:5,attribute:"PatientOrientation",constraint:{contains:"L"}},{weight:20,attribute:"SeriesDescription",constraint:{contains:"L CC"}}],iz=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399162004"}},{weight:5,attribute:"PatientOrientation",constraint:{equals:["P","L"]}},{attribute:"PatientOrientation",constraint:{doesNotEqual:["A","R"]},required:!0},{weight:20,attribute:"SeriesDescription",constraint:{contains:"CC"}}],iH=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399368009"}},{weight:0,attribute:"ViewCode",constraint:{doesNotEqual:"SCT:399162004"},required:!0},{weight:5,attribute:"PatientOrientation",constraint:{equals:["A","R"]}},{weight:20,attribute:"SeriesDescription",constraint:{contains:"L MLO"}}],iW=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399368009"}},{attribute:"ViewCode",constraint:{doesNotEqual:"SCT:399162004"},required:!0},{attribute:"PatientOrientation",constraint:{doesNotContain:["P","FL"]},required:!0},{weight:5,attribute:"PatientOrientation",constraint:{equals:["P","L"]}},{weight:5,attribute:"PatientOrientation",constraint:{equals:["A","FR"]}},{weight:20,attribute:"SeriesDescription",constraint:{contains:"R MLO"}},{attribute:"SeriesDescription",required:!0,constraint:{doesNotContain:"CC"}},{attribute:"SeriesDescription",required:!0,constraint:{doesNotEqual:"L MLO"},required:!0}],i$={storeAsInitialCamera:!0,imageArea:[.8,.8],imageCanvasPoint:{imagePoint:[0,.5],canvasPoint:[0,.5]}},iY={storeAsInitialCamera:!0,imageArea:[.8,.8],imageCanvasPoint:{imagePoint:[1,.5],canvasPoint:[1,.5]}},iG={id:"@ohif/hpMammo",hasUpdatedPriorsInformation:!1,name:nB.t("Hps:Mammography Breast Screening"),protocolMatchingRules:[{id:"Mammography",weight:150,attribute:"ModalitiesInStudy",constraint:{contains:"MG"},required:!0},{id:"numberOfImages",attribute:"numberOfDisplaySetsWithImages",constraint:{greaterThan:2},required:!0}],toolGroupIds:["default"],displaySetSelectors:{RCC:{seriesMatchingRules:iz,studyMatchingRules:iB},LCC:{seriesMatchingRules:iV,studyMatchingRules:iB},RMLO:{seriesMatchingRules:iW,studyMatchingRules:iB},LMLO:{seriesMatchingRules:iH,studyMatchingRules:iB},RCCPrior:{seriesMatchingRules:iz,studyMatchingRules:iF},LCCPrior:{seriesMatchingRules:iV,studyMatchingRules:iF},RMLOPrior:{seriesMatchingRules:iW,studyMatchingRules:iF},LMLOPrior:{seriesMatchingRules:iH,studyMatchingRules:iF}},stages:[{name:"CC/MLO",viewportStructure:{type:"grid",layoutType:"grid",properties:{rows:2,columns:2}},viewports:[{viewportOptions:{toolGroupId:"default",displayArea:iY,allowUnmatchedView:!0},displaySets:[{id:"RCC"}]},{viewportOptions:{toolGroupId:"default",displayArea:i$,allowUnmatchedView:!0},displaySets:[{id:"LCC"}]},{viewportOptions:{toolGroupId:"default",displayArea:iY,allowUnmatchedView:!0},displaySets:[{id:"RMLO"}]},{viewportOptions:{toolGroupId:"default",displayArea:i$,allowUnmatchedView:!0},displaySets:[{id:"LMLO"}]}]},{name:"CC compare",viewportStructure:{type:"grid",layoutType:"grid",properties:{rows:2,columns:2}},viewports:[{viewportOptions:{toolGroupId:"default",displayArea:iY,flipHorizontal:!0,rotation:180},displaySets:[{id:"RCC"}]},{viewportOptions:{toolGroupId:"default",flipHorizontal:!0,displayArea:i$},displaySets:[{id:"LCC"}]},{viewportOptions:{toolGroupId:"default",displayArea:iY,flipHorizontal:!0},displaySets:[{id:"RCCPrior"}]},{viewportOptions:{toolGroupId:"default",displayArea:i$},displaySets:[{id:"LCCPrior"}]}]}],numberOfPriorsReferenced:0},iq={type:"SCALE",scale:1,storeAsInitialCamera:!0},iX={...iq,scale:15},iK={id:"@ohif/hpScale",description:"Has various hanging protocol grid layouts",name:"Scale Images",protocolMatchingRules:[{id:"OneOrMoreSeries",weight:25,attribute:"numberOfDisplaySetsWithImages",constraint:{greaterThan:0}}],toolGroupIds:["default"],displaySetSelectors:{defaultDisplaySetId:{seriesMatchingRules:[{weight:1,attribute:"numImageFrames",constraint:{greaterThan:{value:0}},required:!0},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",displayArea:iq,allowUnmatchedView:!0},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},stages:[{name:"Scale 1:1",stageActivation:{enabled:{minViewportsMatched:1}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:{toolGroupId:"default",allowUnmatchedView:!0,displayArea:iq},displaySets:[{id:"defaultDisplaySetId"}]}]},{name:"Scale 1:15",stageActivation:{enabled:{minViewportsMatched:1}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:{toolGroupId:"default",allowUnmatchedView:!0,displayArea:iX},displaySets:[{id:"defaultDisplaySetId"}]}]}],numberOfPriorsReferenced:-1},iJ={id:"default",locked:!0,name:"Default",createdDate:"2021-02-23T19:22:08.894Z",modifiedDate:"2023-04-01",availableTo:{},editableBy:{},protocolMatchingRules:[],toolGroupIds:["default"],numberOfPriorsReferenced:0,defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",allowUnmatchedView:!0,syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0,options:{matchingRules:["sameFOR"]}}]},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},displaySetSelectors:{defaultDisplaySetId:{seriesMatchingRules:[{weight:10,attribute:"numImageFrames",constraint:{greaterThan:{value:0}}},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},stages:[{name:"default",viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:{viewportType:"stack",viewportId:"default",toolGroupId:"default",initialImageOptions:{custom:"sopInstanceLocation"},syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0}]},displaySets:[{id:"defaultDisplaySetId"}]}],createdDate:"2021-02-23T18:32:42.850Z"}]},iZ={measurementsContextMenu:{inheritsFrom:"ohif.contextMenu",menus:[{id:"forExistingMeasurement",selector:({nearbyToolData:e})=>!!e,items:[{label:"Delete measurement",commands:"removeMeasurement"},{label:"Add Label",commands:"setMeasurementLabel"}]}]}},iQ={"routes.customRoutes":{routes:{$push:[{path:"/custom",children:()=>(0,tu.jsx)("h1",{style:{color:"white"},children:"Hello Custom Route"})}]}}};function i0(e){return"dicomjson"!==e.sourceName&&"dicomlocal"!==e.sourceName}let i1={"routes.customRoutes":{routes:{$push:[{path:"/datasources",children:function(){let e,t,r,n,a=(0,ti.c)(9),[i]=tf(),o=tk(),s=i.dataSources;if(a[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:"100%",height:"100%"},a[0]=e):e=a[0],a[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,tu.jsx)("img",{className:"mx-auto block h-14",src:"./ohif-logo.svg",alt:"OHIF"}),a[1]=t):t=a[1],a[2]!==s||a[3]!==o){let e;a[5]!==o?(e=e=>(0,tu.jsxs)("div",{children:[(0,tu.jsx)("h1",{className:"text-foreground",children:e.configuration?.friendlyName||e.friendlyName}),(0,tu.jsx)(tl.Button,{variant:"secondary",className:ay()("ml-2","mt-1"),onClick:()=>{o({pathname:"/",search:`datasources=${e.sourceName}`})},children:e.sourceName}),(0,tu.jsx)("br",{})]},e.sourceName),a[5]=o,a[6]=e):e=a[6],r=s.filter(i0).map(e),a[2]=s,a[3]=o,a[4]=r}else r=a[4];return a[7]!==r?(n=(0,tu.jsx)("div",{style:e,children:(0,tu.jsx)("div",{className:"flex h-screen w-screen items-center justify-center",children:(0,tu.jsxs)("div",{className:"bg-popover mx-auto space-y-2 rounded-lg py-8 px-8 drop-shadow-md",children:[t,(0,tu.jsx)("div",{className:"space-y-2 pt-4 text-center",children:r})]})})}),a[7]=r,a[8]=n):n=a[8],n}}]}}},i2={"studyBrowser.studyMenuItems":{$push:[{id:"applyHangingProtocol",label:"Apply Hanging Protocol",iconName:"ViewportViews",items:[{id:"applyDefaultProtocol",label:"Default",commands:["loadStudy",{commandName:"setHangingProtocol",commandOptions:{protocolId:"default"}}]},{id:"applyMPRProtocol",label:"2x2 Grid",commands:["loadStudy",{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid"}}]}]},{id:"showInOtherMonitor",label:"Launch On Second Monitor",iconName:"DicomTagBrowser",selector:({servicesManager:e})=>{let{multiMonitorService:t}=e.services;return t.isMultimonitor},commands:{commandName:"multimonitor",commandOptions:{hashParams:"&hangingProtocolId=@ohif/mnGrid8",commands:["loadStudy",{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid8"}}]}}}]}},i3={"routes.customRoutes":{routes:[],notFoundRoute:null}},{formatDate:i4}=K.utils,i5={"studyBrowser.studyMenuItems":[],"studyBrowser.thumbnailMenuItems":[{id:"tagBrowser",label:nz().t("StudyBrowser:Tag Browser"),iconName:"DicomTagBrowser",commands:"openDICOMTagViewer"},{id:"addAsLayer",label:nz().t("StudyBrowser:Add as Layer"),iconName:"ViewportViews",commands:"addDisplaySetAsLayer"}],"studyBrowser.sortFunctions":[{label:nz().t("StudyBrowser:Series Number"),sortFunction:(e,t)=>e?.SeriesNumber-t?.SeriesNumber},{label:nz().t("StudyBrowser:Series Date"),sortFunction:(e,t)=>{let r=new Date(i4(e?.SeriesDate));return new Date(i4(t?.SeriesDate)).getTime()-r.getTime()}}],"studyBrowser.viewPresets":[{id:"list",iconName:"ListView",selected:!1},{id:"thumbnails",iconName:"ThumbnailView",selected:!0}],"studyBrowser.studyMode":"all","studyBrowser.thumbnailDoubleClickCallback":{callbacks:[({activeViewportId:e,servicesManager:t,commandsManager:r,isHangingProtocolLayout:n})=>async a=>{let{hangingProtocolService:i,uiNotificationService:o}=t.services,s=[];try{s=i.getViewportsRequireUpdate(e,a,n)}catch(e){console.warn(e),o.show({title:nz().t("StudyBrowser:Thumbnail Double Click"),message:nz().t("StudyBrowser:The selected display sets could not be added to the viewport."),type:"error",duration:3e3})}r.run("setDisplaySetsForViewports",{viewportsToUpdate:s})}]}},{getLatestInstanceDateTime:i8}=K.utils,i6={"studyBrowser.thumbnailDetailSources":{seriesNumber:({displaySet:e})=>e?.SeriesNumber,numInstances:({displaySet:e})=>(e?.numImageFrames??e?.instances?.length)||1,seriesDate:({displaySet:e,formatters:t})=>t.formatDate(e?.SeriesDate),instanceDateTime:({displaySet:e,instance:t,formatters:r})=>{let{SeriesDate:n,SeriesTime:a}=i8(t??e);if(!n)return"";let i=r.formatDate(n);return a?`${i} ${r.formatTime(a,"HH:mm")}`:i}},"studyBrowser.thumbnailDetailTests":{isDerivedDisplaySet:({displaySet:e})=>!!e?.isDerivedDisplaySet},"studyBrowser.thumbnailDetails":[{id:"SeriesNumber",label:"S:",source:"seriesNumber"},{id:"InstanceCount",source:"numInstances",iconName:({displaySet:e})=>e?.countIcon||"InfoSeries"}]},i9={"ohif.overlayItem":function(e){if(this.condition&&!this.condition(e))return null;let{instance:t}=e,r=t&&this.attribute?t[this.attribute]:this.contentF&&"function"==typeof this.contentF?this.contentF(e):null,n=K.utils.formatValue(r);return n?(0,tu.jsxs)("span",{className:"overlay-item flex flex-row",style:{color:this.color||void 0},title:this.title||"",children:[this.label&&(0,tu.jsx)("span",{className:"mr-1 shrink-0",children:this.label}),(0,tu.jsx)("span",{className:"font-light",children:n})]}):null}},i7={"ohif.contextMenu":{$transform:function(e){let t={...this};for(let r of(t.menus=this.menus.map(e=>({...e})),t.menus)){let{items:t}=r;for(let n of(r.items=[],t))r.items.push(e.transform(n))}return t}}},oe={"ui.contextMenu":tl.ContextMenuViewport},ot={"ohif.menuContent":function(e){let{item:t,commandsManager:r,servicesManager:n,...a}=e,i=function(e){let{item:t}=e,i=t.selector&&!t.selector({servicesManager:n});return(0,tu.jsxs)(tl.DropdownMenuItem,{disabled:i,onSelect:()=>{r.runAsync(t.commands,{...t.commandOptions,...a})},className:"gap-[6px]",children:[t.iconName&&(0,tu.jsx)(tl.Icons.ByName,{name:t.iconName,className:"-ml-1"}),t.label]})};return t.items?(0,tu.jsxs)(tl.DropdownMenuSub,{children:[(0,tu.jsxs)(tl.DropdownMenuSubTrigger,{className:"gap-[6px]",children:[t.iconName&&(0,tu.jsx)(tl.Icons.ByName,{name:t.iconName,className:"-ml-1"}),t.label]}),(0,tu.jsx)(tl.DropdownMenuPortal,{children:(0,tu.jsx)(tl.DropdownMenuSubContent,{children:t.items.map(t=>i({...e,item:t}))})})]}):i({...e,item:t})}},or=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(32),{itemLabel:g,itemList:m,onItemClicked:y}=e,{servicesManager:v}=(0,K.useSystem)(),{t:b}=tQ("DataSourceConfiguration"),[x,S]=(0,to.useState)("");h[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{S("")},h[0]=t):t=h[0],h[1]!==m?(r=[m],h[1]=m,h[2]=r):r=h[2],(0,to.useEffect)(t,r),h[3]!==v.services.customizationService?(n=v.services.customizationService.getCustomization("ui.loadingIndicatorProgress"),h[3]=v.services.customizationService,h[4]=n):n=h[4];let w=n,_=`Select ${g}`;h[5]!==b||h[6]!==_?(a=b(_),h[5]=b,h[6]=_,h[7]=a):a=h[7],h[8]!==a?(i=(0,tu.jsx)("div",{className:"text-highlight text-xl",children:a}),h[8]=a,h[9]=i):i=h[9],h[10]===Symbol.for("react.memo_cache_sentinel")?(o=(0,tu.jsx)(tl.InputFilter.SearchIcon,{}),h[10]=o):o=h[10];let I=`Search ${g} list`;return h[11]!==b||h[12]!==I?(s=b(I),h[11]=b,h[12]=I,h[13]=s):s=h[13],h[14]!==s?(l=(0,tu.jsx)(tl.InputFilter.Input,{placeholder:s,className:"pl-8 pr-9"}),h[14]=s,h[15]=l):l=h[15],h[16]===Symbol.for("react.memo_cache_sentinel")?(u=(0,tu.jsx)(tl.InputFilter.ClearButton,{className:"text-primary mr-0.5 p-0.5"}),h[16]=u):u=h[16],h[17]!==l?(c=(0,tu.jsxs)(tl.InputFilter,{className:"max-w-[40%] grow",onChange:S,children:[o,l,u]}),h[17]=l,h[18]=c):c=h[18],h[19]!==c||h[20]!==i?(d=(0,tu.jsxs)("div",{className:"flex items-center justify-between",children:[i,c]}),h[19]=c,h[20]=i,h[21]=d):d=h[21],h[22]!==w||h[23]!==x||h[24]!==g||h[25]!==m||h[26]!==y||h[27]!==b?(f=(0,tu.jsx)("div",{className:"relative flex min-h-[1px] grow flex-col bg-background text-[14px]",children:null==m?(0,tu.jsx)(w,{className:"h-full w-full"}):0===m.length?(0,tu.jsxs)("div",{className:"text-highlight flex h-full flex-col items-center justify-center px-6 py-4",children:[(0,tu.jsx)(tl.Icons.ToolMagnify,{className:"mb-4"}),(0,tu.jsx)("span",{children:b(`No ${g} available`)})]}):(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)("div",{className:"bg-popover text-foreground px-3 py-1.5",children:b(g)}),(0,tu.jsx)("div",{className:"ohif-scrollbar overflow-auto",children:m.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>(0,tu.jsxs)("div",{className:ay()("hover:text-highlight hover:bg-muted group mx-2 flex items-center justify-between px-6 py-2","rounded border-transparent border-b-input border-[1px]"),children:[(0,tu.jsx)("div",{className:"text-muted-foreground",children:e.name}),(0,tu.jsxs)(tl.Button,{onClick:()=>y(e),className:"invisible group-hover:visible",variant:"default",size:"sm",children:[b("Select"),(0,tu.jsx)(tl.Icons.ChevronRight,{className:"ml-2 h-3 w-3"})]})]},e.id))})]})}),h[22]=w,h[23]=x,h[24]=g,h[25]=m,h[26]=y,h[27]=b,h[28]=f):f=h[28],h[29]!==d||h[30]!==f?(p=(0,tu.jsxs)("div",{className:"flex min-h-[1px] grow flex-col gap-4",children:[d,f]}),h[29]=d,h[30]=f,h[31]=p):p=h[31],p},on="text-ellipsis whitespace-nowrap overflow-hidden",oa=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(54),{configurationAPI:g,configuredItems:m,onHide:y}=e,{t:v}=tQ("DataSourceConfiguration"),[b,x]=(0,to.useState)(),[S,w]=(0,to.useState)(m),[_,I]=(0,to.useState)();h[0]!==g?(t=g.getItemLabels(),h[0]=g,h[1]=t):t=h[1];let[D]=(0,to.useState)(t),[O,k]=(0,to.useState)(D.length===m.length),C=O?S.length-2:S.length-1;h[2]!==g||h[3]!==C||h[4]!==D.length||h[5]!==y||h[6]!==S||h[7]!==O?(r=()=>{let e=!0;return I(null),x(null),0===S.length?g.initialize().then(t=>{e&&x(t)}).catch(e=>I(e.message)):O||S.length!==D.length?g.setCurrentItem(S[C]).then(t=>{e&&x(t)}).catch(e=>I(e.message)):(g.setCurrentItem(S[S.length-1]),y()),()=>{e=!1}},h[2]=g,h[3]=C,h[4]=D.length,h[5]=y,h[6]=S,h[7]=O,h[8]=r):r=h[8],h[9]!==g||h[10]!==C||h[11]!==D||h[12]!==y||h[13]!==S||h[14]!==O?(n=[S,g,y,D,O,C],h[9]=g,h[10]=C,h[11]=D,h[12]=y,h[13]=S,h[14]=O,h[15]=n):n=h[15],(0,to.useEffect)(r,n),h[16]!==D.length||h[17]!==S.length?(a=e=>e!==D.length-1&&e<S.length?"cursor-pointer":"cursor-auto",h[16]=D.length,h[17]=S.length,h[18]=a):a=h[18];let j=a;h[19]!==D.length||h[20]!==S.length?(i=e=>e<S.length?ay()("bg-background/[.4]",e!==D.length-1?"hover:bg-transparent active:bg-popover":""):"bg-transparent",h[19]=D.length,h[20]=S.length,h[21]=i):i=h[21];let E=i;h[22]!==C||h[23]!==S.length?(o=e=>e===C+1?ay()("border-2","border-solid","border-highlight"):e<S.length?"border border-solid border-primary hover:border-highlight active:border-white":"border border-dashed border-input",h[22]=C,h[23]=S.length,h[24]=o):o=h[24];let M=o;h[25]!==S.length?(s=e=>e<=S.length?"text-highlight":"text-primary",h[25]=S.length,h[26]=s):s=h[26];let R=s;h[27]!==_||h[28]!==D||h[29]!==S.length||h[30]!==v?(l=()=>(0,tu.jsxs)("div",{className:"flex min-h-[1px] grow flex-col gap-4",children:[(0,tu.jsx)("div",{className:"text-highlight text-[20px]",children:v(`Error fetching ${D[S.length]} list`)}),(0,tu.jsx)("div",{className:"grow bg-background p-4 text-[14px]",children:_})]}),h[27]=_,h[28]=D,h[29]=S.length,h[30]=v,h[31]=l):l=h[31];let P=l;h[32]!==C||h[33]!==E||h[34]!==M||h[35]!==j||h[36]!==R||h[37]!==D||h[38]!==S||h[39]!==O||h[40]!==v?(u=()=>(0,tu.jsx)("div",{className:"flex gap-4",children:D.map((e,t)=>(0,tu.jsxs)("div",{className:ay()("flex min-w-[1px] shrink basis-[200px] flex-col gap-1 rounded-md p-3.5",j(t),E(t),M(t),R(t)),onClick:O&&t<C||t<=C?()=>{k(!1),w(e=>e.slice(0,t))}:void 0,children:[(0,tu.jsxs)("div",{className:"text- flex items-center gap-2",children:[t<S.length?(0,tu.jsx)(tl.Icons.ByName,{name:"status-tracked",className:"text-highlight"}):(0,tu.jsx)(tl.Icons.ByName,{name:"status-untracked"}),(0,tu.jsx)("div",{className:ay()(on),children:v(e)})]}),t<S.length?(0,tu.jsx)("div",{className:ay()("text-foreground text-[14px]",on),children:S[t].name}):(0,tu.jsx)("br",{})]},e))}),h[32]=C,h[33]=E,h[34]=M,h[35]=j,h[36]=R,h[37]=D,h[38]=S,h[39]=O,h[40]=v,h[41]=u):u=h[41];let A=u;return h[42]!==A?(c=A(),h[42]=A,h[43]=c):c=h[43],h[44]===Symbol.for("react.memo_cache_sentinel")?(d=(0,tu.jsx)("div",{className:"h-0.5 w-full shrink-0 bg-background"}),h[44]=d):d=h[44],h[45]!==C||h[46]!==_||h[47]!==P||h[48]!==D||h[49]!==b?(f=_?P():(0,tu.jsx)(or,{itemLabel:D[C+1],itemList:b,onItemClicked:e=>{k(!1),w(t=>[...t.slice(0,C+1),e])}}),h[45]=C,h[46]=_,h[47]=P,h[48]=D,h[49]=b,h[50]=f):f=h[50],h[51]!==c||h[52]!==f?(p=(0,tu.jsxs)("div",{className:"flex h-[calc(100vh-300px)] select-none flex-col gap-4 pt-0.5",children:[c,d,f]}),h[51]=c,h[52]=f,h[53]=p):p=h[53],p};function oi(){return null}let oo=function(e){let t,r,n,a,i,o,s,l=(0,ti.c)(21),{servicesManager:u,extensionManager:c}=e,{t:d}=tQ("DataSourceConfiguration"),{show:f,hide:p}=(0,tl.useModal)(),{customizationService:h}=u.services,[g,m]=(0,to.useState)(),[y,v]=(0,to.useState)();l[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],l[0]=t):t=l[0];let[b,x]=(0,to.useState)(t);l[1]!==h||l[2]!==c?(r=()=>{let e=!0,t=async()=>{let t=c.getActiveDataSourceDefinition();if(!t?.configuration?.configurationAPI)return;let r=h.getCustomization(t.configuration.configurationAPI)??oi;if(!r)return;let n=r(t.sourceName);m(n),x(n.getItemLabels()),v(null),n.getConfiguredItems().then(t=>{e&&v(t)})},r=c.subscribe(c.EVENTS.ACTIVE_DATA_SOURCE_CHANGED,t);return t(),()=>{e=!1,r.unsubscribe()}},l[1]=h,l[2]=c,l[3]=r):r=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(n=[],l[4]=n):n=l[4],(0,to.useEffect)(r,n),l[5]!==g||l[6]!==y||l[7]!==p||l[8]!==f||l[9]!==d?(a=()=>{f({content:oa,title:d("Configure Data Source"),containerClassName:"max-w-3xl",contentProps:{configurationAPI:g,configuredItems:y,onHide:p}})},l[5]=g,l[6]=y,l[7]=p,l[8]=f,l[9]=d,l[10]=a):a=l[10];let S=a;return l[11]!==g||l[12]!==y||l[13]!==S?(i=()=>{g&&y&&y.length!==g.getItemLabels().length&&S()},o=[g,y,S],l[11]=g,l[12]=y,l[13]=S,l[14]=i,l[15]=o):(i=l[14],o=l[15]),(0,to.useEffect)(i,o),l[16]!==y||l[17]!==b||l[18]!==S||l[19]!==d?(s=y?(0,tu.jsxs)(tl.HoverCard,{children:[(0,tu.jsx)(tl.HoverCardTrigger,{asChild:!0,children:(0,tu.jsxs)(tl.Button,{variant:"ghost",size:"sm",className:"gap-1 text-sm",onClick:S,children:[(0,tu.jsx)(tl.Icons.CloudSettings,{className:"h-5 w-5"}),"Source"]})}),(0,tu.jsx)(tl.HoverCardContent,{align:"center",className:"w-72 p-0",children:(0,tu.jsxs)(tl.Card,{className:"border-0 shadow-none",children:[(0,tu.jsx)(tl.CardHeader,{className:"p-3 pb-1",children:(0,tu.jsxs)(tl.CardDescription,{className:"text-sm",children:[(0,tu.jsxs)("span",{className:"text-foreground font-semibold",children:[d("Data Source"),":"]})," ",d("Configure the server connection and storage settings")]})}),(0,tu.jsxs)(tl.CardContent,{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 p-3 pt-0 text-sm",children:[(0,tu.jsx)("div",{className:"bg-input col-span-2 my-2 h-px"}),b.map((e,t)=>(0,tu.jsxs)(to.Fragment,{children:[(0,tu.jsx)("span",{className:"text-muted-foreground",children:d(e)}),(0,tu.jsx)("span",{children:y[t]?.name??"—"})]},e))]})]})})]}):null,l[16]=y,l[17]=b,l[18]=S,l[19]=d,l[20]=s):s=l[20],s};var os=((v=os||{})[v.projects=0]="projects",v[v.locations=1]="locations",v[v.datasets=2]="datasets",v[v.dicomStores=3]="dicomStores",v);let ol="https://cloudresourcemanager.googleapis.com/v1",ou="https://healthcare.googleapis.com/v1";class oc{constructor(e,t,r){this._extensionManager=void 0,this._fetchOptions=void 0,this._dataSourceName=void 0,this.getItemLabels=()=>["Project","Location","Data set","DICOM store"],this._dataSourceName=e,this._extensionManager=r;const n=t.services.userAuthenticationService;this._fetchOptions={method:"GET",headers:n.getAuthorizationHeader()}}async initialize(){let e=`${ol}/projects`,t=await oc._doFetch(e,os.projects,this._fetchOptions);return t?.length?t.map(e=>({id:e.projectId,name:e.name,itemType:os.projects,url:`${ou}/projects/${e.projectId}`})):[]}async setCurrentItem(e){if(e.itemType===os.dicomStores){let t=`${e.url}/dicomWeb`,r=JSON.parse(JSON.stringify(this._extensionManager.getDataSourceDefinition(this._dataSourceName)));return r.configuration={...r.configuration,wadoUriRoot:t,qidoRoot:t,wadoRoot:t},this._extensionManager.updateDataSourceConfiguration(r.sourceName,r.configuration),[]}let t=e.itemType+1,r=`${os[t]}`,n=`${e.url}/${r}`,a=await oc._doFetch(n,t,this._fetchOptions);return a?.length?a.map(e=>{let r=e.name.split("/");return{id:e.name,name:r[r.length-1],itemType:t,url:`${ou}/${e.name}`}}):[]}async getConfiguredItems(){let e=this._extensionManager.getDataSourceDefinition(this._dataSourceName).configuration.wadoUriRoot,t=e.indexOf("projects"),r=e.substring(t).split("/"),n=[];for(let e=0;e<4&&(e+1)*2<r.length;e+=1)if(e===os.projects){let t=r[1],a=`${ol}/projects/${t}`,i=(await oc._doFetch(a,os.projects,this._fetchOptions))[0];n.push({id:i.projectId,name:i.name,itemType:e,url:`${ou}/projects/${i.projectId}`})}else{let t=r.slice(0,2*e+2).join("/");n.push({id:t,name:r[2*e+1],itemType:e,url:`${ou}/${t}`})}return n}static async _doFetch(e,t,r={},n={}){try{let a=new URL(e);a.search=new URLSearchParams(n).toString();let i=await fetch(a,r),o=await i.json();if(i.status>=200&&i.status<300&&null!=o){if(null!=o.nextPageToken){n.pageToken=o.nextPageToken;let a=await this._doFetch(e,t,r,n);o[os[t]]=o[os[t]].concat(a)}if(o[os[t]])return o[os[t]];if(o.name)return[o];return[]}{let e=o?.error?.message||`Error returned from Google Cloud Healthcare: ${i.status} - ${i.statusText}`;throw Error(e)}}catch(e){throw Error(e?.message||"Error occurred during fetch request.")}}}let od={progressDropdownWithServiceComponent:ac},{sortingCriteria:of}=K.utils,{seriesSortCriteria:op}=of,oh={sortingCriteria:op.seriesInfoSortingCriteria},og={customOnDropHandler:()=>Promise.resolve({handled:!1})},om={"ui.loadingIndicatorProgress":tl.LoadingIndicatorProgress},oy={"ui.loadingIndicatorTotalPercent":tl.LoadingIndicatorTotalPercent},ov={"ui.progressLoadingBar":tl.ProgressLoadingBar},ob={"ui.labellingComponent":tl.LabellingFlow},ox=nz().t("MeasurementTable:Track measurements for this series?"),oS=nz().t("Do you want to add this measurement to the existing report?"),ow=nz().t("You have existing tracked measurements. What would you like to do with your existing tracked measurements?"),o_=nz().t("MeasurementTable:Track measurements for this series?"),oI=nz().t("Measurements cannot span across multiple studies. Do you want to save your tracked measurements?"),oD=nz().t("Do you want to continue tracking measurements for this study?"),oO=nz().t("Do you want to open this Segmentation?"),ok=nz().t("Do you want to open this Segmentation?"),oC=nz().t("There are unsaved measurements. Do you want to save it?"),oj={"ui.notificationComponent":tl.ViewportDialog,"viewportNotification.beginTrackingMessage":ox,"viewportNotification.trackNewSeriesMessage":oS,"viewportNotification.discardSeriesMessage":ow,"viewportNotification.trackNewStudyMessage":o_,"viewportNotification.discardStudyMessage":oI,"viewportNotification.hydrateSRMessage":oD,"viewportNotification.hydrateRTMessage":oO,"viewportNotification.hydrateSEGMessage":ok,"viewportNotification.discardDirtyMessage":oC};var oE=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},oM=[["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["edge",/Edge\/([0-9\._]+)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["safari",/Version\/([0-9\._]+).*Safari/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/]],oR=["Windows Phone","Android","CentOS",{name:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],oP={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"},oA=RegExp("(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino","i"),oN=RegExp("1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|k\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-","i"),oT=function(){function e(e,t,r){this.navigator=t,this.process=r,this.userAgent=e||(this.navigator?t.userAgent||t.vendor:"")}return e.prototype.detect=function(){if(this.process&&!this.userAgent){var e=this.process.version.slice(1).split(".").slice(0,3),t=Array.prototype.slice.call(e,1).join("")||"0";return{name:"node",version:e.join("."),versionNumber:parseFloat(e[0]+"."+t),mobile:!1,os:this.process.platform}}return this.userAgent||this.handleMissingError(),oE({},this.checkBrowser(),this.checkMobile(),this.checkOs())},e.prototype.checkBrowser=function(){var e=this;return oM.filter(function(t){return t[1].test(e.userAgent)}).map(function(t){var r=t[1].exec(e.userAgent),n=r&&r[1].split(/[._]/).slice(0,3),a=Array.prototype.slice.call(n,1).join("")||"0";return n&&n.length<3&&Array.prototype.push.apply(n,1===n.length?[0,0]:[0]),{name:String(t[0]),version:n.join("."),versionNumber:Number(n[0]+"."+a)}}).shift()},e.prototype.checkMobile=function(){var e=this.userAgent.substr(0,4);return{mobile:oA.test(this.userAgent)||oN.test(e)}},e.prototype.checkOs=function(){var e=this;return oR.map(function(t){var r=t.name||t,n=e.getOsPattern(t);return{name:r,pattern:n,value:RegExp("\\b"+n.replace(/([ -])(?!$)/g,"$1?")+"(?:x?[\\d._]+|[ \\w.]*)","i").exec(e.userAgent)}}).filter(function(e){return e.value}).map(function(e){var t,r=e.value[0]||"";return e.pattern&&e.name&&/^Win/i.test(r)&&!/^Windows Phone /i.test(r)&&(t=oP[r.replace(/[^\d.]/g,"")])&&(r="Windows "+t),e.pattern&&e.name&&(r=r.replace(RegExp(e.pattern,"i"),e.name)),r=r.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0].trim(),{os:r=/^(?:webOS|i(?:OS|P))/.test(r)?r:r.charAt(0).toUpperCase()+r.slice(1)}}).shift()},e.prototype.getOsPattern=function(e){return("string"==typeof e?e:void 0)||e.pattern||e.name},e.prototype.handleMissingError=function(){throw Error("Please give user-agent.\n> browser(navigator.userAgent or res.headers['user-agent']).")},e}();function oU(e,t){return e(t={exports:{}},t.exports),t.exports}var oL=oU(function(e){var t=e.exports="u">typeof window&&window.Math==Math?window:"u">typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),oF=oU(function(e){var t=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=t)});oF.version;var oB=function(e){return"object"==typeof e?null!==e:"function"==typeof e},oV=function(e){if(!oB(e))throw TypeError(e+" is not an object!");return e},oz=function(e){try{return!!e()}catch(e){return!0}},oH=!oz(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),oW=oL.document,o$=oB(oW)&&oB(oW.createElement),oY=!oH&&!oz(function(){return 7!=Object.defineProperty(o$?oW.createElement("div"):{},"a",{get:function(){return 7}}).a}),oG=function(e,t){var r,n;if(!oB(e))return e;if(t&&"function"==typeof(r=e.toString)&&!oB(n=r.call(e))||"function"==typeof(r=e.valueOf)&&!oB(n=r.call(e))||!t&&"function"==typeof(r=e.toString)&&!oB(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},oq=Object.defineProperty,oX=oH?Object.defineProperty:function(e,t,r){if(oV(e),t=oG(t,!0),oV(r),oY)try{return oq(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},oK=oH?function(e,t,r){return oX(e,t,{enumerable:!1,configurable:!0,writable:!0,value:r})}:function(e,t,r){return e[t]=r,e},oJ={}.hasOwnProperty,oZ=function(e,t){return oJ.call(e,t)},oQ=0,o0=Math.random(),o1=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++oQ+o0).toString(36))},o2=oU(function(e){var t=o1("src"),r="toString",n=Function[r],a=(""+n).split(r);oF.inspectSource=function(e){return n.call(e)},(e.exports=function(e,r,n,i){var o="function"==typeof n;o&&(oZ(n,"name")||oK(n,"name",r)),e[r]!==n&&(o&&(oZ(n,t)||oK(n,t,e[r]?""+e[r]:a.join(String(r)))),e===oL?e[r]=n:i?e[r]?e[r]=n:oK(e,r,n):(delete e[r],oK(e,r,n)))})(Function.prototype,r,function(){return"function"==typeof this&&this[t]||n.call(this)})}),o3=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},o4=function(e,t,r){if(o3(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,a){return e.call(t,r,n,a)}}return function(){return e.apply(t,arguments)}},o5="prototype",o8=function(e,t,r){var n,a,i,o,s=e&o8.F,l=e&o8.G,u=e&o8.S,c=e&o8.P,d=e&o8.B,f=l?oL:u?oL[t]||(oL[t]={}):(oL[t]||{})[o5],p=l?oF:oF[t]||(oF[t]={}),h=p[o5]||(p[o5]={});for(n in l&&(r=t),r)i=((a=!s&&f&&void 0!==f[n])?f:r)[n],o=d&&a?o4(i,oL):c&&"function"==typeof i?o4(Function.call,i):i,f&&o2(f,n,i,e&o8.U),p[n]!=i&&oK(p,n,o),c&&h[n]!=i&&(h[n]=i)};oL.core=oF,o8.F=1,o8.G=2,o8.S=4,o8.P=8,o8.B=16,o8.W=32,o8.U=64,o8.R=128;var o6={}.toString,o9=function(e){return o6.call(e).slice(8,-1)},o7=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==o9(e)?e.split(""):Object(e)},se=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},st=Math.ceil,sr=Math.floor,sn=Math.min,sa=function(e){var t;return e>0?sn(isNaN(t=+e)?0:(t>0?sr:st)(t),0x1fffffffffffff):0},si=Array.isArray||function(e){return"Array"==o9(e)},so=oU(function(e){var t="__core-js_shared__",r=oL[t]||(oL[t]={});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:oF.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),ss=oU(function(e){var t=so("wks"),r=oL.Symbol,n="function"==typeof r;(e.exports=function(e){return t[e]||(t[e]=n&&r[e]||(n?r:o1)("Symbol."+e))}).store=t})("species"),sl=function(e){var t;return si(e)&&("function"==typeof(t=e.constructor)&&(t===Array||si(t.prototype))&&(t=void 0),oB(t)&&null===(t=t[ss])&&(t=void 0)),void 0===t?Array:t},su=function(e,t){return new(sl(e))(t)},sc=function(e,t){var r=1==e,n=2==e,a=3==e,i=4==e,o=6==e,s=5==e||o,l=t||su;return function(t,u,c){for(var d,f,p=Object(se(t)),h=o7(p),g=o4(u,c,3),m=sa(h.length),y=0,v=r?l(t,m):n?l(t,0):void 0;m>y;y++)if((s||y in h)&&(f=g(d=h[y],y,p),e)){if(r)v[y]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return y;case 2:v.push(d)}else if(i)return!1}return o?-1:a||i?i:v}},sd=function(e,t){return!!e&&oz(function(){t?e.call(null,function(){},1):e.call(null)})},sf=sc(2);o8(o8.P+!sd([].filter,!0)*o8.F,"Array",{filter:function(e){return sf(this,e,arguments[1])}}),oF.Array.filter;var sp=sc(1);o8(o8.P+!sd([].map,!0)*o8.F,"Array",{map:function(e){return sp(this,e,arguments[1])}}),oF.Array.map;var sh=" \n\v\f\r \u2028\u2029\uFEFF",sg="["+sh+"]",sm="
",sy=RegExp("^"+sg+sg+"*"),sv=RegExp(sg+sg+"*$"),sb=function(e,t,r){var n={},a=oz(function(){return!!sh[e]()||sm[e]()!=sm}),i=n[e]=a?t(sx):sh[e];r&&(n[r]=i),o8(o8.P+o8.F*a,"String",n)},sx=sb.trim=function(e,t){return e=String(se(e)),1&t&&(e=e.replace(sy,"")),2&t&&(e=e.replace(sv,"")),e};sb("trim",function(e){return function(){return e(this,3)}}),oF.String.trim;var sS="u">typeof window?window.navigator:void 0,sw="u">typeof process?process:void 0;let s_={"ohif.aboutModal":function(){let e,t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(20),{t:g}=tQ("AboutModal");if(h[0]===Symbol.for("react.memo_cache_sentinel")){let{os:a,version:i,name:o}=new oT(void 0,sS,sw).detect();e=a,n=i,t=o[0].toUpperCase(),r=o.substr(1),h[0]=e,h[1]=t,h[2]=r,h[3]=n}else e=h[0],t=h[1],r=h[2],n=h[3];let m=`${t}${r} ${n}`;h[4]===Symbol.for("react.memo_cache_sentinel")?(a="3.14.0-beta.42".split("-"),h[4]=a):a=h[4];let[y,v]=a;return h[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,tu.jsx)(tl.AboutModal.ProductName,{children:"OHIF Viewer"}),o=(0,tu.jsx)(tl.AboutModal.ProductVersion,{children:y}),s=v&&(0,tu.jsx)(tl.AboutModal.ProductBeta,{children:v}),h[5]=i,h[6]=o,h[7]=s):(i=h[5],o=h[6],s=h[7]),h[8]!==g?(l=g("Commit Hash"),h[8]=g,h[9]=l):l=h[9],h[10]!==l?(u=(0,tu.jsx)(tl.AboutModal.DetailItem,{label:l,value:"39343e6facb521471d73a0269ace0f22b95476d8"}),h[10]=l,h[11]=u):u=h[11],h[12]!==g?(c=g("Current Browser & OS"),h[12]=g,h[13]=c):c=h[13],h[14]!==c?(d=(0,tu.jsx)(tl.AboutModal.DetailItem,{label:c,value:`${m}, ${e}`}),h[14]=c,h[15]=d):d=h[15],h[16]===Symbol.for("react.memo_cache_sentinel")?(f=(0,tu.jsx)(tl.AboutModal.SocialItem,{icon:"SocialGithub",url:"OHIF/Viewers",text:"github.com/OHIF/Viewers"}),h[16]=f):f=h[16],h[17]!==u||h[18]!==d?(p=(0,tu.jsxs)(tl.AboutModal,{className:"w-[400px]",children:[i,o,s,(0,tu.jsxs)(tl.AboutModal.Body,{children:[u,d,f]})]}),h[17]=u,h[18]=d,h[19]=p):p=h[19],p}};function sI(e){return(0,tu.jsx)(tl.SelectItem,{value:e.name,children:e.label},e.name)}let sD={"ohif.appearanceModal":function(){let e,t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_=(0,ti.c)(62),{activeTheme:I,setActiveTheme:D,customCss:O,applyCustomTheme:k,clearCustomTheme:C}=(0,tl.useActiveTheme)(),{t:j}=tQ("AppearanceModal");_[0]!==O?(e=()=>O,_[0]=O,_[1]=e):e=_[1];let[E,M]=to.useState(e);_[2]!==I?(t=()=>"custom"===I,_[2]=I,_[3]=t):t=_[3];let[R,P]=to.useState(t),[A,N]=to.useState(!1);_[4]!==R?(r=()=>{P(!R)},_[4]=R,_[5]=r):r=_[5];let T=r;_[6]!==k||_[7]!==E?(n=()=>{N(!k(E))},_[6]=k,_[7]=E,_[8]=n):n=_[8];let U=n;_[9]!==C?(a=()=>{C(),M(""),N(!1),P(!1)},_[9]=C,_[10]=a):a=_[10];let L=a;_[11]!==k||_[12]!==O||_[13]!==D?(i=e=>{"custom"===e?(P(!0),O&&k(O)):(P(!1),D(e))},_[11]=k,_[12]=O,_[13]=D,_[14]=i):i=_[14];let F=i;_[15]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{M(e.target.value),N(!1)},_[15]=o):o=_[15];let B=o;return _[16]!==j?(s=j("Theme"),_[16]=j,_[17]=s):s=_[17],_[18]!==s?(l=(0,tu.jsx)(tl.AppearanceModal.SectionLabel,{children:s}),_[18]=s,_[19]=l):l=_[19],_[20]!==j?(u=j("Theme"),_[20]=j,_[21]=u):u=_[21],_[22]===Symbol.for("react.memo_cache_sentinel")?(c=(0,tu.jsx)(tl.SelectValue,{}),_[22]=c):c=_[22],_[23]!==u?(d=(0,tu.jsx)(tl.SelectTrigger,{className:"w-[200px]","aria-label":u,children:c}),_[23]=u,_[24]=d):d=_[24],_[25]!==j?(f=j("Default Theme"),_[25]=j,_[26]=f):f=_[26],_[27]!==f?(p=(0,tu.jsx)(tl.SelectItem,{value:"default",children:f}),_[27]=f,_[28]=p):p=_[28],_[29]===Symbol.for("react.memo_cache_sentinel")?(h=tl.themePresets.map(sI),_[29]=h):h=_[29],_[30]!==O||_[31]!==E||_[32]!==j?(g=(O||E)&&(0,tu.jsx)(tl.SelectItem,{value:"custom",children:j("Custom")}),_[30]=O,_[31]=E,_[32]=j,_[33]=g):g=_[33],_[34]!==p||_[35]!==g?(m=(0,tu.jsxs)(tl.SelectContent,{children:[p,h,g]}),_[34]=p,_[35]=g,_[36]=m):m=_[36],_[37]!==I||_[38]!==F||_[39]!==d||_[40]!==m?(y=(0,tu.jsx)("div",{children:(0,tu.jsxs)(tl.Select,{value:I,onValueChange:F,children:[d,m]})}),_[37]=I,_[38]=F,_[39]=d,_[40]=m,_[41]=y):y=_[41],_[42]!==R||_[43]!==j?(v=j(R?"Hide":"Custom Theme"),_[42]=R,_[43]=j,_[44]=v):v=_[44],_[45]!==T||_[46]!==v?(b=(0,tu.jsx)("div",{className:"col-start-2",children:(0,tu.jsx)(tl.Button,{variant:"ghost",size:"sm",onClick:T,children:v})}),_[45]=T,_[46]=v,_[47]=b):b=_[47],_[48]!==y||_[49]!==b||_[50]!==l?(x=(0,tu.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-6 gap-y-4",children:[l,y,b]}),_[48]=y,_[49]=b,_[50]=l,_[51]=x):x=_[51],_[52]!==E||_[53]!==L||_[54]!==U||_[55]!==R||_[56]!==A||_[57]!==j?(S=R&&(0,tu.jsxs)("div",{className:"mt-4 flex flex-col space-y-2",children:[(0,tu.jsx)("textarea",{value:E,onChange:B,placeholder:j("Paste your custom theme color tokens here"),"aria-label":j("Paste your custom theme color tokens here"),rows:8,className:"bg-muted text-foreground border-input placeholder:text-muted-foreground focus:ring-ring rounded-md border px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-inset"}),A&&(0,tu.jsx)("span",{className:"text-destructive text-sm",role:"alert",children:j("No valid theme tokens found")}),(0,tu.jsxs)("div",{className:"flex space-x-2",children:[(0,tu.jsx)(tl.Button,{variant:"default",size:"sm",onClick:U,children:j("Apply")}),(0,tu.jsx)(tl.Button,{variant:"ghost",size:"sm",onClick:L,children:j("Clear")})]})]}),_[52]=E,_[53]=L,_[54]=U,_[55]=R,_[56]=A,_[57]=j,_[58]=S):S=_[58],_[59]!==x||_[60]!==S?(w=(0,tu.jsx)(tl.AppearanceModal,{children:(0,tu.jsxs)(tl.AppearanceModal.Body,{children:[x,S]})}),_[59]=x,_[60]=S,_[61]=w):w=_[61],w}},{availableLanguages:sO,defaultLanguage:sk,currentLanguage:sC}=nz(),sj=[{value:"16",label:"Shift"},{value:"17",label:"Ctrl"},{value:"18",label:"Alt"},{value:"91",label:"Meta"}];function sE(e){return(0,tu.jsx)(tl.SelectItem,{value:e.value,children:e.label},e.value)}let sM={"ohif.userPreferencesModal":function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k,C,j,E,M,R,P,A,N,T,U,L,F,B,V=(0,ti.c)(107),{hide:z}=e,{hotkeysManager:H,servicesManager:W}=(0,K.useSystem)(),{t:$,i18n:Y}=tQ("UserPreferencesModal"),G=W?.services?.toolGroupService,{hotkeyDefinitions:q,hotkeyDefaults:X}=H;V[0]!==q?(t=void 0===q?{}:q,V[0]=q,V[1]=t):t=V[1];let J=t;V[2]!==X?(r=void 0===X?{}:X,V[2]=X,V[3]=r):r=V[3];let Z=r;V[4]!==H?(n=H.getValidHotkeyDefinitions(K.hotkeys.defaults.hotkeyBindings),V[4]=H,V[5]=n):n=V[5];let Q=n;V[6]!==Q||V[7]!==Z||V[8]!==J||V[9]!==H?(a=()=>{Object.keys(Z).length||H.setDefaultHotKeys(K.hotkeys.defaults.hotkeyBindings),Object.keys(J).length||H.setHotkeys(Q)},i=[H,Z,J,Q],V[6]=Q,V[7]=Z,V[8]=J,V[9]=H,V[10]=a,V[11]=i):(a=V[10],i=V[11]),(0,to.useEffect)(a,i),V[12]!==Q||V[13]!==Z?(o=Object.keys(Z).length?Z:Q,V[12]=Q,V[13]=Z,V[14]=o):o=V[14];let ee=o;V[15]!==J||V[16]!==ee?(s=Object.keys(J).length?J:ee,V[15]=J,V[16]=ee,V[17]=s):s=V[17];let et=s;V[18]===Symbol.for("react.memo_cache_sentinel")?(l=sC(),V[18]=l):l=V[18];let er=l;V[19]!==G?(u=function(e,t){if(!e)return null;let r=e.getToolBindings("mpr",t);if(!r?.length)return null;let n=r.find(e=>1===e.mouseButton&&null!=e.modifierKey&&null==e.numTouchPoints);return n?.modifierKey!=null?String(n.modifierKey):null}(G,"Crosshairs"),V[19]=G,V[20]=u):u=V[20];let en=u;V[21]!==G?(c=G?.getDefaultToolBindings?.("mpr","Crosshairs"),V[21]=G,V[22]=c):c=V[22];let ea=c;V[23]!==en||V[24]!==et?(d={hotkeyDefinitions:et,languageValue:er.value,crosshairModifier:en},V[23]=en,V[24]=et,V[25]=d):d=V[25];let[ei,eo]=(0,to.useState)(d);V[26]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{eo(t=>({...t,languageValue:e}))},V[26]=f):f=V[26];let es=f;V[27]===Symbol.for("react.memo_cache_sentinel")?(p=(e,t)=>{eo(r=>({...r,hotkeyDefinitions:{...r.hotkeyDefinitions,[e]:{...r.hotkeyDefinitions[e],keys:t}}}))},V[27]=p):p=V[27];let el=p;V[28]!==ea||V[29]!==H||V[30]!==ee||V[31]!==G?(h=()=>{eo(e=>({...e,languageValue:sk.value,hotkeyDefinitions:ee,crosshairModifier:function(e){if(!e?.length)return null;let t=e.find(e=>1===e.mouseButton&&null!=e.modifierKey&&null==e.numTouchPoints);return t?.modifierKey!=null?String(t.modifierKey):null}(ea)})),H.restoreDefaultBindings(),G&&ea?.length&&(G.setToolBindings("mpr","Crosshairs",ea),G.applyToolBindings("mpr","Crosshairs",{replaceExisting:!0})),G?.removePersistedToolBindings("mpr","Crosshairs")},V[28]=ea,V[29]=H,V[30]=ee,V[31]=G,V[32]=h):h=V[32];let eu=h;if(V[33]!==Y.language||V[34]!==ei.languageValue){t:{if("u"<typeof Intl||"function"!=typeof Intl.DisplayNames){g=null;break t}let e=Array.from(new Set([ei.languageValue,er.value,Y.language,"en"].filter(Boolean)));try{g=new Intl.DisplayNames(e,{type:"language",fallback:"none"});break t}catch(t){console.warn("Intl.DisplayNames not supported for locales",e,t)}g=null}V[33]=Y.language,V[34]=ei.languageValue,V[35]=g}else g=V[35];let ec=g;V[36]!==ec||V[37]!==Y||V[38]!==$?(m=(e,t)=>{let r=`LanguageName.${e}`;if(Y.exists(r,{ns:"UserPreferencesModal"}))return $(r);if(ec){let t=function(e,t){try{let r=e.of(t);if(r&&r.toLowerCase()!==t.toLowerCase())return r.charAt(0).toUpperCase()+r.slice(1)}catch(e){console.debug(`Unable to resolve display name for ${t}`,e)}return null}(ec,e);if(t)return t}return t},V[36]=ec,V[37]=Y,V[38]=$,V[39]=m):m=V[39];let ed=m;V[40]!==$?(y=$("Language"),V[40]=$,V[41]=y):y=V[41],V[42]!==y?(v=(0,tu.jsx)(tl.UserPreferencesModal.SubHeading,{children:y}),V[42]=y,V[43]=v):v=V[43];let ef=ei.languageValue;return V[44]!==$?(b=$("Select language"),V[44]=$,V[45]=b):b=V[45],V[46]!==b?(x=(0,tu.jsx)(tl.SelectTrigger,{className:"w-60","aria-label":"Language",children:(0,tu.jsx)(tl.SelectValue,{placeholder:b})}),V[46]=b,V[47]=x):x=V[47],V[48]!==ed?(S=sO.map(e=>(0,tu.jsx)(tl.SelectItem,{value:e.value,children:ed(e.value,e.label)},e.value)),V[48]=ed,V[49]=S):S=V[49],V[50]!==S?(w=(0,tu.jsx)(tl.SelectContent,{children:S}),V[50]=S,V[51]=w):w=V[51],V[52]!==ei.languageValue||V[53]!==x||V[54]!==w?(_=(0,tu.jsxs)(tl.Select,{defaultValue:ef,onValueChange:es,children:[x,w]}),V[52]=ei.languageValue,V[53]=x,V[54]=w,V[55]=_):_=V[55],V[56]!==v||V[57]!==_?(I=(0,tu.jsxs)("div",{className:"mb-3 flex items-center space-x-14",children:[v,_]}),V[56]=v,V[57]=_,V[58]=I):I=V[58],V[59]!==$?(D=$("Hotkeys"),V[59]=$,V[60]=D):D=V[60],V[61]!==D?(O=(0,tu.jsx)(tl.UserPreferencesModal.SubHeading,{children:D}),V[61]=D,V[62]=O):O=V[62],V[63]!==ei.hotkeyDefinitions||V[64]!==$?(k=(0,tu.jsx)(tl.UserPreferencesModal.HotkeysGrid,{children:Object.entries(ei.hotkeyDefinitions).map(e=>{let[t,r]=e;return(0,tu.jsx)(tl.UserPreferencesModal.Hotkey,{label:$(r.label),value:r.keys,onChange:e=>el(t,e),placeholder:r.keys,hotkeys:K.hotkeys},t)})}),V[63]=ei.hotkeyDefinitions,V[64]=$,V[65]=k):k=V[65],V[66]!==ei.crosshairModifier||V[67]!==$?(C=null!=ei.crosshairModifier&&(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.UserPreferencesModal.SubHeading,{children:$("ModifierKeys",{defaultValue:"Modifier Keys"})}),(0,tu.jsx)(tl.UserPreferencesModal.HotkeysGrid,{children:(0,tu.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,tu.jsx)("span",{className:"text-foreground text-base",children:$("CrosshairsModifier",{defaultValue:"Crosshairs"})}),(0,tu.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,tu.jsx)("span",{className:"text-muted-foreground text-sm",children:$("PlusLeftClick",{defaultValue:"Left Click +"})}),(0,tu.jsxs)(tl.Select,{value:ei.crosshairModifier,onValueChange:e=>eo(t=>({...t,crosshairModifier:e})),children:[(0,tu.jsx)(tl.SelectTrigger,{className:"w-16",children:(0,tu.jsx)(tl.SelectValue,{})}),(0,tu.jsx)(tl.SelectContent,{children:sj.map(sE)})]})]})]})})]}),V[66]=ei.crosshairModifier,V[67]=$,V[68]=C):C=V[68],V[69]!==I||V[70]!==O||V[71]!==k||V[72]!==C?(j=(0,tu.jsxs)(tl.UserPreferencesModal.Body,{children:[I,O,k,C]}),V[69]=I,V[70]=O,V[71]=k,V[72]=C,V[73]=j):j=V[73],V[74]!==$?(E=$("Reset to defaults"),V[74]=$,V[75]=E):E=V[75],V[76]!==eu||V[77]!==E?(M=(0,tu.jsx)(tl.FooterAction.Left,{children:(0,tu.jsx)(tl.FooterAction.Auxiliary,{onClick:eu,children:E})}),V[76]=eu,V[77]=E,V[78]=M):M=V[78],V[79]!==z?(R=()=>{K.hotkeys.stopRecord(),K.hotkeys.unpause(),z()},V[79]=z,V[80]=R):R=V[80],V[81]!==$?(P=$("Cancel"),V[81]=$,V[82]=P):P=V[82],V[83]!==R||V[84]!==P?(A=(0,tu.jsx)(tl.FooterAction.Secondary,{onClick:R,children:P}),V[83]=R,V[84]=P,V[85]=A):A=V[85],V[86]!==z||V[87]!==H||V[88]!==ei.crosshairModifier||V[89]!==ei.hotkeyDefinitions||V[90]!==ei.languageValue||V[91]!==G?(N=()=>{if(ei.languageValue!==er.value){nz().changeLanguage(ei.languageValue),window.location.reload();return}if(H.setHotkeys(ei.hotkeyDefinitions),G&&null!=ei.crosshairModifier){let e=[{mouseButton:1,modifierKey:Number(ei.crosshairModifier)}];G.setToolBindings("mpr","Crosshairs",e),G.applyToolBindings("mpr","Crosshairs",{replaceExisting:!0}),G.persistToolBindings("mpr","Crosshairs",e)}K.hotkeys.stopRecord(),K.hotkeys.unpause(),z()},V[86]=z,V[87]=H,V[88]=ei.crosshairModifier,V[89]=ei.hotkeyDefinitions,V[90]=ei.languageValue,V[91]=G,V[92]=N):N=V[92],V[93]!==$?(T=$("Save"),V[93]=$,V[94]=T):T=V[94],V[95]!==N||V[96]!==T?(U=(0,tu.jsx)(tl.FooterAction.Primary,{onClick:N,children:T}),V[95]=N,V[96]=T,V[97]=U):U=V[97],V[98]!==A||V[99]!==U?(L=(0,tu.jsxs)(tl.FooterAction.Right,{children:[A,U]}),V[98]=A,V[99]=U,V[100]=L):L=V[100],V[101]!==M||V[102]!==L?(F=(0,tu.jsxs)(tl.FooterAction,{children:[M,L]}),V[101]=M,V[102]=L,V[103]=F):F=V[103],V[104]!==j||V[105]!==F?(B=(0,tu.jsxs)(tl.UserPreferencesModal,{children:[j,F]}),V[104]=j,V[105]=F,V[106]=B):B=V[106],B},"ohif.userPreferences.toolBindingsStorageKey":"user-preferred-tool-bindings"},sR="ohif.seriesDescriptionHistory";function sP(){try{let e=window.localStorage.getItem(sR),t=e?JSON.parse(e):null;return t&&"object"==typeof t?t:{}}catch(e){return console.debug("Unable to read the series description history",e),{}}}let sA=[{value:"current",label:"Save to current",help:"Adds a new version to this series as the new default. Earlier versions are kept.",unavailable:"This data has not been saved to a series yet"},{value:"new",label:"Save as new",help:"Creates a separate series.",unavailable:""},{value:"replace",label:"Replace existing",help:"Choose a series to replace. The current data becomes the default and earlier versions are kept.",unavailable:"No other series of this type is loaded"}];function sN(e){return(0,tu.jsx)(tl.SelectItem,{value:e.value,children:e.label},e.value)}function sT(e){return e.preventDefault()}function sU(e){return!e}function sL(e){return e.preventDefault()}function sF(e){return(0,tu.jsx)(tl.SelectItem,{value:e.value,children:e.label},e.value)}function sB(e){return Math.max(e-1,-1)}function sV(e){return!!e}function sz(e){return e?.trim()}function sH(e,t){return isFinite(t.SeriesNumber)?Math.max(e,Number(t.SeriesNumber)):e}let sW={"ohif.createReportDialog":function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k,C,j,E,M,R,P,A,N,T,U,L,F,B,V,z,H,W=(0,ti.c)(141),{dataSources:$,modality:Y,predecessorImageId:G,minSeriesNumber:q,itemName:X,defaultSeriesDescription:J,itemType:Z,rememberedDescriptionCount:Q,hide:ee,onSave:et,onCancel:er,enableDownload:en}=e,ea=void 0===Y?"SR":Y,ei=void 0===q?3e3:q,eo=void 0===X?"":X,es=void 0===J?"":J,el=void 0===Q?5:Q,eu=void 0!==en&&en,{t:ec}=tQ("Buttons"),{servicesManager:ed}=(0,K.useSystem)(),ef=(0,to.useRef)(!1),ep=(0,to.useRef)(null),[eh,eg]=(0,to.useState)($?.[0]?.value??null),{displaySetService:em}=ed.services;W[0]!==em?(t=Array.from(em.getDisplaySetCache().values()),W[0]=em,W[1]=t):t=W[1],W[2]!==ea||W[3]!==t?(r=t.filter(e=>e.Modality===ea),W[2]=ea,W[3]=t,W[4]=r):r=W[4];let ey=r;if(W[5]!==ei||W[6]!==ey){let e=new Set;n=ey.map(e=>{let t=isFinite(e.SeriesNumber),r=t?`${e.SeriesNumber}`:"Not specified";return{value:e.predecessorImageId,seriesNumber:t?Number(e.SeriesNumber):ei,seriesNumberLabel:r,description:e.SeriesDescription||null,label:e.SeriesDescription||`Series ${r}`}}).filter(t=>!(!t.value||e.has(t.value))&&(e.add(t.value),!0)),W[5]=ei,W[6]=ey,W[7]=n}else n=W[7];let ev=n;W[8]!==ev||W[9]!==G?(a=ev.find(e=>e.value===G)??null,W[8]=ev,W[9]=G,W[10]=a):a=W[10];let eb=a;W[11]!==eb||W[12]!==ev?(i=ev.filter(e=>e!==eb),W[11]=eb,W[12]=ev,W[13]=i):i=W[13];let ex=i,eS=1+ey.reduce(sH,ei);if(W[14]!==eb?.description||W[15]!==es||W[16]!==eo||W[17]!==Z||W[18]!==ea||W[19]!==el){let e=el>0?function(e,t){if(!e||!(t>0))return[];let r=sP()[e];return Array.isArray(r)?r.filter(e=>"string"==typeof e&&!!e.trim()).slice(0,t):[]}(Z||ea,el):[],t=[eo,eb?.description,...e,es].map(sz).filter(sV);o=t.filter((e,r)=>t.findIndex(t=>t.toLowerCase()===e.toLowerCase())===r),W[14]=eb?.description,W[15]=es,W[16]=eo,W[17]=Z,W[18]=ea,W[19]=el,W[20]=o}else o=W[20];let ew=o;W[21]!==ew||W[22]!==el?(s=el>0?ew:ew.slice(0,1),W[21]=ew,W[22]=el,W[23]=s):s=W[23];let e_=s,eI=e_[0]??"",[eD,eO]=(0,to.useState)(eb?"current":"new"),[ek,eC]=(0,to.useState)(String(eS)),[ej,eE]=(0,to.useState)(eI),[eM,eR]=(0,to.useState)(null),[eP,eA]=(0,to.useState)(!1),[eN,eT]=(0,to.useState)(!1),[eU,eL]=(0,to.useState)(-1);W[24]!==ex||W[25]!==eM?(l=ex.find(e=>e.value===eM)??null,W[24]=ex,W[25]=eM,W[26]=l):l=W[26];let eF=l,eB="current"===eD?eb:"replace"===eD?eF:null,eV="replace"===eD&&!eF;W[27]!==eb||W[28]!==ex.length?(u=e=>"current"===e&&!!eb||"new"===e||"replace"===e&&ex.length>0,W[27]=eb,W[28]=ex.length,W[29]=u):u=W[29];let ez=u;if(W[30]!==eS||W[31]!==ek){let e=Number.parseInt(ek,10);c=Number.isFinite(e)?e:eS,W[30]=eS,W[31]=ek,W[32]=c}else c=W[32];let eH=c;if(W[33]!==e_||W[34]!==ej){let e=ej.trim().toLowerCase();d=e_.filter(t=>t.toLowerCase().startsWith(e)),W[33]=e_,W[34]=ej,W[35]=d}else d=W[35];let eW=d,e$=eN?eW:e_;W[36]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{eE(e),eA(!1),eL(-1)},W[36]=f):f=W[36];let eY=f;W[37]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{eE(e),eL(-1),eT(!0),eA(!0)},W[37]=p):p=W[37];let eG=p;W[38]!==eI||W[39]!==es||W[40]!==ee||W[41]!==eV||W[42]!==Z||W[43]!==ea||W[44]!==ej||W[45]!==et||W[46]!==el||W[47]!==eH||W[48]!==eB?(h=e=>{if(eV)return;ef.current=!0;let t=eB?eB.seriesNumber:eH,r=eB?eB.description??"":ej.trim()||eI,n=r.toLowerCase()===es?.trim().toLowerCase();eB||n||function(e,t,r){let n=t?.trim();if(!e||!n||!(r>0))return;let a=sP(),i=Array.isArray(a[e])?a[e]:[];a[e]=[n,...i.filter(e=>"string"==typeof e&&!!e.trim()&&e.toLowerCase()!==n.toLowerCase())].slice(0,r);try{window.localStorage.setItem(sR,JSON.stringify(a))}catch(e){console.debug("Unable to store the series description history",e)}}(Z||ea,r,el),et({reportName:r,dataSource:e,series:eB?eB.value:null,seriesNumber:t,priorSeriesNumber:t-1}),ee()},W[38]=eI,W[39]=es,W[40]=ee,W[41]=eV,W[42]=Z,W[43]=ea,W[44]=ej,W[45]=et,W[46]=el,W[47]=eH,W[48]=eB,W[49]=h):h=W[49];let eq=h;W[50]!==eh||W[51]!==eq?(g=()=>eq(eh),W[50]=eh,W[51]=eq,W[52]=g):g=W[52];let eX=g;W[53]!==eq?(m=()=>eq("download"),W[53]=eq,W[54]=m):m=W[54];let eK=m;W[55]!==ee||W[56]!==er?(y=()=>{ef.current=!0,er(),ee()},W[55]=ee,W[56]=er,W[57]=y):y=W[57];let eJ=y;W[58]!==eW||W[59]!==eP||W[60]!==eX||W[61]!==eU||W[62]!==ej||W[63]!==e$?(v=e=>{let t=eU>=0?e$[eU]:eW[0];switch(e.key){case"Tab":!e.shiftKey&&t&&t!==ej?(e.preventDefault(),eY(t)):eA(!1);break;case"ArrowDown":e.preventDefault(),eA(!0),eL(e=>Math.min(e+1,e$.length-1));break;case"ArrowUp":e.preventDefault(),eL(sB);break;case"Escape":eP&&(e.preventDefault(),eA(!1),eL(-1));break;case"Enter":e.preventDefault(),eP&&eU>=0&&t?eY(t):eX()}},W[58]=eW,W[59]=eP,W[60]=eX,W[61]=eU,W[62]=ej,W[63]=e$,W[64]=v):v=W[64];let eZ=v;W[65]!==er?(b=()=>()=>{ef.current||er()},x=[er],W[65]=er,W[66]=b,W[67]=x):(b=W[66],x=W[67]),(0,to.useEffect)(b,x),W[68]!==eD?(S=()=>{if("new"!==eD)return;let e=window.setTimeout(()=>ep.current?.focus(),0);return()=>window.clearTimeout(e)},w=[eD],W[68]=eD,W[69]=S,W[70]=w):(S=W[69],w=W[70]),(0,to.useEffect)(S,w),W[71]!==eD?(_=sA.find(e=>e.value===eD),W[71]=eD,W[72]=_):_=W[72];let eQ=_,e0=$?.length>1;W[73]!==$||W[74]!==eh||W[75]!==e0?(I=e0&&(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.Label,{className:"whitespace-nowrap pt-1.5 text-base",children:"Data source"}),(0,tu.jsxs)(tl.Select,{value:eh,onValueChange:eg,children:[(0,tu.jsx)(tl.SelectTrigger,{"data-cy":"report-data-source-select",children:(0,tu.jsx)(tl.SelectValue,{placeholder:"Select a data source"})}),(0,tu.jsx)(tl.SelectContent,{children:$.map(sF)})]})]}),W[73]=$,W[74]=eh,W[75]=e0,W[76]=I):I=W[76],W[77]===Symbol.for("react.memo_cache_sentinel")?(D=(0,tu.jsx)(tl.Label,{className:"whitespace-nowrap pt-1.5 text-base",children:"Series"}),W[77]=D):D=W[77],W[78]===Symbol.for("react.memo_cache_sentinel")?(O=e=>eO(e),W[78]=O):O=W[78],W[79]!==ez?(k=sA.map(e=>(0,tu.jsx)(tl.TabsTrigger,{value:e.value,"data-cy":`report-destination-${e.value}`,disabled:!ez(e.value),title:ez(e.value)?void 0:e.unavailable,children:e.label},e.value)),W[79]=ez,W[80]=k):k=W[80],W[81]!==k?(C=(0,tu.jsx)(tl.TabsList,{children:k}),W[81]=k,W[82]=C):C=W[82],W[83]!==eD||W[84]!==C?(j=(0,tu.jsx)(tl.Tabs,{value:eD,onValueChange:O,children:C}),W[83]=eD,W[84]=C,W[85]=j):j=W[85];let e1=eQ?.help;W[86]!==e1?(E=(0,tu.jsx)("p",{className:"text-muted-foreground mt-1.5 text-sm","data-cy":"report-destination-help",children:e1}),W[86]=e1,W[87]=E):E=W[87],W[88]!==j||W[89]!==E?(M=(0,tu.jsxs)("div",{children:[j,E]}),W[88]=j,W[89]=E,W[90]=M):M=W[90];let e2="new"===eD?"dialog-input":void 0;W[91]!==e2?(R=(0,tu.jsx)(tl.Label,{htmlFor:e2,className:"whitespace-nowrap pt-1.5 text-base",children:"Series Description"}),W[91]=e2,W[92]=R):R=W[92],W[93]!==eb?.description||W[94]!==e_.length||W[95]!==eP||W[96]!==eD||W[97]!==eZ||W[98]!==eU||W[99]!==ej||W[100]!==ex||W[101]!==eM||W[102]!==e$?(P="new"===eD?(0,tu.jsxs)("div",{className:"relative flex items-center gap-1",children:[(0,tu.jsx)(tl.Input,{ref:ep,id:"dialog-input","data-cy":"dialog-input",autoComplete:"off",placeholder:"Series description",value:ej,onChange:e=>eG(e.target.value),onKeyDown:eZ,onBlur:()=>eA(!1)}),e_.length>1&&(0,tu.jsx)("button",{type:"button","data-cy":"report-series-description-options","aria-label":"Series descriptions used before",className:"text-primary hover:bg-primary/25 shrink-0 rounded p-0.5",onMouseDown:sL,onClick:()=>{eL(-1),eT(!1),eA(sU)},children:(0,tu.jsx)(tl.Icons.ChevronOpen,{className:"h-5 w-5"})}),eP&&e$.length>0&&(0,tu.jsx)("ul",{className:"bg-popover text-popover-foreground border-input absolute left-0 right-0 top-full z-50 mt-1 max-h-40 overflow-auto rounded border p-1 shadow-md","data-cy":"report-series-description-list",children:e$.map((e,t)=>(0,tu.jsx)("li",{children:(0,tu.jsx)("button",{type:"button",className:(0,tl.cn)("hover:bg-accent hover:text-accent-foreground w-full truncate rounded px-2 py-1 text-left text-base",t===eU&&"bg-accent text-accent-foreground"),onMouseDown:sT,onClick:()=>eY(e),children:e})},e))})]}):"replace"===eD?(0,tu.jsxs)(tl.Select,{value:eM??void 0,onValueChange:eR,children:[(0,tu.jsx)(tl.SelectTrigger,{"data-cy":"report-replaced-series-select",children:(0,tu.jsx)(tl.SelectValue,{placeholder:"Select a series"})}),(0,tu.jsx)(tl.SelectContent,{children:ex.map(sN)})]}):(0,tu.jsx)("span",{className:"break-words pt-1.5 text-base","data-cy":"report-series-description",children:eb?.description??"No description"}),W[93]=eb?.description,W[94]=e_.length,W[95]=eP,W[96]=eD,W[97]=eZ,W[98]=eU,W[99]=ej,W[100]=ex,W[101]=eM,W[102]=e$,W[103]=P):P=W[103];let e3="new"===eD?"report-series-number":void 0;W[104]!==e3?(A=(0,tu.jsx)(tl.Label,{htmlFor:e3,className:"whitespace-nowrap pt-1.5 text-base",children:"Series Number"}),W[104]=e3,W[105]=A):A=W[105],W[106]!==eD||W[107]!==eX||W[108]!==ek||W[109]!==eB?(N="new"===eD?(0,tu.jsx)(tl.Input,{id:"report-series-number","data-cy":"report-series-number",type:"number",className:"w-28",value:ek,onChange:e=>eC(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eX())}}):(0,tu.jsx)("span",{className:"pt-1.5 text-base","data-cy":"report-series-number",children:eB?eB.seriesNumberLabel:""}),W[106]=eD,W[107]=eX,W[108]=ek,W[109]=eB,W[110]=N):N=W[110],W[111]!==I||W[112]!==M||W[113]!==R||W[114]!==P||W[115]!==A||W[116]!==N?(T=(0,tu.jsxs)("div",{className:"grid grid-cols-[7rem_minmax(0,1fr)] items-start gap-x-3 gap-y-4",children:[I,D,M,R,P,A,N]}),W[111]=I,W[112]=M,W[113]=R,W[114]=P,W[115]=A,W[116]=N,W[117]=T):T=W[117],W[118]!==eu||W[119]!==eK||W[120]!==eV||W[121]!==ec?(U=eu&&(0,tu.jsx)(tl.FooterAction.Left,{children:(0,tu.jsx)(tl.FooterAction.Secondary,{onClick:eK,dataCY:"report-download-button",disabled:eV,children:ec("Download")})}),W[118]=eu,W[119]=eK,W[120]=eV,W[121]=ec,W[122]=U):U=W[122],W[123]!==ec?(L=ec("Cancel"),W[123]=ec,W[124]=L):L=W[124],W[125]!==eJ||W[126]!==L?(F=(0,tu.jsx)(tl.FooterAction.Secondary,{onClick:eJ,dataCY:"input-dialog-cancel-button",children:L}),W[125]=eJ,W[126]=L,W[127]=F):F=W[127];let e4=eQ?.label;return W[128]!==eX||W[129]!==eV||W[130]!==e4?(B=(0,tu.jsx)(tl.FooterAction.Primary,{onClick:eX,dataCY:"input-dialog-save-button",disabled:eV,children:e4}),W[128]=eX,W[129]=eV,W[130]=e4,W[131]=B):B=W[131],W[132]!==F||W[133]!==B?(V=(0,tu.jsxs)(tl.FooterAction.Right,{children:[F,B]}),W[132]=F,W[133]=B,W[134]=V):V=W[134],W[135]!==U||W[136]!==V?(z=(0,tu.jsxs)(tl.FooterAction,{children:[U,V]}),W[135]=U,W[136]=V,W[137]=z):z=W[137],W[138]!==T||W[139]!==z?(H=(0,tu.jsxs)("div",{className:"text-foreground flex flex-col gap-4",children:[T,z]}),W[138]=T,W[139]=z,W[140]=H):H=W[140],H}},s$={"ohif.hotkeyBindings":K.defaults.hotkeyBindings};function sY(e,t=20,r=25){return new Promise(n=>{let a=0,i=setInterval(()=>{(document.querySelector(e)||a>=t)&&(clearInterval(i),n()),a++},r)})}let sG={"ohif.tours":[{id:"basicViewerTour",route:"/viewer",steps:[{id:"scroll",title:nz().t("Onboarding:Scrolling Through Images"),text:nz().t("Onboarding:You can scroll through the images using the mouse wheel or scrollbar."),attachTo:{element:".viewport-element",on:"top"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_WHEEL"},beforeShowPromise:()=>sY(".viewport-element")},{id:"zoom",title:nz().t("Onboarding:Zooming In and Out"),text:nz().t("Onboarding:You can zoom the images using the right click."),attachTo:{element:".viewport-element",on:"left"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_UP"},beforeShowPromise:()=>sY(".viewport-element")},{id:"pan",title:nz().t("Onboarding:Panning the Image"),text:nz().t("Onboarding:You can pan the images using the middle click."),attachTo:{element:".viewport-element",on:"top"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_UP"},beforeShowPromise:()=>sY(".viewport-element")},{id:"windowing",title:nz().t("Onboarding:Adjusting Window Level"),text:nz().t("Onboarding:You can modify the window level using the left click."),attachTo:{element:".viewport-element",on:"left"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_UP"},beforeShowPromise:()=>sY(".viewport-element")},{id:"length",title:nz().t("Onboarding:Using the Measurement Tools"),text:nz().t("Onboarding:You can measure the length of a region using the Length tool."),attachTo:{element:'[data-cy="MeasurementTools-split-button-primary"]',on:"bottom"},advanceOn:{selector:'[data-cy="MeasurementTools-split-button-primary"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="MeasurementTools-split-button-primary"]')},{id:"drawAnnotation",title:nz().t("Onboarding:Drawing Length Annotations"),text:nz().t("Onboarding:Use the length tool on the viewport to measure the length of a region."),attachTo:{element:".viewport-element",on:"right"},advanceOn:{selector:"body",event:"event::measurement_added"},beforeShowPromise:()=>sY(".viewport-element")},{id:"trackMeasurement",title:nz().t("Onboarding:Tracking Measurements in the Panel"),text:nz().t("Onboarding:Click yes to track the measurements in the measurement panel."),attachTo:{element:'[data-cy="prompt-begin-tracking-yes-btn"]',on:"bottom"},advanceOn:{selector:'[data-cy="prompt-begin-tracking-yes-btn"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="prompt-begin-tracking-yes-btn"]')},{id:"openMeasurementPanel",title:nz().t("Onboarding:Opening the Measurements Panel"),text:nz().t("Onboarding:Click the measurements button to open the measurements panel."),attachTo:{element:"#trackedMeasurements-btn",on:"left-start"},advanceOn:{selector:"#trackedMeasurements-btn",event:"click"},beforeShowPromise:()=>sY("#trackedMeasurements-btn")},{id:"scrollAwayFromMeasurement",title:nz().t("Onboarding:Scrolling Away from a Measurement"),text:nz().t("Onboarding:Scroll the images using the mouse wheel away from the measurement."),attachTo:{element:".viewport-element",on:"left"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_WHEEL"},beforeShowPromise:()=>sY(".viewport-element")},{id:"jumpToMeasurement",title:nz().t("Onboarding:Jumping to Measurements in the Panel"),text:nz().t("Onboarding:Click the measurement in the measurement panel to jump to it."),attachTo:{element:'[data-cy="data-row"]',on:"left-start"},advanceOn:{selector:'[data-cy="data-row"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="data-row"]')},{id:"changeLayout",title:nz().t("Onboarding:Changing Layout"),text:nz().t("Onboarding:You can change the layout of the viewer using the layout button, including MPR for multi-planar views."),attachTo:{element:'[data-cy="Layout"]',on:"bottom"},advanceOn:{selector:'[data-cy="Layout"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="Layout"]')}],tourOptions:{useModalOverlay:!0,defaultStepOptions:{buttons:[{text:nz().t("Onboarding:Skip all"),action(){this.complete()},secondary:!0}]}}}]},sq={instanceSortingCriteria:{sortFunctions:{},defaultSortFunctionName:""}},sX=function(){let e,t,r,n,a,i,o,s=(0,ti.c)(13),{commandsManager:l}=(0,K.useSystem)();return s[0]!==l?(e=()=>{l.run("undo")},s[0]=l,s[1]=e):e=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,tu.jsx)(tl.Icons.Undo,{className:""}),s[2]=t):t=s[2],s[3]!==e?(r=(0,tu.jsx)(tl.Button,{variant:"ghost",className:"hover:bg-muted","data-cy":"undo-btn",onClick:e,children:t}),s[3]=e,s[4]=r):r=s[4],s[5]!==l?(n=()=>{l.run("redo")},s[5]=l,s[6]=n):n=s[6],s[7]===Symbol.for("react.memo_cache_sentinel")?(a=(0,tu.jsx)(tl.Icons.Redo,{className:""}),s[7]=a):a=s[7],s[8]!==n?(i=(0,tu.jsx)(tl.Button,{variant:"ghost",className:"hover:bg-muted","data-cy":"redo-btn",onClick:n,children:a}),s[8]=n,s[9]=i):i=s[9],s[10]!==r||s[11]!==i?(o=(0,tu.jsxs)("div",{className:"text-primary flex cursor-pointer items-center",children:[r,i]}),s[10]=r,s[11]=i,s[12]=o):o=s[12],o},{formatPN:sK,formatDate:sJ}=K.utils,sZ=function(){let e,t,r,n,a,i=(0,ti.c)(10),{servicesManager:o}=(0,K.useSystem)(),{displaySetService:s}=o.services;i[0]===Symbol.for("react.memo_cache_sentinel")?(e={PatientName:"",PatientID:"",PatientSex:"",PatientDOB:""},i[0]=e):e=i[0];let[l,u]=(0,to.useState)(e),[c,d]=(0,to.useState)(!1);i[1]!==s?(t=e=>{let{displaySetsAdded:t}=e;if(!t.length)return;let r=t[0],n=r?.instances?.[0]||r?.instance;if(n){var a;let e,t;u({PatientID:n.PatientID||null,PatientName:n.PatientName?sK(n.PatientName):null,PatientSex:n.PatientSex||null,PatientDOB:sJ(n.PatientBirthDate)||null}),a=n.PatientID||null,e=s.getActiveDisplaySets(),t=!1,e.forEach(e=>{let r=e?.instances?.[0]||e?.instance;r&&r.PatientID!==a&&(t=!0)}),d(t)}},i[1]=s,i[2]=t):t=i[2];let f=t;return i[3]!==s||i[4]!==f?(r=()=>{let e=s.subscribe(s.EVENTS.DISPLAY_SETS_ADDED,e=>f(e));return()=>e.unsubscribe()},i[3]=s,i[4]=f,i[5]=r):r=i[5],i[6]===Symbol.for("react.memo_cache_sentinel")?(n=[],i[6]=n):n=i[6],(0,to.useEffect)(r,n),i[7]!==c||i[8]!==l?(a={patientInfo:l,isMixedPatients:c},i[7]=c,i[8]=l,i[9]=a):a=i[9],a},sQ=((b={}).VISIBLE="visible",b.VISIBLE_COLLAPSED="visibleCollapsed",b.DISABLED="disabled",b.VISIBLE_READONLY="visibleReadOnly",b),s0=(e,t)=>e?.length>t?e.substring(0,t)+"...":e;function s1(e){let t,r,n,a,i,o,s,l,u,c=(0,ti.c)(28),{showPatientInfo:d}=e,f=d===sQ.VISIBLE||d===sQ.VISIBLE_READONLY,[p,h]=(0,to.useState)(f),{patientInfo:g,isMixedPatients:m}=sZ();c[0]!==p||c[1]!==m?(t=()=>{m&&p&&h(!1)},r=[m,p],c[0]=p,c[1]=m,c[2]=t,c[3]=r):(t=c[2],r=c[3]),(0,to.useEffect)(t,r),c[4]!==p||c[5]!==m||c[6]!==d?(n=()=>{m||d===sQ.VISIBLE_READONLY||h(!p)},c[4]=p,c[5]=m,c[6]=d,c[7]=n):n=c[7];let y=n;c[8]!==g.PatientName?(a=s0(g.PatientName,27),c[8]=g.PatientName,c[9]=a):a=c[9];let v=a;c[10]!==g.PatientID?(i=s0(g.PatientID,15),c[10]=g.PatientID,c[11]=i):i=c[11];let b=i;c[12]!==m?(o=m?(0,tu.jsx)(tl.Icons.MultiplePatients,{className:"text-primary"}):(0,tu.jsx)(tl.Icons.Patient,{className:"text-primary"}),c[12]=m,c[13]=o):o=c[13],c[14]!==p||c[15]!==b||c[16]!==v||c[17]!==m||c[18]!==g.PatientDOB||c[19]!==g.PatientSex?(s=(0,tu.jsx)("div",{className:"flex flex-col justify-center",children:p?(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)("div",{className:"text-foreground self-start text-[13px] font-bold",children:v}),(0,tu.jsxs)("div",{className:"text-muted-foreground flex gap-2 text-[11px]",children:[(0,tu.jsx)("div",{children:b}),(0,tu.jsx)("div",{children:g.PatientSex}),(0,tu.jsx)("div",{children:g.PatientDOB})]})]}):(0,tu.jsx)("div",{className:"text-primary self-center text-[13px]",children:m?"Multiple Patients":"Patient"})}),c[14]=p,c[15]=b,c[16]=v,c[17]=m,c[18]=g.PatientDOB,c[19]=g.PatientSex,c[20]=s):s=c[20];let x=`text-primary ${p?"rotate-180":""}`;return c[21]!==x?(l=(0,tu.jsx)(tl.Icons.ArrowLeft,{className:x}),c[21]=x,c[22]=l):l=c[22],c[23]!==y||c[24]!==o||c[25]!==s||c[26]!==l?(u=(0,tu.jsxs)("div",{className:"hover:bg-muted flex cursor-pointer items-center justify-center gap-1 rounded-lg",onClick:y,children:[o,s,l]}),c[23]=y,c[24]=o,c[25]=s,c[26]=l,c[27]=u):u=c[27],u}let s2={"ohif.headerRightSide":{items:[sX,function(){let e,t=(0,ti.c)(2),{extensionManager:r}=(0,K.useSystem)(),{showPatientInfo:n}=r.appConfig;return n===sQ.DISABLED?null:(t[0]!==n?(e=(0,tu.jsx)(s1,{showPatientInfo:n}),t[0]=n,t[1]=e):e=t[1],e)}]}},s3={"ohif.headerRightSide":{items:{$filter:e=>e!==sX}}},s4=e=>{let t,r,n,a,i,o=(0,ti.c)(11),{displaySets:s}=e,{axis:l,series:u}=s[0].instance.chartData;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t={min:0},o[0]=t):t=o[0],o[1]!==l.x.label?(r={label:l.x.label,indexRef:0,type:"x",range:t},o[1]=l.x.label,o[2]=r):r=o[2],o[3]!==l.y.label?(n={label:l.y.label,indexRef:1,type:"y"},o[3]=l.y.label,o[4]=n):n=o[4],o[5]!==r||o[6]!==n?(a={x:r,y:n},o[5]=r,o[6]=n,o[7]=a):a=o[7],o[8]!==u||o[9]!==a?(i=(0,tu.jsx)(tl.LineChart,{showLegend:!0,legendWidth:150,axis:a,series:u}),o[8]=u,o[9]=a,o[10]=i):i=o[10],i};var s5=I(3425);let s8=J().classes.MetadataProvider;function s6(e){let t=K.utils.toNumber(e);return"number"==typeof t&&Number.isFinite(t)?t:void 0}let s9=e=>{let t=e?.images[0]?.ViewCodeSequence[0];if(!t)return;let{CodingSchemeDesignator:r,CodeValue:n}=t;if(r&&n)return`${r}:${n}`},s7=e=>{let t=e?.images?.[0]?.SharedFunctionalGroupsSequence?.[0]?.FrameAnatomySequence?.[0];if(t)return t?.FrameLaterality},le=K.classes.MetadataProvider,lt=({SeriesInstanceUID:e,StudyInstanceUID:t})=>{let{instances:r}=K.DicomMetadataStore.getSeries(t,e);if(!r?.length)return;let n=r[0].Modality;if(!["PT","RTDOSE"].includes(n))return;let a=r.map(e=>e.imageId),i=[];if("RTDOSE"===n){let e=r[0].DoseGridScaling,t=r[0].DoseSummation,n=r[0].DoseType,i=r[0].DoseUnit,o=r[0].NumberOfFrames,s=a[0];for(let r=0;r<o;r++){let a=r+1,o=`${s.replace(/\/frames\/\d+$/,"")}/frames/${a}`;le.addCustomMetadata(o,"scalingModule",{DoseGridScaling:e,DoseSummation:t,DoseType:n,DoseUnit:i})}return}try{if(a.forEach(e=>{let t=function(e){let t=s8.get("instance",e);if(!t)throw Error("dicom metadata are required");let r=function(e){if(null!=e&&"object"==typeof e)return Array.isArray(e)?e[0]:e}(t.RadiopharmaceuticalInformationSequence),n=s6(r?.RadionuclideHalfLife),a=s6(r?.RadionuclideTotalDose);if(void 0===t.SeriesDate||void 0===t.SeriesTime||void 0===t.CorrectedImage||void 0===t.Units||!r||void 0===n||void 0===a||void 0===t.DecayCorrection||void 0===t.AcquisitionDate||void 0===t.AcquisitionTime||void 0===r.RadiopharmaceuticalStartDateTime&&void 0===r.RadiopharmaceuticalStartTime)throw Error("required metadata are missing");void 0===t.PatientWeight&&console.warn("PatientWeight missing from PT instance metadata");let i={CorrectedImage:t.CorrectedImage,Units:t.Units,RadionuclideHalfLife:n,RadionuclideTotalDose:a,RadiopharmaceuticalStartDateTime:r.RadiopharmaceuticalStartDateTime,RadiopharmaceuticalStartTime:r.RadiopharmaceuticalStartTime,DecayCorrection:t.DecayCorrection,PatientWeight:s6(t.PatientWeight),SeriesDate:t.SeriesDate,SeriesTime:t.SeriesTime,AcquisitionDate:t.AcquisitionDate,AcquisitionTime:t.AcquisitionTime},o=s6(t["70531000"]),s=s6(t["70531009"]);(void 0!==o||void 0!==s)&&(i.PhilipsPETPrivateGroup={SUVScaleFactor:o,ActivityConcentrationScaleFactor:s}),void 0!==t["0009100d"]&&(i.GEPrivatePostInjectionDateTime=t["0009100d"]);let l=s6(t.FrameReferenceTime);void 0!==l&&(i.FrameReferenceTime=l);let u=s6(t.ActualFrameDuration);void 0!==u&&(i.ActualFrameDuration=u),void 0!==t.PatientSex&&(i.PatientSex=t.PatientSex);let c=s6(t.PatientSize);return void 0!==c&&(i.PatientSize=c),i}(e);t&&i.push(t)}),!i.length)return;let e=(0,s5.calculateSUVScalingFactors)(i);i.forEach((t,r)=>{le.addCustomMetadata(a[r],"scalingModule",e[r])})}catch(e){console.log(e)}};function lr(e){return!("object"==typeof e||Array.isArray(e))}let ln=new Set(["DS","FL","FD","IS","OD","OF","OL","OV","SL","SS","SV","UL","US","UV"]);function la(e,t){return Array.isArray(e)?e.map(e=>lr(e)?e:la(e,t)):(lr(e)||Object.keys(e).forEach(r=>{null===e[r].Value&&e[r].vr?delete e[r].Value:Array.isArray(e[r].Value)&&e[r].vr&&(1===e[r].Value.length&&e[r].Value[0].BulkDataURI?(t?.dataSourceConfig&&eI(e[r].Value[0],t,t.dataSourceConfig),e[r].BulkDataURI=e[r].Value[0].BulkDataURI,"https:"===window.location.protocol&&e[r].BulkDataURI.startsWith("http:")&&(e[r].BulkDataURI=e[r].BulkDataURI.replace("http:","https:")),delete e[r].Value):ln.has(e[r].vr)?e[r].Value=e[r].Value.map(e=>+e):e[r].Value=e[r].Value.map(e=>la(e,t)))}),e)}function li(e){return JSON.parse(JSON.stringify(la(e)))}function lo(e,t=["ImageType"]){for(let r of t)"string"==typeof e[r]&&(e[r]=e[r].split("\\"));return e}let ls=id()(e=>({type:"uiStateId",uiState:{},setUIState:(t,r)=>e(e=>({uiState:{...e.uiState,[t]:r}}),!1,"setUIState"),clearUIState:()=>e({uiState:{}},!1,"clearUIState")}));var ll=I(3154);function lu(e){let t,r,n,a,i,o=(0,ti.c)(15),{hide:s,onSave:l,placeholder:u,defaultValue:c,submitOnEnter:d}=e,f=void 0===u?"Enter value":u,p=void 0===c?"":c;return o[0]!==f?(t=(0,tu.jsx)(tl.InputDialog.Field,{children:(0,tu.jsx)(tl.InputDialog.Input,{placeholder:f})}),o[0]=f,o[1]=t):t=o[1],o[2]!==s?(r=(0,tu.jsx)(tl.InputDialog.ActionsSecondary,{onClick:s,children:"Cancel"}),o[2]=s,o[3]=r):r=o[3],o[4]!==s||o[5]!==l?(n=(0,tu.jsx)(tl.InputDialog.ActionsPrimary,{onClick:e=>{l(e),s()},children:"Save"}),o[4]=s,o[5]=l,o[6]=n):n=o[6],o[7]!==r||o[8]!==n?(a=(0,tu.jsxs)(tl.InputDialog.Actions,{children:[r,n]}),o[7]=r,o[8]=n,o[9]=a):a=o[9],o[10]!==p||o[11]!==d||o[12]!==t||o[13]!==a?(i=(0,tu.jsxs)(tl.InputDialog,{submitOnEnter:d,defaultValue:p,children:[t,a]}),o[10]=p,o[11]=d,o[12]=t,o[13]=a,o[14]=i):i=o[14],i}async function lc({uiDialogService:e,defaultValue:t="",title:r="Annotation",placeholder:n="",submitOnEnter:a=!0}){return await new Promise(i=>{e.show({id:"dialog-enter-annotation",content:lu,title:r,shouldCloseOnEsc:!0,contentProps:{onSave:e=>{i(e)},placeholder:n,defaultValue:t,submitOnEnter:a}})})}async function ld({measurement:e,uiDialogService:t,labelConfig:r,renderContent:n=tl.LabellingFlow,element:a}){let i=!!r&&r.exclusive,o=r?r.items:[];return await new Promise((r,s)=>{t.show({id:"select-annotation",title:"Annotation",content:n,contentProps:{labellingDoneCallback:n=>{if(t.hide("select-annotation"),e&&"string"==typeof n){let t=aC.annotation.state.getAnnotation(e.uid);(0,ll.setAnnotationLabel)(t,a,n)}r(n)},measurementData:e,componentClassName:{},labelData:o,exclusive:i}})})}var lf=I(6457),lp=function(e,t,r,n,a){var i=a.clientWidth,o=a.clientHeight,s="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,u=s-(a.getBoundingClientRect().left+window.pageXOffset),c=l-(a.getBoundingClientRect().top+window.pageYOffset);if("vertical"===r){var d=void 0;if(d=c<0?0:c>o?1:Math.round(100*c/o)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(n!==(f=u<0?0:u>i?1:Math.round(100*u/i)/100))return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},lh={},lg=function(e,t,r,n){if("u"<typeof document&&!n)return null;var a=n?new n:document.createElement("canvas");a.width=2*r,a.height=2*r;var i=a.getContext("2d");return i?(i.fillStyle=e,i.fillRect(0,0,a.width,a.height),i.fillStyle=t,i.fillRect(0,0,r,r),i.translate(r,r),i.fillRect(0,0,r,r),a.toDataURL()):null},lm=function(e,t,r,n){var a=e+"-"+t+"-"+r+(n?"-server":"");if(lh[a])return lh[a];var i=lg(e,t,r,n);return lh[a]=i,i},ly=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lv=function(e){var t=e.white,r=e.grey,n=e.size,a=e.renderers,i=e.borderRadius,o=e.boxShadow,s=e.children,l=(0,lf.Ay)({default:{grid:{borderRadius:i,boxShadow:o,absolute:"0px 0px 0px 0px",background:"url("+lm(t,r,n,a.canvas)+") center left"}}});return(0,to.isValidElement)(s)?to.cloneElement(s,ly({},s.props,{style:ly({},s.props.style,l.grid)})):to.createElement("div",{style:l.grid})};lv.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var lb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lx=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function lS(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var lw=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");for(var e,r,n,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=n=lS(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.handleChange=function(e){var t=lp(e,n.props.hsl,n.props.direction,n.props.a,n.container);t&&"function"==typeof n.props.onChange&&n.props.onChange(t,e)},n.handleMouseDown=function(e){n.handleChange(e),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},lS(n,r)}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),lx(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,r=(0,lf.Ay)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:lb({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return to.createElement("div",{style:r.alpha},to.createElement("div",{style:r.checkboard},to.createElement(lv,{renderers:this.props.renderers})),to.createElement("div",{style:r.gradient}),to.createElement("div",{style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},to.createElement("div",{style:r.pointer},this.props.pointer?to.createElement(this.props.pointer,this.props):to.createElement("div",{style:r.slider}))))}}]),t}(to.PureComponent||to.Component),l_=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),lI=[38,40],lD=1,lO=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(e){r.setUpdatedValue(e.target.value,e)},r.handleKeyDown=function(e){var t,n=Number(String(e.target.value).replace(/%/g,""));if(!isNaN(n)&&(t=e.keyCode,lI.indexOf(t)>-1)){var a=r.getArrowOffset(),i=38===e.keyCode?n+a:n-a;r.setUpdatedValue(i,e)}},r.handleDrag=function(e){if(r.props.dragLabel){var t=Math.round(r.props.value+e.movementX);t>=0&&t<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(t),e)}},r.handleMouseDown=function(e){r.props.dragLabel&&(e.preventDefault(),r.handleDrag(e),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},r.inputId="rc-editable-input-"+lD++,r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),l_(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){var t,r;return t={},r=this.props.label,r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var r=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(r,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,lf.Ay)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return to.createElement("div",{style:t.wrap},to.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?to.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(to.PureComponent||to.Component),lk=function(e,t,r,n){var a=n.clientWidth,i=n.clientHeight,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=o-(n.getBoundingClientRect().left+window.pageXOffset),u=s-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(c=u<0?359:u>i?0:360*(-(100*u/i)+100)/100,r.h!==c)return{h:c,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var d=void 0;if(d=l<0?0:l>a?359:100*l/a*360/100,r.h!==d)return{h:d,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},lC=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function lj(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var lE=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");for(var e,r,n,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=n=lj(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.handleChange=function(e){var t=lk(e,n.props.direction,n.props.hsl,n.container);t&&"function"==typeof n.props.onChange&&n.props.onChange(t,e)},n.handleMouseDown=function(e){n.handleChange(e),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},lj(n,r)}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),lC(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,r=void 0===t?"horizontal":t,n=(0,lf.Ay)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(100*this.props.hsl.h/360)+100+"%"}}},{vertical:"vertical"===r});return to.createElement("div",{style:n.hue},to.createElement("div",{className:"hue-"+r,style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},to.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),to.createElement("div",{style:n.pointer},this.props.pointer?to.createElement(this.props.pointer,this.props):to.createElement("div",{style:n.slider}))))}}]),t}(to.PureComponent||to.Component),lM=I(7598),lR=I.n(lM);let lP=function(e,t){return e===t||e!=e&&t!=t},lA=function(e,t){for(var r=e.length;r--;)if(lP(e[r][0],t))return r;return -1};var lN=Array.prototype.splice;function lT(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}lT.prototype.clear=function(){this.__data__=[],this.size=0},lT.prototype.delete=function(e){var t=this.__data__,r=lA(t,e);return!(r<0)&&(r==t.length-1?t.pop():lN.call(t,r,1),--this.size,!0)},lT.prototype.get=function(e){var t=this.__data__,r=lA(t,e);return r<0?void 0:t[r][1]},lT.prototype.has=function(e){return lA(this.__data__,e)>-1},lT.prototype.set=function(e,t){var r=this.__data__,n=lA(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var lU="object"==typeof global&&global&&global.Object===Object&&global,lL="object"==typeof self&&self&&self.Object===Object&&self,lF=lU||lL||Function("return this")(),lB=lF.Symbol,lV=Object.prototype,lz=lV.hasOwnProperty,lH=lV.toString,lW=lB?lB.toStringTag:void 0;let l$=function(e){var t=lz.call(e,lW),r=e[lW];try{e[lW]=void 0;var n=!0}catch(e){}var a=lH.call(e);return n&&(t?e[lW]=r:delete e[lW]),a};var lY=Object.prototype.toString,lG=lB?lB.toStringTag:void 0;let lq=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":lG&&lG in Object(e)?l$(e):lY.call(e)},lX=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},lK=function(e){if(!lX(e))return!1;var t=lq(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var lJ=lF["__core-js_shared__"],lZ=(x=/[^.]+$/.exec(lJ&&lJ.keys&&lJ.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",lQ=Function.prototype.toString;let l0=function(e){if(null!=e){try{return lQ.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var l1=/^\[object .+?Constructor\]$/,l2=Object.prototype,l3=Function.prototype.toString,l4=l2.hasOwnProperty,l5=RegExp("^"+l3.call(l4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let l8=function(e){return!!lX(e)&&(!lZ||!(lZ in e))&&(lK(e)?l5:l1).test(l0(e))},l6=function(e,t){var r=null==e?void 0:e[t];return l8(r)?r:void 0};var l9=l6(lF,"Map"),l7=l6(Object,"create"),ue=Object.prototype.hasOwnProperty,ut=Object.prototype.hasOwnProperty;function ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ur.prototype.clear=function(){this.__data__=l7?l7(null):{},this.size=0},ur.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},ur.prototype.get=function(e){var t=this.__data__;if(l7){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ue.call(t,e)?t[e]:void 0},ur.prototype.has=function(e){var t=this.__data__;return l7?void 0!==t[e]:ut.call(t,e)},ur.prototype.set=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=l7&&void 0===t?"__lodash_hash_undefined__":t,this};let un=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},ua=function(e,t){var r=e.__data__;return un(t)?r["string"==typeof t?"string":"hash"]:r.map};function ui(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function uo(e){var t=this.__data__=new lT(e);this.size=t.size}ui.prototype.clear=function(){this.size=0,this.__data__={hash:new ur,map:new(l9||lT),string:new ur}},ui.prototype.delete=function(e){var t=ua(this,e).delete(e);return this.size-=!!t,t},ui.prototype.get=function(e){return ua(this,e).get(e)},ui.prototype.has=function(e){return ua(this,e).has(e)},ui.prototype.set=function(e,t){var r=ua(this,e),n=r.size;return r.set(e,t),this.size+=+(r.size!=n),this},uo.prototype.clear=function(){this.__data__=new lT,this.size=0},uo.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},uo.prototype.get=function(e){return this.__data__.get(e)},uo.prototype.has=function(e){return this.__data__.has(e)},uo.prototype.set=function(e,t){var r=this.__data__;if(r instanceof lT){var n=r.__data__;if(!l9||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ui(n)}return r.set(e,t),this.size=r.size,this};var us=function(){try{var e=l6(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();let ul=function(e,t,r){"__proto__"==t&&us?us(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},uu=function(e,t,r){(void 0===r||lP(e[t],r))&&(void 0!==r||t in e)||ul(e,t,r)},uc=function(e,t,r){for(var n=-1,a=Object(e),i=r(e),o=i.length;o--;){var s=i[++n];if(!1===t(a[s],s,a))break}return e};var ud="object"==typeof exports&&exports&&!exports.nodeType&&exports,uf=ud&&"object"==typeof module&&module&&!module.nodeType&&module,up=uf&&uf.exports===ud?lF.Buffer:void 0,uh=up?up.allocUnsafe:void 0;let ug=function(e,t){if(t)return e.slice();var r=e.length,n=uh?uh(r):new e.constructor(r);return e.copy(n),n};var um=lF.Uint8Array;let uy=function(e){var t=new e.constructor(e.byteLength);return new um(t).set(new um(e)),t},uv=function(e,t){var r=t?uy(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},ub=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};var ux=Object.create,uS=function(){function e(){}return function(t){if(!lX(t))return{};if(ux)return ux(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();let uw=function(e,t){return function(r){return e(t(r))}};var u_=uw(Object.getPrototypeOf,Object),uI=Object.prototype;let uD=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||uI)},uO=function(e){return null!=e&&"object"==typeof e},uk=function(e){return uO(e)&&"[object Arguments]"==lq(e)};var uC=Object.prototype,uj=uC.hasOwnProperty,uE=uC.propertyIsEnumerable,uM=uk(function(){return arguments}())?uk:function(e){return uO(e)&&uj.call(e,"callee")&&!uE.call(e,"callee")},uR=Array.isArray;let uP=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},uA=function(e){return null!=e&&uP(e.length)&&!lK(e)};var uN="object"==typeof exports&&exports&&!exports.nodeType&&exports,uT=uN&&"object"==typeof module&&module&&!module.nodeType&&module,uU=uT&&uT.exports===uN?lF.Buffer:void 0;let uL=(uU?uU.isBuffer:void 0)||function(){return!1};var uF=Object.prototype,uB=Function.prototype.toString,uV=uF.hasOwnProperty,uz=uB.call(Object);let uH=function(e){if(!uO(e)||"[object Object]"!=lq(e))return!1;var t=u_(e);if(null===t)return!0;var r=uV.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&uB.call(r)==uz};var uW={};uW["[object Float32Array]"]=uW["[object Float64Array]"]=uW["[object Int8Array]"]=uW["[object Int16Array]"]=uW["[object Int32Array]"]=uW["[object Uint8Array]"]=uW["[object Uint8ClampedArray]"]=uW["[object Uint16Array]"]=uW["[object Uint32Array]"]=!0,uW["[object Arguments]"]=uW["[object Array]"]=uW["[object ArrayBuffer]"]=uW["[object Boolean]"]=uW["[object DataView]"]=uW["[object Date]"]=uW["[object Error]"]=uW["[object Function]"]=uW["[object Map]"]=uW["[object Number]"]=uW["[object Object]"]=uW["[object RegExp]"]=uW["[object Set]"]=uW["[object String]"]=uW["[object WeakMap]"]=!1;var u$="object"==typeof exports&&exports&&!exports.nodeType&&exports,uY=u$&&"object"==typeof module&&module&&!module.nodeType&&module,uG=uY&&uY.exports===u$&&lU.process,uq=function(){try{var e=uY&&uY.require&&uY.require("util").types;if(e)return e;return uG&&uG.binding&&uG.binding("util")}catch(e){}}(),uX=uq&&uq.isTypedArray,uK=uX?function(e){return uX(e)}:function(e){return uO(e)&&uP(e.length)&&!!uW[lq(e)]};let uJ=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var uZ=Object.prototype.hasOwnProperty;let uQ=function(e,t,r){var n=e[t];uZ.call(e,t)&&lP(n,r)&&(void 0!==r||t in e)||ul(e,t,r)},u0=function(e,t,r,n){var a=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),a?ul(r,s,l):uQ(r,s,l)}return r},u1=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var u2=/^(?:0|[1-9]\d*)$/;let u3=function(e,t){var r=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==r||"symbol"!=r&&u2.test(e))&&e>-1&&e%1==0&&e<t};var u4=Object.prototype.hasOwnProperty;let u5=function(e,t){var r=uR(e),n=!r&&uM(e),a=!r&&!n&&uL(e),i=!r&&!n&&!a&&uK(e),o=r||n||a||i,s=o?u1(e.length,String):[],l=s.length;for(var u in e)(t||u4.call(e,u))&&!(o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||u3(u,l)))&&s.push(u);return s},u8=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t};var u6=Object.prototype.hasOwnProperty;let u9=function(e){if(!lX(e))return u8(e);var t=uD(e),r=[];for(var n in e)"constructor"==n&&(t||!u6.call(e,n))||r.push(n);return r},u7=function(e){return uA(e)?u5(e,!0):u9(e)},ce=function(e,t,r,n,a,i,o){var s=uJ(e,r),l=uJ(t,r),u=o.get(l);if(u)return void uu(e,r,u);var c=i?i(s,l,r+"",e,t,o):void 0,d=void 0===c;if(d){var f=uR(l),p=!f&&uL(l),h=!f&&!p&&uK(l);(c=l,f||p||h)?uR(s)?c=s:uO(s)&&uA(s)?c=ub(s):p?(d=!1,c=ug(l,!0)):h?(d=!1,c=uv(l,!0)):c=[]:uH(l)||uM(l)?(c=s,uM(s))?c=u0(s,u7(s)):(!lX(s)||lK(s))&&(c="function"!=typeof l.constructor||uD(l)?{}:uS(u_(l))):d=!1}d&&(o.set(l,c),a(c,l,n,i,o),o.delete(l)),uu(e,r,c)},ct=function e(t,r,n,a,i){t!==r&&uc(r,function(o,s){if(i||(i=new uo),lX(o))ce(t,r,s,n,e,a,i);else{var l=a?a(uJ(t,s),o,s+"",t,r,i):void 0;void 0===l&&(l=o),uu(t,s,l)}},u7)},cr=function(e){return e},cn=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)};var ca=Math.max,ci=Date.now,co=(S=us?function(e,t){return us(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:cr,w=0,_=0,function(){var e=ci(),t=16-(e-_);if(_=e,t>0){if(++w>=800)return arguments[0]}else w=0;return S.apply(void 0,arguments)});let cs=function(e,t,r){if(!lX(r))return!1;var n=typeof t;return("number"==n?!!(uA(r)&&u3(t,r.length)):"string"==n&&t in r)&&lP(r[t],e)};var cl=(O=function(e,t,r){ct(e,t,r)},co((e=function(e,t){var r=-1,n=t.length,a=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(a=O.length>3&&"function"==typeof a?(n--,a):void 0,i&&cs(t[0],t[1],i)&&(a=n<3?void 0:a,n=1),e=Object(e);++r<n;){var o=t[r];o&&O(e,o,r)}return e},t=ca((t=void 0,e.length-1),0),function(){for(var r=arguments,n=-1,a=ca(r.length-t,0),i=Array(a);++n<a;)i[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];return o[t]=cr(i),cn(e,this,o)}),e+"")),cu=function(e){var t=e.zDepth,r=e.radius,n=e.background,a=e.children,i=e.styles,o=(0,lf.Ay)(cl({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+4*t+"px rgba(0,0,0,.24)",borderRadius:r,background:n}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},void 0===i?{}:i),{"zDepth-1":1===t});return to.createElement("div",{style:o.wrap},to.createElement("div",{style:o.bg}),to.createElement("div",{style:o.content},a))};cu.propTypes={background:lR().string,zDepth:lR().oneOf([0,1,2,3,4,5]),radius:lR().number,styles:lR().object},cu.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};let cc=function(){return lF.Date.now()};var cd=/\s/;let cf=function(e){for(var t=e.length;t--&&cd.test(e.charAt(t)););return t};var cp=/^\s+/;let ch=function(e){return"symbol"==typeof e||uO(e)&&"[object Symbol]"==lq(e)};var cg=0/0,cm=/^[-+]0x[0-9a-f]+$/i,cy=/^0b[01]+$/i,cv=/^0o[0-7]+$/i,cb=parseInt;let cx=function(e){if("number"==typeof e)return e;if(ch(e))return cg;if(lX(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=lX(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,cf(t)+1).replace(cp,""):t;var n=cy.test(e);return n||cv.test(e)?cb(e.slice(2),n?2:8):cm.test(e)?cg:+e};var cS=Math.max,cw=Math.min;let c_=function(e,t,r){var n,a,i,o,s,l,u=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(t){var r=n,i=a;return n=a=void 0,u=t,o=e.apply(i,r)}function h(e){var r=e-l,n=e-u;return void 0===l||r>=t||r<0||d&&n>=i}function g(){var e,r,n,a=cc();if(h(a))return m(a);s=setTimeout(g,(e=a-l,r=a-u,n=t-e,d?cw(n,i-r):n))}function m(e){return(s=void 0,f&&n)?p(e):(n=a=void 0,o)}function y(){var e,r=cc(),i=h(r);if(n=arguments,a=this,l=r,i){if(void 0===s)return u=e=l,s=setTimeout(g,t),c?p(e):o;if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),o}return t=cx(t)||0,lX(r)&&(c=!!r.leading,i=(d="maxWait"in r)?cS(cx(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=l=a=s=void 0},y.flush=function(){return void 0===s?o:m(cc())},y},cI=function(e,t,r){var n=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return lX(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),c_(e,t,{leading:n,maxWait:t,trailing:a})};var cD=function(e,t,r){var n=r.getBoundingClientRect(),a=n.width,i=n.height,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=o-(r.getBoundingClientRect().left+window.pageXOffset),u=s-(r.getBoundingClientRect().top+window.pageYOffset);l<0?l=0:l>a&&(l=a),u<0?u=0:u>i&&(u=i);var c=l/a,d=1-u/i;return{h:t.h,s:c,v:d,a:t.a,source:"hsv"}},cO=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),ck=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.handleChange=function(e){"function"==typeof r.props.onChange&&r.throttle(r.props.onChange,cD(e,r.props.hsl,r.container),e)},r.handleMouseDown=function(e){r.handleChange(e);var t=r.getContainerRenderWindow();t.addEventListener("mousemove",r.handleChange),t.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.throttle=cI(function(e,t,r){e(t,r)},50),r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),cO(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},r=t.color,n=t.white,a=t.black,i=t.pointer,o=t.circle,s=(0,lf.Ay)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(100*this.props.hsv.v)+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:r,white:n,black:a,pointer:i,circle:o}},{custom:!!this.props.style});return to.createElement("div",{style:s.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},to.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),to.createElement("div",{style:s.white,className:"saturation-white"},to.createElement("div",{style:s.black,className:"saturation-black"}),to.createElement("div",{style:s.pointer},this.props.pointer?to.createElement(this.props.pointer,this.props):to.createElement("div",{style:s.circle}))))}}]),t}(to.PureComponent||to.Component);let cC=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e};var cj=uw(Object.keys,Object),cE=Object.prototype.hasOwnProperty;let cM=function(e){if(!uD(e))return cj(e);var t=[];for(var r in Object(e))cE.call(e,r)&&"constructor"!=r&&t.push(r);return t},cR=function(e){return uA(e)?u5(e):cM(e)};var cP=(k=function(e,t){return e&&uc(e,t,cR)},function(e,t){if(null==e)return e;if(!uA(e))return k(e,t);for(var r=e.length,n=-1,a=Object(e);++n<r&&!1!==t(a[n],n,a););return e});let cA=function(e,t){return(uR(e)?cC:cP)(e,"function"==typeof t?t:cr)};function cN(e){return(cN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var cT=/^\s+/,cU=/\s+$/;function cL(e,t){if(t=t||{},(e=e||"")instanceof cL)return e;if(!(this instanceof cL))return new cL(e,t);var r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w=(n={r:0,g:0,b:0},a=1,i=null,o=null,s=null,l=!1,u=!1,"string"==typeof(r=e)&&(r=function(e){e=e.replace(cT,"").replace(cU,"").toLowerCase();var t,r=!1;if(c1[e])e=c1[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=de.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=de.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=de.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=de.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=de.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=de.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=de.hex8.exec(e))?{r:c8(t[1]),g:c8(t[2]),b:c8(t[3]),a:c8(t[4])/255,format:r?"name":"hex8"}:(t=de.hex6.exec(e))?{r:c8(t[1]),g:c8(t[2]),b:c8(t[3]),format:r?"name":"hex"}:(t=de.hex4.exec(e))?{r:c8(t[1]+""+t[1]),g:c8(t[2]+""+t[2]),b:c8(t[3]+""+t[3]),a:c8(t[4]+""+t[4])/255,format:r?"name":"hex8"}:!!(t=de.hex3.exec(e))&&{r:c8(t[1]+""+t[1]),g:c8(t[2]+""+t[2]),b:c8(t[3]+""+t[3]),format:r?"name":"hex"}}(r)),"object"==cN(r)&&(dt(r.r)&&dt(r.g)&&dt(r.b)?(c=r.r,d=r.g,f=r.b,n={r:255*c4(c,255),g:255*c4(d,255),b:255*c4(f,255)},l=!0,u="%"===String(r.r).substr(-1)?"prgb":"rgb"):dt(r.h)&&dt(r.s)&&dt(r.v)?(i=c9(r.s),o=c9(r.v),p=r.h,h=i,g=o,p=6*c4(p,360),h=c4(h,100),g=c4(g,100),m=Math.floor(p),y=p-m,v=g*(1-h),b=g*(1-y*h),x=g*(1-(1-y)*h),n={r:255*[g,b,v,v,x,g][S=m%6],g:255*[x,g,g,b,v,v][S],b:255*[v,v,x,g,g,b][S]},l=!0,u="hsv"):dt(r.h)&&dt(r.s)&&dt(r.l)&&(i=c9(r.s),s=c9(r.l),n=function(e,t,r){var n,a,i;function o(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=c4(e,360),t=c4(t,100),r=c4(r,100),0===t)n=a=i=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),a=o(l,s,e),i=o(l,s,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(r.h,i,s),l=!0,u="hsl"),r.hasOwnProperty("a")&&(a=r.a)),a=c3(a),{ok:l,format:r.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:a});this._originalInput=e,this._r=w.r,this._g=w.g,this._b=w.b,this._a=w.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||w.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=w.ok}function cF(e,t,r){e=c4(e,255);var n,a,i=Math.max(e,t=c4(t,255),r=c4(r,255)),o=Math.min(e,t,r),s=(i+o)/2;if(i==o)n=a=0;else{var l=i-o;switch(a=s>.5?l/(2-i-o):l/(i+o),i){case e:n=(t-r)/l+6*(t<r);break;case t:n=(r-e)/l+2;break;case r:n=(e-t)/l+4}n/=6}return{h:n,s:a,l:s}}function cB(e,t,r){e=c4(e,255);var n,a=Math.max(e,t=c4(t,255),r=c4(r,255)),i=Math.min(e,t,r),o=a-i;if(a==i)n=0;else{switch(a){case e:n=(t-r)/o+6*(t<r);break;case t:n=(r-e)/o+2;break;case r:n=(e-t)/o+4}n/=6}return{h:n,s:0===a?0:o/a,v:a}}function cV(e,t,r,n){var a=[c6(Math.round(e).toString(16)),c6(Math.round(t).toString(16)),c6(Math.round(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function cz(e,t,r,n){return[c6(c7(n)),c6(Math.round(e).toString(16)),c6(Math.round(t).toString(16)),c6(Math.round(r).toString(16))].join("")}function cH(e,t){t=0===t?0:t||10;var r=cL(e).toHsl();return r.s-=t/100,r.s=c5(r.s),cL(r)}function cW(e,t){t=0===t?0:t||10;var r=cL(e).toHsl();return r.s+=t/100,r.s=c5(r.s),cL(r)}function c$(e){return cL(e).desaturate(100)}function cY(e,t){t=0===t?0:t||10;var r=cL(e).toHsl();return r.l+=t/100,r.l=c5(r.l),cL(r)}function cG(e,t){t=0===t?0:t||10;var r=cL(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),cL(r)}function cq(e,t){t=0===t?0:t||10;var r=cL(e).toHsl();return r.l-=t/100,r.l=c5(r.l),cL(r)}function cX(e,t){var r=cL(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,cL(r)}function cK(e){var t=cL(e).toHsl();return t.h=(t.h+180)%360,cL(t)}function cJ(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var r=cL(e).toHsl(),n=[cL(e)],a=360/t,i=1;i<t;i++)n.push(cL({h:(r.h+i*a)%360,s:r.s,l:r.l}));return n}function cZ(e){var t=cL(e).toHsl(),r=t.h;return[cL(e),cL({h:(r+72)%360,s:t.s,l:t.l}),cL({h:(r+216)%360,s:t.s,l:t.l})]}function cQ(e,t,r){t=t||6,r=r||30;var n=cL(e).toHsl(),a=360/r,i=[cL(e)];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(cL(n));return i}function c0(e,t){t=t||6;for(var r=cL(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/t;t--;)o.push(cL({h:n,s:a,v:i})),i=(i+s)%1;return o}cL.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((r=n.b/255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=c3(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=cB(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=cB(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=cF(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=cF(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return cV(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,r,n,a,i,o;return t=this._r,r=this._g,n=this._b,a=this._a,i=e,o=[c6(Math.round(t).toString(16)),c6(Math.round(r).toString(16)),c6(Math.round(n).toString(16)),c6(c7(a))],i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*c4(this._r,255))+"%",g:Math.round(100*c4(this._g,255))+"%",b:Math.round(100*c4(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*c4(this._r,255))+"%, "+Math.round(100*c4(this._g,255))+"%, "+Math.round(100*c4(this._b,255))+"%)":"rgba("+Math.round(100*c4(this._r,255))+"%, "+Math.round(100*c4(this._g,255))+"%, "+Math.round(100*c4(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(c2[cV(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+cz(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=cL(e);r="#"+cz(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return!t&&n&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return cL(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(cY,arguments)},brighten:function(){return this._applyModification(cG,arguments)},darken:function(){return this._applyModification(cq,arguments)},desaturate:function(){return this._applyModification(cH,arguments)},saturate:function(){return this._applyModification(cW,arguments)},greyscale:function(){return this._applyModification(c$,arguments)},spin:function(){return this._applyModification(cX,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(cQ,arguments)},complement:function(){return this._applyCombination(cK,arguments)},monochromatic:function(){return this._applyCombination(c0,arguments)},splitcomplement:function(){return this._applyCombination(cZ,arguments)},triad:function(){return this._applyCombination(cJ,[3])},tetrad:function(){return this._applyCombination(cJ,[4])}},cL.fromRatio=function(e,t){if("object"==cN(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&("a"===n?r[n]=e[n]:r[n]=c9(e[n]));e=r}return cL(e,t)},cL.equals=function(e,t){return!!e&&!!t&&cL(e).toRgbString()==cL(t).toRgbString()},cL.random=function(){return cL.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},cL.mix=function(e,t,r){r=0===r?0:r||50;var n=cL(e).toRgb(),a=cL(t).toRgb(),i=r/100;return cL({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},cL.readability=function(e,t){var r=cL(e),n=cL(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},cL.isReadable=function(e,t,r){var n,a,i,o,s,l=cL.readability(e,t);switch(s=!1,(a=((n=(n=r)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),i=(n.size||"small").toLowerCase(),"AA"!==a&&"AAA"!==a&&(a="AA"),"small"!==i&&"large"!==i&&(i="small"),o={level:a,size:i}).level+o.size){case"AAsmall":case"AAAlarge":s=l>=4.5;break;case"AAlarge":s=l>=3;break;case"AAAsmall":s=l>=7}return s},cL.mostReadable=function(e,t,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=cL.readability(e,t[u]))>l&&(l=n,s=cL(t[u]));return cL.isReadable(e,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,cL.mostReadable(e,["#fff","#000"],r))};var c1=cL.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},c2=cL.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(c1);function c3(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function c4(e,t){"string"==typeof(r=e)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,a="string"==typeof(n=e)&&-1!=n.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),a&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function c5(e){return Math.min(1,Math.max(0,e))}function c8(e){return parseInt(e,16)}function c6(e){return 1==e.length?"0"+e:""+e}function c9(e){return e<=1&&(e=100*e+"%"),e}function c7(e){return Math.round(255*parseFloat(e)).toString(16)}var de=(j="[\\s|\\(]+("+(C="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+C+")[,|\\s]+("+C+")\\s*\\)?",E="[\\s|\\(]+("+C+")[,|\\s]+("+C+")[,|\\s]+("+C+")[,|\\s]+("+C+")\\s*\\)?",{CSS_UNIT:new RegExp(C),rgb:RegExp("rgb"+j),rgba:RegExp("rgba"+E),hsl:RegExp("hsl"+j),hsla:RegExp("hsla"+E),hsv:RegExp("hsv"+j),hsva:RegExp("hsva"+E),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function dt(e){return!!de.CSS_UNIT.exec(e)}var dr=function(e){var t=0,r=0;return cA(["r","g","b","a","h","s","l","v"],function(n){e[n]&&(t+=1,isNaN(e[n])||(r+=1),("s"===n||"l"===n)&&/^\d+%$/.test(e[n])&&(r+=1))}),t===r&&e},dn=function(e,t){var r=e.hex?cL(e.hex):cL(e),n=r.toHsl(),a=r.toHsv(),i=r.toRgb(),o=r.toHex();return 0===n.s&&(n.h=t||0,a.h=t||0),{hsl:n,hex:"000000"===o&&0===i.a?"transparent":"#"+o,rgb:i,hsv:a,oldHue:e.h||t||n.h,source:e.source}},da=function(e){if("transparent"===e)return!0;var t=+("#"===String(e).charAt(0));return e.length!==4+t&&e.length<7+t&&cL(e).isValid()},di=function(e){if(!e)return"#fff";var t=dn(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},ds=function(e,t){return cL(t+" ("+e.replace("°","")+")")._ok},dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},du=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();let dc=function(e){var t=function(t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);function r(e){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.handleChange=function(e,r){if(dr(e)){var n=dn(e,e.h||t.state.oldHue);t.setState(n),t.props.onChangeComplete&&t.debounce(t.props.onChangeComplete,n,r),t.props.onChange&&t.props.onChange(n,r)}},t.handleSwatchHover=function(e,r){if(dr(e)){var n=dn(e,e.h||t.state.oldHue);t.props.onSwatchHover&&t.props.onSwatchHover(n,r)}},t.state=dl({},dn(e.color,0)),t.debounce=c_(function(e,t,r){e(t,r)},100),t}return r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t),du(r,[{key:"render",value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),to.createElement(e,dl({},this.props,this.state,{onChange:this.handleChange},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return dl({},dn(e.color,t.oldHue))}}]),r}(to.PureComponent||to.Component);return t.propTypes=dl({},e.propTypes),t.defaultProps=dl({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t};var dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},df=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function dp(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var dh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};let dg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span",r=to.Component;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function, not "+typeof r);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var e,t,r,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=r=dp(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),r.state={focus:!1},r.handleFocus=function(){return r.setState({focus:!0})},r.handleBlur=function(){return r.setState({focus:!1})},dp(r,t)}return n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r),df(n,[{key:"render",value:function(){return to.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},to.createElement(e,dd({},this.props,this.state)))}}]),n}(function(e){var t=e.color,r=e.style,n=e.onClick,a=void 0===n?function(){}:n,i=e.onHover,o=e.title,s=void 0===o?t:o,l=e.children,u=e.focus,c=e.focusStyle,d="transparent"===t,f=(0,lf.Ay)({default:{swatch:dh({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},r,u?void 0===c?{}:c:{})}}),p={};return i&&(p.onMouseOver=function(e){return i(t,e)}),to.createElement("div",dh({style:f.swatch,onClick:function(e){return a(t,e)},title:s,tabIndex:0,onKeyDown:function(e){return 13===e.keyCode&&a(t,e)}},p),l,d&&to.createElement(lv,{borderRadius:f.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))});var dm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dy=function(e){var t=e.rgb,r=e.hsl,n=e.width,a=e.height,i=e.onChange,o=e.direction,s=e.style,l=e.renderers,u=e.pointer,c=e.className,d=(0,lf.Ay)({default:{picker:{position:"relative",width:n,height:a},alpha:{radius:"2px",style:s}}});return to.createElement("div",{style:d.picker,className:"alpha-picker "+(void 0===c?"":c)},to.createElement(lw,dm({},d.alpha,{rgb:t,hsl:r,pointer:u,renderers:l,onChange:i,direction:o})))};dy.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:function(e){var t=e.direction,r=(0,lf.Ay)({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===t});return to.createElement("div",{style:r.picker})}},dc(dy);let dv=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a};function db(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ui;++t<r;)this.add(e[t])}db.prototype.add=db.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},db.prototype.has=function(e){return this.__data__.has(e)};let dx=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1},dS=function(e,t,r,n,a,i){var o=1&r,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&r?new db:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var h=e[d],g=t[d];if(n)var m=o?n(g,h,d,t,e,i):n(h,g,d,e,t,i);if(void 0!==m){if(m)continue;f=!1;break}if(p){if(!dx(t,function(e,t){if(!p.has(t)&&(h===e||a(h,e,r,n,i)))return p.push(t)})){f=!1;break}}else if(!(h===g||a(h,g,r,n,i))){f=!1;break}}return i.delete(e),i.delete(t),f},dw=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r},d_=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r};var dI=lB?lB.prototype:void 0,dD=dI?dI.valueOf:void 0;let dO=function(e,t,r,n,a,i,o){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!i(new um(e),new um(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return lP(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=dw;case"[object Set]":var l=1&n;if(s||(s=d_),e.size!=t.size&&!l)break;var u=o.get(e);if(u)return u==t;n|=2,o.set(e,t);var c=dS(s(e),s(t),n,a,i,o);return o.delete(e),c;case"[object Symbol]":if(dD)return dD.call(e)==dD.call(t)}return!1},dk=function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e},dC=function(e,t,r){var n=t(e);return uR(e)?n:dk(n,r(e))},dj=function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i};var dE=Object.prototype.propertyIsEnumerable,dM=Object.getOwnPropertySymbols,dR=dM?function(e){return null==e?[]:dj(dM(e=Object(e)),function(t){return dE.call(e,t)})}:function(){return[]};let dP=function(e){return dC(e,cR,dR)};var dA=Object.prototype.hasOwnProperty;let dN=function(e,t,r,n,a,i){var o=1&r,s=dP(e),l=s.length;if(l!=dP(t).length&&!o)return!1;for(var u=l;u--;){var c=s[u];if(!(o?c in t:dA.call(t,c)))return!1}var d=i.get(e),f=i.get(t);if(d&&f)return d==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=o;++u<l;){var g=e[c=s[u]],m=t[c];if(n)var y=o?n(m,g,c,t,e,i):n(g,m,c,e,t,i);if(!(void 0===y?g===m||a(g,m,r,n,i):y)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var v=e.constructor,b=t.constructor;v!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(p=!1)}return i.delete(e),i.delete(t),p};var dT=l6(lF,"DataView"),dU=l6(lF,"Promise"),dL=l6(lF,"Set"),dF=l6(lF,"WeakMap"),dB="[object Map]",dV="[object Promise]",dz="[object Set]",dH="[object WeakMap]",dW="[object DataView]",d$=l0(dT),dY=l0(l9),dG=l0(dU),dq=l0(dL),dX=l0(dF),dK=lq;(dT&&dK(new dT(new ArrayBuffer(1)))!=dW||l9&&dK(new l9)!=dB||dU&&dK(dU.resolve())!=dV||dL&&dK(new dL)!=dz||dF&&dK(new dF)!=dH)&&(dK=function(e){var t=lq(e),r="[object Object]"==t?e.constructor:void 0,n=r?l0(r):"";if(n)switch(n){case d$:return dW;case dY:return dB;case dG:return dV;case dq:return dz;case dX:return dH}return t});let dJ=dK;var dZ="[object Arguments]",dQ="[object Array]",d0="[object Object]",d1=Object.prototype.hasOwnProperty;let d2=function(e,t,r,n,a,i){var o=uR(e),s=uR(t),l=o?dQ:dJ(e),u=s?dQ:dJ(t);l=l==dZ?d0:l,u=u==dZ?d0:u;var c=l==d0,d=u==d0,f=l==u;if(f&&uL(e)){if(!uL(t))return!1;o=!0,c=!1}if(f&&!c)return i||(i=new uo),o||uK(e)?dS(e,t,r,n,a,i):dO(e,t,l,r,n,a,i);if(!(1&r)){var p=c&&d1.call(e,"__wrapped__"),h=d&&d1.call(t,"__wrapped__");if(p||h){var g=p?e.value():e,m=h?t.value():t;return i||(i=new uo),a(g,m,r,n,i)}}return!!f&&(i||(i=new uo),dN(e,t,r,n,a,i))},d3=function e(t,r,n,a,i){return t===r||(null!=t&&null!=r&&(uO(t)||uO(r))?d2(t,r,n,a,e,i):t!=t&&r!=r)},d4=function(e,t,r,n){var a=r.length,i=a,o=!n;if(null==e)return!i;for(e=Object(e);a--;){var s=r[a];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++a<i;){var l=(s=r[a])[0],u=e[l],c=s[1];if(o&&s[2]){if(void 0===u&&!(l in e))return!1}else{var d=new uo;if(n)var f=n(u,c,l,e,t,d);if(!(void 0===f?d3(c,u,3,n,d):f))return!1}}return!0},d5=function(e){return e==e&&!lX(e)},d8=function(e){for(var t=cR(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,d5(a)]}return t},d6=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}},d9=function(e){var t=d8(e);return 1==t.length&&t[0][2]?d6(t[0][0],t[0][1]):function(r){return r===e||d4(r,e,t)}};var d7=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/;let ft=function(e,t){if(uR(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||ch(e))||fe.test(e)||!d7.test(e)||null!=t&&e in Object(t)};function fr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(fr.Cache||ui),r}fr.Cache=ui;var fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fa=/\\(\\)?/g,fi=(R=(M=fr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(fn,function(e,r,n,a){t.push(n?a.replace(fa,"$1"):r||e)}),t},function(e){return 500===R.size&&R.clear(),e})).cache,M),fo=1/0,fs=lB?lB.prototype:void 0,fl=fs?fs.toString:void 0;let fu=function e(t){if("string"==typeof t)return t;if(uR(t))return dv(t,e)+"";if(ch(t))return fl?fl.call(t):"";var r=t+"";return"0"==r&&1/t==-fo?"-0":r},fc=function(e,t){return uR(e)?e:ft(e,t)?[e]:fi(null==e?"":fu(e))};var fd=1/0;let ff=function(e){if("string"==typeof e||ch(e))return e;var t=e+"";return"0"==t&&1/e==-fd?"-0":t},fp=function(e,t){t=fc(t,e);for(var r=0,n=t.length;null!=e&&r<n;)e=e[ff(t[r++])];return r&&r==n?e:void 0},fh=function(e,t,r){var n=null==e?void 0:fp(e,t);return void 0===n?r:n},fg=function(e,t){return null!=e&&t in Object(e)},fm=function(e,t,r){t=fc(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=ff(t[n]);if(!(i=null!=e&&r(e,o)))break;e=e[o]}return i||++n!=a?i:!!(a=null==e?0:e.length)&&uP(a)&&u3(o,a)&&(uR(e)||uM(e))},fy=function(e){var t;return ft(e)?(t=ff(e),function(e){return null==e?void 0:e[t]}):function(t){return fp(t,e)}},fv=function(e){if("function"==typeof e)return e;if(null==e)return cr;if("object"==typeof e){var t,r;return uR(e)?(t=e[0],r=e[1],ft(t)&&d5(r)?d6(ff(t),r):function(e){var n=fh(e,t);return void 0===n&&n===r?null!=e&&fm(e,t,fg):d3(r,n,3)}):d9(e)}return fy(e)},fb=function(e,t){var r=-1,n=uA(e)?Array(e.length):[];return cP(e,function(e,a,i){n[++r]=t(e,a,i)}),n},fx=function(e,t){return(uR(e)?dv:fb)(e,fv(t))},fS=function(e){var t=e.colors,r=e.onClick,n=e.onSwatchHover,a=(0,lf.Ay)({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return to.createElement("div",{style:a.swatches},fx(t,function(e){return to.createElement(dg,{key:e,color:e,style:a.swatch,onClick:r,onHover:n,focusStyle:{boxShadow:"0 0 4px "+e}})}),to.createElement("div",{style:a.clear}))};var fw=function(e){var t=e.onChange,r=e.onSwatchHover,n=e.hex,a=e.colors,i=e.width,o=e.triangle,s=e.styles,l=e.className,u="transparent"===n,c=function(e,r){da(e)&&t({hex:e,source:"hex"},r)},d=(0,lf.Ay)(cl({default:{card:{width:i,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:n,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:di(n),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+n+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},void 0===s?{}:s),{"hide-triangle":"hide"===o});return to.createElement("div",{style:d.card,className:"block-picker "+(void 0===l?"":l)},to.createElement("div",{style:d.triangle}),to.createElement("div",{style:d.head},u&&to.createElement(lv,{borderRadius:"6px 6px 0 0"}),to.createElement("div",{style:d.label},n)),to.createElement("div",{style:d.body},to.createElement(fS,{colors:a,onClick:c,onSwatchHover:r}),to.createElement(lO,{style:{input:d.input},value:n,onChange:c})))};fw.propTypes={width:lR().oneOfType([lR().string,lR().number]),colors:lR().arrayOf(lR().string),triangle:lR().oneOf(["top","hide"]),styles:lR().object},fw.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}},dc(fw);var f_={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},fI={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},fD={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},fO={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},fk={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},fC={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},fj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},fE={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},fM={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},fR={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},fP={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},fA={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},fN={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},fT={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},fU={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},fL={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},fF={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},fB={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},fV=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.hover,i=e.active,o=e.circleSize,s=e.circleSpacing,l=(0,lf.Ay)({default:{swatch:{width:o,height:o,marginRight:s,marginBottom:s,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(o/2+1)+"px "+t,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+t}}},{hover:a,active:i});return to.createElement("div",{style:l.swatch},to.createElement(dg,{style:l.Swatch,color:t,onClick:r,onHover:n,focusStyle:{boxShadow:l.Swatch.boxShadow+", 0 0 5px "+t}}))};fV.defaultProps={circleSize:28,circleSpacing:14};let fz=(0,lf.H8)(fV);var fH=function(e){var t=e.width,r=e.onChange,n=e.onSwatchHover,a=e.colors,i=e.hex,o=e.circleSize,s=e.styles,l=e.circleSpacing,u=e.className,c=(0,lf.Ay)(cl({default:{card:{width:t,display:"flex",flexWrap:"wrap",marginRight:-l,marginBottom:-l}}},void 0===s?{}:s)),d=function(e,t){return r({hex:e,source:"hex"},t)};return to.createElement("div",{style:c.card,className:"circle-picker "+(void 0===u?"":u)},fx(a,function(e){return to.createElement(fz,{key:e,color:e,onClick:d,onSwatchHover:n,active:i===e.toLowerCase(),circleSize:o,circleSpacing:l})}))};fH.propTypes={width:lR().oneOfType([lR().string,lR().number]),circleSize:lR().number,circleSpacing:lR().number,styles:lR().object},fH.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[f_["500"],fI["500"],fD["500"],fO["500"],fk["500"],fC["500"],fj["500"],fE["500"],fM["500"],fR["500"],fP["500"],fA["500"],fN["500"],fT["500"],fU["500"],fL["500"],fF["500"],fB["500"]],styles:{}},dc(fH);let fW=function(e){return void 0===e};var f$=I(9767),fY=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),fG=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.toggleViews=function(){"hex"===r.state.view?r.setState({view:"rgb"}):"rgb"===r.state.view?r.setState({view:"hsl"}):"hsl"===r.state.view&&(1===r.props.hsl.a?r.setState({view:"hex"}):r.setState({view:"rgb"}))},r.handleChange=function(e,t){e.hex?da(e.hex)&&r.props.onChange({hex:e.hex,source:"hex"},t):e.r||e.g||e.b?r.props.onChange({r:e.r||r.props.rgb.r,g:e.g||r.props.rgb.g,b:e.b||r.props.rgb.b,source:"rgb"},t):e.a?(e.a<0?e.a=0:e.a>1&&(e.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&("string"==typeof e.s&&e.s.includes("%")&&(e.s=e.s.replace("%","")),"string"==typeof e.l&&e.l.includes("%")&&(e.l=e.l.replace("%","")),1==e.s?e.s=.01:1==e.l&&(e.l=.01),r.props.onChange({h:e.h||r.props.hsl.h,s:Number(fW(e.s)?r.props.hsl.s:e.s),l:Number(fW(e.l)?r.props.hsl.l:e.l),source:"hsl"},t))},r.showHighlight=function(e){e.currentTarget.style.background="#eee"},r.hideHighlight=function(e){e.currentTarget.style.background="transparent"},1!==e.hsl.a&&"hex"===e.view?r.state={view:"rgb"}:r.state={view:e.view},r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),fY(t,[{key:"render",value:function(){var e=this,t=(0,lf.Ay)({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),r=void 0;return"hex"===this.state.view?r=to.createElement("div",{style:t.fields,className:"flexbox-fix"},to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?r=to.createElement("div",{style:t.fields,className:"flexbox-fix"},to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),to.createElement("div",{style:t.alpha},to.createElement(lO,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(r=to.createElement("div",{style:t.fields,className:"flexbox-fix"},to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lO,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),to.createElement("div",{style:t.alpha},to.createElement(lO,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),to.createElement("div",{style:t.wrap,className:"flexbox-fix"},r,to.createElement("div",{style:t.toggle},to.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},to.createElement(f$.A,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return 1!==e.hsl.a&&"hex"===t.view?{view:"rgb"}:null}}]),t}(to.Component);fG.defaultProps={view:"hex"};let fq=function(){var e=(0,lf.Ay)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return to.createElement("div",{style:e.picker})},fX=function(){var e=(0,lf.Ay)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return to.createElement("div",{style:e.picker})};var fK=function(e){var t=e.width,r=e.onChange,n=e.disableAlpha,a=e.rgb,i=e.hsl,o=e.hsv,s=e.hex,l=e.renderers,u=e.styles,c=e.className,d=e.defaultView,f=(0,lf.Ay)(cl({default:{picker:{width:t,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+a.r+", "+a.g+", "+a.b+", "+a.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},void 0===u?{}:u),{disableAlpha:n});return to.createElement("div",{style:f.picker,className:"chrome-picker "+(void 0===c?"":c)},to.createElement("div",{style:f.saturation},to.createElement(ck,{style:f.Saturation,hsl:i,hsv:o,pointer:fX,onChange:r})),to.createElement("div",{style:f.body},to.createElement("div",{style:f.controls,className:"flexbox-fix"},to.createElement("div",{style:f.color},to.createElement("div",{style:f.swatch},to.createElement("div",{style:f.active}),to.createElement(lv,{renderers:l}))),to.createElement("div",{style:f.toggles},to.createElement("div",{style:f.hue},to.createElement(lE,{style:f.Hue,hsl:i,pointer:fq,onChange:r})),to.createElement("div",{style:f.alpha},to.createElement(lw,{style:f.Alpha,rgb:a,hsl:i,pointer:fq,renderers:l,onChange:r})))),to.createElement(fG,{rgb:a,hsl:i,hex:s,view:d,onChange:r,disableAlpha:n})))};fK.propTypes={width:lR().oneOfType([lR().string,lR().number]),disableAlpha:lR().bool,styles:lR().object,defaultView:lR().oneOf(["hex","rgb","hsl"])},fK.defaultProps={width:225,disableAlpha:!1,styles:{}};let fJ=dc(fK),fZ=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.active,i=(0,lf.Ay)({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:di(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return to.createElement(dg,{style:i.color,color:t,onClick:void 0===r?function(){}:r,onHover:n,focusStyle:{boxShadow:"0 0 4px "+t}},to.createElement("div",{style:i.dot}))},fQ=function(e){var t=e.hex,r=e.rgb,n=e.onChange,a=(0,lf.Ay)({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),i=function(e,t){e.r||e.g||e.b?n({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,source:"rgb"},t):n({hex:e.hex,source:"hex"},t)};return to.createElement("div",{style:a.fields,className:"flexbox-fix"},to.createElement("div",{style:a.active}),to.createElement(lO,{style:{wrap:a.HEXwrap,input:a.HEXinput,label:a.HEXlabel},label:"hex",value:t,onChange:i}),to.createElement(lO,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"r",value:r.r,onChange:i}),to.createElement(lO,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"g",value:r.g,onChange:i}),to.createElement(lO,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"b",value:r.b,onChange:i}))};var f0=function(e){var t=e.onChange,r=e.onSwatchHover,n=e.colors,a=e.hex,i=e.rgb,o=e.styles,s=void 0===o?{}:o,l=e.className,u=(0,lf.Ay)(cl({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},s)),c=function(e,r){e.hex?da(e.hex)&&t({hex:e.hex,source:"hex"},r):t(e,r)};return to.createElement(cu,{style:u.Compact,styles:s},to.createElement("div",{style:u.compact,className:"compact-picker "+(void 0===l?"":l)},to.createElement("div",null,fx(n,function(e){return to.createElement(fZ,{key:e,color:e,active:e.toLowerCase()===a,onClick:c,onSwatchHover:r})}),to.createElement("div",{style:u.clear})),to.createElement(fQ,{hex:a,rgb:i,onChange:c})))};f0.propTypes={colors:lR().arrayOf(lR().string),styles:lR().object},f0.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}},dc(f0);let f1=(0,lf.H8)(function(e){var t=e.hover,r=e.color,n=e.onClick,a=e.onSwatchHover,i={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},o=(0,lf.Ay)({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:i}},{hover:t});return to.createElement("div",{style:o.swatch},to.createElement(dg,{color:r,onClick:n,onHover:a,focusStyle:i}))});var f2=function(e){var t=e.width,r=e.colors,n=e.onChange,a=e.onSwatchHover,i=e.triangle,o=e.styles,s=e.className,l=(0,lf.Ay)(cl({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},void 0===o?{}:o),{"hide-triangle":"hide"===i,"top-left-triangle":"top-left"===i,"top-right-triangle":"top-right"===i,"bottom-left-triangle":"bottom-left"===i,"bottom-right-triangle":"bottom-right"===i}),u=function(e,t){return n({hex:e,source:"hex"},t)};return to.createElement("div",{style:l.card,className:"github-picker "+(void 0===s?"":s)},to.createElement("div",{style:l.triangleShadow}),to.createElement("div",{style:l.triangle}),fx(r,function(e){return to.createElement(f1,{color:e,key:e,onClick:u,onSwatchHover:a})}))};f2.propTypes={width:lR().oneOfType([lR().string,lR().number]),colors:lR().arrayOf(lR().string),triangle:lR().oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:lR().object},f2.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}},dc(f2);var f3=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f4=function(e){var t=e.width,r=e.height,n=e.onChange,a=e.hsl,i=e.direction,o=e.pointer,s=e.styles,l=e.className,u=(0,lf.Ay)(cl({default:{picker:{position:"relative",width:t,height:r},hue:{radius:"2px"}}},void 0===s?{}:s));return to.createElement("div",{style:u.picker,className:"hue-picker "+(void 0===l?"":l)},to.createElement(lE,f3({},u.hue,{hsl:a,pointer:o,onChange:function(e){return n({a:1,h:e.h,l:.5,s:1})},direction:i})))};f4.propTypes={styles:lR().object},f4.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:function(e){var t=e.direction,r=(0,lf.Ay)({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===t});return to.createElement("div",{style:r.picker})},styles:{}},dc(f4),dc(function(e){var t=e.onChange,r=e.hex,n=e.rgb,a=e.styles,i=void 0===a?{}:a,o=e.className,s=(0,lf.Ay)(cl({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+r,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},i)),l=function(e,r){e.hex?da(e.hex)&&t({hex:e.hex,source:"hex"},r):(e.r||e.g||e.b)&&t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:"rgb"},r)};return to.createElement(cu,{styles:i},to.createElement("div",{style:s.material,className:"material-picker "+(void 0===o?"":o)},to.createElement(lO,{style:{wrap:s.HEXwrap,input:s.HEXinput,label:s.HEXlabel},label:"hex",value:r,onChange:l}),to.createElement("div",{style:s.split,className:"flexbox-fix"},to.createElement("div",{style:s.third},to.createElement(lO,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"r",value:n.r,onChange:l})),to.createElement("div",{style:s.third},to.createElement(lO,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"g",value:n.g,onChange:l})),to.createElement("div",{style:s.third},to.createElement(lO,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"b",value:n.b,onChange:l})))))});let f5=function(e){var t=e.onChange,r=e.rgb,n=e.hsv,a=e.hex,i=(0,lf.Ay)({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",top:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),o=function(e,a){e["#"]?da(e["#"])&&t({hex:e["#"],source:"hex"},a):e.r||e.g||e.b?t({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,source:"rgb"},a):(e.h||e.s||e.v)&&t({h:e.h||n.h,s:e.s||n.s,v:e.v||n.v,source:"hsv"},a)};return to.createElement("div",{style:i.fields},to.createElement(lO,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"h",value:Math.round(n.h),onChange:o}),to.createElement(lO,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"s",value:Math.round(100*n.s),onChange:o}),to.createElement(lO,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"v",value:Math.round(100*n.v),onChange:o}),to.createElement("div",{style:i.divider}),to.createElement(lO,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:o}),to.createElement(lO,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:o}),to.createElement(lO,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:o}),to.createElement("div",{style:i.divider}),to.createElement(lO,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"#",value:a.replace("#",""),onChange:o}),to.createElement("div",{style:i.fieldSymbols},to.createElement("div",{style:i.symbol},"°"),to.createElement("div",{style:i.symbol},"%"),to.createElement("div",{style:i.symbol},"%")))},f8=function(e){var t=e.hsl,r=(0,lf.Ay)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":t.l>.5});return to.createElement("div",{style:r.picker})},f6=function(){var e=(0,lf.Ay)({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return to.createElement("div",{style:e.pointer},to.createElement("div",{style:e.left},to.createElement("div",{style:e.leftInside})),to.createElement("div",{style:e.right},to.createElement("div",{style:e.rightInside})))},f9=function(e){var t=e.onClick,r=e.label,n=e.children,a=e.active,i=(0,lf.Ay)({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:a});return to.createElement("div",{style:i.button,onClick:t},r||n)},f7=function(e){var t=e.rgb,r=e.currentColor,n=(0,lf.Ay)({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return to.createElement("div",null,to.createElement("div",{style:n.label},"new"),to.createElement("div",{style:n.swatches},to.createElement("div",{style:n.new}),to.createElement("div",{style:n.current})),to.createElement("div",{style:n.label},"current"))};var pe=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),pt=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.state={currentColor:e.hex},r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),pe(t,[{key:"render",value:function(){var e=this.props,t=e.styles,r=e.className,n=(0,lf.Ay)(cl({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},void 0===t?{}:t));return to.createElement("div",{style:n.picker,className:"photoshop-picker "+(void 0===r?"":r)},to.createElement("div",{style:n.head},this.props.header),to.createElement("div",{style:n.body,className:"flexbox-fix"},to.createElement("div",{style:n.saturation},to.createElement(ck,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:f8,onChange:this.props.onChange})),to.createElement("div",{style:n.hue},to.createElement(lE,{direction:"vertical",hsl:this.props.hsl,pointer:f6,onChange:this.props.onChange})),to.createElement("div",{style:n.controls},to.createElement("div",{style:n.top,className:"flexbox-fix"},to.createElement("div",{style:n.previews},to.createElement(f7,{rgb:this.props.rgb,currentColor:this.state.currentColor})),to.createElement("div",{style:n.actions},to.createElement(f9,{label:"OK",onClick:this.props.onAccept,active:!0}),to.createElement(f9,{label:"Cancel",onClick:this.props.onCancel}),to.createElement(f5,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),t}(to.Component);pt.propTypes={header:lR().string,styles:lR().object},pt.defaultProps={header:"Color Picker",styles:{}},dc(pt);let pr=function(e){var t=e.onChange,r=e.rgb,n=e.hsl,a=e.hex,i=e.disableAlpha,o=(0,lf.Ay)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:i}),s=function(e,a){e.hex?da(e.hex)&&t({hex:e.hex,source:"hex"},a):e.r||e.g||e.b?t({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,a:r.a,source:"rgb"},a):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:n.h,s:n.s,l:n.l,a:e.a,source:"rgb"},a))};return to.createElement("div",{style:o.fields,className:"flexbox-fix"},to.createElement("div",{style:o.double},to.createElement(lO,{style:{input:o.input,label:o.label},label:"hex",value:a.replace("#",""),onChange:s})),to.createElement("div",{style:o.single},to.createElement(lO,{style:{input:o.input,label:o.label},label:"r",value:r.r,onChange:s,dragLabel:"true",dragMax:"255"})),to.createElement("div",{style:o.single},to.createElement(lO,{style:{input:o.input,label:o.label},label:"g",value:r.g,onChange:s,dragLabel:"true",dragMax:"255"})),to.createElement("div",{style:o.single},to.createElement(lO,{style:{input:o.input,label:o.label},label:"b",value:r.b,onChange:s,dragLabel:"true",dragMax:"255"})),to.createElement("div",{style:o.alpha},to.createElement(lO,{style:{input:o.input,label:o.label},label:"a",value:Math.round(100*r.a),onChange:s,dragLabel:"true",dragMax:"100"})))};var pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pa=function(e){var t=e.colors,r=e.onClick,n=void 0===r?function(){}:r,a=e.onSwatchHover,i=(0,lf.Ay)({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!t||!t.length}),o=function(e,t){n({hex:e,source:"hex"},t)};return to.createElement("div",{style:i.colors,className:"flexbox-fix"},t.map(function(e){var t="string"==typeof e?{color:e}:e,r=""+t.color+(t.title||"");return to.createElement("div",{key:r,style:i.swatchWrap},to.createElement(dg,pn({},t,{style:i.swatch,onClick:o,onHover:a,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+t.color}})))}))};pa.propTypes={colors:lR().arrayOf(lR().oneOfType([lR().string,lR().shape({color:lR().string,title:lR().string})])).isRequired};var pi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},po=function(e){var t=e.width,r=e.rgb,n=e.hex,a=e.hsv,i=e.hsl,o=e.onChange,s=e.onSwatchHover,l=e.disableAlpha,u=e.presetColors,c=e.renderers,d=e.styles,f=void 0===d?{}:d,p=e.className,h=(0,lf.Ay)(cl({default:pi({picker:{width:t,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+r.r+","+r.g+","+r.b+","+r.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},f),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},f),{disableAlpha:l});return to.createElement("div",{style:h.picker,className:"sketch-picker "+(void 0===p?"":p)},to.createElement("div",{style:h.saturation},to.createElement(ck,{style:h.Saturation,hsl:i,hsv:a,onChange:o})),to.createElement("div",{style:h.controls,className:"flexbox-fix"},to.createElement("div",{style:h.sliders},to.createElement("div",{style:h.hue},to.createElement(lE,{style:h.Hue,hsl:i,onChange:o})),to.createElement("div",{style:h.alpha},to.createElement(lw,{style:h.Alpha,rgb:r,hsl:i,renderers:c,onChange:o}))),to.createElement("div",{style:h.color},to.createElement(lv,null),to.createElement("div",{style:h.activeColor}))),to.createElement(pr,{rgb:r,hsl:i,hex:n,onChange:o,disableAlpha:l}),to.createElement(pa,{colors:u,onClick:o,onSwatchHover:s}))};po.propTypes={disableAlpha:lR().bool,width:lR().oneOfType([lR().string,lR().number]),styles:lR().object},po.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]},dc(po);let ps=function(e){var t=e.hsl,r=e.offset,n=e.onClick,a=void 0===n?function(){}:n,i=e.active,o=e.first,s=e.last,l=(0,lf.Ay)({default:{swatch:{height:"12px",background:"hsl("+t.h+", 50%, "+100*r+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:i,first:o,last:s});return to.createElement("div",{style:l.swatch,onClick:function(e){return a({h:t.h,s:.5,l:r,source:"hsl"},e)}})},pl=function(e){var t=e.onClick,r=e.hsl,n=(0,lf.Ay)({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}});return to.createElement("div",{style:n.swatches},to.createElement("div",{style:n.swatch},to.createElement(ps,{hsl:r,offset:".80",active:.1>Math.abs(r.l-.8)&&.1>Math.abs(r.s-.5),onClick:t,first:!0})),to.createElement("div",{style:n.swatch},to.createElement(ps,{hsl:r,offset:".65",active:.1>Math.abs(r.l-.65)&&.1>Math.abs(r.s-.5),onClick:t})),to.createElement("div",{style:n.swatch},to.createElement(ps,{hsl:r,offset:".50",active:.1>Math.abs(r.l-.5)&&.1>Math.abs(r.s-.5),onClick:t})),to.createElement("div",{style:n.swatch},to.createElement(ps,{hsl:r,offset:".35",active:.1>Math.abs(r.l-.35)&&.1>Math.abs(r.s-.5),onClick:t})),to.createElement("div",{style:n.swatch},to.createElement(ps,{hsl:r,offset:".20",active:.1>Math.abs(r.l-.2)&&.1>Math.abs(r.s-.5),onClick:t,last:!0})),to.createElement("div",{style:n.clear}))};var pu=function(e){var t=e.hsl,r=e.onChange,n=e.pointer,a=e.styles,i=e.className,o=(0,lf.Ay)(cl({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},void 0===a?{}:a));return to.createElement("div",{style:o.wrap||{},className:"slider-picker "+(void 0===i?"":i)},to.createElement("div",{style:o.hue},to.createElement(lE,{style:o.Hue,hsl:t,pointer:n,onChange:r})),to.createElement("div",{style:o.swatches},to.createElement(pl,{hsl:t,onClick:r})))};pu.propTypes={styles:lR().object},pu.defaultProps={pointer:function(){var e=(0,lf.Ay)({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return to.createElement("div",{style:e.picker})},styles:{}},dc(pu);var pc=I(1810);let pd=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.first,i=e.last,o=e.active,s=(0,lf.Ay)({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:di(t),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:i,active:o,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return to.createElement(dg,{color:t,style:s.color,onClick:void 0===r?function(){}:r,onHover:n,focusStyle:{boxShadow:"0 0 4px "+t}},to.createElement("div",{style:s.check},to.createElement(pc.A,null)))},pf=function(e){var t=e.onClick,r=e.onSwatchHover,n=e.group,a=e.active,i=(0,lf.Ay)({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return to.createElement("div",{style:i.group},fx(n,function(e,i){return to.createElement(pd,{key:e,color:e,active:e.toLowerCase()===a,first:0===i,last:i===n.length-1,onClick:t,onSwatchHover:r})}))};var pp=function(e){var t=e.width,r=e.height,n=e.onChange,a=e.onSwatchHover,i=e.colors,o=e.hex,s=e.styles,l=e.className,u=(0,lf.Ay)(cl({default:{picker:{width:t,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},void 0===s?{}:s)),c=function(e,t){return n({hex:e,source:"hex"},t)};return to.createElement("div",{style:u.picker,className:"swatches-picker "+(void 0===l?"":l)},to.createElement(cu,null,to.createElement("div",{style:u.overflow},to.createElement("div",{style:u.body},fx(i,function(e){return to.createElement(pf,{key:e.toString(),group:e,active:o,onClick:c,onSwatchHover:a})}),to.createElement("div",{style:u.clear})))))};pp.propTypes={width:lR().oneOfType([lR().string,lR().number]),height:lR().oneOfType([lR().string,lR().number]),colors:lR().arrayOf(lR().arrayOf(lR().string)),styles:lR().object},pp.defaultProps={width:320,height:240,colors:[[f_["900"],f_["700"],f_["500"],f_["300"],f_["100"]],[fI["900"],fI["700"],fI["500"],fI["300"],fI["100"]],[fD["900"],fD["700"],fD["500"],fD["300"],fD["100"]],[fO["900"],fO["700"],fO["500"],fO["300"],fO["100"]],[fk["900"],fk["700"],fk["500"],fk["300"],fk["100"]],[fC["900"],fC["700"],fC["500"],fC["300"],fC["100"]],[fj["900"],fj["700"],fj["500"],fj["300"],fj["100"]],[fE["900"],fE["700"],fE["500"],fE["300"],fE["100"]],[fM["900"],fM["700"],fM["500"],fM["300"],fM["100"]],["#194D33",fR["700"],fR["500"],fR["300"],fR["100"]],[fP["900"],fP["700"],fP["500"],fP["300"],fP["100"]],[fA["900"],fA["700"],fA["500"],fA["300"],fA["100"]],[fN["900"],fN["700"],fN["500"],fN["300"],fN["100"]],[fT["900"],fT["700"],fT["500"],fT["300"],fT["100"]],[fU["900"],fU["700"],fU["500"],fU["300"],fU["100"]],[fL["900"],fL["700"],fL["500"],fL["300"],fL["100"]],[fF["900"],fF["700"],fF["500"],fF["300"],fF["100"]],[fB["900"],fB["700"],fB["500"],fB["300"],fB["100"]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}},dc(pp);var ph=function(e){var t=e.onChange,r=e.onSwatchHover,n=e.hex,a=e.colors,i=e.width,o=e.triangle,s=e.styles,l=e.className,u=(0,lf.Ay)(cl({default:{card:{width:i,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},void 0===s?{}:s),{"hide-triangle":"hide"===o,"top-left-triangle":"top-left"===o,"top-right-triangle":"top-right"===o}),c=function(e,r){da(e)&&t({hex:e,source:"hex"},r)};return to.createElement("div",{style:u.card,className:"twitter-picker "+(void 0===l?"":l)},to.createElement("div",{style:u.triangleShadow}),to.createElement("div",{style:u.triangle}),to.createElement("div",{style:u.body},fx(a,function(e,t){return to.createElement(dg,{key:t,color:e,hex:e,style:u.swatch,onClick:c,onHover:r,focusStyle:{boxShadow:"0 0 4px "+e}})}),to.createElement("div",{style:u.hash},"#"),to.createElement(lO,{label:null,style:{input:u.input},value:n.replace("#",""),onChange:c}),to.createElement("div",{style:u.clear})))};ph.propTypes={width:lR().oneOfType([lR().string,lR().number]),triangle:lR().oneOf(["hide","top-left","top-right"]),colors:lR().arrayOf(lR().string),styles:lR().object},ph.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}},dc(ph);var pg=function(e){var t=(0,lf.Ay)({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(100*e.hsl.s)+"%, "+Math.round(100*e.hsl.l)+"%)"}}});return to.createElement("div",{style:t.picker})};pg.propTypes={hsl:lR().shape({h:lR().number,s:lR().number,l:lR().number,a:lR().number})},pg.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var pm=function(e){var t=(0,lf.Ay)({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return to.createElement("div",{style:t.picker})};pm.propTypes={hsl:lR().shape({h:lR().number,s:lR().number,l:lR().number,a:lR().number})},pm.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};let py=function(e){var t=e.onChange,r=e.rgb,n=e.hsl,a=e.hex,i=e.hsv,o=function(e,r){if(e.hex)da(e.hex)&&t({hex:e.hex,source:"hex"},r);else if(e.rgb){var n=e.rgb.split(",");ds(e.rgb,"rgb")&&t({r:n[0],g:n[1],b:n[2],a:1,source:"rgb"},r)}else if(e.hsv){var a=e.hsv.split(",");ds(e.hsv,"hsv")&&(a[2]=a[2].replace("%",""),a[1]=a[1].replace("%",""),a[0]=a[0].replace("°",""),1==a[1]?a[1]=.01:1==a[2]&&(a[2]=.01),t({h:Number(a[0]),s:Number(a[1]),v:Number(a[2]),source:"hsv"},r))}else if(e.hsl){var i=e.hsl.split(",");ds(e.hsl,"hsl")&&(i[2]=i[2].replace("%",""),i[1]=i[1].replace("%",""),i[0]=i[0].replace("°",""),1==c[1]?c[1]=.01:1==c[2]&&(c[2]=.01),t({h:Number(i[0]),s:Number(i[1]),v:Number(i[2]),source:"hsl"},r))}},s=(0,lf.Ay)({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),l=r.r+", "+r.g+", "+r.b,u=Math.round(n.h)+"°, "+Math.round(100*n.s)+"%, "+Math.round(100*n.l)+"%",c=Math.round(i.h)+"°, "+Math.round(100*i.s)+"%, "+Math.round(100*i.v)+"%";return to.createElement("div",{style:s.wrap,className:"flexbox-fix"},to.createElement("div",{style:s.fields},to.createElement("div",{style:s.double},to.createElement(lO,{style:{input:s.input,label:s.label},label:"hex",value:a,onChange:o})),to.createElement("div",{style:s.column},to.createElement("div",{style:s.single},to.createElement(lO,{style:{input:s.input2,label:s.label2},label:"rgb",value:l,onChange:o})),to.createElement("div",{style:s.single},to.createElement(lO,{style:{input:s.input2,label:s.label2},label:"hsv",value:c,onChange:o})),to.createElement("div",{style:s.single},to.createElement(lO,{style:{input:s.input2,label:s.label2},label:"hsl",value:u,onChange:o})))))};var pv=function(e){var t=e.width,r=e.onChange,n=e.rgb,a=e.hsl,i=e.hsv,o=e.hex,s=e.header,l=e.styles,u=e.className,c=(0,lf.Ay)(cl({default:{picker:{width:t,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+n.r+", "+n.g+", "+n.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},void 0===l?{}:l));return to.createElement("div",{style:c.picker,className:"google-picker "+(void 0===u?"":u)},to.createElement("div",{style:c.head},s),to.createElement("div",{style:c.swatch}),to.createElement("div",{style:c.saturation},to.createElement(ck,{hsl:a,hsv:i,pointer:pg,onChange:r})),to.createElement("div",{style:c.body},to.createElement("div",{style:c.controls,className:"flexbox-fix"},to.createElement("div",{style:c.hue},to.createElement(lE,{style:c.Hue,hsl:a,radius:"4px",pointer:pm,onChange:r}))),to.createElement(py,{rgb:n,hsl:a,hex:o,hsv:i,onChange:r})))};pv.propTypes={width:lR().oneOfType([lR().string,lR().number]),styles:lR().object,header:lR().string},pv.defaultProps={width:652,styles:{},header:"Color picker"},dc(pv);let pb=function(e){let t,r,n,a,i,o,s,l=(0,ti.c)(16),{value:u,hide:c,onSave:d}=e,[f,p]=(0,to.useState)(u);l[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{p(e.rgb)},l[0]=t):t=l[0];let h=t;return l[1]===Symbol.for("react.memo_cache_sentinel")?(r=[],l[1]=r):r=l[1],l[2]!==f?(n=(0,tu.jsx)(fJ,{color:f,onChange:h,presetColors:r,width:300}),l[2]=f,l[3]=n):n=l[3],l[4]!==c?(a=(0,tu.jsx)(tl.FooterAction.Secondary,{dataCY:"color-picker-cancel-btn",onClick:c,children:"Cancel"}),l[4]=c,l[5]=a):a=l[5],l[6]!==f||l[7]!==c||l[8]!==d?(i=(0,tu.jsx)(tl.FooterAction.Primary,{dataCY:"color-picker-save-btn",onClick:()=>{c(),d(f)},children:"Save"}),l[6]=f,l[7]=c,l[8]=d,l[9]=i):i=l[9],l[10]!==a||l[11]!==i?(o=(0,tu.jsx)(tl.FooterAction,{children:(0,tu.jsxs)(tl.FooterAction.Right,{children:[a,i]})}),l[10]=a,l[11]=i,l[12]=o):o=l[12],l[13]!==n||l[14]!==o?(s=(0,tu.jsxs)("div",{"data-cy":"color-picker-dialog",children:[n,o]}),l[13]=n,l[14]=o,l[15]=s):s=l[15],s},px=function({servicesManager:e},t,r){let{measurementService:n,customizationService:a,toolGroupService:i,uiDialogService:o}=e.services,{viewportId:s,StudyInstanceUID:l,SeriesInstanceUID:u,measurementId:c,toolName:d}=r;return new Promise(e=>{(async()=>{if(i.getToolGroupForViewport(s).getToolConfiguration(d).getTextCallback)e({StudyInstanceUID:l,SeriesInstanceUID:u,viewportId:s});else{let t=a.getCustomization("measurementLabels"),r=n.getMeasurement(c),i=a.getCustomization("ui.labellingComponent"),d=await ld({measurement:r,uiDialogService:o,labelConfig:t,renderContent:i});n.update(c,{...d},!0),e({StudyInstanceUID:l,SeriesInstanceUID:u,viewportId:s})}})()})};function pS(e,t){tl.Icons.addIcon(e,t)}function pw(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(41),{buttonSectionId:g,title:m}=e,{servicesManager:y}=(0,K.useSystem)(),{t:v}=tQ(),{toolbarService:b,customizationService:x}=y.services,[S,w]=(0,to.useState)(!1);h[0]!==g?(t={buttonSection:g},h[0]=g,h[1]=t):t=h[1];let{toolbarButtons:_,onInteraction:I}=(0,K.useToolbar)(t);h[2]!==g?(r={buttonSectionId:g},h[2]=g,h[3]=r):r=h[3];let{activeToolOptions:D}=(0,K.useActiveToolOptions)(r);if(!_.length)return null;if(!_.every(p_))throw Error("Toolbox accepts only button sections at the top level, not buttons. Create at least one button section.");h[4]!==I?(n=e=>{let{itemId:t}=e;I?.({itemId:t})},h[4]=I,h[5]=n):n=h[5];let O=n;h[6]!==g||h[7]!==x?(a=x.getCustomization(`${g}.config`),h[6]=g,h[7]=x,h[8]=a):a=h[8];let k=a;if(h[9]!==v||h[10]!==m?(i=v(m),h[9]=v,h[10]=m,h[11]=i):i=h[11],h[12]!==i?(o=(0,tu.jsx)("span",{children:i}),h[12]=i,h[13]=o):o=h[13],h[14]!==k||h[15]!==S?(s=k&&(0,tu.jsx)("div",{className:"ml-auto mr-2",children:(0,tu.jsx)(tl.Icons.Settings,{className:"text-primary h-4 w-4",onClick:e=>{e.stopPropagation(),w(!S)}})}),h[14]=k,h[15]=S,h[16]=s):s=h[16],h[17]!==o||h[18]!==s?(l=(0,tu.jsxs)(tl.PanelSection.Header,{className:"flex items-center justify-between",children:[o,s]}),h[17]=o,h[18]=s,h[19]=l):l=h[19],h[20]!==k||h[21]!==S?(u=S&&(0,tu.jsx)(k,{}),h[20]=k,h[21]=S,h[22]=u):u=h[22],h[23]!==O||h[24]!==y||h[25]!==b||h[26]!==_){let e;h[28]!==O||h[29]!==y||h[30]!==b?(e=e=>{let t=e.componentProps.buttonSection,r=b.getButtonSection(t);return(0,tu.jsx)("div",{className:"bg-muted flex flex-wrap gap-2 py-2 px-1",children:r.map(e=>{if(!e||!e.componentProps.visible)return null;let{id:t,Component:r,componentProps:n}=e;return(0,tu.jsx)("div",{children:(0,tu.jsx)(r,{...n,id:t,onInteraction:O,size:"toolbox",servicesManager:y})},t)})},t)},h[28]=O,h[29]=y,h[30]=b,h[31]=e):e=h[31],c=_.map(e),h[23]=O,h[24]=y,h[25]=b,h[26]=_,h[27]=c}else c=h[27];return h[32]!==D?(d=D&&(0,tu.jsx)("div",{className:"bg-muted mt-1 h-auto px-2",children:(0,tu.jsx)(tl.ToolSettings,{options:D})}),h[32]=D,h[33]=d):d=h[33],h[34]!==c||h[35]!==d||h[36]!==u?(f=(0,tu.jsxs)(tl.PanelSection.Content,{className:"bg-muted flex-shrink-0 border-none",children:[u,c,d]}),h[34]=c,h[35]=d,h[36]=u,h[37]=f):f=h[37],h[38]!==f||h[39]!==l?(p=(0,tu.jsxs)(tl.PanelSection,{children:[l,f]}),h[38]=f,h[39]=l,h[40]=p):p=h[40],p}function p_(e){return e.componentProps.buttonSection}let pI={id:nH,preRegistration:function({servicesManager:e,commandsManager:t,hotkeysManager:r,serviceProvidersManager:n,appConfig:a}){Array.isArray(a.customizationService)&&a.customizationService.some(e=>"string"==typeof e&&e.includes("customizationModule.theme"))&&n.registerProvider("activeTheme",tl.ActiveThemeProvider);let{toolbarService:i,cineService:o,viewportGridService:s}=e.services;i.registerEventForToolbarUpdate(o,[o.EVENTS.CINE_STATE_CHANGED]),i.registerEventForToolbarUpdate(r,[K.HotkeysManager.EVENTS.HOTKEY_PRESSED]),K.DicomMetadataStore.subscribe(K.DicomMetadataStore.EVENTS.INSTANCES_ADDED,lt),K.DicomMetadataStore.subscribe(K.DicomMetadataStore.EVENTS.SERIES_UPDATED,lt),function({servicesManager:e}){let{hangingProtocolService:t}=e.services;t.addCustomAttribute("ViewCode","View Code Designator:Value",s9),t.addCustomAttribute("Laterality","Laterality of object",s7)}({servicesManager:e});let l=[],u=e=>{Object.entries(e).forEach(([e,r])=>{if([s.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED,s.EVENTS.VIEWPORTS_READY].includes(e)){let n=`${e}_${JSON.stringify(r)}`;l.includes(n)||(s.subscribe(e,e=>{let n=e?.viewportId??s.getActiveViewportId();t.run(r,{viewportId:n})}),l.push(n))}})};i.subscribe(i.EVENTS.TOOL_BAR_MODIFIED,e=>{let{buttons:t}=e;for(let[e,r]of Object.entries(t)){let{buttonSection:e,items:t,listeners:n}=r.props||{};e&&t&&t.forEach(e=>{e.listeners&&u(e.listeners)}),n&&u(n)}})},onModeExit(){ih.getState().clearViewportGridState(),ls.getState().clearUIState(),ig.getState().clearDisplaySetSelectorMap(),im.getState().clearHangingProtocolStageIndexMap(),iS.getState().clearToggleHangingProtocol(),ib.getState().clearViewportsByPosition(),function(){let{fileManager:e,dataSetCacheManager:t}=eu().wadouri;for(let r of aD){let n=r.substring(r.indexOf(":")+1),a=Number(n);Number.isInteger(a)&&a>=0&&e.remove(a);for(let e=0;e<1e5&&t.isLoaded(n);e++)t.unload(n)}aD.clear()}()},getDataSourcesModule:function(){return[{name:"dicomweb",type:"webApi",createDataSource:ez},{name:"dicomwebproxy",type:"webApi",createDataSource:e4},{name:"dicomjson",type:"jsonApi",createDataSource:eK},{name:"dicomlocal",type:"localApi",createDataSource:e3},{name:"merge",type:"mergeApi",createDataSource:ta}]},getViewportModule:()=>[{name:"chartViewport",component:s4}],getLayoutTemplateModule:function({servicesManager:e,extensionManager:t,commandsManager:r,hotkeysManager:n}){return[{name:"viewerLayout",id:"viewerLayout",component:function(a){return rX({servicesManager:e,extensionManager:t,commandsManager:r,hotkeysManager:n,...a})}}]},getPanelModule:function({commandsManager:e,extensionManager:t,servicesManager:r}){return[{name:"seriesList",iconName:"tab-studies",iconLabel:"Studies",label:nB.t("SidePanel:Studies"),component:n=>(0,tu.jsx)(no,{...n,commandsManager:e,extensionManager:t,servicesManager:r})}]},getHangingProtocolModule:function(){return[{name:iJ.id,protocol:iJ},{name:iL.id,protocol:iL},{name:iG.id,protocol:iG},{name:iK.id,protocol:iK},{name:iE.id,protocol:iE},{name:iM.id,protocol:iM}]},getSopClassHandlerModule:function(e){return ar=e,[{name:at,sopClassUids:ai,getDisplaySetsFromSeries:aa},{name:"not-supported-display-sets-handler",sopClassUids:[],getDisplaySetsFromSeries:n1},{name:n2,sopClassUids:n3,getDisplaySetsFromSeries:n4}]},getToolbarModule:function({commandsManager:e,servicesManager:t}){let{cineService:r}=t.services;return[{name:"ohif.toolButton",defaultComponent:aw},{name:"ohif.toolButtonList",defaultComponent:af},{name:"ohif.row",defaultComponent:ag},{name:"ohif.toolBoxButtonGroup",defaultComponent:ab},{name:"ohif.toolBoxButton",defaultComponent:aS},{name:"ohif.layoutSelector",defaultComponent:r=>al({...r,commandsManager:e,servicesManager:t})},{name:"ohif.progressDropdown",defaultComponent:ac},{name:"ohif.Toolbar",defaultComponent:t0},{name:"evaluate.cine",evaluate:()=>{let e=r.getState().isCineEnabled;return{className:tl.utils.getToggledClassName(e)}}}]},getCommandsModule:({servicesManager:e,commandsManager:t,extensionManager:r})=>{let{customizationService:n,measurementService:a,hangingProtocolService:i,uiNotificationService:o,viewportGridService:s,displaySetService:l,multiMonitorService:u}=e.services,c=new aj(e,t),d={addDisplaySetAsLayer:({viewportId:r,displaySetInstanceUID:n,removeFirst:a=!1})=>{if(!r){let{activeViewportId:t}=e.services.viewportGridService.getState();r=t}if(!r||!n)return void console.warn("Missing required parameters for addDisplaySetAsLayer command");let{displaySetService:i,viewportGridService:o,hangingProtocolService:s}=e.services;if(!i.getDisplaySetByUID(n))return;let l=o.getDisplaySetsUIDsForViewport(r);if(!function(e){let{viewportId:t,displaySetInstanceUID:r,servicesManager:n}=e,{displaySetService:a,viewportGridService:i}=n.services;return!(!a.getDisplaySetByUID(r)||i.getDisplaySetsUIDsForViewport(t).includes(r))}({viewportId:r,displaySetInstanceUID:n,servicesManager:e}))return;let u=s.getViewportsRequireUpdate(r,n);u.forEach(t=>{!function(e){let{viewport:t,displaySetInstanceUID:r,currentDisplaySetUIDs:n,servicesManager:a}=e,{cornerstoneViewportService:i,displaySetService:o,customizationService:s}=a.services,{viewportId:l}=t,u=[...n,r];t.displaySetInstanceUIDs=u,t.viewportOptions||(t.viewportOptions={});let c=o.getDisplaySetByUID(r);if(t.viewportOptions.orientation||(t.viewportOptions.orientation=i.getOrientation(l)),!t.viewportOptions.viewportType){let e=i.getCornerstoneViewport(l);e?.type==="orthographic"?t.viewportOptions.viewportType="volume":c.isOverlayDisplaySet&&n.every(e=>{let t=o.getDisplaySetByUID(e);return t.isOverlayDisplaySet?t.referencedDisplaySetInstanceUID===c.referencedDisplaySetInstanceUID:e===c.referencedDisplaySetInstanceUID})?t.viewportOptions.viewportType="stack":t.viewportOptions.viewportType="volume"}let d=i.getCornerstoneViewport(l),f=!!d&&(0,iy.isNextViewport)(d),p=u.map((e,r)=>{if(t.displaySetOptions?.[r])return t.displaySetOptions[r];if(0===r)return{};let n=function(e,t){var r;return"SEG"===e.Modality?{}:{colormap:{name:(r=e.Modality,(t?.getCustomization("cornerstone.modalityOverlayDefaultColorMaps")||{defaultSettings:{}}).defaultSettings[r]||{colormap:"hsv",opacity:.9}).colormap||"hsv",opacity:.9}}}(o.getDisplaySetByUID(e),s);return f&&"number"==typeof n.colormap?.opacity&&(n.colormap.opacity=iy.NEXT_OVERLAY_OPACITY),n});t.displaySetOptions=p}({viewport:t,displaySetInstanceUID:n,currentDisplaySetUIDs:l,servicesManager:e})}),t.runCommand("updateStoredPositionPresentation",{viewportId:r,displaySetInstanceUIDs:u[0].displaySetInstanceUIDs}),t.run("setDisplaySetsForViewports",{viewportsToUpdate:u})},removeDisplaySetLayer:({viewportId:r,displaySetInstanceUID:n,unhydrate:a=!1})=>{if(!r||!n)return void console.warn("Missing required parameters for removeDisplaySetLayer command");let{displaySetService:i,viewportGridService:o,hangingProtocolService:s,segmentationService:l}=e.services,u=i.getDisplaySetByUID(n);if(!u)return;iv.includes(u.Modality)&&(l.removeRepresentationsFromViewport(r,{segmentationId:n}),a&&(u.isHydrated=!1,t.runCommand("updateStoredSegmentationPresentation",{displaySet:u,hydrated:!1})));let c=o.getDisplaySetsUIDsForViewport(r);if(!c.includes(n))return;let d=s.getViewportsRequireUpdate(r,n);d.forEach(t=>{!function(e){let{viewport:t,displaySetInstanceUID:r,currentDisplaySetUIDs:n,servicesManager:a}=e,{cornerstoneViewportService:i,displaySetService:o}=a.services,{viewportId:s}=t;t.displaySetInstanceUIDs=n.filter(e=>e!==r),t.viewportOptions||(t.viewportOptions={});let l=i.getCornerstoneViewport(s)?.type==="orthographic";t.viewportOptions.viewportType=l?"volume":"stack",t.viewportOptions.orientation||(t.viewportOptions.orientation=i.getOrientation(s)),t.displaySetOptions=t.displaySetInstanceUIDs.map(()=>({}))}({viewport:t,displaySetInstanceUID:n,currentDisplaySetUIDs:c,servicesManager:e})}),t.runCommand("updateStoredPositionPresentation",{viewportId:r,displaySetInstanceUIDs:d[0].displaySetInstanceUIDs}),t.run("setDisplaySetsForViewports",{viewportsToUpdate:d})},multimonitor:async e=>{let{screenDelta:t,StudyInstanceUID:r,commands:n,hashParams:a}=e;if(u.numberOfScreens<2)return e.fallback?.(e);await u.launchWindow(r,t,a)&&n&&setTimeout(()=>{u.run(t,n,e)},1e3)},promptSaveReport:n=>{let{StudyInstanceUID:a}=n;ik({servicesManager:e,commandsManager:t,extensionManager:r},n,{data:{StudyInstanceUID:a}})},loadStudy:async e=>{let{StudyInstanceUID:t}=e;if(l.getActiveDisplaySets().find(e=>e.StudyInstanceUID===t))return;let[n]=r.getActiveDataSource();await ni(n,l,t);let a=K.DicomMetadataStore.getStudy(t);i.addStudy(a)},showContextMenu:e=>{let{menuCustomizationId:t,element:r,event:a,selectorProps:o,defaultPointsPosition:s=[]}=e,l={...e};t&&Object.assign(l,n.getCustomization(t));let{protocol:u,stage:d}=i.getActiveProtocol();l.selectorProps={event:a,protocol:u,stage:d,...o},c.showContextMenu(l,r,s)},closeContextMenu:()=>{c.closeContextMenu()},displayNotification:({text:e,title:t,type:r})=>{o.show({title:t,message:e,type:r})},clearMeasurements:e=>{a.clearMeasurements(e.measurementFilter)},setHangingProtocol:({activeStudyUID:e="",StudyInstanceUID:t="",protocolId:r,stageId:n,stageIndex:a,reset:u=!1,restoreCachedLayout:c=!0})=>{let d=e||t;try{let e=s.getState(),t=i.getState();((e,t)=>{let{activeViewportId:r}=e,{protocol:n}=t.getActiveProtocol();if(!n)return;let a=t.getState(),{protocolId:i,stageIndex:o,activeStudyUID:s}=a,{viewportGridState:l,setViewportGridState:u}=ih.getState(),{displaySetSelectorMap:c,setDisplaySetSelector:d}=ig.getState(),{hangingProtocolStageIndexMap:f,setHangingProtocolStageIndex:p}=im.getState(),h=n.stages[o],g=`${s}:${i}:${o}`,m=`${s}:${i}`,{rows:y,columns:v}=h.viewportStructure.properties,b=h.viewports.length!==e.viewports.size||e.layout.numRows!==y||e.layout.numCols!==v;return f[m]=a,g&&b&&u(g,{...e}),e.viewports.forEach((e,t)=>{let{displaySetOptions:n,displaySetInstanceUIDs:a}=e;if(!n)return;let i=[];for(let e=0;e<n.length;e++){let o=a[e];o&&(t===r&&i.push(o),n[e]?.id&&"activeDisplaySet"!==n[e].id&&d(`${s}:${n[e].id}:${n[e].matchedDisplaySetsIndex||0}`,[o]))}t===r&&d(`${s}:activeDisplaySet:0`,i)}),p(m,a)})(e,i);let{hangingProtocolStageIndexMap:o}=im.getState(),{displaySetSelectorMap:f}=ig.getState();if(r){if(void 0===a&&void 0===n){let e=`${d||t.activeStudyUID}:${r}`;a=o[e]?.stageIndex}}else r=t.protocolId,void 0===n&&void 0===a&&(a=t.stageIndex);let p=a??i.getStageIndex(r,{stageId:n,stageIndex:a}),h=i.setActiveStudyUID(d),g=`${d||i.getState().activeStudyUID}:${r}:${p||0}`,{viewportGridState:m}=ih.getState(),y=!u&&c&&m[g];if(u||h&&!m[g]&&void 0===a&&void 0===n){let e=l.getActiveDisplaySets();i.run({StudyInstanceUID:d,displaySets:e},r)}else r!==t.protocolId||p!==t.stageIndex||d?(i.setProtocol(r,{displaySetSelectorMap:f,stageId:n,stageIndex:p,restoreProtocol:y}),y&&s.set(m[g])):i.setProtocol(r,{stageId:n,stageIndex:p,displaySetSelectorMap:f});let{setDisplaySetSelector:v}=ig.getState();return v(`${d||t.activeStudyUID}:activeDisplaySet:0`,null),iw.getState().clearToggleOneUpViewportGridStore(),!0}catch(e){return console.error(e),o.show({title:"Apply Hanging Protocol",message:"The hanging protocol could not be applied.",type:"error",duration:3e3}),!1}},toggleHangingProtocol:({protocolId:e,stageIndex:t})=>{let{protocol:r,stageIndex:n,activeStudy:a}=i.getActiveProtocol(),{toggleHangingProtocol:o,setToggleHangingProtocol:s}=iS.getState(),l=`${a.StudyInstanceUID}:${e}:${0|t}`;if(r.id!==e||void 0!==t&&t!==n)return s(l,{protocolId:r.id,stageIndex:n}),d.setHangingProtocol({protocolId:e,stageIndex:t,reset:!0});{let e=o[l]||{protocolId:"default"};return d.setHangingProtocol(e)}},deltaStage:({direction:e})=>{let{protocolId:t,stageIndex:r}=i.getState(),{protocol:n}=i.getActiveProtocol();for(let a=r+e;a>=0&&a<n.stages.length;a+=e)if("disabled"!==n.stages[a].status)return d.setHangingProtocol({protocolId:t,stageIndex:a});o.show({title:"Change Stage",message:"The hanging protocol has no more applicable stages",type:"info",duration:3e3})},setViewportGridLayout:({numRows:e,numCols:r,isHangingProtocolLayout:n=!1})=>{let{protocol:a}=i.getActiveProtocol(),o=a.callbacks?.onLayoutChange;!1!==t.run(o,{numRows:e,numCols:r})&&(iw.getState().clearToggleOneUpViewportGridStore(),window.setTimeout(()=>{((e,{numRows:t,numCols:r})=>{let{viewports:n}=e,{setViewportsByPosition:a,addInitialInDisplay:i}=ib.getState(),o=[],s={};n.forEach(e=>{if(e.positionId){let t={...e,viewportOptions:{...e.viewportOptions}};s[e.positionId]=t,a(e.positionId,t)}});for(let e=0;e<t;e++)for(let t=0;t<r;t++){let r=s[`${t}-${e}`];r?.displaySetInstanceUIDs&&o.push(...r.displaySetInstanceUIDs)}o.forEach(e=>i(e))})(s.getState(),{numRows:e,numCols:r});let{viewportsByPosition:t,initialInDisplay:a}=ib.getState(),o=ix.bind(null,i,n,{...t,initialInDisplay:a});s.setLayout({numRows:e,numCols:r,findOrCreateViewport:o,isHangingProtocolLayout:n})},0))},toggleOneUp(){let e=s.getState(),{activeViewportId:r,viewports:n,layout:a,isHangingProtocolLayout:o}=e,{displaySetInstanceUIDs:l,displaySetOptions:u,viewportOptions:c}=n.get(r);if(1===a.numCols&&1===a.numRows){let{toggleOneUpViewportGridStore:e}=iw.getState();if(!e)return;let r=e.activeViewportId,n=l.length>1?[]:l.map(e=>i.getViewportsRequireUpdate(r,e,o)).flat(),a=s.getLayoutOptionsFromState(e);s.setLayout({numRows:e.layout.numRows,numCols:e.layout.numCols,activeViewportId:r,layoutOptions:a,findOrCreateViewport:(t,r)=>{let a=Array.from(e.viewports.values()).find(e=>e.positionId===r),i=n.find(e=>e.viewportId===a.viewportId);return i?{viewportOptions:c,displaySetOptions:u,...i}:a},isHangingProtocolLayout:!0}),iw.getState().clearToggleOneUpViewportGridStore(),setTimeout(()=>{t.runCommand("resetCrosshairs")},0)}else{let{setToggleOneUpViewportGridStore:t}=iw.getState();t(e),s.setLayout({numRows:1,numCols:1,findOrCreateViewport:()=>({displaySetInstanceUIDs:l,displaySetOptions:u,viewportOptions:c}),isHangingProtocolLayout:!0})}},navigateHistory(e){t1.history.navigate(e.to,e.options)},openDICOMTagViewer({displaySetInstanceUID:t}){let{activeViewportId:r,viewports:n}=s.getState(),{displaySetInstanceUIDs:a}=n.get(r),i=l.activeDisplaySets,{UIModalService:o}=e.services,u=t||a[0]||i[0]?.displaySetInstanceUID;o.show({content:ie,contentProps:{displaySets:i,displaySetInstanceUID:u},title:"DICOM Tag Browser",containerClassName:"max-w-3xl"})},toggleOverlays:()=>{let e=document.getElementsByClassName("viewport-overlay");for(let t=0;t<e.length;t++)e.item(t).classList.toggle("hidden")},scrollActiveThumbnailIntoView:()=>{let{activeViewportId:e,viewports:t}=s.getState(),r=t.get(e),n=r?.displaySetInstanceUIDs?.[0];if(!n||!document.querySelector("#ohif-thumbnail-list"))return;let a=document.querySelector(`#thumbnail-${n}`);a&&a.scrollIntoView({behavior:"smooth"})},updateViewportDisplaySet:({direction:e,excludeNonImageModalities:r})=>{let n,a=["SR","SEG","SM","RTSTRUCT","RTPLAN","RTDOSE"],u=[...l.activeDisplaySets],{activeViewportId:c,viewports:f,isHangingProtocolLayout:p}=s.getState(),{displaySetInstanceUIDs:h}=f.get(c);for(n=u.findIndex(e=>h.includes(e.displaySetInstanceUID))+e;n>-1&&n<u.length;n+=e){let e=u[n];if(!e.madeInClient&&(!r||!a.includes(e.Modality)))break}if(n<0||n>=u.length)return;let{displaySetInstanceUID:g}=u[n],m=[];try{m=i.getViewportsRequireUpdate(c,g,p)}catch(e){console.warn(e),o.show({title:"Navigate Viewport Display Set",message:"The requested display sets could not be added to the viewport due to a mismatch in the Hanging Protocol rules.",type:"info",duration:3e3})}t.run("setDisplaySetsForViewports",{viewportsToUpdate:m}),setTimeout(()=>d.scrollActiveThumbnailIntoView(),0)},createStoreFunction:({dataSource:e,defaultFileName:t,defaultContentType:n})=>{if("download"===e)return async e=>{let r=Array.isArray(e)?e:[e];if(aO(r),K.DicomMetadataStore.addInstances(r,!0),1!==r.length)throw Error("Download only supports a single DICOM instance");iC(eE(r[0]),{filename:t||"dicom.dcm"})};if("copyToClipboard"===e)return async e=>{let t=Array.isArray(e)?e:[e];if(aO(t),K.DicomMetadataStore.addInstances(t,!0),1!==t.length)throw Error("Copy to clipboard only supports a single DICOM instance");let r=eE(t[0]);await navigator.clipboard.write([new ClipboardItem({[n||"application/dicom"]:r})])};let a=r.getDataSources(e),i=a?.[0];return i?.store?.dicom?async(t,{dicomDict:r}={})=>{let n=Array.isArray(t)?t:[t];if(aO(n),"dicomlocal"!==e){let e=i.getConfig?.();e?.wadoRoot&&n.forEach(t=>{ek(t,"wadoRoot",e.wadoRoot)})}for(let e of((Array.isArray(n)?n:[n]).forEach(e=>(function(e,t){let r;if(!e)return;if(e.imageId)return e.imageId;try{r=t?.getImageIdsForInstance?.({instance:e})}catch(e){J().log.debug("Unable to derive the imageId of a stored instance",e)}if(!(r||=e.url)||"string"!=typeof r)return;ek(e,"imageId",r);let{StudyInstanceUID:n,SeriesInstanceUID:a}=e,i=e.SOPInstanceUID||e.SopInstanceUID;return n&&a&&i&&ak.addImageIdToUIDs(r,{StudyInstanceUID:n,SeriesInstanceUID:a,SOPInstanceUID:i}),r})(e,i)),K.DicomMetadataStore.addInstances(n,!0),n))await i.store.dicom(e,null,r);for(let e of new Set(n.map(e=>e.StudyInstanceUID).filter(Boolean)))i.deleteStudyMetadataPromise(e)}:null},launchDefaultMode:({study:e,workflows:t=[],defaultWorkflow:r,workflowId:n})=>{let a=n?t.find(e=>e.id===n):r??t[0];a?a.launchWithStudy(e):console.warn(n?`launchDefaultMode: workflow '${n}' is not applicable to the study`:"launchDefaultMode: no workflow is applicable to the study")}},f={multimonitor:d.multimonitor,promptSaveReport:d.promptSaveReport,loadStudy:d.loadStudy,showContextMenu:d.showContextMenu,closeContextMenu:d.closeContextMenu,clearMeasurements:d.clearMeasurements,displayNotification:d.displayNotification,setHangingProtocol:d.setHangingProtocol,toggleHangingProtocol:d.toggleHangingProtocol,navigateHistory:d.navigateHistory,nextStage:{commandFn:d.deltaStage,options:{direction:1}},previousStage:{commandFn:d.deltaStage,options:{direction:-1}},setViewportGridLayout:d.setViewportGridLayout,toggleOneUp:d.toggleOneUp,openDICOMTagViewer:d.openDICOMTagViewer,updateViewportDisplaySet:d.updateViewportDisplaySet,scrollActiveThumbnailIntoView:d.scrollActiveThumbnailIntoView,addDisplaySetAsLayer:d.addDisplaySetAsLayer,removeDisplaySetLayer:d.removeDisplaySetLayer,createStoreFunction:d.createStoreFunction,launchDefaultMode:{commandFn:d.launchDefaultMode,context:"WORKLIST"}};return{actions:d,definitions:f,defaultContext:"DEFAULT"}},getUtilityModule:({servicesManager:e})=>[{name:"common",exports:{getStudiesForPatientByMRN:na}}],getCustomizationModule:function({servicesManager:e,extensionManager:t}){return[{name:"helloPage",value:iQ},{name:"theme",value:sD},{name:"datasources",value:i1},{name:"multimonitor",value:i2},{name:"hideHeaderUndoRedo",value:s3},{name:"default",value:{...i3,...i5,...i6,...i9,...i7,...ot,...function({servicesManager:e,extensionManager:t}){return{"ohif.dataSourceConfigurationComponent":oo.bind(null,{servicesManager:e,extensionManager:t}),"ohif.dataSourceConfigurationAPI.google":r=>new oc(r,e,t)}}({servicesManager:e,extensionManager:t}),...od,...oh,...iZ,...og,...om,...oy,...ov,...ob,...oe,...oj,...s_,...sM,...sW,...s$,...sG,...sq,...{"workList.variant":"default","workList.previewSeriesView":"all","workList.columns":tl.StudyList.defaultColumns,"workList.renderPreviewContent":void 0,"workList.onStudyDoubleClick":{commandName:"launchDefaultMode"},"workList.settingsMenuItems":e=>e},...s2}}]}}})(),D})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ohif/core/src/utils/thumbnailNoImageModalities"),require("@ohif/core/src/utils/isDisplaySetReconstructable"),require("@cornerstonejs/tools/utilities"),require("@cornerstonejs/tools"),require("@cornerstonejs/dicom-image-loader"),require("@ohif/app"),require("@ohif/i18n"),require("@ohif/core/src/classes/ImageSet"),require("@ohif/core/src"),require("@cornerstonejs/core"),require("@ohif/core/src/hooks/useToolbar"),require("@ohif/core/src/utils/sortStudy"),require("@cornerstonejs/calculate-suv"),require("@ohif/core"),require("@ohif/core/src/utils/toNumber"),require("@ohif/core/src/utils/sortInstancesByPosition"),require("dcmjs"),require("gl-matrix"),require("@ohif/extension-cornerstone"),require("@ohif/ui-next")):"function"==typeof define&&define.amd?define(["@ohif/core/src/utils/thumbnailNoImageModalities","@ohif/core/src/utils/isDisplaySetReconstructable","@cornerstonejs/tools/utilities","@cornerstonejs/tools","@cornerstonejs/dicom-image-loader","@ohif/app","@ohif/i18n","@ohif/core/src/classes/ImageSet","@ohif/core/src","@cornerstonejs/core","@ohif/core/src/hooks/useToolbar","@ohif/core/src/utils/sortStudy","@cornerstonejs/calculate-suv","@ohif/core","@ohif/core/src/utils/toNumber","@ohif/core/src/utils/sortInstancesByPosition","dcmjs","gl-matrix","@ohif/extension-cornerstone","@ohif/ui-next"],t):"object"==typeof exports?exports["ohif-extension-default"]=t(require("@ohif/core/src/utils/thumbnailNoImageModalities"),require("@ohif/core/src/utils/isDisplaySetReconstructable"),require("@cornerstonejs/tools/utilities"),require("@cornerstonejs/tools"),require("@cornerstonejs/dicom-image-loader"),require("@ohif/app"),require("@ohif/i18n"),require("@ohif/core/src/classes/ImageSet"),require("@ohif/core/src"),require("@cornerstonejs/core"),require("@ohif/core/src/hooks/useToolbar"),require("@ohif/core/src/utils/sortStudy"),require("@cornerstonejs/calculate-suv"),require("@ohif/core"),require("@ohif/core/src/utils/toNumber"),require("@ohif/core/src/utils/sortInstancesByPosition"),require("dcmjs"),require("gl-matrix"),require("@ohif/extension-cornerstone"),require("@ohif/ui-next")):e["ohif-extension-default"]=t(e["@ohif/core/src/utils/thumbnailNoImageModalities"],e["@ohif/core/src/utils/isDisplaySetReconstructable"],e["@cornerstonejs/tools/utilities"],e["@cornerstonejs/tools"],e["@cornerstonejs/dicom-image-loader"],e["@ohif/app"],e["@ohif/i18n"],e["@ohif/core/src/classes/ImageSet"],e["@ohif/core/src"],e["@cornerstonejs/core"],e["@ohif/core/src/hooks/useToolbar"],e["@ohif/core/src/utils/sortStudy"],e["@cornerstonejs/calculate-suv"],e["@ohif/core"],e["@ohif/core/src/utils/toNumber"],e["@ohif/core/src/utils/sortInstancesByPosition"],e.dcmjs,e["gl-matrix"],e["@ohif/extension-cornerstone"],e["@ohif/ui-next"])}(globalThis,(e,t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b)=>(()=>{var x,S,w={1810(e,t,r){"use strict";var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};t.A=function(e){var t=e.fill,r=e.width,n=e.height,o=e.style,s=function(e,t){var r={};for(var n in e)!(t.indexOf(n)>=0)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return i.default.createElement("svg",a({viewBox:"0 0 24 24",style:a({fill:void 0===t?"currentColor":t,width:void 0===r?24:r,height:void 0===n?24:n},void 0===o?{}:o)},s),i.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},9767(e,t,r){"use strict";var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};t.A=function(e){var t=e.fill,r=e.width,n=e.height,o=e.style,s=function(e,t){var r={};for(var n in e)!(t.indexOf(n)>=0)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return i.default.createElement("svg",a({viewBox:"0 0 24 24",style:a({fill:void 0===t?"currentColor":t,width:void 0===r?24:r,height:void 0===n?24:n},void 0===o?{}:o)},s),i.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},5956(e){"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),n=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},a=n.exec(e);a;){try{t[a[0]]=decodeURIComponent(a[0])}catch(e){var i=function(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=(function e(t,r){try{return[decodeURIComponent(t.join(""))]}catch(e){}if(1===t.length)return t;r=r||1;var n=t.slice(0,r),a=t.slice(r);return Array.prototype.concat.call([],e(n),e(a))})(t,n).join("")).match(r)||[];return e}}(a[0]);i!==a[0]&&(t[a[0]]=i)}a=n.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];e=e.replace(RegExp(l,"g"),t[l])}return e}(e)}}},9913(e){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),a=Array.isArray(t),i=0;i<n.length;i++){var o=n[i],s=e[o];(a?-1!==t.indexOf(o):t(o,s,e))&&(r[o]=s)}return r}},2051(e,t,r){var n=0/0,a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=u||c||Function("return this")(),f=Object.prototype.toString,p=Math.max,h=Math.min,g=function(){return d.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==f.call(t))return n;if(m(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=m(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var u=o.test(e);return u||s.test(e)?l(e.slice(2),u?2:8):i.test(e)?n:+e}e.exports=function(e,t,r){var n,a,i,o,s,l,u=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var r=n,i=a;return n=a=void 0,u=t,o=e.apply(i,r)}function b(e){var r=e-l,n=e-u;return void 0===l||r>=t||r<0||d&&n>=i}function x(){var e,r,n,a=g();if(b(a))return S(a);s=setTimeout(x,(e=a-l,r=a-u,n=t-e,d?h(n,i-r):n))}function S(e){return(s=void 0,f&&n)?v(e):(n=a=void 0,o)}function w(){var e,r=g(),i=b(r);if(n=arguments,a=this,l=r,i){if(void 0===s)return u=e=l,s=setTimeout(x,t),c?v(e):o;if(d)return s=setTimeout(x,t),v(l)}return void 0===s&&(s=setTimeout(x,t)),o}return t=y(t)||0,m(r)&&(c=!!r.leading,i=(d="maxWait"in r)?p(y(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),w.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=l=a=s=void 0},w.flush=function(){return void 0===s?o:S(g())},w}},3008(e,t,r){var n,a="__lodash_hash_undefined__",i=1/0,o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/,l=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,p="object"==typeof self&&self&&self.Object===Object&&self,h=f||p||Function("return this")(),g=Array.prototype,m=Function.prototype,y=Object.prototype,v=h["__core-js_shared__"],b=(n=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",x=m.toString,S=y.hasOwnProperty,w=y.toString,_=RegExp("^"+x.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=h.Symbol,D=g.splice,O=T(h,"Map"),k=T(Object,"create"),C=I?I.prototype:void 0,j=C?C.toString:void 0;function E(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function M(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function R(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function P(e,t){for(var r,n,a=e.length;a--;){if(r=e[a][0],r===(n=t)||r!=r&&n!=n)return a}return -1}function A(e,t){var r,n,a=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?a["string"==typeof t?"string":"hash"]:a.map}function T(e,t){var r,n,a,i=null==e?void 0:e[t];return!(!F(i)||(r=i,b&&b in r))&&("[object Function]"==(a=F(n=i)?w.call(n):"")||"[object GeneratorFunction]"==a||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(i)?_:d).test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(i))?i:void 0}E.prototype.clear=function(){this.__data__=k?k(null):{}},E.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},E.prototype.get=function(e){var t=this.__data__;if(k){var r=t[e];return r===a?void 0:r}return S.call(t,e)?t[e]:void 0},E.prototype.has=function(e){var t=this.__data__;return k?void 0!==t[e]:S.call(t,e)},E.prototype.set=function(e,t){return this.__data__[e]=k&&void 0===t?a:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,r=P(t,e);return!(r<0)&&(r==t.length-1?t.pop():D.call(t,r,1),!0)},M.prototype.get=function(e){var t=this.__data__,r=P(t,e);return r<0?void 0:t[r][1]},M.prototype.has=function(e){return P(this.__data__,e)>-1},M.prototype.set=function(e,t){var r=this.__data__,n=P(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new E,map:new(O||M),string:new E}},R.prototype.delete=function(e){return A(this,e).delete(e)},R.prototype.get=function(e){return A(this,e).get(e)},R.prototype.has=function(e){return A(this,e).has(e)},R.prototype.set=function(e,t){return A(this,e).set(e,t),this};var N=U(function(e){e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(B(e))return j?j.call(e):"";var t=e+"";return"0"==t&&1/e==-i?"-0":t}(t);var t,r=[];return l.test(e)&&r.push(""),e.replace(u,function(e,t,n,a){r.push(n?a.replace(c,"$1"):t||e)}),r});function U(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o),o};return r.cache=new(U.Cache||R),r}U.Cache=R;var L=Array.isArray;function F(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function B(e){return"symbol"==typeof e||!!e&&"object"==typeof e&&"[object Symbol]"==w.call(e)}e.exports=function(e,t,r){var n=null==e?void 0:function(e,t){var r;t=!function(e,t){if(L(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||B(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}(t,e)?L(r=t)?r:N(r):[t];for(var n=0,a=t.length;null!=e&&n<a;)e=e[function(e){if("string"==typeof e||B(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}(t[n++])];return n&&n==a?e:void 0}(e,t);return void 0===n?r:n}},3424(e,t,r){e=r.nmd(e);var n,a,i,o="__lodash_hash_undefined__",s=1/0,l="[object Arguments]",u="[object Array]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",h="[object Map]",g="[object Number]",m="[object Object]",y="[object Promise]",v="[object RegExp]",b="[object Set]",x="[object String]",S="[object Symbol]",w="[object WeakMap]",_="[object ArrayBuffer]",I="[object DataView]",D=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,k=/^\./,C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/\\(\\)?/g,E=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[l]=R[u]=R[_]=R[c]=R[I]=R[d]=R[f]=R[p]=R[h]=R[g]=R[m]=R[v]=R[b]=R[x]=R[w]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,A="object"==typeof self&&self&&self.Object===Object&&self,T=P||A||Function("return this")(),N=t&&!t.nodeType&&t,U=N&&e&&!e.nodeType&&e,L=U&&U.exports===N&&P.process,F=function(){try{return L&&L.binding("util")}catch(e){}}(),B=F&&F.isTypedArray;function V(e,t){return!!(e?e.length:0)&&function(e,t){if(t!=t){for(var r=z,n=e.length,a=-1;++a<n;)if(r(e[a],a,e))return a;return -1}for(var i=-1,o=e.length;++i<o;)if(e[i]===t)return i;return -1}(e,t)>-1}function z(e){return e!=e}function H(e,t){return e.has(t)}function W(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function $(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Y(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var G=Array.prototype,q=Function.prototype,X=Object.prototype,K=T["__core-js_shared__"],J=(n=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Z=q.toString,Q=X.hasOwnProperty,ee=X.toString,et=RegExp("^"+Z.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),er=T.Symbol,en=T.Uint8Array,ea=X.propertyIsEnumerable,ei=G.splice,eo=(a=Object.keys,i=Object,function(e){return a(i(e))}),es=eP(T,"DataView"),el=eP(T,"Map"),eu=eP(T,"Promise"),ec=eP(T,"Set"),ed=eP(T,"WeakMap"),ef=eP(Object,"create"),ep=eB(es),eh=eB(el),eg=eB(eu),em=eB(ec),ey=eB(ed),ev=er?er.prototype:void 0,eb=ev?ev.valueOf:void 0,ex=ev?ev.toString:void 0;function eS(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ew(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function e_(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function eI(e){var t=-1,r=e?e.length:0;for(this.__data__=new e_;++t<r;)this.add(e[t])}function eD(e){this.__data__=new ew(e)}function eO(e,t){for(var r=e.length;r--;)if(ez(e[r][0],t))return r;return -1}function ek(e,t){var r;t=eN(t,e)?[t]:eW(r=t)?r:eL(r);for(var n=0,a=t.length;null!=e&&n<a;)e=e[eF(t[n++])];return n&&n==a?e:void 0}function eC(e,t){return null!=e&&t in Object(e)}function ej(e,t,r,n,a){return e===t||(null!=e&&null!=t&&(eq(e)||eX(t))?function(e,t,r,n,a,i){var o=eW(e),s=eW(t),p=u,y=u;o||(p=(p=eA(e))==l?m:p),s||(y=(y=eA(t))==l?m:y);var w=p==m&&!W(e),D=y==m&&!W(t),O=p==y;if(O&&!w)return i||(i=new eD),o||eJ(e)?eM(e,t,r,n,a,i):function(e,t,r,n,a,i,o){switch(r){case I:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case _:if(e.byteLength!=t.byteLength||!n(new en(e),new en(t)))break;return!0;case c:case d:case g:return ez(+e,+t);case f:return e.name==t.name&&e.message==t.message;case v:case x:return e==t+"";case h:var s=$;case b:var l=2&i;if(s||(s=Y),e.size!=t.size&&!l)break;var u=o.get(e);if(u)return u==t;i|=1,o.set(e,t);var p=eM(s(e),s(t),n,a,i,o);return o.delete(e),p;case S:if(eb)return eb.call(e)==eb.call(t)}return!1}(e,t,p,r,n,a,i);if(!(2&a)){var k=w&&Q.call(e,"__wrapped__"),C=D&&Q.call(t,"__wrapped__");if(k||C){var j=k?e.value():e,E=C?t.value():t;return i||(i=new eD),r(j,E,n,a,i)}}return!!O&&(i||(i=new eD),function(e,t,r,n,a,i){var o=2&a,s=eZ(e),l=s.length;if(l!=eZ(t).length&&!o)return!1;for(var u=l;u--;){var c=s[u];if(!(o?c in t:Q.call(t,c)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var f=!0;i.set(e,t),i.set(t,e);for(var p=o;++u<l;){var h=e[c=s[u]],g=t[c];if(n)var m=o?n(g,h,c,t,e,i):n(h,g,c,e,t,i);if(!(void 0===m?h===g||r(h,g,n,a,i):m)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var y=e.constructor,v=t.constructor;y!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v)&&(f=!1)}return i.delete(e),i.delete(t),f}(e,t,r,n,a,i))}(e,t,ej,r,n,a):e!=e&&t!=t)}eS.prototype.clear=function(){this.__data__=ef?ef(null):{}},eS.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},eS.prototype.get=function(e){var t=this.__data__;if(ef){var r=t[e];return r===o?void 0:r}return Q.call(t,e)?t[e]:void 0},eS.prototype.has=function(e){var t=this.__data__;return ef?void 0!==t[e]:Q.call(t,e)},eS.prototype.set=function(e,t){return this.__data__[e]=ef&&void 0===t?o:t,this},ew.prototype.clear=function(){this.__data__=[]},ew.prototype.delete=function(e){var t=this.__data__,r=eO(t,e);return!(r<0)&&(r==t.length-1?t.pop():ei.call(t,r,1),!0)},ew.prototype.get=function(e){var t=this.__data__,r=eO(t,e);return r<0?void 0:t[r][1]},ew.prototype.has=function(e){return eO(this.__data__,e)>-1},ew.prototype.set=function(e,t){var r=this.__data__,n=eO(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},e_.prototype.clear=function(){this.__data__={hash:new eS,map:new(el||ew),string:new eS}},e_.prototype.delete=function(e){return eR(this,e).delete(e)},e_.prototype.get=function(e){return eR(this,e).get(e)},e_.prototype.has=function(e){return eR(this,e).has(e)},e_.prototype.set=function(e,t){return eR(this,e).set(e,t),this},eI.prototype.add=eI.prototype.push=function(e){return this.__data__.set(e,o),this},eI.prototype.has=function(e){return this.__data__.has(e)},eD.prototype.clear=function(){this.__data__=new ew},eD.prototype.delete=function(e){return this.__data__.delete(e)},eD.prototype.get=function(e){return this.__data__.get(e)},eD.prototype.has=function(e){return this.__data__.has(e)},eD.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ew){var n=r.__data__;if(!el||n.length<199)return n.push([e,t]),this;r=this.__data__=new e_(n)}return r.set(e,t),this};var eE=ec&&1/Y(new ec([,-0]))[1]==s?function(e){return new ec(e)}:function(){};function eM(e,t,r,n,a,i){var o=2&a,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var c=-1,d=!0,f=1&a?new eI:void 0;for(i.set(e,t),i.set(t,e);++c<s;){var p=e[c],h=t[c];if(n)var g=o?n(h,p,c,t,e,i):n(p,h,c,e,t,i);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!function(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!f.has(t)&&(p===e||r(p,e,n,a,i)))return f.add(t)})){d=!1;break}}else if(!(p===h||r(p,h,n,a,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function eR(e,t){var r,n,a=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?a["string"==typeof t?"string":"hash"]:a.map}function eP(e,t){var r,n=null==e?void 0:e[t];return!(!eq(n)||(r=n,J&&J in r))&&(eY(n)||W(n)?et:E).test(eB(n))?n:void 0}var eA=function(e){return ee.call(e)};function eT(e,t){return!!(t=null==t?0x1fffffffffffff:t)&&("number"==typeof e||M.test(e))&&e>-1&&e%1==0&&e<t}function eN(e,t){if(eW(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||eK(e))||O.test(e)||!D.test(e)||null!=t&&e in Object(t)}(es&&eA(new es(new ArrayBuffer(1)))!=I||el&&eA(new el)!=h||eu&&eA(eu.resolve())!=y||ec&&eA(new ec)!=b||ed&&eA(new ed)!=w)&&(eA=function(e){var t=ee.call(e),r=t==m?e.constructor:void 0,n=r?eB(r):void 0;if(n)switch(n){case ep:return I;case eh:return h;case eg:return y;case em:return b;case ey:return w}return t});function eU(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}var eL=eV(function(e){e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(eK(e))return ex?ex.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var t,r=[];return k.test(e)&&r.push(""),e.replace(C,function(e,t,n,a){r.push(n?a.replace(j,"$1"):t||e)}),r});function eF(e){if("string"==typeof e||eK(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function eB(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eV(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o),o};return r.cache=new(eV.Cache||e_),r}function ez(e,t){return e===t||e!=e&&t!=t}function eH(e){var t;return eX(t=e)&&e$(t)&&Q.call(e,"callee")&&(!ea.call(e,"callee")||ee.call(e)==l)}eV.Cache=e_;var eW=Array.isArray;function e$(e){return null!=e&&eG(e.length)&&!eY(e)}function eY(e){var t=eq(e)?ee.call(e):"";return t==p||"[object GeneratorFunction]"==t}function eG(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function eq(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eX(e){return!!e&&"object"==typeof e}function eK(e){return"symbol"==typeof e||eX(e)&&ee.call(e)==S}var eJ=B?function(e){return B(e)}:function(e){return eX(e)&&eG(e.length)&&!!R[ee.call(e)]};function eZ(e){return e$(e)?function(e){var t=eW(e)||eH(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],r=t.length,n=!!r;for(var a in e)Q.call(e,a)&&!(n&&("length"==a||eT(a,r)))&&t.push(a);return t}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||X))return eo(e);var t,r,n=[];for(var a in Object(e))Q.call(e,a)&&"constructor"!=a&&n.push(a);return n}(e)}function eQ(e){return e}e.exports=function(e,t){var r,n,a,i,o;return e&&e.length?function(e,t){var r=-1,n=V,a=e.length,i=!0,o=[],s=o;if(a>=200){var l=t?null:eE(e);if(l)return Y(l);i=!1,n=H,s=new eI}else s=t?[]:o;e:for(;++r<a;){var u=e[r],c=t?t(u):u;if(u=0!==u?u:0,i&&c==c){for(var d=s.length;d--;)if(s[d]===c)continue e;t&&s.push(c),o.push(u)}else n(s,c,void 0)||(s!==o&&s.push(c),o.push(u))}return o}(e,"function"==typeof t?t:null==t?eQ:"object"==typeof t?eW(t)?(r=t[0],n=t[1],eN(r)&&(a=n)==a&&!eq(a)?eU(eF(r),n):function(e){var t,a,i,o,s,l=(t=e,a=r,void 0===(i=null==t?void 0:ek(t,a))?void 0:i);return void 0===l&&l===n?(o=e,s=r,null!=o&&function(e,t,r){t=eN(t,e)?[t]:eW(n=t)?n:eL(n);for(var n,a,i=-1,o=t.length;++i<o;){var s=eF(t[i]);if(!(a=null!=e&&r(e,s)))break;e=e[s]}if(a)return a;var o=e?e.length:0;return!!o&&eG(o)&&eT(s,o)&&(eW(e)||eH(e))}(o,s,eC)):ej(n,l,void 0,3)}):1==(o=function(e){for(var t=eZ(e),r=t.length;r--;){var n,a=t[r],i=e[a];t[r]=[a,i,(n=i)==n&&!eq(n)]}return t}(i=t)).length&&o[0][2]?eU(o[0][0],o[0][1]):function(e){return e===i||function(e,t){var r=t.length,n=r;if(null==e)return!n;for(e=Object(e);r--;){var a=t[r];if((0,a[2])?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<n;){var i=(a=t[r])[0],o=e[i],s=a[1];if(0,a[2]){if(void 0===o&&!(i in e))return!1}else{var l,u=new eD;if(!(void 0===l?ej(s,o,void 0,3,u):l))return!1}}return!0}(e,o)}:function(e){var t;return eN(e)?(t=eF(e),function(e){return null==e?void 0:e[t]}):function(t){return ek(t,e)}}(t)):[]}},5178(e,t,r){e.exports=r(3188)(r(7183),"DataView")},3615(e,t,r){var n=r(8342),a=r(9184),i=r(128),o=r(4287),s=r(7);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,e.exports=l},789(e,t,r){var n=r(7752),a=r(718),i=r(7849),o=r(3957),s=r(845);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,e.exports=l},8561(e,t,r){e.exports=r(3188)(r(7183),"Map")},1451(e,t,r){var n=r(5674),a=r(1036),i=r(31),o=r(1907),s=r(971);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=o,l.prototype.set=s,e.exports=l},1490(e,t,r){e.exports=r(3188)(r(7183),"Promise")},6775(e,t,r){e.exports=r(3188)(r(7183),"Set")},8869(e,t,r){var n=r(1451),a=r(6810),i=r(5813);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=a,o.prototype.has=i,e.exports=o},2823(e,t,r){var n=r(789),a=r(8926),i=r(2680),o=r(3851),s=r(8423),l=r(3967);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=a,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=l,e.exports=u},7187(e,t,r){e.exports=r(7183).Symbol},6846(e,t,r){e.exports=r(7183).Uint8Array},1366(e,t,r){e.exports=r(3188)(r(7183),"WeakMap")},607(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},836(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}},661(e,t,r){var n=r(142),a=r(5962),i=r(4383),o=r(8098),s=r(4683),l=r(3905),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),c=!r&&a(e),d=!r&&!c&&o(e),f=!r&&!c&&!d&&l(e),p=r||c||d||f,h=p?n(e.length,String):[],g=h.length;for(var m in e)(t||u.call(e,m))&&!(p&&("length"==m||d&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g)))&&h.push(m);return h}},6138(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}},5862(e){e.exports=function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}},7938(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},2177(e,t,r){var n=r(9142),a=r(9830),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];i.call(e,t)&&a(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},435(e,t,r){var n=r(9830);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return -1}},267(e,t,r){var n=r(6837),a=r(8420);e.exports=function(e,t){return e&&n(t,a(t),e)}},5240(e,t,r){var n=r(6837),a=r(3435);e.exports=function(e,t){return e&&n(t,a(t),e)}},9142(e,t,r){var n=r(3733);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9557(e,t,r){var n=r(2823),a=r(607),i=r(2177),o=r(267),s=r(5240),l=r(6064),u=r(8601),c=r(2881),d=r(6186),f=r(3300),p=r(4667),h=r(8355),g=r(6203),m=r(7981),y=r(235),v=r(4383),b=r(8098),x=r(4024),S=r(6015),w=r(8802),_=r(8420),I=r(3435),D="[object Arguments]",O="[object Function]",k="[object Object]",C={};C[D]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[k]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[O]=C["[object WeakMap]"]=!1,e.exports=function e(t,r,j,E,M,R){var P,A=1&r,T=2&r,N=4&r;if(j&&(P=M?j(t,E,M,R):j(t)),void 0!==P)return P;if(!S(t))return t;var U=v(t);if(U){if(P=g(t),!A)return u(t,P)}else{var L=h(t),F=L==O||"[object GeneratorFunction]"==L;if(b(t))return l(t,A);if(L==k||L==D||F&&!M){if(P=T||F?{}:y(t),!A)return T?d(t,s(P,t)):c(t,o(P,t))}else{if(!C[L])return M?t:{};P=m(t,L,A)}}R||(R=new n);var B=R.get(t);if(B)return B;R.set(t,P),w(t)?t.forEach(function(n){P.add(e(n,r,j,n,t,R))}):x(t)&&t.forEach(function(n,a){P.set(a,e(n,r,j,a,t,R))});var V=N?T?p:f:T?I:_,z=U?void 0:V(t);return a(z||t,function(n,a){z&&(n=t[a=n]),i(P,a,e(n,r,j,a,t,R))}),P}},1534(e,t,r){var n=r(6015),a=Object.create;e.exports=function(){function e(){}return function(t){if(!n(t))return{};if(a)return a(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}()},4183(e,t,r){var n=r(6895);e.exports=r(9835)(n)},1311(e,t,r){e.exports=r(7747)()},6895(e,t,r){var n=r(1311),a=r(8420);e.exports=function(e,t){return e&&n(e,t,a)}},2748(e,t,r){var n=r(4679),a=r(4671);e.exports=function(e,t){t=n(t,e);for(var r=0,i=t.length;null!=e&&r<i;)e=e[a(t[r++])];return r&&r==i?e:void 0}},9169(e,t,r){var n=r(5862),a=r(4383);e.exports=function(e,t,r){var i=t(e);return a(e)?i:n(i,r(e))}},6990(e,t,r){var n=r(7187),a=r(1029),i=r(8704),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?a(e):i(e)}},1607(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},6252(e,t,r){var n=r(6990),a=r(6184);e.exports=function(e){return a(e)&&"[object Arguments]"==n(e)}},3028(e,t,r){var n=r(7114),a=r(6184);e.exports=function e(t,r,i,o,s){return t===r||(null!=t&&null!=r&&(a(t)||a(r))?n(t,r,i,o,e,s):t!=t&&r!=r)}},7114(e,t,r){var n=r(2823),a=r(5237),i=r(3728),o=r(5355),s=r(8355),l=r(4383),u=r(8098),c=r(3905),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,g,m,y){var v=l(e),b=l(t),x=v?f:s(e),S=b?f:s(t);x=x==d?p:x,S=S==d?p:S;var w=x==p,_=S==p,I=x==S;if(I&&u(e)){if(!u(t))return!1;v=!0,w=!1}if(I&&!w)return y||(y=new n),v||c(e)?a(e,t,r,g,m,y):i(e,t,x,r,g,m,y);if(!(1&r)){var D=w&&h.call(e,"__wrapped__"),O=_&&h.call(t,"__wrapped__");if(D||O){var k=D?e.value():e,C=O?t.value():t;return y||(y=new n),m(k,C,r,g,y)}}return!!I&&(y||(y=new n),o(e,t,r,g,m,y))}},162(e,t,r){var n=r(8355),a=r(6184);e.exports=function(e){return a(e)&&"[object Map]"==n(e)}},9121(e,t,r){var n=r(2823),a=r(3028);e.exports=function(e,t,r,i){var o=r.length,s=o,l=!i;if(null==e)return!s;for(e=Object(e);o--;){var u=r[o];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=r[o])[0],d=e[c],f=u[1];if(l&&u[2]){if(void 0===d&&!(c in e))return!1}else{var p=new n;if(i)var h=i(d,f,c,e,t,p);if(!(void 0===h?a(f,d,3,i,p):h))return!1}}return!0}},3829(e,t,r){var n=r(4360),a=r(7234),i=r(6015),o=r(275),s=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,d=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||a(e))&&(n(e)?d:s).test(o(e))}},8344(e,t,r){var n=r(8355),a=r(6184);e.exports=function(e){return a(e)&&"[object Set]"==n(e)}},4271(e,t,r){var n=r(6990),a=r(1784),i=r(6184),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&a(e.length)&&!!o[n(e)]}},4207(e,t,r){var n=r(2801),a=r(2208),i=r(9090),o=r(4383),s=r(3681);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?o(e)?a(e[0],e[1]):n(e):s(e)}},9966(e,t,r){var n=r(8089),a=r(6128),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},7641(e,t,r){var n=r(6015),a=r(8089),i=r(5567),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=a(e),r=[];for(var s in e)"constructor"==s&&(t||!o.call(e,s))||r.push(s);return r}},5218(e,t,r){var n=r(4183),a=r(9592);e.exports=function(e,t){var r=-1,i=a(e)?Array(e.length):[];return n(e,function(e,n,a){i[++r]=t(e,n,a)}),i}},2801(e,t,r){var n=r(9121),a=r(9406),i=r(6459);e.exports=function(e){var t=a(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},2208(e,t,r){var n=r(3028),a=r(9650),i=r(2993),o=r(9668),s=r(8938),l=r(6459),u=r(4671);e.exports=function(e,t){return o(e)&&s(t)?l(u(e),t):function(r){var o=a(r,e);return void 0===o&&o===t?i(r,e):n(t,o,3)}}},5351(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},4953(e,t,r){var n=r(2748);e.exports=function(e){return function(t){return n(t,e)}}},142(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},4742(e,t,r){var n=r(7187),a=r(6138),i=r(4383),o=r(3536),s=1/0,l=n?n.prototype:void 0,u=l?l.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return a(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-s?"-0":r}},6143(e){e.exports=function(e){return function(t){return e(t)}}},7773(e){e.exports=function(e,t){return e.has(t)}},4420(e,t,r){var n=r(9090);e.exports=function(e){return"function"==typeof e?e:n}},4679(e,t,r){var n=r(4383),a=r(9668),i=r(412),o=r(2832);e.exports=function(e,t){return n(e)?e:a(e,t)?[e]:i(o(e))}},3911(e,t,r){var n=r(6846);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},6064(e,t,r){e=r.nmd(e);var n=r(7183),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,o=i&&i.exports===a?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},3887(e,t,r){var n=r(3911);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},1871(e){var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},5938(e,t,r){var n=r(7187),a=n?n.prototype:void 0,i=a?a.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},1671(e,t,r){var n=r(3911);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},8601(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},6837(e,t,r){var n=r(2177),a=r(9142);e.exports=function(e,t,r,i){var o=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=i?i(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?a(r,u,c):n(r,u,c)}return r}},2881(e,t,r){var n=r(6837),a=r(9946);e.exports=function(e,t){return n(e,a(e),t)}},6186(e,t,r){var n=r(6837),a=r(1693);e.exports=function(e,t){return n(e,a(e),t)}},5171(e,t,r){e.exports=r(7183)["__core-js_shared__"]},9835(e,t,r){var n=r(9592);e.exports=function(e,t){return function(r,a){if(null==r)return r;if(!n(r))return e(r,a);for(var i=r.length,o=t?i:-1,s=Object(r);(t?o--:++o<i)&&!1!==a(s[o],o,s););return r}}},7747(e){e.exports=function(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++a];if(!1===r(i[l],l,i))break}return t}}},3733(e,t,r){var n=r(3188);e.exports=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},5237(e,t,r){var n=r(8869),a=r(7938),i=r(7773);e.exports=function(e,t,r,o,s,l){var u=1&r,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var h=-1,g=!0,m=2&r?new n:void 0;for(l.set(e,t),l.set(t,e);++h<c;){var y=e[h],v=t[h];if(o)var b=u?o(v,y,h,t,e,l):o(y,v,h,e,t,l);if(void 0!==b){if(b)continue;g=!1;break}if(m){if(!a(t,function(e,t){if(!i(m,t)&&(y===e||s(y,e,r,o,l)))return m.push(t)})){g=!1;break}}else if(!(y===v||s(y,v,r,o,l))){g=!1;break}}return l.delete(e),l.delete(t),g}},3728(e,t,r){var n=r(7187),a=r(6846),i=r(9830),o=r(5237),s=r(8887),l=r(8629),u=n?n.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,r,n,u,d,f){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new a(e),new a(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var h=1&n;if(p||(p=l),e.size!=t.size&&!h)break;var g=f.get(e);if(g)return g==t;n|=2,f.set(e,t);var m=o(p(e),p(t),n,u,d,f);return f.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},5355(e,t,r){var n=r(3300),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,o,s){var l=1&r,u=n(e),c=u.length;if(c!=n(t).length&&!l)return!1;for(var d=c;d--;){var f=u[d];if(!(l?f in t:a.call(t,f)))return!1}var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d<c;){var y=e[f=u[d]],v=t[f];if(i)var b=l?i(v,y,f,t,e,s):i(y,v,f,e,t,s);if(!(void 0===b?y===v||o(y,v,r,i,s):b)){g=!1;break}m||(m="constructor"==f)}if(g&&!m){var x=e.constructor,S=t.constructor;x!=S&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof S&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}},5194(e,t,r){e.exports="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g},3300(e,t,r){var n=r(9169),a=r(9946),i=r(8420);e.exports=function(e){return n(e,i,a)}},4667(e,t,r){var n=r(9169),a=r(1693),i=r(3435);e.exports=function(e){return n(e,i,a)}},8037(e,t,r){var n=r(5912);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},9406(e,t,r){var n=r(8938),a=r(8420);e.exports=function(e){for(var t=a(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,n(o)]}return t}},3188(e,t,r){var n=r(3829),a=r(1870);e.exports=function(e,t){var r=a(e,t);return n(r)?r:void 0}},9637(e,t,r){e.exports=r(1429)(Object.getPrototypeOf,Object)},1029(e,t,r){var n=r(7187),a=Object.prototype,i=a.hasOwnProperty,o=a.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var a=o.call(e);return n&&(t?e[s]=r:delete e[s]),a}},9946(e,t,r){var n=r(836),a=r(6499),i=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;e.exports=o?function(e){return null==e?[]:n(o(e=Object(e)),function(t){return i.call(e,t)})}:a},1693(e,t,r){var n=r(5862),a=r(9637),i=r(9946),o=r(6499);e.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=a(e);return t}:o},8355(e,t,r){var n=r(5178),a=r(8561),i=r(1490),o=r(6775),s=r(1366),l=r(6990),u=r(275),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",g=u(n),m=u(a),y=u(i),v=u(o),b=u(s),x=l;(n&&x(new n(new ArrayBuffer(1)))!=h||a&&x(new a)!=c||i&&x(i.resolve())!=d||o&&x(new o)!=f||s&&x(new s)!=p)&&(x=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case g:return h;case m:return c;case y:return d;case v:return f;case b:return p}return t}),e.exports=x},1870(e){e.exports=function(e,t){return null==e?void 0:e[t]}},3852(e,t,r){var n=r(4679),a=r(5962),i=r(4383),o=r(4683),s=r(1784),l=r(4671);e.exports=function(e,t,r){t=n(t,e);for(var u=-1,c=t.length,d=!1;++u<c;){var f=l(t[u]);if(!(d=null!=e&&r(e,f)))break;e=e[f]}return d||++u!=c?d:!!(c=null==e?0:e.length)&&s(c)&&o(f,c)&&(i(e)||a(e))}},8342(e,t,r){var n=r(1960);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},9184(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},128(e,t,r){var n=r(1960),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return a.call(t,e)?t[e]:void 0}},4287(e,t,r){var n=r(1960),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:a.call(t,e)}},7(e,t,r){var n=r(1960);e.exports=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},6203(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},7981(e,t,r){var n=r(3911),a=r(3887),i=r(1871),o=r(5938),s=r(1671);e.exports=function(e,t,r){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return a(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return i(e);case"[object Symbol]":return o(e)}}},235(e,t,r){var n=r(1534),a=r(9637),i=r(8089);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(a(e))}},4683(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9668(e,t,r){var n=r(4383),a=r(3536),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||a(e))||o.test(e)||!i.test(e)||null!=t&&e in Object(t)}},5912(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7234(e,t,r){var n,a=r(5171),i=(n=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},8089(e){var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},8938(e,t,r){var n=r(6015);e.exports=function(e){return e==e&&!n(e)}},7752(e){e.exports=function(){this.__data__=[],this.size=0}},718(e,t,r){var n=r(435),a=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():a.call(t,r,1),--this.size,!0)}},7849(e,t,r){var n=r(435);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},3957(e,t,r){var n=r(435);e.exports=function(e){return n(this.__data__,e)>-1}},845(e,t,r){var n=r(435);e.exports=function(e,t){var r=this.__data__,a=n(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}},5674(e,t,r){var n=r(3615),a=r(789),i=r(8561);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||a),string:new n}}},1036(e,t,r){var n=r(8037);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=!!t,t}},31(e,t,r){var n=r(8037);e.exports=function(e){return n(this,e).get(e)}},1907(e,t,r){var n=r(8037);e.exports=function(e){return n(this,e).has(e)}},971(e,t,r){var n=r(8037);e.exports=function(e,t){var r=n(this,e),a=r.size;return r.set(e,t),this.size+=+(r.size!=a),this}},8887(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},6459(e){e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},2110(e,t,r){var n=r(9098);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},1960(e,t,r){e.exports=r(3188)(Object,"create")},6128(e,t,r){e.exports=r(1429)(Object.keys,Object)},5567(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},3271(e,t,r){e=r.nmd(e);var n=r(5194),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,o=i&&i.exports===a&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},8704(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1429(e){e.exports=function(e,t){return function(r){return e(t(r))}}},7183(e,t,r){var n=r(5194),a="object"==typeof self&&self&&self.Object===Object&&self;e.exports=n||a||Function("return this")()},6810(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},5813(e){e.exports=function(e){return this.__data__.has(e)}},8629(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},8926(e,t,r){var n=r(789);e.exports=function(){this.__data__=new n,this.size=0}},2680(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3851(e){e.exports=function(e){return this.__data__.get(e)}},8423(e){e.exports=function(e){return this.__data__.has(e)}},3967(e,t,r){var n=r(789),a=r(8561),i=r(1451);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!a||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(o)}return r.set(e,t),this.size=r.size,this}},412(e,t,r){var n=r(2110),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;e.exports=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(a,function(e,r,n,a){t.push(n?a.replace(i,"$1"):r||e)}),t})},4671(e,t,r){var n=r(3536),a=1/0;e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}},275(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1285(e,t,r){var n=r(9557);e.exports=function(e){return n(e,5)}},9830(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2122(e,t,r){var n=r(6895),a=r(4420);e.exports=function(e,t){return e&&n(e,a(t))}},9650(e,t,r){var n=r(2748);e.exports=function(e,t,r){var a=null==e?void 0:n(e,t);return void 0===a?r:a}},2993(e,t,r){var n=r(1607),a=r(3852);e.exports=function(e,t){return null!=e&&a(e,t,n)}},9090(e){e.exports=function(e){return e}},5962(e,t,r){var n=r(6252),a=r(6184),i=Object.prototype,o=i.hasOwnProperty,s=i.propertyIsEnumerable;e.exports=n(function(){return arguments}())?n:function(e){return a(e)&&o.call(e,"callee")&&!s.call(e,"callee")}},4383(e){e.exports=Array.isArray},9592(e,t,r){var n=r(4360),a=r(1784);e.exports=function(e){return null!=e&&a(e.length)&&!n(e)}},8098(e,t,r){e=r.nmd(e);var n=r(7183),a=r(1329),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||a},4360(e,t,r){var n=r(6990),a=r(6015);e.exports=function(e){if(!a(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1784(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},4024(e,t,r){var n=r(162),a=r(6143),i=r(3271),o=i&&i.isMap;e.exports=o?a(o):n},6015(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},6184(e){e.exports=function(e){return null!=e&&"object"==typeof e}},5229(e,t,r){var n=r(6990),a=r(9637),i=r(6184),o=Object.prototype,s=Function.prototype.toString,l=o.hasOwnProperty,u=s.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=a(e);if(null===t)return!0;var r=l.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==u}},8802(e,t,r){var n=r(8344),a=r(6143),i=r(3271),o=i&&i.isSet;e.exports=o?a(o):n},7561(e,t,r){var n=r(6990),a=r(4383),i=r(6184);e.exports=function(e){return"string"==typeof e||!a(e)&&i(e)&&"[object String]"==n(e)}},3536(e,t,r){var n=r(6990),a=r(6184);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==n(e)}},3905(e,t,r){var n=r(4271),a=r(6143),i=r(3271),o=i&&i.isTypedArray;e.exports=o?a(o):n},8420(e,t,r){var n=r(661),a=r(9966),i=r(9592);e.exports=function(e){return i(e)?n(e):a(e)}},3435(e,t,r){var n=r(661),a=r(7641),i=r(9592);e.exports=function(e){return i(e)?n(e,!0):a(e)}},764(e,t,r){var n=r(6138),a=r(4207),i=r(5218),o=r(4383);e.exports=function(e,t){return(o(e)?n:i)(e,a(t,3))}},9098(e,t,r){var n=r(1451);function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(a.Cache||n),r}a.Cache=n,e.exports=a},3681(e,t,r){var n=r(5351),a=r(4953),i=r(9668),o=r(4671);e.exports=function(e){return i(e)?n(o(e)):a(e)}},6499(e){e.exports=function(){return[]}},1329(e){e.exports=function(){return!1}},2832(e,t,r){var n=r(4742);e.exports=function(e){return null==e?"":n(e)}},4867(e,t,r){e=r.nmd(e),e.exports=function(){"use strict";function t(){return V.apply(null,arguments)}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){var t;if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(t in e)if(i(e,t))return!1;return!0}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var r,n=[],a=e.length;for(r=0;r<a;++r)n.push(t(e[r],r));return n}function d(e,t){for(var r in t)i(t,r)&&(e[r]=t[r]);return i(t,"toString")&&(e.toString=t.toString),i(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,r,n){return ti(e,t,r,n,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function h(e){var t=null,r=!1,n=e._d&&!isNaN(e._d.getTime());return(n&&(t=p(e),r=z.call(t.parsedDateParts,function(e){return null!=e}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e))?n:(e._isValid=n,e._isValid)}function g(e){var t=f(NaN);return null!=e?d(p(t),e):p(t).userInvalidated=!0,t}z=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var m,y,v=t.momentProperties=[],b=!1;function x(e,t){var r,n,a,i=v.length;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=p(t)),s(t._locale)||(e._locale=t._locale),i>0)for(r=0;r<i;r++)s(a=t[n=v[r]])||(e[n]=a);return e}function S(e){x(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,t.updateOffset(this),b=!1)}function w(e){return e instanceof S||null!=e&&null!=e._isAMomentObject}function _(e){!1===t.suppressDeprecationWarnings&&"u">typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function I(e,r){var n=!0;return d(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){var a,o,s,l=[],u=arguments.length;for(o=0;o<u;o++){if(a="","object"==typeof arguments[o]){for(s in a+="\n["+o+"] ",arguments[0])i(arguments[0],s)&&(a+=s+": "+arguments[0][s]+", ");a=a.slice(0,-2)}else a=arguments[o];l.push(a)}_(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+Error().stack),n=!1}return r.apply(this,arguments)},r)}var D={};function O(e,r){null!=t.deprecationHandler&&t.deprecationHandler(e,r),D[e]||(_(r),D[e]=!0)}function k(e){return"u">typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var r,n=d({},e);for(r in t)i(t,r)&&(a(e[r])&&a(t[r])?(n[r]={},d(n[r],e[r]),d(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)i(e,r)&&!i(t,r)&&a(e[r])&&(n[r]=d({},n[r]));return n}function j(e){null!=e&&this.set(e)}function E(e,t,r){var n=""+Math.abs(e);return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,t-n.length)).toString().substr(1)+n}t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var M=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},A={};function T(e,t,r,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),e&&(A[e]=a),t&&(A[t[0]]=function(){return E(a.apply(this,arguments),t[1],t[2])}),r&&(A[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function N(e,t){return e.isValid()?(P[t=U(t,e.localeData())]=P[t]||function(e){var t,r,n,a=e.match(M);for(r=0,n=a.length;r<n;r++)A[a[r]]?a[r]=A[a[r]]:a[r]=(t=a[r]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=k(a[r])?a[r].call(t,e):a[r];return i}}(t),P[t](e)):e.localeData().invalidDate()}function U(e,t){var r=5;function n(e){return t.longDateFormat(e)||e}for(R.lastIndex=0;r>=0&&R.test(e);)e=e.replace(R,n),R.lastIndex=0,r-=1;return e}var L={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function F(e){return"string"==typeof e?L[e]||L[e.toLowerCase()]:void 0}function B(e){var t,r,n={};for(r in e)i(e,r)&&(t=F(r))&&(n[t]=e[r]);return n}var V,z,H,W={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},$=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)i(e,t)&&r.push(t);return r},Y=/\d/,G=/\d\d/,q=/\d{3}/,X=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Z=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,ee=/\d{1,3}/,et=/\d{1,4}/,er=/[+-]?\d{1,6}/,en=/\d+/,ea=/[+-]?\d+/,ei=/Z|[+-]\d\d:?\d\d/gi,eo=/Z|[+-]\d\d(?::?\d\d)?/gi,es=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,el=/^[1-9]\d?/,eu=/^([1-9]\d|\d)/;function ec(e,t,r){H[e]=k(t)?t:function(e,n){return e&&r?r:t}}function ed(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ef(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ep(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=ef(t)),r}H={};var eh={};function eg(e,t){var r,n,a=t;for("string"==typeof e&&(e=[e]),l(t)&&(a=function(e,r){r[t]=ep(e)}),n=e.length,r=0;r<n;r++)eh[e[r]]=a}function em(e,t){eg(e,function(e,r,n,a){n._w=n._w||{},t(e,n._w,n,a)})}function ey(e){return e%4==0&&e%100!=0||e%400==0}function ev(e){return ey(e)?366:365}T("Y",0,0,function(){var e=this.year();return e<=9999?E(e,4):"+"+e}),T(0,["YY",2],0,function(){return this.year()%100}),T(0,["YYYY",4],0,"year"),T(0,["YYYYY",5],0,"year"),T(0,["YYYYYY",6,!0],0,"year"),ec("Y",ea),ec("YY",J,G),ec("YYYY",et,X),ec("YYYYY",er,K),ec("YYYYYY",er,K),eg(["YYYYY","YYYYYY"],0),eg("YYYY",function(e,r){r[0]=2===e.length?t.parseTwoDigitYear(e):ep(e)}),eg("YY",function(e,r){r[0]=t.parseTwoDigitYear(e)}),eg("Y",function(e,t){t[0]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return ep(e)+(ep(e)>68?1900:2e3)};var eb=ex("FullYear",!0);function ex(e,r){return function(n){return null!=n?(ew(this,e,n),t.updateOffset(this,r),this):eS(this,e)}}function eS(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function ew(e,t,r){var n,a,i,o;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(a?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(a?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(a?n.setUTCHours(r):n.setHours(r));case"Date":return void(a?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=e.month(),o=29!==(o=e.date())||1!==i||ey(r)?o:28,a?n.setUTCFullYear(r,i,o):n.setFullYear(r,i,o)}}function e_(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=(t%12+12)%12;return e+=(t-r)/12,1===r?ey(e)?29:28:31-r%7%2}eH=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return -1},T("M",["MM",2],"Mo",function(){return this.month()+1}),T("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),T("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ec("M",J,el),ec("MM",J,G),ec("MMM",function(e,t){return t.monthsShortRegex(e)}),ec("MMMM",function(e,t){return t.monthsRegex(e)}),eg(["M","MM"],function(e,t){t[1]=ep(e)-1}),eg(["MMM","MMMM"],function(e,t,r,n){var a=r._locale.monthsParse(e,n,r._strict);null!=a?t[1]=a:p(r).invalidMonth=e});var eI="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),eD=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;function eO(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();if(r)if("MMM"===t)return -1!==(a=eH.call(this._shortMonthsParse,o))?a:null;else return -1!==(a=eH.call(this._longMonthsParse,o))?a:null;return"MMM"===t?-1!==(a=eH.call(this._shortMonthsParse,o))||-1!==(a=eH.call(this._longMonthsParse,o))?a:null:-1!==(a=eH.call(this._longMonthsParse,o))||-1!==(a=eH.call(this._shortMonthsParse,o))?a:null}function ek(e,t){if(!e.isValid())return e;if("string"==typeof t){if(/^\d+$/.test(t))t=ep(t);else if(!l(t=e.localeData().monthsParse(t)))return e}var r=t,n=e.date();return n=n<29?n:Math.min(n,e_(e.year(),r)),e._isUTC?e._d.setUTCMonth(r,n):e._d.setMonth(r,n),e}function eC(e){return null!=e?(ek(this,e),t.updateOffset(this,!0),this):eS(this,"Month")}function ej(){function e(e,t){return t.length-e.length}var t,r,n,a,i=[],o=[],s=[];for(t=0;t<12;t++)r=f([2e3,t]),n=ed(this.monthsShort(r,"")),a=ed(this.months(r,"")),i.push(n),o.push(a),s.push(a),s.push(n);i.sort(e),o.sort(e),s.sort(e),this._monthsRegex=RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=RegExp("^("+i.join("|")+")","i")}function eE(e,t,r,n,a,i,o){var s;return e<100&&e>=0?isFinite((s=new Date(e+400,t,r,n,a,i,o)).getFullYear())&&s.setFullYear(e):s=new Date(e,t,r,n,a,i,o),s}function eM(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,isFinite((t=new Date(Date.UTC.apply(null,r))).getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function eR(e,t,r){var n=7+t-r;return-((7+eM(e,0,n).getUTCDay()-t)%7)+n-1}function eP(e,t,r,n,a){var i,o,s=1+7*(t-1)+(7+r-n)%7+eR(e,n,a);return s<=0?o=ev(i=e-1)+s:s>ev(e)?(i=e+1,o=s-ev(e)):(i=e,o=s),{year:i,dayOfYear:o}}function eA(e,t,r){var n,a,i=eR(e.year(),t,r),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?n=o+eT(a=e.year()-1,t,r):o>eT(e.year(),t,r)?(n=o-eT(e.year(),t,r),a=e.year()+1):(a=e.year(),n=o),{week:n,year:a}}function eT(e,t,r){var n=eR(e,t,r),a=eR(e+1,t,r);return(ev(e)-n+a)/7}function eN(e,t){return e.slice(t,7).concat(e.slice(0,t))}T("w",["ww",2],"wo","week"),T("W",["WW",2],"Wo","isoWeek"),ec("w",J,el),ec("ww",J,G),ec("W",J,el),ec("WW",J,G),em(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=ep(e)}),T("d",0,"do","day"),T("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),T("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),T("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),T("e",0,0,"weekday"),T("E",0,0,"isoWeekday"),ec("d",J),ec("e",J),ec("E",J),ec("dd",function(e,t){return t.weekdaysMinRegex(e)}),ec("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ec("dddd",function(e,t){return t.weekdaysRegex(e)}),em(["dd","ddd","dddd"],function(e,t,r,n){var a=r._locale.weekdaysParse(e,n,r._strict);null!=a?t.d=a:p(r).invalidWeekday=e}),em(["d","e","E"],function(e,t,r,n){t[n]=ep(e)});var eU="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function eL(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();if(r)if("dddd"===t)return -1!==(a=eH.call(this._weekdaysParse,o))?a:null;else if("ddd"===t)return -1!==(a=eH.call(this._shortWeekdaysParse,o))?a:null;else return -1!==(a=eH.call(this._minWeekdaysParse,o))?a:null;return"dddd"===t?-1!==(a=eH.call(this._weekdaysParse,o))||-1!==(a=eH.call(this._shortWeekdaysParse,o))||-1!==(a=eH.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=eH.call(this._shortWeekdaysParse,o))||-1!==(a=eH.call(this._weekdaysParse,o))||-1!==(a=eH.call(this._minWeekdaysParse,o))?a:null:-1!==(a=eH.call(this._minWeekdaysParse,o))||-1!==(a=eH.call(this._weekdaysParse,o))||-1!==(a=eH.call(this._shortWeekdaysParse,o))?a:null}function eF(){function e(e,t){return t.length-e.length}var t,r,n,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)r=f([2e3,1]).day(t),n=ed(this.weekdaysMin(r,"")),a=ed(this.weekdaysShort(r,"")),i=ed(this.weekdays(r,"")),o.push(n),s.push(a),l.push(i),u.push(n),u.push(a),u.push(i);o.sort(e),s.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=RegExp("^("+o.join("|")+")","i")}function eB(){return this.hours()%12||12}function eV(e,t){T(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ez(e,t){return t._meridiemParse}T("H",["HH",2],0,"hour"),T("h",["hh",2],0,eB),T("k",["kk",2],0,function(){return this.hours()||24}),T("hmm",0,0,function(){return""+eB.apply(this)+E(this.minutes(),2)}),T("hmmss",0,0,function(){return""+eB.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),T("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),T("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),eV("a",!0),eV("A",!1),ec("a",ez),ec("A",ez),ec("H",J,eu),ec("h",J,el),ec("k",J,el),ec("HH",J,G),ec("hh",J,G),ec("kk",J,G),ec("hmm",Z),ec("hmmss",Q),ec("Hmm",Z),ec("Hmmss",Q),eg(["H","HH"],3),eg(["k","kk"],function(e,t,r){var n=ep(e);t[3]=24===n?0:n}),eg(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e}),eg(["h","hh"],function(e,t,r){t[3]=ep(e),p(r).bigHour=!0}),eg("hmm",function(e,t,r){var n=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n)),p(r).bigHour=!0}),eg("hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n,2)),t[5]=ep(e.substr(a)),p(r).bigHour=!0}),eg("Hmm",function(e,t,r){var n=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n))}),eg("Hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[3]=ep(e.substr(0,n)),t[4]=ep(e.substr(n,2)),t[5]=ep(e.substr(a))});var eH,eW,e$=ex("Hours",!0),eY={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:eI,week:{dow:0,doy:6},weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysShort:eU,meridiemParse:/[ap]\.?m?\.?/i},eG={},eq={};function eX(e){return e?e.toLowerCase().replace("_","-"):e}function eK(t){var n=null;if(void 0===eG[t]&&e&&e.exports&&t&&t.match("^[^/\\\\]*$"))try{n=eW._abbr,r(3118)("./locale/"+t),eJ(n)}catch(e){eG[t]=null}return eG[t]}function eJ(e,t){var r;return e&&((r=s(t)?eQ(e):eZ(e,t))?eW=r:"u">typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),eW._abbr}function eZ(e,t){if(null===t)return delete eG[e],null;var r,n=eY;if(t.abbr=e,null!=eG[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=eG[e]._config;else if(null!=t.parentLocale)if(null!=eG[t.parentLocale])n=eG[t.parentLocale]._config;else{if(null==(r=eK(t.parentLocale)))return eq[t.parentLocale]||(eq[t.parentLocale]=[]),eq[t.parentLocale].push({name:e,config:t}),null;n=r._config}return eG[e]=new j(C(n,t)),eq[e]&&eq[e].forEach(function(e){eZ(e.name,e.config)}),eJ(e),eG[e]}function eQ(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return eW;if(!n(e)){if(t=eK(e))return t;e=[e]}return function(e){for(var t,r,n,a,i=0;i<e.length;){for(t=(a=eX(e[i]).split("-")).length,r=(r=eX(e[i+1]))?r.split("-"):null;t>0;){if(n=eK(a.slice(0,t).join("-")))return n;if(r&&r.length>=t&&function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}(a,r)>=t-1)break;t--}i++}return eW}(e)}function e0(e){var t,r=e._a;return r&&-2===p(e).overflow&&(t=r[1]<0||r[1]>11?1:r[2]<1||r[2]>e_(r[0],r[1])?2:r[3]<0||r[3]>24||24===r[3]&&(0!==r[4]||0!==r[5]||0!==r[6])?3:r[4]<0||r[4]>59?4:r[5]<0||r[5]>59?5:r[6]<0||r[6]>999?6:-1,p(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),p(e)._overflowWeeks&&-1===t&&(t=7),p(e)._overflowWeekday&&-1===t&&(t=8),p(e).overflow=t),e}var e1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e2=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e3=/Z|[+-]\d\d(?::?\d\d)?/,e4=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],e5=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],e8=/^\/?Date\((-?\d+)/i,e6=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,e9={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function e7(e){var t,r,n,a,i,o,s=e._i,l=e1.exec(s)||e2.exec(s),u=e4.length,c=e5.length;if(l){for(p(e).iso=!0,t=0,r=u;t<r;t++)if(e4[t][1].exec(l[1])){a=e4[t][0],n=!1!==e4[t][2];break}if(null==a){e._isValid=!1;return}if(l[3]){for(t=0,r=c;t<r;t++)if(e5[t][1].exec(l[3])){i=(l[2]||" ")+e5[t][0];break}if(null==i){e._isValid=!1;return}}if(!n&&null!=i){e._isValid=!1;return}if(l[4])if(e3.exec(l[4]))o="Z";else{e._isValid=!1;return}e._f=a+(i||"")+(o||""),tn(e)}else e._isValid=!1}function te(e){var t,r,n,a,i,o,s,l,u,c,d,f=e6.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(f){if(i=f[4],o=f[3],s=f[2],l=f[5],u=f[6],c=f[7],d=[(t=parseInt(i,10))<=49?2e3+t:t<=999?1900+t:t,eI.indexOf(o),parseInt(s,10),parseInt(l,10),parseInt(u,10)],c&&d.push(parseInt(c,10)),r=f[1],n=d,a=e,r&&eU.indexOf(r)!==new Date(n[0],n[1],n[2]).getDay()&&(p(a).weekdayMismatch=!0,a._isValid=!1,1))return;e._a=d,e._tzm=function(e,t,r){if(e)return e9[e];if(t)return 0;var n=parseInt(r,10),a=n%100;return(n-a)/100*60+a}(f[8],f[9],f[10]),e._d=eM.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function tt(e,t,r){return null!=e?e:null!=t?t:r}function tr(e){var r,n,a,i,o,s,l,u,c,d,f,h,g,m,y,v,b=[];if(!e._d){for(f=new Date(t.now()),m=e._useUTC?[f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()]:[f.getFullYear(),f.getMonth(),f.getDate()],e._w&&null==e._a[2]&&null==e._a[1]&&(null!=(n=(r=e)._w).GG||null!=n.W||null!=n.E?(s=1,l=4,a=tt(n.GG,r._a[0],eA(to(),1,4).year),i=tt(n.W,1),((o=tt(n.E,1))<1||o>7)&&(c=!0)):(s=r._locale._week.dow,l=r._locale._week.doy,d=eA(to(),s,l),a=tt(n.gg,r._a[0],d.year),i=tt(n.w,d.week),null!=n.d?((o=n.d)<0||o>6)&&(c=!0):null!=n.e?(o=n.e+s,(n.e<0||n.e>6)&&(c=!0)):o=s),i<1||i>eT(a,s,l)?p(r)._overflowWeeks=!0:null!=c?p(r)._overflowWeekday=!0:(u=eP(a,i,o,s,l),r._a[0]=u.year,r._dayOfYear=u.dayOfYear)),null!=e._dayOfYear&&(v=tt(e._a[0],m[0]),(e._dayOfYear>ev(v)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),g=eM(v,0,e._dayOfYear),e._a[1]=g.getUTCMonth(),e._a[2]=g.getUTCDate()),h=0;h<3&&null==e._a[h];++h)e._a[h]=b[h]=m[h];for(;h<7;h++)e._a[h]=b[h]=null==e._a[h]?+(2===h):e._a[h];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?eM:eE).apply(null,b),y=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==y&&(p(e).weekdayMismatch=!0)}}function tn(e){if(e._f===t.ISO_8601)return void e7(e);if(e._f===t.RFC_2822)return void te(e);e._a=[],p(e).empty=!0;var r,n,a,o,s,l,u,c,d,f,h,g=""+e._i,m=g.length,y=0;for(h=(u=U(e._f,e._locale).match(M)||[]).length,s=0;s<h;s++)if(c=u[s],(l=(g.match(!i(H,c)?new RegExp(ed(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,r,n,a){return t||r||n||a}))):H[c](e._strict,e._locale))||[])[0])&&((d=g.substr(0,g.indexOf(l))).length>0&&p(e).unusedInput.push(d),g=g.slice(g.indexOf(l)+l.length),y+=l.length),A[c])l?p(e).empty=!1:p(e).unusedTokens.push(c),null!=l&&i(eh,c)&&eh[c](l,e._a,e,c);else e._strict&&!l&&p(e).unusedTokens.push(c);p(e).charsLeftOver=m-y,g.length>0&&p(e).unusedInput.push(g),e._a[3]<=12&&!0===p(e).bigHour&&e._a[3]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[3]=(r=e._locale,n=e._a[3],null==(a=e._meridiem)?n:null!=r.meridiemHour?r.meridiemHour(n,a):(null!=r.isPM&&((o=r.isPM(a))&&n<12&&(n+=12),o||12!==n||(n=0)),n)),null!==(f=p(e).era)&&(e._a[0]=e._locale.erasConvertYear(f,e._a[0])),tr(e),e0(e)}function ta(e){var r=e._i,i=e._f;return(e._locale=e._locale||eQ(e._l),null===r||void 0===i&&""===r)?g({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),w(r))?new S(e0(r)):(u(r)?e._d=r:n(i)?!function(e){var t,r,n,a,i,o,s=!1,l=e._f.length;if(0===l){p(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<l;a++)i=0,o=!1,t=x({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],tn(t),h(t)&&(o=!0),i+=p(t).charsLeftOver,i+=10*p(t).unusedTokens.length,p(t).score=i,s?i<n&&(n=i,r=t):(null==n||i<n||o)&&(n=i,r=t,o&&(s=!0));d(e,r||t)}(e):i?tn(e):function(e){var r=e._i;if(s(r))e._d=new Date(t.now());else if(u(r))e._d=new Date(r.valueOf());else if("string"==typeof r)!function(e){var r=e8.exec(e._i);if(null!==r){e._d=new Date(+r[1]);return}e7(e),!1!==e._isValid||(delete e._isValid,te(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:t.createFromInputFallback(e)))}(e);else if(n(r))e._a=c(r.slice(0),function(e){return parseInt(e,10)}),tr(e);else if(a(r)){if(!e._d){var i=B(e._i),o=void 0===i.day?i.date:i.day;e._a=c([i.year,i.month,o,i.hour,i.minute,i.second,i.millisecond],function(e){return e&&parseInt(e,10)}),tr(e)}}else l(r)?e._d=new Date(r):t.createFromInputFallback(e)}(e),h(e)||(e._d=null),e)}function ti(e,t,r,i,s){var l,u={};return(!0===t||!1===t)&&(i=t,t=void 0),(!0===r||!1===r)&&(i=r,r=void 0),(a(e)&&o(e)||n(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=s,u._l=r,u._i=e,u._f=t,u._strict=i,(l=new S(e0(ta(u))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function to(e,t,r,n){return ti(e,t,r,n,!1)}t.createFromInputFallback=I("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var ts=I("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=to.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),tl=I("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=to.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()});function tu(e,t){var r,a;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return to();for(r=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](r))&&(r=t[a]);return r}var tc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function td(e){var t=B(e),r=t.year||0,n=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,s=t.day||0,l=t.hour||0,u=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,r,n=!1,a=tc.length;for(t in e)if(i(e,t)&&!(-1!==eH.call(tc,t)&&(null==e[t]||!isNaN(e[t]))))return!1;for(r=0;r<a;++r)if(e[tc[r]]){if(n)return!1;parseFloat(e[tc[r]])!==ep(e[tc[r]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*3600,this._days=+s+7*o,this._months=+a+3*n+12*r,this._data={},this._locale=eQ(),this._bubble()}function tf(e){return e instanceof td}function tp(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function th(e,t){T(e,0,0,function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+E(~~(e/60),2)+t+E(~~e%60,2)})}th("Z",":"),th("ZZ",""),ec("Z",eo),ec("ZZ",eo),eg(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=tm(eo,e)});var tg=/([\+\-]|\d\d)/gi;function tm(e,t){var r,n,a=(t||"").match(e);return null===a?null:0===(n=+(60*(r=((a[a.length-1]||[])+"").match(tg)||["-",0,0])[1])+ep(r[2]))?0:"+"===r[0]?n:-n}function ty(e,r){var n,a;return r._isUTC?(n=r.clone(),a=(w(e)||u(e)?e.valueOf():to(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),t.updateOffset(n,!1),n):to(e).local()}function tv(e){return-Math.round(e._d.getTimezoneOffset())}function tb(){return!!this.isValid()&&this._isUTC&&0===this._offset}t.updateOffset=function(){};var tx=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tS=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tw(e,t){var r,n,a,o,s,u,c=e,d=null;return tf(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=tx.exec(e))?(o="-"===d[1]?-1:1,c={y:0,d:ep(d[2])*o,h:ep(d[3])*o,m:ep(d[4])*o,s:ep(d[5])*o,ms:ep(tp(1e3*d[6]))*o}):(d=tS.exec(e))?(o="-"===d[1]?-1:1,c={y:t_(d[2],o),M:t_(d[3],o),w:t_(d[4],o),d:t_(d[5],o),h:t_(d[6],o),m:t_(d[7],o),s:t_(d[8],o)}):null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(r=to(c.from),n=to(c.to),u=r.isValid()&&n.isValid()?(n=ty(n,r),r.isBefore(n)?a=tI(r,n):((a=tI(n,r)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0},(c={}).ms=u.milliseconds,c.M=u.months),s=new td(c),tf(e)&&i(e,"_locale")&&(s._locale=e._locale),tf(e)&&i(e,"_isValid")&&(s._isValid=e._isValid),s}function t_(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function tI(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=t-e.clone().add(r.months,"M"),r}function tD(e,t){return function(r,n){var a;return null===n||isNaN(+n)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=r,r=n,n=a),tO(this,tw(r,n),e),this}}function tO(e,r,n,a){var i=r._milliseconds,o=tp(r._days),s=tp(r._months);e.isValid()&&(a=null==a||a,s&&ek(e,eS(e,"Month")+s*n),o&&ew(e,"Date",eS(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),a&&t.updateOffset(e,o||s))}tw.fn=td.prototype,tw.invalid=function(){return tw(NaN)};var tk=tD(1,"add"),tC=tD(-1,"subtract");function tj(e){return"string"==typeof e||e instanceof String}function tE(e,t){if(e.date()<t.date())return-tE(t,e);var r,n=(t.year()-e.year())*12+(t.month()-e.month()),a=e.clone().add(n,"months");return r=t-a<0?(t-a)/(a-e.clone().add(n-1,"months")):(t-a)/(e.clone().add(n+1,"months")-a),-(n+r)||0}function tM(e){var t;return void 0===e?this._locale._abbr:(null!=(t=eQ(e))&&(this._locale=t),this)}t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var tR=I("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function tP(){return this._locale}function tA(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-126227808e5:new Date(e,t,r).valueOf()}function tT(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-126227808e5:Date.UTC(e,t,r)}function tN(e,t){return t.erasAbbrRegex(e)}function tU(){var e,t,r,n,a,i=[],o=[],s=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)r=ed(u[e].name),n=ed(u[e].abbr),a=ed(u[e].narrow),o.push(r),i.push(n),s.push(a),l.push(r),l.push(n),l.push(a);this._erasRegex=RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=RegExp("^("+s.join("|")+")","i")}function tL(e,t){T(0,[e,e.length],0,t)}function tF(e,t,r,n,a){var i;return null==e?eA(this,n,a).year:(t>(i=eT(e,n,a))&&(t=i),tB.call(this,e,t,r,n,a))}function tB(e,t,r,n,a){var i=eP(e,t,r,n,a),o=eM(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}T("N",0,0,"eraAbbr"),T("NN",0,0,"eraAbbr"),T("NNN",0,0,"eraAbbr"),T("NNNN",0,0,"eraName"),T("NNNNN",0,0,"eraNarrow"),T("y",["y",1],"yo","eraYear"),T("y",["yy",2],0,"eraYear"),T("y",["yyy",3],0,"eraYear"),T("y",["yyyy",4],0,"eraYear"),ec("N",tN),ec("NN",tN),ec("NNN",tN),ec("NNNN",function(e,t){return t.erasNameRegex(e)}),ec("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),eg(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var a=r._locale.erasParse(e,n,r._strict);a?p(r).era=a:p(r).invalidEra=e}),ec("y",en),ec("yy",en),ec("yyy",en),ec("yyyy",en),ec("yo",function(e,t){return t._eraYearOrdinalRegex||en}),eg(["y","yy","yyy","yyyy"],0),eg(["yo"],function(e,t,r,n){var a;r._locale._eraYearOrdinalRegex&&(a=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[0]=r._locale.eraYearOrdinalParse(e,a):t[0]=parseInt(e,10)}),T(0,["gg",2],0,function(){return this.weekYear()%100}),T(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tL("gggg","weekYear"),tL("ggggg","weekYear"),tL("GGGG","isoWeekYear"),tL("GGGGG","isoWeekYear"),ec("G",ea),ec("g",ea),ec("GG",J,G),ec("gg",J,G),ec("GGGG",et,X),ec("gggg",et,X),ec("GGGGG",er,K),ec("ggggg",er,K),em(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,n){t[n.substr(0,2)]=ep(e)}),em(["gg","GG"],function(e,r,n,a){r[a]=t.parseTwoDigitYear(e)}),T("Q",0,"Qo","quarter"),ec("Q",Y),eg("Q",function(e,t){t[1]=(ep(e)-1)*3}),T("D",["DD",2],"Do","date"),ec("D",J,el),ec("DD",J,G),ec("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),eg(["D","DD"],2),eg("Do",function(e,t){t[2]=ep(e.match(J)[0])});var tV=ex("Date",!0);T("DDD",["DDDD",3],"DDDo","dayOfYear"),ec("DDD",ee),ec("DDDD",q),eg(["DDD","DDDD"],function(e,t,r){r._dayOfYear=ep(e)}),T("m",["mm",2],0,"minute"),ec("m",J,eu),ec("mm",J,G),eg(["m","mm"],4);var tz=ex("Minutes",!1);T("s",["ss",2],0,"second"),ec("s",J,eu),ec("ss",J,G),eg(["s","ss"],5);var tH=ex("Seconds",!1);for(T("S",0,0,function(){return~~(this.millisecond()/100)}),T(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),T(0,["SSS",3],0,"millisecond"),T(0,["SSSS",4],0,function(){return 10*this.millisecond()}),T(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),T(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),T(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),T(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),T(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ec("S",ee,Y),ec("SS",ee,G),ec("SSS",ee,q),m="SSSS";m.length<=9;m+="S")ec(m,en);function tW(e,t){t[6]=ep(("0."+e)*1e3)}for(m="S";m.length<=9;m+="S")eg(m,tW);y=ex("Milliseconds",!1),T("z",0,0,"zoneAbbr"),T("zz",0,0,"zoneName");var t$=S.prototype;function tY(e){return e}t$.add=tk,t$.calendar=function(e,r){if(1==arguments.length)if(arguments[0]){var s,c,d,f;if(s=arguments[0],w(s)||u(s)||tj(s)||l(s)||(d=n(c=s),f=!1,d&&(f=0===c.filter(function(e){return!l(e)&&tj(c)}).length),d&&f)||function(e){var t,r,n=a(e)&&!o(e),s=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=l.length;for(t=0;t<u;t+=1)r=l[t],s=s||i(e,r);return n&&s}(s)||null==s)e=arguments[0],r=void 0;else(function(e){var t,r,n=a(e)&&!o(e),s=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)r=l[t],s=s||i(e,r);return n&&s})(arguments[0])&&(r=arguments[0],e=void 0)}else e=void 0,r=void 0;var p=e||to(),h=ty(p,this).startOf("day"),g=t.calendarFormat(this,h)||"sameElse",m=r&&(k(r[g])?r[g].call(this,p):r[g]);return this.format(m||this.localeData().calendar(g,this,to(p)))},t$.clone=function(){return new S(this)},t$.diff=function(e,t,r){var n,a,i;if(!this.isValid()||!(n=ty(e,this)).isValid())return NaN;switch(a=(n.utcOffset()-this.utcOffset())*6e4,t=F(t)){case"year":i=tE(this,n)/12;break;case"month":i=tE(this,n);break;case"quarter":i=tE(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-a)/864e5;break;case"week":i=(this-n-a)/6048e5;break;default:i=this-n}return r?i:ef(i)},t$.endOf=function(e){var r,n;if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?tT:tA,e){case"year":r=n(this.year()+1,0,1)-1;break;case"quarter":r=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":r=n(this.year(),this.month()+1,1)-1;break;case"week":r=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":r=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":r=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":r=this._d.valueOf(),r+=36e5-((r+(this._isUTC?0:6e4*this.utcOffset()))%36e5+36e5)%36e5-1;break;case"minute":r=this._d.valueOf(),r+=6e4-(r%6e4+6e4)%6e4-1;break;case"second":r=this._d.valueOf(),r+=1e3-(r%1e3+1e3)%1e3-1}return this._d.setTime(r),t.updateOffset(this,!0),this},t$.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var r=N(this,e);return this.localeData().postformat(r)},t$.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||to(e).isValid())?tw({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},t$.fromNow=function(e){return this.from(to(),e)},t$.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||to(e).isValid())?tw({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},t$.toNow=function(e){return this.to(to(),e)},t$.get=function(e){return k(this[e=F(e)])?this[e]():this},t$.invalidAt=function(){return p(this).overflow},t$.isAfter=function(e,t){var r=w(e)?e:to(e);return!!(this.isValid()&&r.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())},t$.isBefore=function(e,t){var r=w(e)?e:to(e);return!!(this.isValid()&&r.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())},t$.isBetween=function(e,t,r,n){var a=w(e)?e:to(e),i=w(t)?t:to(t);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(n=n||"()")[0]?this.isAfter(a,r):!this.isBefore(a,r))&&(")"===n[1]?this.isBefore(i,r):!this.isAfter(i,r))},t$.isSame=function(e,t){var r,n=w(e)?e:to(e);return!!(this.isValid()&&n.isValid())&&("millisecond"===(t=F(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))},t$.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},t$.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},t$.isValid=function(){return h(this)},t$.lang=tR,t$.locale=tM,t$.localeData=tP,t$.max=tl,t$.min=ts,t$.parsingFlags=function(){return d({},p(this))},t$.set=function(e,t){if("object"==typeof e){var r,n=function(e){var t,r=[];for(t in e)i(e,t)&&r.push({unit:t,priority:W[t]});return r.sort(function(e,t){return e.priority-t.priority}),r}(e=B(e)),a=n.length;for(r=0;r<a;r++)this[n[r].unit](e[n[r].unit])}else if(k(this[e=F(e)]))return this[e](t);return this},t$.startOf=function(e){var r,n;if(void 0===(e=F(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?tT:tA,e){case"year":r=n(this.year(),0,1);break;case"quarter":r=n(this.year(),this.month()-this.month()%3,1);break;case"month":r=n(this.year(),this.month(),1);break;case"week":r=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":r=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":r=n(this.year(),this.month(),this.date());break;case"hour":r=this._d.valueOf(),r-=((r+(this._isUTC?0:6e4*this.utcOffset()))%36e5+36e5)%36e5;break;case"minute":r=this._d.valueOf(),r-=(r%6e4+6e4)%6e4;break;case"second":r=this._d.valueOf(),r-=(r%1e3+1e3)%1e3}return this._d.setTime(r),t.updateOffset(this,!0),this},t$.subtract=tC,t$.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]},t$.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}},t$.toDate=function(){return new Date(this.valueOf())},t$.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;if(0>r.year()||r.year()>9999)return N(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ");if(k(Date.prototype.toISOString))if(t)return this.toDate().toISOString();else return new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(r,"Z"));return N(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},t$.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r,n="moment",a="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+n+'("]',t=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",r=a+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+r)},"u">typeof Symbol&&null!=Symbol.for&&(t$[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),t$.toJSON=function(){return this.isValid()?this.toISOString():null},t$.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},t$.unix=function(){return Math.floor(this.valueOf()/1e3)},t$.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},t$.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},t$.eraName=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].name;return""},t$.eraNarrow=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].narrow;return""},t$.eraAbbr=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].abbr;return""},t$.eraYear=function(){var e,r,n,a,i=this.localeData().eras();for(e=0,r=i.length;e<r;++e)if(n=i[e].since<=i[e].until?1:-1,a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until||i[e].until<=a&&a<=i[e].since)return(this.year()-t(i[e].since).year())*n+i[e].offset;return this.year()},t$.year=eb,t$.isLeapYear=function(){return ey(this.year())},t$.weekYear=function(e){return tF.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},t$.isoWeekYear=function(e){return tF.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},t$.quarter=t$.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)},t$.month=eC,t$.daysInMonth=function(){return e_(this.year(),this.month())},t$.week=t$.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add((e-t)*7,"d")},t$.isoWeek=t$.isoWeeks=function(e){var t=eA(this,1,4).week;return null==e?t:this.add((e-t)*7,"d")},t$.weeksInYear=function(){var e=this.localeData()._week;return eT(this.year(),e.dow,e.doy)},t$.weeksInWeekYear=function(){var e=this.localeData()._week;return eT(this.weekYear(),e.dow,e.doy)},t$.isoWeeksInYear=function(){return eT(this.year(),1,4)},t$.isoWeeksInISOWeekYear=function(){return eT(this.isoWeekYear(),1,4)},t$.date=tV,t$.day=t$.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,r,n=eS(this,"Day");return null==e?n:(t=e,r=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=r.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-n,"d"))},t$.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},t$.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,r=(t=this.localeData(),"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e);return this.day(this.day()%7?r:r-7)},t$.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},t$.hour=t$.hours=e$,t$.minute=t$.minutes=tz,t$.second=t$.seconds=tH,t$.millisecond=t$.milliseconds=y,t$.utcOffset=function(e,r,n){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:tv(this);if("string"==typeof e){if(null===(e=tm(eo,e)))return this}else 16>Math.abs(e)&&!n&&(e*=60);return!this._isUTC&&r&&(a=tv(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!r||this._changeInProgress?tO(this,tw(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this},t$.utc=function(e){return this.utcOffset(0,e)},t$.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(tv(this),"m")),this},t$.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=tm(ei,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},t$.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?to(e).utcOffset():0,(this.utcOffset()-e)%60==0)},t$.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},t$.isLocal=function(){return!!this.isValid()&&!this._isUTC},t$.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},t$.isUtc=tb,t$.isUTC=tb,t$.zoneAbbr=function(){return this._isUTC?"UTC":""},t$.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},t$.dates=I("dates accessor is deprecated. Use date instead.",tV),t$.months=I("months accessor is deprecated. Use month instead",eC),t$.years=I("years accessor is deprecated. Use year instead",eb),t$.zone=I("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),t$.isDSTShifted=I("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,t={};return x(t,this),(t=ta(t))._a?(e=t._isUTC?f(t._a):to(t._a),this._isDSTShifted=this.isValid()&&function(e,t){var r,n=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),i=0;for(r=0;r<n;r++)ep(e[r])!==ep(t[r])&&i++;return i+a}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var tG=j.prototype;function tq(e,t,r,n){var a=eQ(),i=f().set(n,t);return a[r](i,e)}function tX(e,t,r){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return tq(e,t,r,"month");var n,a=[];for(n=0;n<12;n++)a[n]=tq(e,n,r,"month");return a}function tK(e,t,r,n){"boolean"==typeof e||(r=t=e,e=!1),l(t)&&(r=t,t=void 0),t=t||"";var a,i=eQ(),o=e?i._week.dow:0,s=[];if(null!=r)return tq(t,(r+o)%7,n,"day");for(a=0;a<7;a++)s[a]=tq(t,(a+o)%7,n,"day");return s}tG.calendar=function(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return k(n)?n.call(t,r):n},tG.longDateFormat=function(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(M).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},tG.invalidDate=function(){return this._invalidDate},tG.ordinal=function(e){return this._ordinal.replace("%d",e)},tG.preparse=tY,tG.postformat=tY,tG.relativeTime=function(e,t,r,n){var a=this._relativeTime[r];return k(a)?a(e,t,r,n):a.replace(/%d/i,e)},tG.pastFuture=function(e,t){var r=this._relativeTime[e>0?"future":"past"];return k(r)?r(t):r.replace(/%s/i,t)},tG.set=function(e){var t,r;for(r in e)i(e,r)&&(k(t=e[r])?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},tG.eras=function(e,r){var n,a,i,o=this._eras||eQ("en")._eras;for(n=0,a=o.length;n<a;++n)switch("string"==typeof o[n].since&&(i=t(o[n].since).startOf("day"),o[n].since=i.valueOf()),typeof o[n].until){case"undefined":o[n].until=Infinity;break;case"string":i=t(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf()}return o},tG.erasParse=function(e,t,r){var n,a,i,o,s,l=this.eras();for(e=e.toUpperCase(),n=0,a=l.length;n<a;++n)if(i=l[n].name.toUpperCase(),o=l[n].abbr.toUpperCase(),s=l[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[n];break;case"NNNN":if(i===e)return l[n];break;case"NNNNN":if(s===e)return l[n]}else if([i,o,s].indexOf(e)>=0)return l[n]},tG.erasConvertYear=function(e,r){var n=e.since<=e.until?1:-1;return void 0===r?t(e.since).year():t(e.since).year()+(r-e.offset)*n},tG.erasAbbrRegex=function(e){return i(this,"_erasAbbrRegex")||tU.call(this),e?this._erasAbbrRegex:this._erasRegex},tG.erasNameRegex=function(e){return i(this,"_erasNameRegex")||tU.call(this),e?this._erasNameRegex:this._erasRegex},tG.erasNarrowRegex=function(e){return i(this,"_erasNarrowRegex")||tU.call(this),e?this._erasNarrowRegex:this._erasRegex},tG.months=function(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||eD).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone},tG.monthsShort=function(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[eD.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},tG.monthsParse=function(e,t,r){var n,a,i;if(this._monthsParseExact)return eO.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=f([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=RegExp(i.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}},tG.monthsRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||ej.call(this),e)?this._monthsStrictRegex:this._monthsRegex:(i(this,"_monthsRegex")||(this._monthsRegex=es),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},tG.monthsShortRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||ej.call(this),e)?this._monthsShortStrictRegex:this._monthsShortRegex:(i(this,"_monthsShortRegex")||(this._monthsShortRegex=es),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},tG.week=function(e){return eA(e,this._week.dow,this._week.doy).week},tG.firstDayOfYear=function(){return this._week.doy},tG.firstDayOfWeek=function(){return this._week.dow},tG.weekdays=function(e,t){var r=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?eN(r,this._week.dow):e?r[e.day()]:r},tG.weekdaysMin=function(e){return!0===e?eN(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},tG.weekdaysShort=function(e){return!0===e?eN(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},tG.weekdaysParse=function(e,t,r){var n,a,i;if(this._weekdaysParseExact)return eL.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=RegExp(i.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;else if(!r&&this._weekdaysParse[n].test(e))return n}},tG.weekdaysRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eF.call(this),e)?this._weekdaysStrictRegex:this._weekdaysRegex:(i(this,"_weekdaysRegex")||(this._weekdaysRegex=es),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},tG.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eF.call(this),e)?this._weekdaysShortStrictRegex:this._weekdaysShortRegex:(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=es),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},tG.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eF.call(this),e)?this._weekdaysMinStrictRegex:this._weekdaysMinRegex:(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=es),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},tG.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},tG.meridiem=function(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"},eJ("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=1===ep(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+r}}),t.lang=I("moment.lang is deprecated. Use moment.locale instead.",eJ),t.langData=I("moment.langData is deprecated. Use moment.localeData instead.",eQ);var tJ=Math.abs;function tZ(e,t,r,n){var a=tw(t,r);return e._milliseconds+=n*a._milliseconds,e._days+=n*a._days,e._months+=n*a._months,e._bubble()}function tQ(e){return e<0?Math.floor(e):Math.ceil(e)}function t0(e){return 4800*e/146097}function t1(e){return 146097*e/4800}function t2(e){return function(){return this.as(e)}}var t3=t2("ms"),t4=t2("s"),t5=t2("m"),t8=t2("h"),t6=t2("d"),t9=t2("w"),t7=t2("M"),re=t2("Q"),rt=t2("y");function rr(e){return function(){return this.isValid()?this._data[e]:NaN}}var rn=rr("milliseconds"),ra=rr("seconds"),ri=rr("minutes"),ro=rr("hours"),rs=rr("days"),rl=rr("months"),ru=rr("years"),rc=Math.round,rd={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rf(e,t,r,n,a){return a.relativeTime(t||1,!!r,e,n)}var rp=Math.abs;function rh(e){return(e>0)-(e<0)||+e}function rg(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,a,i,o,s,l=rp(this._milliseconds)/1e3,u=rp(this._days),c=rp(this._months),d=this.asSeconds();return d?(e=ef(l/60),t=ef(e/60),l%=60,e%=60,r=ef(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",i=rh(this._months)!==rh(d)?"-":"",o=rh(this._days)!==rh(d)?"-":"",s=rh(this._milliseconds)!==rh(d)?"-":"",a+"P"+(r?i+r+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+n+"S":"")):"P0D"}var rm=td.prototype;return rm.isValid=function(){return this._isValid},rm.abs=function(){var e=this._data;return this._milliseconds=tJ(this._milliseconds),this._days=tJ(this._days),this._months=tJ(this._months),e.milliseconds=tJ(e.milliseconds),e.seconds=tJ(e.seconds),e.minutes=tJ(e.minutes),e.hours=tJ(e.hours),e.months=tJ(e.months),e.years=tJ(e.years),this},rm.add=function(e,t){return tZ(this,e,t,1)},rm.subtract=function(e,t){return tZ(this,e,t,-1)},rm.as=function(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=F(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+t0(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(t1(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw Error("Unknown unit "+e)}},rm.asMilliseconds=t3,rm.asSeconds=t4,rm.asMinutes=t5,rm.asHours=t8,rm.asDays=t6,rm.asWeeks=t9,rm.asMonths=t7,rm.asQuarters=re,rm.asYears=rt,rm.valueOf=t3,rm._bubble=function(){var e,t,r,n,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*tQ(t1(s)+o),o=0,s=0),l.milliseconds=i%1e3,l.seconds=(e=ef(i/1e3))%60,l.minutes=(t=ef(e/60))%60,l.hours=(r=ef(t/60))%24,o+=ef(r/24),s+=a=ef(t0(o)),o-=tQ(t1(a)),n=ef(s/12),s%=12,l.days=o,l.months=s,l.years=n,this},rm.clone=function(){return tw(this)},rm.get=function(e){return e=F(e),this.isValid()?this[e+"s"]():NaN},rm.milliseconds=rn,rm.seconds=ra,rm.minutes=ri,rm.hours=ro,rm.days=rs,rm.weeks=function(){return ef(this.days()/7)},rm.months=rl,rm.years=ru,rm.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,a,i,o,s,l,u,c,d,f,p,h,g=!1,m=rd;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(g=e),"object"==typeof t&&(m=Object.assign({},rd,t),null!=t.s&&null==t.ss&&(m.ss=t.s-1)),p=this.localeData(),r=!g,n=m,a=tw(this).abs(),i=rc(a.as("s")),o=rc(a.as("m")),s=rc(a.as("h")),l=rc(a.as("d")),u=rc(a.as("M")),c=rc(a.as("w")),d=rc(a.as("y")),f=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||o<=1&&["m"]||o<n.m&&["mm",o]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l],null!=n.w&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),(f=f||u<=1&&["M"]||u<n.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=r,f[3]=+this>0,f[4]=p,h=rf.apply(null,f),g&&(h=p.pastFuture(+this,h)),p.postformat(h)},rm.toISOString=rg,rm.toString=rg,rm.toJSON=rg,rm.locale=tM,rm.localeData=tP,rm.toIsoString=I("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rg),rm.lang=tR,T("X",0,0,"unix"),T("x",0,0,"valueOf"),ec("x",ea),ec("X",/[+-]?\d+(\.\d{1,3})?/),eg("X",function(e,t,r){r._d=new Date(1e3*parseFloat(e))}),eg("x",function(e,t,r){r._d=new Date(ep(e))}),t.version="2.30.1",V=to,t.fn=t$,t.min=function(){var e=[].slice.call(arguments,0);return tu("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return tu("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=f,t.unix=function(e){return to(1e3*e)},t.months=function(e,t){return tX(e,t,"months")},t.isDate=u,t.locale=eJ,t.invalid=g,t.duration=tw,t.isMoment=w,t.weekdays=function(e,t,r){return tK(e,t,r,"weekdays")},t.parseZone=function(){return to.apply(null,arguments).parseZone()},t.localeData=eQ,t.isDuration=tf,t.monthsShort=function(e,t){return tX(e,t,"monthsShort")},t.weekdaysMin=function(e,t,r){return tK(e,t,r,"weekdaysMin")},t.defineLocale=eZ,t.updateLocale=function(e,t){if(null!=t){var r,n,a=eY;null!=eG[e]&&null!=eG[e].parentLocale?eG[e].set(C(eG[e]._config,t)):(null!=(n=eK(e))&&(a=n._config),t=C(a,t),null==n&&(t.abbr=e),(r=new j(t)).parentLocale=eG[e],eG[e]=r),eJ(e)}else null!=eG[e]&&(null!=eG[e].parentLocale?(eG[e]=eG[e].parentLocale,e===eJ()&&eJ(e)):null!=eG[e]&&delete eG[e]);return eG[e]},t.locales=function(){return $(eG)},t.weekdaysShort=function(e,t,r){return tK(e,t,r,"weekdaysShort")},t.normalizeUnits=F,t.relativeTimeRounding=function(e){return void 0===e?rc:"function"==typeof e&&(rc=e,!0)},t.relativeTimeThreshold=function(e,t){return void 0!==rd[e]&&(void 0===t?rd[e]:(rd[e]=t,"s"===e&&(rd.ss=t-1),!0))},t.calendarFormat=function(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},t.prototype=t$,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t}()},3118(e){function t(e){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=3118,e.exports=t},856(e,t,r){"use strict";var n=r(9564);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,i,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},7598(e,t,r){e.exports=r(856)()},9564(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8985(e,t,r){"use strict";let n=r(3182),a=r(5956),i=r(9646),o=r(9913);function s(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function u(e,t){return t.decode?a(e):e}function c(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=c(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let a="string"==typeof r&&r.includes(e.arrayFormatSeparator),i="string"==typeof r&&!a&&u(r,e).includes(e.arrayFormatSeparator);r=i?u(r,e):r;let o=a||i?r.split(e.arrayFormatSeparator).map(t=>u(t,e)):null===r?r:u(r,e);n[t]=o};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let a of e.split("&")){if(""===a)continue;let[e,o]=i(t.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator"].includes(t.arrayFormat)?o:u(o,t),r(u(e,t),o,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=f(r[e],t);else n[e]=f(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=d,t.parse=p,t.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",a,"]"].join("")]:[...r,[l(t,e),"[",l(a,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[l(t,e),"=",l(n,e)].join("")]:[[r,l(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),a={};for(let t of Object.keys(e))r(t)||(a[t]=e[t]);let i=Object.keys(a);return!1!==t.sort&&i.sort(t.sort),i.map(r=>{let a=e[r];return void 0===a?"":null===a?l(r,t):Array.isArray(a)?a.reduce(n(r),[]).join("&"):l(r,t)+"="+l(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,n]=i(e,"#");return Object.assign({url:r.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,t)}:{})},t.stringifyUrl=(e,r)=>{var n;let a,i;r=Object.assign({encode:!0,strict:!0},r);let o=c(e.url).split("?")[0]||"",s=t.extract(e.url),u=Object.assign(t.parse(s,{sort:!1}),e.query),d=t.stringify(u,r);d&&(d=`?${d}`);let f=(n=e.url,a="",-1!==(i=n.indexOf("#"))&&(a=n.slice(i)),a);return e.fragmentIdentifier&&(f=`#${l(e.fragmentIdentifier,r)}`),`${o}${d}${f}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);let{url:a,query:i,fragmentIdentifier:s}=t.parseUrl(e,n);return t.stringifyUrl({url:a,query:o(i,r),fragmentIdentifier:s},n)},t.exclude=(e,r,n)=>{let a=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,a,n)}},76(e,t,r){"use strict";var n=r(6326).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.c=function(e){return n.H.useMemoCache(e)}},3060(e,t){"use strict";var r=Symbol.for("react.transitional.element");function n(e,t,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),"key"in t)for(var i in n={},t)"key"!==i&&(n[i]=t[i]);else n=t;return{$$typeof:r,type:e,key:a,ref:void 0!==(t=n.ref)?t:null,props:n}}t.Fragment=Symbol.for("react.fragment"),t.jsx=n,t.jsxs=n},8391(e,t){"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator,g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,y={};function v(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||g}function b(){}function x(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||g}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var S=x.prototype=new b;S.constructor=x,m(S,v.prototype),S.isPureReactComponent=!0;var w=Array.isArray;function _(){}var I={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function O(e,t,n){var a=n.ref;return{$$typeof:r,type:e,key:t,ref:void 0!==a?a:null,props:n}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var C=/\/+/g;function j(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function E(e,t,a){if(null==e)return e;var i=[],o=0;return!function e(t,a,i,o,s){var l,u,c,d=typeof t;("undefined"===d||"boolean"===d)&&(t=null);var p=!1;if(null===t)p=!0;else switch(d){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case r:case n:p=!0;break;case f:return e((p=t._init)(t._payload),a,i,o,s)}}if(p)return s=s(t),p=""===o?"."+j(t,0):o,w(s)?(i="",null!=p&&(i=p.replace(C,"$&/")+"/"),e(s,a,i,"",function(e){return e})):null!=s&&(k(s)&&(l=s,u=i+(null==s.key||t&&t.key===s.key?"":(""+s.key).replace(C,"$&/")+"/")+p,s=O(l.type,u,l.props)),a.push(s)),1;p=0;var g=""===o?".":o+":";if(w(t))for(var m=0;m<t.length;m++)d=g+j(o=t[m],m),p+=e(o,a,i,d,s);else if("function"==typeof(m=null===(c=t)||"object"!=typeof c?null:"function"==typeof(c=h&&c[h]||c["@@iterator"])?c:null))for(t=m.call(t),m=0;!(o=t.next()).done;)d=g+j(o=o.value,m++),p+=e(o,a,i,d,s);else if("object"===d){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),a,i,o,s);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(a=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.")}return p}(e,i,"","",function(e){return t.call(a,e,o++)}),i}function M(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};t.Activity=p,t.Children={map:E,forEach:function(e,t,r){E(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return E(e,function(){t++}),t},toArray:function(e){return E(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=a,t.Profiler=o,t.PureComponent=x,t.StrictMode=i,t.Suspense=c,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return I.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=m({},e.props),a=e.key;if(null!=t)for(i in void 0!==t.key&&(a=""+t.key),t)D.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&("ref"!==i||void 0!==t.ref)&&(n[i]=t[i]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var o=Array(i),s=0;s<i;s++)o[s]=arguments[s+2];n.children=o}return O(e.type,a,n)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,r){var n,a={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)D.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(a[n]=t[n]);var o=arguments.length-2;if(1===o)a.children=r;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];a.children=s}if(e&&e.defaultProps)for(n in o=e.defaultProps)void 0===a[n]&&(a[n]=o[n]);return O(e,i,a)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=I.T,r={};I.T=r;try{var n=e(),a=I.S;null!==a&&a(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(_,R)}catch(e){R(e)}finally{null!==t&&null!==r.types&&(t.types=r.types),I.T=t}},t.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},t.use=function(e){return I.H.use(e)},t.useActionState=function(e,t,r){return I.H.useActionState(e,t,r)},t.useCallback=function(e,t){return I.H.useCallback(e,t)},t.useContext=function(e){return I.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return I.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return I.H.useEffect(e,t)},t.useEffectEvent=function(e){return I.H.useEffectEvent(e)},t.useId=function(){return I.H.useId()},t.useImperativeHandle=function(e,t,r){return I.H.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return I.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.H.useMemo(e,t)},t.useOptimistic=function(e,t){return I.H.useOptimistic(e,t)},t.useReducer=function(e,t,r){return I.H.useReducer(e,t,r)},t.useRef=function(e){return I.H.useRef(e)},t.useState=function(e){return I.H.useState(e)},t.useSyncExternalStore=function(e,t,r){return I.H.useSyncExternalStore(e,t,r)},t.useTransition=function(){return I.H.useTransition()},t.version="19.2.7"},2184(e,t,r){"use strict";e.exports=r(76)},6326(e,t,r){"use strict";e.exports=r(8391)},6870(e,t,r){"use strict";e.exports=r(3060)},7002(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.autoprefix=void 0;var n,a=(n=r(2122))&&n.__esModule?n:{default:n},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(" ");return{position:"absolute",top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){var r=t[e];return r||{extend:e}}},s=t.autoprefix=function(e){var t={};return(0,a.default)(e,function(e,r){var n={};(0,a.default)(e,function(e,t){var r=o[t];r?n=i({},n,r(e)):n[t]=e}),t[r]=n}),t};t.default=s},2990(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.active=void 0;var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};function o(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var s=t.active=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span",r=i.default.Component;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function, not "+typeof r);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var r,s,l,u=arguments.length,c=Array(u),d=0;d<u;d++)c[d]=arguments[d];return s=l=o(this,(r=n.__proto__||Object.getPrototypeOf(n)).call.apply(r,[this].concat(c))),l.state={active:!1},l.handleMouseDown=function(){return l.setState({active:!0})},l.handleMouseUp=function(){return l.setState({active:!1})},l.render=function(){return i.default.createElement(t,{onMouseDown:l.handleMouseDown,onMouseUp:l.handleMouseUp},i.default.createElement(e,a({},l.props,l.state)))},o(l,s)}return n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r),n};t.default=s},7136(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hover=void 0;var n,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=(n=r(6326))&&n.__esModule?n:{default:n};function o(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var s=t.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span",r=i.default.Component;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function, not "+typeof r);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var r,s,l,u=arguments.length,c=Array(u),d=0;d<u;d++)c[d]=arguments[d];return s=l=o(this,(r=n.__proto__||Object.getPrototypeOf(n)).call.apply(r,[this].concat(c))),l.state={hover:!1},l.handleMouseOver=function(){return l.setState({hover:!0})},l.handleMouseOut=function(){return l.setState({hover:!1})},l.render=function(){return i.default.createElement(t,{onMouseOver:l.handleMouseOver,onMouseOut:l.handleMouseOut},i.default.createElement(e,a({},l.props,l.state)))},o(l,s)}return n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r),n};t.default=s},3003(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenNames=void 0;var n=s(r(7561)),a=s(r(2122)),i=s(r(5229)),o=s(r(764));function s(e){return e&&e.__esModule?e:{default:e}}var l=t.flattenNames=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=[];return(0,o.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return r.push(e)}):(0,i.default)(t)?(0,a.default)(t,function(e,t){!0===e&&r.push(t),r.push(t+"-"+e)}):(0,n.default)(t)&&r.push(t)}),r};t.default=l},6457(e,t,r){"use strict";t.H8=void 0;var n=u(r(3003)),a=u(r(101)),i=u(r(7002)),o=u(r(7136)),s=u(r(2990)),l=u(r(6431));function u(e){return e&&e.__esModule?e:{default:e}}o.default,t.H8=o.default,s.default,l.default,t.Ay=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var s=(0,n.default)(r),l=(0,a.default)(e,s);return(0,i.default)(l)}},6431(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r={},n=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];r[e]=t};return 0===e&&n("first-child"),e===t-1&&n("last-child"),(0===e||e%2==0)&&n("even"),1===Math.abs(e%2)&&n("odd"),n("nth-child",e),r}},101(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeClasses=void 0;var n=o(r(2122)),a=o(r(1285)),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function o(e){return e&&e.__esModule?e:{default:e}}var s=t.mergeClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.default&&(0,a.default)(e.default)||{};return t.map(function(t){var a=e[t];return a&&(0,n.default)(a,function(e,t){r[t]||(r[t]={}),r[t]=i({},r[t],a[t])}),t}),r};t.default=s},9646(e){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},3182(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},9741(e){e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},4774(e,t,r){"use strict";var n=r(6326),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,o=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),a=n[0].inst,c=n[1];return s(function(){a.value=r,a.getSnapshot=t,u(a)&&c({inst:a})},[e,r,t]),o(function(){return u(a)&&c({inst:a}),e(function(){u(a)&&c({inst:a})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},9449(e,t,r){"use strict";var n=r(6326),a=r(3391),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=a.useSyncExternalStore,s=n.useRef,l=n.useEffect,u=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var p=o(e,(d=u(function(){function e(e){if(!l){if(l=!0,o=e,e=n(e),void 0!==a&&f.hasValue){var t=f.value;if(a(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var r=n(e);return void 0!==a&&a(t,r)?t:(o=e,s=r)}var o,s,l=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,a]))[0],d[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}},3391(e,t,r){"use strict";e.exports=r(4774)},4413(e,t,r){"use strict";e.exports=r(9449)},3425(e){"use strict";e.exports=f},6557(e){"use strict";e.exports=u},2302(e){"use strict";e.exports=a},4713(e){"use strict";e.exports=n},3154(e){"use strict";e.exports=r},8500(e){"use strict";e.exports=i},1002(e){"use strict";e.exports=p},1459(e){"use strict";e.exports=l},7238(e){"use strict";e.exports=s},4687(e){"use strict";e.exports=c},3110(e){"use strict";e.exports=t},2220(e){"use strict";e.exports=g},2323(e){"use strict";e.exports=d},1357(t){"use strict";t.exports=e},534(e){"use strict";e.exports=h},4669(e){"use strict";e.exports=v},3545(e){"use strict";e.exports=o},55(e){"use strict";e.exports=b},2111(e){"use strict";e.exports=m},7155(e){"use strict";e.exports=y},5530(e){!function(){"use strict";var t={}.hasOwnProperty;function r(){for(var e="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var a="";for(var i in e)t.call(e,i)&&e[i]&&(a=n(a,i));return a}(i)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return r}):window.classNames=r}()}},_={};function I(e){var t=_[e];if(void 0!==t)return t.exports;var r=_[e]={exports:{}};return w[e].call(r.exports,r,r.exports,I),r.exports}I.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return I.d(t,{a:t}),t},S=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,I.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);I.r(r);var n={};x=x||[null,S({}),S([]),S(S)];for(var a=2&t&&e;("object"==typeof a||"function"==typeof a)&&!~x.indexOf(a);a=S(a))Object.getOwnPropertyNames(a).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,I.d(r,n),r},I.d=(e,t)=>{for(var r in t)I.o(t,r)&&!I.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},I.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),I.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),I.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},I.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var D={};return(()=>{"use strict";I.r(D),I.d(D,{ContextMenuController:()=>aj,CustomizableContextMenuTypes:()=>N,MoreDropdownMenu:()=>r1,PanelStudyBrowserHeader:()=>rK,StaticWadoClient:()=>ew,Toolbar:()=>t0,Toolbox:()=>pk,callInputDialog:()=>lg,callInputDialogAutoComplete:()=>lm,cleanDenaturalizedDataset:()=>lu,colorPickerDialog:()=>pI,createReportAsync:()=>i_,createReportDialogPrompt:()=>ns,default:()=>pj,dicomWebUtils:()=>U,getStudiesForPatientByMRN:()=>na,promptLabelAnnotation:()=>pD,promptSaveReport:()=>ik,requestDisplaySetCreationForStudy:()=>ni,useDisplaySetSelectorStore:()=>ig,useHangingProtocolStageIndexStore:()=>im,usePatientInfo:()=>s3,useToggleHangingProtocolStore:()=>iS,useToggleOneUpViewportGridStore:()=>iw,useUIStateStore:()=>lf,useViewportGridStore:()=>ih,useViewportsByPositionStore:()=>ib,utils:()=>L});var e,t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,O,k,C,j,E,M,R,P,A,T,N={};I.r(N);var U={};I.r(U),I.d(U,{cleanDenaturalizedDataset:()=>lu,fixBulkDataURI:()=>eI,fixMultiValueKeys:()=>ld,transferDenaturalizedDataset:()=>lc});var L={};function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(n.key),n)}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function z(e){for(var t=new Uint8Array(e.length),r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t}function H(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,a=e.length;n&&(a=Math.min(r+n,e.length));for(var i=r;i<a;i++)if(e[i]===t[0]&&function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r+t.length>e.length)return!1;for(var n=r,a=0;a<t.length;a++){if(t[a]!==e[n])return!1;n+=1}return!0}(e,t,i))return i;return -1}function W(e){return"object"===F(e)&&null!==e}function $(e){return 0===Object.keys(e).length&&e.constructor===Object}I.r(L),I.d(L,{Toolbox:()=>pk,addIcon:()=>pO});var Y=function(e){return e[0]},G={DICOM:"application/dicom",DICOM_JSON:"application/dicom+json",OCTET_STREAM:"application/octet-stream",PDF:"application/pdf",JPEG:"image/jpeg",PNG:"image/png"},q=function(){},X={DICOMwebClient:function(){var e,t;function r(e){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");this.baseURL=e.url,this.baseURL||console.error("no DICOMweb base url provided - calls that require a URL will fail"),"username"in e&&(this.username=e.username,"password"in e||console.error("no password provided to authenticate with DICOMweb service"),this.password=e.password),"qidoURLPrefix"in e?(q("use URL prefix for QIDO-RS: ".concat(e.qidoURLPrefix)),this.qidoURL="".concat(this.baseURL,"/").concat(e.qidoURLPrefix)):this.qidoURL=this.baseURL,"wadoURLPrefix"in e?(q("use URL prefix for WADO-RS: ".concat(e.wadoURLPrefix)),this.wadoURL="".concat(this.baseURL,"/").concat(e.wadoURLPrefix)):this.wadoURL=this.baseURL,"stowURLPrefix"in e?(q("use URL prefix for STOW-RS: ".concat(e.stowURLPrefix)),this.stowURL="".concat(this.baseURL,"/").concat(e.stowURLPrefix)):this.stowURL=this.baseURL,e.singlepart?(q("use singlepart",e.singlepart),this.singlepart=!0===e.singlepart?"bulkdata,video,image":e.singlepart):this.singlepart="","requestHooks"in e&&(this.requestHooks=e.requestHooks),this.headers=e.headers||{},this.errorInterceptor=e.errorInterceptor||function(){},this.verbose=!1!==e.verbose,this.setDebug(e.debug)}return e=[{key:"setDebug",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.debugLevel=!!e,q=t||e?console.log:function(){}}},{key:"getDebug",value:function(){return this.debugLevel}},{key:"setVerbose",value:function(e){this.verbose=e}},{key:"getVerbose",value:function(){return this.verbose}},{key:"_httpRequest",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.errorInterceptor,o=this.requestHooks;return new Promise(function(s,l){var u=a.request?a.request:new XMLHttpRequest;u.open(t,e,!0),"responseType"in a&&(u.responseType=a.responseType),"object"===F(n)&&Object.keys(n).forEach(function(e){u.setRequestHeader(e,n[e])});var c=r.headers;if(Object.keys(c).forEach(function(e){u.setRequestHeader(e,c[e])}),u.onloadstart=function(){q("upload started: ",e)},u.onloadend=function(){q("upload finished")},u.onreadystatechange=function(){if(4===u.readyState)if(200===u.status){var e=u.getResponseHeader("Content-Type");e&&-1!==e.indexOf("multipart")?s(function(e){var t,r=ArrayBuffer.isView(e)?e:new Uint8Array(e),n=z("\r\n\r\n"),a=H(r,n,0,1e3);if(-1===a)throw Error("Response message has no multipart mime header");var i=function(e){for(var t=e.split("\r\n"),r=0;r<t.length;r++)if("--"===t[r].substr(0,2))return t[r];return null}(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=r||e.length-t,a="",i=t;i<t+n;i++)a+=String.fromCharCode(e[i]);return a}(r,0,a));if(!i)throw Error("Header of response message does not specify boundary");for(var o=z(i),s=o.length,l=[],u=s;-1!==t&&-1!==(t=H(r,o,u));){var c=H(r,n,u,1e3);if(-1===c)throw Error("Response message part has no mime header");u=c+n.length;var d=e.slice(u,t-2);l.push(d),u=t+s}return l}(u.response)):"arraybuffer"===u.responseType?s([u.response]):s(u.response)}else if(202===u.status)r.verbose&&console.warn("some resources already existed: ",u),s(u.response);else if(204===u.status)r.verbose&&console.warn("empty response for request: ",u),s([]);else{var t=Error("request failed");t.request=u,t.response=u.response,t.status=u.status,r.verbose&&(console.error("request failed: ",u),console.error(t),console.error(t.response)),i(t),l(t)}},"progressCallback"in a&&"function"==typeof a.progressCallback&&(u.onprogress=a.progressCallback),o&&((d=Array.isArray(o)&&o.every(function(e){return"function"==typeof e&&2===e.length}))||console.warn("Request hooks should have the following signature: function requestHook(request, metadata) { return request; }"),d)){var d,f={method:t,url:e,headers:Object.assign({},n,r.headers)};u=function(e){return o.reduce(function(e,t){return t(e,f)},e)}(u)}"withCredentials"in a&&a.withCredentials&&(u.withCredentials=!0),"data"in a?u.send(a.data):u.send()})}},{key:"_httpGet",value:function(e,t,r,n,a){return this._httpRequest(e,"get",t,{responseType:r,progressCallback:n,withCredentials:a})}},{key:"_httpGetApplicationJson",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=e;"object"!==F(t)||$(t)||(i+=r._parseQueryParameters(t));var o={Accept:G.DICOM_JSON};return this._httpGet(i,o,"json",n,a)}},{key:"_httpGetApplicationPdf",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=e;"object"!==F(t)||$(t)||(i+=r._parseQueryParameters(t));var o={Accept:G.PDF};return this._httpGet(i,o,"json",n,a)}},{key:"_httpGetImage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=e;"object"!==F(n)||$(n)||(o+=r._parseQueryParameters(n));var s=r._buildAcceptHeaderFieldValue(t,["image/","image/*","image/jpeg","image/jp2","image/gif","image/png"]);return this._httpGet(o,{Accept:s},"arraybuffer",a,i)}},{key:"_httpGetText",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=e;"object"!==F(n)||$(n)||(o+=r._parseQueryParameters(n));var s=r._buildAcceptHeaderFieldValue(t,["text/","text/*","text/html","text/plain","text/rtf","text/xml"]);return this._httpGet(o,{Accept:s},"arraybuffer",a,i)}},{key:"_httpGetVideo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=e;"object"!==F(n)||$(n)||(o+=r._parseQueryParameters(n));var s=r._buildAcceptHeaderFieldValue(t,["video/","video/*","video/mpeg","video/mp4","video/H265"]);return this._httpGet(o,{Accept:s},"arraybuffer",a,i)}},{key:"_httpGetMultipartImage",value:function(e,t,n,a){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,u={};return o?i=["image/jpeg","image/gif","image/png","image/jp2"]:(i={"1.2.840.10008.1.2.5":["image/x-dicom-rle"],"1.2.840.10008.1.2.4.50":["image/jpeg"],"1.2.840.10008.1.2.4.51":["image/jpeg"],"1.2.840.10008.1.2.4.57":["image/jpeg"],"1.2.840.10008.1.2.4.70":["image/jpeg"],"1.2.840.10008.1.2.4.80":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.81":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.90":["image/jp2"],"1.2.840.10008.1.2.4.91":["image/jp2"],"1.2.840.10008.1.2.4.92":["image/jpx"],"1.2.840.10008.1.2.4.93":["image/jpx"]},n&&(u.Range=r._buildRangeHeaderFieldValue(n))),u.Accept=r._buildMultipartAcceptHeaderFieldValue(t,i),this._httpGet(e,u,"arraybuffer",s,l)}},{key:"_httpGetMultipartVideo",value:function(e,t,n,a){var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,u={};return o?i=["video/","video/*","video/mpeg2","video/mp4","video/H265"]:(i={"1.2.840.10008.1.2.4.100":["video/mpeg2"],"1.2.840.10008.1.2.4.101":["video/mpeg2"],"1.2.840.10008.1.2.4.102":["video/mp4"],"1.2.840.10008.1.2.4.103":["video/mp4"],"1.2.840.10008.1.2.4.104":["video/mp4"],"1.2.840.10008.1.2.4.105":["video/mp4"],"1.2.840.10008.1.2.4.106":["video/mp4"]},n&&(u.Range=r._buildRangeHeaderFieldValue(n))),u.Accept=r._buildMultipartAcceptHeaderFieldValue(t,i),this._httpGet(e,u,"arraybuffer",s,l)}},{key:"_httpGetMultipartApplicationDicom",value:function(e,t,n,a,i){var o={},s="application/dicom",l=t;return t||(l=[{mediaType:s}]),o.Accept=r._buildMultipartAcceptHeaderFieldValue(l,{"1.2.840.10008.1.2.1":[s],"1.2.840.10008.1.2.5":[s],"1.2.840.10008.1.2.4.50":[s],"1.2.840.10008.1.2.4.51":[s],"1.2.840.10008.1.2.4.57":[s],"1.2.840.10008.1.2.4.70":[s],"1.2.840.10008.1.2.4.80":[s],"1.2.840.10008.1.2.4.81":[s],"1.2.840.10008.1.2.4.90":[s],"1.2.840.10008.1.2.4.91":[s],"1.2.840.10008.1.2.4.92":[s],"1.2.840.10008.1.2.4.93":[s],"1.2.840.10008.1.2.4.100":[s],"1.2.840.10008.1.2.4.101":[s],"1.2.840.10008.1.2.4.102":[s],"1.2.840.10008.1.2.4.103":[s],"1.2.840.10008.1.2.4.104":[s],"1.2.840.10008.1.2.4.105":[s],"1.2.840.10008.1.2.4.106":[s]}),this._httpGet(e,o,"arraybuffer",a,i)}},{key:"_httpGetMultipartApplicationOctetStream",value:function(e,t,n,a,i,o){var s,l={},u={"1.2.840.10008.1.2.1":function(e){if(Array.isArray(e))return V(e)}(s=Object.values(G))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e){if(e){if("string"==typeof e)return V(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V(e,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},c=t;return t||(c=[{mediaType:"application/octet-stream"}]),n&&(l.Range=r._buildRangeHeaderFieldValue(n)),l.Accept=r._buildMultipartAcceptHeaderFieldValue(c,u),this._httpGet(e,l,"arraybuffer",i,o)}},{key:"_httpPost",value:function(e,t,r,n,a,i){return this._httpRequest(e,"post",t,{data:r,progressCallback:n,withCredentials:a,request:i})}},{key:"_httpPostApplicationJson",value:function(e,t,r,n){var a={"Content-Type":G.DICOM_JSON};return this._httpPost(e,a,t,r,n)}},{key:"searchForStudies",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q("search for studies");var t=!1,n="".concat(this.qidoURL,"/studies");return"queryParams"in e&&(n+=r._parseQueryParameters(e.queryParams)),"withCredentials"in e&&e.withCredentials&&(t=e.withCredentials),this._httpGetApplicationJson(n,{},!1,t)}},{key:"retrieveStudyMetadata",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of study metadata");q("retrieve metadata of study ".concat(e.studyInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/metadata"),r=!1;return"withCredentials"in e&&e.withCredentials&&(r=e.withCredentials),this._httpGetApplicationJson(t,{},!1,r)}},{key:"searchForSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.qidoURL;"studyInstanceUID"in e&&(q("search series of study ".concat(e.studyInstanceUID)),t+="/studies/".concat(e.studyInstanceUID)),t+="/series","queryParams"in e&&(t+=r._parseQueryParameters(e.queryParams));var n=!1;return"withCredentials"in e&&e.withCredentials&&(n=e.withCredentials),this._httpGetApplicationJson(t,{},!1,n)}},{key:"retrieveSeriesMetadata",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of series metadata");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of series metadata");q("retrieve metadata of series ".concat(e.seriesInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/metadata"),r=!1;return"withCredentials"in e&&e.withCredentials&&(r=e.withCredentials),this._httpGetApplicationJson(t,{},!1,r)}},{key:"searchForInstances",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.qidoURL,n=!1;return"studyInstanceUID"in e?(t+="/studies/".concat(e.studyInstanceUID),"seriesInstanceUID"in e?(q("search for instances of series ".concat(e.seriesInstanceUID)),t+="/series/".concat(e.seriesInstanceUID)):q("search for instances of study ".concat(e.studyInstanceUID))):q("search for instances"),t+="/instances","queryParams"in e&&(t+=r._parseQueryParameters(e.queryParams)),"withCredentials"in e&&e.withCredentials&&(n=e.withCredentials),this._httpGetApplicationJson(t,{},!1,n)}},{key:"buildInstanceWadoURIUrl",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required.");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required.");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required.");var t=e.contentType||G.DICOM,r=e.transferSyntax||"*",n=[];n.push("requestType=WADO"),n.push("studyUID=".concat(e.studyInstanceUID)),n.push("seriesUID=".concat(e.seriesInstanceUID)),n.push("objectUID=".concat(e.sopInstanceUID)),n.push("contentType=".concat(t)),n.push("transferSyntax=".concat(r));var a=n.join("&");return"".concat(this.wadoURL,"?").concat(a)}},{key:"retrieveInstanceMetadata",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of instance metadata");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of instance metadata");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of instance metadata");q("retrieve metadata of instance ".concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/metadata"),r=!1;return"withCredentials"in e&&e.withCredentials&&(r=e.withCredentials),this._httpGetApplicationJson(t,{},!1,r)}},{key:"retrieveInstanceFrames",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of instance frames");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of instance frames");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of instance frames");if(!("frameNumbers"in e))throw Error("frame numbers are required for retrieval of instance frames");q("retrieve frames ".concat(e.frameNumbers.toString()," of instance ").concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/frames/").concat(e.frameNumbers.toString()),n=e.mediaTypes,a=!1;"withCredentials"in e&&e.withCredentials&&(a=e.withCredentials);var i=!1;if("progressCallback"in e&&(i=e.progressCallback),!n)return this._httpGetMultipartApplicationOctetStream(t,!1,!1,!1,i,a);if(r._getSharedMediaTypes(n).length>1){var o={Accept:r._buildMultipartAcceptHeaderFieldValue(n,{"1.2.840.10008.1.2.1":["application/octet-stream"],"1.2.840.10008.1.2.5":["image/x-dicom-rle"],"1.2.840.10008.1.2.4.50":["image/jpeg"],"1.2.840.10008.1.2.4.51":["image/jpeg"],"1.2.840.10008.1.2.4.57":["image/jpeg"],"1.2.840.10008.1.2.4.70":["image/jpeg"],"1.2.840.10008.1.2.4.80":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.81":["image/x-jls","image/jls"],"1.2.840.10008.1.2.4.90":["image/jp2"],"1.2.840.10008.1.2.4.91":["image/jp2"],"1.2.840.10008.1.2.4.92":["image/jpx"],"1.2.840.10008.1.2.4.93":["image/jpx"],"1.2.840.10008.1.2.4.201":["image/jhc"],"1.2.840.10008.1.2.4.202":["image/jhc"]})};return this._httpGet(t,o,"arraybuffer",i,a)}var s=r._getCommonMediaType(n);if(s.startsWith("application"))return this._httpGetMultipartApplicationOctetStream(t,n,!1,!1,i,a);if(s.startsWith("image"))return this._httpGetMultipartImage(t,n,!1,!1,!1,i,a);if(s.startsWith("video"))return this._httpGetMultipartVideo(t,n,!1,!1,!1,i,a);throw Error("Media type ".concat(s," is not supported for retrieval of frames."))}},{key:"retrieveInstanceRendered",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/rendered"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",o,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);if(s.startsWith("video"))return this._httpGetVideo(t,n,a,o,i);if(s.startsWith("text"))return this._httpGetText(t,n,a,o,i);if(s===G.PDF)return this._httpGetApplicationPdf(t,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered instance.")}},{key:"retrieveInstanceThumbnail",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/thumbnail"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",o,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered instance.")}},{key:"retrieveInstanceFramesRendered",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance frames");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance frames");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance frames");if(!("frameNumbers"in e))throw Error("frame numbers are required for retrieval of rendered instance frames");q("retrieve rendered frames ".concat(e.frameNumbers.toString()," of instance ").concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/frames/").concat(e.frameNumbers.toString(),"/rendered"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",!1,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);if(s.startsWith("video"))return this._httpGetVideo(t,n,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered frame.")}},{key:"retrieveInstanceFramesThumbnail",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required for retrieval of rendered instance frames");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required for retrieval of rendered instance frames");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required for retrieval of rendered instance frames");if(!("frameNumbers"in e))throw Error("frame numbers are required for retrieval of rendered instance frames");console.debug("retrieve rendered frames ".concat(e.frameNumbers.toString()," of instance ").concat(e.sopInstanceUID));var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID,"/frames/").concat(e.frameNumbers.toString(),"/thumbnail"),n=e.mediaTypes,a=e.queryParams,i=!1;"withCredentials"in e&&e.withCredentials&&(i=e.withCredentials);var o=!1;if("progressCallback"in e&&(o=e.progressCallback),!n)return a&&(t+=r._parseQueryParameters(a)),this._httpGet(t,{},"arraybuffer",o,i);var s=r._getCommonMediaType(n);if(s.startsWith("image"))return this._httpGetImage(t,n,a,o,i);throw Error("Media type ".concat(s," is not supported ")+"for retrieval of rendered frame.")}},{key:"retrieveInstance",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required");if(!("sopInstanceUID"in e))throw Error("SOP Instance UID is required");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID,"/instances/").concat(e.sopInstanceUID),n=e.mediaTypes,a=e.withCredentials,i=void 0!==a&&a,o=e.progressCallback,s=void 0!==o&&o;if(!n)return this._httpGetMultipartApplicationDicom(t,!1,!1,s,i).then(Y);var l=r._getCommonMediaType(n);if(l===G.DICOM)return this._httpGetMultipartApplicationDicom(t,n,!1,s,i).then(Y);throw Error("Media type ".concat(l," is not supported for retrieval of instance."))}},{key:"retrieveSeries",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required");if(!("seriesInstanceUID"in e))throw Error("Series Instance UID is required");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID,"/series/").concat(e.seriesInstanceUID),n=e.mediaTypes,a=!1;"withCredentials"in e&&e.withCredentials&&(a=e.withCredentials);var i=!1;if("progressCallback"in e&&(i=e.progressCallback),!n)return this._httpGetMultipartApplicationDicom(t,!1,!1,i,a);var o=r._getCommonMediaType(n);if(o===G.DICOM)return this._httpGetMultipartApplicationDicom(t,n,!1,i,a);throw Error("Media type ".concat(o," is not supported for retrieval of series."))}},{key:"retrieveStudy",value:function(e){if(!("studyInstanceUID"in e))throw Error("Study Instance UID is required");var t="".concat(this.wadoURL,"/studies/").concat(e.studyInstanceUID),n=e.mediaTypes,a=e.withCredentials,i=void 0!==a&&a,o=e.progressCallback,s=void 0!==o&&o;if(!n)return this._httpGetMultipartApplicationDicom(t,!1,!1,s,i);var l=r._getCommonMediaType(n);if(l===G.DICOM)return this._httpGetMultipartApplicationDicom(t,n,!1,s,i);throw Error("Media type ".concat(l," is not supported for retrieval of study."))}},{key:"retrieveBulkData",value:function(e){if(!("BulkDataURI"in e))throw Error("BulkDataURI is required.");var t=e.BulkDataURI,n=e.mediaTypes,a=e.byteRange,i=e.withCredentials,o=void 0!==i&&i,s=e.progressCallback,l=void 0!==s&&s;if(-1!==this.singlepart.indexOf("bulkdata"))return this._httpGet(t,e.headers,"arraybuffer",null,o);if(n)try{var u=r._getCommonMediaType(n);if("image/"===u)return this._httpGetMultipartImage(t,n,a,!1,!1,l,o)}catch(e){}return this._httpGetMultipartApplicationOctetStream(t,n,a,!1,l,o)}},{key:"storeInstances",value:function(e){if(!("datasets"in e))throw Error("datasets are required for storing");var t="".concat(this.stowURL,"/studies");"studyInstanceUID"in e&&(t+="/".concat(e.studyInstanceUID));var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return"".concat(e()+e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/dicom",n=z("\r\n--".concat(t,"\r\n").concat("Content-Type: ".concat(r),"\r\n\r\n")),a=z("\r\n--".concat(t,"--")),i=n.length,o=a.length,s=0,l=e.map(function(e){var t=new Uint8Array(e),r=t.length;return s+=i+r+o,t}),u=new Uint8Array(s);u.set(n,0);var c=0;return l.forEach(function(e){u.set(n,c),u.set(e,c+i),c+=i+e.length}),u.set(a,c),{data:u.buffer,boundary:t}}(e.datasets),n=r.data,a=r.boundary,i=e.withCredentials;return this._httpPost(t,{"Content-Type":'multipart/related; type="application/dicom"; boundary="'.concat(a,'"')},n,e.progressCallback,void 0!==i&&i,e.request)}}],t=[{key:"_parseQueryParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="?";return Object.keys(e).forEach(function(r,n){0!==n&&(t+="&"),t+="".concat(r,"=").concat(encodeURIComponent(e[r]))}),t}},{key:"_assertMediaTypeIsValid",value:function(e){if(!e)throw Error("Not a valid media type: ".concat(e));var t=e.indexOf("/");if(-1===t||!["application","image","text","video"].includes(e.slice(0,t))||e.slice(t+1).includes("/"))throw Error("Not a valid media type: ".concat(e))}},{key:"_parseMediaType",value:function(e){return r._assertMediaTypeIsValid(e),e.split("/")}},{key:"_buildAcceptHeaderFieldValue",value:function(e,t){if(!Array.isArray(e))throw Error("Acceptable media types must be provided as an Array");return e.map(function(e){var n=e.mediaType;if(r._assertMediaTypeIsValid(n),!t.includes(n))throw Error("Media type ".concat(n," is not supported for requested resource"));return n}).join(", ")}},{key:"_buildMultipartAcceptHeaderFieldValue",value:function(e,t){var n=this;if(!Array.isArray(e))throw Error("Acceptable media types must be provided as an Array");if(!Array.isArray(t)&&!W(t))throw Error("Supported media types must be provided as an Array or an Object");var a=[];if(e.forEach(function(e){var i=e.transferSyntaxUID,o=e.mediaType;r._assertMediaTypeIsValid(o);var s='multipart/related; type="'.concat(o,'"');if(W(t)){if(!Object.values(t).flat(1).includes(o)&&(!o.endsWith("/*")||!o.endsWith("/")))return void q("Media type ".concat(o," is not supported for requested resource"));if(i){if("*"!==i){if(!Object.keys(t).includes(i))throw Error("Transfer syntax ".concat(i," is not supported for requested resource"));var l=t[i];if(!l.includes(o)){var u=r._parseMediaType(o)[0];l.map(function(e){if(!(u===r._parseMediaType(e)[0]&&(o.endsWith("/*")||o.endsWith("/"))))throw Error("Transfer syntax ".concat(i," is not supported for requested resource"))})}}s+="; transfer-syntax=".concat(i)}}else if(Array.isArray(t)&&!t.includes(o)){n.verbose&&console.warn("Media type ".concat(o," is not supported for requested resource"));return}a.push(s)}),!a.length)throw Error("No acceptable media types found among ".concat(JSON.stringify(e)));return a.join(", ")}},{key:"_buildRangeHeaderFieldValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return 1===e.length?"bytes=".concat(e[0],"-"):2===e.length?"bytes=".concat(e[0],"-").concat(e[1]):"bytes=0-"}},{key:"_getSharedMediaTypes",value:function(e){var t=new Set;return e&&e.length?(e.forEach(function(e){var n=e.mediaType,a=r._parseMediaType(n)[0];t.add("".concat(a,"/"))}),Array.from(t)):t}},{key:"_getCommonMediaType",value:function(e){if(!e||!e.length)throw Error("No acceptable media types provided");var t=r._getSharedMediaTypes(e);if(0===t.length)throw Error("No common acceptable media type could be identified.");if(t.length>1)throw Error("Acceptable media types must have the same type.");return t[0]}}],e&&B(r.prototype,e),t&&B(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}()},K=I(1002),J=I.n(K),Z=I(2323);let{getString:Q,getName:ee,getModalities:et}=K.DICOMWeb;function er(e){if(!e||!e.length)return[];let t=[];return e.forEach(e=>t.push({studyInstanceUid:Q(e["0020000D"]),date:Q(e["00080020"]),time:Q(e["00080030"]),accession:Q(e["00080050"])||"",mrn:Q(e["00100020"])||"",patientName:K.utils.formatPN(ee(e["00100010"]))||"",patientBirthDate:Q(e["00100030"])||"",instances:Number(Q(e["00201208"]))||0,description:Q(e["00081030"])||"",modalities:Q(et(e["00080060"],e["00080061"]))||"",referringPhysicianName:K.utils.formatPN(ee(e["00080090"]))||""})),t}async function en(e,t,r,n){return await e.searchForStudies({studyInstanceUid:void 0,queryParams:n})}function ea(e,t={}){if(!e)return;let r=e?.disableWildcard!==void 0?!e.disableWildcard:t.supportsWildcard,n=e=>r&&e?`*${e}*`:e,a={PatientName:n(e.patientName),"00100020":n(e.patientId),AccessionNumber:n(e.accessionNumber),StudyDescription:n(e.studyDescription),ModalitiesInStudy:e.modalitiesInStudy,limit:e.limit||101,offset:e.offset||0,fuzzymatching:!0===t.supportsFuzzyMatching,includefield:"00081030,00080060,00080090,00100030"};if(e.startDate&&e.endDate)a.StudyDate=`${e.startDate}-${e.endDate}`;else if(e.startDate){let t=new Date,r=String(t.getDate()).padStart(2,"0"),n=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear(),o=`${i}${n}${r}`;a.StudyDate=`${e.startDate}-${o}`}else e.endDate&&(a.StudyDate=`19700102-${e.endDate}`);if(e.studyInstanceUid){let t=e.studyInstanceUid;a.StudyInstanceUID=t=(t=Array.isArray(t)?t.join():t).replace(/[^0-9.]+/g,"\\")}let i={};return Object.keys(a).forEach(e=>{void 0!==a[e]&&""!==a[e]&&(i[e]=a[e])}),i}function ei({instance:e,frame:t,config:r,thumbnail:n=!1}){if(!e)return;if(e.imageId&&void 0===t)return e.imageId;if(e.url)return e.url;let a=n?"thumbnailRendering":"imageRendering";if(r[a]&&"wadouri"!==r[a])return function(e,t,r){var n;let a,i=(n=r,a=function(e,t){let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a}=e;return`${t.wadoRoot}/studies/${r}/series/${n}/instances/${a}`}(e,t),n=n||1,`${a}/frames/${n}`);if(i)return`wadors:${i}`}(e,r,t);{let n="dicomweb:"+function(e,t){let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a}=t,i=[];i.push("requestType=WADO"),i.push(`studyUID=${r}`),i.push(`seriesUID=${n}`),i.push(`objectUID=${a}`),i.push("contentType=application/dicom"),i.push("transferSyntax=*");let o=i.join("&");return`${e.wadoUriRoot}?${o}`}(r,e);return void 0!==t&&(n+="&frame="+t),n}}var eo=I(2111),es=I.n(eo),el=I(2302),eu=I.n(el);class ec{constructor(e,t,r={},n,a){this.client=e,this.studyInstanceUID=t,this.filters=r,this.sortCriteria=n,this.sortFunction=a}async execLoad(){let e=await this.preLoad(),t=await this.load(e);return await this.posLoad(t)}async runLoaders(e){let t;for(let r of e)if((t=await r())&&t.length)break;if(e.next().done&&!t)throw Error("RetrieveMetadataLoader failed");return t}async configLoad(){}async preLoad(){}async load(e){}async posLoad(e){}}class ed extends ec{getOptions(){let{studyInstanceUID:e,filters:t}=this,r={studyInstanceUID:e},{seriesInstanceUID:n}=t;return n&&(r.seriesInstanceUID=n),r}*getLoaders(){let e=[],{studyInstanceUID:t,filters:{seriesInstanceUID:r}={},client:n}=this;r&&e.push(n.retrieveSeriesMetadata.bind(n,{studyInstanceUID:t,seriesInstanceUID:r})),e.push(n.retrieveStudyMetadata.bind(n,{studyInstanceUID:t})),yield*e}async load(e){let t=this.getLoaders();return this.runLoaders(t)}async posLoad(e){return e}}class ef{constructor(){this.metadata=void 0,this.processFunction=void 0,this.internalPromise=void 0,this.thenFunction=void 0,this.rejectFunction=void 0}setMetadata(e){this.metadata=e}setProcessFunction(e){this.processFunction=e}getPromise(){return this.start()}start(){return this.internalPromise||(this.internalPromise=this.processFunction(),this.thenFunction&&(this.then(this.thenFunction),this.thenFunction=void 0),this.rejectFunction&&(this.reject(this.rejectFunction),this.rejectFunction=void 0)),this.internalPromise}then(e){if(this.internalPromise)return this.internalPromise.then(e);this.thenFunction=e}reject(e){if(this.internalPromise)return this.internalPromise.reject(e);this.rejectFunction=e}}class ep extends ec{*getPreLoaders(){let e=[],{studyInstanceUID:t,filters:{seriesInstanceUID:r}={},client:n}=this,a={studyInstanceUID:t,queryParams:{includefield:"00080021,00080031,0008103E,00200011"}};r&&(a.queryParams.SeriesInstanceUID=r,e.push(n.searchForSeries.bind(n,a))),e.push(n.searchForSeries.bind(n,a)),yield*e}async preLoad(){let e=this.getPreLoaders(),t=await this.runLoaders(e),r=this.sortCriteria,n=this.sortFunction,{naturalizeDataset:a}=es().data.DicomMetaDictionary,i=t.map(a);return(0,Z.sortStudySeries)(i,r,n)}async load(e){let{client:t,studyInstanceUID:r}=this,n=e.map(e=>({seriesInstanceUID:e.SeriesInstanceUID,metadata:e})),a=Object.freeze({hasNext:()=>n.length>0,next(){let{seriesInstanceUID:e,metadata:a}=n.shift(),i=new ef;return i.setMetadata(a),i.setProcessFunction(()=>t.retrieveSeriesMetadata({studyInstanceUID:r,seriesInstanceUID:e})),i}}),i=[];for(;a.hasNext();){let e=a.next();i.push(e)}return{preLoadData:e,promises:i}}async posLoad({preLoadData:e,promises:t}){return{preLoadData:e,promises:t}}}async function eh(e,t,r,n={},a,i){let o=new(!1!==r?ep:ed)(e,t,n,a,i);return await o.execLoad()}let eg=function(e,t,r,n,a,i){let{seriesInstanceUID:o}=n;return new Promise((s,l)=>{let u=o.map(o=>eh(e,t,r,Object.assign({},n,{seriesInstanceUID:o}),a,i));!0===r?Promise.all(u).then(e=>{let t={preLoadData:[],promises:[]};e.forEach(({preLoadData:e,promises:r})=>{t.preLoadData=t.preLoadData.concat(e),t.promises=t.promises.concat(r)}),s(t)},l):Promise.all(u).then(e=>{s(e.flat())},l)})},em="RetrieveStudyMetadata",ey=new Map;function ev(e,t,r,n,a,i,o={}){let s;if(!e)throw Error(`${em}: Required 'dicomWebClient' parameter not provided.`);if(!t)throw Error(`${em}: Required 'StudyInstanceUID' parameter not provided.`);let l=`${o.name}:${t}`;return ey.has(l)?ey.get(l):(s=n&&n.seriesInstanceUID&&Array.isArray(n.seriesInstanceUID)?eg(e,t,r,n,a,i):new Promise((o,s)=>{eh(e,t,r,n,a,i).then(function(e){o(e)},s)}),ey.set(l,s),s)}function eb(e){if(!e)return;let t=`:${e}`;for(let r of[...ey.keys()])(r===e||r.endsWith(t))&&ey.delete(r)}let ex=function(e,t,r){r=r||0;let n=function(e){let t=new Uint8Array(e.length);for(let r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t}(t);for(let t=r;t<e.length;t++)if(n[0]===e[t]&&function(e,t,r){if(r+e.length>t.length)return!1;let n=r;for(let r=0;r<e.length;r++)if(e[r]!==t[n++])return!1;return!0}(n,e,t))return t;return -1},{DICOMwebClient:eS}=X;eS._orig_buildMultipartAcceptHeaderFieldValue||(eS._orig_buildMultipartAcceptHeaderFieldValue=eS._buildMultipartAcceptHeaderFieldValue,eS._buildMultipartAcceptHeaderFieldValue=function(e,t){return 1===e.length&&e[0].mediaType.endsWith("/*")?"*/*":eS._orig_buildMultipartAcceptHeaderFieldValue(e,t)});class ew extends X.DICOMwebClient{constructor(e){super(e),this.config=void 0,this.staticWado=void 0,this.staticWado=e.staticWado,this.config=e}retrieveBulkData(e){let t=!1!==this.config.fixBulkdataMultipart,r={...e};return this.staticWado&&(r.mediaTypes=[{mediaType:"application/*"}]),super.retrieveBulkData(r).then(e=>t?function(e){let t=new Uint8Array(e[0]);if(t.length<25)return e;let r=ex(t,"--");if(r>6)return e;let n=ex(t,"\r\n\r\n",r);if(n>512)return e;let a=function(e){for(let t=0;t<e.length;t++)if("--"===e[t].substr(0,2))return e[t]}((function(e,t,r){t=t||0,r=r||e.length-t;let n="";for(let a=t;a<t+r;a++)n+=String.fromCharCode(e[a]);return n})(t,0,n).split("\r\n"));if(!a)return e;let i=n+4,o=ex(t,a,i);return -1===o?e:[t.slice(i,o-2).buffer]}(e):e)}retrieveInstanceFrames(e){return this.staticWado?super.retrieveInstanceFrames({...e,mediaTypes:[{mediaType:"image/*"}]}):super.retrieveInstanceFrames(e)}async searchForStudies(e){if(!this.staticWado)return super.searchForStudies(e);let t=await super.searchForStudies(e),{queryParams:r}=e;if(!r)return t;let n=this.toLowerParams(r);return t.filter(e=>{for(let t of Object.keys(ew.studyFilterKeys))if(!this.filterItem(t,n,e,ew.studyFilterKeys))return!1;return!0})}async searchForSeries(e){if(!this.staticWado)return super.searchForSeries(e);let t=await super.searchForSeries(e),{queryParams:r}=e;if(!r)return t;let n=this.toLowerParams(r);return t.filter(e=>{for(let t of Object.keys(ew.seriesFilterKeys))if(!this.filterItem(t,n,e,ew.seriesFilterKeys))return!1;return!0})}compareValues(e,t,r){let{fuzzyMatching:n}=r;if(Array.isArray(e))return e.find(e=>this.compareValues(e,t,r));if(Array.isArray(t))return t.find(t=>this.compareValues(e,t,r));if(t?.Alphabetic&&(t=t.Alphabetic),n&&"string"==typeof t&&"string"==typeof e){let r=e.toLowerCase(),n=t.toLowerCase(),a=e=>e.split(/[\s^]+/).filter(Boolean),i=a(r),o=a(n);return i.every(e=>o.some(t=>t.startsWith(e)))}if("string"==typeof t){if(0===t.length||0===e.length||"*"===e)return!0;if("*"===e[0]&&"*"===e[e.length-1])return -1!=t.indexOf(e.substring(1,e.length-1));if("*"===e[e.length-1])return -1!=t.indexOf(e.substring(0,e.length-1));if("*"===e[0])return t.indexOf(e.substring(1))===t.length-e.length+1}return e===t}compareDateRange(e,t){if(!t)return!0;let r=e.indexOf("-");if(-1===r)return this.compareValues(e,t,{});let n=e.substring(0,r),a=e.substring(r+1);return(!n||t>=n)&&(!a||t<=a)}filterItem(e,t,r,n){let{supportsFuzzyMatching:a=!1}=this.config,i={fuzzyMatching:-1!==e.indexOf("name")&&a},o=n[e]||e;if(!t)return!0;let s=t[e]||t[o];if(!s)return!0;let l=r[e]||r[o];if(!l)return!1;if("DA"===l.vr&&l.Value?.[0])return this.compareDateRange(s,l.Value[0]);let u=l.Value;return this.compareValues(s,u,i)}toLowerParams(e){let t={};return Object.entries(e).forEach(([e,r])=>{t[e.toLowerCase()]=r}),t}}ew.studyFilterKeys={studyinstanceuid:"0020000D",patientname:"00100010","00100020":"mrn",studydescription:"00081030",studydate:"00080020",modalitiesinstudy:"00080061",accessionnumber:"00080050"},ew.seriesFilterKeys={seriesinstanceuid:"0020000E",seriesnumber:"00200011",modality:"00080060"};let e_=(e,t)=>{let{singlepart:r}=e,{instance:n,tag:a="PixelData",defaultType:i="video/mp4",singlepart:o="video",url:s=null}=t;if(s)return s;let l=n[a];if(l){if(l.DirectRetrieveURL)return l.DirectRetrieveURL;if(l.InlineBinary){let e=K.utils.b64toBlob(l.InlineBinary,i);return l.DirectRetrieveURL=URL.createObjectURL(e),l.DirectRetrieveURL}if(!r||!0!==r&&-1===r.indexOf(o))return l.retrieveBulkData?l.retrieveBulkData({mediaType:i}).then(e=>(l.DirectRetrieveURL=URL.createObjectURL(new Blob([e],{type:i})),l.DirectRetrieveURL)):void console.warn("Unable to retrieve",a,"from",n)}return((e,t)=>{let{wadoRoot:r}=e,{instance:n,tag:a="PixelData"}=t,{StudyInstanceUID:i,SeriesInstanceUID:o,SOPInstanceUID:s}=n,l=n[a]?.BulkDataURI??"";if(l?.indexOf("?")===-1&&("PixelData"===a||"EncapsulatedDocument"===a))return`${r}/studies/${i}/series/${o}/instances/${s}/rendered`})(e,t)||((e,t)=>{let{instance:r,tag:n="PixelData",defaultPath:a="/pixeldata",defaultType:i="video/mp4"}=t,o=r[n],{StudyInstanceUID:s,SeriesInstanceUID:l,SOPInstanceUID:u}=r,c=o&&o.BulkDataURI||`series/${l}/instances/${u}${a}`,d=-1!==c.indexOf("?"),f=-1!==c.indexOf("accept="),p=c+(f?"":(d?"&":"?")+`accept=${i}`);if(p.startsWith("series/")){let{wadoRoot:t}=e;return`${t}/studies/${s}/${p}`}return p})(e,t)};function eI(e,t,r){let{BulkDataURI:n}=e,{bulkDataURI:a={}}=r;n=a.transform?.(n)||n;let{startsWith:i,prefixWith:o=""}=a;if(i&&n.startsWith(i)&&(e.BulkDataURI=n=o+n.substring(i.length)),!n.startsWith("http")&&!e.BulkDataURI.startsWith("/")){let{StudyInstanceUID:i,SeriesInstanceUID:o}=t,s=n.startsWith("instances/")||n.startsWith("../");n.startsWith("series/")||n.startsWith("bulkdata/")||"studies"===a.relativeResolution&&!s?e.BulkDataURI=`${r.wadoRoot}/studies/${i}/${n}`:(s||"series"===a.relativeResolution||!a.relativeResolution)&&(e.BulkDataURI=`${r.wadoRoot}/studies/${i}/series/${o}/${n}`);return}if("/"===n[0]&&r.wadoRoot.startsWith("http")){let t=new URL(r.wadoRoot);e.BulkDataURI=`${t.origin}${n}`}}let eD={allowInvalidVRLength:!1,fragmentMultiframe:!1},eO=["url","wadorsuri","wadouri","wadoRoot","wadoUri","wadoUriRoot","imageRendering","imageId","_parentInstance","frameNumber"];function ek(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function eC(e){for(let t of eO){if(!Object.prototype.hasOwnProperty.call(e,t))continue;let r=Object.getOwnPropertyDescriptor(e,t);r&&!1!==r.enumerable&&ek(e,t,r.value)}}function ej(e){let t=e?._meta?.TransferSyntaxUID;return"string"==typeof t?t:Array.isArray(t?.Value)?t.Value[0]:"string"==typeof e?.TransferSyntaxUID?e.TransferSyntaxUID:"1.2.840.10008.1.2.1"}function eE(e){let t,r;return new Blob([(eC(e),t=ej(e),r=es().data.datasetToDict(e),t&&r?.meta&&(r.meta["00020010"]={vr:"UI",Value:[t]}),r.write(eD))],{type:"application/dicom"})}function eM(e,t,r){let{StudyInstanceUID:n,SeriesInstanceUID:a,SOPInstanceUID:i}=e,o=a&&i?`/studies/${n}/series/${a}/instances/${i}/${t}`:a?`/studies/${n}/series/${a}/${t}`:`/studies/${n}/${t}`;if(!r)return o;let s=r.toString();return s?`${o}?${s}`:o}async function eR(e,t,r,n,a){let i,o=(i=eM(e,t,new URLSearchParams({viewport:"256,256"})),{url:`${r}${i}`,endpointPath:i,headers:{...n(),Accept:"image/jpeg"}});try{let e=await fetch(o.url,{method:"GET",headers:o.headers,signal:a});if(!e.ok)return console.warn(`thumbnail fetch failed with status ${e.status} for ${o.endpointPath}`),null;let t=await e.blob();return URL.createObjectURL(t)}catch(e){if(e?.name==="AbortError")return null;return console.warn("thumbnail fetch failed",e),null}}async function eP(e,t,r,n,a,i){let o="00080018",s=await eR(e,t,r,n,i);if(s)return s;if(i?.aborted||e.SOPInstanceUID||!e.StudyInstanceUID||!e.SeriesInstanceUID)return null;try{a.headers=n();let s=await a.searchForInstances({studyInstanceUID:e.StudyInstanceUID,seriesInstanceUID:e.SeriesInstanceUID,queryParams:{limit:1,includefield:o}});if(i?.aborted)return null;let l=s?.[0],u=l?.[o],c=u?.Value,d=Array.isArray(c)&&c.length?String(c[0]):void 0;if(!d)return null;return eR({...e,SOPInstanceUID:d},t,r,n,i)}catch(e){return console.warn("thumbnail fetch QIDO fallback failed",e),null}}async function eA({url:e,wadoRoot:t,headers:r,signal:n,userAuthenticationService:a}){if(!e||n?.aborted)return{url:null};if(!r?.Authorization||!function(e,t){if(!t)return!1;try{let r=new URL(e,window.location.href),n=new URL(t,window.location.href),a="http:"===r.protocol||"https:"===r.protocol,i="http:"===n.protocol||"https:"===n.protocol;return a&&i&&r.origin===n.origin}catch{return!1}}(e,t))return{url:e};try{var i;let t,o=await fetch(e,{method:"GET",headers:r,signal:n});if(!o.ok)return(401===o.status||403===o.status)&&a?.handleUnauthenticated?.(),console.warn(`rendered media fetch failed with status ${o.status}`),{url:null};let s=await o.blob(),l=URL.createObjectURL(s);if(n?.aborted)return URL.revokeObjectURL(l),{url:null};return{url:l,revoke:(i=l,t=!1,()=>{t||(URL.revokeObjectURL(i),t=!0)})}}catch(e){if(e?.name==="AbortError")return{url:null};return console.warn("rendered media fetch failed",e),{url:null}}}function eT(e,t={}){let{mediaType:r}=t,n={multipart:!1,BulkDataURI:e.BulkDataURI,mediaTypes:r?[{mediaType:r},{mediaType:"application/octet-stream"}]:void 0,...t};return this.retrieveBulkData(n).then(t=>{let r=Array.isArray(t)?t.find(e=>e?.byteLength):t?.byteLength?t:void 0;return e.Value=r,r})}let{DicomMetaDictionary:eN,DicomDict:eU}=es().data,{naturalizeDataset:eL,denaturalizeDataset:eF}=eN,eB=K.classes.MetadataProvider,eV={includeTransferSyntax:!1};function ez(e,t){var r,n;let a,i,o,s,l,{userAuthenticationService:u}=t.services;e.bulkDataURI||={enabled:!0};let c=(t,r=t)=>{if(!t)return t;for(let n of Object.keys(t)){let a=t[n];if(Array.isArray(a)&&"object"==typeof a[0]){a.filter(Boolean).forEach(e=>c(e,r));continue}a&&a.BulkDataURI&&!a.Value&&(eI(a,r,e),a.retrieveBulkData=eT.bind(o,a))}return t},d=t=>{let r=eL(t);return e.bulkDataURI?.enabled?c(r):r},f={initialize:({params:t,query:r})=>{e.onConfiguration&&"function"==typeof e.onConfiguration&&(e=e.onConfiguration(e,{params:t,query:r})),a=JSON.parse(JSON.stringify(e)),s=()=>{let e={},t=u.getAuthorizationHeader();return t&&t.Authorization&&(e.Authorization=t.Authorization),e},l=t=>{let r=s();if(t?.includeTransferSyntax===!1)return{...r};{let t=K.utils.generateAcceptHeader(e.acceptHeader,e.requestTransferSyntaxUID,e.omitQuotationForMultipartRequest);return{...r,Accept:t}}};let n=e.qidoRoot??e.wadoRoot,c=e.wadoRoot??e.qidoRoot,d=e.stowRoot??c;i={url:c,staticWado:e.staticWado,singlepart:e.singlepart,headers:u.getAuthorizationHeader(),errorInterceptor:K.errorHandler.getHTTPErrorHandler(),supportsFuzzyMatching:e.supportsFuzzyMatching},(o=e.staticWado?new ew(i):new X.DICOMwebClient(i)).qidoURL=n,o.wadoURL=c,o.stowURL=d},query:{studies:{mapParams:ea.bind(),search:async function(t){o.headers=s();let{studyInstanceUid:r,seriesInstanceUid:n,...a}=ea(t,{supportsFuzzyMatching:e.supportsFuzzyMatching,supportsWildcard:e.supportsWildcard})||{};return er(await en(o,void 0,void 0,a))},processResults:er.bind()},series:{search:async function(e){var t;let r;return o.headers=s(),r=[],(t=await o.searchForSeries({studyInstanceUID:e,queryParams:{includefield:"0008103E,00080021"}}))&&t.length&&t.forEach(e=>r.push({studyInstanceUid:Q(e["0020000D"]),seriesInstanceUid:Q(e["0020000E"]),modality:Q(e["00080060"]),seriesNumber:Q(e["00200011"]),seriesDate:Q(e["00080021"]),numSeriesInstances:Number(Q(e["00201209"])),description:Q(e["0008103E"])})),(0,Z.sortStudySeries)(r),r.map(e=>({...e,seriesDate:K.utils.formatDate(e.seriesDate)}))}},instances:{search:(e,t)=>(o.headers=s(),en.call(void 0,o,e,null,t))}},retrieve:{getGetThumbnailSrc:function(t,r){return function({thumbnailContext:e,imageId:t,config:r,getAuthorizationHeader:n,qidoDicomWebClient:a,retrieve:i}){let o=r.thumbnailRendering;return o?"wadors"===o?function(e){return!t||!e?.getImageSrc||e?.signal?.aborted?null:e.getImageSrc(t)}:"thumbnailDirect"===o?function(){return i.directURL({instance:e,defaultPath:"/thumbnail",defaultType:"image/jpeg",singlepart:!0,tag:"Absent"})}:"fetch"===(r.thumbnailRequestStrategy||"bulkDataRetrieve")?async function(t){return eP(e,o,r.wadoRoot,n,a,t?.signal)}:"thumbnail"===o||"rendered"===o?async function(t){if(t?.signal?.aborted)return null;let n=eM(e,o,new URLSearchParams({accept:"image/jpeg"})),a=`${r.wadoRoot}${n}`;return URL.createObjectURL(new Blob([await i.bulkDataURI({BulkDataURI:a.replace("wadors:",""),defaultType:"image/jpeg",mediaTypes:["image/jpeg"],thumbnail:!0})],{type:"image/jpeg"}))}:function(){return console.warn(`Unsupported thumbnailRendering "${o}"; returning null thumbnail src.`),null}:function(){return console.warn("thumbnailRendering is not configured; returning null thumbnail src."),null}}({thumbnailContext:t,imageId:r,config:e,getAuthorizationHeader:s,qidoDicomWebClient:o,retrieve:this})},directURL:t=>e_({wadoRoot:e.wadoRoot,singlepart:e.singlepart},t),renderedURL:(t,r)=>(function({config:e,getAuthorizationHeader:t,retrieve:r,userAuthenticationService:n}){return async function(a,i={}){return eA({url:await r.directURL(a),wadoRoot:e.wadoRoot,headers:t(),signal:i.signal,userAuthenticationService:n})}})({config:e,getAuthorizationHeader:s,retrieve:f.retrieve,userAuthenticationService:u})(t,r),getWadoDicomWebClient:()=>o,prefetchInstanceFrames:({instance:e,imageId:t})=>{let r={done:Promise.resolve(!1),cancel:()=>{}};if(!e||!t)return r;let n=e.StudyInstanceUID,a=e.SeriesInstanceUID,i=e.SOPInstanceUID||e.SopInstanceUID;if(!n||!a||!i)return r;let l=!1,u=async()=>{o.headers=s();let e=await o.retrieveInstance({studyInstanceUID:n,seriesInstanceUID:a,sopInstanceUID:i});if(l)throw Error("prefetchInstanceFrames cancelled");if(e instanceof ArrayBuffer)return e;if(Array.isArray(e)&&e[0]instanceof ArrayBuffer)return e[0];if(e&&e.buffer instanceof ArrayBuffer)return e.buffer;throw Error("Unexpected retrieveInstance result for instance prefetch")};return{done:(async()=>{try{return await eu().prefetchPart10Instance(t,u),!l}catch(e){return console.warn("[prefetchInstanceFrames] full-instance prefetch failed; falling back to per-frame loads",e),!1}})(),cancel:()=>{l=!0}}},bulkDataURI:async({StudyInstanceUID:e,BulkDataURI:t})=>(o.headers=s(),o.retrieveBulkData({multipart:!1,BulkDataURI:t,StudyInstanceUID:e}).then(e=>e&&e[0]||void 0)),series:{metadata:async({StudyInstanceUID:t,filters:r,sortCriteria:n,sortFunction:a,madeInClient:i=!1,returnPromises:o=!1}={})=>{if(!t)throw Error("Unable to query for SeriesMetadata without StudyInstanceUID");return e.enableStudyLazyLoad?f._retrieveSeriesMetadataAsync(t,r,n,a,i,o):f._retrieveSeriesMetadataSync(t,r,n,a,i)}}},store:{dicom:async(e,t,r)=>{if(o.headers=s(),e instanceof ArrayBuffer)await o.storeInstances({datasets:[e],request:t});else{let n=r;if(!r){let t=new eU(eF({FileMetaInformationVersion:e._meta?.FileMetaInformationVersion?.Value,MediaStorageSOPClassUID:e.SOPClassUID,MediaStorageSOPInstanceUID:e.SOPInstanceUID,TransferSyntaxUID:ej(e),ImplementationClassUID:"2.25.270695996825855179949881587723571202391.2.0.0",ImplementationVersionName:"OHIF-3.11.0"}));t.dict=eF(e),n=t}let a=n.write(eD);await o.storeInstances({datasets:[a],request:t})}}},_retrieveSeriesMetadataSync:async(t,r,n,a,i)=>{o.headers=l(eV);let u=(await ev(o,t,!1,r,n,a,e)).map(d);o.headers=s(),await K.utils.resolveBulkDataTags(u);let c={},p={};u.forEach(r=>{c[r.SeriesInstanceUID]||(c[r.SeriesInstanceUID]={StudyInstanceUID:r.StudyInstanceUID,StudyDescription:r.StudyDescription,SeriesInstanceUID:r.SeriesInstanceUID,SeriesDescription:r.SeriesDescription,SeriesNumber:r.SeriesNumber,SeriesTime:r.SeriesTime,SOPClassUID:r.SOPClassUID,ProtocolName:r.ProtocolName,Modality:r.Modality}),p[r.SeriesInstanceUID]||(p[r.SeriesInstanceUID]=[]);let n=f.getImageIdsForInstance({instance:r});ek(r,"imageId",n),ek(r,"wadoRoot",e.wadoRoot),ek(r,"wadoUri",e.wadoUri),eB.addImageIdToUIDs(n,{StudyInstanceUID:t,SeriesInstanceUID:r.SeriesInstanceUID,SOPInstanceUID:r.SOPInstanceUID}),p[r.SeriesInstanceUID].push(r)});let h=Object.values(c);return K.DicomMetadataStore.addSeriesMetadata(h,i),Object.keys(p).forEach(e=>K.DicomMetadataStore.addInstances(p[e],i)),c},_retrieveSeriesMetadataAsync:async(t,r,n,a,i=!1,u=!1)=>{o.headers=l(eV);let{preLoadData:c,promises:p}=await ev(o,t,!0,r,n,a,e);async function h(t){let r=t.map(d);o.headers=s(),await K.utils.resolveBulkDataTags(r),r.forEach(t=>{ek(t,"wadoRoot",e.wadoRoot),ek(t,"wadoUri",e.wadoUri);let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a}=t,i=t.NumberOfFrames||1;for(let e=0;e<i;e++){let o=e+1,s=f.getImageIdsForInstance({instance:t,frame:o});eB.addImageIdToUIDs(s,{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a,frameNumber:i>1?o:void 0})}let o=f.getImageIdsForInstance({instance:t});ek(t,"imageId",o)}),K.DicomMetadataStore.addInstances(r,i)}function g(){let e=K.DicomMetadataStore.getStudy(t);e&&(e.isLoaded=!0)}c.forEach(e=>{e.StudyInstanceUID=t}),K.DicomMetadataStore.addSeriesMetadata(c,i);let m=0,y=p.map(e=>{let t;return{metadata:e.metadata,start:()=>(t||(t=e.start().then(async e=>(await h(e),m++,u&&m===p.length&&g(),e))),t)}});return u?(y.length||g(),y):(await Promise.all(y.map(e=>e.start())),g(),c)},deleteStudyMetadataPromise:eb,getImageIdsForDisplaySet(e){let t=e.images,r=[];return t&&e.images.forEach(e=>{let t=e.NumberOfFrames;if(t>1)for(let n=1;n<=t;n++){let t=this.getImageIdsForInstance({instance:e,frame:n});r.push(t)}else{let t=this.getImageIdsForInstance({instance:e});r.push(t)}}),r},getImageIdsForInstance:({instance:t,frame:r})=>ei({instance:t,frame:r,config:e}),getConfig:()=>a,getStudyInstanceUIDs({params:e,query:t}){let r=e.StudyInstanceUIDs||e.studyInstanceUIDs,n=K.utils.splitComma(t.getAll("StudyInstanceUIDs").concat(t.getAll("studyInstanceUIDs"))),a=n.length&&n||r;return a&&Array.isArray(a)?a:[a]}};return e.supportsReject&&(r=e.wadoRoot,n=s,f.reject={series:(e,t)=>new Promise((a,i)=>{let o=`${r}/studies/${e}/series/${t}/reject/113001%5EDCM`,s=new XMLHttpRequest;s.open("POST",o,!0);let l=n();for(let e in l)s.setRequestHeader(e,l[e]);console.log(s),s.onreadystatechange=function(){if(4==s.readyState)switch(s.status){case 200:case 204:a(s.responseText);break;case 404:i("Your dataSource does not support reject functionality");default:i(`Unexpected status code: ${s.status}`)}},s.send()})}),K.IWebApiDataSource.create(f)}var eH=I(8985);function eW(e,t={}){let{allowedOrigins:r=[],userAuthenticationService:n}=t,a=function(e){if(!e||"string"!=typeof e)throw Error('Missing required "url" query parameter');try{return new URL(e,window.location.href)}catch{throw Error('Invalid URL in "url" query parameter')}}(e),i=a.protocol.toLowerCase(),o=a.origin===window.location.origin;if(!["http:","https:"].includes(i))throw Error("Only HTTP(S) URLs are allowed for dynamic datasource configuration");if(a.hash)throw Error("URL fragments are not allowed for dynamic datasource configuration");if(a.username||a.password)throw Error("URL userinfo is not allowed for dynamic datasource configuration");let s=!!n?.getAuthorizationHeader?.()?.Authorization;if(s&&!o){let e=function(e=[]){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).map(e=>{try{let t=new URL(e);if(!["http:","https:"].includes(t.protocol))return console.error(`[secureConfigFetch] Ignoring misconfigured allowed origin "${e}". Entries must use http:// or https://.`),null;if(t.username||t.password||"/"!==t.pathname||t.search||t.hash)return console.error(`[secureConfigFetch] Ignoring misconfigured allowed origin "${e}". Entries must be bare origins only (scheme + host + optional port), with no username/password, path, query, or hash.`),null;return t.origin}catch{return console.error(`[secureConfigFetch] Ignoring misconfigured allowed origin "${e}". Entry is not a valid URL.`),null}}).filter(Boolean):[]}(r);if(!e.length||!e.includes(a.origin))throw Error(`Blocked remote configuration origin "${a.origin}" in authenticated environment`)}return{parsedUrl:a,normalizedUrl:a.toString(),isAuthenticated:s,isSameOrigin:o}}async function e$(e){let{normalizedUrl:t}=e,r=await fetch(t,{method:"GET",mode:"cors",credentials:"same-origin",redirect:"error",referrerPolicy:"no-referrer"});if(!r.ok)throw Error(`Failed to fetch dynamic datasource configuration (${r.status})`);return r.json()}let eY=J().classes.MetadataProvider,eG={studyInstanceUid:"StudyInstanceUID",patientId:"PatientID"},eq={urls:[],studyInstanceUIDMap:new Map},eX=(e,t)=>{let r=[];return eq.urls.map(n=>{n.studies.map(n=>{n[e]===t&&r.push(n)})}),r};function eK(e,t){let{userAuthenticationService:r}=t.services,n={initialize:async({query:t,url:n})=>{let a,i,o;n||(n=t.get("url"));let s=eW(n,{allowedOrigins:e.dangerouslyAllowedOriginsForAuthenticatedEnvironments,userAuthenticationService:r}),l=(o=s.normalizedUrl,eq.urls.find(e=>e.url===o));if(l)return l.studies.map(e=>e.StudyInstanceUID);let u=await e$(s);u.studies.forEach(t=>{a=t.StudyInstanceUID,t.series.forEach(t=>{i=t.SeriesInstanceUID,t.instances.forEach(t=>{let{metadata:r}=t,n=ei({instance:t,config:e}),{query:o}=eH.parseUrl(t.url);eY.addImageIdToUIDs(n,{StudyInstanceUID:a,SeriesInstanceUID:i,SOPInstanceUID:r.SOPInstanceUID,frameNumber:o.frame?parseInt(o.frame):void 0})})})}),eq.urls.push({url:s.normalizedUrl,studies:[...u.studies]}),eq.studyInstanceUIDMap.set(s.normalizedUrl,u.studies.map(e=>e.StudyInstanceUID))},query:{studies:{mapParams:()=>{},search:async e=>{let[t,r]=Object.entries(e)[0];return eX(eG[t],r).map(e=>({accession:e.AccessionNumber,date:e.StudyDate,description:e.StudyDescription,instances:e.NumInstances,modalities:e.Modalities,mrn:e.PatientID,patientName:e.PatientName,studyInstanceUid:e.StudyInstanceUID,NumInstances:e.NumInstances,time:e.StudyTime}))},processResults:()=>{console.warn(" DICOMJson QUERY processResults not implemented")}},series:{search:()=>{console.warn(" DICOMJson QUERY SERIES SEARCH not implemented")}},instances:{search:()=>{console.warn(" DICOMJson QUERY instances SEARCH not implemented")}}},retrieve:{directURL:t=>e_(e,t),series:{metadata:async({filters:t,StudyInstanceUID:r,madeInClient:n=!1,customSort:a}={})=>{let i;if(!r)throw Error("Unable to query for SeriesMetadata without StudyInstanceUID");let o=eX("StudyInstanceUID",r)[0];i=a?a(o.series):o.series;let s=["SeriesInstanceUID","SeriesInstanceUIDs","seriesInstanceUID","seriesInstanceUIDs"].find(e=>t[e]);if(s){let e=t[s];i=i.filter(t=>e.includes(t.SeriesInstanceUID))}let l=i.map(e=>{let t={StudyInstanceUID:o.StudyInstanceUID,...e};return delete t.instances,t});K.DicomMetadataStore.addSeriesMetadata(l,n);let u=i.length;i.forEach((t,a)=>{var i;i=t.instances.map(r=>{let n={...function e(t){return Object.keys(t).reduce((r,n)=>("object"==typeof t[n]&&null!==t[n]?r[n]=e(t[n]):r[n]=t[n],n.endsWith("Sequence")&&(r[n]=J().utils.addAccessors(r[n])),r),Array.isArray(t)?[]:{})}(r.metadata),url:r.url,imageId:ei({instance:r,config:e}),...t,...o};return delete n.instances,delete n.series,n}),K.DicomMetadataStore.addInstances(i,n),a===u-1&&(K.DicomMetadataStore.getStudy(r,n).isLoaded=!0)})}}},store:{dicom:()=>{console.warn(" DICOMJson store dicom not implemented")}},reject:{},deleteStudyMetadataPromise:()=>{},getImageIdsForDisplaySet(t){let r=t.images,n=[];if(!r)return n;let{StudyInstanceUID:a,SeriesInstanceUID:i}=t,o=eX("StudyInstanceUID",a)[0].series.find(e=>e.SeriesInstanceUID===i)||{},s=new Map;return o.instances&&o.instances.forEach(e=>{if(e?.metadata?.SOPInstanceUID){let{metadata:t,url:r}=e,n=s.get(t.SOPInstanceUID)||[];n.push({...t,url:r}),s.set(t.SOPInstanceUID,n)}}),t.images.forEach(t=>{let r=t.NumberOfFrames||1,a=s.get(t.SOPInstanceUID)||[t];for(let t=0;t<r;t++){let i=ei({instance:a[Math.min(t,a.length-1)],frame:r>1?t:void 0,config:e});n.push(i)}}),n},getImageIdsForInstance:({instance:e,frame:t})=>ei({instance:e,frame:t}),getStudyInstanceUIDs:({params:t,query:n})=>{let a=n.get("url");if(a)try{let t=eW(a,{allowedOrigins:e.dangerouslyAllowedOriginsForAuthenticatedEnvironments,userAuthenticationService:r});return eq.studyInstanceUIDMap.get(t.normalizedUrl)}catch{return}},getConfig:()=>e};return K.IWebApiDataSource.create(n)}function eJ(e,t){let r=e.split("&frame=")[0].split("?frame=")[0],n=r.includes("?")?"&":"?";return`${r}${n}frame=${t}`}let eZ=J().classes.MetadataProvider,{EVENTS:eQ}=K.DicomMetadataStore,e0={SR:!0,SEG:!0,DOC:!0},e1=(e,t,r=0)=>e===t?r:e<t?-1:1,e2=(e,t)=>{let r=e.instances[0],n=t.instances[0],a=r.Modality,i=n.Modality,o=e0[a],s=e0[i];return o&&s?e1(r.SeriesNumber,n.SeriesNumber):o||s?o?-1:1:e1(n.SeriesNumber,r.SeriesNumber)};function e3(e){let{name:t}=e;return K.IWebApiDataSource.create({initialize:({params:e,query:t})=>{},query:{studies:{mapParams:()=>{},search:e=>K.DicomMetadataStore.getStudyInstanceUIDs().map(e=>{let t=0,r=new Set,n=K.DicomMetadataStore.getStudy(e);n.series.forEach(e=>{t+=e.instances.length,r.add(e.instances[0].Modality)});let a=n?.series[0]?.instances[0];if(a)return{accession:a.AccessionNumber,date:a.StudyDate,description:a.StudyDescription,mrn:a.PatientID,patientName:K.utils.formatPN(a.PatientName),studyInstanceUid:a.StudyInstanceUID,time:a.StudyTime,instances:t,modalities:Array.from(r).join("/"),NumInstances:t}}),processResults:()=>{console.warn(" DICOMLocal QUERY processResults not implemented")}},series:{search:e=>K.DicomMetadataStore.getStudy(e).series.map(t=>{let r=t?.instances[0];return{studyInstanceUid:e,seriesInstanceUid:r.SeriesInstanceUID,modality:r.Modality,seriesNumber:r.SeriesNumber,seriesDate:r.SeriesDate,numSeriesInstances:t.instances.length,description:r.SeriesDescription}})},instances:{search:()=>{console.warn(" DICOMLocal QUERY instances SEARCH not implemented")}}},retrieve:{directURL:e=>{let{instance:t,tag:r,defaultType:n}=e,a=t[r];if(a instanceof Array&&a[0]instanceof ArrayBuffer)return URL.createObjectURL(new Blob([a[0]],{type:n}))},series:{metadata:async({StudyInstanceUID:e,madeInClient:t=!1}={})=>{if(!e)throw Error("Unable to query for SeriesMetadata without StudyInstanceUID");let r=K.DicomMetadataStore.getStudy(e,t);K.DicomMetadataStore._broadcastEvent(eQ.SERIES_ADDED,{StudyInstanceUID:e,madeInClient:t}),r.series.forEach(r=>{let{SeriesInstanceUID:n}=r,a=r.instances[0].NumberOfFrames>1;r.instances.forEach((e,t)=>{let{url:r,StudyInstanceUID:n,SeriesInstanceUID:i,SOPInstanceUID:o}=e;ek(e,"imageId",r),eC(e),eZ.addImageIdToUIDs(r,{StudyInstanceUID:n,SeriesInstanceUID:i,SOPInstanceUID:o,frameNumber:a?t+1:1})}),K.DicomMetadataStore._broadcastEvent(eQ.INSTANCES_ADDED,{StudyInstanceUID:e,SeriesInstanceUID:n,madeInClient:t})})}}},store:{dicom:e=>{let t=eE(e);var r=URL.createObjectURL(t);window.location.assign(r)}},getImageIdsForDisplaySet(e){let t=e.images,r=[];return t&&e.images.forEach(e=>{let t=e.NumberOfFrames;if(t>1)for(let n=1;n<=t;n++){let t=this.getImageIdsForInstance({instance:e,frame:n});r.push(t)}else{let t=this.getImageIdsForInstance({instance:e});r.push(t)}}),r},getImageIdsForInstance({instance:e,frame:t}){let{StudyInstanceUID:r,SeriesInstanceUID:n}=e,a=e.SOPInstanceUID||e.SopInstanceUID,i=K.DicomMetadataStore.getInstance(r,n,a),o=i?.url||e.url;return o?(Number(i?.NumberOfFrames||e.NumberOfFrames)||1)>1?eJ(o,void 0!==t?t:1):o:void 0},deleteStudyMetadataPromise(){console.log("deleteStudyMetadataPromise not implemented")},getStudyInstanceUIDs:({params:e,query:t})=>{let{StudyInstanceUIDs:r}=e,n=t.getAll("StudyInstanceUIDs")||r,a=n&&Array.isArray(n)?n:[n],i=!1;return a.forEach(e=>{let t=K.DicomMetadataStore.getStudy(e);t&&(t.series=t.series.sort(e2),i=!0)}),i?a:[]}})}function e4(e,t){let r,{name:n}=e,{userAuthenticationService:a}=t.services;return K.IWebApiDataSource.create({initialize:async({params:i,query:o})=>{let s=o.get("url");if(s){let n=eW(s,{allowedOrigins:e.dangerouslyAllowedOriginsForAuthenticatedEnvironments,userAuthenticationService:a}),l=await e$(n);if(!l.servers?.dicomWeb?.[0])throw Error("Invalid configuration returned by url");(r=ez(l.servers.dicomWeb[0].configuration||l.servers.dicomWeb[0],t)).initialize({params:i,query:o})}else throw Error(`No url for '${n}'`)},query:{studies:{search:e=>r.query.studies.search(e)},series:{search:(...e)=>r.query.series.search(...e)},instances:{search:(e,t)=>r.query.instances.search(e,t)}},retrieve:{getGetThumbnailSrc:(...e)=>r.retrieve.getGetThumbnailSrc(...e),directURL:(...e)=>r.retrieve.directURL(...e),renderedURL:(...e)=>r.retrieve.renderedURL(...e),series:{metadata:async(...e)=>r.retrieve.series.metadata(...e)}},store:{dicom:(...e)=>r.store.dicom(...e)},reject:{series:(...e)=>r?.reject?.series?.(...e)},deleteStudyMetadataPromise:(...e)=>r?.deleteStudyMetadataPromise?.(...e),getImageIdsForDisplaySet:(...e)=>r?.getImageIdsForDisplaySet?.(...e),getImageIdsForInstance:(...e)=>r?.getImageIdsForInstance?.(...e),getConfig:(...e)=>r?.getConfig?.(...e)??{dicomUploadEnabled:!1},getStudyInstanceUIDs({params:e,query:t}){let r=t.get("studyInstanceUIDs")||t.get("studyInstanceUids");if(!r)throw Error(`No studyInstanceUids in request for '${n}'`);return r.split(";")}})}var e5=I(3008),e8=I.n(e5),e6=I(3424),e9=I.n(e6);let e7={"query.studies.search":{mergeKey:"studyInstanceUid",tagFunc:e=>e},"query.series.search":{mergeKey:"seriesInstanceUid",tagFunc:(e,t)=>(e.forEach(e=>{e.RetrieveAETitle=t,K.DicomMetadataStore.updateSeriesMetadata(e)}),e)}},te=async({mergeMap:e,path:t,args:r,extensionManager:n,dataSourceNames:a,defaultDataSourceName:i})=>{let{mergeKey:o,tagFunc:s}=e[t]||{tagFunc:e=>e},l=Object.values(n.dataSourceDefs),u=l.find(e=>e.sourceName===i),c=l.filter(e=>e.sourceName!==i);u&&c.unshift(u);let d=[],f=[];for(let e of c){let{configuration:i,sourceName:o}=e;if(i&&a.includes(o)){let[e]=n.getDataSources(o),a=e8()(e,t).apply(e,r);d.push(a),f.push(o)}}let p=(await Promise.allSettled(d)).map((e,t)=>s(e.value,f[t]));return o?e9()(p.flat(),e=>e8()(e,o)):p.flat()},tt=({path:e,args:t,extensionManager:r,dataSourceNames:n,defaultDataSourceName:a})=>{let i=Object.values(r.dataSourceDefs),o=i.find(e=>e.sourceName===a),s=i.filter(e=>e.sourceName!==a);o&&s.unshift(o);let l=[];for(let a of s){let{configuration:i,sourceName:o}=a;if(i&&n.includes(o)){let[n]=r.getDataSources(o),a=e8()(n,e).apply(n,t);l.push(a)}}return l.flat()},tr=({path:e,args:t,defaultDataSourceName:r,extensionManager:n})=>{let[a]=n.getDataSources(r);return e8()(a,e).apply(a,t)},tn=({path:e,args:t,defaultDataSourceName:r,extensionManager:n})=>{let[a]=t,i=K.DicomMetadataStore.getSeries(a.StudyInstanceUID,a.SeriesInstanceUID),[o]=n.getDataSources(i.RetrieveAETitle||r);return o[e](...t)};function ta(e,t,r){let{seriesMerge:n}=e,{dataSourceNames:a,defaultDataSourceName:i}=n;return K.IWebApiDataSource.create({initialize:(...e)=>tt({path:"initialize",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i}),query:{studies:{search:(...e)=>te({mergeMap:e7,path:"query.studies.search",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})},series:{search:(...e)=>te({mergeMap:e7,path:"query.series.search",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})},instances:{search:(...e)=>te({mergeMap:e7,path:"query.instances.search",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})}},retrieve:{getGetThumbnailSrc:(...e)=>tr({path:"retrieve.getGetThumbnailSrc",args:e,defaultDataSourceName:i,extensionManager:r}),bulkDataURI:(...e)=>te({mergeMap:e7,path:"retrieve.bulkDataURI",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i}),directURL:(...e)=>tr({path:"retrieve.directURL",args:e,defaultDataSourceName:i,extensionManager:r}),renderedURL:(...e)=>{let[t]=r.getDataSources(i),n=e8()(t,"retrieve.renderedURL");if(n)return n.apply(t,e);let a=e8()(t,"retrieve.directURL");return a?Promise.resolve(a.apply(t,[e[0]])).then(e=>({url:e||null})):Promise.resolve({url:null})},series:{metadata:(...e)=>te({mergeMap:e7,path:"retrieve.series.metadata",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})}},store:{dicom:(...e)=>tr({path:"store.dicom",args:e,defaultDataSourceName:i,extensionManager:r})},deleteStudyMetadataPromise:(...e)=>tt({path:"deleteStudyMetadataPromise",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i}),getImageIdsForDisplaySet:(...e)=>tn({path:"getImageIdsForDisplaySet",args:e,defaultDataSourceName:i,extensionManager:r}),getImageIdsForInstance:(...e)=>tn({path:"getImageIdsForDisplaySet",args:e,defaultDataSourceName:i,extensionManager:r}),getStudyInstanceUIDs:(...e)=>tt({path:"getStudyInstanceUIDs",args:e,extensionManager:r,dataSourceNames:a,defaultDataSourceName:i})})}var ti=I(2184),to=I(6326),ts=I.t(to,2),tl=I(55),tu=I(6870);let tc=(0,to.createContext)(null),{Provider:td}=tc,tf=()=>(0,to.useContext)(tc);function tp(){return(tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function th(e,t){if(!1===e||null==e)throw Error(t)}function tg(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}(r=P||(P={})).Pop="POP",r.Push="PUSH",r.Replace="REPLACE",(n=A||(A={})).data="data",n.deferred="deferred",n.redirect="redirect",n.error="error";let tm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ty(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function tv(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field [")+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function tb(){return(tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}Symbol("deferred");let tx=to.createContext(null),tS=to.createContext(null),tw=to.createContext(null),t_=to.createContext({outlet:null,matches:[],isDataRoute:!1});function tI(){return null!=to.useContext(tw)}function tD(){return tI()||th(!1),to.useContext(tw).location}function tO(e){to.useContext(tS).static||to.useLayoutEffect(e)}function tk(){let{isDataRoute:e}=to.useContext(t_);return e?function(){let e,t,r,n,{router:a}=(tC.UseNavigateStable,(e=to.useContext(tx))||th(!1),e),i=(tj.UseNavigateStable,(n=((t=to.useContext(t_))||th(!1),r=t).matches[r.matches.length-1]).route.id||th(!1),n.route.id),o=to.useRef(!1);return tO(()=>{o.current=!0}),to.useCallback(function(e,t){void 0===t&&(t={}),o.current&&("number"==typeof e?a.navigate(e):a.navigate(e,tb({fromRouteId:i},t)))},[a,i])}():function(){var e,t;let r;tI()||th(!1);let n=to.useContext(tx),{basename:a,future:i,navigator:o}=to.useContext(tS),{matches:s}=to.useContext(t_),{pathname:l}=tD(),u=JSON.stringify((e=s,t=i.v7_relativeSplatPath,r=e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0),t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase))),c=to.useRef(!1);return tO(()=>{c.current=!0}),to.useCallback(function(e,t){if(void 0===t&&(t={}),!c.current)return;if("number"==typeof e)return void o.go(e);let r=function(e,t,r,n){let a,i;void 0===n&&(n=!1),"string"==typeof e?a=tg(e):(th(!(a=tp({},e)).pathname||!a.pathname.includes("?"),tv("?","pathname","search",a)),th(!a.pathname||!a.pathname.includes("#"),tv("#","pathname","hash",a)),th(!a.search||!a.search.includes("#"),tv("#","search","hash",a)));let o=""===e||""===a.pathname,s=o?"/":a.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t){let r,n,a;void 0===t&&(t="/");let{pathname:i,search:o="",hash:s=""}="string"==typeof e?tg(e):e;if(i){let e;if(e=i,tm.test(e))r=i;else{if(i.includes("//")){var l="Pathnames cannot have embedded double slashes - normalizing "+i+" -> "+(i=i.replace(/\/\/+/g,"/"));"u">typeof console&&console.warn(l);try{throw Error(l)}catch(e){}}r=i.startsWith("/")?ty(i.substring(1),"/"):ty(i,t)}}else r=t;return{pathname:r,search:(n=o)&&"?"!==n?n.startsWith("?")?n:"?"+n:"",hash:(a=s)&&"#"!==a?a.startsWith("#")?a:"#"+a:""}}(a,i),u=s&&"/"!==s&&s.endsWith("/"),c=(o||"."===s)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}(e,JSON.parse(u),l,"path"===t.relative);null==n&&"/"!==a&&(r.pathname="/"===r.pathname?a:[a,r.pathname].join("/").replace(/\/\/+/g,"/")),(t.replace?o.replace:o.push)(r,t.state,t)},[a,o,u,l,n])}()}to.Component;var tC=((a=tC||{}).UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a),tj=((i=tj||{}).UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i);ts.startTransition;var tE=((o=tE||{})[o.pending=0]="pending",o[o.success=1]="success",o[o.error=2]="error",o);function tM(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function tR(e){return(tR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tP(e){var t=function(e,t){if("object"!=tR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=tR(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tR(t)?t:t+""}function tA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tP(n.key),n)}}function tT(e,t,r){return t&&tA(e.prototype,t),r&&tA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}new Promise(()=>{}),to.Component,I(9741),Object.create(null);var tN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,tU={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},tL=function(e){return tU[e]},tF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(tN,tL)}},tB=(0,to.createContext)(),tV=function(){function e(){tM(this,e),this.usedNamespaces={}}return tT(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach(function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function tz(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tH(e,t,r){return(t=tP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tW(){if(console&&console.warn){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var t$={};function tY(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&t$[t[0]]||("string"==typeof t[0]&&(t$[t[0]]=new Date),tW.apply(void 0,t))}var tG=function(e,t){return function(){e.isInitialized?t():e.on("initialized",function r(){setTimeout(function(){e.off("initialized",r)},0),t()})}};function tq(e,t,r){e.loadNamespaces(t,tG(e,r))}function tX(e,t,r,n){"string"==typeof r&&(r=[r]),r.forEach(function(t){0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,tG(e,n))}function tK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tK(Object(r),!0).forEach(function(t){tH(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tK(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var tZ=function(e,t){var r=(0,to.useRef)();return(0,to.useEffect)(function(){r.current=t?r.current:e},[e,t]),r.current};function tQ(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.i18n,a=(0,to.useContext)(tB)||{},i=a.i18n,o=a.defaultNS,s=n||i||T;if(s&&!s.reportNamespaces&&(s.reportNamespaces=new tV),!s){tY("You will need to pass in an i18next instance by using initReactI18next");var l=function(e,t){return"string"==typeof t?t:t&&"object"===tR(t)&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},u=[l,{},!1];return u.t=l,u.i18n={},u.ready=!1,u}s.options.react&&void 0!==s.options.react.wait&&tY("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=tJ(tJ(tJ({},tF),s.options.react),r),d=c.useSuspense,f=c.keyPrefix,p=e||o||s.options&&s.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);var h=(s.isInitialized||s.initializedStoreOnce)&&p.every(function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0===t.options.ignoreJSONStructure?function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],a=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return -1===n||2===n};return(!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1)||!t.services.backendConnector.backend||!t.isLanguageChangingTo||!!o(t.isLanguageChangingTo,e))&&!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!a||o(i,e)))}(e,t,r):t.hasLoadedNamespace(e,{lng:r.lng,precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(tY("i18n.languages were undefined or empty",t.languages),!0)}(e,s,c)});function g(){return s.getFixedT(r.lng||null,"fallback"===c.nsMode?p:p[0],f)}var m=function(e){if(Array.isArray(e))return e}(t=(0,to.useState)(g))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,a,i,o=[],s=!0,l=!1;try{a=(t=t.call(e)).next,!1;for(;!(s=(r=a.call(t)).done)&&(o.push(r.value),2!==o.length);s=!0);}catch(e){l=!0,n=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return tz(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?tz(e,2):void 0}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=m[0],v=m[1],b=p.join();r.lng&&(b="".concat(r.lng).concat(b));var x=tZ(b),S=(0,to.useRef)(!0);(0,to.useEffect)(function(){var e=c.bindI18n,t=c.bindI18nStore;function n(){S.current&&v(g)}return S.current=!0,h||d||(r.lng?tX(s,r.lng,p,function(){S.current&&v(g)}):tq(s,p,function(){S.current&&v(g)})),h&&x&&x!==b&&S.current&&v(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){S.current=!1,e&&s&&e.split(" ").forEach(function(e){return s.off(e,n)}),t&&s&&t.split(" ").forEach(function(e){return s.store.off(e,n)})}},[s,b]);var w=(0,to.useRef)(!0);(0,to.useEffect)(function(){S.current&&!w.current&&v(g),w.current=!1},[s,f]);var _=[y,s,h];if(_.t=y,_.i18n=s,_.ready=h,h||!h&&!d)return _;throw new Promise(function(e){r.lng?tX(s,r.lng,p,function(){return e()}):tq(s,p,function(){return e()})})}function t0(e){let t,r,n,a=(0,ti.c)(14),{buttonSection:i,viewportId:o,location:s}=e,l=void 0===i?"primary":i;a[0]!==l?(t={buttonSection:l},a[0]=l,a[1]=t):t=a[1];let{toolbarButtons:u,onInteraction:c,isItemOpen:d,isItemLocked:f,openItem:p,closeItem:h,toggleLock:g}=(0,K.useToolbar)(t);return u.length?(a[2]!==h||a[3]!==f||a[4]!==d||a[5]!==s||a[6]!==c||a[7]!==p||a[8]!==g||a[9]!==u||a[10]!==o?(r=u?.map(e=>{if(!e)return null;let{id:t,Component:r,componentProps:n}=e,a={...n,isOpen:d(t,o),isLocked:f(t,o),onOpen:()=>p(t,o),onClose:()=>h(t,o),onToggleLock:()=>g(t,o),viewportId:o},i=(0,tu.jsx)(r,{id:t,location:s,onInteraction:e=>{c({...e,itemId:t,viewportId:o})},...a},t);return(0,tu.jsx)("div",{className:"contents",children:i},t)}),a[2]=h,a[3]=f,a[4]=d,a[5]=s,a[6]=c,a[7]=p,a[8]=g,a[9]=u,a[10]=o,a[11]=r):r=a[11],a[12]!==r?(n=(0,tu.jsx)(tu.Fragment,{children:r}),a[12]=r,a[13]=n):n=a[13],n):null}var t1=I(8500);function t2(e,t){return(0,tu.jsx)(e,{},t)}let t3=function(e){let t,r,n,a,i,o,s,l,u,c,d=(0,ti.c)(37),{appConfig:f}=e,{servicesManager:p,extensionManager:h}=(0,K.useSystem)(),{customizationService:g}=p.services,m=tk(),y=tD();d[0]!==g||d[1]!==h||d[2]!==y||d[3]!==m?(t=()=>{let{pathname:e}=y,t=e.indexOf("/",1),r=e.substring(t+1),n=h.getDataSources(r),a=new URLSearchParams;-1!==t&&n&&a.append("datasources",e.substring(t+1)),(0,t1.preserveQueryParameters)(a,g),m({pathname:"/",search:decodeURIComponent(a.toString())})},d[0]=g,d[1]=h,d[2]=y,d[3]=m,d[4]=t):t=d[4];let v=t,{t:b}=tQ(),{show:x}=(0,tl.useModal)();if(d[5]!==f.oidc||d[6]!==f.showStudyList||d[7]!==f.whiteLabeling||d[8]!==g||d[9]!==m||d[10]!==v||d[11]!==x||d[12]!==b){let e=g.getCustomization("ohif.aboutModal"),t=g.getCustomization("ohif.appearanceModal"),u=g.getCustomization("ohif.userPreferencesModal"),c=g.getCustomization("ohif.headerRightSide")?.items??[],p=[{title:e?.menuTitle??b("Header:About"),icon:"info",onClick:()=>x({content:e,title:e?.title??b("AboutModal:About OHIF Viewer"),containerClassName:e?.containerClassName??"max-w-md"})},{title:u.menuTitle??b("Header:Preferences"),icon:"settings",onClick:()=>x({content:u,title:u.title??b("UserPreferencesModal:User preferences"),containerClassName:u?.containerClassName??"flex max-w-4xl p-6 flex-col"})}];if(t&&p.splice(1,0,{title:t.menuTitle??b("Header:Appearance"),icon:"ColorChange",onClick:()=>x({content:t,title:t.title??b("AppearanceModal:Appearance"),containerClassName:t.containerClassName??"max-w-md"})}),f.oidc){let e,t,r;d[20]!==b?(e=b("Header:Logout"),d[20]=b,d[21]=e):e=d[21],d[22]!==m?(t=async()=>{m(`/logout?redirect_uri=${encodeURIComponent(window.location.href)}`)},d[22]=m,d[23]=t):t=d[23],d[24]!==e||d[25]!==t?(r={title:e,icon:"power-off",onClick:t},d[24]=e,d[25]=t,d[26]=r):r=d[26],p.push(r)}r=tl.Header,n=p,a=!!f.showStudyList,i=v,o=f.whiteLabeling,d[27]===Symbol.for("react.memo_cache_sentinel")?(s=(0,tu.jsx)(t0,{buttonSection:"secondary"}),d[27]=s):s=d[27],l=c.map(t2),d[5]=f.oidc,d[6]=f.showStudyList,d[7]=f.whiteLabeling,d[8]=g,d[9]=m,d[10]=v,d[11]=x,d[12]=b,d[13]=r,d[14]=n,d[15]=a,d[16]=i,d[17]=o,d[18]=s,d[19]=l}else r=d[13],n=d[14],a=d[15],i=d[16],o=d[17],s=d[18],l=d[19];return d[28]===Symbol.for("react.memo_cache_sentinel")?(u=(0,tu.jsx)("div",{className:"relative flex justify-center gap-[4px]",children:(0,tu.jsx)(t0,{buttonSection:"primary"})}),d[28]=u):u=d[28],d[29]!==r||d[30]!==n||d[31]!==a||d[32]!==i||d[33]!==o||d[34]!==s||d[35]!==l?(c=(0,tu.jsx)(r,{menuOptions:n,isReturnEnabled:a,onClickReturnButton:i,WhiteLabeling:o,Secondary:s,RightSide:l,children:u}),d[29]=r,d[30]=n,d[31]=a,d[32]=i,d[33]=o,d[34]=s,d[35]=l,d[36]=c):c=d[36],c},t4=e=>{let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w=(0,ti.c)(45);w[0]!==e?({servicesManager:o,side:s,activeTabIndex:t,isExpanded:r,tabs:l,onOpen:a,onClose:n,...i}=e,w[0]=e,w[1]=t,w[2]=r,w[3]=n,w[4]=a,w[5]=i,w[6]=o,w[7]=s,w[8]=l):(t=w[1],r=w[2],n=w[3],a=w[4],i=w[5],o=w[6],s=w[7],l=w[8]);let{panelService:_,toolbarService:I,viewportGridService:D}=o.services,[O,k]=(0,to.useState)(r),[C,j]=(0,to.useState)(t??0),[E,M]=(0,to.useState)(!1);w[9]!==_||w[10]!==s||w[11]!==l?(u=l??_.getPanels(s),w[9]=_,w[10]=s,w[11]=l,w[12]=u):u=w[12];let[R,P]=(0,to.useState)(u);w[13]!==I||w[14]!==D?(c=e=>{let{activeTabIndex:t}=e,{activeViewportId:r}=D.getState();I.refreshToolbarState({viewportId:r}),j(t)},w[13]=I,w[14]=D,w[15]=c):c=w[15];let A=c;w[16]!==a?(d=()=>{k(!0),a?.()},w[16]=a,w[17]=d):d=w[17];let T=d;w[18]!==n?(f=()=>{k(!1),M(!0),n?.()},w[18]=n,w[19]=f):f=w[19];let N=f;return w[20]!==r?(p=()=>{k(r)},h=[r],w[20]=r,w[21]=p,w[22]=h):(p=w[21],h=w[22]),(0,to.useEffect)(p,h),w[23]!==t?(g=()=>{j(t??0)},m=[t],w[23]=t,w[24]=g,w[25]=m):(g=w[24],m=w[25]),(0,to.useEffect)(g,m),w[26]!==_||w[27]!==s?(v=()=>{let{unsubscribe:e}=_.subscribe(_.EVENTS.PANELS_CHANGED,e=>{e.position===s&&P(_.getPanels(s))});return()=>{e()}},y=[_,s],w[26]=_,w[27]=s,w[28]=y,w[29]=v):(y=w[28],v=w[29]),(0,to.useEffect)(v,y),w[30]!==E||w[31]!==_||w[32]!==O||w[33]!==R?(b=()=>{let e=_.subscribe(_.EVENTS.ACTIVATE_PANEL,e=>{if(O||e.forceActive){let t=R.findIndex(t=>t.id===e.panelId);-1!==t&&(E||k(!0),j(t))}});return()=>{e.unsubscribe()}},x=[R,O,_,E],w[30]=E,w[31]=_,w[32]=O,w[33]=R,w[34]=b,w[35]=x):(b=w[34],x=w[35]),(0,to.useEffect)(b,x),w[36]!==C||w[37]!==A||w[38]!==N||w[39]!==T||w[40]!==i||w[41]!==s||w[42]!==O||w[43]!==R?(S=(0,tu.jsx)(tl.SidePanel,{...i,side:s,tabs:R,activeTabIndex:C,isExpanded:O,onOpen:T,onClose:N,onActiveTabIndexChange:A}),w[36]=C,w[37]=A,w[38]=N,w[39]=T,w[40]=i,w[41]=s,w[42]=O,w[43]=R,w[44]=S):S=w[44],S},t5=(0,to.createContext)(null);t5.displayName="PanelGroupContext";let t8="data-panel-group-id",t6="data-panel-resize-handle-id",t9=to.useLayoutEffect,t7=ts["useId".toString()],re="function"==typeof t7?t7:()=>null,rt=0;function rr(e=null){let t=re(),r=(0,to.useRef)(e||t||null);return null===r.current&&(r.current=""+rt++),null!=e?e:r.current}function rn({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:i,id:o,maxSize:s,minSize:l,onCollapse:u,onExpand:c,onResize:d,order:f,style:p,tagName:h="div",...g}){let m=(0,to.useContext)(t5);if(null===m)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:y,expandPanel:v,getPanelSize:b,getPanelStyle:x,groupId:S,isPanelCollapsed:w,reevaluatePanelConstraints:_,registerPanel:I,resizePanel:D,unregisterPanel:O}=m,k=rr(o),C=(0,to.useRef)({callbacks:{onCollapse:u,onExpand:c,onResize:d},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:s,minSize:l},id:k,idIsFromProps:void 0!==o,order:f});(0,to.useRef)({didLogMissingDefaultSizeWarning:!1}),t9(()=>{let{callbacks:e,constraints:t}=C.current,i={...t};C.current.id=k,C.current.idIsFromProps=void 0!==o,C.current.order=f,e.onCollapse=u,e.onExpand=c,e.onResize=d,t.collapsedSize=r,t.collapsible=n,t.defaultSize=a,t.maxSize=s,t.minSize=l,(i.collapsedSize!==t.collapsedSize||i.collapsible!==t.collapsible||i.maxSize!==t.maxSize||i.minSize!==t.minSize)&&_(C.current,i)}),t9(()=>{let e=C.current;return I(e),()=>{O(e)}},[f,k,I,O]),(0,to.useImperativeHandle)(i,()=>({collapse:()=>{y(C.current)},expand:e=>{v(C.current,e)},getId:()=>k,getSize:()=>b(C.current),isCollapsed:()=>w(C.current),isExpanded:()=>!w(C.current),resize:e=>{D(C.current,e)}}),[y,v,b,w,k,D]);let j=x(C.current,a);return(0,to.createElement)(h,{...g,children:e,className:t,id:k,style:{...j,...p},[t8]:S,"data-panel":"","data-panel-collapsible":n||void 0,"data-panel-id":k,"data-panel-size":parseFloat(""+j.flexGrow).toFixed(1)})}let ra=(0,to.forwardRef)((e,t)=>(0,to.createElement)(rn,{...e,forwardedRef:t}));rn.displayName="Panel",ra.displayName="forwardRef(Panel)";function ri(e){return"keydown"===e.type}function ro(e){return e.type.startsWith("pointer")}function rs(e){return e.type.startsWith("mouse")}function rl(e){if(ro(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(rs(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let ru=1,rc=2,rd=4,rf=8,rp="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),rh=new Map,rg=new Map,rm=new Set;new AbortController;function ry(e,t){if(!e)throw console.error(t),Error(t)}function rv(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function rb(e,t,r=10){return 0===rv(e,t,r)}function rx(e,t,r){return 0===rv(e,t,r)}function rS({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];ry(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,maxSize:o=100,minSize:s=0}=n;return 0>rv(r,s)&&(r=i&&0>rv(r,(a+s)/2)?a:s),r=parseFloat((r=Math.min(o,r)).toFixed(10))}function rw({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(rx(e,0))return t;let o=[...t],[s,l]=n;ry(null!=s,"Invalid first pivot index"),ry(null!=l,"Invalid second pivot index");let u=0;if("keyboard"===i){{let n=e<0?l:s,a=r[n];ry(a,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:u=0}=a;if(o){let r=t[n];if(ry(null!=r,`Previous layout not found for panel index ${n}`),rx(r,i)){let t=u-r;rv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,a=r[n];ry(a,`No panel constraints found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:u=0}=a;if(o){let r=t[n];if(ry(null!=r,`Previous layout not found for panel index ${n}`),rx(r,u)){let t=r-i;rv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?l:s,i=0;for(;;){let e=t[a];if(ry(null!=e,`Previous layout not found for panel index ${a}`),i+=rS({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let o=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-o:o}{let n=e<0?s:l;for(;n>=0&&n<r.length;){let a=Math.abs(e)-Math.abs(u),i=t[n];ry(null!=i,`Previous layout not found for panel index ${n}`);let s=rS({panelConstraints:r,panelIndex:n,size:i-a});if(!rx(i,s)&&(u+=i-s,o[n]=s,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?n--:n++}}if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!rx(e[r],t[r],void 0))return!1;return!0}(a,o))return a;{let n=e<0?l:s,a=t[n];ry(null!=a,`Previous layout not found for panel index ${n}`);let i=a+u,c=rS({panelConstraints:r,panelIndex:n,size:i});if(o[n]=c,!rx(c,i)){let t=i-c,n=e<0?l:s;for(;n>=0&&n<r.length;){let a=o[n];ry(null!=a,`Previous layout not found for panel index ${n}`);let i=rS({panelConstraints:r,panelIndex:n,size:a+t});if(rx(a,i)||(t-=i-a,o[n]=i),rx(t,0))break;e>0?n--:n++}}}return rx(o.reduce((e,t)=>t+e,0),100)?o:a}function r_(e,t=document){return Array.from(t.querySelectorAll(`[${t6}][data-panel-group-id="${e}"]`))}function rI(e,t,r){let n=function(e,t,r=document){let n=r_(e,r).findIndex(e=>e.getAttribute(t6)===t);return null!=n?n:null}(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function rD(e,t=document){var r;if(t instanceof HTMLElement&&(null==t||null==(r=t.dataset)?void 0:r.panelGroupId)==e)return t;let n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function rO(e,t=document){let r=t.querySelector(`[${t6}="${e}"]`);return r||null}function rk(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function rC(e,t){let{x:r,y:n}=rl(t);return"horizontal"===e?r:n}function rj(e,t,r){t.forEach((t,n)=>{let a=e[n];ry(a,`Panel data not found for index ${n}`);let{callbacks:i,constraints:o,id:s}=a,{collapsedSize:l=0,collapsible:u}=o,c=r[s];if(null==c||t!==c){r[s]=t;let{onCollapse:e,onExpand:n,onResize:a}=i;a&&a(t,c),u&&(e||n)&&(n&&(null==c||rb(c,l))&&!rb(t,l)&&n(),e&&(null==c||!rb(c,l))&&rb(t,l)&&e())}})}function rE(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function rM(e){try{if("u">typeof localStorage)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function rR(e){return`react-resizable-panels:${e}`}function rP(e){return e.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function rA(e,t){try{let r=rR(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}function rT(e,t,r,n,a){var i;let o=rR(e),s=rP(t),l=null!=(i=rA(e,a))?i:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(o,JSON.stringify(l))}catch(e){console.error(e)}}function rN({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!rx(n,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];ry(null!=t,`No layout data found for index ${e}`);let a=100/n*t;r[e]=a}let a=0;for(let e=0;e<t.length;e++){let n=r[e];ry(null!=n,`No layout data found for index ${e}`);let i=rS({panelConstraints:t,panelIndex:e,size:n});n!=i&&(a+=n-i,r[e]=i)}if(!rx(a,0))for(let e=0;e<t.length;e++){let n=r[e];ry(null!=n,`No layout data found for index ${e}`);let i=rS({panelConstraints:t,panelIndex:e,size:n+a});if(n!==i&&(a-=i-n,r[e]=i,rx(a,0)))break}return r}let rU={getItem:e=>(rM(rU),rU.getItem(e)),setItem:(e,t)=>{rM(rU),rU.setItem(e,t)}},rL={};function rF({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:i=null,onLayout:o=null,keyboardResizeBy:s=null,storage:l=rU,style:u,tagName:c="div",...d}){let f=rr(i),p=(0,to.useRef)(null),[h,g]=(0,to.useState)(null),[m,y]=(0,to.useState)([]),v=function(){let[e,t]=(0,to.useState)(0);return(0,to.useCallback)(()=>t(e=>e+1),[])}(),b=(0,to.useRef)({}),x=(0,to.useRef)(new Map),S=(0,to.useRef)(0),w=(0,to.useRef)({autoSaveId:e,direction:n,dragState:h,id:f,keyboardResizeBy:s,onLayout:o,storage:l}),_=(0,to.useRef)({layout:m,panelDataArray:[],panelDataArrayChanged:!1});(0,to.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,to.useImperativeHandle)(a,()=>({getId:()=>w.current.id,getLayout:()=>{let{layout:e}=_.current;return e},setLayout:e=>{let{onLayout:t}=w.current,{layout:r,panelDataArray:n}=_.current,a=rN({layout:e,panelConstraints:n.map(e=>e.constraints)});rk(r,a)||(y(a),_.current.layout=a,t&&t(a),rj(n,a,b.current))}}),[]),t9(()=>{w.current.autoSaveId=e,w.current.direction=n,w.current.dragState=h,w.current.id=f,w.current.onLayout=o,w.current.storage=l}),function({committedValuesRef:e,eagerValuesRef:t,groupId:r,layout:n,panelDataArray:a,panelGroupElement:i,setLayout:o}){(0,to.useRef)({didWarnAboutMissingResizeHandle:!1}),t9(()=>{if(!i)return;let e=r_(r,i);for(let t=0;t<a.length-1;t++){let{valueMax:r,valueMin:i,valueNow:o}=function({layout:e,panelsArray:t,pivotIndices:r}){let n=0,a=100,i=0,o=0,s=r[0];return ry(null!=s,"No pivot index found"),t.forEach((e,t)=>{let{constraints:r}=e,{maxSize:l=100,minSize:u=0}=r;t===s?(n=u,a=l):(i+=u,o+=l)}),{valueMax:Math.min(a,100-i),valueMin:Math.max(n,100-o),valueNow:e[s]}}({layout:n,panelsArray:a,pivotIndices:[t,t+1]}),s=e[t];if(null==s);else{let e=a[t];ry(e,`No panel data found for index "${t}"`),s.setAttribute("aria-controls",e.id),s.setAttribute("aria-valuemax",""+Math.round(r)),s.setAttribute("aria-valuemin",""+Math.round(i)),s.setAttribute("aria-valuenow",null!=o?""+Math.round(o):"")}}return()=>{e.forEach((e,t)=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-valuemax"),e.removeAttribute("aria-valuemin"),e.removeAttribute("aria-valuenow")})}},[r,n,a,i]),(0,to.useEffect)(()=>{if(!i)return;let e=t.current;ry(e,"Eager values not found");let{panelDataArray:a}=e;ry(null!=rD(r,i),`No group found for id "${r}"`);let s=r_(r,i);ry(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute(t6);ry(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var a,i,o,s;let l=rO(t,n),u=r_(e,n),c=l?u.indexOf(l):-1;return[null!=(a=null==(i=r[c])?void 0:i.id)?a:null,null!=(o=null==(s=r[c+1])?void 0:s.id)?o:null]}(r,t,a,i);if(null==s||null==l)return()=>{};let u=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=a.findIndex(e=>e.id===s);if(l>=0){let e=a[l];ry(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:u=0,collapsible:c,minSize:d=0}=e.constraints;if(null!=s&&c){let e=rw({delta:rx(s,u)?d-u:u-s,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:rI(r,t,i),prevLayout:n,trigger:"keyboard"});n!==e&&o(e)}}}};return e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}});return()=>{l.forEach(e=>e())}},[i,e,t,r,n,a,o])}({committedValuesRef:w,eagerValuesRef:_,groupId:f,layout:m,panelDataArray:_.current.panelDataArray,setLayout:y,panelGroupElement:p.current}),(0,to.useEffect)(()=>{let{panelDataArray:t}=_.current;if(e){if(0===m.length||m.length!==t.length)return;let r=rL[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(rT,100),rL[e]=r),r(e,[...t],new Map(x.current),m,l)}},[e,m,l]),(0,to.useEffect)(()=>{});let I=(0,to.useCallback)(e=>{let{onLayout:t}=w.current,{layout:r,panelDataArray:n}=_.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:i=0,panelSize:o,pivotIndices:s}=rz(n,e,r);if(ry(null!=o,`Panel size not found for panel "${e.id}"`),!rb(o,i)){x.current.set(e.id,o);let l=rw({delta:rV(n,e)===n.length-1?o-i:i-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});rE(r,l)||(y(l),_.current.layout=l,t&&t(l),rj(n,l,b.current))}}},[]),D=(0,to.useCallback)((e,t)=>{let{onLayout:r}=w.current,{layout:n,panelDataArray:a}=_.current;if(e.constraints.collapsible){let i=a.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:l=0,pivotIndices:u}=rz(a,e,n),c=null!=t?t:l;if(rb(s,o)){let t=x.current.get(e.id),o=null!=t&&t>=c?t:c,l=rw({delta:rV(a,e)===a.length-1?s-o:o-s,initialLayout:n,panelConstraints:i,pivotIndices:u,prevLayout:n,trigger:"imperative-api"});rE(n,l)||(y(l),_.current.layout=l,r&&r(l),rj(a,l,b.current))}}},[]),O=(0,to.useCallback)(e=>{let{layout:t,panelDataArray:r}=_.current,{panelSize:n}=rz(r,e,t);return ry(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),k=(0,to.useCallback)((e,t)=>{let{panelDataArray:r}=_.current,n=rV(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:i=3}){let o=r[a];return{flexBasis:0,flexGrow:null==o?void 0!=e?e.toPrecision(i):"1":1===n.length?"1":o.toPrecision(i),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:h,layout:m,panelData:r,panelIndex:n})},[h,m]),C=(0,to.useCallback)(e=>{let{layout:t,panelDataArray:r}=_.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=rz(r,e,t);return ry(null!=i,`Panel size not found for panel "${e.id}"`),!0===a&&rb(i,n)},[]),j=(0,to.useCallback)(e=>{let{layout:t,panelDataArray:r}=_.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=rz(r,e,t);return ry(null!=i,`Panel size not found for panel "${e.id}"`),!a||rv(i,n)>0},[]),E=(0,to.useCallback)(e=>{let{panelDataArray:t}=_.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),_.current.panelDataArrayChanged=!0,v()},[v]);t9(()=>{if(_.current.panelDataArrayChanged){_.current.panelDataArrayChanged=!1;let{autoSaveId:r,onLayout:n,storage:a}=w.current,{layout:i,panelDataArray:o}=_.current,s=null;if(r){var e,t;let n=null!=(t=(null!=(e=rA(r,a))?e:{})[rP(o)])?t:null;n&&(x.current=new Map(Object.entries(n.expandToSizes)),s=n.layout)}null==s&&(s=function({panelDataArray:e}){let t=Array(e.length),r=e.map(e=>e.constraints),n=0,a=100;for(let i=0;i<e.length;i++){let e=r[i];ry(e,`Panel constraints not found for index ${i}`);let{defaultSize:o}=e;null!=o&&(n++,t[i]=o,a-=o)}for(let i=0;i<e.length;i++){let o=r[i];ry(o,`Panel constraints not found for index ${i}`);let{defaultSize:s}=o;if(null!=s)continue;let l=a/(e.length-n);n++,t[i]=l,a-=l}return t}({panelDataArray:o}));let l=rN({layout:s,panelConstraints:o.map(e=>e.constraints)});rk(i,l)||(y(l),_.current.layout=l,n&&n(l),rj(o,l,b.current))}}),t9(()=>{let e=_.current;return()=>{e.layout=[]}},[]);let M=(0,to.useCallback)(e=>{let t=!1,r=p.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let i=p.current;if(!i)return()=>null;let{direction:o,dragState:s,id:l,keyboardResizeBy:u,onLayout:c}=w.current,{layout:d,panelDataArray:f}=_.current,{initialLayout:h}=null!=s?s:{},g=rI(l,e,i),m=function(e,t,r,n,a,i){if(ri(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let i=0;switch(e.key){case"ArrowDown":i=t?0:n;break;case"ArrowLeft":i=t?-n:0;break;case"ArrowRight":i=t?n:0;break;case"ArrowUp":i=t?0:-n;break;case"End":i=100;break;case"Home":i=-100}return i}return null==n?0:function(e,t,r,n,a){let i="horizontal"===r,o=rO(t,a);ry(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(t8);ry(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,u=rC(r,e),c=rD(s,a);ry(c,`No group element found for id "${s}"`);let d=c.getBoundingClientRect();return(u-l)/(i?d.width:d.height)*100}(e,t,r,n,i)}(r,e,o,s,u,i),v="horizontal"===o;v&&t&&(m=-m);let x=rw({delta:m,initialLayout:null!=h?h:d,panelConstraints:f.map(e=>e.constraints),pivotIndices:g,prevLayout:d,trigger:ri(r)?"keyboard":"mouse-or-touch"}),I=!rE(d,x);(ro(r)||rs(r))&&S.current!=m&&((S.current=m,I||0===m)?rg.set(e,0):v?(n=m<0?ru:rc,rg.set(e,n)):(a=m<0?rd:rf,rg.set(e,a))),I&&(y(x),_.current.layout=x,c&&c(x),rj(f,x,b.current))}},[]),R=(0,to.useCallback)((e,t)=>{let{onLayout:r}=w.current,{layout:n,panelDataArray:a}=_.current,i=a.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=rz(a,e,n);ry(null!=o,`Panel size not found for panel "${e.id}"`);let l=rw({delta:rV(a,e)===a.length-1?o-t:t-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});rE(n,l)||(y(l),_.current.layout=l,r&&r(l),rj(a,l,b.current))},[]),P=(0,to.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=_.current,{collapsedSize:a=0,collapsible:i}=t,{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:u=0}=e.constraints,{panelSize:c}=rz(n,e,r);null!=c&&(i&&s&&rb(c,a)?rb(a,o)||R(e,o):c<u?R(e,u):c>l&&R(e,l))},[R]),A=(0,to.useCallback)((e,t)=>{let{direction:r}=w.current,{layout:n}=_.current;if(!p.current)return;let a=rO(e,p.current);ry(a,`Drag handle element not found for id "${e}"`);let i=rC(r,t);g({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:i,initialLayout:n})},[]),T=(0,to.useCallback)(()=>{g(null)},[]),N=(0,to.useCallback)(e=>{let{panelDataArray:t}=_.current,r=rV(t,e);r>=0&&(t.splice(r,1),delete b.current[e.id],_.current.panelDataArrayChanged=!0,v())},[v]),U=(0,to.useMemo)(()=>({collapsePanel:I,direction:n,dragState:h,expandPanel:D,getPanelSize:O,getPanelStyle:k,groupId:f,isPanelCollapsed:C,isPanelExpanded:j,reevaluatePanelConstraints:P,registerPanel:E,registerResizeHandle:M,resizePanel:R,startDragging:A,stopDragging:T,unregisterPanel:N,panelGroupElement:p.current}),[I,h,n,D,O,k,f,C,j,P,E,M,R,A,T,N]);return(0,to.createElement)(t5.Provider,{value:U},(0,to.createElement)(c,{...d,children:t,className:r,id:i,ref:p,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...u},"data-panel-group":"","data-panel-group-direction":n,[t8]:f}))}let rB=(0,to.forwardRef)((e,t)=>(0,to.createElement)(rF,{...e,forwardedRef:t}));function rV(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function rz(e,t,r){let n=rV(e,t),a=n===e.length-1,i=r[n];return{...t.constraints,panelSize:i,pivotIndices:a?[n-1,n]:[n,n+1]}}function rH(e,t=document){let r=t.querySelector(`[data-panel-id="${e}"]`);return r||null}rF.displayName="PanelGroup",rB.displayName="forwardRef(PanelGroup)";let rW=(e,t)=>{e&&(e.style.minWidth=void 0===t?"":`${t}px`,e.style.maxWidth=e.style.minWidth)},r$="mt-[1px] bg-background";function rY(){return document.body.classList.add("bg-background"),document.body.classList.add("overflow-hidden"),rG}function rG(){document.body.classList.remove("bg-background"),document.body.classList.remove("overflow-hidden")}function rq(){document.activeElement?.blur()}let rX=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I=(0,ti.c)(71),{extensionManager:D,servicesManager:O,hotkeysManager:k,commandsManager:C,viewports:j,ViewportGridComp:E,leftPanelClosed:M,rightPanelClosed:R,leftPanelResizable:P,rightPanelResizable:A,leftPanelInitialExpandedWidth:T,rightPanelInitialExpandedWidth:N,leftPanelMinimumExpandedWidth:U,rightPanelMinimumExpandedWidth:L}=e,F=void 0!==M&&M,B=void 0!==R&&R,V=void 0!==P&&P,z=void 0!==A&&A,[H]=tf(),{panelService:W,hangingProtocolService:$,customizationService:Y}=O.services,[G,q]=(0,to.useState)(H.showLoadingIndicator);I[0]!==W?(t=e=>!!W.getPanels(e).length,I[0]=W,I[1]=t):t=I[1];let X=t,[J,Z]=(0,to.useState)(X("right")),[Q,ee]=(0,to.useState)(X("left")),[et,er]=(0,to.useState)(F),[en,ea]=(0,to.useState)(B),[ei,eo,es,el,eu,ec,ed]=((e,t,r,n,a,i,o,s,l,u)=>{let c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k,C,j,E,M,R,P,A,T=(0,ti.c)(96);T[0]!==o||T[1]!==l||T[2]!==s||T[3]!==u?(c=(({leftPanelInitialExpandedWidth:e=282,rightPanelInitialExpandedWidth:t=280,leftPanelMinimumExpandedWidth:r=145,rightPanelMinimumExpandedWidth:n=280})=>({groupId:"viewerLayoutResizablePanelGroup",shared:{expandedInsideBorderSize:0,collapsedInsideBorderSize:4,collapsedOutsideBorderSize:4,collapsedWidth:25},left:{panelId:"viewerLayoutResizableLeftPanel",initialExpandedWidth:e,minimumExpandedOffsetWidth:r+0,initialExpandedOffsetWidth:e+0,collapsedOffsetWidth:33},right:{panelId:"viewerLayoutResizableRightPanel",initialExpandedWidth:t,minimumExpandedOffsetWidth:n+0,initialExpandedOffsetWidth:t+0,collapsedOffsetWidth:33}}))({leftPanelInitialExpandedWidth:o,rightPanelInitialExpandedWidth:s,leftPanelMinimumExpandedWidth:l,rightPanelMinimumExpandedWidth:u}),T[0]=o,T[1]=l,T[2]=s,T[3]=u,T[4]=c):c=T[4];let[N]=(0,to.useState)(c),[U,L]=(0,to.useState)(N.left.initialExpandedWidth),[F,B]=(0,to.useState)(N.right.initialExpandedWidth),[V,z]=(0,to.useState)(0),[H,W]=(0,to.useState)(0),[$,Y]=(0,to.useState)(0),[G,q]=(0,to.useState)(0),X=(0,to.useRef)(null),K=(0,to.useRef)(null),J=(0,to.useRef)(null),Z=(0,to.useRef)(null),Q=(0,to.useRef)(null),ee=(0,to.useRef)(!1),et=(0,to.useRef)(null);T[5]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{let{width:t}=X.current?.getBoundingClientRect();return e/(t-et.current)*100},T[5]=d):d=T[5];let er=d;T[6]!==N.shared.expandedInsideBorderSize?(f=e=>{let{width:t}=X.current?.getBoundingClientRect();return e/100*(t-et.current)-N.shared.expandedInsideBorderSize},T[6]=N.shared.expandedInsideBorderSize,T[7]=f):f=T[7];let en=f;T[8]!==e||T[9]!==N.groupId||T[10]!==N.left.initialExpandedOffsetWidth||T[11]!==N.left.panelId||T[12]!==N.right.initialExpandedOffsetWidth||T[13]!==N.right.panelId||T[14]!==r?(p=()=>{X.current=rD(N.groupId);let t=rH(N.left.panelId);K.current=t;let n=rH(N.right.panelId);J.current=n;let a=document.querySelectorAll("[data-panel-resize-handle-id]");if(et.current=0,a.forEach(e=>{et.current=et.current+e.offsetWidth}),!e){let e=er(N.left.initialExpandedOffsetWidth);Z?.current?.expand(e),rW(t,N.left.initialExpandedOffsetWidth)}if(!r){let e=er(N.right.initialExpandedOffsetWidth);Q?.current?.expand(e),rW(n,N.right.initialExpandedOffsetWidth)}},T[8]=e,T[9]=N.groupId,T[10]=N.left.initialExpandedOffsetWidth,T[11]=N.left.panelId,T[12]=N.right.initialExpandedOffsetWidth,T[13]=N.right.panelId,T[14]=r,T[15]=p):p=T[15],T[16]===Symbol.for("react.memo_cache_sentinel")?(h=[],T[16]=h):h=T[16],(0,to.useLayoutEffect)(p,h),T[17]!==U||T[18]!==N.left.collapsedOffsetWidth||T[19]!==N.left.minimumExpandedOffsetWidth||T[20]!==N.right.collapsedOffsetWidth||T[21]!==N.right.minimumExpandedOffsetWidth||T[22]!==N.shared.expandedInsideBorderSize||T[23]!==F?(g=()=>{if(!Z.current?.isCollapsed()){let e=er(U+N.shared.expandedInsideBorderSize);Z.current?.resize(e)}if(!Q?.current?.isCollapsed()){let e=er(F+N.shared.expandedInsideBorderSize);Q?.current?.resize(e)}let e=new ResizeObserver(()=>{let e=er(N.left.minimumExpandedOffsetWidth),t=er(N.right.minimumExpandedOffsetWidth);z(e),W(t),Y(er(N.left.collapsedOffsetWidth)),q(er(N.right.collapsedOffsetWidth))});return e.observe(X.current),()=>{e.disconnect()}},T[17]=U,T[18]=N.left.collapsedOffsetWidth,T[19]=N.left.minimumExpandedOffsetWidth,T[20]=N.right.collapsedOffsetWidth,T[21]=N.right.minimumExpandedOffsetWidth,T[22]=N.shared.expandedInsideBorderSize,T[23]=F,T[24]=g):g=T[24],T[25]!==a||T[26]!==i||T[27]!==U||T[28]!==V||T[29]!==F||T[30]!==H?(m=[U,F,V,H,a,i],T[25]=a,T[26]=i,T[27]=U,T[28]=V,T[29]=F,T[30]=H,T[31]=m):m=T[31],(0,to.useLayoutEffect)(g,m),T[32]!==U||T[33]!==N.shared.expandedInsideBorderSize||T[34]!==F?(y=e=>{e?(ee.current=!0,rW(K.current),rW(J.current)):(ee.current=!1,Z?.current?.isExpanded()&&rW(K.current,U+N.shared.expandedInsideBorderSize),Q?.current?.isExpanded()&&rW(J.current,F+N.shared.expandedInsideBorderSize))},T[32]=U,T[33]=N.shared.expandedInsideBorderSize,T[34]=F,T[35]=y):y=T[35];let ea=y;T[36]!==t?(v=()=>{t(!0),rW(K.current),Z?.current?.collapse()},T[36]=t,T[37]=v):v=T[37];let ei=v;T[38]!==N.left.initialExpandedOffsetWidth||T[39]!==t?(b=()=>{Z?.current?.expand(er(N.left.initialExpandedOffsetWidth)),t(!1)},T[38]=N.left.initialExpandedOffsetWidth,T[39]=t,T[40]=b):b=T[40];let eo=b;T[41]!==en?(x=e=>{if(!X?.current||Z.current?.isCollapsed())return;let t=en(e);L(t),ee.current||rW(K.current,t)},T[41]=en,T[42]=x):x=T[42];let es=x;T[43]!==n?(S=()=>{n(!0),rW(J.current),Q?.current?.collapse()},T[43]=n,T[44]=S):S=T[44];let el=S;T[45]!==N.right.initialExpandedOffsetWidth||T[46]!==n?(w=()=>{Q?.current?.expand(er(N.right.initialExpandedOffsetWidth)),n(!1)},T[45]=N.right.initialExpandedOffsetWidth,T[46]=n,T[47]=w):w=T[47];let eu=w;T[48]!==en?(_=e=>{if(!X?.current||Q?.current?.isCollapsed())return;let t=en(e);B(t),ee.current||rW(J.current,t)},T[48]=en,T[49]=_):_=T[49];let ec=_;return T[50]!==U||T[51]!==ei||T[52]!==eo||T[53]!==N.shared.collapsedInsideBorderSize||T[54]!==N.shared.collapsedOutsideBorderSize||T[55]!==N.shared.collapsedWidth||T[56]!==N.shared.expandedInsideBorderSize?(I={expandedWidth:U,collapsedWidth:N.shared.collapsedWidth,collapsedInsideBorderSize:N.shared.collapsedInsideBorderSize,collapsedOutsideBorderSize:N.shared.collapsedOutsideBorderSize,expandedInsideBorderSize:N.shared.expandedInsideBorderSize,onClose:ei,onOpen:eo},T[50]=U,T[51]=ei,T[52]=eo,T[53]=N.shared.collapsedInsideBorderSize,T[54]=N.shared.collapsedOutsideBorderSize,T[55]=N.shared.collapsedWidth,T[56]=N.shared.expandedInsideBorderSize,T[57]=I):I=T[57],T[58]!==el||T[59]!==eu||T[60]!==N.shared.collapsedInsideBorderSize||T[61]!==N.shared.collapsedOutsideBorderSize||T[62]!==N.shared.collapsedWidth||T[63]!==N.shared.expandedInsideBorderSize||T[64]!==F?(D={expandedWidth:F,collapsedWidth:N.shared.collapsedWidth,collapsedInsideBorderSize:N.shared.collapsedInsideBorderSize,collapsedOutsideBorderSize:N.shared.collapsedOutsideBorderSize,expandedInsideBorderSize:N.shared.expandedInsideBorderSize,onClose:el,onOpen:eu},T[58]=el,T[59]=eu,T[60]=N.shared.collapsedInsideBorderSize,T[61]=N.shared.collapsedOutsideBorderSize,T[62]=N.shared.collapsedWidth,T[63]=N.shared.expandedInsideBorderSize,T[64]=F,T[65]=D):D=T[65],T[66]!==N.groupId?(O={direction:"horizontal",id:N.groupId},T[66]=N.groupId,T[67]=O):O=T[67],T[68]!==t?(k=()=>t(!0),C=()=>t(!1),T[68]=t,T[69]=k,T[70]=C):(k=T[69],C=T[70]),T[71]!==$||T[72]!==V||T[73]!==es||T[74]!==N.left.panelId||T[75]!==k||T[76]!==C?(j={defaultSize:V,minSize:V,onResize:es,collapsible:!0,collapsedSize:$,onCollapse:k,onExpand:C,ref:Z,order:0,id:N.left.panelId},T[71]=$,T[72]=V,T[73]=es,T[74]=N.left.panelId,T[75]=k,T[76]=C,T[77]=j):j=T[77],T[78]===Symbol.for("react.memo_cache_sentinel")?(E={order:1,id:"viewerLayoutResizableViewportGridPanel"},T[78]=E):E=T[78],T[79]!==n?(M=()=>n(!0),R=()=>n(!1),T[79]=n,T[80]=M,T[81]=R):(M=T[80],R=T[81]),T[82]!==ec||T[83]!==N.right.panelId||T[84]!==H||T[85]!==G||T[86]!==M||T[87]!==R?(P={defaultSize:H,minSize:H,onResize:ec,collapsible:!0,collapsedSize:G,onCollapse:M,onExpand:R,ref:Q,order:2,id:N.right.panelId},T[82]=ec,T[83]=N.right.panelId,T[84]=H,T[85]=G,T[86]=M,T[87]=R,T[88]=P):P=T[88],T[89]!==ea||T[90]!==I||T[91]!==D||T[92]!==O||T[93]!==j||T[94]!==P?(A=[I,D,O,j,E,P,ea],T[89]=ea,T[90]=I,T[91]=D,T[92]=O,T[93]=j,T[94]=P,T[95]=A):A=T[95],A})(F,er,B,ea,Q,J,T,N,U,L);I[2]!==Y?(r=Y.getCustomization("ui.loadingIndicatorProgress"),I[2]=Y,I[3]=r):r=I[3];let ef=r;I[4]===Symbol.for("react.memo_cache_sentinel")?(n=[],I[4]=n):n=I[4],(0,to.useEffect)(rY,n),I[5]!==D?(a=e=>{let t=D.getModuleEntry(e);if(!t||!t.component)throw Error(`${e} is not valid for an extension module or no component found from extension ${e}. Please verify your configuration or ensure that the extension is properly registered. It's also possible that your mode is utilizing a module from an extension that hasn't been included in its dependencies (add the extension to the "extensionDependencies" array in your mode's index.js file). Check the reference string to the extension in your Mode configuration`);return{entry:t}},I[5]=D,I[6]=a):a=I[6];let ep=a;I[7]!==$?(o=()=>{let{unsubscribe:e}=$.subscribe(K.HangingProtocolService.EVENTS.PROTOCOL_CHANGED,()=>{q(!1)});return()=>{e()}},i=[$],I[7]=$,I[8]=i,I[9]=o):(i=I[8],o=I[9]),(0,to.useEffect)(o,i),I[10]!==ep?(s=e=>{let{entry:t}=ep(e.namespace);return{component:t.component,isReferenceViewable:t.isReferenceViewable,displaySetsToDisplay:e.displaySetsToDisplay}},I[10]=ep,I[11]=s):s=I[11];let eh=s;I[12]!==X||I[13]!==W?(l=()=>{let{unsubscribe:e}=W.subscribe(W.EVENTS.PANELS_CHANGED,e=>{let{options:t}=e;ee(X("left")),Z(X("right")),t?.leftPanelClosed!==void 0&&er(t.leftPanelClosed),t?.rightPanelClosed!==void 0&&ea(t.rightPanelClosed)});return()=>{e()}},u=[W,X],I[12]=X,I[13]=W,I[14]=l,I[15]=u):(l=I[14],u=I[15]),(0,to.useEffect)(l,u),I[16]!==eh||I[17]!==j?(c=j.map(eh),I[16]=eh,I[17]=j,I[18]=c):c=I[18];let eg=c;I[19]!==H||I[20]!==D||I[21]!==k||I[22]!==O?(d=(0,tu.jsx)(t3,{hotkeysManager:k,extensionManager:D,servicesManager:O,appConfig:H}),I[19]=H,I[20]=D,I[21]=k,I[22]=O,I[23]=d):d=I[23],I[24]===Symbol.for("react.memo_cache_sentinel")?(f={height:"calc(100vh - 52px)"},I[24]=f):f=I[24],I[25]!==ef||I[26]!==G?(p=G&&(0,tu.jsx)(ef,{className:"h-full w-full bg-background"}),I[25]=ef,I[26]=G,I[27]=p):p=I[27],I[28]!==Q||I[29]!==et||I[30]!==ei||I[31]!==V||I[32]!==ed||I[33]!==el||I[34]!==O?(h=Q?(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.ResizablePanel,{...el,children:(0,tu.jsx)(t4,{side:"left",isExpanded:!et,servicesManager:O,...ei})}),(0,tu.jsx)(tl.ResizableHandle,{onDragging:ed,disabled:!V,className:r$})]}):null,I[28]=Q,I[29]=et,I[30]=ei,I[31]=V,I[32]=ed,I[33]=el,I[34]=O,I[35]=h):h=I[35],I[36]!==E||I[37]!==C||I[38]!==O||I[39]!==eg?(g=(0,tu.jsx)("div",{className:"flex h-full flex-1 flex-col",children:(0,tu.jsx)("div",{className:"relative flex h-full flex-1 items-center justify-center overflow-hidden bg-background",onMouseEnter:rq,children:(0,tu.jsx)(E,{servicesManager:O,viewportComponents:eg,commandsManager:C})})}),I[36]=E,I[37]=C,I[38]=O,I[39]=eg,I[40]=g):g=I[40],I[41]!==eu||I[42]!==g?(m=(0,tu.jsx)(tl.ResizablePanel,{...eu,children:g}),I[41]=eu,I[42]=g,I[43]=m):m=I[43],I[44]!==J||I[45]!==ed||I[46]!==ec||I[47]!==en||I[48]!==eo||I[49]!==z||I[50]!==O?(y=J?(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.ResizableHandle,{onDragging:ed,disabled:!z,className:r$}),(0,tu.jsx)(tl.ResizablePanel,{...ec,children:(0,tu.jsx)(t4,{side:"right",isExpanded:!en,servicesManager:O,...eo})})]}):null,I[44]=J,I[45]=ed,I[46]=ec,I[47]=en,I[48]=eo,I[49]=z,I[50]=O,I[51]=y):y=I[51],I[52]!==es||I[53]!==h||I[54]!==m||I[55]!==y?(v=(0,tu.jsxs)(tl.ResizablePanelGroup,{...es,children:[h,m,y]}),I[52]=es,I[53]=h,I[54]=m,I[55]=y,I[56]=v):v=I[56],I[57]!==p||I[58]!==v?(b=(0,tu.jsx)("div",{className:"relative flex w-full flex-row flex-nowrap items-stretch overflow-hidden bg-background",style:f,children:(0,tu.jsxs)(to.Fragment,{children:[p,v]})}),I[57]=p,I[58]=v,I[59]=b):b=I[59],I[60]!==Y?(x=Y.getCustomization("ohif.tours"),I[60]=Y,I[61]=x):x=I[61],I[62]!==x?(S=(0,tu.jsx)(tl.Onboarding,{tours:x}),I[62]=x,I[63]=S):S=I[63];let em=H?.investigationalUseDialog;return I[64]!==em?(w=(0,tu.jsx)(tl.InvestigationalUseDialog,{dialogConfiguration:em}),I[64]=em,I[65]=w):w=I[65],I[66]!==d||I[67]!==b||I[68]!==S||I[69]!==w?(_=(0,tu.jsxs)("div",{children:[d,b,S,w]}),I[66]=d,I[67]=b,I[68]=S,I[69]=w,I[70]=_):_=I[70],_};function rK(e){let t,r,n,a,i,o,s,l=(0,ti.c)(21),{viewPresets:u,updateViewPresetValue:c,actionIcons:d,updateActionIconValue:f}=e;if(l[0]!==d||l[1]!==f){let e;l[3]!==f?(e=(e,t)=>to.createElement(tl.Icons[e.iconName]||tl.Icons.MissingIcon,{key:t,onClick:()=>f(e),className:"cursor-pointer"}),l[3]=f,l[4]=e):e=l[4],t=d.map(e),l[0]=d,l[1]=f,l[2]=t}else t=l[2];l[5]!==t?(r=(0,tu.jsx)("div",{className:"flex items-center justify-center",children:(0,tu.jsx)("div",{className:"text-primary flex items-center space-x-1",children:t})}),l[5]=t,l[6]=r):r=l[6],l[7]!==u?(n=u.filter(rZ),l[7]=u,l[8]=n):n=l[8];let p=n[0].id;return l[9]!==c||l[10]!==u?(a=e=>{c(u.find(t=>t.id===e))},l[9]=c,l[10]=u,l[11]=a):a=l[11],l[12]!==u?(i=u.map(rJ),l[12]=u,l[13]=i):i=l[13],l[14]!==n[0].id||l[15]!==a||l[16]!==i?(o=(0,tu.jsx)("div",{className:"ml-auto flex h-full items-center justify-center",children:(0,tu.jsx)(tl.ToggleGroup,{type:"single",value:p,onValueChange:a,children:i})}),l[14]=n[0].id,l[15]=a,l[16]=i,l[17]=o):o=l[17],l[18]!==r||l[19]!==o?(s=(0,tu.jsx)(tu.Fragment,{children:(0,tu.jsx)("div",{className:"bg-muted flex h-[40px] select-none rounded-t p-2",children:(0,tu.jsx)("div",{className:"flex h-[24px] w-full select-none justify-center self-center text-[14px]",children:(0,tu.jsxs)("div",{className:"flex w-full items-center gap-[10px]",children:[r,o]})})})}),l[18]=r,l[19]=o,l[20]=s):s=l[20],s}function rJ(e,t){return(0,tu.jsx)(tl.ToggleGroupItem,{"aria-label":e.id,value:e.id,className:"text-primary",children:to.createElement(tl.Icons[e.iconName]||tl.Icons.MissingIcon)},t)}function rZ(e){return e.selected}let rQ=[{id:"settings",iconName:"Settings",value:!1}],r0=({commandsManager:e,items:t,...r})=>{let{servicesManager:n}=(0,K.useSystem)(),{customizationService:a}=n.services,i=a.getCustomization("ohif.menuContent")??(t=>{let a,i,o,s,l,u=(0,ti.c)(12),{item:c}=t;return u[0]!==c?(a=()=>c.onClick({commandsManager:e,servicesManager:n,...r}),u[0]=c,u[1]=a):a=u[1],u[2]!==c.iconName?(i=c.iconName&&(0,tu.jsx)(tl.Icons.ByName,{name:c.iconName}),u[2]=c.iconName,u[3]=i):i=u[3],u[4]!==c.label?(o=(0,tu.jsx)("span",{children:c.label}),u[4]=c.label,u[5]=o):o=u[5],u[6]!==i||u[7]!==o?(s=(0,tu.jsxs)("div",{className:"flex items-center gap-2",children:[i,o]}),u[6]=i,u[7]=o,u[8]=s):s=u[8],u[9]!==a||u[10]!==s?(l=(0,tu.jsx)(tl.DropdownMenuItem,{onClick:a,children:s}),u[9]=a,u[10]=s,u[11]=l):l=u[11],l});return(0,tu.jsx)(tl.DropdownMenuContent,{hideWhenDetached:!0,align:"start",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:t?.map((t,a)=>(0,tu.jsx)(i,{item:t,commandsManager:e,servicesManager:n,...r},t.id||`menu-item-${a}`))})};function r1(e){let t,r,n=(0,ti.c)(8),{menuItemsKey:a,getMenuItems:i,commandsManager:o}=e,s=void 0===i?r0:i,{servicesManager:l}=(0,K.useSystem)(),{customizationService:u}=l.services;n[0]!==u||n[1]!==a?(t=u.getCustomization(a),n[0]=u,n[1]=a,n[2]=t):t=n[2];let c=t;return c?.length?(n[3]!==o||n[4]!==s||n[5]!==c||n[6]!==l?(r=function(e){return(0,tu.jsxs)(tl.DropdownMenu,{children:[(0,tu.jsx)(tl.DropdownMenuTrigger,{asChild:!0,children:(0,tu.jsx)(tl.Button,{variant:"ghost",size:"icon",className:"hidden group-hover:inline-flex data-[state=open]:inline-flex",onClick:r2,children:(0,tu.jsx)(tl.Icons.More,{})})}),s({...e,commandsManager:o,servicesManager:l,items:c})]})},n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=r):r=n[7],r):null}function r2(e){e.preventDefault(),e.stopPropagation()}var r3=I(1357);let{formatValue:r4}=K.utils,r5=new Set,{sortStudyInstances:r8,formatDate:r6,formatTime:r9,createStudyBrowserTabs:r7}=K.utils,ne=function({getImageSrc:e,getStudiesForPatientByMRN:t,requestDisplaySetCreationForStudy:r,dataSource:n,customMapDisplaySets:a,onClickUntrack:i,onDoubleClickThumbnailHandlerCallBack:o}){let{servicesManager:s,commandsManager:l,extensionManager:u}=(0,K.useSystem)(),{displaySetService:c,customizationService:d}=s.services,f=tk(),p=d.getCustomization("studyBrowser.studyMode")||"all",h=(0,tl.useImageViewer)().StudyInstanceUIDs,g=(0,to.useRef)(new Set),[{activeViewportId:m,viewports:y,isHangingProtocolLayout:v}]=(0,tl.useViewportGrid)(),[b,x]=(0,to.useState)(p),[S,w]=(0,to.useState)("primary"===p&&h.length>0?[h[0]]:[...h]),[_,I]=(0,to.useState)(!1),[D,O]=(0,to.useState)([]),[k,C]=(0,to.useState)([]),[j,E]=(0,to.useState)({}),[M,R]=(0,to.useState)({}),[P,A]=(0,to.useState)(null),[T,N]=(0,to.useState)(d.getCustomization("studyBrowser.viewPresets")),[U,L]=(0,to.useState)(rQ),F=a||nt,B=(0,to.useCallback)((e,...t)=>{let r=F(e,...t),n=d.getCustomization("studyBrowser.thumbnailDetails"),a=d.getCustomization("studyBrowser.thumbnailDetailSources"),i=d.getCustomization("studyBrowser.thumbnailDetailTests");return r.map(e=>{let t=c.getDisplaySetByUID(e.displaySetInstanceUID);return t?{...e,details:function({items:e,displaySet:t,sources:r,tests:n,formatters:a}){if(!Array.isArray(e))return;let i={displaySet:t,instance:t?.instance,formatters:a},o=[],s=!1,l=(e,t,r,n)=>{if("string"!=typeof e)return e;let a=t?.[e];if(!a){let t=`${n}|${r}|${e}`;r5.has(t)||(r5.add(t),console.warn(`Thumbnail detail item "${n}" names an unknown ${r} "${e}"`)),s=!0}return a};for(let t of e){let e;if(!t)continue;let{id:a,condition:s,contentF:u,source:c,attribute:d,iconName:f}=t;if(void 0!==s){let e=l(s,n,"condition",a);if("function"!=typeof e||!e(i))continue}if("function"==typeof u)e=u(i);else if(void 0!==c){let t=l(c,r,"source",a);e="function"==typeof t?t(i):void 0}else d&&(e=i.instance?.[d]);let p=r4(e);if(!p)continue;let h="function"==typeof f?f(i):f;o.push({id:a,label:t.label??"",title:t.title??"",value:p,iconName:h||void 0})}if(o.length||!s)return o}({items:n,displaySet:t,sources:a,tests:i,formatters:{formatDate:r6,formatTime:r9}})}:e})},[F,d,c]),V=(0,to.useCallback)(async e=>{let t=d.getCustomization("studyBrowser.thumbnailDoubleClickCallback"),r={activeViewportId:m,commandsManager:l,servicesManager:s,isHangingProtocolLayout:v,appConfig:u.appConfig};for(let n of t?.callbacks.map(e=>e(r)))await n(e);o?.(e)},[m,l,s,v,d,u.appConfig,o]);(0,to.useEffect)(()=>{async function e(e){if(g.current.has(e))return;g.current.add(e);let r=await n.query.studies.search({studyInstanceUid:e}),a=r;try{a=await t(r)}catch(e){console.warn(e)}let i=a.map(e=>({AccessionNumber:e.accession,StudyDate:e.date,StudyDescription:e.description,NumInstances:e.instances,ModalitiesInStudy:e.modalities,PatientID:e.mrn,PatientName:e.patientName,StudyInstanceUID:e.studyInstanceUid,StudyTime:e.time})).map(e=>({studyInstanceUid:e.StudyInstanceUID,date:r6(e.StudyDate)||"",description:e.StudyDescription,modalities:e.ModalitiesInStudy,numInstances:Number(e.NumInstances)}));O(e=>{let t=[...e];for(let r of i)e.find(e=>e.studyInstanceUid===r.studyInstanceUid)||t.push(r);return t})}h.forEach(t=>e(t))},[h,n,t,f]),(0,to.useEffect)(()=>{if(!_){if(m){let e=250+10*c.getActiveDisplaySets().length;window.setTimeout(()=>I(!0),e)}return}let t=c.activeDisplaySets;(t=t.filter(e=>!r3.thumbnailNoImageModalities.includes(e.Modality)||null===e.thumbnailSrc)).length&&t.forEach(async t=>{let r={},a=c.getDisplaySetByUID(t.displaySetInstanceUID),i=nr(a,n.getImageIdsForDisplaySet(t));if(a?.unsupported)return;let{thumbnailSrc:o}=a;!o&&a.getThumbnailSrc&&(o=await a.getThumbnailSrc({getImageSrc:e})),!o&&i&&(a.thumbnailSrc=await e(i)),r[t.displaySetInstanceUID]=o,R(e=>({...e,...r}))})},[c,n,e,m,_]),(0,to.useEffect)(()=>{let e=c.activeDisplaySets;if(!e.length)return;let t=B(e,j,M,y);a||r8(t),C(t)},[c.activeDisplaySets,j,y,M,a,B]),(0,to.useEffect)(()=>{let t=c.subscribe(c.EVENTS.DISPLAY_SETS_ADDED,t=>{if(!_)return;let{displaySetsAdded:r,options:a}=t;r.forEach(async t=>{let r=t.displaySetInstanceUID,i={},o=c.getDisplaySetByUID(r);if(o?.unsupported)return;a?.madeInClient&&A(r);let s=n.getImageIdsForDisplaySet(o),l=nr(o,s);if(!l)return;let{thumbnailSrc:u}=o;!u&&o.getThumbnailSrc&&(u=await o.getThumbnailSrc({getImageSrc:e})),u||(o.thumbnailSrc=u=await e(l)),i[r]=u,R(e=>({...e,...i}))})});return()=>{t.unsubscribe()}},[c,n,e,_]),(0,to.useEffect)(()=>{let e=c.subscribe(c.EVENTS.DISPLAY_SETS_CHANGED,e=>{let t=B(e,j,M,y);a||r8(t),C(t)}),t=c.subscribe(c.EVENTS.DISPLAY_SET_SERIES_METADATA_INVALIDATED,()=>{let e=B(c.getActiveDisplaySets(),j,M,y);a||r8(e),C(e)});return()=>{e.unsubscribe(),t.unsubscribe()}},[j,M,y,c,a,B]);let z=r7(h,D,k);(0,to.useEffect)(()=>{if(P){let e=document.getElementById(`thumbnail-${P}`);e&&"function"==typeof e.scrollIntoView&&(e.scrollIntoView({behavior:"smooth"}),A(null))}},[P,S,b]),(0,to.useEffect)(()=>{if(!P)return;let e=function(e,t,r){let n=[t.find(e=>e.name===r)||t[0],...t];for(let t=0;t<n.length;t++){let r=n[t].studies.find(t=>t.displaySets.find(t=>t.displaySetInstanceUID===e));if(r)return{tabName:n[t].name,StudyInstanceUID:r.studyInstanceUid}}}(P,z,b);if(!e)return;let{tabName:t,StudyInstanceUID:r}=e;x(t),S.includes(r)||w([...S,r])},[S,P,z]);let H=y.get(m)?.displaySetInstanceUIDs;return(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(rK,{viewPresets:T,updateViewPresetValue:e=>{e&&N(T.map(t=>(t.selected=t.id===e.id,t)))},actionIcons:U,updateActionIconValue:e=>{e.value=!e.value,L([...U])}}),(0,tu.jsx)(tl.Separator,{orientation:"horizontal",className:"bg-background",thickness:"2px"})]}),(0,tu.jsx)(tl.StudyBrowser,{tabs:z,servicesManager:s,activeTabName:b,expandedStudyInstanceUIDs:S,onClickStudy:function(e){let t=S.includes(e);w(t?[...S.filter(t=>t!==e)]:[...S,e]),t||r(c,e,!0)},onClickTab:e=>{x(e)},onClickUntrack:i,onClickThumbnail:()=>{},onDoubleClickThumbnail:V,activeDisplaySetInstanceUIDs:H,showSettings:U.find(e=>"settings"===e.id)?.value,viewPresets:T,ThumbnailMenuItems:r1({commandsManager:l,servicesManager:s,menuItemsKey:"studyBrowser.thumbnailMenuItems"}),StudyMenuItems:r1({commandsManager:l,servicesManager:s,menuItemsKey:"studyBrowser.studyMenuItems"})})]})};function nt(e,t,r,n){let a=[],i=[];return e.filter(e=>!e.excludeFromThumbnailBrowser).forEach(e=>{var n;let{thumbnailSrc:o,displaySetInstanceUID:s}=e,l=(n=e,r3.thumbnailNoImageModalities.includes(n.Modality)||n?.unsupported||null===n.thumbnailSrc?"thumbnailNoImage":"thumbnail"),u="thumbnail"===l?a:i,c=t?.[s];u.push({displaySetInstanceUID:s,description:e.SeriesDescription||"",seriesNumber:e.SeriesNumber,modality:e.Modality,seriesDate:r6(e.SeriesDate),numInstances:e.numImageFrames??e.instances?.length,loadingProgress:c,countIcon:e.countIcon,messages:e.messages,StudyInstanceUID:e.StudyInstanceUID,componentType:l,imageSrc:o||r[s],dragData:{type:"displayset",displaySetInstanceUID:s},isHydratedForDerivedDisplaySet:e.isHydrated})}),[...a,...i]}function nr(e,t){let r;if(e.isDynamicVolume){let t=e.dynamicVolumeInfo.timePoints,n=Math.floor(t.length/2),a=t[n];r=a[Math.floor(a.length/2)]}else r=t[Math.floor(t.length/2)];return r}let nn=function(e,t){return new Promise((r,n)=>{let a=document.createElement("canvas");e.utilities.loadImageToCanvas({canvas:a,imageId:t,thumbnail:!0}).then(e=>{r(a.toDataURL())}).catch(n)})},na=async function(e,t){if(!t?.length)return[];let r=t[0].mrn;return r?e.query.studies.search({patientId:r,disableWildcard:!0}):t},ni=function(e,t,r,n){if(!t.activeDisplaySets.some(e=>e.StudyInstanceUID===r))return e.retrieve.series.metadata({StudyInstanceUID:r,madeInClient:n})},no=function(){let e,t,r,n,a,i=(0,ti.c)(10),{extensionManager:o}=(0,K.useSystem)();i[0]!==o?([r]=o.getActiveDataSource(),t=na.bind(null,r),e=function(e){let t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common");try{let{cornerstone:e}=t.exports.getCornerstoneLibraries();return nn.bind(null,e)}catch(e){throw Error("Required command not found")}}(o),n=ni.bind(null,r),i[0]=o,i[1]=e,i[2]=t,i[3]=r,i[4]=n):(e=i[1],t=i[2],r=i[3],n=i[4]);let s=n;return i[5]!==e||i[6]!==t||i[7]!==s||i[8]!==r?(a=(0,tu.jsx)(ne,{dataSource:r,getImageSrc:e,getStudiesForPatientByMRN:t,requestDisplaySetCreationForStudy:s}),i[5]=e,i[6]=t,i[7]=s,i[8]=r,i[9]=a):a=i[9],a};function ns({title:e="Save Measurements",modality:t="SR",minSeriesNumber:r=0,predecessorImageId:n,itemName:a="",defaultSeriesDescription:i="",itemType:o,rememberedDescriptionCount:s=5,extensionManager:l,servicesManager:u,enableDownload:c=!1}){let{uiDialogService:d,customizationService:f}=u.services,p=l.getDataSourcesForUI(),h=f.getCustomization("ohif.createReportDialog"),g=window.config.allowMultiSelectExport;return r||="SR"===t&&3e3||"SEG"===t&&3100||"RTSTRUCT"===t&&3200||4e3,new Promise(function(l){d.show({id:"report-dialog",title:e,containerClassName:"max-w-lg",content:h,contentProps:{dataSources:g?p:void 0,predecessorImageId:n,minSeriesNumber:r,itemName:a,defaultSeriesDescription:i,itemType:o,rememberedDescriptionCount:s,modality:t,enableDownload:c,onSave:async({reportName:e,dataSource:t,series:r,seriesNumber:n,priorSeriesNumber:a})=>{l({value:e,dataSourceName:t,series:r,seriesNumber:n,priorSeriesNumber:a,action:1})},onCancel:()=>{l({action:0,value:void 0,series:void 0,dataSourceName:void 0})},defaultValue:e}})})}function nl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.forEach(function(t){tH(e,t,r[t])})}return e}function nu(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nc(e,t){if(t&&("object"==tR(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return nu(e)}function nd(e){return(nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nf(e,t){return(nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function np(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nf(e,t)}var nh={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},ng=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tM(this,e),this.init(t,r)}return tT(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||nh,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,nl({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),nm=function(){function e(){tM(this,e),this.observers={}}return tT(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach(function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)}),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e]=this.observers[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(function(e){e.apply(void 0,r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(r))})}}]),e}();function ny(){var e,t,r=new Promise(function(r,n){e=r,t=n});return r.resolve=e,r.reject=t,r}function nv(e){return null==e?"":""+e}function nb(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function a(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(a())return{};var o=n(i.shift());!e[o]&&r&&(e[o]=new r),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return a()?{}:{obj:e,k:n(i.shift())}}function nx(e,t,r){var n=nb(e,t,Object);n.obj[n.k]=r}function nS(e,t){var r=nb(e,t),n=r.obj,a=r.k;if(n)return n[a]}function nw(e,t,r){var n=nS(e,r);return void 0!==n?n:nS(t,r)}function n_(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var nI={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function nD(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return nI[e]}):e}var nO="u">typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,nk=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return tM(this,t),r=nc(this,nd(t).call(this)),nO&&nm.call(nu(r)),r.data=e||{},r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r}return np(t,e),tT(t,[{key:"addNamespaces",value:function(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,i=[e,t];return r&&"string"!=typeof r&&(i=i.concat(r)),r&&"string"==typeof r&&(i=i.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(i=e.split(".")),nS(this.data,i)}},{key:"addResource",value:function(e,t,r,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var o=[e,t];r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),nx(this.data,o,n),a.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var a in r)("string"==typeof r[a]||"[object Array]"===Object.prototype.toString.apply(r[a]))&&this.addResource(e,t,a,r[a],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),n=r,r=t,t=o[1]),this.addNamespaces(t);var s=nS(this.data,o)||{};n?function e(t,r,n){for(var a in r)"__proto__"!==a&&"constructor"!==a&&(a in t?"string"==typeof t[a]||t[a]instanceof String||"string"==typeof r[a]||r[a]instanceof String?n&&(t[a]=r[a]):e(t[a],r[a],n):t[a]=r[a]);return t}(s,r,a):s=nl({},s,r),nx(this.data,o,s),i.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?nl({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(nm),nC={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,a){var i=this;return e.forEach(function(e){i.processors[e]&&(t=i.processors[e].process(t,r,n,a))}),t}},nj={},nE=function(e){function t(e){var r,n,a,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return tM(this,t),a=nc(this,nd(t).call(this)),nO&&nm.call(nu(a)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n=nu(a),r.forEach(function(t){e[t]&&(n[t]=e[t])}),a.options=i,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=ng.create("translator"),a}return np(t,e),tT(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=t.ns||this.options.defaultNS;if(r&&e.indexOf(r)>-1){var i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:a};var o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(a=o.shift()),e=o.join(n)}return"string"==typeof a&&(a=[a]),{key:e,namespaces:a}}},{key:"translate",value:function(e,r,n){var a=this;if("object"!==tR(r)&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],r),s=o.key,l=o.namespaces,u=l[l.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase())return d?u+(r.nsSeparator||this.options.nsSeparator)+s:s;var f=this.resolve(e,r),p=f&&f.res,h=f&&f.usedKey||s,g=f&&f.exactUsedKey||s,m=Object.prototype.toString.apply(p),y=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b="string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p;if(v&&p&&b&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(m)&&("string"!=typeof y||"[object Array]"!==m)){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,r):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var x="[object Array]"===m,S=x?[]:{},w=x?g:h;for(var _ in p)if(Object.prototype.hasOwnProperty.call(p,_)){var I="".concat(w).concat(i).concat(_);S[_]=this.translate(I,nl({},r,{joinArrays:!1,ns:l})),S[_]===I&&(S[_]=p[_])}p=S}}else if(v&&"string"==typeof y&&"[object Array]"===m)(p=p.join(y))&&(p=this.extendTranslation(p,e,r,n));else{var D=!1,O=!1,k=void 0!==r.count&&"string"!=typeof r.count,C=t.hasDefaultValue(r),j=k?this.pluralResolver.getSuffix(c,r.count):"",E=r["defaultValue".concat(j)]||r.defaultValue;!this.isValidLookup(p)&&C&&(D=!0,p=E),this.isValidLookup(p)||(O=!0,p=s);var M=C&&E!==p&&this.options.updateMissing;if(O||D||M){if(this.logger.log(M?"updateKey":"missingKey",c,u,s,M?E:p),i){var R=this.resolve(s,nl({},r,{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var P=[],A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&A&&A[0])for(var T=0;T<A.length;T++)P.push(A[T]);else"all"===this.options.saveMissingTo?P=this.languageUtils.toResolveHierarchy(r.lng||this.language):P.push(r.lng||this.language);var N=function(e,t,n){a.options.missingKeyHandler?a.options.missingKeyHandler(e,u,t,M?n:p,M,r):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(e,u,t,M?n:p,M,r),a.emit("missingKey",e,u,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?P.forEach(function(e){a.pluralResolver.getSuffixes(e).forEach(function(t){N([e],s+t,r["defaultValue".concat(t)]||E)})}):N(P,s,E))}p=this.extendTranslation(p,e,r,f,n),O&&p===s&&this.options.appendNamespaceToMissingKey&&(p="".concat(u,":").concat(s)),O&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(p))}return p}},{key:"extendTranslation",value:function(e,t,r,n,a){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,r,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(nl({},r,{interpolation:nl({},this.options.interpolation,r.interpolation)}));var o,s=r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var l=e.match(this.interpolator.nestingRegexp);o=l&&l.length}var u=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(u=nl({},this.options.interpolation.defaultVariables,u)),e=this.interpolator.interpolate(e,u,r.lng||this.language,r),s){var c=e.match(this.interpolator.nestingRegexp);o<(c&&c.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return a&&a[0]===n[0]&&!r.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):i.translate.apply(i,n.concat([t]))},r)),r.interpolation&&this.interpolator.reset()}var d=r.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==r.applyPostProcessor&&(e=nC.handle(f,e,t,this.options&&this.options.postProcessPassResolved?nl({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,a,i,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!o.isValidLookup(t)){var l=o.extractFromKey(e,s),u=l.key;r=u;var c=l.namespaces;o.options.fallbackNS&&(c=c.concat(o.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);c.forEach(function(e){o.isValidLookup(t)||(i=e,!nj["".concat(p[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(i)&&(nj["".concat(p[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(function(r){if(!o.isValidLookup(t)){a=r;var i,l,c=u,p=[c];for(o.i18nFormat&&o.i18nFormat.addLookupKeys?o.i18nFormat.addLookupKeys(p,u,r,e,s):(d&&(i=o.pluralResolver.getSuffix(r,s.count)),d&&f&&p.push(c+i),f&&p.push(c+="".concat(o.options.contextSeparator).concat(s.context)),d&&p.push(c+=i));l=p.pop();)o.isValidLookup(t)||(n=l,t=o.getResource(r,e,l,s))}}))})}}),{res:t,usedKey:r,exactUsedKey:n,usedLng:a,usedNS:i}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),t}(nm);function nM(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nR=function(){function e(t){tM(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ng.create("languageUtils")}return tT(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return null;var t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||0>e.indexOf("-"))return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map(function(e){return e.toLowerCase()}):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=nM(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=nM(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=nM(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach(function(e){if(!t){var n=r.formatLanguageCode(e);(!r.options.supportedLngs||r.isSupportedCode(n))&&(t=n)}}),!t&&this.options.supportedLngs&&e.forEach(function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find(function(e){if(0===e.indexOf(n))return e})}}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),a=[],i=function(e){e&&(r.isSupportedCode(e)?a.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),n.forEach(function(e){0>a.indexOf(e)&&i(r.formatLanguageCode(e))}),a}}]),e}(),nP=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],nA={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(+(1!=e&&(e%10!=1||e%100==11)))},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:3*(e%100==3||e%100==4))},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},nT=function(){function e(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tM(this,e),this.languageUtils=t,this.options=n,this.logger=ng.create("pluralResolver"),this.rules=(r={},nP.forEach(function(e){e.lngs.forEach(function(t){r[t]={numbers:e.nr,plurals:nA[e.fc]}})}),r)}return tT(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map(function(e){return t+e})}},{key:"getSuffixes",value:function(e){var t=this,r=this.getRule(e);return r?r.numbers.map(function(r){return t.getSuffix(e,r)}):[]}},{key:"getSuffix",value:function(e,t){var r=this,n=this.getRule(e);if(n){var a=n.noAbs?n.plurals(t):n.plurals(Math.abs(t)),i=n.numbers[a];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON?o():this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?o():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),nN=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tM(this,e),this.logger=ng.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return tT(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:nD,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?n_(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?n_(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?n_(t.nestingPrefix):t.nestingPrefixEscaped||n_("$t("),this.nestingSuffix=t.nestingSuffix?n_(t.nestingSuffix):t.nestingSuffixEscaped||n_(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var a,i,o,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(0>e.indexOf(s.formatSeparator)){var a=nw(t,l,e);return s.alwaysFormat?s.format(a,void 0,r):a}var i=e.split(s.formatSeparator),o=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(nw(t,l,o),u,r,n)};this.resetRegExp();var d=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,f=n&&n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}].forEach(function(t){for(o=0;a=t.regex.exec(e);){if(void 0===(i=c(a[1].trim())))if("function"==typeof d){var r=d(e,a,n);i="string"==typeof r?r:""}else if(f){i=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(a[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||s.useRawValueToEscape||(i=nv(i));if(e=e.replace(a[0],t.safeValue(i)),t.regex.lastIndex=0,++o>=s.maxReplaces)break}}),e}},{key:"nest",value:function(e,t){var r,n,a=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=nl({},i);function s(e,t){var r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),a="{".concat(n[1]);e=n[0],a=(a=this.interpolate(a,o)).replace(/'/g,'"');try{o=JSON.parse(a),t&&(o=nl({},t,o))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(a)}return delete o.defaultValue,e}for(o.applyPostProcessor=!1,delete o.defaultValue;r=this.nestingRegexp.exec(e);){var l=[],u=!1;if(r[0].includes(this.formatSeparator)&&!/{.*}/.test(r[1])){var c=r[1].split(this.formatSeparator).map(function(e){return e.trim()});r[1]=c.shift(),l=c,u=!0}if((n=t(s.call(this,r[1].trim(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=nv(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),u&&(n=l.reduce(function(e,t){return a.format(e,t,i.lng,i)},n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}(),nU=function(e){function t(e,r,n){var a,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return tM(this,t),a=nc(this,nd(t).call(this)),nO&&nm.call(nu(a)),a.backend=e,a.store=r,a.services=n,a.languageUtils=n.languageUtils,a.options=i,a.logger=ng.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(n,i.backend,i),a}return np(t,e),tT(t,[{key:"queueLoad",value:function(e,t,r,n){var a=this,i=[],o=[],s=[],l=[];return e.forEach(function(e){var n=!0;t.forEach(function(t){var s="".concat(e,"|").concat(t);!r.reload&&a.store.hasResourceBundle(e,t)?a.state[s]=2:a.state[s]<0||(1===a.state[s]?0>o.indexOf(s)&&o.push(s):(a.state[s]=1,n=!1,0>o.indexOf(s)&&o.push(s),0>i.indexOf(s)&&i.push(s),0>l.indexOf(t)&&l.push(t)))}),n||s.push(e)}),(i.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:n}),{toLoad:i,pending:o,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),a=n[0],i=n[1];t&&this.emit("failedLoading",a,i,t),r&&this.store.addResourceBundle(a,i,r),this.state[e]=t?-1:2;var o={};this.queue.forEach(function(r){n=r.loaded,(l=(s=nb(n,[a],Object)).obj)[u=s.k]=l[u]||[],l[u].push(i);for(var n,s,l,u,c=r.pending,d=c.indexOf(e);-1!==d;)c.splice(d,1),d=c.indexOf(e);t&&r.errors.push(t),0!==r.pending.length||r.done||(Object.keys(r.loaded).forEach(function(e){o[e]||(o[e]=[]),r.loaded[e].length&&r.loaded[e].forEach(function(t){0>o[e].indexOf(t)&&o[e].push(t)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(function(e){return!e.done})}},{key:"read",value:function(e,t,r){var n=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,o=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[r](e,t,function(s,l){s&&l&&a<5?setTimeout(function(){n.read.call(n,e,t,r,a+1,2*i,o)},i):o(s,l)}):o(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,n,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(function(e){r.loadOne(e)})}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),a=n[0],i=n[1];this.read(a,i,"read",void 0,void 0,function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(i," for language ").concat(a," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(i," for language ").concat(a),o),t.loaded(e,n,o)})}},{key:"saveMissing",value:function(e,t,r,n,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==r||""===r||(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,nl({},i,{isUpdate:a})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),t}(nm);function nL(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&0>e.whitelist.indexOf("cimode")&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function nF(){}var nB=new(function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(tM(this,t),e=nc(this,nd(t).call(this)),nO&&nm.call(nu(e)),e.options=nL(r),e.services={},e.logger=ng,e.modules={external:[]},n&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,n),nc(e,nu(e));setTimeout(function(){e.init(r,n)},0)}return e}return np(t,e),tT(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;function n(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(r=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=nl({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===tR(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===tR(e[2])||"object"===tR(e[3])){var r=e[3]||e[2];Object.keys(r).forEach(function(e){t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,nL(t)),this.format=this.options.interpolation.format,r||(r=nF),!this.options.isClone){this.modules.logger?ng.init(n(this.modules.logger),this.options):ng.init(null,this.options);var a=new nR(this.options);this.store=new nk(this.options.resources,this.options);var i=this.services;i.logger=ng,i.resourceStore=this.store,i.languageUtils=a,i.pluralResolver=new nT(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new nN(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new nU(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];e.emit.apply(e,[t].concat(n))}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new nE(this.services,this.options),this.translator.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];e.emit.apply(e,[t].concat(n))}),this.modules.external.forEach(function(t){t.init&&t.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.length>0&&"dev"!==o[0]&&(this.options.lng=o[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}});var s=ny(),l=function(){var t=function(t,n){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),s.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),s}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nF,n=r,a="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&"cimode"===a.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach(function(e){0>i.indexOf(e)&&i.push(e)})};a?o(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e){return o(e)}),this.options.preload&&this.options.preload.forEach(function(e){return o(e)}),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=ny();return e||(e=this.languages),t||(t=this.options.ns),r||(r=nF),this.services.backendConnector.reload(e,t,function(e){n.resolve(),r(e)}),n}},{key:"use",value:function(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&nC.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=ny();this.emit("languageChanging",e);var a=function(e,a){a?(r.language=a,r.languages=r.services.languageUtils.toResolveHierarchy(a),r.translator.changeLanguage(a),r.isLanguageChangingTo=void 0,r.emit("languageChanged",a),r.logger.log("languageChanged",a)):r.isLanguageChangingTo=void 0,n.resolve(function(){return r.t.apply(r,arguments)}),t&&t(e,function(){return r.t.apply(r,arguments)})},i=function(e){var t="string"==typeof e?e:r.services.languageUtils.getBestMatchFromCodes(e);t&&(r.language||(r.language=t,r.languages=r.services.languageUtils.toResolveHierarchy(t)),r.translator.language||r.translator.changeLanguage(t),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(t)),r.loadResources(t,function(e){a(e,t)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t){var r=this,n=function e(t,n){var a;if("object"!==tR(n)){for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];a=r.options.overloadTranslationOptionHandler([t,n].concat(o))}else a=nl({},n);return a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,r.t(t,a)};return"string"==typeof e?n.lng=e:n.lngs=e,n.ns=t,n}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],a=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return -1===n||2===n};if(r.precheck){var s=r.precheck(this,o);if(void 0!==s)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||o(n,e)&&(!a||o(i,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=ny();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){0>r.options.ns.indexOf(e)&&r.options.ns.push(e)}),this.loadResources(function(e){n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=ny();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],a=e.filter(function(e){return 0>n.indexOf(e)});return a.length?(this.options.preload=n.concat(a),this.loadResources(function(e){r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nF,a=nl({},this.options,r,{isClone:!0}),i=new t(a);return["store","services","language"].forEach(function(t){i[t]=e[t]}),i.services=nl({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new nE(i.services,i.options),i.translator.on("*",function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];i.emit.apply(i,[e].concat(r))}),i.init(a,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}}]),t}(nm)),nV=I(3545),nz=I.n(nV);let nH=JSON.parse('{"UU":"@ohif/extension-default"}').UU;var nW=I(2220),n$=I.n(nW),nY=I(3110);let{toNumber:nG}=K.utils;var nq=I(534),nX=I.n(nq),nK=I(7155);let{calculateScanAxisNormal:nJ}=K.utils,{areAllImageOrientationsEqual:nZ}=K.utils;var nQ=I(7238),n0=I.n(nQ);function n1(e){let t=new(n0())(e),r=new K.DisplaySetMessageList,n=e[0];if(e.length){let e=n.SOPClassUID;e?r.addMessage(K.DisplaySetMessage.CODES.UNSUPPORTED_SOP_CLASS_UID,{sopClassUid:e}):r.addMessage(K.DisplaySetMessage.CODES.MISSING_SOP_CLASS_UID)}else r.addMessage(K.DisplaySetMessage.CODES.NO_VALID_INSTANCES);return t.setAttributes({displaySetInstanceUID:t.uid,SeriesDate:n.SeriesDate,SeriesTime:n.SeriesTime,SeriesInstanceUID:n.SeriesInstanceUID,StudyInstanceUID:n.StudyInstanceUID,SeriesNumber:n.SeriesNumber||0,FrameRate:n.FrameTime,SOPClassUID:n.SOPClassUID,SeriesDescription:n.SeriesDescription||"",Modality:n.Modality,instances:e,instance:e[n.length-1],unsupported:!0,SOPClassHandlerId:"unsupported",isReconstructable:!1,messages:r}),[t]}let n2="chart",n3=["1.9.451.13215.7.3.2.7.6.1"],n4=e=>(function(e){let t;if(!e||!e.length)throw Error("No instances were provided");let r=(t=new Set,e.forEach(e=>{t.add(e.SOPClassUID)}),Array.from(t));return e.map(e=>{if("CHT"===e.Modality)return((e,t)=>{let{StudyInstanceUID:r,SeriesInstanceUID:n,SOPInstanceUID:a,SeriesDescription:i,SeriesNumber:o,SOPClassUID:s}=e,{SeriesDate:l,SeriesTime:u}=K.utils.getLatestInstanceDateTime(e);return{Modality:"CHT",loading:!1,isReconstructable:!1,displaySetInstanceUID:K.utils.guid(),SeriesDescription:i,SeriesNumber:o,SeriesDate:l,SeriesTime:u,SOPInstanceUID:a,SeriesInstanceUID:n,StudyInstanceUID:r,SOPClassHandlerId:`${nH}.sopClassHandlerModule.${n2}`,SOPClassUID:s,isDerivedDisplaySet:!0,isLoaded:!0,sopClassUids:t,instance:e,instances:[e],addInstances:function(e,t){this.instances.push(...e),this.instance=this.instances[this.instances.length-1];let{SeriesDate:r,SeriesTime:n}=K.utils.getLatestInstanceDateTime(this.instance);return this.SeriesDate=r,this.SeriesTime=n,this}}})(e,r);throw Error("Unsupported modality")})})(e);var n5=I(6557);let{isImage:n8,sortStudyInstances:n6,sopClassDictionary:n9,isDisplaySetReconstructable:n7}=K.utils,{ImageSet:ae}=K.classes,at="stack",ar={},an=(e,t)=>{n6(e);let r=e[0],n=new ae(e),{extensionManager:a}=ar,i=a.getActiveDataSource()[0],o=i.getImageIdsForDisplaySet(n),{isDynamicVolume:s,value:l,averageSpacingBetweenFrames:u,dynamicVolumeInfo:c}=function(e,t){let r,n=(e=>{let{extensionManager:t}=ar;if(!t)throw Error("extensionManager is not available");let{getDynamicVolumeInfo:r}=t.getModuleEntry("@ohif/extension-cornerstone.utilityModule.volumeLoader").exports;return r(e)})(t),{isDynamicVolume:a,timePoints:i}=n,{appConfig:o}=ar;if(a){let t,n=i[0],a=new Map;e[0].NumberOfFrames>1&&i.length>1?(t=i[0].map(e=>n5.metaData.get("instance",e)).filter(Boolean)).length||(t=[e[0]]):(e.forEach(e=>a.set(e.imageId,e)),t=n.map(e=>a.get(e)).filter(Boolean)),r=n7(t,o)}else r=n7(e,o);return{isDynamicVolume:a,...r,dynamicVolumeInfo:n}}(e,o),d=s?"cornerstoneStreamingDynamicImageVolume":"cornerstoneStreamingImageVolume",f=function(e,t,r){var n;let a=new K.DisplaySetMessageList;if(r)return a;if(!e.length)return void a.addMessage(K.DisplaySetMessage.CODES.NO_VALID_INSTANCES);let{Modality:i,ImageType:o,NumberOfFrames:s}=e[0];if(o?.includes("LOCALIZER")||!nY.constructableModalities.includes(i))return a;let l=s>1;l||e.every(e=>e.ImagePositionPatient)||a.addMessage(K.DisplaySetMessage.CODES.NO_POSITION_INFORMATION);let u=n$()(e);return l?(n=u[0],(0,nY.hasPixelMeasurements)(n)||a.addMessage(K.DisplaySetMessage.CODES.MULTIFRAME_NO_PIXEL_MEASUREMENTS),(0,nY.hasOrientation)(n)||a.addMessage(K.DisplaySetMessage.CODES.MULTIFRAME_NO_ORIENTATION),(0,nY.hasPosition)(n)||a.addMessage(K.DisplaySetMessage.CODES.MULTIFRAME_NO_POSITION_INFORMATION)):u.length>2&&(!function(e){if(!e?.length)return!1;let t=e[0],r=nG(t.Rows),n=nG(t.Columns);for(let t=1;t<e.length;t++){let{Rows:a,Columns:i}=e[t];if(nG(a)!==r||nG(i)!==n)return!1}return!0}(u)&&a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_DIMENSIONS),!function(e){if(!e?.length)return!1;let t=e[0],r=nX()(t.SamplesPerPixel);for(let t=1;t<e.length;t++){let{SamplesPerPixel:n}=e[t];if(n!==r)return!1}return!0}(u)&&a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_COMPONENTS),nZ(u)||a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_ORIENTATIONS),!function(e){if(!e?.length)return!1;let t=nX()(e[0].ImageOrientationPatient);if(!t)return!1;let r=nJ(t),n=nX()(e[0].ImagePositionPatient),a=nX()(e[e.length-1].ImagePositionPatient);if(!n||!a)return!1;let i=(0,nY._getPerpendicularDistance)(n,a)/(e.length-1),o=n;for(let t=1;t<e.length;t++){let n=e[t],a=nX()(n.ImagePositionPatient);if(function(e,t,r,n){let a=nK.vec3.scaleAndAdd(nK.vec3.create(),e,r,n);return nK.vec3.distance(t,a)>n}(o,a,r,i))return!1;o=a}return!0}(u)&&a.addMessage(K.DisplaySetMessage.CODES.INCONSISTENT_POSITION_INFORMATION),function(e,t){if(!e?.length)return;let r=nX()(e[0].ImagePositionPatient);if(!r)return;let n=nX()(e[e.length-1].ImagePositionPatient);if(!n)return;let a=(0,nY._getPerpendicularDistance)(r,n)/(e.length-1),i=r,o=[];for(let r=1;r<e.length;r++){let n=e[r],s=nX()(n.ImagePositionPatient),l=(0,nY._getPerpendicularDistance)(s,i),u=(0,nY._getSpacingIssue)(l,a);if(u){let e=u.issue;if(o.includes(e)||(o.push(e),e===nY.reconstructionIssues.MISSING_FRAMES?t.addMessage(K.DisplaySetMessage.CODES.MISSING_FRAMES):e===nY.reconstructionIssues.IRREGULAR_SPACING&&t.addMessage(K.DisplaySetMessage.CODES.IRREGULAR_SPACING)),o.length>1)break}i=s}}(u,a)),t||a.addMessage(K.DisplaySetMessage.CODES.NOT_RECONSTRUCTABLE),a}(e,l,s);n.setAttributes({volumeLoaderSchema:d,displaySetInstanceUID:n.uid,SeriesDate:r.SeriesDate,SeriesTime:r.SeriesTime,SeriesInstanceUID:r.SeriesInstanceUID,StudyInstanceUID:r.StudyInstanceUID,SeriesNumber:r.SeriesNumber||0,FrameRate:r.FrameTime,SOPClassUID:r.SOPClassUID,SeriesDescription:r.SeriesDescription||"",Modality:r.Modality,isMultiFrame:r.NumberOfFrames>1,countIcon:l?"icon-mpr":void 0,numImageFrames:e.length,SOPClassHandlerId:`${nH}.sopClassHandlerModule.${at}`,isReconstructable:l,messages:f,averageSpacingBetweenFrames:u||null,isDynamicVolume:s,dynamicVolumeInfo:c,supportsWindowLevel:!0,label:r.SeriesDescription||`${nz().t("Series")} ${r.SeriesNumber} - ${nz().t(r.Modality)}`,FrameOfReferenceUID:r.FrameOfReferenceUID});let p=o[Math.floor(o.length/2)],h=e[Math.floor(e.length/2)];if(s){let e=c.timePoints,t=Math.floor(e.length/2),r=e[t];p=r[Math.floor(r.length/2)]}n.setAttributes({getThumbnailSrc:i.retrieve.getGetThumbnailSrc?.(h,p)});let{servicesManager:g}=ar,{customizationService:m}=g.services;return n.sort(m),n};function aa(e){let t;if(!e||!e.length)throw Error("No instances were provided");let r=[],n=(t=new Set,e.forEach(e=>{t.add(e.SOPClassUID)}),Array.from(t)),a=[];if(e.forEach((e,t)=>{let i;if(n8(e.SOPClassUID)||e.Rows)if(e.NumberOfFrames>1)(i=an([e],t)).setAttributes({sopClassUids:n,numImageFrames:e.NumberOfFrames,instanceNumber:e.InstanceNumber,acquisitionDatetime:e.AcquisitionDateTime}),r.push(i);else{let o;"CR"===(o=e.Modality)||"MG"===o||"DX"===o?((i=an([e],t)).setAttributes({sopClassUids:n,instanceNumber:e.InstanceNumber,acquisitionDatetime:e.AcquisitionDateTime}),r.push(i)):a.push(e)}}),a.length){let t=an(a,r.length);t.setAttribute("studyInstanceUid",e[0].StudyInstanceUID),t.setAttributes({sopClassUids:n}),r.push(t)}return r}let ai=[n9.ComputedRadiographyImageStorage,n9.DigitalXRayImageStorageForPresentation,n9.DigitalXRayImageStorageForProcessing,n9.DigitalMammographyXRayImageStorageForPresentation,n9.DigitalMammographyXRayImageStorageForProcessing,n9.DigitalIntraOralXRayImageStorageForPresentation,n9.DigitalIntraOralXRayImageStorageForProcessing,n9.CTImageStorage,n9.EnhancedCTImageStorage,n9.LegacyConvertedEnhancedCTImageStorage,n9.UltrasoundMultiframeImageStorage,n9.MRImageStorage,n9.EnhancedMRImageStorage,n9.EnhancedMRColorImageStorage,n9.LegacyConvertedEnhancedMRImageStorage,n9.UltrasoundImageStorage,n9.UltrasoundImageStorageRET,n9.SecondaryCaptureImageStorage,n9.MultiframeSingleBitSecondaryCaptureImageStorage,n9.MultiframeGrayscaleByteSecondaryCaptureImageStorage,n9.MultiframeGrayscaleWordSecondaryCaptureImageStorage,n9.MultiframeTrueColorSecondaryCaptureImageStorage,n9.XRayAngiographicImageStorage,n9.EnhancedXAImageStorage,n9.XRayRadiofluoroscopicImageStorage,n9.EnhancedXRFImageStorage,n9.XRay3DAngiographicImageStorage,n9.XRay3DCraniofacialImageStorage,n9.BreastTomosynthesisImageStorage,n9.CornealTopographyMapStorage,n9.BreastProjectionXRayImageStorageForPresentation,n9.BreastProjectionXRayImageStorageForProcessing,n9.IntravascularOpticalCoherenceTomographyImageStorageForPresentation,n9.IntravascularOpticalCoherenceTomographyImageStorageForProcessing,n9.NuclearMedicineImageStorage,n9.VLEndoscopicImageStorage,n9.VideoEndoscopicImageStorage,n9.VLMicroscopicImageStorage,n9.VideoMicroscopicImageStorage,n9.VLSlideCoordinatesMicroscopicImageStorage,n9.VLPhotographicImageStorage,n9.VideoPhotographicImageStorage,n9.OphthalmicPhotography8BitImageStorage,n9.OphthalmicPhotography16BitImageStorage,n9.OphthalmicTomographyImageStorage,n9.PositronEmissionTomographyImageStorage,n9.EnhancedPETImageStorage,n9.LegacyConvertedEnhancedPETImageStorage,n9.RTImageStorage,n9.EnhancedUSVolumeStorage,n9.RTDoseStorage];function ao(e,t){return(0,tu.jsx)(tl.LayoutSelector.Preset,{title:e.title,icon:e.icon,commandOptions:e.commandOptions,disabled:e.disabled,isPreset:!0},`advanced-preset-${t}`)}function as(e,t){return(0,tu.jsx)(tl.LayoutSelector.Preset,{icon:e.icon,commandOptions:e.commandOptions,isPreset:!1},`common-preset-${t}`)}let al=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k=(0,ti.c)(62);k[0]!==e?({commandsManager:t,servicesManager:n,rows:a,columns:i,...r}=e,k[0]=e,k[1]=t,k[2]=r,k[3]=n,k[4]=a,k[5]=i):(t=k[1],r=k[2],n=k[3],a=k[4],i=k[5]);let C=void 0===a?3:a,j=void 0===i?4:i,{customizationService:E}=n.services,{t:M}=tQ("ToolbarLayoutSelector");if(k[6]!==t||k[7]!==E||k[8]!==r||k[9]!==n||k[10]!==M){let e,a,i=E?.getCustomization("layoutSelector.commonPresets")||[{icon:"layout-single",commandOptions:{numRows:1,numCols:1}},{icon:"layout-side-by-side",commandOptions:{numRows:1,numCols:2}},{icon:"layout-four-up",commandOptions:{numRows:2,numCols:2}},{icon:"layout-three-row",commandOptions:{numRows:3,numCols:1}}],h=E?.getCustomization("layoutSelector.advancedPresetGenerator"),g=h?h({servicesManager:n}):[{title:"MPR",icon:"layout-three-col",commandOptions:{protocolId:"mpr"}},{title:"3D four up",icon:"layout-four-up",commandOptions:{protocolId:"3d-four-up"}},{title:"3D main",icon:"layout-three-row",commandOptions:{protocolId:"3d-main"}},{title:"Axial Primary",icon:"layout-side-by-side",commandOptions:{protocolId:"axial-primary"}},{title:"3D only",icon:"layout-single",commandOptions:{protocolId:"3d-only"}},{title:"3D primary",icon:"layout-side-by-side",commandOptions:{protocolId:"3d-primary"}},{title:"Frame View",icon:"icon-stack",commandOptions:{protocolId:"frame-view"}}];k[19]!==t?(e=(e,r)=>{r?t.run({commandName:"setHangingProtocol",commandOptions:{...e,restoreCachedLayout:!1}}):t.run({commandName:"setViewportGridLayout",commandOptions:e})},k[19]=t,k[20]=e):e=k[20];let m=e;f="Layout",p="Layout",s=tl.LayoutSelector,u=m,c=r,k[21]!==M?(a=M("Change layout"),k[21]=M,k[22]=a):a=k[22],k[23]!==a?(d=(0,tu.jsx)(tl.LayoutSelector.Trigger,{tooltip:a}),k[23]=a,k[24]=d):d=k[24],o=tl.LayoutSelector.Content,l=(i.length>0||g.length>0)&&(0,tu.jsxs)("div",{className:"bg-popover flex flex-col gap-2.5 rounded-lg p-2",children:[i.length>0&&(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.LayoutSelector.PresetSection,{title:M("Common"),children:i.map(as)}),(0,tu.jsx)(tl.LayoutSelector.Divider,{})]}),g.length>0&&(0,tu.jsx)(tl.LayoutSelector.PresetSection,{title:M("Advanced"),children:g.map(ao)})]}),k[6]=t,k[7]=E,k[8]=r,k[9]=n,k[10]=M,k[11]=o,k[12]=s,k[13]=l,k[14]=u,k[15]=c,k[16]=d,k[17]=f,k[18]=p}else o=k[11],s=k[12],l=k[13],u=k[14],c=k[15],d=k[16],f=k[17],p=k[18];return k[25]!==M?(h=M("Custom"),k[25]=M,k[26]=h):h=k[26],k[27]!==h?(g=(0,tu.jsx)("div",{className:"text-muted-foreground text-xs",children:h}),k[27]=h,k[28]=g):g=k[28],k[29]!==j||k[30]!==C?(m=(0,tu.jsx)(tl.LayoutSelector.GridSelector,{rows:C,columns:j}),k[29]=j,k[30]=C,k[31]=m):m=k[31],k[32]!==M?(y=M("Hover to select"),k[32]=M,k[33]=y):y=k[33],k[34]===Symbol.for("react.memo_cache_sentinel")?(v=(0,tu.jsx)("br",{}),k[34]=v):v=k[34],k[35]!==M?(b=M("rows and columns"),k[35]=M,k[36]=b):b=k[36],k[37]===Symbol.for("react.memo_cache_sentinel")?(x=(0,tu.jsx)("br",{}),k[37]=x):x=k[37],k[38]!==M?(S=M("Click to apply"),k[38]=M,k[39]=S):S=k[39],k[40]!==y||k[41]!==b||k[42]!==S?(w=(0,tu.jsxs)(tl.LayoutSelector.HelpText,{children:[y," ",v,b," ",x,S]}),k[40]=y,k[41]=b,k[42]=S,k[43]=w):w=k[43],k[44]!==g||k[45]!==m||k[46]!==w?(_=(0,tu.jsxs)("div",{className:"bg-muted flex flex-col gap-2.5 border-l-2 border-solid border-background p-2",children:[g,m,w]}),k[44]=g,k[45]=m,k[46]=w,k[47]=_):_=k[47],k[48]!==o||k[49]!==_||k[50]!==l?(I=(0,tu.jsxs)(o,{children:[l,_]}),k[48]=o,k[49]=_,k[50]=l,k[51]=I):I=k[51],k[52]!==s||k[53]!==I||k[54]!==u||k[55]!==c||k[56]!==d?(D=(0,tu.jsxs)(s,{onSelectionChange:u,...c,children:[d,I]}),k[52]=s,k[53]=I,k[54]=u,k[55]=c,k[56]=d,k[57]=D):D=k[57],k[58]!==D||k[59]!==f||k[60]!==p?(O=(0,tu.jsx)("div",{id:f,"data-cy":p,children:D}),k[58]=D,k[59]=f,k[60]=p,k[61]=O):O=k[61],O},au=(e=[])=>e.map(e=>({label:e.name,value:e.id,info:e.info,activated:!1,completed:!1}));function ac(){let e,t,r,n,a,i,o,s=(0,ti.c)(15),{servicesManager:l}=(0,K.useSystem)(),{workflowStepsService:u}=l.services,[c,d]=(0,to.useState)(u.activeWorkflowStep?.id);s[0]!==u.workflowSteps?(e=au(u.workflowSteps),s[0]=u.workflowSteps,s[1]=e):e=s[1];let[f,p]=(0,to.useState)(e);s[2]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let{selectedOption:t}=e;t&&(t.completed||p(e=>{let r=[...e],n=r.findIndex(e=>e.value===t.value);for(let e=n;e>=0;e--){let t=r[e];if(t.completed)break;r[e]={...t,completed:!0}}return r}),d(t.value))},s[2]=t):t=s[2];let h=t;return s[3]!==c||s[4]!==u?(r=()=>{let e;return c&&u.setActiveWorkflowStep(c),()=>clearTimeout(e)},n=[c,u],s[3]=c,s[4]=u,s[5]=r,s[6]=n):(r=s[5],n=s[6]),(0,to.useEffect)(r,n),s[7]!==u?(a=()=>{let{unsubscribe:e}=u.subscribe(u.EVENTS.STEPS_CHANGED,()=>p(au(u.workflowSteps))),{unsubscribe:t}=u.subscribe(u.EVENTS.ACTIVE_STEP_CHANGED,()=>d(u.activeWorkflowStep.id));return()=>{e(),t()}},s[7]=u,s[8]=a):a=s[8],s[9]!==l||s[10]!==u?(i=[l,u],s[9]=l,s[10]=u,s[11]=i):i=s[11],(0,to.useEffect)(a,i),s[12]!==c||s[13]!==f?(o=(0,tu.jsx)(tl.ProgressDropdown,{options:f,value:c,onChange:h}),s[12]=c,s[13]=f,s[14]=o):o=s[14],o}var ad=I(1459);function af(e){let t,r,n,a,i,o,s,l,u,c,d,f=(0,ti.c)(42),{buttonSection:p,id:h}=e;f[0]!==p?(t={buttonSection:p},f[0]=p,f[1]=t):t=f[1];let{onInteraction:g,toolbarButtons:m}=(0,ad.useToolbar)(t);if(!m?.length)return null;f[2]!==m?(r=m.find(ah)?.componentProps||m[0].componentProps,f[2]=m,f[3]=r):r=f[3];let y=r;if(f[4]!==h||f[5]!==g||f[6]!==y||f[7]!==m){let e,t,r,u=m.map(ap);a=tl.ToolButtonList;let c=`${h}-split-button-primary`;f[14]!==h||f[15]!==g||f[16]!==y.commands?(e=e=>{let{itemId:t}=e;return g?.({id:h,itemId:t,commands:y.commands})},f[14]=h,f[15]=g,f[16]=y.commands,f[17]=e):e=f[17],f[18]!==y||f[19]!==e?(t=(0,tu.jsx)(tl.ToolButton,{...y,onInteraction:e,className:y.className}),f[18]=y,f[19]=e,f[20]=t):t=f[20],f[21]!==y.id||f[22]!==y.isActive||f[23]!==c||f[24]!==t?(s=(0,tu.jsx)(tl.ToolButtonListDefault,{children:(0,tu.jsx)("div",{"data-cy":c,"data-tool":y.id,"data-active":y.isActive,children:t})}),f[21]=y.id,f[22]=y.isActive,f[23]=c,f[24]=t,f[25]=s):s=f[25];let d=y.isActive?"opacity-0":"opacity-100";f[26]!==d?(l=(0,tu.jsx)(tl.ToolButtonListDivider,{className:d}),f[26]=d,f[27]=l):l=f[27],o=`${h}-split-button-secondary`,n=tl.ToolButtonListDropDown,f[28]!==h||f[29]!==g?(r=e=>(0,tu.jsx)(tl.ToolButtonListItem,{...e,"data-cy":e.id,"data-tool":e.id,"data-active":e.isActive,onSelect:()=>g?.({id:h,itemId:e.id,commands:e.commands}),children:(0,tu.jsx)("span",{className:"pl-1",children:e.label||e.tooltip||e.id})},e.id),f[28]=h,f[29]=g,f[30]=r):r=f[30],i=u.map(r),f[4]=h,f[5]=g,f[6]=y,f[7]=m,f[8]=n,f[9]=a,f[10]=i,f[11]=o,f[12]=s,f[13]=l}else n=f[8],a=f[9],i=f[10],o=f[11],s=f[12],l=f[13];return f[31]!==n||f[32]!==i?(u=(0,tu.jsx)(n,{children:i}),f[31]=n,f[32]=i,f[33]=u):u=f[33],f[34]!==o||f[35]!==u?(c=(0,tu.jsx)("div",{"data-cy":o,children:u}),f[34]=o,f[35]=u,f[36]=c):c=f[36],f[37]!==a||f[38]!==s||f[39]!==l||f[40]!==c?(d=(0,tu.jsxs)(a,{children:[s,l,c]}),f[37]=a,f[38]=s,f[39]=l,f[40]=c,f[41]=d):d=f[41],d}function ap(e){return e.componentProps}function ah(e){return e.componentProps.isActive}let ag=function(e){let t,r,n,a=(0,ti.c)(12),{buttonSection:i,className:o,show:s}=e;a[0]!==i?(t={buttonSection:i},a[0]=i,a[1]=t):t=a[1];let{onInteraction:l,toolbarButtons:u}=(0,K.useToolbar)(t);if(!u?.length)return null;let c=`space-x-1} flex flex-row items-center ${void 0===o?"":o}`;if(a[2]!==i||a[3]!==l||a[4]!==u){let e;a[6]!==i||a[7]!==l?(e=(e,t)=>{let{id:r,Component:n,componentProps:a}=e;return(0,tu.jsx)("div",{className:"flex-shrink-0",children:(0,tu.jsx)(n,{...a,onInteraction:l,location:a.location||i})},r||t)},a[6]=i,a[7]=l,a[8]=e):e=a[8],r=u.map(e),a[2]=i,a[3]=l,a[4]=u,a[5]=r}else r=a[5];return a[9]!==c||a[10]!==r?(n=(0,tu.jsx)("div",{className:c,children:r}),a[9]=c,a[10]=r,a[11]=n):n=a[11],n};var am=I(5530),ay=I.n(am),av=I(4687);function ab(e){let t,r,n,a,i=(0,ti.c)(13),{buttonSection:o,id:s}=e;i[0]!==o?(t={buttonSection:o},i[0]=o,i[1]=t):t=i[1];let{onInteraction:l,toolbarButtons:u}=(0,av.useToolbar)(t);if(!o)return null;if(i[2]!==s||i[3]!==l||i[4]!==u){let e,t=u.map(ax);r="bg-popover flex flex-row space-x-1 rounded-md px-0 py-0",i[7]!==s||i[8]!==l?(e=e=>(0,to.createElement)(tl.ToolButton,{...e,key:e.id,size:"small",className:e.disabled&&"text-foreground/70",onInteraction:t=>{l?.({event:t,id:s,commands:e.commands,itemId:e.id,item:e})}}),i[7]=s,i[8]=l,i[9]=e):e=i[9],n=t.map(e),i[2]=s,i[3]=l,i[4]=u,i[5]=r,i[6]=n}else r=i[5],n=i[6];return i[10]!==r||i[11]!==n?(a=(0,tu.jsx)("div",{className:r,children:n}),i[10]=r,i[11]=n,i[12]=a):a=i[12],a}function ax(e){return e.componentProps}function aS(e){let t,r,n,a,i,o,s,l,u,c,d,f,p=(0,ti.c)(24);if(p[0]!==e){let{onInteraction:c,className:d,options:f,...h}=e;r=c,n=f,a=h,u="bg-popover flex flex-row rounded-md px-0 py-0",t=tl.ToolButton,i=a,o=a.id,s="small",l=ay()(a.disabled&&"text-foreground/70",d),p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=a,p[5]=i,p[6]=o,p[7]=s,p[8]=l,p[9]=u}else t=p[1],r=p[2],n=p[3],a=p[4],i=p[5],o=p[6],s=p[7],l=p[8],u=p[9];return p[10]!==r||p[11]!==n||p[12]!==a?(c=e=>{r?.({event:e,itemId:a.id,commands:a.commands,options:n})},p[10]=r,p[11]=n,p[12]=a,p[13]=c):c=p[13],p[14]!==t||p[15]!==i||p[16]!==o||p[17]!==s||p[18]!==l||p[19]!==c?(d=(0,tu.jsx)(t,{...i,id:o,size:s,className:l,onInteraction:c}),p[14]=t,p[15]=i,p[16]=o,p[17]=s,p[18]=l,p[19]=c,p[20]=d):d=p[20],p[21]!==u||p[22]!==d?(f=(0,tu.jsx)("div",{className:u,children:d}),p[21]=u,p[22]=d,p[23]=f):f=p[23],f}function aw(e){let t,r,n=(0,ti.c)(7),{IconContainer:a,containerProps:i}=(0,tl.useIconPresentation)();n[0]!==e.icon?(t=(0,tu.jsx)(tl.Icons.ByName,{name:e.icon}),n[0]=e.icon,n[1]=t):t=n[1];let o=t;return n[2]!==o||n[3]!==a||n[4]!==i||n[5]!==e?(r=(0,tu.jsx)("div",{children:a?(0,tu.jsx)(a,{disabled:e.disabled,...e,...i,children:o}):(0,tu.jsx)(tl.Button,{variant:"ghost",size:"icon",disabled:e.disabled,children:o})}),n[2]=o,n[3]=a,n[4]=i,n[5]=e,n[6]=r):r=n[6],r}let a_=J().classes.MetadataProvider,aI="[SEG register]",aD=new Set;function aO(e,t={}){let r=Array.isArray(e)?e:[e],{referencedImageIds:n=[]}=t;return r.forEach(e=>(function(e,t={}){let{referencedImageIds:r=[]}=t;if(void 0===e.PixelData&&!Array.isArray(e.PerFrameFunctionalGroupsSequence))return void J().log.debug(aI,"Skipping local wadouri registration (no pixel data)",{SOPClassUID:e.SOPClassUID,SOPInstanceUID:e.SOPInstanceUID});let n=eE(e),a=eu().wadouri.fileManager.add(n);aD.add(a),ek(e,"url",a);let{StudyInstanceUID:i,SeriesInstanceUID:o}=e,s=e.SOPInstanceUID||e.SopInstanceUID,l=e.PerFrameFunctionalGroupsSequence;Array.isArray(l)&&!e.NumberOfFrames&&(e.NumberOfFrames=l.length);let u=Math.max(Number(e.NumberOfFrames)||0,Array.isArray(l)?l.length:0,1),c=[];if(i&&o&&s){let e=(e,t=1)=>{a_.addImageIdToUIDs(e,{StudyInstanceUID:i,SeriesInstanceUID:o,SOPInstanceUID:s,frameNumber:t})};for(let t=1;t<=u;t++){let r=u>1?eJ(a,t):a;c.push(r),e(r,t)}}return eC(e),J().log.debug(aI,"Registered local wadouri instance",{StudyInstanceUID:i,SeriesInstanceUID:o,SOPInstanceUID:s,numberOfFrames:u,baseImageId:a,frameImageIds:c,blobSizeBytes:n.size,referencedImageIdCount:r.length,SegmentationType:e.SegmentationType,SOPClassUID:e.SOPClassUID}),a})(e,{referencedImageIds:n})),r}let ak=J().classes.MetadataProvider;var aC=I(4713);class aj{constructor(e,t){this.commandsManager=void 0,this.services=void 0,this.menuItems=void 0,this.services=e.services,this.commandsManager=t}closeContextMenu(){this.services.uiDialogService.hide("context-menu")}showContextMenu(e,t,r){if(!this.services.uiDialogService)return void console.warn("Unable to show dialog; no UI Dialog Service available.");let{event:n,subMenu:a,menuId:i,menus:o,selectorProps:s}=e;if(!o)return void console.warn("No menus found for",i);let{locking:l,visibility:u}=aC.annotation,c=s?.nearbyToolData?.annotationUID;if(c){let e=l.isAnnotationLocked(c),t=u.isAnnotationVisible(c);if(e||!t)return void console.warn(`Annotation is ${e?"locked":"not visible"}.`)}let d=function e(t,r,n,a){let i={selectorProps:t,event:r},o=function(e,t,r){let{subMenu:n}=t,a=function*(){yield function(e,t){if(t)return e.find(e=>e.id===t)}(e,r||n),yield!e?null:e.find(e=>!e.selector||e.selector(t.selectorProps))}(),i=a.next(),o=i.value;for(;!i.done;)(o=i.value)&&a.return(),i=a.next();return o}(n,i,a);if(!o)return;if(!o.items)return console.warn("Must define items in menu",o),[];let s=[];return o.items.forEach(a=>{let{delegating:o,selector:l,subMenu:u}=a;if(!l||l(t))if(o)s=[...s,...e(t,r,n,u)];else{var c,d;let e,t=(c=a,d=i,e={...c,value:d.selectorProps?.value},"ShowSubMenu"!==c.actionType||e.iconRight||(e.iconRight="chevron-down"),c.action||(e.action=(t,r)=>{let{event:n={}}=r,{detail:a={}}=n;e.element=a.element,r.onClose();let i=r[`on${t.actionType||"Default"}`];i?i.call(r,e,t,d):console.warn("No action defined for",t)}),e);s.push(t)}}),s}(s||e,n,o,i);if(!d)return;let f=this.services.customizationService.getCustomization("ui.contextMenu");this.services.uiDialogService.hide("context-menu"),this.services.uiDialogService.show({id:"context-menu",showOverlay:!1,defaultPosition:aj._getDefaultPosition(r,n?.detail||n,t),content:f,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,unstyled:!0,contentProps:{items:d,selectorProps:s,menus:o,event:n,subMenu:a,eventData:n?.detail||n,onClose:()=>{this.services.uiDialogService.hide("context-menu")},onShowSubMenu:(n,a,i)=>{a.subMenu?this.showContextMenu({...e,menuId:a.subMenu},t,r):console.warn("No submenu defined for",n,a,i)},onDefault:(e,t,r)=>{this.commandsManager.run(e,{...s,...t,subProps:r})}}})}}aj.getDefaultPosition=()=>({x:0,y:0}),aj._getEventDefaultPosition=e=>({x:e?.currentPoints?.client[0]??e?.pageX,y:e?.currentPoints?.client[1]??e?.pageY}),aj._getElementDefaultPosition=e=>{if(e){let t=e.getBoundingClientRect();return{x:t.x,y:t.y}}return{x:void 0,y:void 0}},aj._getCanvasPointsPosition=(e=[],t)=>{let r=aj._getElementDefaultPosition(t);for(let t=0;t<e.length;t++){let n={x:e[t][0]||e[t].x,y:e[t][1]||e[t].y};if(aj._isValidPosition(n)&&aj._isValidPosition(r))return{x:n.x+r.x,y:n.y+r.y}}},aj._isValidPosition=e=>e&&"number"==typeof e.x&&"number"==typeof e.y,aj._getDefaultPosition=(e,t,r)=>{let n=function*(){yield aj._getCanvasPointsPosition(e,r),yield aj._getEventDefaultPosition(t),yield aj._getElementDefaultPosition(r),yield aj.getDefaultPosition()}(),a=n.next(),i=a.value;for(;!a.done;)i=a.value,aj._isValidPosition(i)&&n.return(),a=n.next();return i};var aE=I(4867),aM=I.n(aE);function aR(){return(aR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}var aP=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function aA(e,t){if(e.length!==t.length)return!1;for(var r,n,a=0;a<e.length;a++)if(!((r=e[a])===(n=t[a])||aP(r)&&aP(n))&&1)return!1;return!0}let aT=function(e,t){void 0===t&&(t=aA);var r,n,a=[],i=!1;return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return i&&r===this&&t(o,a)||(n=e.apply(this,o),i=!0,r=this,a=o),n}};var aN="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function aU(e){cancelAnimationFrame(e.id)}var aL=-1;function aF(e){if(void 0===e&&(e=!1),-1===aL||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),aL=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return aL}var aB=null;function aV(e){if(void 0===e&&(e=!1),null===aB||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),a=n.style;a.width="100px",a.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?aB="positive-descending":(t.scrollLeft=1,aB=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t)}return aB}var az=function(e,t){return e},aH=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},aW=function(e,t,r){var n=e.itemSize,a=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var o=0;if(i>=0){var s=a[i];o=s.offset+s.size}for(var l=i+1;l<=t;l++){var u=n(l);a[l]={offset:o,size:u},o+=u}r.lastMeasuredIndex=t}return a[t]},a$=function(e,t,r){var n=t.itemMetadataMap,a=t.lastMeasuredIndex;return(a>0?n[a].offset:0)>=r?aY(e,t,a,0,r):aG(e,t,Math.max(0,a),r)},aY=function(e,t,r,n,a){for(;n<=r;){var i=n+Math.floor((r-n)/2),o=aW(e,i,t).offset;if(o===a)return i;o<a?n=i+1:o>a&&(r=i-1)}return n>0?n-1:0},aG=function(e,t,r,n){for(var a=e.itemCount,i=1;r<a&&aW(e,r,t).offset<n;)r+=i,i*=2;return aY(e,t,Math.min(r,a-1),Math.floor(r/2),n)},aq=function(e,t){var r=e.itemCount,n=t.itemMetadataMap,a=t.estimatedItemSize,i=t.lastMeasuredIndex,o=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];o=s.offset+s.size}return o+(r-i-1)*a},aX=(u=(s={getItemOffset:function(e,t,r){return aW(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:aq,getOffsetForIndexAndAlignment:function(e,t,r,n,a,i){var o=e.direction,s=e.height,l=e.layout,u=e.width,c="horizontal"===o||"horizontal"===l?u:s,d=aW(e,t,a),f=Math.max(0,Math.min(aq(e,a)-c,d.offset)),p=Math.max(0,d.offset-c+d.size+i);switch("smart"===r&&(r=n>=p-c&&n<=f+c?"auto":"center"),r){case"start":return f;case"end":return p;case"center":return Math.round(p+(f-p)/2);default:if(n>=p&&n<=f)return n;if(n<p)return p;return f}},getStartIndexForOffset:function(e,t,r){return a$(e,r,t)},getStopIndexForStartIndex:function(e,t,r,n){for(var a=e.direction,i=e.height,o=e.itemCount,s=e.layout,l=e.width,u=aW(e,t,n),c=r+("horizontal"===a||"horizontal"===s?l:i),d=u.offset+u.size,f=t;f<o-1&&d<c;)d+=aW(e,++f,n).size;return f},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,n){void 0===n&&(n=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),n&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}).getItemOffset,c=s.getEstimatedTotalSize,d=s.getItemSize,f=s.getOffsetForIndexAndAlignment,p=s.getStartIndexForOffset,h=s.getStopIndexForStartIndex,g=s.initInstanceProps,m=s.shouldResetStyleCacheOnItemSizeChange,y=s.validateProps,(l=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=g(r.props,nu(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:nu(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=aT(function(e,t,n,a){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:a})}),r._callOnScroll=void 0,r._callOnScroll=aT(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,n=r.props,a=n.direction,i=n.itemSize,o=n.layout,s=r._getItemStyleCache(m&&i,m&&o,m&&a);if(s.hasOwnProperty(e))t=s[e];else{var l=u(r.props,e,r._instanceProps),c=d(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===o,p="rtl"===a,h=f?l:0;s[e]=t={position:"absolute",left:p?void 0:h,right:p?h:void 0,top:f?0:l,height:f?"100%":c,width:f?c:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=aT(function(e,t,r){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,a=t.scrollLeft,i=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===a)return null;var t=r.props.direction,o=a;if("rtl"===t)switch(aV()){case"negative":o=-a;break;case"positive-descending":o=i-n-a}return o=Math.max(0,Math.min(o,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,a=t.scrollHeight,i=t.scrollTop;r.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,a-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n;null!==r._resetIsScrollingTimeoutId&&aU(r._resetIsScrollingTimeoutId),e=r._resetIsScrolling,t=aN(),r._resetIsScrollingTimeoutId=n={id:requestAnimationFrame(function r(){aN()-t>=150?e.call(null):n.id=requestAnimationFrame(r)})}},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,nf(t,e),t.getDerivedStateFromProps=function(e,t){return aH(e,t),y(e),null};var r=t.prototype;return r.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},r.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,n=r.itemCount,a=r.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var o=0;if(this._outerRef){var s=this._outerRef;o="vertical"===a?s.scrollWidth>s.clientWidth?aF():0:s.scrollHeight>s.clientHeight?aF():0}this.scrollTo(f(this.props,e,t,i,this._instanceProps,o))},r.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var a=this._outerRef;"horizontal"===t||"horizontal"===n?a.scrollLeft=r:a.scrollTop=r}this._callPropsCallbacks()},r.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,a=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(aV()){case"negative":i.scrollLeft=-a;break;case"positive-ascending":i.scrollLeft=a;break;default:var o=i.clientWidth,s=i.scrollWidth;i.scrollLeft=s-o-a}else i.scrollLeft=a;else i.scrollTop=a}this._callPropsCallbacks()},r.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&aU(this._resetIsScrollingTimeoutId)},r.render=function(){var e=this.props,t=e.children,r=e.className,n=e.direction,a=e.height,i=e.innerRef,o=e.innerElementType,s=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,f=void 0===d?az:d,p=e.layout,h=e.outerElementType,g=e.outerTagName,m=e.style,y=e.useIsScrolling,v=e.width,b=this.state.isScrolling,x="horizontal"===n||"horizontal"===p,S=x?this._onScrollHorizontal:this._onScrollVertical,w=this._getRangeToRender(),_=w[0],I=w[1],D=[];if(l>0)for(var O=_;O<=I;O++)D.push((0,to.createElement)(t,{data:u,key:f(O,u),index:O,isScrolling:y?b:void 0,style:this._getItemStyle(O)}));var k=c(this.props,this._instanceProps);return(0,to.createElement)(h||g||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:aR({position:"relative",height:a,width:v,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:n},m)},(0,to.createElement)(o||s||"div",{children:D,ref:i,style:{height:x?"100%":k,pointerEvents:b?"none":void 0,width:x?k:"100%"}}))},r._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],a=e[3];this._callOnItemsRendered(t,r,n,a)}if("function"==typeof this.props.onScroll){var i=this.state,o=i.scrollDirection,s=i.scrollOffset,l=i.scrollUpdateWasRequested;this._callOnScroll(o,s,l)}},r._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,a=n.isScrolling,i=n.scrollDirection,o=n.scrollOffset;if(0===t)return[0,0,0,0];var s=p(this.props,o,this._instanceProps),l=h(this.props,s,o,this._instanceProps);return[Math.max(0,s-(a&&"backward"!==i?1:Math.max(1,r))),Math.max(0,Math.min(t-1,l+(a&&"forward"!==i?1:Math.max(1,r)))),s,l]},t}(to.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},l),aK=I(2051),aJ=I.n(aK);let aZ={padding:"10px 0"},aQ={borderBottomWidth:"1px",...aZ},a0=e=>{let t,r,n,a,i,o,s,l,u,c=(0,ti.c)(28),{row:d,style:f,keyPrefix:p,onToggle:h}=e;c[0]!==h||c[1]!==d.areChildrenVisible?(t=()=>{h(!d.areChildrenVisible)},c[0]=h,c[1]=d.areChildrenVisible,c[2]=t):t=c[2];let g=t,m=d.children&&d.children.length>0||d.depth>0,y=8*(1+2*d.depth);return c[3]!==f?(r={...f,...aQ},c[3]=f,c[4]=r):r=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(n=ay()("hover:bg-primary/25 border-input text-foreground bg-background flex w-full flex-row items-center break-all text-base","leading-[20px]"),c[5]=n):n=c[5],c[6]!==g||c[7]!==m||c[8]!==h||c[9]!==y||c[10]!==d.areChildrenVisible?(a=m&&(0,tu.jsx)("div",{style:{paddingLeft:`${y}px`,opacity:+!!h},children:d.areChildrenVisible?(0,tu.jsx)("div",{className:"cursor-pointer p-1",onClick:g,children:(0,tu.jsx)(tl.Icons.ChevronDown,{})}):(0,tu.jsx)("div",{className:"cursor-pointer p-1",onClick:g,children:(0,tu.jsx)(tl.Icons.ChevronRight,{})})}),c[6]=g,c[7]=m,c[8]=h,c[9]=y,c[10]=d.areChildrenVisible,c[11]=a):a=c[11],c[12]!==d.tag?(i=(0,tu.jsx)("div",{className:"w-4/24 px-3",children:d.tag}),c[12]=d.tag,c[13]=i):i=c[13],c[14]!==d.valueRepresentation?(o=(0,tu.jsx)("div",{className:"w-2/24 px-3",children:d.valueRepresentation}),c[14]=d.valueRepresentation,c[15]=o):o=c[15],c[16]!==d.keyword?(s=(0,tu.jsx)("div",{className:"w-6/24 px-3",children:d.keyword}),c[16]=d.keyword,c[17]=s):s=c[17],c[18]!==d.value?(l=(0,tu.jsx)("div",{className:"w-5/24 grow px-3",children:d.value}),c[18]=d.value,c[19]=l):l=c[19],c[20]!==p||c[21]!==r||c[22]!==a||c[23]!==i||c[24]!==o||c[25]!==s||c[26]!==l?(u=(0,tu.jsxs)("div",{style:r,className:n,children:[a,i,o,s,l]},p),c[20]=p,c[21]=r,c[22]=a,c[23]=i,c[24]=o,c[25]=s,c[26]=l,c[27]=u):u=c[27],u};function a1(e){let t,r,n,a,i,o,s,l,u,c,d=(0,ti.c)(18),{tagRef:f,vrRef:p,keywordRef:h,valueRef:g}=e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=ay()("bg-popover ohif-scrollbar flex w-full flex-row overflow-y-scroll"),d[0]=t):t=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"Tag"}),d[1]=r):r=d[1],d[2]!==f?(n=(0,tu.jsx)("div",{className:"w-4/24 px-3",children:(0,tu.jsx)("label",{ref:f,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:r})}),d[2]=f,d[3]=n):n=d[3],d[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"VR"}),d[4]=a):a=d[4],d[5]!==p?(i=(0,tu.jsx)("div",{className:"w-2/24 px-3",children:(0,tu.jsx)("label",{ref:p,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:a})}),d[5]=p,d[6]=i):i=d[6],d[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"Keyword"}),d[7]=o):o=d[7],d[8]!==h?(s=(0,tu.jsx)("div",{className:"w-6/24 px-3",children:(0,tu.jsx)("label",{ref:h,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:o})}),d[8]=h,d[9]=s):s=d[9],d[10]===Symbol.for("react.memo_cache_sentinel")?(l=(0,tu.jsx)("span",{className:"flex flex-row items-center focus:outline-none",children:"Value"}),d[10]=l):l=d[10],d[11]!==g?(u=(0,tu.jsx)("div",{className:"w-5/24 grow px-3",children:(0,tu.jsx)("label",{ref:g,className:"text-foreground flex flex-1 select-none flex-col pl-1 text-lg",children:l})}),d[11]=g,d[12]=u):u=d[12],d[13]!==n||d[14]!==i||d[15]!==s||d[16]!==u?(c=(0,tu.jsxs)("div",{className:t,style:aZ,children:[n,i,s,u]}),d[13]=n,d[14]=i,d[15]=s,d[16]=u,d[17]=c):c=d[17],c}function a2(e){return e.isVisible}let a3=to.memo(function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S=(0,ti.c)(35),{rows:w}=e,_=(0,to.useRef)(null),I=(0,to.useRef)(null),[D,O]=(0,to.useState)(null),[k,C]=(0,to.useState)(null),[j,E]=(0,to.useState)(null),[M,R]=(0,to.useState)(null),[P,A]=(0,to.useState)(w);S[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{e&&O(e)},S[0]=t):t=S[0];let T=t;S[1]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{e&&C(e)},S[1]=r):r=S[1];let N=r;S[2]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{e&&E(e)},S[2]=n):n=S[2];let U=n;S[3]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{e&&R(e)},S[3]=a):a=S[3];let L=a;S[4]!==w?(i=()=>{A(w)},o=[w],S[4]=w,S[5]=i,S[6]=o):(i=S[5],o=S[6]),(0,to.useEffect)(i,o),S[7]!==P?(s=P.filter(a2),S[7]=P,S[8]=s):s=S[8];let F=s;S[9]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{_?.current&&(_.current.scrollTo(0),_.current.resetAfterIndex(0))},S[9]=l):l=S[9],S[10]!==w?(u=[w],S[10]=w,S[11]=u):u=S[11],(0,to.useEffect)(l,u),S[12]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{let e=aJ()(()=>_.current.resetAfterIndex(0),100);return window.addEventListener("resize",e),()=>{e.cancel(),window.removeEventListener("resize",e)}},d=[],S[12]=c,S[13]=d):(c=S[12],d=S[13]),(0,to.useEffect)(c,d),S[14]!==j||S[15]!==D||S[16]!==M||S[17]!==k?(f=e=>t=>(function(e,t,r){if(!r||t.some(e=>!e))return 0;let n=t.map(e=>e.offsetWidth),a=r.getContext("2d");a.font=getComputedStyle(r).font;let i=["tag","valueRepresentation","keyword","value"];return Object.entries(e).filter(([e])=>i.includes(e)).map(([,e],t)=>20*Math.ceil(a.measureText(e).width/n[t])+20+1).reduce((e,t)=>Math.max(e,t),0)})(e[t],[D,k,j,M],I.current),S[14]=j,S[15]=D,S[16]=M,S[17]=k,S[18]=f):f=S[18];let B=f;S[19]!==P?(p=e=>{if(e.children)return t=>{A(P.map(r=>e.uid===r.uid?{...r,areChildrenVisible:t}:e.children.includes(r.uid)?{...r,isVisible:t,areChildrenVisible:t}:r)),_?.current?.resetAfterIndex(0)}},S[19]=P,S[20]=p):p=S[20];let V=p;S[21]!==V?(h=e=>{let{rows:t}=e;return function(e){let{index:r,style:n}=e,a=t[r];return(0,tu.jsx)(a0,{style:n,row:a,keyPrefix:`DICOMTagRow-${r}`,onToggle:V(a)})}},S[21]=V,S[22]=h):h=S[22];let z=h;S[23]!==D?(g=()=>null!==D,S[23]=D,S[24]=g):g=S[24];let H=g;return S[25]===Symbol.for("react.memo_cache_sentinel")?(m=(0,tu.jsx)("canvas",{style:{visibility:"hidden",position:"absolute"},className:"text-base",ref:I}),y=(0,tu.jsx)(a1,{tagRef:T,vrRef:N,keywordRef:U,valueRef:L}),S[25]=m,S[26]=y):(m=S[25],y=S[26]),S[27]===Symbol.for("react.memo_cache_sentinel")?(v={height:"32rem"},S[27]=v):v=S[27],S[28]!==B||S[29]!==z||S[30]!==H||S[31]!==F?(b=H()&&(0,tu.jsx)(aX,{ref:_,height:500,itemCount:F.length,itemSize:B(F),width:"100%",className:"ohif-scrollbar text-foreground",children:z({rows:F})}),S[28]=B,S[29]=z,S[30]=H,S[31]=F,S[32]=b):b=S[32],S[33]!==b?(x=(0,tu.jsxs)("div",{children:[m,y,(0,tu.jsx)("div",{className:"border-background bg-background relative m-auto border-2",style:v,children:b})]}),S[33]=b,S[34]=x):x=S[34],x}),a4=0,a5=()=>`row_${++a4}`,{ImageSet:a8}=K.classes,{DicomMetaDictionary:a6}=es().data,{nameMap:a9}=a6;function a7(e){e.sort((e,t)=>e.tag<t.tag?-1:1)}let ie=e=>{let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x=(0,ti.c)(51),{displaySets:S,displaySetInstanceUID:w}=e,[_,I]=(0,to.useState)(w),[D,O]=(0,to.useState)(1),[k,C]=(0,to.useState)("");x[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{I(e.value),O(1)},x[0]=t):t=x[0];let j=t;if(x[1]!==S||x[2]!==_){let e;x[4]!==_?(e=e=>e.displaySetInstanceUID===_,x[4]=_,x[5]=e):e=x[5],r=S.find(e),x[1]=S,x[2]=_,x[3]=r}else r=x[3];let E=r;S.sort(it),x[6]!==S?(n=S.map(ir),x[6]=S,x[7]=n):n=x[7];let M=n;x[8]!==E||x[9]!==D?(a=e=>e?E.images[D-1]:E.instance||E,x[8]=E,x[9]=D,x[10]=a):a=x[10];let R=a,P=E instanceof a8&&E.images.length>1,A=E instanceof a8;if(x[11]!==R||x[12]!==A){let e,t=R(A);i=function({tags:e,metadata:t}){let r=[],n=[{tags:e,depth:0,parents:null,index:0,children:[]}],a=new Map;for(;n.length>0;){let{tags:e,depth:i,parents:o,index:s,children:l}=n.pop();for(let u=s;u<e.length;u++){let s=e[u],c=s.uid??a5();if(o?.length>0&&o.forEach(e=>{a.get(e).push(c)}),"SQ"===s.vr){let t={uid:c,tag:s.tag,valueRepresentation:s.vr,keyword:s.keyword,value:"",depth:i,isVisible:!0,areChildrenVisible:!0,children:[],parents:o};r.push(t),a.set(c,t.children);let d=o?[...o,c]:[c];if(s.values.length>0){n.push({tags:e,depth:i,parents:o,index:u+1,children:l});for(let e=s.values.length-1,t=s.values[e];e>=0;t=s.values[--e]){let r=a5();n.push({tags:t,depth:i+2,parents:[...d,r],index:0,children:[]});let o={tags:[{tag:"(FFFE,E000)",vr:"",keyword:`Item #${e}`,value:"",uid:r}],depth:i+1,parents:d,index:0,children:[]};n.push(o),a.set(r,o.children)}break}}else{if("xs"===s.vr)try{let e=t[es().data.Tag.fromPString(s.tag).toCleanString()];s.vr=e.vr}catch(e){console.warn(`Failed to parse value representation for tag '${s.keyword}'`)}let e={uid:c,tag:s.tag,valueRepresentation:s.vr,keyword:s.keyword,value:s.value,depth:i,isVisible:!0,parents:o};r.push(e),"(FFFE,E000)"===e.tag&&(e.areChildrenVisible=!0,e.children=[])}}}return r}({tags:(e=function e(t,r=0){if(!t)return[];let n=Object.keys(t),a=[];for(let o=0;o<n.length;o++){let s=n[o];if("_vrMap"===s)continue;let l=a9[s],u=t[s];if(l&&"SQ"===l.vr){var i;let t=Array.isArray(i=u)?i:[i],n={tag:l.tag,vr:l.vr,keyword:s,values:[]};if(a.push(n),null===u)continue;t.forEach(t=>{let a=e(t,r+1);a.length&&(a7(a),n.values.push(a))});continue}if(Array.isArray(u)&&u.length>0&&"object"!=typeof u[0]&&(u=u.join("\\")),"number"==typeof u&&(u=u.toString()),"string"!=typeof u&&(null===u?u=" ":"object"==typeof u?u.InlineBinary?u="Inline Binary":u.BulkDataURI?u="Bulk Data URI":u.Alphabetic?u=u.Alphabetic:(console.warn(`Unrecognised Value: ${u} for ${s}:`),console.warn(u),u=" "):(console.warn(`Unrecognised Value: ${u} for ${s}:`),u=" ")),s=s.replace("RETIRED_",""),l)a.push({tag:l.tag,vr:l.vr,keyword:s,value:u});else{let e=/[0-9A-Fa-f]{6}/g;if(s.match(e)){let e=`(${s.substring(0,4)},${s.substring(4,8)})`;a.push({tag:e,vr:"",keyword:"Private Tag",value:u})}}}return a}(t),a7(e),e),metadata:t}),x[11]=R,x[12]=A,x[13]=i}else i=x[13];let T=i;t:{let e,t;if(!k){o=T;break t}if(x[14]!==k||x[15]!==T){e=new Set;let t=["tag","valueRepresentation","keyword","value"],r=k.toLowerCase();T.forEach(n=>{t.some(e=>n[e]?.toLowerCase().includes(r))&&(e.add(n.uid),[...n.parents??[],...n.children??[]].forEach(t=>e.add(t)))}),x[14]=k,x[15]=T,x[16]=e}else e=x[16];if(x[17]!==e||x[18]!==T){let r;x[20]!==e?(r=t=>e.has(t.uid),x[20]=e,x[21]=r):r=x[21],t=T.filter(r),x[17]=e,x[18]=T,x[19]=t}else t=x[19];o=t}let N=o;return x[22]===Symbol.for("react.memo_cache_sentinel")?(s=(0,tu.jsx)("span",{className:"text-muted-foreground flex h-6 items-center pb-2 text-base",children:"Series"}),x[22]=s):s=x[22],x[23]===Symbol.for("react.memo_cache_sentinel")?(l=e=>j({value:e}),x[23]=l):l=x[23],x[24]!==M||x[25]!==_?(u=M.find(e=>e.value===_)?.label||"Select Series",x[24]=M,x[25]=_,x[26]=u):u=x[26],x[27]!==u?(c=(0,tu.jsx)(tl.SelectTrigger,{"data-cy":"dicom-tag-series-select-trigger",children:(0,tu.jsx)(tl.SelectValue,{"data-cy":"dicom-tag-series-select-value",children:u})}),x[27]=u,x[28]=c):c=x[28],x[29]!==M?(d=M.map(ia),x[29]=M,x[30]=d):d=x[30],x[31]!==d?(f=(0,tu.jsx)(tl.SelectContent,{children:d}),x[31]=d,x[32]=f):f=x[32],x[33]!==_||x[34]!==c||x[35]!==f?(p=(0,tu.jsxs)("div",{className:"flex w-1/3 flex-col",children:[s,(0,tu.jsxs)(tl.Select,{value:_,onValueChange:l,children:[c,f]})]}),x[33]=_,x[34]=c,x[35]=f,x[36]=p):p=x[36],x[37]!==E.images?.length||x[38]!==D||x[39]!==P?(h=P&&(0,tu.jsxs)("div",{className:"mx-auto mt-0.5 flex w-1/4 flex-col",children:[(0,tu.jsxs)("span",{className:"text-muted-foreground flex h-6 min-w-0 items-center whitespace-nowrap pb-2 text-base",children:[(0,tu.jsx)("span",{className:"truncate",children:"Instance Number"}),(0,tu.jsxs)("span",{className:"shrink-0",children:[" (",D," of ",E?.images?.length,")"]})]}),(0,tu.jsx)(tl.Slider,{value:[D],onValueChange:e=>{let[t]=e;O(t)},min:1,max:E?.images?.length,step:1,className:"pt-3"})]}),x[37]=E.images?.length,x[38]=D,x[39]=P,x[40]=h):h=x[40],x[41]===Symbol.for("react.memo_cache_sentinel")?(g=(0,tu.jsx)("span",{className:"text-muted-foreground flex h-6 items-center pb-2 text-base",children:"Search metadata"}),x[41]=g):g=x[41],x[42]===Symbol.for("react.memo_cache_sentinel")?(m=(0,tu.jsxs)("div",{className:"ml-auto mr-1 flex w-1/3 flex-col",children:[g,(0,tu.jsxs)(tl.InputFilter,{className:"text-muted-foreground",onChange:C,children:[(0,tu.jsx)(tl.InputFilter.SearchIcon,{}),(0,tu.jsx)(tl.InputFilter.Input,{placeholder:"Search metadata",className:"pl-9 pr-9"}),(0,tu.jsx)(tl.InputFilter.ClearButton,{className:"text-primary mr-0.5 p-0.5"})]})]}),x[42]=m):m=x[42],x[43]!==p||x[44]!==h?(y=(0,tu.jsx)("div",{className:"mb-6 flex flex-row items-start pl-1",children:(0,tu.jsxs)("div",{className:"flex w-full flex-row items-start gap-6",children:[p,h,m]})}),x[43]=p,x[44]=h,x[45]=y):y=x[45],x[46]!==N?(v=(0,tu.jsx)(a3,{rows:N}),x[46]=N,x[47]=v):v=x[47],x[48]!==y||x[49]!==v?(b=(0,tu.jsxs)("div",{className:"dicom-tag-browser-content bg-muted",children:[y,v]}),x[48]=y,x[49]=v,x[50]=b):b=x[50],b};function it(e,t){return e.SeriesNumber-t.SeriesNumber}function ir(e){let{displaySetInstanceUID:t,SeriesDate:r,SeriesTime:n,SeriesNumber:a,SeriesDescription:i,Modality:o}=e,s=`${r}:${n}`.split(".")[0];return{value:t,label:`${a} (${o}): ${i}`,description:aM()(s,"YYYYMMDD:HHmmss").format("ddd, MMM Do YYYY")}}function ia(e){return(0,tu.jsxs)(tl.SelectItem,{value:e.value,children:[e.label,(0,tu.jsx)("span",{className:"text-muted-foreground ml-1 text-xs",children:e.description})]},e.value)}let ii=e=>{let t,r=new Set,n=(e,n)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,i={setState:n,getState:a,getInitialState:()=>o,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},o=t=e(n,a,i);return i};var io=I(4413);let{useDebugValue:is}=to,{useSyncExternalStoreWithSelector:il}=io,iu=!1,ic=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t="function"==typeof e?e?ii(e):ii:e,r=(e,r)=>(function(e,t=e=>e,r){r&&!iu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),iu=!0);let n=il(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return is(n),n})(t,e,r);return Object.assign(r,t),r},id=e=>e?ic(e):ic,ip=new Map,ih=id()(e=>({type:"viewportGridId",viewportGridState:{},setViewportGridState:(t,r)=>e(e=>({viewportGridState:{...e.viewportGridState,[t]:r}}),!1,"setViewportGridState"),clearViewportGridState:()=>e({viewportGridState:{}},!1,"clearViewportGridState")})),ig=id()(e=>({type:"displaySetSelectorId",displaySetSelectorMap:{},setDisplaySetSelector:(t,r)=>e(e=>({displaySetSelectorMap:{...e.displaySetSelectorMap,[t]:r}}),!1,"setDisplaySetSelector"),clearDisplaySetSelectorMap:()=>e({displaySetSelectorMap:{}},!1,"clearDisplaySetSelectorMap")})),im=id()(e=>({hangingProtocolStageIndexMap:{},type:"hangingProtocolStageIndexId",setHangingProtocolStageIndex:(t,r)=>e(e=>({hangingProtocolStageIndexMap:{...e.hangingProtocolStageIndexMap,[t]:r}}),!1,"setHangingProtocolStageIndex"),clearHangingProtocolStageIndexMap:()=>e({hangingProtocolStageIndexMap:{}},!1,"clearHangingProtocolStageIndexMap")}));var iy=I(4669);let iv=["SEG","RTSTRUCT"],ib=id()(e=>({type:"viewportsByPositionId",viewportsByPosition:{},initialInDisplay:[],setViewportsByPosition:(t,r)=>e(e=>({viewportsByPosition:{...e.viewportsByPosition,[t]:r}}),!1,"setViewportsByPosition"),clearViewportsByPosition:()=>e({viewportsByPosition:{}},!1,"clearViewportsByPosition"),addInitialInDisplay:t=>e(e=>({initialInDisplay:[...e.initialInDisplay,t]}),!1,"addInitialInDisplay")})),ix=(e,t,r,n,a,i)=>{let o=r?.[a];if(o)return{...o};let{protocolId:s,stageIndex:l}=e.getState();i.inDisplay||(i.inDisplay=[...r.initialInDisplay]);let u=e.getMissingViewport(t?s:"default",l,i);if(u){let e=u.displaySetsInfo.map(e=>e.displaySetInstanceUID);return i.inDisplay.push(...e),{displaySetInstanceUIDs:e,displaySetOptions:u.displaySetsInfo.map(e=>e.displaySetOptions),viewportOptions:{...u.viewportOptions}}}return{}},iS=id()(e=>({toggleHangingProtocol:{},type:"toggleHangingProtocolId",setToggleHangingProtocol:(t,r)=>e(e=>({toggleHangingProtocol:{...e.toggleHangingProtocol,[t]:r}}),!1,"setToggleHangingProtocol"),clearToggleHangingProtocol:()=>e({toggleHangingProtocol:{}},!1,"clearToggleHangingProtocol")})),iw=id(e=>({toggleOneUpViewportGridStore:null,type:"toggleOneUpViewportGridId",setToggleOneUpViewportGridStore:t=>e({toggleOneUpViewportGridStore:t}),clearToggleOneUpViewportGridStore:()=>e({toggleOneUpViewportGridStore:null})})),i_=async function({servicesManager:e,getReport:t,reportType:r="Measurements",successMessage:n}){let{displaySetService:a,uiNotificationService:i,uiDialogService:o}=e.services;try{if(!await t())return;let e=a.getMostRecentDisplaySet().displaySetInstanceUID;return i.show({title:"Create Report",message:n??`${r} saved successfully`,type:"success"}),[e]}catch(e){throw i.show({title:"Create Report",message:e.message||`Failed to store ${r}`,type:"error"}),Error(`Failed to store ${r}. Error: ${e.message||"Unknown error"}`)}finally{o.hide("loading-dialog")}},{filterAnd:iI,filterMeasurementsByStudyUID:iD,filterMeasurementsBySeriesUID:iO}=K.utils.MeasurementFilters,ik=async function e({servicesManager:t,commandsManager:r,extensionManager:n},a,i){let o,{measurementService:s,displaySetService:l}=t.services,u=void 0===i.viewportId?i.data.viewportId:i.viewportId,c=void 0===i.isBackupSave?i.data.isBackupSave:i.isBackupSave,d=i?.data?.StudyInstanceUID||a.trackedStudy,f=i?.data?.SeriesInstanceUID,{displaySetInstanceUID:p}=i.data??i,{trackedSeries:h,measurementFilter:g=iI(iD(d),iO(h)),defaultSaveTitle:m="Save Measurements",defaultSeriesDescription:y="Measurements"}=a,v=s.getMeasurements(g),b=function(e){let t;for(let r of e){if(t&&r.predecessorImageId&&r.predecessorImageId!==t)return void console.warn("Found multiple source predecessors, not defaulting to same series");t||=r.predecessorImageId}return t}(v);try{let e=await ns({title:m,predecessorImageId:b,defaultSeriesDescription:y,minSeriesNumber:3e3,extensionManager:n,servicesManager:t,enableDownload:!0});if(1===e.action){let{series:n,seriesNumber:a,value:i,dataSourceName:s}=e,u=i||y,c=async()=>r.runCommand("storeMeasurements",{measurementData:v,dataSource:s,additionalFindingTypes:["ArrowAnnotate"],options:{SeriesDescription:u,SeriesNumber:a,predecessorImageId:n}},"CORNERSTONE_STRUCTURED_REPORT");o=await i_({servicesManager:t,getReport:c});let d=o?.length?l.getDisplaySetByUID(o[0]):void 0;d?.predecessorImageId&&r.runCommand("recordMeasurementsPredecessor",{measurements:v,predecessorImageId:d.predecessorImageId})}else e.action;return{userResponse:e.action,createdDisplaySetInstanceUIDs:o,StudyInstanceUID:d,SeriesInstanceUID:f,viewportId:u,isBackupSave:c,displaySetInstanceUID:p}}catch(e){return console.warn("Unable to save report",e),null}},{downloadBlob:iC}=K.utils,ij={toolGroupId:"default",allowUnmatchedView:!0,syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0,options:{matchingRules:["sameFOR"]}}]},iE={id:"@ohif/mnGrid",description:"Has various hanging protocol grid layouts",name:"2x2",protocolMatchingRules:[{id:"OneOrMoreSeries",weight:25,attribute:"numberOfDisplaySetsWithImages",constraint:{greaterThan:0}}],toolGroupIds:["default"],displaySetSelectors:{defaultDisplaySetId:{allowUnmatchedView:!0,seriesMatchingRules:[{attribute:"numImageFrames",constraint:{greaterThan:{value:0}},weight:1,required:!0},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0,options:{matchingRules:["sameFOR"]}}]},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},stages:[{id:"2x2",name:"2x2",stageActivation:{enabled:{minViewportsMatched:4}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:2}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:2,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:3,id:"defaultDisplaySetId"}]}]},{name:"3x1",stageActivation:{enabled:{minViewportsMatched:3}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:3}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:1}]},{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:2}]}]},{name:"2x1",stageActivation:{enabled:{minViewportsMatched:2}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:2}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]}]},{name:"1x1",stageActivation:{enabled:{minViewportsMatched:1}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]}]}],numberOfPriorsReferenced:-1},iM={...iE,id:"@ohif/mnGrid8",description:"Has various hanging protocol grid layouts up to 4x2",name:"4x2",stages:[{id:"4x2",name:"4x2",stageActivation:{enabled:{minViewportsMatched:7}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:4}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:2,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:3,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:4,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:5,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:6,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:7,id:"defaultDisplaySetId"}]}]},{id:"3x2",name:"3x2",stageActivation:{enabled:{minViewportsMatched:5}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:3}},viewports:[{viewportOptions:ij,displaySets:[{id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:1,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:2,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:3,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:4,id:"defaultDisplaySetId"}]},{viewportOptions:ij,displaySets:[{matchedDisplaySetsIndex:5,id:"defaultDisplaySetId"}]}]},...iE.stages]},iR={id:"defaultDisplaySetId"},iP={id:"priorDisplaySetId"},iA={viewportOptions:{toolGroupId:"default",allowUnmatchedView:!0},displaySets:[iR]},iT={...iA,displaySets:[{...iR,matchedDisplaySetsIndex:1}]},iN={...iA,displaySets:[iP]},iU={...iN,displaySets:[{...iP,matchedDisplaySetsIndex:1}]},iL={id:"@ohif/hpCompare",description:nB.t("Hps:Compare two studies in various layouts"),name:nB.t("Hps:Compare Two Studies"),numberOfPriorsReferenced:1,protocolMatchingRules:[{id:"Two Studies",weight:1e3,attribute:"StudyInstanceUID",from:"prior",required:!0,constraint:{notNull:!0}}],toolGroupIds:["default"],displaySetSelectors:{defaultDisplaySetId:{studyMatchingRules:[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:0}}}],seriesMatchingRules:[{attribute:"numImageFrames",constraint:{greaterThan:{value:0}}},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]},priorDisplaySetId:{studyMatchingRules:[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:1}}}],seriesMatchingRules:[{attribute:"numImageFrames",constraint:{greaterThan:{value:0}}},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",allowUnmatchedView:!0},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},stages:[{name:"2x2",stageActivation:{enabled:{minViewportsMatched:4}},viewportStructure:{layoutType:"grid",properties:{rows:2,columns:2}},viewports:[iA,iN,iT,iU]},{name:"2x1",stageActivation:{enabled:{minViewportsMatched:2}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:2}},viewports:[iA,iN]}]},iF=[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:1}}}],iB=[{attribute:"studyInstanceUIDsIndex",from:"options",required:!0,constraint:{equals:{value:0}}}],iV=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399162004"}},{weight:5,attribute:"PatientOrientation",constraint:{contains:"L"}},{weight:20,attribute:"SeriesDescription",constraint:{contains:"L CC"}}],iz=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399162004"}},{weight:5,attribute:"PatientOrientation",constraint:{equals:["P","L"]}},{attribute:"PatientOrientation",constraint:{doesNotEqual:["A","R"]},required:!0},{weight:20,attribute:"SeriesDescription",constraint:{contains:"CC"}}],iH=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399368009"}},{weight:0,attribute:"ViewCode",constraint:{doesNotEqual:"SCT:399162004"},required:!0},{weight:5,attribute:"PatientOrientation",constraint:{equals:["A","R"]}},{weight:20,attribute:"SeriesDescription",constraint:{contains:"L MLO"}}],iW=[{weight:10,attribute:"ViewCode",constraint:{contains:"SCT:399368009"}},{attribute:"ViewCode",constraint:{doesNotEqual:"SCT:399162004"},required:!0},{attribute:"PatientOrientation",constraint:{doesNotContain:["P","FL"]},required:!0},{weight:5,attribute:"PatientOrientation",constraint:{equals:["P","L"]}},{weight:5,attribute:"PatientOrientation",constraint:{equals:["A","FR"]}},{weight:20,attribute:"SeriesDescription",constraint:{contains:"R MLO"}},{attribute:"SeriesDescription",required:!0,constraint:{doesNotContain:"CC"}},{attribute:"SeriesDescription",required:!0,constraint:{doesNotEqual:"L MLO"},required:!0}],i$={storeAsInitialCamera:!0,imageArea:[.8,.8],imageCanvasPoint:{imagePoint:[0,.5],canvasPoint:[0,.5]}},iY={storeAsInitialCamera:!0,imageArea:[.8,.8],imageCanvasPoint:{imagePoint:[1,.5],canvasPoint:[1,.5]}},iG={id:"@ohif/hpMammo",hasUpdatedPriorsInformation:!1,name:nB.t("Hps:Mammography Breast Screening"),protocolMatchingRules:[{id:"Mammography",weight:150,attribute:"ModalitiesInStudy",constraint:{contains:"MG"},required:!0},{id:"numberOfImages",attribute:"numberOfDisplaySetsWithImages",constraint:{greaterThan:2},required:!0}],toolGroupIds:["default"],displaySetSelectors:{RCC:{seriesMatchingRules:iz,studyMatchingRules:iB},LCC:{seriesMatchingRules:iV,studyMatchingRules:iB},RMLO:{seriesMatchingRules:iW,studyMatchingRules:iB},LMLO:{seriesMatchingRules:iH,studyMatchingRules:iB},RCCPrior:{seriesMatchingRules:iz,studyMatchingRules:iF},LCCPrior:{seriesMatchingRules:iV,studyMatchingRules:iF},RMLOPrior:{seriesMatchingRules:iW,studyMatchingRules:iF},LMLOPrior:{seriesMatchingRules:iH,studyMatchingRules:iF}},stages:[{name:"CC/MLO",viewportStructure:{type:"grid",layoutType:"grid",properties:{rows:2,columns:2}},viewports:[{viewportOptions:{toolGroupId:"default",displayArea:iY,allowUnmatchedView:!0},displaySets:[{id:"RCC"}]},{viewportOptions:{toolGroupId:"default",displayArea:i$,allowUnmatchedView:!0},displaySets:[{id:"LCC"}]},{viewportOptions:{toolGroupId:"default",displayArea:iY,allowUnmatchedView:!0},displaySets:[{id:"RMLO"}]},{viewportOptions:{toolGroupId:"default",displayArea:i$,allowUnmatchedView:!0},displaySets:[{id:"LMLO"}]}]},{name:"CC compare",viewportStructure:{type:"grid",layoutType:"grid",properties:{rows:2,columns:2}},viewports:[{viewportOptions:{toolGroupId:"default",displayArea:iY,flipHorizontal:!0,rotation:180},displaySets:[{id:"RCC"}]},{viewportOptions:{toolGroupId:"default",flipHorizontal:!0,displayArea:i$},displaySets:[{id:"LCC"}]},{viewportOptions:{toolGroupId:"default",displayArea:iY,flipHorizontal:!0},displaySets:[{id:"RCCPrior"}]},{viewportOptions:{toolGroupId:"default",displayArea:i$},displaySets:[{id:"LCCPrior"}]}]}],numberOfPriorsReferenced:0},iq={type:"SCALE",scale:1,storeAsInitialCamera:!0},iX={...iq,scale:15},iK={id:"@ohif/hpScale",description:"Has various hanging protocol grid layouts",name:"Scale Images",protocolMatchingRules:[{id:"OneOrMoreSeries",weight:25,attribute:"numberOfDisplaySetsWithImages",constraint:{greaterThan:0}}],toolGroupIds:["default"],displaySetSelectors:{defaultDisplaySetId:{seriesMatchingRules:[{weight:1,attribute:"numImageFrames",constraint:{greaterThan:{value:0}},required:!0},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",displayArea:iq,allowUnmatchedView:!0},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},stages:[{name:"Scale 1:1",stageActivation:{enabled:{minViewportsMatched:1}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:{toolGroupId:"default",allowUnmatchedView:!0,displayArea:iq},displaySets:[{id:"defaultDisplaySetId"}]}]},{name:"Scale 1:15",stageActivation:{enabled:{minViewportsMatched:1}},viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:{toolGroupId:"default",allowUnmatchedView:!0,displayArea:iX},displaySets:[{id:"defaultDisplaySetId"}]}]}],numberOfPriorsReferenced:-1},iJ={id:"default",locked:!0,name:"Default",createdDate:"2021-02-23T19:22:08.894Z",modifiedDate:"2023-04-01",availableTo:{},editableBy:{},protocolMatchingRules:[],toolGroupIds:["default"],numberOfPriorsReferenced:0,defaultViewport:{viewportOptions:{viewportType:"stack",toolGroupId:"default",allowUnmatchedView:!0,syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0,options:{matchingRules:["sameFOR"]}}]},displaySets:[{id:"defaultDisplaySetId",matchedDisplaySetsIndex:-1}]},displaySetSelectors:{defaultDisplaySetId:{seriesMatchingRules:[{weight:10,attribute:"numImageFrames",constraint:{greaterThan:{value:0}}},{attribute:"isDisplaySetFromUrl",weight:20,constraint:{equals:!0}}]}},stages:[{name:"default",viewportStructure:{layoutType:"grid",properties:{rows:1,columns:1}},viewports:[{viewportOptions:{viewportType:"stack",viewportId:"default",toolGroupId:"default",initialImageOptions:{custom:"sopInstanceLocation"},syncGroups:[{type:"hydrateseg",id:"sameFORId",source:!0,target:!0}]},displaySets:[{id:"defaultDisplaySetId"}]}],createdDate:"2021-02-23T18:32:42.850Z"}]},iZ={measurementsContextMenu:{inheritsFrom:"ohif.contextMenu",menus:[{id:"forExistingMeasurement",selector:({nearbyToolData:e})=>!!e,items:[{label:"Delete measurement",commands:"removeMeasurement"},{label:"Add Label",commands:"setMeasurementLabel"}]}]}},iQ={"routes.customRoutes":{routes:{$push:[{path:"/custom",children:()=>(0,tu.jsx)("h1",{style:{color:"white"},children:"Hello Custom Route"})}]}}};function i0(e){return"dicomjson"!==e.sourceName&&"dicomlocal"!==e.sourceName}let i1={"routes.customRoutes":{routes:{$push:[{path:"/datasources",children:function(){let e,t,r,n,a=(0,ti.c)(9),[i]=tf(),o=tk(),s=i.dataSources;if(a[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:"100%",height:"100%"},a[0]=e):e=a[0],a[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,tu.jsx)("img",{className:"mx-auto block h-14",src:"./ohif-logo.svg",alt:"OHIF"}),a[1]=t):t=a[1],a[2]!==s||a[3]!==o){let e;a[5]!==o?(e=e=>(0,tu.jsxs)("div",{children:[(0,tu.jsx)("h1",{className:"text-foreground",children:e.configuration?.friendlyName||e.friendlyName}),(0,tu.jsx)(tl.Button,{variant:"secondary",className:ay()("ml-2","mt-1"),onClick:()=>{o({pathname:"/",search:`datasources=${e.sourceName}`})},children:e.sourceName}),(0,tu.jsx)("br",{})]},e.sourceName),a[5]=o,a[6]=e):e=a[6],r=s.filter(i0).map(e),a[2]=s,a[3]=o,a[4]=r}else r=a[4];return a[7]!==r?(n=(0,tu.jsx)("div",{style:e,children:(0,tu.jsx)("div",{className:"flex h-screen w-screen items-center justify-center",children:(0,tu.jsxs)("div",{className:"bg-popover mx-auto space-y-2 rounded-lg py-8 px-8 drop-shadow-md",children:[t,(0,tu.jsx)("div",{className:"space-y-2 pt-4 text-center",children:r})]})})}),a[7]=r,a[8]=n):n=a[8],n}}]}}},i2={"studyBrowser.studyMenuItems":{$push:[{id:"applyHangingProtocol",label:"Apply Hanging Protocol",iconName:"ViewportViews",items:[{id:"applyDefaultProtocol",label:"Default",commands:["loadStudy",{commandName:"setHangingProtocol",commandOptions:{protocolId:"default"}}]},{id:"applyMPRProtocol",label:"2x2 Grid",commands:["loadStudy",{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid"}}]}]},{id:"showInOtherMonitor",label:"Launch On Second Monitor",iconName:"DicomTagBrowser",selector:({servicesManager:e})=>{let{multiMonitorService:t}=e.services;return t.isMultimonitor},commands:{commandName:"multimonitor",commandOptions:{hashParams:"&hangingProtocolId=@ohif/mnGrid8",commands:["loadStudy",{commandName:"setHangingProtocol",commandOptions:{protocolId:"@ohif/mnGrid8"}}]}}}]}},i3={"routes.customRoutes":{routes:[],notFoundRoute:null}},{formatDate:i4}=K.utils,i5={"studyBrowser.studyMenuItems":[],"studyBrowser.thumbnailMenuItems":[{id:"tagBrowser",label:nz().t("StudyBrowser:Tag Browser"),iconName:"DicomTagBrowser",commands:"openDICOMTagViewer"},{id:"addAsLayer",label:nz().t("StudyBrowser:Add as Layer"),iconName:"ViewportViews",commands:"addDisplaySetAsLayer"}],"studyBrowser.sortFunctions":[{label:nz().t("StudyBrowser:Series Number"),sortFunction:(e,t)=>e?.SeriesNumber-t?.SeriesNumber},{label:nz().t("StudyBrowser:Series Date"),sortFunction:(e,t)=>{let r=new Date(i4(e?.SeriesDate));return new Date(i4(t?.SeriesDate)).getTime()-r.getTime()}}],"studyBrowser.viewPresets":[{id:"list",iconName:"ListView",selected:!1},{id:"thumbnails",iconName:"ThumbnailView",selected:!0}],"studyBrowser.studyMode":"all","studyBrowser.thumbnailDoubleClickCallback":{callbacks:[({activeViewportId:e,servicesManager:t,commandsManager:r,isHangingProtocolLayout:n})=>async a=>{let{hangingProtocolService:i,uiNotificationService:o}=t.services,s=[];try{s=i.getViewportsRequireUpdate(e,a,n)}catch(e){console.warn(e),o.show({title:nz().t("StudyBrowser:Thumbnail Double Click"),message:nz().t("StudyBrowser:The selected display sets could not be added to the viewport."),type:"error",duration:3e3})}r.run("setDisplaySetsForViewports",{viewportsToUpdate:s})}]}},{getLatestInstanceDateTime:i8}=K.utils,i6={"studyBrowser.thumbnailDetailSources":{seriesNumber:({displaySet:e})=>e?.SeriesNumber,numInstances:({displaySet:e})=>(e?.numImageFrames??e?.instances?.length)||1,seriesDate:({displaySet:e,formatters:t})=>t.formatDate(e?.SeriesDate),instanceDateTime:({displaySet:e,instance:t,formatters:r})=>{let{SeriesDate:n,SeriesTime:a}=i8(t??e);if(!n)return"";let i=r.formatDate(n);return a?`${i} ${r.formatTime(a,"HH:mm")}`:i}},"studyBrowser.thumbnailDetailTests":{isDerivedDisplaySet:({displaySet:e})=>!!e?.isDerivedDisplaySet},"studyBrowser.thumbnailDetails":[{id:"SeriesNumber",label:"S:",source:"seriesNumber"},{id:"InstanceCount",source:"numInstances",iconName:({displaySet:e})=>e?.countIcon||"InfoSeries"}]},i9={"ohif.overlayItem":function(e){if(this.condition&&!this.condition(e))return null;let{instance:t}=e,r=t&&this.attribute?t[this.attribute]:this.contentF&&"function"==typeof this.contentF?this.contentF(e):null,n=K.utils.formatValue(r);return n?(0,tu.jsxs)("span",{className:"overlay-item flex flex-row",style:{color:this.color||void 0},title:this.title||"",children:[this.label&&(0,tu.jsx)("span",{className:"mr-1 shrink-0",children:this.label}),(0,tu.jsx)("span",{className:"font-light",children:n})]}):null}},i7={"ohif.contextMenu":{$transform:function(e){let t={...this};for(let r of(t.menus=this.menus.map(e=>({...e})),t.menus)){let{items:t}=r;for(let n of(r.items=[],t))r.items.push(e.transform(n))}return t}}},oe={"ui.contextMenu":tl.ContextMenuViewport},ot={"ohif.menuContent":function(e){let{item:t,commandsManager:r,servicesManager:n,...a}=e,i=function(e){let{item:t}=e,i=t.selector&&!t.selector({servicesManager:n});return(0,tu.jsxs)(tl.DropdownMenuItem,{disabled:i,onSelect:()=>{r.runAsync(t.commands,{...t.commandOptions,...a})},className:"gap-[6px]",children:[t.iconName&&(0,tu.jsx)(tl.Icons.ByName,{name:t.iconName,className:"-ml-1"}),t.label]})};return t.items?(0,tu.jsxs)(tl.DropdownMenuSub,{children:[(0,tu.jsxs)(tl.DropdownMenuSubTrigger,{className:"gap-[6px]",children:[t.iconName&&(0,tu.jsx)(tl.Icons.ByName,{name:t.iconName,className:"-ml-1"}),t.label]}),(0,tu.jsx)(tl.DropdownMenuPortal,{children:(0,tu.jsx)(tl.DropdownMenuSubContent,{children:t.items.map(t=>i({...e,item:t}))})})]}):i({...e,item:t})}},or=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(32),{itemLabel:g,itemList:m,onItemClicked:y}=e,{servicesManager:v}=(0,K.useSystem)(),{t:b}=tQ("DataSourceConfiguration"),[x,S]=(0,to.useState)("");h[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{S("")},h[0]=t):t=h[0],h[1]!==m?(r=[m],h[1]=m,h[2]=r):r=h[2],(0,to.useEffect)(t,r),h[3]!==v.services.customizationService?(n=v.services.customizationService.getCustomization("ui.loadingIndicatorProgress"),h[3]=v.services.customizationService,h[4]=n):n=h[4];let w=n,_=`Select ${g}`;h[5]!==b||h[6]!==_?(a=b(_),h[5]=b,h[6]=_,h[7]=a):a=h[7],h[8]!==a?(i=(0,tu.jsx)("div",{className:"text-highlight text-xl",children:a}),h[8]=a,h[9]=i):i=h[9],h[10]===Symbol.for("react.memo_cache_sentinel")?(o=(0,tu.jsx)(tl.InputFilter.SearchIcon,{}),h[10]=o):o=h[10];let I=`Search ${g} list`;return h[11]!==b||h[12]!==I?(s=b(I),h[11]=b,h[12]=I,h[13]=s):s=h[13],h[14]!==s?(l=(0,tu.jsx)(tl.InputFilter.Input,{placeholder:s,className:"pl-8 pr-9"}),h[14]=s,h[15]=l):l=h[15],h[16]===Symbol.for("react.memo_cache_sentinel")?(u=(0,tu.jsx)(tl.InputFilter.ClearButton,{className:"text-primary mr-0.5 p-0.5"}),h[16]=u):u=h[16],h[17]!==l?(c=(0,tu.jsxs)(tl.InputFilter,{className:"max-w-[40%] grow",onChange:S,children:[o,l,u]}),h[17]=l,h[18]=c):c=h[18],h[19]!==c||h[20]!==i?(d=(0,tu.jsxs)("div",{className:"flex items-center justify-between",children:[i,c]}),h[19]=c,h[20]=i,h[21]=d):d=h[21],h[22]!==w||h[23]!==x||h[24]!==g||h[25]!==m||h[26]!==y||h[27]!==b?(f=(0,tu.jsx)("div",{className:"relative flex min-h-[1px] grow flex-col bg-background text-[14px]",children:null==m?(0,tu.jsx)(w,{className:"h-full w-full"}):0===m.length?(0,tu.jsxs)("div",{className:"text-highlight flex h-full flex-col items-center justify-center px-6 py-4",children:[(0,tu.jsx)(tl.Icons.ToolMagnify,{className:"mb-4"}),(0,tu.jsx)("span",{children:b(`No ${g} available`)})]}):(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)("div",{className:"bg-popover text-foreground px-3 py-1.5",children:b(g)}),(0,tu.jsx)("div",{className:"ohif-scrollbar overflow-auto",children:m.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>(0,tu.jsxs)("div",{className:ay()("hover:text-highlight hover:bg-muted group mx-2 flex items-center justify-between px-6 py-2","rounded border-transparent border-b-input border-[1px]"),children:[(0,tu.jsx)("div",{className:"text-muted-foreground",children:e.name}),(0,tu.jsxs)(tl.Button,{onClick:()=>y(e),className:"invisible group-hover:visible",variant:"default",size:"sm",children:[b("Select"),(0,tu.jsx)(tl.Icons.ChevronRight,{className:"ml-2 h-3 w-3"})]})]},e.id))})]})}),h[22]=w,h[23]=x,h[24]=g,h[25]=m,h[26]=y,h[27]=b,h[28]=f):f=h[28],h[29]!==d||h[30]!==f?(p=(0,tu.jsxs)("div",{className:"flex min-h-[1px] grow flex-col gap-4",children:[d,f]}),h[29]=d,h[30]=f,h[31]=p):p=h[31],p},on="text-ellipsis whitespace-nowrap overflow-hidden",oa=function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(54),{configurationAPI:g,configuredItems:m,onHide:y}=e,{t:v}=tQ("DataSourceConfiguration"),[b,x]=(0,to.useState)(),[S,w]=(0,to.useState)(m),[_,I]=(0,to.useState)();h[0]!==g?(t=g.getItemLabels(),h[0]=g,h[1]=t):t=h[1];let[D]=(0,to.useState)(t),[O,k]=(0,to.useState)(D.length===m.length),C=O?S.length-2:S.length-1;h[2]!==g||h[3]!==C||h[4]!==D.length||h[5]!==y||h[6]!==S||h[7]!==O?(r=()=>{let e=!0;return I(null),x(null),0===S.length?g.initialize().then(t=>{e&&x(t)}).catch(e=>I(e.message)):O||S.length!==D.length?g.setCurrentItem(S[C]).then(t=>{e&&x(t)}).catch(e=>I(e.message)):(g.setCurrentItem(S[S.length-1]),y()),()=>{e=!1}},h[2]=g,h[3]=C,h[4]=D.length,h[5]=y,h[6]=S,h[7]=O,h[8]=r):r=h[8],h[9]!==g||h[10]!==C||h[11]!==D||h[12]!==y||h[13]!==S||h[14]!==O?(n=[S,g,y,D,O,C],h[9]=g,h[10]=C,h[11]=D,h[12]=y,h[13]=S,h[14]=O,h[15]=n):n=h[15],(0,to.useEffect)(r,n),h[16]!==D.length||h[17]!==S.length?(a=e=>e!==D.length-1&&e<S.length?"cursor-pointer":"cursor-auto",h[16]=D.length,h[17]=S.length,h[18]=a):a=h[18];let j=a;h[19]!==D.length||h[20]!==S.length?(i=e=>e<S.length?ay()("bg-background/[.4]",e!==D.length-1?"hover:bg-transparent active:bg-popover":""):"bg-transparent",h[19]=D.length,h[20]=S.length,h[21]=i):i=h[21];let E=i;h[22]!==C||h[23]!==S.length?(o=e=>e===C+1?ay()("border-2","border-solid","border-highlight"):e<S.length?"border border-solid border-primary hover:border-highlight active:border-white":"border border-dashed border-input",h[22]=C,h[23]=S.length,h[24]=o):o=h[24];let M=o;h[25]!==S.length?(s=e=>e<=S.length?"text-highlight":"text-primary",h[25]=S.length,h[26]=s):s=h[26];let R=s;h[27]!==_||h[28]!==D||h[29]!==S.length||h[30]!==v?(l=()=>(0,tu.jsxs)("div",{className:"flex min-h-[1px] grow flex-col gap-4",children:[(0,tu.jsx)("div",{className:"text-highlight text-[20px]",children:v(`Error fetching ${D[S.length]} list`)}),(0,tu.jsx)("div",{className:"grow bg-background p-4 text-[14px]",children:_})]}),h[27]=_,h[28]=D,h[29]=S.length,h[30]=v,h[31]=l):l=h[31];let P=l;h[32]!==C||h[33]!==E||h[34]!==M||h[35]!==j||h[36]!==R||h[37]!==D||h[38]!==S||h[39]!==O||h[40]!==v?(u=()=>(0,tu.jsx)("div",{className:"flex gap-4",children:D.map((e,t)=>(0,tu.jsxs)("div",{className:ay()("flex min-w-[1px] shrink basis-[200px] flex-col gap-1 rounded-md p-3.5",j(t),E(t),M(t),R(t)),onClick:O&&t<C||t<=C?()=>{k(!1),w(e=>e.slice(0,t))}:void 0,children:[(0,tu.jsxs)("div",{className:"text- flex items-center gap-2",children:[t<S.length?(0,tu.jsx)(tl.Icons.ByName,{name:"status-tracked",className:"text-highlight"}):(0,tu.jsx)(tl.Icons.ByName,{name:"status-untracked"}),(0,tu.jsx)("div",{className:ay()(on),children:v(e)})]}),t<S.length?(0,tu.jsx)("div",{className:ay()("text-foreground text-[14px]",on),children:S[t].name}):(0,tu.jsx)("br",{})]},e))}),h[32]=C,h[33]=E,h[34]=M,h[35]=j,h[36]=R,h[37]=D,h[38]=S,h[39]=O,h[40]=v,h[41]=u):u=h[41];let A=u;return h[42]!==A?(c=A(),h[42]=A,h[43]=c):c=h[43],h[44]===Symbol.for("react.memo_cache_sentinel")?(d=(0,tu.jsx)("div",{className:"h-0.5 w-full shrink-0 bg-background"}),h[44]=d):d=h[44],h[45]!==C||h[46]!==_||h[47]!==P||h[48]!==D||h[49]!==b?(f=_?P():(0,tu.jsx)(or,{itemLabel:D[C+1],itemList:b,onItemClicked:e=>{k(!1),w(t=>[...t.slice(0,C+1),e])}}),h[45]=C,h[46]=_,h[47]=P,h[48]=D,h[49]=b,h[50]=f):f=h[50],h[51]!==c||h[52]!==f?(p=(0,tu.jsxs)("div",{className:"flex h-[calc(100vh-300px)] select-none flex-col gap-4 pt-0.5",children:[c,d,f]}),h[51]=c,h[52]=f,h[53]=p):p=h[53],p};function oi(){return null}let oo=function(e){let t,r,n,a,i,o,s,l=(0,ti.c)(21),{servicesManager:u,extensionManager:c}=e,{t:d}=tQ("DataSourceConfiguration"),{show:f,hide:p}=(0,tl.useModal)(),{customizationService:h}=u.services,[g,m]=(0,to.useState)(),[y,v]=(0,to.useState)();l[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],l[0]=t):t=l[0];let[b,x]=(0,to.useState)(t);l[1]!==h||l[2]!==c?(r=()=>{let e=!0,t=async()=>{let t=c.getActiveDataSourceDefinition();if(!t?.configuration?.configurationAPI)return;let r=h.getCustomization(t.configuration.configurationAPI)??oi;if(!r)return;let n=r(t.sourceName);m(n),x(n.getItemLabels()),v(null),n.getConfiguredItems().then(t=>{e&&v(t)})},r=c.subscribe(c.EVENTS.ACTIVE_DATA_SOURCE_CHANGED,t);return t(),()=>{e=!1,r.unsubscribe()}},l[1]=h,l[2]=c,l[3]=r):r=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(n=[],l[4]=n):n=l[4],(0,to.useEffect)(r,n),l[5]!==g||l[6]!==y||l[7]!==p||l[8]!==f||l[9]!==d?(a=()=>{f({content:oa,title:d("Configure Data Source"),containerClassName:"max-w-3xl",contentProps:{configurationAPI:g,configuredItems:y,onHide:p}})},l[5]=g,l[6]=y,l[7]=p,l[8]=f,l[9]=d,l[10]=a):a=l[10];let S=a;return l[11]!==g||l[12]!==y||l[13]!==S?(i=()=>{g&&y&&y.length!==g.getItemLabels().length&&S()},o=[g,y,S],l[11]=g,l[12]=y,l[13]=S,l[14]=i,l[15]=o):(i=l[14],o=l[15]),(0,to.useEffect)(i,o),l[16]!==y||l[17]!==b||l[18]!==S||l[19]!==d?(s=y?(0,tu.jsxs)(tl.HoverCard,{children:[(0,tu.jsx)(tl.HoverCardTrigger,{asChild:!0,children:(0,tu.jsxs)(tl.Button,{variant:"ghost",size:"sm",className:"gap-1 text-sm",onClick:S,children:[(0,tu.jsx)(tl.Icons.CloudSettings,{className:"h-5 w-5"}),"Source"]})}),(0,tu.jsx)(tl.HoverCardContent,{align:"center",className:"w-72 p-0",children:(0,tu.jsxs)(tl.Card,{className:"border-0 shadow-none",children:[(0,tu.jsx)(tl.CardHeader,{className:"p-3 pb-1",children:(0,tu.jsxs)(tl.CardDescription,{className:"text-sm",children:[(0,tu.jsxs)("span",{className:"text-foreground font-semibold",children:[d("Data Source"),":"]})," ",d("Configure the server connection and storage settings")]})}),(0,tu.jsxs)(tl.CardContent,{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 p-3 pt-0 text-sm",children:[(0,tu.jsx)("div",{className:"bg-input col-span-2 my-2 h-px"}),b.map((e,t)=>(0,tu.jsxs)(to.Fragment,{children:[(0,tu.jsx)("span",{className:"text-muted-foreground",children:d(e)}),(0,tu.jsx)("span",{children:y[t]?.name??"—"})]},e))]})]})})]}):null,l[16]=y,l[17]=b,l[18]=S,l[19]=d,l[20]=s):s=l[20],s};var os=((v=os||{})[v.projects=0]="projects",v[v.locations=1]="locations",v[v.datasets=2]="datasets",v[v.dicomStores=3]="dicomStores",v);let ol="https://cloudresourcemanager.googleapis.com/v1",ou="https://healthcare.googleapis.com/v1";class oc{constructor(e,t,r){this._extensionManager=void 0,this._fetchOptions=void 0,this._dataSourceName=void 0,this.getItemLabels=()=>["Project","Location","Data set","DICOM store"],this._dataSourceName=e,this._extensionManager=r;const n=t.services.userAuthenticationService;this._fetchOptions={method:"GET",headers:n.getAuthorizationHeader()}}async initialize(){let e=`${ol}/projects`,t=await oc._doFetch(e,os.projects,this._fetchOptions);return t?.length?t.map(e=>({id:e.projectId,name:e.name,itemType:os.projects,url:`${ou}/projects/${e.projectId}`})):[]}async setCurrentItem(e){if(e.itemType===os.dicomStores){let t=`${e.url}/dicomWeb`,r=JSON.parse(JSON.stringify(this._extensionManager.getDataSourceDefinition(this._dataSourceName)));return r.configuration={...r.configuration,wadoUriRoot:t,qidoRoot:t,wadoRoot:t},this._extensionManager.updateDataSourceConfiguration(r.sourceName,r.configuration),[]}let t=e.itemType+1,r=`${os[t]}`,n=`${e.url}/${r}`,a=await oc._doFetch(n,t,this._fetchOptions);return a?.length?a.map(e=>{let r=e.name.split("/");return{id:e.name,name:r[r.length-1],itemType:t,url:`${ou}/${e.name}`}}):[]}async getConfiguredItems(){let e=this._extensionManager.getDataSourceDefinition(this._dataSourceName).configuration.wadoUriRoot,t=e.indexOf("projects"),r=e.substring(t).split("/"),n=[];for(let e=0;e<4&&(e+1)*2<r.length;e+=1)if(e===os.projects){let t=r[1],a=`${ol}/projects/${t}`,i=(await oc._doFetch(a,os.projects,this._fetchOptions))[0];n.push({id:i.projectId,name:i.name,itemType:e,url:`${ou}/projects/${i.projectId}`})}else{let t=r.slice(0,2*e+2).join("/");n.push({id:t,name:r[2*e+1],itemType:e,url:`${ou}/${t}`})}return n}static async _doFetch(e,t,r={},n={}){try{let a=new URL(e);a.search=new URLSearchParams(n).toString();let i=await fetch(a,r),o=await i.json();if(i.status>=200&&i.status<300&&null!=o){if(null!=o.nextPageToken){n.pageToken=o.nextPageToken;let a=await this._doFetch(e,t,r,n);o[os[t]]=o[os[t]].concat(a)}if(o[os[t]])return o[os[t]];if(o.name)return[o];return[]}{let e=o?.error?.message||`Error returned from Google Cloud Healthcare: ${i.status} - ${i.statusText}`;throw Error(e)}}catch(e){throw Error(e?.message||"Error occurred during fetch request.")}}}let od={progressDropdownWithServiceComponent:ac},{sortingCriteria:of}=K.utils,{seriesSortCriteria:op}=of,oh={sortingCriteria:op.seriesInfoSortingCriteria},og={customOnDropHandler:()=>Promise.resolve({handled:!1})},om={"ui.loadingIndicatorProgress":tl.LoadingIndicatorProgress},oy={"ui.loadingIndicatorTotalPercent":tl.LoadingIndicatorTotalPercent},ov={"ui.progressLoadingBar":tl.ProgressLoadingBar},ob={"ui.labellingComponent":tl.LabellingFlow},ox=nz().t("MeasurementTable:Track measurements for this series?"),oS=nz().t("Do you want to add this measurement to the existing report?"),ow=nz().t("You have existing tracked measurements. What would you like to do with your existing tracked measurements?"),o_=nz().t("MeasurementTable:Track measurements for this series?"),oI=nz().t("Measurements cannot span across multiple studies. Do you want to save your tracked measurements?"),oD=nz().t("Do you want to continue tracking measurements for this study?"),oO=nz().t("Do you want to open this Segmentation?"),ok=nz().t("Do you want to open this Segmentation?"),oC=nz().t("There are unsaved measurements. Do you want to save it?"),oj={"ui.notificationComponent":tl.ViewportDialog,"viewportNotification.beginTrackingMessage":ox,"viewportNotification.trackNewSeriesMessage":oS,"viewportNotification.discardSeriesMessage":ow,"viewportNotification.trackNewStudyMessage":o_,"viewportNotification.discardStudyMessage":oI,"viewportNotification.hydrateSRMessage":oD,"viewportNotification.hydrateRTMessage":oO,"viewportNotification.hydrateSEGMessage":ok,"viewportNotification.discardDirtyMessage":oC};var oE=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},oM=[["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["edge",/Edge\/([0-9\._]+)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["safari",/Version\/([0-9\._]+).*Safari/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/]],oR=["Windows Phone","Android","CentOS",{name:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],oP={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"},oA=RegExp("(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino","i"),oT=RegExp("1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|k\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-","i"),oN=function(){function e(e,t,r){this.navigator=t,this.process=r,this.userAgent=e||(this.navigator?t.userAgent||t.vendor:"")}return e.prototype.detect=function(){if(this.process&&!this.userAgent){var e=this.process.version.slice(1).split(".").slice(0,3),t=Array.prototype.slice.call(e,1).join("")||"0";return{name:"node",version:e.join("."),versionNumber:parseFloat(e[0]+"."+t),mobile:!1,os:this.process.platform}}return this.userAgent||this.handleMissingError(),oE({},this.checkBrowser(),this.checkMobile(),this.checkOs())},e.prototype.checkBrowser=function(){var e=this;return oM.filter(function(t){return t[1].test(e.userAgent)}).map(function(t){var r=t[1].exec(e.userAgent),n=r&&r[1].split(/[._]/).slice(0,3),a=Array.prototype.slice.call(n,1).join("")||"0";return n&&n.length<3&&Array.prototype.push.apply(n,1===n.length?[0,0]:[0]),{name:String(t[0]),version:n.join("."),versionNumber:Number(n[0]+"."+a)}}).shift()},e.prototype.checkMobile=function(){var e=this.userAgent.substr(0,4);return{mobile:oA.test(this.userAgent)||oT.test(e)}},e.prototype.checkOs=function(){var e=this;return oR.map(function(t){var r=t.name||t,n=e.getOsPattern(t);return{name:r,pattern:n,value:RegExp("\\b"+n.replace(/([ -])(?!$)/g,"$1?")+"(?:x?[\\d._]+|[ \\w.]*)","i").exec(e.userAgent)}}).filter(function(e){return e.value}).map(function(e){var t,r=e.value[0]||"";return e.pattern&&e.name&&/^Win/i.test(r)&&!/^Windows Phone /i.test(r)&&(t=oP[r.replace(/[^\d.]/g,"")])&&(r="Windows "+t),e.pattern&&e.name&&(r=r.replace(RegExp(e.pattern,"i"),e.name)),r=r.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0].trim(),{os:r=/^(?:webOS|i(?:OS|P))/.test(r)?r:r.charAt(0).toUpperCase()+r.slice(1)}}).shift()},e.prototype.getOsPattern=function(e){return("string"==typeof e?e:void 0)||e.pattern||e.name},e.prototype.handleMissingError=function(){throw Error("Please give user-agent.\n> browser(navigator.userAgent or res.headers['user-agent']).")},e}();function oU(e,t){return e(t={exports:{}},t.exports),t.exports}var oL=oU(function(e){var t=e.exports="u">typeof window&&window.Math==Math?window:"u">typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),oF=oU(function(e){var t=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=t)});oF.version;var oB=function(e){return"object"==typeof e?null!==e:"function"==typeof e},oV=function(e){if(!oB(e))throw TypeError(e+" is not an object!");return e},oz=function(e){try{return!!e()}catch(e){return!0}},oH=!oz(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),oW=oL.document,o$=oB(oW)&&oB(oW.createElement),oY=!oH&&!oz(function(){return 7!=Object.defineProperty(o$?oW.createElement("div"):{},"a",{get:function(){return 7}}).a}),oG=function(e,t){var r,n;if(!oB(e))return e;if(t&&"function"==typeof(r=e.toString)&&!oB(n=r.call(e))||"function"==typeof(r=e.valueOf)&&!oB(n=r.call(e))||!t&&"function"==typeof(r=e.toString)&&!oB(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},oq=Object.defineProperty,oX=oH?Object.defineProperty:function(e,t,r){if(oV(e),t=oG(t,!0),oV(r),oY)try{return oq(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},oK=oH?function(e,t,r){return oX(e,t,{enumerable:!1,configurable:!0,writable:!0,value:r})}:function(e,t,r){return e[t]=r,e},oJ={}.hasOwnProperty,oZ=function(e,t){return oJ.call(e,t)},oQ=0,o0=Math.random(),o1=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++oQ+o0).toString(36))},o2=oU(function(e){var t=o1("src"),r="toString",n=Function[r],a=(""+n).split(r);oF.inspectSource=function(e){return n.call(e)},(e.exports=function(e,r,n,i){var o="function"==typeof n;o&&(oZ(n,"name")||oK(n,"name",r)),e[r]!==n&&(o&&(oZ(n,t)||oK(n,t,e[r]?""+e[r]:a.join(String(r)))),e===oL?e[r]=n:i?e[r]?e[r]=n:oK(e,r,n):(delete e[r],oK(e,r,n)))})(Function.prototype,r,function(){return"function"==typeof this&&this[t]||n.call(this)})}),o3=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},o4=function(e,t,r){if(o3(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,a){return e.call(t,r,n,a)}}return function(){return e.apply(t,arguments)}},o5="prototype",o8=function(e,t,r){var n,a,i,o,s=e&o8.F,l=e&o8.G,u=e&o8.S,c=e&o8.P,d=e&o8.B,f=l?oL:u?oL[t]||(oL[t]={}):(oL[t]||{})[o5],p=l?oF:oF[t]||(oF[t]={}),h=p[o5]||(p[o5]={});for(n in l&&(r=t),r)i=((a=!s&&f&&void 0!==f[n])?f:r)[n],o=d&&a?o4(i,oL):c&&"function"==typeof i?o4(Function.call,i):i,f&&o2(f,n,i,e&o8.U),p[n]!=i&&oK(p,n,o),c&&h[n]!=i&&(h[n]=i)};oL.core=oF,o8.F=1,o8.G=2,o8.S=4,o8.P=8,o8.B=16,o8.W=32,o8.U=64,o8.R=128;var o6={}.toString,o9=function(e){return o6.call(e).slice(8,-1)},o7=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==o9(e)?e.split(""):Object(e)},se=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},st=Math.ceil,sr=Math.floor,sn=Math.min,sa=function(e){var t;return e>0?sn(isNaN(t=+e)?0:(t>0?sr:st)(t),0x1fffffffffffff):0},si=Array.isArray||function(e){return"Array"==o9(e)},so=oU(function(e){var t="__core-js_shared__",r=oL[t]||(oL[t]={});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:oF.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),ss=oU(function(e){var t=so("wks"),r=oL.Symbol,n="function"==typeof r;(e.exports=function(e){return t[e]||(t[e]=n&&r[e]||(n?r:o1)("Symbol."+e))}).store=t})("species"),sl=function(e){var t;return si(e)&&("function"==typeof(t=e.constructor)&&(t===Array||si(t.prototype))&&(t=void 0),oB(t)&&null===(t=t[ss])&&(t=void 0)),void 0===t?Array:t},su=function(e,t){return new(sl(e))(t)},sc=function(e,t){var r=1==e,n=2==e,a=3==e,i=4==e,o=6==e,s=5==e||o,l=t||su;return function(t,u,c){for(var d,f,p=Object(se(t)),h=o7(p),g=o4(u,c,3),m=sa(h.length),y=0,v=r?l(t,m):n?l(t,0):void 0;m>y;y++)if((s||y in h)&&(f=g(d=h[y],y,p),e)){if(r)v[y]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return y;case 2:v.push(d)}else if(i)return!1}return o?-1:a||i?i:v}},sd=function(e,t){return!!e&&oz(function(){t?e.call(null,function(){},1):e.call(null)})},sf=sc(2);o8(o8.P+!sd([].filter,!0)*o8.F,"Array",{filter:function(e){return sf(this,e,arguments[1])}}),oF.Array.filter;var sp=sc(1);o8(o8.P+!sd([].map,!0)*o8.F,"Array",{map:function(e){return sp(this,e,arguments[1])}}),oF.Array.map;var sh=" \n\v\f\r \u2028\u2029\uFEFF",sg="["+sh+"]",sm="
",sy=RegExp("^"+sg+sg+"*"),sv=RegExp(sg+sg+"*$"),sb=function(e,t,r){var n={},a=oz(function(){return!!sh[e]()||sm[e]()!=sm}),i=n[e]=a?t(sx):sh[e];r&&(n[r]=i),o8(o8.P+o8.F*a,"String",n)},sx=sb.trim=function(e,t){return e=String(se(e)),1&t&&(e=e.replace(sy,"")),2&t&&(e=e.replace(sv,"")),e};sb("trim",function(e){return function(){return e(this,3)}}),oF.String.trim;var sS="u">typeof window?window.navigator:void 0,sw="u">typeof process?process:void 0;let s_={"ohif.aboutModal":function(){let e,t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(20),{t:g}=tQ("AboutModal");if(h[0]===Symbol.for("react.memo_cache_sentinel")){let{os:a,version:i,name:o}=new oN(void 0,sS,sw).detect();e=a,n=i,t=o[0].toUpperCase(),r=o.substr(1),h[0]=e,h[1]=t,h[2]=r,h[3]=n}else e=h[0],t=h[1],r=h[2],n=h[3];let m=`${t}${r} ${n}`;h[4]===Symbol.for("react.memo_cache_sentinel")?(a="3.14.0-beta.44".split("-"),h[4]=a):a=h[4];let[y,v]=a;return h[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,tu.jsx)(tl.AboutModal.ProductName,{children:"OHIF Viewer"}),o=(0,tu.jsx)(tl.AboutModal.ProductVersion,{children:y}),s=v&&(0,tu.jsx)(tl.AboutModal.ProductBeta,{children:v}),h[5]=i,h[6]=o,h[7]=s):(i=h[5],o=h[6],s=h[7]),h[8]!==g?(l=g("Commit Hash"),h[8]=g,h[9]=l):l=h[9],h[10]!==l?(u=(0,tu.jsx)(tl.AboutModal.DetailItem,{label:l,value:"bcde2b050fd4a9f46bae00f21f4f7d27adc5829c"}),h[10]=l,h[11]=u):u=h[11],h[12]!==g?(c=g("Current Browser & OS"),h[12]=g,h[13]=c):c=h[13],h[14]!==c?(d=(0,tu.jsx)(tl.AboutModal.DetailItem,{label:c,value:`${m}, ${e}`}),h[14]=c,h[15]=d):d=h[15],h[16]===Symbol.for("react.memo_cache_sentinel")?(f=(0,tu.jsx)(tl.AboutModal.SocialItem,{icon:"SocialGithub",url:"OHIF/Viewers",text:"github.com/OHIF/Viewers"}),h[16]=f):f=h[16],h[17]!==u||h[18]!==d?(p=(0,tu.jsxs)(tl.AboutModal,{className:"w-[400px]",children:[i,o,s,(0,tu.jsxs)(tl.AboutModal.Body,{children:[u,d,f]})]}),h[17]=u,h[18]=d,h[19]=p):p=h[19],p}};function sI(e){return(0,tu.jsx)(tl.SelectItem,{value:e.name,children:e.label},e.name)}let sD={"ohif.appearanceModal":function(){let e,t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_=(0,ti.c)(62),{activeTheme:I,setActiveTheme:D,customCss:O,applyCustomTheme:k,clearCustomTheme:C}=(0,tl.useActiveTheme)(),{t:j}=tQ("AppearanceModal");_[0]!==O?(e=()=>O,_[0]=O,_[1]=e):e=_[1];let[E,M]=to.useState(e);_[2]!==I?(t=()=>"custom"===I,_[2]=I,_[3]=t):t=_[3];let[R,P]=to.useState(t),[A,T]=to.useState(!1);_[4]!==R?(r=()=>{P(!R)},_[4]=R,_[5]=r):r=_[5];let N=r;_[6]!==k||_[7]!==E?(n=()=>{T(!k(E))},_[6]=k,_[7]=E,_[8]=n):n=_[8];let U=n;_[9]!==C?(a=()=>{C(),M(""),T(!1),P(!1)},_[9]=C,_[10]=a):a=_[10];let L=a;_[11]!==k||_[12]!==O||_[13]!==D?(i=e=>{"custom"===e?(P(!0),O&&k(O)):(P(!1),D(e))},_[11]=k,_[12]=O,_[13]=D,_[14]=i):i=_[14];let F=i;_[15]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{M(e.target.value),T(!1)},_[15]=o):o=_[15];let B=o;return _[16]!==j?(s=j("Theme"),_[16]=j,_[17]=s):s=_[17],_[18]!==s?(l=(0,tu.jsx)(tl.AppearanceModal.SectionLabel,{children:s}),_[18]=s,_[19]=l):l=_[19],_[20]!==j?(u=j("Theme"),_[20]=j,_[21]=u):u=_[21],_[22]===Symbol.for("react.memo_cache_sentinel")?(c=(0,tu.jsx)(tl.SelectValue,{}),_[22]=c):c=_[22],_[23]!==u?(d=(0,tu.jsx)(tl.SelectTrigger,{className:"w-[200px]","aria-label":u,children:c}),_[23]=u,_[24]=d):d=_[24],_[25]!==j?(f=j("Default Theme"),_[25]=j,_[26]=f):f=_[26],_[27]!==f?(p=(0,tu.jsx)(tl.SelectItem,{value:"default",children:f}),_[27]=f,_[28]=p):p=_[28],_[29]===Symbol.for("react.memo_cache_sentinel")?(h=tl.themePresets.map(sI),_[29]=h):h=_[29],_[30]!==O||_[31]!==E||_[32]!==j?(g=(O||E)&&(0,tu.jsx)(tl.SelectItem,{value:"custom",children:j("Custom")}),_[30]=O,_[31]=E,_[32]=j,_[33]=g):g=_[33],_[34]!==p||_[35]!==g?(m=(0,tu.jsxs)(tl.SelectContent,{children:[p,h,g]}),_[34]=p,_[35]=g,_[36]=m):m=_[36],_[37]!==I||_[38]!==F||_[39]!==d||_[40]!==m?(y=(0,tu.jsx)("div",{children:(0,tu.jsxs)(tl.Select,{value:I,onValueChange:F,children:[d,m]})}),_[37]=I,_[38]=F,_[39]=d,_[40]=m,_[41]=y):y=_[41],_[42]!==R||_[43]!==j?(v=j(R?"Hide":"Custom Theme"),_[42]=R,_[43]=j,_[44]=v):v=_[44],_[45]!==N||_[46]!==v?(b=(0,tu.jsx)("div",{className:"col-start-2",children:(0,tu.jsx)(tl.Button,{variant:"ghost",size:"sm",onClick:N,children:v})}),_[45]=N,_[46]=v,_[47]=b):b=_[47],_[48]!==y||_[49]!==b||_[50]!==l?(x=(0,tu.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-6 gap-y-4",children:[l,y,b]}),_[48]=y,_[49]=b,_[50]=l,_[51]=x):x=_[51],_[52]!==E||_[53]!==L||_[54]!==U||_[55]!==R||_[56]!==A||_[57]!==j?(S=R&&(0,tu.jsxs)("div",{className:"mt-4 flex flex-col space-y-2",children:[(0,tu.jsx)("textarea",{value:E,onChange:B,placeholder:j("Paste your custom theme color tokens here"),"aria-label":j("Paste your custom theme color tokens here"),rows:8,className:"bg-muted text-foreground border-input placeholder:text-muted-foreground focus:ring-ring rounded-md border px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-inset"}),A&&(0,tu.jsx)("span",{className:"text-destructive text-sm",role:"alert",children:j("No valid theme tokens found")}),(0,tu.jsxs)("div",{className:"flex space-x-2",children:[(0,tu.jsx)(tl.Button,{variant:"default",size:"sm",onClick:U,children:j("Apply")}),(0,tu.jsx)(tl.Button,{variant:"ghost",size:"sm",onClick:L,children:j("Clear")})]})]}),_[52]=E,_[53]=L,_[54]=U,_[55]=R,_[56]=A,_[57]=j,_[58]=S):S=_[58],_[59]!==x||_[60]!==S?(w=(0,tu.jsx)(tl.AppearanceModal,{children:(0,tu.jsxs)(tl.AppearanceModal.Body,{children:[x,S]})}),_[59]=x,_[60]=S,_[61]=w):w=_[61],w}},{availableLanguages:sO,defaultLanguage:sk,currentLanguage:sC}=nz(),sj=[{value:"16",label:"Shift"},{value:"17",label:"Ctrl"},{value:"18",label:"Alt"},{value:"91",label:"Meta"}];function sE(e){return(0,tu.jsx)(tl.SelectItem,{value:e.value,children:e.label},e.value)}let sM={"ohif.userPreferencesModal":function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k,C,j,E,M,R,P,A,T,N,U,L,F,B,V=(0,ti.c)(107),{hide:z}=e,{hotkeysManager:H,servicesManager:W}=(0,K.useSystem)(),{t:$,i18n:Y}=tQ("UserPreferencesModal"),G=W?.services?.toolGroupService,{hotkeyDefinitions:q,hotkeyDefaults:X}=H;V[0]!==q?(t=void 0===q?{}:q,V[0]=q,V[1]=t):t=V[1];let J=t;V[2]!==X?(r=void 0===X?{}:X,V[2]=X,V[3]=r):r=V[3];let Z=r;V[4]!==H?(n=H.getValidHotkeyDefinitions(K.hotkeys.defaults.hotkeyBindings),V[4]=H,V[5]=n):n=V[5];let Q=n;V[6]!==Q||V[7]!==Z||V[8]!==J||V[9]!==H?(a=()=>{Object.keys(Z).length||H.setDefaultHotKeys(K.hotkeys.defaults.hotkeyBindings),Object.keys(J).length||H.setHotkeys(Q)},i=[H,Z,J,Q],V[6]=Q,V[7]=Z,V[8]=J,V[9]=H,V[10]=a,V[11]=i):(a=V[10],i=V[11]),(0,to.useEffect)(a,i),V[12]!==Q||V[13]!==Z?(o=Object.keys(Z).length?Z:Q,V[12]=Q,V[13]=Z,V[14]=o):o=V[14];let ee=o;V[15]!==J||V[16]!==ee?(s=Object.keys(J).length?J:ee,V[15]=J,V[16]=ee,V[17]=s):s=V[17];let et=s;V[18]===Symbol.for("react.memo_cache_sentinel")?(l=sC(),V[18]=l):l=V[18];let er=l;V[19]!==G?(u=function(e,t){if(!e)return null;let r=e.getToolBindings("mpr",t);if(!r?.length)return null;let n=r.find(e=>1===e.mouseButton&&null!=e.modifierKey&&null==e.numTouchPoints);return n?.modifierKey!=null?String(n.modifierKey):null}(G,"Crosshairs"),V[19]=G,V[20]=u):u=V[20];let en=u;V[21]!==G?(c=G?.getDefaultToolBindings?.("mpr","Crosshairs"),V[21]=G,V[22]=c):c=V[22];let ea=c;V[23]!==en||V[24]!==et?(d={hotkeyDefinitions:et,languageValue:er.value,crosshairModifier:en},V[23]=en,V[24]=et,V[25]=d):d=V[25];let[ei,eo]=(0,to.useState)(d);V[26]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{eo(t=>({...t,languageValue:e}))},V[26]=f):f=V[26];let es=f;V[27]===Symbol.for("react.memo_cache_sentinel")?(p=(e,t)=>{eo(r=>({...r,hotkeyDefinitions:{...r.hotkeyDefinitions,[e]:{...r.hotkeyDefinitions[e],keys:t}}}))},V[27]=p):p=V[27];let el=p;V[28]!==ea||V[29]!==H||V[30]!==ee||V[31]!==G?(h=()=>{eo(e=>({...e,languageValue:sk.value,hotkeyDefinitions:ee,crosshairModifier:function(e){if(!e?.length)return null;let t=e.find(e=>1===e.mouseButton&&null!=e.modifierKey&&null==e.numTouchPoints);return t?.modifierKey!=null?String(t.modifierKey):null}(ea)})),H.restoreDefaultBindings(),G&&ea?.length&&(G.setToolBindings("mpr","Crosshairs",ea),G.applyToolBindings("mpr","Crosshairs",{replaceExisting:!0})),G?.removePersistedToolBindings("mpr","Crosshairs")},V[28]=ea,V[29]=H,V[30]=ee,V[31]=G,V[32]=h):h=V[32];let eu=h;if(V[33]!==Y.language||V[34]!==ei.languageValue){t:{if("u"<typeof Intl||"function"!=typeof Intl.DisplayNames){g=null;break t}let e=Array.from(new Set([ei.languageValue,er.value,Y.language,"en"].filter(Boolean)));try{g=new Intl.DisplayNames(e,{type:"language",fallback:"none"});break t}catch(t){console.warn("Intl.DisplayNames not supported for locales",e,t)}g=null}V[33]=Y.language,V[34]=ei.languageValue,V[35]=g}else g=V[35];let ec=g;V[36]!==ec||V[37]!==Y||V[38]!==$?(m=(e,t)=>{let r=`LanguageName.${e}`;if(Y.exists(r,{ns:"UserPreferencesModal"}))return $(r);if(ec){let t=function(e,t){try{let r=e.of(t);if(r&&r.toLowerCase()!==t.toLowerCase())return r.charAt(0).toUpperCase()+r.slice(1)}catch(e){console.debug(`Unable to resolve display name for ${t}`,e)}return null}(ec,e);if(t)return t}return t},V[36]=ec,V[37]=Y,V[38]=$,V[39]=m):m=V[39];let ed=m;V[40]!==$?(y=$("Language"),V[40]=$,V[41]=y):y=V[41],V[42]!==y?(v=(0,tu.jsx)(tl.UserPreferencesModal.SubHeading,{children:y}),V[42]=y,V[43]=v):v=V[43];let ef=ei.languageValue;return V[44]!==$?(b=$("Select language"),V[44]=$,V[45]=b):b=V[45],V[46]!==b?(x=(0,tu.jsx)(tl.SelectTrigger,{className:"w-60","aria-label":"Language",children:(0,tu.jsx)(tl.SelectValue,{placeholder:b})}),V[46]=b,V[47]=x):x=V[47],V[48]!==ed?(S=sO.map(e=>(0,tu.jsx)(tl.SelectItem,{value:e.value,children:ed(e.value,e.label)},e.value)),V[48]=ed,V[49]=S):S=V[49],V[50]!==S?(w=(0,tu.jsx)(tl.SelectContent,{children:S}),V[50]=S,V[51]=w):w=V[51],V[52]!==ei.languageValue||V[53]!==x||V[54]!==w?(_=(0,tu.jsxs)(tl.Select,{defaultValue:ef,onValueChange:es,children:[x,w]}),V[52]=ei.languageValue,V[53]=x,V[54]=w,V[55]=_):_=V[55],V[56]!==v||V[57]!==_?(I=(0,tu.jsxs)("div",{className:"mb-3 flex items-center space-x-14",children:[v,_]}),V[56]=v,V[57]=_,V[58]=I):I=V[58],V[59]!==$?(D=$("Hotkeys"),V[59]=$,V[60]=D):D=V[60],V[61]!==D?(O=(0,tu.jsx)(tl.UserPreferencesModal.SubHeading,{children:D}),V[61]=D,V[62]=O):O=V[62],V[63]!==ei.hotkeyDefinitions||V[64]!==$?(k=(0,tu.jsx)(tl.UserPreferencesModal.HotkeysGrid,{children:Object.entries(ei.hotkeyDefinitions).map(e=>{let[t,r]=e;return(0,tu.jsx)(tl.UserPreferencesModal.Hotkey,{label:$(r.label),value:r.keys,onChange:e=>el(t,e),placeholder:r.keys,hotkeys:K.hotkeys},t)})}),V[63]=ei.hotkeyDefinitions,V[64]=$,V[65]=k):k=V[65],V[66]!==ei.crosshairModifier||V[67]!==$?(C=null!=ei.crosshairModifier&&(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.UserPreferencesModal.SubHeading,{children:$("ModifierKeys",{defaultValue:"Modifier Keys"})}),(0,tu.jsx)(tl.UserPreferencesModal.HotkeysGrid,{children:(0,tu.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,tu.jsx)("span",{className:"text-foreground text-base",children:$("CrosshairsModifier",{defaultValue:"Crosshairs"})}),(0,tu.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,tu.jsx)("span",{className:"text-muted-foreground text-sm",children:$("PlusLeftClick",{defaultValue:"Left Click +"})}),(0,tu.jsxs)(tl.Select,{value:ei.crosshairModifier,onValueChange:e=>eo(t=>({...t,crosshairModifier:e})),children:[(0,tu.jsx)(tl.SelectTrigger,{className:"w-16",children:(0,tu.jsx)(tl.SelectValue,{})}),(0,tu.jsx)(tl.SelectContent,{children:sj.map(sE)})]})]})]})})]}),V[66]=ei.crosshairModifier,V[67]=$,V[68]=C):C=V[68],V[69]!==I||V[70]!==O||V[71]!==k||V[72]!==C?(j=(0,tu.jsxs)(tl.UserPreferencesModal.Body,{children:[I,O,k,C]}),V[69]=I,V[70]=O,V[71]=k,V[72]=C,V[73]=j):j=V[73],V[74]!==$?(E=$("Reset to defaults"),V[74]=$,V[75]=E):E=V[75],V[76]!==eu||V[77]!==E?(M=(0,tu.jsx)(tl.FooterAction.Left,{children:(0,tu.jsx)(tl.FooterAction.Auxiliary,{onClick:eu,children:E})}),V[76]=eu,V[77]=E,V[78]=M):M=V[78],V[79]!==z?(R=()=>{K.hotkeys.stopRecord(),K.hotkeys.unpause(),z()},V[79]=z,V[80]=R):R=V[80],V[81]!==$?(P=$("Cancel"),V[81]=$,V[82]=P):P=V[82],V[83]!==R||V[84]!==P?(A=(0,tu.jsx)(tl.FooterAction.Secondary,{onClick:R,children:P}),V[83]=R,V[84]=P,V[85]=A):A=V[85],V[86]!==z||V[87]!==H||V[88]!==ei.crosshairModifier||V[89]!==ei.hotkeyDefinitions||V[90]!==ei.languageValue||V[91]!==G?(T=()=>{if(ei.languageValue!==er.value){nz().changeLanguage(ei.languageValue),window.location.reload();return}if(H.setHotkeys(ei.hotkeyDefinitions),G&&null!=ei.crosshairModifier){let e=[{mouseButton:1,modifierKey:Number(ei.crosshairModifier)}];G.setToolBindings("mpr","Crosshairs",e),G.applyToolBindings("mpr","Crosshairs",{replaceExisting:!0}),G.persistToolBindings("mpr","Crosshairs",e)}K.hotkeys.stopRecord(),K.hotkeys.unpause(),z()},V[86]=z,V[87]=H,V[88]=ei.crosshairModifier,V[89]=ei.hotkeyDefinitions,V[90]=ei.languageValue,V[91]=G,V[92]=T):T=V[92],V[93]!==$?(N=$("Save"),V[93]=$,V[94]=N):N=V[94],V[95]!==T||V[96]!==N?(U=(0,tu.jsx)(tl.FooterAction.Primary,{onClick:T,children:N}),V[95]=T,V[96]=N,V[97]=U):U=V[97],V[98]!==A||V[99]!==U?(L=(0,tu.jsxs)(tl.FooterAction.Right,{children:[A,U]}),V[98]=A,V[99]=U,V[100]=L):L=V[100],V[101]!==M||V[102]!==L?(F=(0,tu.jsxs)(tl.FooterAction,{children:[M,L]}),V[101]=M,V[102]=L,V[103]=F):F=V[103],V[104]!==j||V[105]!==F?(B=(0,tu.jsxs)(tl.UserPreferencesModal,{children:[j,F]}),V[104]=j,V[105]=F,V[106]=B):B=V[106],B},"ohif.userPreferences.toolBindingsStorageKey":"user-preferred-tool-bindings"},sR="ohif.seriesDescriptionHistory";function sP(){try{let e=window.localStorage.getItem(sR),t=e?JSON.parse(e):null;return t&&"object"==typeof t?t:{}}catch(e){return console.debug("Unable to read the series description history",e),{}}}let sA=[{value:"current",label:"Save to current",help:"Adds a new version to this series as the new default. Earlier versions are kept.",unavailable:"This data has not been saved to a series yet"},{value:"new",label:"Save as new",help:"Creates a separate series.",unavailable:""},{value:"replace",label:"Replace existing",help:"Choose a series to replace. The current data becomes the default and earlier versions are kept.",unavailable:"No other series of this type is loaded"}];function sT(e){return(0,tu.jsx)(tl.SelectItem,{value:e.value,children:e.label},e.value)}function sN(e){return e.preventDefault()}function sU(e){return!e}function sL(e){return e.preventDefault()}function sF(e){return(0,tu.jsx)(tl.SelectItem,{value:e.value,children:e.label},e.value)}function sB(e){return Math.max(e-1,-1)}function sV(e){return!!e}function sz(e){return e?.trim()}function sH(e,t){return isFinite(t.SeriesNumber)?Math.max(e,Number(t.SeriesNumber)):e}let sW={"ohif.createReportDialog":function(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w,_,I,D,O,k,C,j,E,M,R,P,A,T,N,U,L,F,B,V,z,H,W=(0,ti.c)(141),{dataSources:$,modality:Y,predecessorImageId:G,minSeriesNumber:q,itemName:X,defaultSeriesDescription:J,itemType:Z,rememberedDescriptionCount:Q,hide:ee,onSave:et,onCancel:er,enableDownload:en}=e,ea=void 0===Y?"SR":Y,ei=void 0===q?3e3:q,eo=void 0===X?"":X,es=void 0===J?"":J,el=void 0===Q?5:Q,eu=void 0!==en&&en,{t:ec}=tQ("Buttons"),{servicesManager:ed}=(0,K.useSystem)(),ef=(0,to.useRef)(!1),ep=(0,to.useRef)(null),[eh,eg]=(0,to.useState)($?.[0]?.value??null),{displaySetService:em}=ed.services;W[0]!==em?(t=Array.from(em.getDisplaySetCache().values()),W[0]=em,W[1]=t):t=W[1],W[2]!==ea||W[3]!==t?(r=t.filter(e=>e.Modality===ea),W[2]=ea,W[3]=t,W[4]=r):r=W[4];let ey=r;if(W[5]!==ei||W[6]!==ey){let e=new Set;n=ey.map(e=>{let t=isFinite(e.SeriesNumber),r=t?`${e.SeriesNumber}`:"Not specified";return{value:e.predecessorImageId,seriesNumber:t?Number(e.SeriesNumber):ei,seriesNumberLabel:r,description:e.SeriesDescription||null,label:e.SeriesDescription||`Series ${r}`}}).filter(t=>!(!t.value||e.has(t.value))&&(e.add(t.value),!0)),W[5]=ei,W[6]=ey,W[7]=n}else n=W[7];let ev=n;W[8]!==ev||W[9]!==G?(a=ev.find(e=>e.value===G)??null,W[8]=ev,W[9]=G,W[10]=a):a=W[10];let eb=a;W[11]!==eb||W[12]!==ev?(i=ev.filter(e=>e!==eb),W[11]=eb,W[12]=ev,W[13]=i):i=W[13];let ex=i,eS=1+ey.reduce(sH,ei);if(W[14]!==eb?.description||W[15]!==es||W[16]!==eo||W[17]!==Z||W[18]!==ea||W[19]!==el){let e=el>0?function(e,t){if(!e||!(t>0))return[];let r=sP()[e];return Array.isArray(r)?r.filter(e=>"string"==typeof e&&!!e.trim()).slice(0,t):[]}(Z||ea,el):[],t=[eo,eb?.description,...e,es].map(sz).filter(sV);o=t.filter((e,r)=>t.findIndex(t=>t.toLowerCase()===e.toLowerCase())===r),W[14]=eb?.description,W[15]=es,W[16]=eo,W[17]=Z,W[18]=ea,W[19]=el,W[20]=o}else o=W[20];let ew=o;W[21]!==ew||W[22]!==el?(s=el>0?ew:ew.slice(0,1),W[21]=ew,W[22]=el,W[23]=s):s=W[23];let e_=s,eI=e_[0]??"",[eD,eO]=(0,to.useState)(eb?"current":"new"),[ek,eC]=(0,to.useState)(String(eS)),[ej,eE]=(0,to.useState)(eI),[eM,eR]=(0,to.useState)(null),[eP,eA]=(0,to.useState)(!1),[eT,eN]=(0,to.useState)(!1),[eU,eL]=(0,to.useState)(-1);W[24]!==ex||W[25]!==eM?(l=ex.find(e=>e.value===eM)??null,W[24]=ex,W[25]=eM,W[26]=l):l=W[26];let eF=l,eB="current"===eD?eb:"replace"===eD?eF:null,eV="replace"===eD&&!eF;W[27]!==eb||W[28]!==ex.length?(u=e=>"current"===e&&!!eb||"new"===e||"replace"===e&&ex.length>0,W[27]=eb,W[28]=ex.length,W[29]=u):u=W[29];let ez=u;if(W[30]!==eS||W[31]!==ek){let e=Number.parseInt(ek,10);c=Number.isFinite(e)?e:eS,W[30]=eS,W[31]=ek,W[32]=c}else c=W[32];let eH=c;if(W[33]!==e_||W[34]!==ej){let e=ej.trim().toLowerCase();d=e_.filter(t=>t.toLowerCase().startsWith(e)),W[33]=e_,W[34]=ej,W[35]=d}else d=W[35];let eW=d,e$=eT?eW:e_;W[36]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{eE(e),eA(!1),eL(-1)},W[36]=f):f=W[36];let eY=f;W[37]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{eE(e),eL(-1),eN(!0),eA(!0)},W[37]=p):p=W[37];let eG=p;W[38]!==eI||W[39]!==es||W[40]!==ee||W[41]!==eV||W[42]!==Z||W[43]!==ea||W[44]!==ej||W[45]!==et||W[46]!==el||W[47]!==eH||W[48]!==eB?(h=e=>{if(eV)return;ef.current=!0;let t=eB?eB.seriesNumber:eH,r=eB?eB.description??"":ej.trim()||eI,n=r.toLowerCase()===es?.trim().toLowerCase();eB||n||function(e,t,r){let n=t?.trim();if(!e||!n||!(r>0))return;let a=sP(),i=Array.isArray(a[e])?a[e]:[];a[e]=[n,...i.filter(e=>"string"==typeof e&&!!e.trim()&&e.toLowerCase()!==n.toLowerCase())].slice(0,r);try{window.localStorage.setItem(sR,JSON.stringify(a))}catch(e){console.debug("Unable to store the series description history",e)}}(Z||ea,r,el),et({reportName:r,dataSource:e,series:eB?eB.value:null,seriesNumber:t,priorSeriesNumber:t-1}),ee()},W[38]=eI,W[39]=es,W[40]=ee,W[41]=eV,W[42]=Z,W[43]=ea,W[44]=ej,W[45]=et,W[46]=el,W[47]=eH,W[48]=eB,W[49]=h):h=W[49];let eq=h;W[50]!==eh||W[51]!==eq?(g=()=>eq(eh),W[50]=eh,W[51]=eq,W[52]=g):g=W[52];let eX=g;W[53]!==eq?(m=()=>eq("download"),W[53]=eq,W[54]=m):m=W[54];let eK=m;W[55]!==ee||W[56]!==er?(y=()=>{ef.current=!0,er(),ee()},W[55]=ee,W[56]=er,W[57]=y):y=W[57];let eJ=y;W[58]!==eW||W[59]!==eP||W[60]!==eX||W[61]!==eU||W[62]!==ej||W[63]!==e$?(v=e=>{let t=eU>=0?e$[eU]:eW[0];switch(e.key){case"Tab":!e.shiftKey&&t&&t!==ej?(e.preventDefault(),eY(t)):eA(!1);break;case"ArrowDown":e.preventDefault(),eA(!0),eL(e=>Math.min(e+1,e$.length-1));break;case"ArrowUp":e.preventDefault(),eL(sB);break;case"Escape":eP&&(e.preventDefault(),eA(!1),eL(-1));break;case"Enter":e.preventDefault(),eP&&eU>=0&&t?eY(t):eX()}},W[58]=eW,W[59]=eP,W[60]=eX,W[61]=eU,W[62]=ej,W[63]=e$,W[64]=v):v=W[64];let eZ=v;W[65]!==er?(b=()=>()=>{ef.current||er()},x=[er],W[65]=er,W[66]=b,W[67]=x):(b=W[66],x=W[67]),(0,to.useEffect)(b,x),W[68]!==eD?(S=()=>{if("new"!==eD)return;let e=window.setTimeout(()=>ep.current?.focus(),0);return()=>window.clearTimeout(e)},w=[eD],W[68]=eD,W[69]=S,W[70]=w):(S=W[69],w=W[70]),(0,to.useEffect)(S,w),W[71]!==eD?(_=sA.find(e=>e.value===eD),W[71]=eD,W[72]=_):_=W[72];let eQ=_,e0=$?.length>1;W[73]!==$||W[74]!==eh||W[75]!==e0?(I=e0&&(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)(tl.Label,{className:"whitespace-nowrap pt-1.5 text-base",children:"Data source"}),(0,tu.jsxs)(tl.Select,{value:eh,onValueChange:eg,children:[(0,tu.jsx)(tl.SelectTrigger,{"data-cy":"report-data-source-select",children:(0,tu.jsx)(tl.SelectValue,{placeholder:"Select a data source"})}),(0,tu.jsx)(tl.SelectContent,{children:$.map(sF)})]})]}),W[73]=$,W[74]=eh,W[75]=e0,W[76]=I):I=W[76],W[77]===Symbol.for("react.memo_cache_sentinel")?(D=(0,tu.jsx)(tl.Label,{className:"whitespace-nowrap pt-1.5 text-base",children:"Series"}),W[77]=D):D=W[77],W[78]===Symbol.for("react.memo_cache_sentinel")?(O=e=>eO(e),W[78]=O):O=W[78],W[79]!==ez?(k=sA.map(e=>(0,tu.jsx)(tl.TabsTrigger,{value:e.value,"data-cy":`report-destination-${e.value}`,disabled:!ez(e.value),title:ez(e.value)?void 0:e.unavailable,children:e.label},e.value)),W[79]=ez,W[80]=k):k=W[80],W[81]!==k?(C=(0,tu.jsx)(tl.TabsList,{children:k}),W[81]=k,W[82]=C):C=W[82],W[83]!==eD||W[84]!==C?(j=(0,tu.jsx)(tl.Tabs,{value:eD,onValueChange:O,children:C}),W[83]=eD,W[84]=C,W[85]=j):j=W[85];let e1=eQ?.help;W[86]!==e1?(E=(0,tu.jsx)("p",{className:"text-muted-foreground mt-1.5 text-sm","data-cy":"report-destination-help",children:e1}),W[86]=e1,W[87]=E):E=W[87],W[88]!==j||W[89]!==E?(M=(0,tu.jsxs)("div",{children:[j,E]}),W[88]=j,W[89]=E,W[90]=M):M=W[90];let e2="new"===eD?"dialog-input":void 0;W[91]!==e2?(R=(0,tu.jsx)(tl.Label,{htmlFor:e2,className:"whitespace-nowrap pt-1.5 text-base",children:"Series Description"}),W[91]=e2,W[92]=R):R=W[92],W[93]!==eb?.description||W[94]!==e_.length||W[95]!==eP||W[96]!==eD||W[97]!==eZ||W[98]!==eU||W[99]!==ej||W[100]!==ex||W[101]!==eM||W[102]!==e$?(P="new"===eD?(0,tu.jsxs)("div",{className:"relative flex items-center gap-1",children:[(0,tu.jsx)(tl.Input,{ref:ep,id:"dialog-input","data-cy":"dialog-input",autoComplete:"off",placeholder:"Series description",value:ej,onChange:e=>eG(e.target.value),onKeyDown:eZ,onBlur:()=>eA(!1)}),e_.length>1&&(0,tu.jsx)("button",{type:"button","data-cy":"report-series-description-options","aria-label":"Series descriptions used before",className:"text-primary hover:bg-primary/25 shrink-0 rounded p-0.5",onMouseDown:sL,onClick:()=>{eL(-1),eN(!1),eA(sU)},children:(0,tu.jsx)(tl.Icons.ChevronOpen,{className:"h-5 w-5"})}),eP&&e$.length>0&&(0,tu.jsx)("ul",{className:"bg-popover text-popover-foreground border-input absolute left-0 right-0 top-full z-50 mt-1 max-h-40 overflow-auto rounded border p-1 shadow-md","data-cy":"report-series-description-list",children:e$.map((e,t)=>(0,tu.jsx)("li",{children:(0,tu.jsx)("button",{type:"button",className:(0,tl.cn)("hover:bg-accent hover:text-accent-foreground w-full truncate rounded px-2 py-1 text-left text-base",t===eU&&"bg-accent text-accent-foreground"),onMouseDown:sN,onClick:()=>eY(e),children:e})},e))})]}):"replace"===eD?(0,tu.jsxs)(tl.Select,{value:eM??void 0,onValueChange:eR,children:[(0,tu.jsx)(tl.SelectTrigger,{"data-cy":"report-replaced-series-select",children:(0,tu.jsx)(tl.SelectValue,{placeholder:"Select a series"})}),(0,tu.jsx)(tl.SelectContent,{children:ex.map(sT)})]}):(0,tu.jsx)("span",{className:"break-words pt-1.5 text-base","data-cy":"report-series-description",children:eb?.description??"No description"}),W[93]=eb?.description,W[94]=e_.length,W[95]=eP,W[96]=eD,W[97]=eZ,W[98]=eU,W[99]=ej,W[100]=ex,W[101]=eM,W[102]=e$,W[103]=P):P=W[103];let e3="new"===eD?"report-series-number":void 0;W[104]!==e3?(A=(0,tu.jsx)(tl.Label,{htmlFor:e3,className:"whitespace-nowrap pt-1.5 text-base",children:"Series Number"}),W[104]=e3,W[105]=A):A=W[105],W[106]!==eD||W[107]!==eX||W[108]!==ek||W[109]!==eB?(T="new"===eD?(0,tu.jsx)(tl.Input,{id:"report-series-number","data-cy":"report-series-number",type:"number",className:"w-28",value:ek,onChange:e=>eC(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eX())}}):(0,tu.jsx)("span",{className:"pt-1.5 text-base","data-cy":"report-series-number",children:eB?eB.seriesNumberLabel:""}),W[106]=eD,W[107]=eX,W[108]=ek,W[109]=eB,W[110]=T):T=W[110],W[111]!==I||W[112]!==M||W[113]!==R||W[114]!==P||W[115]!==A||W[116]!==T?(N=(0,tu.jsxs)("div",{className:"grid grid-cols-[7rem_minmax(0,1fr)] items-start gap-x-3 gap-y-4",children:[I,D,M,R,P,A,T]}),W[111]=I,W[112]=M,W[113]=R,W[114]=P,W[115]=A,W[116]=T,W[117]=N):N=W[117],W[118]!==eu||W[119]!==eK||W[120]!==eV||W[121]!==ec?(U=eu&&(0,tu.jsx)(tl.FooterAction.Left,{children:(0,tu.jsx)(tl.FooterAction.Secondary,{onClick:eK,dataCY:"report-download-button",disabled:eV,children:ec("Download")})}),W[118]=eu,W[119]=eK,W[120]=eV,W[121]=ec,W[122]=U):U=W[122],W[123]!==ec?(L=ec("Cancel"),W[123]=ec,W[124]=L):L=W[124],W[125]!==eJ||W[126]!==L?(F=(0,tu.jsx)(tl.FooterAction.Secondary,{onClick:eJ,dataCY:"input-dialog-cancel-button",children:L}),W[125]=eJ,W[126]=L,W[127]=F):F=W[127];let e4=eQ?.label;return W[128]!==eX||W[129]!==eV||W[130]!==e4?(B=(0,tu.jsx)(tl.FooterAction.Primary,{onClick:eX,dataCY:"input-dialog-save-button",disabled:eV,children:e4}),W[128]=eX,W[129]=eV,W[130]=e4,W[131]=B):B=W[131],W[132]!==F||W[133]!==B?(V=(0,tu.jsxs)(tl.FooterAction.Right,{children:[F,B]}),W[132]=F,W[133]=B,W[134]=V):V=W[134],W[135]!==U||W[136]!==V?(z=(0,tu.jsxs)(tl.FooterAction,{children:[U,V]}),W[135]=U,W[136]=V,W[137]=z):z=W[137],W[138]!==N||W[139]!==z?(H=(0,tu.jsxs)("div",{className:"text-foreground flex flex-col gap-4",children:[N,z]}),W[138]=N,W[139]=z,W[140]=H):H=W[140],H}},s$={"ohif.hotkeyBindings":K.defaults.hotkeyBindings};function sY(e,t=20,r=25){return new Promise(n=>{let a=0,i=setInterval(()=>{(document.querySelector(e)||a>=t)&&(clearInterval(i),n()),a++},r)})}let sG={"ohif.tours":[{id:"basicViewerTour",route:"/viewer",steps:[{id:"scroll",title:nz().t("Onboarding:Scrolling Through Images"),text:nz().t("Onboarding:You can scroll through the images using the mouse wheel or scrollbar."),attachTo:{element:".viewport-element",on:"top"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_WHEEL"},beforeShowPromise:()=>sY(".viewport-element")},{id:"zoom",title:nz().t("Onboarding:Zooming In and Out"),text:nz().t("Onboarding:You can zoom the images using the right click."),attachTo:{element:".viewport-element",on:"left"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_UP"},beforeShowPromise:()=>sY(".viewport-element")},{id:"pan",title:nz().t("Onboarding:Panning the Image"),text:nz().t("Onboarding:You can pan the images using the middle click."),attachTo:{element:".viewport-element",on:"top"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_UP"},beforeShowPromise:()=>sY(".viewport-element")},{id:"windowing",title:nz().t("Onboarding:Adjusting Window Level"),text:nz().t("Onboarding:You can modify the window level using the left click."),attachTo:{element:".viewport-element",on:"left"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_UP"},beforeShowPromise:()=>sY(".viewport-element")},{id:"length",title:nz().t("Onboarding:Using the Measurement Tools"),text:nz().t("Onboarding:You can measure the length of a region using the Length tool."),attachTo:{element:'[data-cy="MeasurementTools-split-button-primary"]',on:"bottom"},advanceOn:{selector:'[data-cy="MeasurementTools-split-button-primary"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="MeasurementTools-split-button-primary"]')},{id:"drawAnnotation",title:nz().t("Onboarding:Drawing Length Annotations"),text:nz().t("Onboarding:Use the length tool on the viewport to measure the length of a region."),attachTo:{element:".viewport-element",on:"right"},advanceOn:{selector:"body",event:"event::measurement_added"},beforeShowPromise:()=>sY(".viewport-element")},{id:"trackMeasurement",title:nz().t("Onboarding:Tracking Measurements in the Panel"),text:nz().t("Onboarding:Click yes to track the measurements in the measurement panel."),attachTo:{element:'[data-cy="prompt-begin-tracking-yes-btn"]',on:"bottom"},advanceOn:{selector:'[data-cy="prompt-begin-tracking-yes-btn"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="prompt-begin-tracking-yes-btn"]')},{id:"openMeasurementPanel",title:nz().t("Onboarding:Opening the Measurements Panel"),text:nz().t("Onboarding:Click the measurements button to open the measurements panel."),attachTo:{element:"#trackedMeasurements-btn",on:"left-start"},advanceOn:{selector:"#trackedMeasurements-btn",event:"click"},beforeShowPromise:()=>sY("#trackedMeasurements-btn")},{id:"scrollAwayFromMeasurement",title:nz().t("Onboarding:Scrolling Away from a Measurement"),text:nz().t("Onboarding:Scroll the images using the mouse wheel away from the measurement."),attachTo:{element:".viewport-element",on:"left"},advanceOn:{selector:".cornerstone-viewport-element",event:"CORNERSTONE_TOOLS_MOUSE_WHEEL"},beforeShowPromise:()=>sY(".viewport-element")},{id:"jumpToMeasurement",title:nz().t("Onboarding:Jumping to Measurements in the Panel"),text:nz().t("Onboarding:Click the measurement in the measurement panel to jump to it."),attachTo:{element:'[data-cy="data-row"]',on:"left-start"},advanceOn:{selector:'[data-cy="data-row"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="data-row"]')},{id:"changeLayout",title:nz().t("Onboarding:Changing Layout"),text:nz().t("Onboarding:You can change the layout of the viewer using the layout button, including MPR for multi-planar views."),attachTo:{element:'[data-cy="Layout"]',on:"bottom"},advanceOn:{selector:'[data-cy="Layout"]',event:"click"},beforeShowPromise:()=>sY('[data-cy="Layout"]')}],tourOptions:{useModalOverlay:!0,defaultStepOptions:{buttons:[{text:nz().t("Onboarding:Skip all"),action(){this.complete()},secondary:!0}]}}}]},sq={instanceSortingCriteria:{sortFunctions:{},defaultSortFunctionName:""}},{DefaultHistoryMemo:sX}=n5.utilities.HistoryMemo,sK=[aC.Enums.Events.HISTORY_UNDO,aC.Enums.Events.HISTORY_REDO,aC.Enums.Events.ANNOTATION_COMPLETED,aC.Enums.Events.ANNOTATION_MODIFIED,aC.Enums.Events.ANNOTATION_REMOVED,aC.Enums.Events.SEGMENTATION_DATA_MODIFIED],sJ=["mouseup","touchend"];function sZ(e){let{canUndo:t,canRedo:r}=sX;return e.canUndo===t&&e.canRedo===r?e:{canUndo:t,canRedo:r}}function sQ(){return{canUndo:sX.canUndo,canRedo:sX.canRedo}}let s0=function(){let e,t,r,n,a,i,o,s,l,u=(0,ti.c)(21),{commandsManager:c}=(0,K.useSystem)(),{t:d}=tQ(),{canUndo:f,canRedo:p}=function(){let e,t,r=(0,ti.c)(2),[n,a]=(0,to.useState)(sQ);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=null,t=()=>{e=null,a(sZ)},r=()=>{null===e&&(e=setTimeout(t,0))};return sK.forEach(e=>n5.eventTarget.addEventListener(e,r)),sJ.forEach(e=>window.addEventListener(e,r,!0)),t(),()=>{sK.forEach(e=>n5.eventTarget.removeEventListener(e,r)),sJ.forEach(e=>window.removeEventListener(e,r,!0)),null!==e&&clearTimeout(e)}},t=[],r[0]=e,r[1]=t):(e=r[0],t=r[1]),(0,to.useEffect)(e,t),n}(),h=!f;u[0]!==d?(e=d("Header:Undo"),u[0]=d,u[1]=e):e=u[1],u[2]!==c?(t=()=>{c.run("undo")},u[2]=c,u[3]=t):t=u[3],u[4]===Symbol.for("react.memo_cache_sentinel")?(r=(0,tu.jsx)(tl.Icons.Undo,{className:""}),u[4]=r):r=u[4],u[5]!==h||u[6]!==e||u[7]!==t?(n=(0,tu.jsx)(tl.Button,{variant:"ghost",className:"hover:bg-muted cursor-pointer","data-cy":"undo-btn",disabled:h,"aria-label":e,onClick:t,children:r}),u[5]=h,u[6]=e,u[7]=t,u[8]=n):n=u[8];let g=!p;return u[9]!==d?(a=d("Header:Redo"),u[9]=d,u[10]=a):a=u[10],u[11]!==c?(i=()=>{c.run("redo")},u[11]=c,u[12]=i):i=u[12],u[13]===Symbol.for("react.memo_cache_sentinel")?(o=(0,tu.jsx)(tl.Icons.Redo,{className:""}),u[13]=o):o=u[13],u[14]!==g||u[15]!==a||u[16]!==i?(s=(0,tu.jsx)(tl.Button,{variant:"ghost",className:"hover:bg-muted cursor-pointer","data-cy":"redo-btn",disabled:g,"aria-label":a,onClick:i,children:o}),u[14]=g,u[15]=a,u[16]=i,u[17]=s):s=u[17],u[18]!==n||u[19]!==s?(l=(0,tu.jsxs)("div",{className:"text-primary flex items-center",children:[n,s]}),u[18]=n,u[19]=s,u[20]=l):l=u[20],l},{formatPN:s1,formatDate:s2}=K.utils,s3=function(){let e,t,r,n,a,i=(0,ti.c)(10),{servicesManager:o}=(0,K.useSystem)(),{displaySetService:s}=o.services;i[0]===Symbol.for("react.memo_cache_sentinel")?(e={PatientName:"",PatientID:"",PatientSex:"",PatientDOB:""},i[0]=e):e=i[0];let[l,u]=(0,to.useState)(e),[c,d]=(0,to.useState)(!1);i[1]!==s?(t=e=>{let{displaySetsAdded:t}=e;if(!t.length)return;let r=t[0],n=r?.instances?.[0]||r?.instance;if(n){var a;let e,t;u({PatientID:n.PatientID||null,PatientName:n.PatientName?s1(n.PatientName):null,PatientSex:n.PatientSex||null,PatientDOB:s2(n.PatientBirthDate)||null}),a=n.PatientID||null,e=s.getActiveDisplaySets(),t=!1,e.forEach(e=>{let r=e?.instances?.[0]||e?.instance;r&&r.PatientID!==a&&(t=!0)}),d(t)}},i[1]=s,i[2]=t):t=i[2];let f=t;return i[3]!==s||i[4]!==f?(r=()=>{let e=s.subscribe(s.EVENTS.DISPLAY_SETS_ADDED,e=>f(e));return()=>e.unsubscribe()},i[3]=s,i[4]=f,i[5]=r):r=i[5],i[6]===Symbol.for("react.memo_cache_sentinel")?(n=[],i[6]=n):n=i[6],(0,to.useEffect)(r,n),i[7]!==c||i[8]!==l?(a={patientInfo:l,isMixedPatients:c},i[7]=c,i[8]=l,i[9]=a):a=i[9],a},s4=((b={}).VISIBLE="visible",b.VISIBLE_COLLAPSED="visibleCollapsed",b.DISABLED="disabled",b.VISIBLE_READONLY="visibleReadOnly",b),s5=(e,t)=>e?.length>t?e.substring(0,t)+"...":e;function s8(e){let t,r,n,a,i,o,s,l,u,c=(0,ti.c)(28),{showPatientInfo:d}=e,f=d===s4.VISIBLE||d===s4.VISIBLE_READONLY,[p,h]=(0,to.useState)(f),{patientInfo:g,isMixedPatients:m}=s3();c[0]!==p||c[1]!==m?(t=()=>{m&&p&&h(!1)},r=[m,p],c[0]=p,c[1]=m,c[2]=t,c[3]=r):(t=c[2],r=c[3]),(0,to.useEffect)(t,r),c[4]!==p||c[5]!==m||c[6]!==d?(n=()=>{m||d===s4.VISIBLE_READONLY||h(!p)},c[4]=p,c[5]=m,c[6]=d,c[7]=n):n=c[7];let y=n;c[8]!==g.PatientName?(a=s5(g.PatientName,27),c[8]=g.PatientName,c[9]=a):a=c[9];let v=a;c[10]!==g.PatientID?(i=s5(g.PatientID,15),c[10]=g.PatientID,c[11]=i):i=c[11];let b=i;c[12]!==m?(o=m?(0,tu.jsx)(tl.Icons.MultiplePatients,{className:"text-primary"}):(0,tu.jsx)(tl.Icons.Patient,{className:"text-primary"}),c[12]=m,c[13]=o):o=c[13],c[14]!==p||c[15]!==b||c[16]!==v||c[17]!==m||c[18]!==g.PatientDOB||c[19]!==g.PatientSex?(s=(0,tu.jsx)("div",{className:"flex flex-col justify-center",children:p?(0,tu.jsxs)(tu.Fragment,{children:[(0,tu.jsx)("div",{className:"text-foreground self-start text-[13px] font-bold",children:v}),(0,tu.jsxs)("div",{className:"text-muted-foreground flex gap-2 text-[11px]",children:[(0,tu.jsx)("div",{children:b}),(0,tu.jsx)("div",{children:g.PatientSex}),(0,tu.jsx)("div",{children:g.PatientDOB})]})]}):(0,tu.jsx)("div",{className:"text-primary self-center text-[13px]",children:m?"Multiple Patients":"Patient"})}),c[14]=p,c[15]=b,c[16]=v,c[17]=m,c[18]=g.PatientDOB,c[19]=g.PatientSex,c[20]=s):s=c[20];let x=`text-primary ${p?"rotate-180":""}`;return c[21]!==x?(l=(0,tu.jsx)(tl.Icons.ArrowLeft,{className:x}),c[21]=x,c[22]=l):l=c[22],c[23]!==y||c[24]!==o||c[25]!==s||c[26]!==l?(u=(0,tu.jsxs)("div",{className:"hover:bg-muted flex cursor-pointer items-center justify-center gap-1 rounded-lg",onClick:y,children:[o,s,l]}),c[23]=y,c[24]=o,c[25]=s,c[26]=l,c[27]=u):u=c[27],u}let s6={"ohif.headerRightSide":{items:[s0,function(){let e,t=(0,ti.c)(2),{extensionManager:r}=(0,K.useSystem)(),{showPatientInfo:n}=r.appConfig;return n===s4.DISABLED?null:(t[0]!==n?(e=(0,tu.jsx)(s8,{showPatientInfo:n}),t[0]=n,t[1]=e):e=t[1],e)}]}},s9={"ohif.headerRightSide":{items:{$filter:e=>e!==s0}}},s7=e=>{let t,r,n,a,i,o=(0,ti.c)(11),{displaySets:s}=e,{axis:l,series:u}=s[0].instance.chartData;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t={min:0},o[0]=t):t=o[0],o[1]!==l.x.label?(r={label:l.x.label,indexRef:0,type:"x",range:t},o[1]=l.x.label,o[2]=r):r=o[2],o[3]!==l.y.label?(n={label:l.y.label,indexRef:1,type:"y"},o[3]=l.y.label,o[4]=n):n=o[4],o[5]!==r||o[6]!==n?(a={x:r,y:n},o[5]=r,o[6]=n,o[7]=a):a=o[7],o[8]!==u||o[9]!==a?(i=(0,tu.jsx)(tl.LineChart,{showLegend:!0,legendWidth:150,axis:a,series:u}),o[8]=u,o[9]=a,o[10]=i):i=o[10],i};var le=I(3425);let lt=J().classes.MetadataProvider;function lr(e){let t=K.utils.toNumber(e);return"number"==typeof t&&Number.isFinite(t)?t:void 0}let ln=e=>{let t=e?.images[0]?.ViewCodeSequence[0];if(!t)return;let{CodingSchemeDesignator:r,CodeValue:n}=t;if(r&&n)return`${r}:${n}`},la=e=>{let t=e?.images?.[0]?.SharedFunctionalGroupsSequence?.[0]?.FrameAnatomySequence?.[0];if(t)return t?.FrameLaterality},li=K.classes.MetadataProvider,lo=({SeriesInstanceUID:e,StudyInstanceUID:t})=>{let{instances:r}=K.DicomMetadataStore.getSeries(t,e);if(!r?.length)return;let n=r[0].Modality;if(!["PT","RTDOSE"].includes(n))return;let a=r.map(e=>e.imageId),i=[];if("RTDOSE"===n){let e=r[0].DoseGridScaling,t=r[0].DoseSummation,n=r[0].DoseType,i=r[0].DoseUnit,o=r[0].NumberOfFrames,s=a[0];for(let r=0;r<o;r++){let a=r+1,o=`${s.replace(/\/frames\/\d+$/,"")}/frames/${a}`;li.addCustomMetadata(o,"scalingModule",{DoseGridScaling:e,DoseSummation:t,DoseType:n,DoseUnit:i})}return}try{if(a.forEach(e=>{let t=function(e){let t=lt.get("instance",e);if(!t)throw Error("dicom metadata are required");let r=function(e){if(null!=e&&"object"==typeof e)return Array.isArray(e)?e[0]:e}(t.RadiopharmaceuticalInformationSequence),n=lr(r?.RadionuclideHalfLife),a=lr(r?.RadionuclideTotalDose);if(void 0===t.SeriesDate||void 0===t.SeriesTime||void 0===t.CorrectedImage||void 0===t.Units||!r||void 0===n||void 0===a||void 0===t.DecayCorrection||void 0===t.AcquisitionDate||void 0===t.AcquisitionTime||void 0===r.RadiopharmaceuticalStartDateTime&&void 0===r.RadiopharmaceuticalStartTime)throw Error("required metadata are missing");void 0===t.PatientWeight&&console.warn("PatientWeight missing from PT instance metadata");let i={CorrectedImage:t.CorrectedImage,Units:t.Units,RadionuclideHalfLife:n,RadionuclideTotalDose:a,RadiopharmaceuticalStartDateTime:r.RadiopharmaceuticalStartDateTime,RadiopharmaceuticalStartTime:r.RadiopharmaceuticalStartTime,DecayCorrection:t.DecayCorrection,PatientWeight:lr(t.PatientWeight),SeriesDate:t.SeriesDate,SeriesTime:t.SeriesTime,AcquisitionDate:t.AcquisitionDate,AcquisitionTime:t.AcquisitionTime},o=lr(t["70531000"]),s=lr(t["70531009"]);(void 0!==o||void 0!==s)&&(i.PhilipsPETPrivateGroup={SUVScaleFactor:o,ActivityConcentrationScaleFactor:s}),void 0!==t["0009100d"]&&(i.GEPrivatePostInjectionDateTime=t["0009100d"]);let l=lr(t.FrameReferenceTime);void 0!==l&&(i.FrameReferenceTime=l);let u=lr(t.ActualFrameDuration);void 0!==u&&(i.ActualFrameDuration=u),void 0!==t.PatientSex&&(i.PatientSex=t.PatientSex);let c=lr(t.PatientSize);return void 0!==c&&(i.PatientSize=c),i}(e);t&&i.push(t)}),!i.length)return;let e=(0,le.calculateSUVScalingFactors)(i);i.forEach((t,r)=>{li.addCustomMetadata(a[r],"scalingModule",e[r])})}catch(e){console.log(e)}};function ls(e){return!("object"==typeof e||Array.isArray(e))}let ll=new Set(["DS","FL","FD","IS","OD","OF","OL","OV","SL","SS","SV","UL","US","UV"]);function lu(e,t){return Array.isArray(e)?e.map(e=>ls(e)?e:lu(e,t)):(ls(e)||Object.keys(e).forEach(r=>{null===e[r].Value&&e[r].vr?delete e[r].Value:Array.isArray(e[r].Value)&&e[r].vr&&(1===e[r].Value.length&&e[r].Value[0].BulkDataURI?(t?.dataSourceConfig&&eI(e[r].Value[0],t,t.dataSourceConfig),e[r].BulkDataURI=e[r].Value[0].BulkDataURI,"https:"===window.location.protocol&&e[r].BulkDataURI.startsWith("http:")&&(e[r].BulkDataURI=e[r].BulkDataURI.replace("http:","https:")),delete e[r].Value):ll.has(e[r].vr)?e[r].Value=e[r].Value.map(e=>+e):e[r].Value=e[r].Value.map(e=>lu(e,t)))}),e)}function lc(e){return JSON.parse(JSON.stringify(lu(e)))}function ld(e,t=["ImageType"]){for(let r of t)"string"==typeof e[r]&&(e[r]=e[r].split("\\"));return e}let lf=id()(e=>({type:"uiStateId",uiState:{},setUIState:(t,r)=>e(e=>({uiState:{...e.uiState,[t]:r}}),!1,"setUIState"),clearUIState:()=>e({uiState:{}},!1,"clearUIState")}));var lp=I(3154);function lh(e){let t,r,n,a,i,o=(0,ti.c)(15),{hide:s,onSave:l,placeholder:u,defaultValue:c,submitOnEnter:d}=e,f=void 0===u?"Enter value":u,p=void 0===c?"":c;return o[0]!==f?(t=(0,tu.jsx)(tl.InputDialog.Field,{children:(0,tu.jsx)(tl.InputDialog.Input,{placeholder:f})}),o[0]=f,o[1]=t):t=o[1],o[2]!==s?(r=(0,tu.jsx)(tl.InputDialog.ActionsSecondary,{onClick:s,children:"Cancel"}),o[2]=s,o[3]=r):r=o[3],o[4]!==s||o[5]!==l?(n=(0,tu.jsx)(tl.InputDialog.ActionsPrimary,{onClick:e=>{l(e),s()},children:"Save"}),o[4]=s,o[5]=l,o[6]=n):n=o[6],o[7]!==r||o[8]!==n?(a=(0,tu.jsxs)(tl.InputDialog.Actions,{children:[r,n]}),o[7]=r,o[8]=n,o[9]=a):a=o[9],o[10]!==p||o[11]!==d||o[12]!==t||o[13]!==a?(i=(0,tu.jsxs)(tl.InputDialog,{submitOnEnter:d,defaultValue:p,children:[t,a]}),o[10]=p,o[11]=d,o[12]=t,o[13]=a,o[14]=i):i=o[14],i}async function lg({uiDialogService:e,defaultValue:t="",title:r="Annotation",placeholder:n="",submitOnEnter:a=!0}){return await new Promise(i=>{e.show({id:"dialog-enter-annotation",content:lh,title:r,shouldCloseOnEsc:!0,contentProps:{onSave:e=>{i(e)},placeholder:n,defaultValue:t,submitOnEnter:a}})})}async function lm({measurement:e,uiDialogService:t,labelConfig:r,renderContent:n=tl.LabellingFlow,element:a}){let i=!!r&&r.exclusive,o=r?r.items:[];return await new Promise((r,s)=>{t.show({id:"select-annotation",title:"Annotation",content:n,contentProps:{labellingDoneCallback:n=>{if(t.hide("select-annotation"),e&&"string"==typeof n){let t=aC.annotation.state.getAnnotation(e.uid);(0,lp.setAnnotationLabel)(t,a,n)}r(n)},measurementData:e,componentClassName:{},labelData:o,exclusive:i}})})}var ly=I(6457),lv=function(e,t,r,n,a){var i=a.clientWidth,o=a.clientHeight,s="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,u=s-(a.getBoundingClientRect().left+window.pageXOffset),c=l-(a.getBoundingClientRect().top+window.pageYOffset);if("vertical"===r){var d=void 0;if(d=c<0?0:c>o?1:Math.round(100*c/o)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(n!==(f=u<0?0:u>i?1:Math.round(100*u/i)/100))return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},lb={},lx=function(e,t,r,n){if("u"<typeof document&&!n)return null;var a=n?new n:document.createElement("canvas");a.width=2*r,a.height=2*r;var i=a.getContext("2d");return i?(i.fillStyle=e,i.fillRect(0,0,a.width,a.height),i.fillStyle=t,i.fillRect(0,0,r,r),i.translate(r,r),i.fillRect(0,0,r,r),a.toDataURL()):null},lS=function(e,t,r,n){var a=e+"-"+t+"-"+r+(n?"-server":"");if(lb[a])return lb[a];var i=lx(e,t,r,n);return lb[a]=i,i},lw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l_=function(e){var t=e.white,r=e.grey,n=e.size,a=e.renderers,i=e.borderRadius,o=e.boxShadow,s=e.children,l=(0,ly.Ay)({default:{grid:{borderRadius:i,boxShadow:o,absolute:"0px 0px 0px 0px",background:"url("+lS(t,r,n,a.canvas)+") center left"}}});return(0,to.isValidElement)(s)?to.cloneElement(s,lw({},s.props,{style:lw({},s.props.style,l.grid)})):to.createElement("div",{style:l.grid})};l_.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var lI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lD=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function lO(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var lk=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");for(var e,r,n,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=n=lO(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.handleChange=function(e){var t=lv(e,n.props.hsl,n.props.direction,n.props.a,n.container);t&&"function"==typeof n.props.onChange&&n.props.onChange(t,e)},n.handleMouseDown=function(e){n.handleChange(e),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},lO(n,r)}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),lD(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,r=(0,ly.Ay)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:lI({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return to.createElement("div",{style:r.alpha},to.createElement("div",{style:r.checkboard},to.createElement(l_,{renderers:this.props.renderers})),to.createElement("div",{style:r.gradient}),to.createElement("div",{style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},to.createElement("div",{style:r.pointer},this.props.pointer?to.createElement(this.props.pointer,this.props):to.createElement("div",{style:r.slider}))))}}]),t}(to.PureComponent||to.Component),lC=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),lj=[38,40],lE=1,lM=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(e){r.setUpdatedValue(e.target.value,e)},r.handleKeyDown=function(e){var t,n=Number(String(e.target.value).replace(/%/g,""));if(!isNaN(n)&&(t=e.keyCode,lj.indexOf(t)>-1)){var a=r.getArrowOffset(),i=38===e.keyCode?n+a:n-a;r.setUpdatedValue(i,e)}},r.handleDrag=function(e){if(r.props.dragLabel){var t=Math.round(r.props.value+e.movementX);t>=0&&t<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(t),e)}},r.handleMouseDown=function(e){r.props.dragLabel&&(e.preventDefault(),r.handleDrag(e),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},r.inputId="rc-editable-input-"+lE++,r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),lC(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){var t,r;return t={},r=this.props.label,r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var r=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(r,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,ly.Ay)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return to.createElement("div",{style:t.wrap},to.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?to.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(to.PureComponent||to.Component),lR=function(e,t,r,n){var a=n.clientWidth,i=n.clientHeight,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=o-(n.getBoundingClientRect().left+window.pageXOffset),u=s-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(c=u<0?359:u>i?0:360*(-(100*u/i)+100)/100,r.h!==c)return{h:c,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var d=void 0;if(d=l<0?0:l>a?359:100*l/a*360/100,r.h!==d)return{h:d,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},lP=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function lA(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var lT=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");for(var e,r,n,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=n=lA(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.handleChange=function(e){var t=lR(e,n.props.direction,n.props.hsl,n.container);t&&"function"==typeof n.props.onChange&&n.props.onChange(t,e)},n.handleMouseDown=function(e){n.handleChange(e),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},lA(n,r)}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),lP(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,r=void 0===t?"horizontal":t,n=(0,ly.Ay)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(100*this.props.hsl.h/360)+100+"%"}}},{vertical:"vertical"===r});return to.createElement("div",{style:n.hue},to.createElement("div",{className:"hue-"+r,style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},to.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),to.createElement("div",{style:n.pointer},this.props.pointer?to.createElement(this.props.pointer,this.props):to.createElement("div",{style:n.slider}))))}}]),t}(to.PureComponent||to.Component),lN=I(7598),lU=I.n(lN);let lL=function(e,t){return e===t||e!=e&&t!=t},lF=function(e,t){for(var r=e.length;r--;)if(lL(e[r][0],t))return r;return -1};var lB=Array.prototype.splice;function lV(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}lV.prototype.clear=function(){this.__data__=[],this.size=0},lV.prototype.delete=function(e){var t=this.__data__,r=lF(t,e);return!(r<0)&&(r==t.length-1?t.pop():lB.call(t,r,1),--this.size,!0)},lV.prototype.get=function(e){var t=this.__data__,r=lF(t,e);return r<0?void 0:t[r][1]},lV.prototype.has=function(e){return lF(this.__data__,e)>-1},lV.prototype.set=function(e,t){var r=this.__data__,n=lF(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var lz="object"==typeof global&&global&&global.Object===Object&&global,lH="object"==typeof self&&self&&self.Object===Object&&self,lW=lz||lH||Function("return this")(),l$=lW.Symbol,lY=Object.prototype,lG=lY.hasOwnProperty,lq=lY.toString,lX=l$?l$.toStringTag:void 0;let lK=function(e){var t=lG.call(e,lX),r=e[lX];try{e[lX]=void 0;var n=!0}catch(e){}var a=lq.call(e);return n&&(t?e[lX]=r:delete e[lX]),a};var lJ=Object.prototype.toString,lZ=l$?l$.toStringTag:void 0;let lQ=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":lZ&&lZ in Object(e)?lK(e):lJ.call(e)},l0=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},l1=function(e){if(!l0(e))return!1;var t=lQ(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var l2=lW["__core-js_shared__"],l3=(x=/[^.]+$/.exec(l2&&l2.keys&&l2.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",l4=Function.prototype.toString;let l5=function(e){if(null!=e){try{return l4.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var l8=/^\[object .+?Constructor\]$/,l6=Object.prototype,l9=Function.prototype.toString,l7=l6.hasOwnProperty,ue=RegExp("^"+l9.call(l7).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let ut=function(e){return!!l0(e)&&(!l3||!(l3 in e))&&(l1(e)?ue:l8).test(l5(e))},ur=function(e,t){var r=null==e?void 0:e[t];return ut(r)?r:void 0};var un=ur(lW,"Map"),ua=ur(Object,"create"),ui=Object.prototype.hasOwnProperty,uo=Object.prototype.hasOwnProperty;function us(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}us.prototype.clear=function(){this.__data__=ua?ua(null):{},this.size=0},us.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},us.prototype.get=function(e){var t=this.__data__;if(ua){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ui.call(t,e)?t[e]:void 0},us.prototype.has=function(e){var t=this.__data__;return ua?void 0!==t[e]:uo.call(t,e)},us.prototype.set=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=ua&&void 0===t?"__lodash_hash_undefined__":t,this};let ul=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},uu=function(e,t){var r=e.__data__;return ul(t)?r["string"==typeof t?"string":"hash"]:r.map};function uc(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ud(e){var t=this.__data__=new lV(e);this.size=t.size}uc.prototype.clear=function(){this.size=0,this.__data__={hash:new us,map:new(un||lV),string:new us}},uc.prototype.delete=function(e){var t=uu(this,e).delete(e);return this.size-=!!t,t},uc.prototype.get=function(e){return uu(this,e).get(e)},uc.prototype.has=function(e){return uu(this,e).has(e)},uc.prototype.set=function(e,t){var r=uu(this,e),n=r.size;return r.set(e,t),this.size+=+(r.size!=n),this},ud.prototype.clear=function(){this.__data__=new lV,this.size=0},ud.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ud.prototype.get=function(e){return this.__data__.get(e)},ud.prototype.has=function(e){return this.__data__.has(e)},ud.prototype.set=function(e,t){var r=this.__data__;if(r instanceof lV){var n=r.__data__;if(!un||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new uc(n)}return r.set(e,t),this.size=r.size,this};var uf=function(){try{var e=ur(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();let up=function(e,t,r){"__proto__"==t&&uf?uf(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},uh=function(e,t,r){(void 0===r||lL(e[t],r))&&(void 0!==r||t in e)||up(e,t,r)},ug=function(e,t,r){for(var n=-1,a=Object(e),i=r(e),o=i.length;o--;){var s=i[++n];if(!1===t(a[s],s,a))break}return e};var um="object"==typeof exports&&exports&&!exports.nodeType&&exports,uy=um&&"object"==typeof module&&module&&!module.nodeType&&module,uv=uy&&uy.exports===um?lW.Buffer:void 0,ub=uv?uv.allocUnsafe:void 0;let ux=function(e,t){if(t)return e.slice();var r=e.length,n=ub?ub(r):new e.constructor(r);return e.copy(n),n};var uS=lW.Uint8Array;let uw=function(e){var t=new e.constructor(e.byteLength);return new uS(t).set(new uS(e)),t},u_=function(e,t){var r=t?uw(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},uI=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};var uD=Object.create,uO=function(){function e(){}return function(t){if(!l0(t))return{};if(uD)return uD(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();let uk=function(e,t){return function(r){return e(t(r))}};var uC=uk(Object.getPrototypeOf,Object),uj=Object.prototype;let uE=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||uj)},uM=function(e){return null!=e&&"object"==typeof e},uR=function(e){return uM(e)&&"[object Arguments]"==lQ(e)};var uP=Object.prototype,uA=uP.hasOwnProperty,uT=uP.propertyIsEnumerable,uN=uR(function(){return arguments}())?uR:function(e){return uM(e)&&uA.call(e,"callee")&&!uT.call(e,"callee")},uU=Array.isArray;let uL=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},uF=function(e){return null!=e&&uL(e.length)&&!l1(e)};var uB="object"==typeof exports&&exports&&!exports.nodeType&&exports,uV=uB&&"object"==typeof module&&module&&!module.nodeType&&module,uz=uV&&uV.exports===uB?lW.Buffer:void 0;let uH=(uz?uz.isBuffer:void 0)||function(){return!1};var uW=Object.prototype,u$=Function.prototype.toString,uY=uW.hasOwnProperty,uG=u$.call(Object);let uq=function(e){if(!uM(e)||"[object Object]"!=lQ(e))return!1;var t=uC(e);if(null===t)return!0;var r=uY.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u$.call(r)==uG};var uX={};uX["[object Float32Array]"]=uX["[object Float64Array]"]=uX["[object Int8Array]"]=uX["[object Int16Array]"]=uX["[object Int32Array]"]=uX["[object Uint8Array]"]=uX["[object Uint8ClampedArray]"]=uX["[object Uint16Array]"]=uX["[object Uint32Array]"]=!0,uX["[object Arguments]"]=uX["[object Array]"]=uX["[object ArrayBuffer]"]=uX["[object Boolean]"]=uX["[object DataView]"]=uX["[object Date]"]=uX["[object Error]"]=uX["[object Function]"]=uX["[object Map]"]=uX["[object Number]"]=uX["[object Object]"]=uX["[object RegExp]"]=uX["[object Set]"]=uX["[object String]"]=uX["[object WeakMap]"]=!1;var uK="object"==typeof exports&&exports&&!exports.nodeType&&exports,uJ=uK&&"object"==typeof module&&module&&!module.nodeType&&module,uZ=uJ&&uJ.exports===uK&&lz.process,uQ=function(){try{var e=uJ&&uJ.require&&uJ.require("util").types;if(e)return e;return uZ&&uZ.binding&&uZ.binding("util")}catch(e){}}(),u0=uQ&&uQ.isTypedArray,u1=u0?function(e){return u0(e)}:function(e){return uM(e)&&uL(e.length)&&!!uX[lQ(e)]};let u2=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var u3=Object.prototype.hasOwnProperty;let u4=function(e,t,r){var n=e[t];u3.call(e,t)&&lL(n,r)&&(void 0!==r||t in e)||up(e,t,r)},u5=function(e,t,r,n){var a=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),a?up(r,s,l):u4(r,s,l)}return r},u8=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var u6=/^(?:0|[1-9]\d*)$/;let u9=function(e,t){var r=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==r||"symbol"!=r&&u6.test(e))&&e>-1&&e%1==0&&e<t};var u7=Object.prototype.hasOwnProperty;let ce=function(e,t){var r=uU(e),n=!r&&uN(e),a=!r&&!n&&uH(e),i=!r&&!n&&!a&&u1(e),o=r||n||a||i,s=o?u8(e.length,String):[],l=s.length;for(var u in e)(t||u7.call(e,u))&&!(o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||u9(u,l)))&&s.push(u);return s},ct=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t};var cr=Object.prototype.hasOwnProperty;let cn=function(e){if(!l0(e))return ct(e);var t=uE(e),r=[];for(var n in e)"constructor"==n&&(t||!cr.call(e,n))||r.push(n);return r},ca=function(e){return uF(e)?ce(e,!0):cn(e)},ci=function(e,t,r,n,a,i,o){var s=u2(e,r),l=u2(t,r),u=o.get(l);if(u)return void uh(e,r,u);var c=i?i(s,l,r+"",e,t,o):void 0,d=void 0===c;if(d){var f=uU(l),p=!f&&uH(l),h=!f&&!p&&u1(l);(c=l,f||p||h)?uU(s)?c=s:uM(s)&&uF(s)?c=uI(s):p?(d=!1,c=ux(l,!0)):h?(d=!1,c=u_(l,!0)):c=[]:uq(l)||uN(l)?(c=s,uN(s))?c=u5(s,ca(s)):(!l0(s)||l1(s))&&(c="function"!=typeof l.constructor||uE(l)?{}:uO(uC(l))):d=!1}d&&(o.set(l,c),a(c,l,n,i,o),o.delete(l)),uh(e,r,c)},co=function e(t,r,n,a,i){t!==r&&ug(r,function(o,s){if(i||(i=new ud),l0(o))ci(t,r,s,n,e,a,i);else{var l=a?a(u2(t,s),o,s+"",t,r,i):void 0;void 0===l&&(l=o),uh(t,s,l)}},ca)},cs=function(e){return e},cl=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)};var cu=Math.max,cc=Date.now,cd=(S=uf?function(e,t){return uf(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:cs,w=0,_=0,function(){var e=cc(),t=16-(e-_);if(_=e,t>0){if(++w>=800)return arguments[0]}else w=0;return S.apply(void 0,arguments)});let cf=function(e,t,r){if(!l0(r))return!1;var n=typeof t;return("number"==n?!!(uF(r)&&u9(t,r.length)):"string"==n&&t in r)&&lL(r[t],e)};var cp=(O=function(e,t,r){co(e,t,r)},cd((e=function(e,t){var r=-1,n=t.length,a=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(a=O.length>3&&"function"==typeof a?(n--,a):void 0,i&&cf(t[0],t[1],i)&&(a=n<3?void 0:a,n=1),e=Object(e);++r<n;){var o=t[r];o&&O(e,o,r)}return e},t=cu((t=void 0,e.length-1),0),function(){for(var r=arguments,n=-1,a=cu(r.length-t,0),i=Array(a);++n<a;)i[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];return o[t]=cs(i),cl(e,this,o)}),e+"")),ch=function(e){var t=e.zDepth,r=e.radius,n=e.background,a=e.children,i=e.styles,o=(0,ly.Ay)(cp({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+4*t+"px rgba(0,0,0,.24)",borderRadius:r,background:n}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},void 0===i?{}:i),{"zDepth-1":1===t});return to.createElement("div",{style:o.wrap},to.createElement("div",{style:o.bg}),to.createElement("div",{style:o.content},a))};ch.propTypes={background:lU().string,zDepth:lU().oneOf([0,1,2,3,4,5]),radius:lU().number,styles:lU().object},ch.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};let cg=function(){return lW.Date.now()};var cm=/\s/;let cy=function(e){for(var t=e.length;t--&&cm.test(e.charAt(t)););return t};var cv=/^\s+/;let cb=function(e){return"symbol"==typeof e||uM(e)&&"[object Symbol]"==lQ(e)};var cx=0/0,cS=/^[-+]0x[0-9a-f]+$/i,cw=/^0b[01]+$/i,c_=/^0o[0-7]+$/i,cI=parseInt;let cD=function(e){if("number"==typeof e)return e;if(cb(e))return cx;if(l0(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=l0(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,cy(t)+1).replace(cv,""):t;var n=cw.test(e);return n||c_.test(e)?cI(e.slice(2),n?2:8):cS.test(e)?cx:+e};var cO=Math.max,ck=Math.min;let cC=function(e,t,r){var n,a,i,o,s,l,u=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(t){var r=n,i=a;return n=a=void 0,u=t,o=e.apply(i,r)}function h(e){var r=e-l,n=e-u;return void 0===l||r>=t||r<0||d&&n>=i}function g(){var e,r,n,a=cg();if(h(a))return m(a);s=setTimeout(g,(e=a-l,r=a-u,n=t-e,d?ck(n,i-r):n))}function m(e){return(s=void 0,f&&n)?p(e):(n=a=void 0,o)}function y(){var e,r=cg(),i=h(r);if(n=arguments,a=this,l=r,i){if(void 0===s)return u=e=l,s=setTimeout(g,t),c?p(e):o;if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),o}return t=cD(t)||0,l0(r)&&(c=!!r.leading,i=(d="maxWait"in r)?cO(cD(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=l=a=s=void 0},y.flush=function(){return void 0===s?o:m(cg())},y},cj=function(e,t,r){var n=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return l0(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),cC(e,t,{leading:n,maxWait:t,trailing:a})};var cE=function(e,t,r){var n=r.getBoundingClientRect(),a=n.width,i=n.height,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=o-(r.getBoundingClientRect().left+window.pageXOffset),u=s-(r.getBoundingClientRect().top+window.pageYOffset);l<0?l=0:l>a&&(l=a),u<0?u=0:u>i&&(u=i);var c=l/a,d=1-u/i;return{h:t.h,s:c,v:d,a:t.a,source:"hsv"}},cM=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),cR=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.handleChange=function(e){"function"==typeof r.props.onChange&&r.throttle(r.props.onChange,cE(e,r.props.hsl,r.container),e)},r.handleMouseDown=function(e){r.handleChange(e);var t=r.getContainerRenderWindow();t.addEventListener("mousemove",r.handleChange),t.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.throttle=cj(function(e,t,r){e(t,r)},50),r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),cM(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},r=t.color,n=t.white,a=t.black,i=t.pointer,o=t.circle,s=(0,ly.Ay)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(100*this.props.hsv.v)+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:r,white:n,black:a,pointer:i,circle:o}},{custom:!!this.props.style});return to.createElement("div",{style:s.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},to.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),to.createElement("div",{style:s.white,className:"saturation-white"},to.createElement("div",{style:s.black,className:"saturation-black"}),to.createElement("div",{style:s.pointer},this.props.pointer?to.createElement(this.props.pointer,this.props):to.createElement("div",{style:s.circle}))))}}]),t}(to.PureComponent||to.Component);let cP=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e};var cA=uk(Object.keys,Object),cT=Object.prototype.hasOwnProperty;let cN=function(e){if(!uE(e))return cA(e);var t=[];for(var r in Object(e))cT.call(e,r)&&"constructor"!=r&&t.push(r);return t},cU=function(e){return uF(e)?ce(e):cN(e)};var cL=(k=function(e,t){return e&&ug(e,t,cU)},function(e,t){if(null==e)return e;if(!uF(e))return k(e,t);for(var r=e.length,n=-1,a=Object(e);++n<r&&!1!==t(a[n],n,a););return e});let cF=function(e,t){return(uU(e)?cP:cL)(e,"function"==typeof t?t:cs)};function cB(e){return(cB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var cV=/^\s+/,cz=/\s+$/;function cH(e,t){if(t=t||{},(e=e||"")instanceof cH)return e;if(!(this instanceof cH))return new cH(e,t);var r,n,a,i,o,s,l,u,c,d,f,p,h,g,m,y,v,b,x,S,w=(n={r:0,g:0,b:0},a=1,i=null,o=null,s=null,l=!1,u=!1,"string"==typeof(r=e)&&(r=function(e){e=e.replace(cV,"").replace(cz,"").toLowerCase();var t,r=!1;if(c8[e])e=c8[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=di.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=di.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=di.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=di.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=di.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=di.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=di.hex8.exec(e))?{r:dt(t[1]),g:dt(t[2]),b:dt(t[3]),a:dt(t[4])/255,format:r?"name":"hex8"}:(t=di.hex6.exec(e))?{r:dt(t[1]),g:dt(t[2]),b:dt(t[3]),format:r?"name":"hex"}:(t=di.hex4.exec(e))?{r:dt(t[1]+""+t[1]),g:dt(t[2]+""+t[2]),b:dt(t[3]+""+t[3]),a:dt(t[4]+""+t[4])/255,format:r?"name":"hex8"}:!!(t=di.hex3.exec(e))&&{r:dt(t[1]+""+t[1]),g:dt(t[2]+""+t[2]),b:dt(t[3]+""+t[3]),format:r?"name":"hex"}}(r)),"object"==cB(r)&&(ds(r.r)&&ds(r.g)&&ds(r.b)?(c=r.r,d=r.g,f=r.b,n={r:255*c7(c,255),g:255*c7(d,255),b:255*c7(f,255)},l=!0,u="%"===String(r.r).substr(-1)?"prgb":"rgb"):ds(r.h)&&ds(r.s)&&ds(r.v)?(i=dn(r.s),o=dn(r.v),p=r.h,h=i,g=o,p=6*c7(p,360),h=c7(h,100),g=c7(g,100),m=Math.floor(p),y=p-m,v=g*(1-h),b=g*(1-y*h),x=g*(1-(1-y)*h),n={r:255*[g,b,v,v,x,g][S=m%6],g:255*[x,g,g,b,v,v][S],b:255*[v,v,x,g,g,b][S]},l=!0,u="hsv"):ds(r.h)&&ds(r.s)&&ds(r.l)&&(i=dn(r.s),s=dn(r.l),n=function(e,t,r){var n,a,i;function o(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=c7(e,360),t=c7(t,100),r=c7(r,100),0===t)n=a=i=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),a=o(l,s,e),i=o(l,s,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(r.h,i,s),l=!0,u="hsl"),r.hasOwnProperty("a")&&(a=r.a)),a=c9(a),{ok:l,format:r.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:a});this._originalInput=e,this._r=w.r,this._g=w.g,this._b=w.b,this._a=w.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||w.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=w.ok}function cW(e,t,r){e=c7(e,255);var n,a,i=Math.max(e,t=c7(t,255),r=c7(r,255)),o=Math.min(e,t,r),s=(i+o)/2;if(i==o)n=a=0;else{var l=i-o;switch(a=s>.5?l/(2-i-o):l/(i+o),i){case e:n=(t-r)/l+6*(t<r);break;case t:n=(r-e)/l+2;break;case r:n=(e-t)/l+4}n/=6}return{h:n,s:a,l:s}}function c$(e,t,r){e=c7(e,255);var n,a=Math.max(e,t=c7(t,255),r=c7(r,255)),i=Math.min(e,t,r),o=a-i;if(a==i)n=0;else{switch(a){case e:n=(t-r)/o+6*(t<r);break;case t:n=(r-e)/o+2;break;case r:n=(e-t)/o+4}n/=6}return{h:n,s:0===a?0:o/a,v:a}}function cY(e,t,r,n){var a=[dr(Math.round(e).toString(16)),dr(Math.round(t).toString(16)),dr(Math.round(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function cG(e,t,r,n){return[dr(da(n)),dr(Math.round(e).toString(16)),dr(Math.round(t).toString(16)),dr(Math.round(r).toString(16))].join("")}function cq(e,t){t=0===t?0:t||10;var r=cH(e).toHsl();return r.s-=t/100,r.s=de(r.s),cH(r)}function cX(e,t){t=0===t?0:t||10;var r=cH(e).toHsl();return r.s+=t/100,r.s=de(r.s),cH(r)}function cK(e){return cH(e).desaturate(100)}function cJ(e,t){t=0===t?0:t||10;var r=cH(e).toHsl();return r.l+=t/100,r.l=de(r.l),cH(r)}function cZ(e,t){t=0===t?0:t||10;var r=cH(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),cH(r)}function cQ(e,t){t=0===t?0:t||10;var r=cH(e).toHsl();return r.l-=t/100,r.l=de(r.l),cH(r)}function c0(e,t){var r=cH(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,cH(r)}function c1(e){var t=cH(e).toHsl();return t.h=(t.h+180)%360,cH(t)}function c2(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var r=cH(e).toHsl(),n=[cH(e)],a=360/t,i=1;i<t;i++)n.push(cH({h:(r.h+i*a)%360,s:r.s,l:r.l}));return n}function c3(e){var t=cH(e).toHsl(),r=t.h;return[cH(e),cH({h:(r+72)%360,s:t.s,l:t.l}),cH({h:(r+216)%360,s:t.s,l:t.l})]}function c4(e,t,r){t=t||6,r=r||30;var n=cH(e).toHsl(),a=360/r,i=[cH(e)];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(cH(n));return i}function c5(e,t){t=t||6;for(var r=cH(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/t;t--;)o.push(cH({h:n,s:a,v:i})),i=(i+s)%1;return o}cH.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((r=n.b/255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=c9(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=c$(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=c$(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=cW(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=cW(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return cY(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,r,n,a,i,o;return t=this._r,r=this._g,n=this._b,a=this._a,i=e,o=[dr(Math.round(t).toString(16)),dr(Math.round(r).toString(16)),dr(Math.round(n).toString(16)),dr(da(a))],i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*c7(this._r,255))+"%",g:Math.round(100*c7(this._g,255))+"%",b:Math.round(100*c7(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*c7(this._r,255))+"%, "+Math.round(100*c7(this._g,255))+"%, "+Math.round(100*c7(this._b,255))+"%)":"rgba("+Math.round(100*c7(this._r,255))+"%, "+Math.round(100*c7(this._g,255))+"%, "+Math.round(100*c7(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(c6[cY(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+cG(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=cH(e);r="#"+cG(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return!t&&n&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return cH(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(cJ,arguments)},brighten:function(){return this._applyModification(cZ,arguments)},darken:function(){return this._applyModification(cQ,arguments)},desaturate:function(){return this._applyModification(cq,arguments)},saturate:function(){return this._applyModification(cX,arguments)},greyscale:function(){return this._applyModification(cK,arguments)},spin:function(){return this._applyModification(c0,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(c4,arguments)},complement:function(){return this._applyCombination(c1,arguments)},monochromatic:function(){return this._applyCombination(c5,arguments)},splitcomplement:function(){return this._applyCombination(c3,arguments)},triad:function(){return this._applyCombination(c2,[3])},tetrad:function(){return this._applyCombination(c2,[4])}},cH.fromRatio=function(e,t){if("object"==cB(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&("a"===n?r[n]=e[n]:r[n]=dn(e[n]));e=r}return cH(e,t)},cH.equals=function(e,t){return!!e&&!!t&&cH(e).toRgbString()==cH(t).toRgbString()},cH.random=function(){return cH.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},cH.mix=function(e,t,r){r=0===r?0:r||50;var n=cH(e).toRgb(),a=cH(t).toRgb(),i=r/100;return cH({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},cH.readability=function(e,t){var r=cH(e),n=cH(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},cH.isReadable=function(e,t,r){var n,a,i,o,s,l=cH.readability(e,t);switch(s=!1,(a=((n=(n=r)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),i=(n.size||"small").toLowerCase(),"AA"!==a&&"AAA"!==a&&(a="AA"),"small"!==i&&"large"!==i&&(i="small"),o={level:a,size:i}).level+o.size){case"AAsmall":case"AAAlarge":s=l>=4.5;break;case"AAlarge":s=l>=3;break;case"AAAsmall":s=l>=7}return s},cH.mostReadable=function(e,t,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=cH.readability(e,t[u]))>l&&(l=n,s=cH(t[u]));return cH.isReadable(e,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,cH.mostReadable(e,["#fff","#000"],r))};var c8=cH.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},c6=cH.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(c8);function c9(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function c7(e,t){"string"==typeof(r=e)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,a="string"==typeof(n=e)&&-1!=n.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),a&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function de(e){return Math.min(1,Math.max(0,e))}function dt(e){return parseInt(e,16)}function dr(e){return 1==e.length?"0"+e:""+e}function dn(e){return e<=1&&(e=100*e+"%"),e}function da(e){return Math.round(255*parseFloat(e)).toString(16)}var di=(j="[\\s|\\(]+("+(C="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+C+")[,|\\s]+("+C+")\\s*\\)?",E="[\\s|\\(]+("+C+")[,|\\s]+("+C+")[,|\\s]+("+C+")[,|\\s]+("+C+")\\s*\\)?",{CSS_UNIT:new RegExp(C),rgb:RegExp("rgb"+j),rgba:RegExp("rgba"+E),hsl:RegExp("hsl"+j),hsla:RegExp("hsla"+E),hsv:RegExp("hsv"+j),hsva:RegExp("hsva"+E),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function ds(e){return!!di.CSS_UNIT.exec(e)}var dl=function(e){var t=0,r=0;return cF(["r","g","b","a","h","s","l","v"],function(n){e[n]&&(t+=1,isNaN(e[n])||(r+=1),("s"===n||"l"===n)&&/^\d+%$/.test(e[n])&&(r+=1))}),t===r&&e},du=function(e,t){var r=e.hex?cH(e.hex):cH(e),n=r.toHsl(),a=r.toHsv(),i=r.toRgb(),o=r.toHex();return 0===n.s&&(n.h=t||0,a.h=t||0),{hsl:n,hex:"000000"===o&&0===i.a?"transparent":"#"+o,rgb:i,hsv:a,oldHue:e.h||t||n.h,source:e.source}},dc=function(e){if("transparent"===e)return!0;var t=+("#"===String(e).charAt(0));return e.length!==4+t&&e.length<7+t&&cH(e).isValid()},dd=function(e){if(!e)return"#fff";var t=du(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},df=function(e,t){return cH(t+" ("+e.replace("°","")+")")._ok},dp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dh=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();let dg=function(e){var t=function(t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);function r(e){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.handleChange=function(e,r){if(dl(e)){var n=du(e,e.h||t.state.oldHue);t.setState(n),t.props.onChangeComplete&&t.debounce(t.props.onChangeComplete,n,r),t.props.onChange&&t.props.onChange(n,r)}},t.handleSwatchHover=function(e,r){if(dl(e)){var n=du(e,e.h||t.state.oldHue);t.props.onSwatchHover&&t.props.onSwatchHover(n,r)}},t.state=dp({},du(e.color,0)),t.debounce=cC(function(e,t,r){e(t,r)},100),t}return r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t),dh(r,[{key:"render",value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),to.createElement(e,dp({},this.props,this.state,{onChange:this.handleChange},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return dp({},du(e.color,t.oldHue))}}]),r}(to.PureComponent||to.Component);return t.propTypes=dp({},e.propTypes),t.defaultProps=dp({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t};var dm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dy=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function dv(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var db=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};let dx=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span",r=to.Component;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function, not "+typeof r);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");for(var e,t,r,a=arguments.length,i=Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=r=dv(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),r.state={focus:!1},r.handleFocus=function(){return r.setState({focus:!0})},r.handleBlur=function(){return r.setState({focus:!1})},dv(r,t)}return n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r),dy(n,[{key:"render",value:function(){return to.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},to.createElement(e,dm({},this.props,this.state)))}}]),n}(function(e){var t=e.color,r=e.style,n=e.onClick,a=void 0===n?function(){}:n,i=e.onHover,o=e.title,s=void 0===o?t:o,l=e.children,u=e.focus,c=e.focusStyle,d="transparent"===t,f=(0,ly.Ay)({default:{swatch:db({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},r,u?void 0===c?{}:c:{})}}),p={};return i&&(p.onMouseOver=function(e){return i(t,e)}),to.createElement("div",db({style:f.swatch,onClick:function(e){return a(t,e)},title:s,tabIndex:0,onKeyDown:function(e){return 13===e.keyCode&&a(t,e)}},p),l,d&&to.createElement(l_,{borderRadius:f.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))});var dS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dw=function(e){var t=e.rgb,r=e.hsl,n=e.width,a=e.height,i=e.onChange,o=e.direction,s=e.style,l=e.renderers,u=e.pointer,c=e.className,d=(0,ly.Ay)({default:{picker:{position:"relative",width:n,height:a},alpha:{radius:"2px",style:s}}});return to.createElement("div",{style:d.picker,className:"alpha-picker "+(void 0===c?"":c)},to.createElement(lk,dS({},d.alpha,{rgb:t,hsl:r,pointer:u,renderers:l,onChange:i,direction:o})))};dw.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:function(e){var t=e.direction,r=(0,ly.Ay)({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===t});return to.createElement("div",{style:r.picker})}},dg(dw);let d_=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a};function dI(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new uc;++t<r;)this.add(e[t])}dI.prototype.add=dI.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},dI.prototype.has=function(e){return this.__data__.has(e)};let dD=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1},dO=function(e,t,r,n,a,i){var o=1&r,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&r?new dI:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var h=e[d],g=t[d];if(n)var m=o?n(g,h,d,t,e,i):n(h,g,d,e,t,i);if(void 0!==m){if(m)continue;f=!1;break}if(p){if(!dD(t,function(e,t){if(!p.has(t)&&(h===e||a(h,e,r,n,i)))return p.push(t)})){f=!1;break}}else if(!(h===g||a(h,g,r,n,i))){f=!1;break}}return i.delete(e),i.delete(t),f},dk=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r},dC=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r};var dj=l$?l$.prototype:void 0,dE=dj?dj.valueOf:void 0;let dM=function(e,t,r,n,a,i,o){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!i(new uS(e),new uS(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return lL(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=dk;case"[object Set]":var l=1&n;if(s||(s=dC),e.size!=t.size&&!l)break;var u=o.get(e);if(u)return u==t;n|=2,o.set(e,t);var c=dO(s(e),s(t),n,a,i,o);return o.delete(e),c;case"[object Symbol]":if(dE)return dE.call(e)==dE.call(t)}return!1},dR=function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e},dP=function(e,t,r){var n=t(e);return uU(e)?n:dR(n,r(e))},dA=function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i};var dT=Object.prototype.propertyIsEnumerable,dN=Object.getOwnPropertySymbols,dU=dN?function(e){return null==e?[]:dA(dN(e=Object(e)),function(t){return dT.call(e,t)})}:function(){return[]};let dL=function(e){return dP(e,cU,dU)};var dF=Object.prototype.hasOwnProperty;let dB=function(e,t,r,n,a,i){var o=1&r,s=dL(e),l=s.length;if(l!=dL(t).length&&!o)return!1;for(var u=l;u--;){var c=s[u];if(!(o?c in t:dF.call(t,c)))return!1}var d=i.get(e),f=i.get(t);if(d&&f)return d==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=o;++u<l;){var g=e[c=s[u]],m=t[c];if(n)var y=o?n(m,g,c,t,e,i):n(g,m,c,e,t,i);if(!(void 0===y?g===m||a(g,m,r,n,i):y)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var v=e.constructor,b=t.constructor;v!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(p=!1)}return i.delete(e),i.delete(t),p};var dV=ur(lW,"DataView"),dz=ur(lW,"Promise"),dH=ur(lW,"Set"),dW=ur(lW,"WeakMap"),d$="[object Map]",dY="[object Promise]",dG="[object Set]",dq="[object WeakMap]",dX="[object DataView]",dK=l5(dV),dJ=l5(un),dZ=l5(dz),dQ=l5(dH),d0=l5(dW),d1=lQ;(dV&&d1(new dV(new ArrayBuffer(1)))!=dX||un&&d1(new un)!=d$||dz&&d1(dz.resolve())!=dY||dH&&d1(new dH)!=dG||dW&&d1(new dW)!=dq)&&(d1=function(e){var t=lQ(e),r="[object Object]"==t?e.constructor:void 0,n=r?l5(r):"";if(n)switch(n){case dK:return dX;case dJ:return d$;case dZ:return dY;case dQ:return dG;case d0:return dq}return t});let d2=d1;var d3="[object Arguments]",d4="[object Array]",d5="[object Object]",d8=Object.prototype.hasOwnProperty;let d6=function(e,t,r,n,a,i){var o=uU(e),s=uU(t),l=o?d4:d2(e),u=s?d4:d2(t);l=l==d3?d5:l,u=u==d3?d5:u;var c=l==d5,d=u==d5,f=l==u;if(f&&uH(e)){if(!uH(t))return!1;o=!0,c=!1}if(f&&!c)return i||(i=new ud),o||u1(e)?dO(e,t,r,n,a,i):dM(e,t,l,r,n,a,i);if(!(1&r)){var p=c&&d8.call(e,"__wrapped__"),h=d&&d8.call(t,"__wrapped__");if(p||h){var g=p?e.value():e,m=h?t.value():t;return i||(i=new ud),a(g,m,r,n,i)}}return!!f&&(i||(i=new ud),dB(e,t,r,n,a,i))},d9=function e(t,r,n,a,i){return t===r||(null!=t&&null!=r&&(uM(t)||uM(r))?d6(t,r,n,a,e,i):t!=t&&r!=r)},d7=function(e,t,r,n){var a=r.length,i=a,o=!n;if(null==e)return!i;for(e=Object(e);a--;){var s=r[a];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++a<i;){var l=(s=r[a])[0],u=e[l],c=s[1];if(o&&s[2]){if(void 0===u&&!(l in e))return!1}else{var d=new ud;if(n)var f=n(u,c,l,e,t,d);if(!(void 0===f?d9(c,u,3,n,d):f))return!1}}return!0},fe=function(e){return e==e&&!l0(e)},ft=function(e){for(var t=cU(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,fe(a)]}return t},fr=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}},fn=function(e){var t=ft(e);return 1==t.length&&t[0][2]?fr(t[0][0],t[0][1]):function(r){return r===e||d7(r,e,t)}};var fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/;let fo=function(e,t){if(uU(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||cb(e))||fi.test(e)||!fa.test(e)||null!=t&&e in Object(t)};function fs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(fs.Cache||uc),r}fs.Cache=uc;var fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fu=/\\(\\)?/g,fc=(R=(M=fs(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(fl,function(e,r,n,a){t.push(n?a.replace(fu,"$1"):r||e)}),t},function(e){return 500===R.size&&R.clear(),e})).cache,M),fd=1/0,ff=l$?l$.prototype:void 0,fp=ff?ff.toString:void 0;let fh=function e(t){if("string"==typeof t)return t;if(uU(t))return d_(t,e)+"";if(cb(t))return fp?fp.call(t):"";var r=t+"";return"0"==r&&1/t==-fd?"-0":r},fg=function(e,t){return uU(e)?e:fo(e,t)?[e]:fc(null==e?"":fh(e))};var fm=1/0;let fy=function(e){if("string"==typeof e||cb(e))return e;var t=e+"";return"0"==t&&1/e==-fm?"-0":t},fv=function(e,t){t=fg(t,e);for(var r=0,n=t.length;null!=e&&r<n;)e=e[fy(t[r++])];return r&&r==n?e:void 0},fb=function(e,t,r){var n=null==e?void 0:fv(e,t);return void 0===n?r:n},fx=function(e,t){return null!=e&&t in Object(e)},fS=function(e,t,r){t=fg(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=fy(t[n]);if(!(i=null!=e&&r(e,o)))break;e=e[o]}return i||++n!=a?i:!!(a=null==e?0:e.length)&&uL(a)&&u9(o,a)&&(uU(e)||uN(e))},fw=function(e){var t;return fo(e)?(t=fy(e),function(e){return null==e?void 0:e[t]}):function(t){return fv(t,e)}},f_=function(e){if("function"==typeof e)return e;if(null==e)return cs;if("object"==typeof e){var t,r;return uU(e)?(t=e[0],r=e[1],fo(t)&&fe(r)?fr(fy(t),r):function(e){var n=fb(e,t);return void 0===n&&n===r?null!=e&&fS(e,t,fx):d9(r,n,3)}):fn(e)}return fw(e)},fI=function(e,t){var r=-1,n=uF(e)?Array(e.length):[];return cL(e,function(e,a,i){n[++r]=t(e,a,i)}),n},fD=function(e,t){return(uU(e)?d_:fI)(e,f_(t))},fO=function(e){var t=e.colors,r=e.onClick,n=e.onSwatchHover,a=(0,ly.Ay)({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return to.createElement("div",{style:a.swatches},fD(t,function(e){return to.createElement(dx,{key:e,color:e,style:a.swatch,onClick:r,onHover:n,focusStyle:{boxShadow:"0 0 4px "+e}})}),to.createElement("div",{style:a.clear}))};var fk=function(e){var t=e.onChange,r=e.onSwatchHover,n=e.hex,a=e.colors,i=e.width,o=e.triangle,s=e.styles,l=e.className,u="transparent"===n,c=function(e,r){dc(e)&&t({hex:e,source:"hex"},r)},d=(0,ly.Ay)(cp({default:{card:{width:i,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:n,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:dd(n),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+n+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},void 0===s?{}:s),{"hide-triangle":"hide"===o});return to.createElement("div",{style:d.card,className:"block-picker "+(void 0===l?"":l)},to.createElement("div",{style:d.triangle}),to.createElement("div",{style:d.head},u&&to.createElement(l_,{borderRadius:"6px 6px 0 0"}),to.createElement("div",{style:d.label},n)),to.createElement("div",{style:d.body},to.createElement(fO,{colors:a,onClick:c,onSwatchHover:r}),to.createElement(lM,{style:{input:d.input},value:n,onChange:c})))};fk.propTypes={width:lU().oneOfType([lU().string,lU().number]),colors:lU().arrayOf(lU().string),triangle:lU().oneOf(["top","hide"]),styles:lU().object},fk.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}},dg(fk);var fC={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},fj={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},fE={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},fM={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},fR={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},fP={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},fA={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},fT={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},fN={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},fU={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},fL={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},fF={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},fB={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},fV={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},fz={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},fH={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},fW={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},f$={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},fY=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.hover,i=e.active,o=e.circleSize,s=e.circleSpacing,l=(0,ly.Ay)({default:{swatch:{width:o,height:o,marginRight:s,marginBottom:s,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(o/2+1)+"px "+t,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+t}}},{hover:a,active:i});return to.createElement("div",{style:l.swatch},to.createElement(dx,{style:l.Swatch,color:t,onClick:r,onHover:n,focusStyle:{boxShadow:l.Swatch.boxShadow+", 0 0 5px "+t}}))};fY.defaultProps={circleSize:28,circleSpacing:14};let fG=(0,ly.H8)(fY);var fq=function(e){var t=e.width,r=e.onChange,n=e.onSwatchHover,a=e.colors,i=e.hex,o=e.circleSize,s=e.styles,l=e.circleSpacing,u=e.className,c=(0,ly.Ay)(cp({default:{card:{width:t,display:"flex",flexWrap:"wrap",marginRight:-l,marginBottom:-l}}},void 0===s?{}:s)),d=function(e,t){return r({hex:e,source:"hex"},t)};return to.createElement("div",{style:c.card,className:"circle-picker "+(void 0===u?"":u)},fD(a,function(e){return to.createElement(fG,{key:e,color:e,onClick:d,onSwatchHover:n,active:i===e.toLowerCase(),circleSize:o,circleSpacing:l})}))};fq.propTypes={width:lU().oneOfType([lU().string,lU().number]),circleSize:lU().number,circleSpacing:lU().number,styles:lU().object},fq.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[fC["500"],fj["500"],fE["500"],fM["500"],fR["500"],fP["500"],fA["500"],fT["500"],fN["500"],fU["500"],fL["500"],fF["500"],fB["500"],fV["500"],fz["500"],fH["500"],fW["500"],f$["500"]],styles:{}},dg(fq);let fX=function(e){return void 0===e};var fK=I(9767),fJ=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),fZ=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.toggleViews=function(){"hex"===r.state.view?r.setState({view:"rgb"}):"rgb"===r.state.view?r.setState({view:"hsl"}):"hsl"===r.state.view&&(1===r.props.hsl.a?r.setState({view:"hex"}):r.setState({view:"rgb"}))},r.handleChange=function(e,t){e.hex?dc(e.hex)&&r.props.onChange({hex:e.hex,source:"hex"},t):e.r||e.g||e.b?r.props.onChange({r:e.r||r.props.rgb.r,g:e.g||r.props.rgb.g,b:e.b||r.props.rgb.b,source:"rgb"},t):e.a?(e.a<0?e.a=0:e.a>1&&(e.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&("string"==typeof e.s&&e.s.includes("%")&&(e.s=e.s.replace("%","")),"string"==typeof e.l&&e.l.includes("%")&&(e.l=e.l.replace("%","")),1==e.s?e.s=.01:1==e.l&&(e.l=.01),r.props.onChange({h:e.h||r.props.hsl.h,s:Number(fX(e.s)?r.props.hsl.s:e.s),l:Number(fX(e.l)?r.props.hsl.l:e.l),source:"hsl"},t))},r.showHighlight=function(e){e.currentTarget.style.background="#eee"},r.hideHighlight=function(e){e.currentTarget.style.background="transparent"},1!==e.hsl.a&&"hex"===e.view?r.state={view:"rgb"}:r.state={view:e.view},r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),fJ(t,[{key:"render",value:function(){var e=this,t=(0,ly.Ay)({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),r=void 0;return"hex"===this.state.view?r=to.createElement("div",{style:t.fields,className:"flexbox-fix"},to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?r=to.createElement("div",{style:t.fields,className:"flexbox-fix"},to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),to.createElement("div",{style:t.alpha},to.createElement(lM,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(r=to.createElement("div",{style:t.fields,className:"flexbox-fix"},to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),to.createElement("div",{style:t.field},to.createElement(lM,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),to.createElement("div",{style:t.alpha},to.createElement(lM,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),to.createElement("div",{style:t.wrap,className:"flexbox-fix"},r,to.createElement("div",{style:t.toggle},to.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},to.createElement(fK.A,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return 1!==e.hsl.a&&"hex"===t.view?{view:"rgb"}:null}}]),t}(to.Component);fZ.defaultProps={view:"hex"};let fQ=function(){var e=(0,ly.Ay)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return to.createElement("div",{style:e.picker})},f0=function(){var e=(0,ly.Ay)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return to.createElement("div",{style:e.picker})};var f1=function(e){var t=e.width,r=e.onChange,n=e.disableAlpha,a=e.rgb,i=e.hsl,o=e.hsv,s=e.hex,l=e.renderers,u=e.styles,c=e.className,d=e.defaultView,f=(0,ly.Ay)(cp({default:{picker:{width:t,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+a.r+", "+a.g+", "+a.b+", "+a.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},void 0===u?{}:u),{disableAlpha:n});return to.createElement("div",{style:f.picker,className:"chrome-picker "+(void 0===c?"":c)},to.createElement("div",{style:f.saturation},to.createElement(cR,{style:f.Saturation,hsl:i,hsv:o,pointer:f0,onChange:r})),to.createElement("div",{style:f.body},to.createElement("div",{style:f.controls,className:"flexbox-fix"},to.createElement("div",{style:f.color},to.createElement("div",{style:f.swatch},to.createElement("div",{style:f.active}),to.createElement(l_,{renderers:l}))),to.createElement("div",{style:f.toggles},to.createElement("div",{style:f.hue},to.createElement(lT,{style:f.Hue,hsl:i,pointer:fQ,onChange:r})),to.createElement("div",{style:f.alpha},to.createElement(lk,{style:f.Alpha,rgb:a,hsl:i,pointer:fQ,renderers:l,onChange:r})))),to.createElement(fZ,{rgb:a,hsl:i,hex:s,view:d,onChange:r,disableAlpha:n})))};f1.propTypes={width:lU().oneOfType([lU().string,lU().number]),disableAlpha:lU().bool,styles:lU().object,defaultView:lU().oneOf(["hex","rgb","hsl"])},f1.defaultProps={width:225,disableAlpha:!1,styles:{}};let f2=dg(f1),f3=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.active,i=(0,ly.Ay)({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:dd(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return to.createElement(dx,{style:i.color,color:t,onClick:void 0===r?function(){}:r,onHover:n,focusStyle:{boxShadow:"0 0 4px "+t}},to.createElement("div",{style:i.dot}))},f4=function(e){var t=e.hex,r=e.rgb,n=e.onChange,a=(0,ly.Ay)({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),i=function(e,t){e.r||e.g||e.b?n({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,source:"rgb"},t):n({hex:e.hex,source:"hex"},t)};return to.createElement("div",{style:a.fields,className:"flexbox-fix"},to.createElement("div",{style:a.active}),to.createElement(lM,{style:{wrap:a.HEXwrap,input:a.HEXinput,label:a.HEXlabel},label:"hex",value:t,onChange:i}),to.createElement(lM,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"r",value:r.r,onChange:i}),to.createElement(lM,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"g",value:r.g,onChange:i}),to.createElement(lM,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"b",value:r.b,onChange:i}))};var f5=function(e){var t=e.onChange,r=e.onSwatchHover,n=e.colors,a=e.hex,i=e.rgb,o=e.styles,s=void 0===o?{}:o,l=e.className,u=(0,ly.Ay)(cp({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},s)),c=function(e,r){e.hex?dc(e.hex)&&t({hex:e.hex,source:"hex"},r):t(e,r)};return to.createElement(ch,{style:u.Compact,styles:s},to.createElement("div",{style:u.compact,className:"compact-picker "+(void 0===l?"":l)},to.createElement("div",null,fD(n,function(e){return to.createElement(f3,{key:e,color:e,active:e.toLowerCase()===a,onClick:c,onSwatchHover:r})}),to.createElement("div",{style:u.clear})),to.createElement(f4,{hex:a,rgb:i,onChange:c})))};f5.propTypes={colors:lU().arrayOf(lU().string),styles:lU().object},f5.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}},dg(f5);let f8=(0,ly.H8)(function(e){var t=e.hover,r=e.color,n=e.onClick,a=e.onSwatchHover,i={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},o=(0,ly.Ay)({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:i}},{hover:t});return to.createElement("div",{style:o.swatch},to.createElement(dx,{color:r,onClick:n,onHover:a,focusStyle:i}))});var f6=function(e){var t=e.width,r=e.colors,n=e.onChange,a=e.onSwatchHover,i=e.triangle,o=e.styles,s=e.className,l=(0,ly.Ay)(cp({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},void 0===o?{}:o),{"hide-triangle":"hide"===i,"top-left-triangle":"top-left"===i,"top-right-triangle":"top-right"===i,"bottom-left-triangle":"bottom-left"===i,"bottom-right-triangle":"bottom-right"===i}),u=function(e,t){return n({hex:e,source:"hex"},t)};return to.createElement("div",{style:l.card,className:"github-picker "+(void 0===s?"":s)},to.createElement("div",{style:l.triangleShadow}),to.createElement("div",{style:l.triangle}),fD(r,function(e){return to.createElement(f8,{color:e,key:e,onClick:u,onSwatchHover:a})}))};f6.propTypes={width:lU().oneOfType([lU().string,lU().number]),colors:lU().arrayOf(lU().string),triangle:lU().oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:lU().object},f6.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}},dg(f6);var f9=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f7=function(e){var t=e.width,r=e.height,n=e.onChange,a=e.hsl,i=e.direction,o=e.pointer,s=e.styles,l=e.className,u=(0,ly.Ay)(cp({default:{picker:{position:"relative",width:t,height:r},hue:{radius:"2px"}}},void 0===s?{}:s));return to.createElement("div",{style:u.picker,className:"hue-picker "+(void 0===l?"":l)},to.createElement(lT,f9({},u.hue,{hsl:a,pointer:o,onChange:function(e){return n({a:1,h:e.h,l:.5,s:1})},direction:i})))};f7.propTypes={styles:lU().object},f7.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:function(e){var t=e.direction,r=(0,ly.Ay)({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:"vertical"===t});return to.createElement("div",{style:r.picker})},styles:{}},dg(f7),dg(function(e){var t=e.onChange,r=e.hex,n=e.rgb,a=e.styles,i=void 0===a?{}:a,o=e.className,s=(0,ly.Ay)(cp({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+r,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},i)),l=function(e,r){e.hex?dc(e.hex)&&t({hex:e.hex,source:"hex"},r):(e.r||e.g||e.b)&&t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:"rgb"},r)};return to.createElement(ch,{styles:i},to.createElement("div",{style:s.material,className:"material-picker "+(void 0===o?"":o)},to.createElement(lM,{style:{wrap:s.HEXwrap,input:s.HEXinput,label:s.HEXlabel},label:"hex",value:r,onChange:l}),to.createElement("div",{style:s.split,className:"flexbox-fix"},to.createElement("div",{style:s.third},to.createElement(lM,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"r",value:n.r,onChange:l})),to.createElement("div",{style:s.third},to.createElement(lM,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"g",value:n.g,onChange:l})),to.createElement("div",{style:s.third},to.createElement(lM,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"b",value:n.b,onChange:l})))))});let pe=function(e){var t=e.onChange,r=e.rgb,n=e.hsv,a=e.hex,i=(0,ly.Ay)({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",top:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),o=function(e,a){e["#"]?dc(e["#"])&&t({hex:e["#"],source:"hex"},a):e.r||e.g||e.b?t({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,source:"rgb"},a):(e.h||e.s||e.v)&&t({h:e.h||n.h,s:e.s||n.s,v:e.v||n.v,source:"hsv"},a)};return to.createElement("div",{style:i.fields},to.createElement(lM,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"h",value:Math.round(n.h),onChange:o}),to.createElement(lM,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"s",value:Math.round(100*n.s),onChange:o}),to.createElement(lM,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"v",value:Math.round(100*n.v),onChange:o}),to.createElement("div",{style:i.divider}),to.createElement(lM,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:o}),to.createElement(lM,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:o}),to.createElement(lM,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:o}),to.createElement("div",{style:i.divider}),to.createElement(lM,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"#",value:a.replace("#",""),onChange:o}),to.createElement("div",{style:i.fieldSymbols},to.createElement("div",{style:i.symbol},"°"),to.createElement("div",{style:i.symbol},"%"),to.createElement("div",{style:i.symbol},"%")))},pt=function(e){var t=e.hsl,r=(0,ly.Ay)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":t.l>.5});return to.createElement("div",{style:r.picker})},pr=function(){var e=(0,ly.Ay)({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return to.createElement("div",{style:e.pointer},to.createElement("div",{style:e.left},to.createElement("div",{style:e.leftInside})),to.createElement("div",{style:e.right},to.createElement("div",{style:e.rightInside})))},pn=function(e){var t=e.onClick,r=e.label,n=e.children,a=e.active,i=(0,ly.Ay)({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:a});return to.createElement("div",{style:i.button,onClick:t},r||n)},pa=function(e){var t=e.rgb,r=e.currentColor,n=(0,ly.Ay)({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return to.createElement("div",null,to.createElement("div",{style:n.label},"new"),to.createElement("div",{style:n.swatches},to.createElement("div",{style:n.new}),to.createElement("div",{style:n.current})),to.createElement("div",{style:n.label},"current"))};var pi=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),po=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function, not "+typeof e);function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.state={currentColor:e.hex},r}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),pi(t,[{key:"render",value:function(){var e=this.props,t=e.styles,r=e.className,n=(0,ly.Ay)(cp({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},void 0===t?{}:t));return to.createElement("div",{style:n.picker,className:"photoshop-picker "+(void 0===r?"":r)},to.createElement("div",{style:n.head},this.props.header),to.createElement("div",{style:n.body,className:"flexbox-fix"},to.createElement("div",{style:n.saturation},to.createElement(cR,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:pt,onChange:this.props.onChange})),to.createElement("div",{style:n.hue},to.createElement(lT,{direction:"vertical",hsl:this.props.hsl,pointer:pr,onChange:this.props.onChange})),to.createElement("div",{style:n.controls},to.createElement("div",{style:n.top,className:"flexbox-fix"},to.createElement("div",{style:n.previews},to.createElement(pa,{rgb:this.props.rgb,currentColor:this.state.currentColor})),to.createElement("div",{style:n.actions},to.createElement(pn,{label:"OK",onClick:this.props.onAccept,active:!0}),to.createElement(pn,{label:"Cancel",onClick:this.props.onCancel}),to.createElement(pe,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),t}(to.Component);po.propTypes={header:lU().string,styles:lU().object},po.defaultProps={header:"Color Picker",styles:{}},dg(po);let ps=function(e){var t=e.onChange,r=e.rgb,n=e.hsl,a=e.hex,i=e.disableAlpha,o=(0,ly.Ay)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:i}),s=function(e,a){e.hex?dc(e.hex)&&t({hex:e.hex,source:"hex"},a):e.r||e.g||e.b?t({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,a:r.a,source:"rgb"},a):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:n.h,s:n.s,l:n.l,a:e.a,source:"rgb"},a))};return to.createElement("div",{style:o.fields,className:"flexbox-fix"},to.createElement("div",{style:o.double},to.createElement(lM,{style:{input:o.input,label:o.label},label:"hex",value:a.replace("#",""),onChange:s})),to.createElement("div",{style:o.single},to.createElement(lM,{style:{input:o.input,label:o.label},label:"r",value:r.r,onChange:s,dragLabel:"true",dragMax:"255"})),to.createElement("div",{style:o.single},to.createElement(lM,{style:{input:o.input,label:o.label},label:"g",value:r.g,onChange:s,dragLabel:"true",dragMax:"255"})),to.createElement("div",{style:o.single},to.createElement(lM,{style:{input:o.input,label:o.label},label:"b",value:r.b,onChange:s,dragLabel:"true",dragMax:"255"})),to.createElement("div",{style:o.alpha},to.createElement(lM,{style:{input:o.input,label:o.label},label:"a",value:Math.round(100*r.a),onChange:s,dragLabel:"true",dragMax:"100"})))};var pl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pu=function(e){var t=e.colors,r=e.onClick,n=void 0===r?function(){}:r,a=e.onSwatchHover,i=(0,ly.Ay)({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!t||!t.length}),o=function(e,t){n({hex:e,source:"hex"},t)};return to.createElement("div",{style:i.colors,className:"flexbox-fix"},t.map(function(e){var t="string"==typeof e?{color:e}:e,r=""+t.color+(t.title||"");return to.createElement("div",{key:r,style:i.swatchWrap},to.createElement(dx,pl({},t,{style:i.swatch,onClick:o,onHover:a,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+t.color}})))}))};pu.propTypes={colors:lU().arrayOf(lU().oneOfType([lU().string,lU().shape({color:lU().string,title:lU().string})])).isRequired};var pc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pd=function(e){var t=e.width,r=e.rgb,n=e.hex,a=e.hsv,i=e.hsl,o=e.onChange,s=e.onSwatchHover,l=e.disableAlpha,u=e.presetColors,c=e.renderers,d=e.styles,f=void 0===d?{}:d,p=e.className,h=(0,ly.Ay)(cp({default:pc({picker:{width:t,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+r.r+","+r.g+","+r.b+","+r.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},f),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},f),{disableAlpha:l});return to.createElement("div",{style:h.picker,className:"sketch-picker "+(void 0===p?"":p)},to.createElement("div",{style:h.saturation},to.createElement(cR,{style:h.Saturation,hsl:i,hsv:a,onChange:o})),to.createElement("div",{style:h.controls,className:"flexbox-fix"},to.createElement("div",{style:h.sliders},to.createElement("div",{style:h.hue},to.createElement(lT,{style:h.Hue,hsl:i,onChange:o})),to.createElement("div",{style:h.alpha},to.createElement(lk,{style:h.Alpha,rgb:r,hsl:i,renderers:c,onChange:o}))),to.createElement("div",{style:h.color},to.createElement(l_,null),to.createElement("div",{style:h.activeColor}))),to.createElement(ps,{rgb:r,hsl:i,hex:n,onChange:o,disableAlpha:l}),to.createElement(pu,{colors:u,onClick:o,onSwatchHover:s}))};pd.propTypes={disableAlpha:lU().bool,width:lU().oneOfType([lU().string,lU().number]),styles:lU().object},pd.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]},dg(pd);let pf=function(e){var t=e.hsl,r=e.offset,n=e.onClick,a=void 0===n?function(){}:n,i=e.active,o=e.first,s=e.last,l=(0,ly.Ay)({default:{swatch:{height:"12px",background:"hsl("+t.h+", 50%, "+100*r+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:i,first:o,last:s});return to.createElement("div",{style:l.swatch,onClick:function(e){return a({h:t.h,s:.5,l:r,source:"hsl"},e)}})},pp=function(e){var t=e.onClick,r=e.hsl,n=(0,ly.Ay)({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}});return to.createElement("div",{style:n.swatches},to.createElement("div",{style:n.swatch},to.createElement(pf,{hsl:r,offset:".80",active:.1>Math.abs(r.l-.8)&&.1>Math.abs(r.s-.5),onClick:t,first:!0})),to.createElement("div",{style:n.swatch},to.createElement(pf,{hsl:r,offset:".65",active:.1>Math.abs(r.l-.65)&&.1>Math.abs(r.s-.5),onClick:t})),to.createElement("div",{style:n.swatch},to.createElement(pf,{hsl:r,offset:".50",active:.1>Math.abs(r.l-.5)&&.1>Math.abs(r.s-.5),onClick:t})),to.createElement("div",{style:n.swatch},to.createElement(pf,{hsl:r,offset:".35",active:.1>Math.abs(r.l-.35)&&.1>Math.abs(r.s-.5),onClick:t})),to.createElement("div",{style:n.swatch},to.createElement(pf,{hsl:r,offset:".20",active:.1>Math.abs(r.l-.2)&&.1>Math.abs(r.s-.5),onClick:t,last:!0})),to.createElement("div",{style:n.clear}))};var ph=function(e){var t=e.hsl,r=e.onChange,n=e.pointer,a=e.styles,i=e.className,o=(0,ly.Ay)(cp({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},void 0===a?{}:a));return to.createElement("div",{style:o.wrap||{},className:"slider-picker "+(void 0===i?"":i)},to.createElement("div",{style:o.hue},to.createElement(lT,{style:o.Hue,hsl:t,pointer:n,onChange:r})),to.createElement("div",{style:o.swatches},to.createElement(pp,{hsl:t,onClick:r})))};ph.propTypes={styles:lU().object},ph.defaultProps={pointer:function(){var e=(0,ly.Ay)({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return to.createElement("div",{style:e.picker})},styles:{}},dg(ph);var pg=I(1810);let pm=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.first,i=e.last,o=e.active,s=(0,ly.Ay)({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:dd(t),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:i,active:o,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return to.createElement(dx,{color:t,style:s.color,onClick:void 0===r?function(){}:r,onHover:n,focusStyle:{boxShadow:"0 0 4px "+t}},to.createElement("div",{style:s.check},to.createElement(pg.A,null)))},py=function(e){var t=e.onClick,r=e.onSwatchHover,n=e.group,a=e.active,i=(0,ly.Ay)({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return to.createElement("div",{style:i.group},fD(n,function(e,i){return to.createElement(pm,{key:e,color:e,active:e.toLowerCase()===a,first:0===i,last:i===n.length-1,onClick:t,onSwatchHover:r})}))};var pv=function(e){var t=e.width,r=e.height,n=e.onChange,a=e.onSwatchHover,i=e.colors,o=e.hex,s=e.styles,l=e.className,u=(0,ly.Ay)(cp({default:{picker:{width:t,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},void 0===s?{}:s)),c=function(e,t){return n({hex:e,source:"hex"},t)};return to.createElement("div",{style:u.picker,className:"swatches-picker "+(void 0===l?"":l)},to.createElement(ch,null,to.createElement("div",{style:u.overflow},to.createElement("div",{style:u.body},fD(i,function(e){return to.createElement(py,{key:e.toString(),group:e,active:o,onClick:c,onSwatchHover:a})}),to.createElement("div",{style:u.clear})))))};pv.propTypes={width:lU().oneOfType([lU().string,lU().number]),height:lU().oneOfType([lU().string,lU().number]),colors:lU().arrayOf(lU().arrayOf(lU().string)),styles:lU().object},pv.defaultProps={width:320,height:240,colors:[[fC["900"],fC["700"],fC["500"],fC["300"],fC["100"]],[fj["900"],fj["700"],fj["500"],fj["300"],fj["100"]],[fE["900"],fE["700"],fE["500"],fE["300"],fE["100"]],[fM["900"],fM["700"],fM["500"],fM["300"],fM["100"]],[fR["900"],fR["700"],fR["500"],fR["300"],fR["100"]],[fP["900"],fP["700"],fP["500"],fP["300"],fP["100"]],[fA["900"],fA["700"],fA["500"],fA["300"],fA["100"]],[fT["900"],fT["700"],fT["500"],fT["300"],fT["100"]],[fN["900"],fN["700"],fN["500"],fN["300"],fN["100"]],["#194D33",fU["700"],fU["500"],fU["300"],fU["100"]],[fL["900"],fL["700"],fL["500"],fL["300"],fL["100"]],[fF["900"],fF["700"],fF["500"],fF["300"],fF["100"]],[fB["900"],fB["700"],fB["500"],fB["300"],fB["100"]],[fV["900"],fV["700"],fV["500"],fV["300"],fV["100"]],[fz["900"],fz["700"],fz["500"],fz["300"],fz["100"]],[fH["900"],fH["700"],fH["500"],fH["300"],fH["100"]],[fW["900"],fW["700"],fW["500"],fW["300"],fW["100"]],[f$["900"],f$["700"],f$["500"],f$["300"],f$["100"]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}},dg(pv);var pb=function(e){var t=e.onChange,r=e.onSwatchHover,n=e.hex,a=e.colors,i=e.width,o=e.triangle,s=e.styles,l=e.className,u=(0,ly.Ay)(cp({default:{card:{width:i,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},void 0===s?{}:s),{"hide-triangle":"hide"===o,"top-left-triangle":"top-left"===o,"top-right-triangle":"top-right"===o}),c=function(e,r){dc(e)&&t({hex:e,source:"hex"},r)};return to.createElement("div",{style:u.card,className:"twitter-picker "+(void 0===l?"":l)},to.createElement("div",{style:u.triangleShadow}),to.createElement("div",{style:u.triangle}),to.createElement("div",{style:u.body},fD(a,function(e,t){return to.createElement(dx,{key:t,color:e,hex:e,style:u.swatch,onClick:c,onHover:r,focusStyle:{boxShadow:"0 0 4px "+e}})}),to.createElement("div",{style:u.hash},"#"),to.createElement(lM,{label:null,style:{input:u.input},value:n.replace("#",""),onChange:c}),to.createElement("div",{style:u.clear})))};pb.propTypes={width:lU().oneOfType([lU().string,lU().number]),triangle:lU().oneOf(["hide","top-left","top-right"]),colors:lU().arrayOf(lU().string),styles:lU().object},pb.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}},dg(pb);var px=function(e){var t=(0,ly.Ay)({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(100*e.hsl.s)+"%, "+Math.round(100*e.hsl.l)+"%)"}}});return to.createElement("div",{style:t.picker})};px.propTypes={hsl:lU().shape({h:lU().number,s:lU().number,l:lU().number,a:lU().number})},px.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var pS=function(e){var t=(0,ly.Ay)({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return to.createElement("div",{style:t.picker})};pS.propTypes={hsl:lU().shape({h:lU().number,s:lU().number,l:lU().number,a:lU().number})},pS.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};let pw=function(e){var t=e.onChange,r=e.rgb,n=e.hsl,a=e.hex,i=e.hsv,o=function(e,r){if(e.hex)dc(e.hex)&&t({hex:e.hex,source:"hex"},r);else if(e.rgb){var n=e.rgb.split(",");df(e.rgb,"rgb")&&t({r:n[0],g:n[1],b:n[2],a:1,source:"rgb"},r)}else if(e.hsv){var a=e.hsv.split(",");df(e.hsv,"hsv")&&(a[2]=a[2].replace("%",""),a[1]=a[1].replace("%",""),a[0]=a[0].replace("°",""),1==a[1]?a[1]=.01:1==a[2]&&(a[2]=.01),t({h:Number(a[0]),s:Number(a[1]),v:Number(a[2]),source:"hsv"},r))}else if(e.hsl){var i=e.hsl.split(",");df(e.hsl,"hsl")&&(i[2]=i[2].replace("%",""),i[1]=i[1].replace("%",""),i[0]=i[0].replace("°",""),1==c[1]?c[1]=.01:1==c[2]&&(c[2]=.01),t({h:Number(i[0]),s:Number(i[1]),v:Number(i[2]),source:"hsl"},r))}},s=(0,ly.Ay)({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),l=r.r+", "+r.g+", "+r.b,u=Math.round(n.h)+"°, "+Math.round(100*n.s)+"%, "+Math.round(100*n.l)+"%",c=Math.round(i.h)+"°, "+Math.round(100*i.s)+"%, "+Math.round(100*i.v)+"%";return to.createElement("div",{style:s.wrap,className:"flexbox-fix"},to.createElement("div",{style:s.fields},to.createElement("div",{style:s.double},to.createElement(lM,{style:{input:s.input,label:s.label},label:"hex",value:a,onChange:o})),to.createElement("div",{style:s.column},to.createElement("div",{style:s.single},to.createElement(lM,{style:{input:s.input2,label:s.label2},label:"rgb",value:l,onChange:o})),to.createElement("div",{style:s.single},to.createElement(lM,{style:{input:s.input2,label:s.label2},label:"hsv",value:c,onChange:o})),to.createElement("div",{style:s.single},to.createElement(lM,{style:{input:s.input2,label:s.label2},label:"hsl",value:u,onChange:o})))))};var p_=function(e){var t=e.width,r=e.onChange,n=e.rgb,a=e.hsl,i=e.hsv,o=e.hex,s=e.header,l=e.styles,u=e.className,c=(0,ly.Ay)(cp({default:{picker:{width:t,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+n.r+", "+n.g+", "+n.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},void 0===l?{}:l));return to.createElement("div",{style:c.picker,className:"google-picker "+(void 0===u?"":u)},to.createElement("div",{style:c.head},s),to.createElement("div",{style:c.swatch}),to.createElement("div",{style:c.saturation},to.createElement(cR,{hsl:a,hsv:i,pointer:px,onChange:r})),to.createElement("div",{style:c.body},to.createElement("div",{style:c.controls,className:"flexbox-fix"},to.createElement("div",{style:c.hue},to.createElement(lT,{style:c.Hue,hsl:a,radius:"4px",pointer:pS,onChange:r}))),to.createElement(pw,{rgb:n,hsl:a,hex:o,hsv:i,onChange:r})))};p_.propTypes={width:lU().oneOfType([lU().string,lU().number]),styles:lU().object,header:lU().string},p_.defaultProps={width:652,styles:{},header:"Color picker"},dg(p_);let pI=function(e){let t,r,n,a,i,o,s,l=(0,ti.c)(16),{value:u,hide:c,onSave:d}=e,[f,p]=(0,to.useState)(u);l[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{p(e.rgb)},l[0]=t):t=l[0];let h=t;return l[1]===Symbol.for("react.memo_cache_sentinel")?(r=[],l[1]=r):r=l[1],l[2]!==f?(n=(0,tu.jsx)(f2,{color:f,onChange:h,presetColors:r,width:300}),l[2]=f,l[3]=n):n=l[3],l[4]!==c?(a=(0,tu.jsx)(tl.FooterAction.Secondary,{dataCY:"color-picker-cancel-btn",onClick:c,children:"Cancel"}),l[4]=c,l[5]=a):a=l[5],l[6]!==f||l[7]!==c||l[8]!==d?(i=(0,tu.jsx)(tl.FooterAction.Primary,{dataCY:"color-picker-save-btn",onClick:()=>{c(),d(f)},children:"Save"}),l[6]=f,l[7]=c,l[8]=d,l[9]=i):i=l[9],l[10]!==a||l[11]!==i?(o=(0,tu.jsx)(tl.FooterAction,{children:(0,tu.jsxs)(tl.FooterAction.Right,{children:[a,i]})}),l[10]=a,l[11]=i,l[12]=o):o=l[12],l[13]!==n||l[14]!==o?(s=(0,tu.jsxs)("div",{"data-cy":"color-picker-dialog",children:[n,o]}),l[13]=n,l[14]=o,l[15]=s):s=l[15],s},pD=function({servicesManager:e},t,r){let{measurementService:n,customizationService:a,toolGroupService:i,uiDialogService:o}=e.services,{viewportId:s,StudyInstanceUID:l,SeriesInstanceUID:u,measurementId:c,toolName:d}=r;return new Promise(e=>{(async()=>{if(i.getToolGroupForViewport(s).getToolConfiguration(d).getTextCallback)e({StudyInstanceUID:l,SeriesInstanceUID:u,viewportId:s});else{let t=a.getCustomization("measurementLabels"),r=n.getMeasurement(c),i=a.getCustomization("ui.labellingComponent"),d=await lm({measurement:r,uiDialogService:o,labelConfig:t,renderContent:i});n.update(c,{...d},!0),e({StudyInstanceUID:l,SeriesInstanceUID:u,viewportId:s})}})()})};function pO(e,t){tl.Icons.addIcon(e,t)}function pk(e){let t,r,n,a,i,o,s,l,u,c,d,f,p,h=(0,ti.c)(41),{buttonSectionId:g,title:m}=e,{servicesManager:y}=(0,K.useSystem)(),{t:v}=tQ(),{toolbarService:b,customizationService:x}=y.services,[S,w]=(0,to.useState)(!1);h[0]!==g?(t={buttonSection:g},h[0]=g,h[1]=t):t=h[1];let{toolbarButtons:_,onInteraction:I}=(0,K.useToolbar)(t);h[2]!==g?(r={buttonSectionId:g},h[2]=g,h[3]=r):r=h[3];let{activeToolOptions:D}=(0,K.useActiveToolOptions)(r);if(!_.length)return null;if(!_.every(pC))throw Error("Toolbox accepts only button sections at the top level, not buttons. Create at least one button section.");h[4]!==I?(n=e=>{let{itemId:t}=e;I?.({itemId:t})},h[4]=I,h[5]=n):n=h[5];let O=n;h[6]!==g||h[7]!==x?(a=x.getCustomization(`${g}.config`),h[6]=g,h[7]=x,h[8]=a):a=h[8];let k=a;if(h[9]!==v||h[10]!==m?(i=v(m),h[9]=v,h[10]=m,h[11]=i):i=h[11],h[12]!==i?(o=(0,tu.jsx)("span",{children:i}),h[12]=i,h[13]=o):o=h[13],h[14]!==k||h[15]!==S?(s=k&&(0,tu.jsx)("div",{className:"ml-auto mr-2",children:(0,tu.jsx)(tl.Icons.Settings,{className:"text-primary h-4 w-4",onClick:e=>{e.stopPropagation(),w(!S)}})}),h[14]=k,h[15]=S,h[16]=s):s=h[16],h[17]!==o||h[18]!==s?(l=(0,tu.jsxs)(tl.PanelSection.Header,{className:"flex items-center justify-between",children:[o,s]}),h[17]=o,h[18]=s,h[19]=l):l=h[19],h[20]!==k||h[21]!==S?(u=S&&(0,tu.jsx)(k,{}),h[20]=k,h[21]=S,h[22]=u):u=h[22],h[23]!==O||h[24]!==y||h[25]!==b||h[26]!==_){let e;h[28]!==O||h[29]!==y||h[30]!==b?(e=e=>{let t=e.componentProps.buttonSection,r=b.getButtonSection(t);return(0,tu.jsx)("div",{className:"bg-muted flex flex-wrap gap-2 py-2 px-1",children:r.map(e=>{if(!e||!e.componentProps.visible)return null;let{id:t,Component:r,componentProps:n}=e;return(0,tu.jsx)("div",{children:(0,tu.jsx)(r,{...n,id:t,onInteraction:O,size:"toolbox",servicesManager:y})},t)})},t)},h[28]=O,h[29]=y,h[30]=b,h[31]=e):e=h[31],c=_.map(e),h[23]=O,h[24]=y,h[25]=b,h[26]=_,h[27]=c}else c=h[27];return h[32]!==D?(d=D&&(0,tu.jsx)("div",{className:"bg-muted mt-1 h-auto px-2",children:(0,tu.jsx)(tl.ToolSettings,{options:D})}),h[32]=D,h[33]=d):d=h[33],h[34]!==c||h[35]!==d||h[36]!==u?(f=(0,tu.jsxs)(tl.PanelSection.Content,{className:"bg-muted flex-shrink-0 border-none",children:[u,c,d]}),h[34]=c,h[35]=d,h[36]=u,h[37]=f):f=h[37],h[38]!==f||h[39]!==l?(p=(0,tu.jsxs)(tl.PanelSection,{children:[l,f]}),h[38]=f,h[39]=l,h[40]=p):p=h[40],p}function pC(e){return e.componentProps.buttonSection}let pj={id:nH,preRegistration:function({servicesManager:e,commandsManager:t,hotkeysManager:r,serviceProvidersManager:n,appConfig:a}){Array.isArray(a.customizationService)&&a.customizationService.some(e=>"string"==typeof e&&e.includes("customizationModule.theme"))&&n.registerProvider("activeTheme",tl.ActiveThemeProvider);let{toolbarService:i,cineService:o,viewportGridService:s}=e.services;i.registerEventForToolbarUpdate(o,[o.EVENTS.CINE_STATE_CHANGED]),i.registerEventForToolbarUpdate(r,[K.HotkeysManager.EVENTS.HOTKEY_PRESSED]),K.DicomMetadataStore.subscribe(K.DicomMetadataStore.EVENTS.INSTANCES_ADDED,lo),K.DicomMetadataStore.subscribe(K.DicomMetadataStore.EVENTS.SERIES_UPDATED,lo),function({servicesManager:e}){let{hangingProtocolService:t}=e.services;t.addCustomAttribute("ViewCode","View Code Designator:Value",ln),t.addCustomAttribute("Laterality","Laterality of object",la)}({servicesManager:e});let l=[],u=e=>{Object.entries(e).forEach(([e,r])=>{if([s.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED,s.EVENTS.VIEWPORTS_READY].includes(e)){let n=`${e}_${JSON.stringify(r)}`;l.includes(n)||(s.subscribe(e,e=>{let n=e?.viewportId??s.getActiveViewportId();t.run(r,{viewportId:n})}),l.push(n))}})};i.subscribe(i.EVENTS.TOOL_BAR_MODIFIED,e=>{let{buttons:t}=e;for(let[e,r]of Object.entries(t)){let{buttonSection:e,items:t,listeners:n}=r.props||{};e&&t&&t.forEach(e=>{e.listeners&&u(e.listeners)}),n&&u(n)}})},onModeExit(){ih.getState().clearViewportGridState(),lf.getState().clearUIState(),ig.getState().clearDisplaySetSelectorMap(),im.getState().clearHangingProtocolStageIndexMap(),iS.getState().clearToggleHangingProtocol(),ib.getState().clearViewportsByPosition(),function(){let{fileManager:e,dataSetCacheManager:t}=eu().wadouri;for(let r of aD){let n=r.substring(r.indexOf(":")+1),a=Number(n);Number.isInteger(a)&&a>=0&&e.remove(a);for(let e=0;e<1e5&&t.isLoaded(n);e++)t.unload(n)}aD.clear()}()},getDataSourcesModule:function(){return[{name:"dicomweb",type:"webApi",createDataSource:ez},{name:"dicomwebproxy",type:"webApi",createDataSource:e4},{name:"dicomjson",type:"jsonApi",createDataSource:eK},{name:"dicomlocal",type:"localApi",createDataSource:e3},{name:"merge",type:"mergeApi",createDataSource:ta}]},getViewportModule:()=>[{name:"chartViewport",component:s7}],getLayoutTemplateModule:function({servicesManager:e,extensionManager:t,commandsManager:r,hotkeysManager:n}){return[{name:"viewerLayout",id:"viewerLayout",component:function(a){return rX({servicesManager:e,extensionManager:t,commandsManager:r,hotkeysManager:n,...a})}}]},getPanelModule:function({commandsManager:e,extensionManager:t,servicesManager:r}){return[{name:"seriesList",iconName:"tab-studies",iconLabel:"Studies",label:nB.t("SidePanel:Studies"),component:n=>(0,tu.jsx)(no,{...n,commandsManager:e,extensionManager:t,servicesManager:r})}]},getHangingProtocolModule:function(){return[{name:iJ.id,protocol:iJ},{name:iL.id,protocol:iL},{name:iG.id,protocol:iG},{name:iK.id,protocol:iK},{name:iE.id,protocol:iE},{name:iM.id,protocol:iM}]},getSopClassHandlerModule:function(e){return ar=e,[{name:at,sopClassUids:ai,getDisplaySetsFromSeries:aa},{name:"not-supported-display-sets-handler",sopClassUids:[],getDisplaySetsFromSeries:n1},{name:n2,sopClassUids:n3,getDisplaySetsFromSeries:n4}]},getToolbarModule:function({commandsManager:e,servicesManager:t}){let{cineService:r}=t.services;return[{name:"ohif.toolButton",defaultComponent:aw},{name:"ohif.toolButtonList",defaultComponent:af},{name:"ohif.row",defaultComponent:ag},{name:"ohif.toolBoxButtonGroup",defaultComponent:ab},{name:"ohif.toolBoxButton",defaultComponent:aS},{name:"ohif.layoutSelector",defaultComponent:r=>al({...r,commandsManager:e,servicesManager:t})},{name:"ohif.progressDropdown",defaultComponent:ac},{name:"ohif.Toolbar",defaultComponent:t0},{name:"evaluate.cine",evaluate:()=>{let e=r.getState().isCineEnabled;return{className:tl.utils.getToggledClassName(e)}}}]},getCommandsModule:({servicesManager:e,commandsManager:t,extensionManager:r})=>{let{customizationService:n,measurementService:a,hangingProtocolService:i,uiNotificationService:o,viewportGridService:s,displaySetService:l,multiMonitorService:u}=e.services,c=new aj(e,t),d={addDisplaySetAsLayer:({viewportId:r,displaySetInstanceUID:n,removeFirst:a=!1})=>{if(!r){let{activeViewportId:t}=e.services.viewportGridService.getState();r=t}if(!r||!n)return void console.warn("Missing required parameters for addDisplaySetAsLayer command");let{displaySetService:i,viewportGridService:o,hangingProtocolService:s}=e.services;if(!i.getDisplaySetByUID(n))return;let l=o.getDisplaySetsUIDsForViewport(r);if(!function(e){let{viewportId:t,displaySetInstanceUID:r,servicesManager:n}=e,{displaySetService:a,viewportGridService:i}=n.services;return!(!a.getDisplaySetByUID(r)||i.getDisplaySetsUIDsForViewport(t).includes(r))}({viewportId:r,displaySetInstanceUID:n,servicesManager:e}))return;let u=s.getViewportsRequireUpdate(r,n);u.forEach(t=>{!function(e){let{viewport:t,displaySetInstanceUID:r,currentDisplaySetUIDs:n,servicesManager:a}=e,{cornerstoneViewportService:i,displaySetService:o,customizationService:s}=a.services,{viewportId:l}=t,u=[...n,r];t.displaySetInstanceUIDs=u,t.viewportOptions||(t.viewportOptions={});let c=o.getDisplaySetByUID(r);if(t.viewportOptions.orientation||(t.viewportOptions.orientation=i.getOrientation(l)),!t.viewportOptions.viewportType){let e=i.getCornerstoneViewport(l);e?.type==="orthographic"?t.viewportOptions.viewportType="volume":c.isOverlayDisplaySet&&n.every(e=>{let t=o.getDisplaySetByUID(e);return t.isOverlayDisplaySet?t.referencedDisplaySetInstanceUID===c.referencedDisplaySetInstanceUID:e===c.referencedDisplaySetInstanceUID})?t.viewportOptions.viewportType="stack":t.viewportOptions.viewportType="volume"}let d=i.getCornerstoneViewport(l),f=!!d&&(0,iy.isNextViewport)(d),p=u.map((e,r)=>{if(t.displaySetOptions?.[r])return t.displaySetOptions[r];if(0===r)return{};let n=function(e,t){var r;return"SEG"===e.Modality?{}:{colormap:{name:(r=e.Modality,(t?.getCustomization("cornerstone.modalityOverlayDefaultColorMaps")||{defaultSettings:{}}).defaultSettings[r]||{colormap:"hsv",opacity:.9}).colormap||"hsv",opacity:.9}}}(o.getDisplaySetByUID(e),s);return f&&"number"==typeof n.colormap?.opacity&&(n.colormap.opacity=iy.NEXT_OVERLAY_OPACITY),n});t.displaySetOptions=p}({viewport:t,displaySetInstanceUID:n,currentDisplaySetUIDs:l,servicesManager:e})}),t.runCommand("updateStoredPositionPresentation",{viewportId:r,displaySetInstanceUIDs:u[0].displaySetInstanceUIDs}),t.run("setDisplaySetsForViewports",{viewportsToUpdate:u})},removeDisplaySetLayer:({viewportId:r,displaySetInstanceUID:n,unhydrate:a=!1})=>{if(!r||!n)return void console.warn("Missing required parameters for removeDisplaySetLayer command");let{displaySetService:i,viewportGridService:o,hangingProtocolService:s,segmentationService:l}=e.services,u=i.getDisplaySetByUID(n);if(!u)return;iv.includes(u.Modality)&&(l.removeRepresentationsFromViewport(r,{segmentationId:n}),a&&(u.isHydrated=!1,t.runCommand("updateStoredSegmentationPresentation",{displaySet:u,hydrated:!1})));let c=o.getDisplaySetsUIDsForViewport(r);if(!c.includes(n))return;let d=s.getViewportsRequireUpdate(r,n);d.forEach(t=>{!function(e){let{viewport:t,displaySetInstanceUID:r,currentDisplaySetUIDs:n,servicesManager:a}=e,{cornerstoneViewportService:i,displaySetService:o}=a.services,{viewportId:s}=t;t.displaySetInstanceUIDs=n.filter(e=>e!==r),t.viewportOptions||(t.viewportOptions={});let l=i.getCornerstoneViewport(s)?.type==="orthographic";t.viewportOptions.viewportType=l?"volume":"stack",t.viewportOptions.orientation||(t.viewportOptions.orientation=i.getOrientation(s)),t.displaySetOptions=t.displaySetInstanceUIDs.map(()=>({}))}({viewport:t,displaySetInstanceUID:n,currentDisplaySetUIDs:c,servicesManager:e})}),t.runCommand("updateStoredPositionPresentation",{viewportId:r,displaySetInstanceUIDs:d[0].displaySetInstanceUIDs}),t.run("setDisplaySetsForViewports",{viewportsToUpdate:d})},multimonitor:async e=>{let{screenDelta:t,StudyInstanceUID:r,commands:n,hashParams:a}=e;if(u.numberOfScreens<2)return e.fallback?.(e);await u.launchWindow(r,t,a)&&n&&setTimeout(()=>{u.run(t,n,e)},1e3)},promptSaveReport:n=>{let{StudyInstanceUID:a}=n;ik({servicesManager:e,commandsManager:t,extensionManager:r},n,{data:{StudyInstanceUID:a}})},loadStudy:async e=>{let{StudyInstanceUID:t}=e;if(l.getActiveDisplaySets().find(e=>e.StudyInstanceUID===t))return;let[n]=r.getActiveDataSource();await ni(n,l,t);let a=K.DicomMetadataStore.getStudy(t);i.addStudy(a)},showContextMenu:e=>{let{menuCustomizationId:t,element:r,event:a,selectorProps:o,defaultPointsPosition:s=[]}=e,l={...e};t&&Object.assign(l,n.getCustomization(t));let{protocol:u,stage:d}=i.getActiveProtocol();l.selectorProps={event:a,protocol:u,stage:d,...o},c.showContextMenu(l,r,s)},closeContextMenu:()=>{c.closeContextMenu()},displayNotification:({text:e,title:t,type:r})=>{o.show({title:t,message:e,type:r})},clearMeasurements:e=>{a.clearMeasurements(e.measurementFilter)},setHangingProtocol:({activeStudyUID:e="",StudyInstanceUID:t="",protocolId:r,stageId:n,stageIndex:a,reset:u=!1,restoreCachedLayout:c=!0})=>{let d=e||t;try{let e=s.getState(),t=i.getState();((e,t)=>{let{activeViewportId:r}=e,{protocol:n}=t.getActiveProtocol();if(!n)return;let a=t.getState(),{protocolId:i,stageIndex:o,activeStudyUID:s}=a,{viewportGridState:l,setViewportGridState:u}=ih.getState(),{displaySetSelectorMap:c,setDisplaySetSelector:d}=ig.getState(),{hangingProtocolStageIndexMap:f,setHangingProtocolStageIndex:p}=im.getState(),h=n.stages[o],g=`${s}:${i}:${o}`,m=`${s}:${i}`,{rows:y,columns:v}=h.viewportStructure.properties,b=h.viewports.length!==e.viewports.size||e.layout.numRows!==y||e.layout.numCols!==v;return f[m]=a,g&&b&&u(g,{...e}),e.viewports.forEach((e,t)=>{let{displaySetOptions:n,displaySetInstanceUIDs:a}=e;if(!n)return;let i=[];for(let e=0;e<n.length;e++){let o=a[e];o&&(t===r&&i.push(o),n[e]?.id&&"activeDisplaySet"!==n[e].id&&d(`${s}:${n[e].id}:${n[e].matchedDisplaySetsIndex||0}`,[o]))}t===r&&d(`${s}:activeDisplaySet:0`,i)}),p(m,a)})(e,i);let{hangingProtocolStageIndexMap:o}=im.getState(),{displaySetSelectorMap:f}=ig.getState();if(r){if(void 0===a&&void 0===n){let e=`${d||t.activeStudyUID}:${r}`;a=o[e]?.stageIndex}}else r=t.protocolId,void 0===n&&void 0===a&&(a=t.stageIndex);let p=a??i.getStageIndex(r,{stageId:n,stageIndex:a}),h=i.setActiveStudyUID(d),g=`${d||i.getState().activeStudyUID}:${r}:${p||0}`,{viewportGridState:m}=ih.getState(),y=!u&&c&&m[g];if(u||h&&!m[g]&&void 0===a&&void 0===n){let e=l.getActiveDisplaySets();i.run({StudyInstanceUID:d,displaySets:e},r)}else r!==t.protocolId||p!==t.stageIndex||d?(i.setProtocol(r,{displaySetSelectorMap:f,stageId:n,stageIndex:p,restoreProtocol:y}),y&&s.set(m[g])):i.setProtocol(r,{stageId:n,stageIndex:p,displaySetSelectorMap:f});let{setDisplaySetSelector:v}=ig.getState();return v(`${d||t.activeStudyUID}:activeDisplaySet:0`,null),iw.getState().clearToggleOneUpViewportGridStore(),!0}catch(e){return console.error(e),o.show({title:"Apply Hanging Protocol",message:"The hanging protocol could not be applied.",type:"error",duration:3e3}),!1}},toggleHangingProtocol:({protocolId:e,stageIndex:t})=>{let{protocol:r,stageIndex:n,activeStudy:a}=i.getActiveProtocol(),{toggleHangingProtocol:o,setToggleHangingProtocol:s}=iS.getState(),l=`${a.StudyInstanceUID}:${e}:${0|t}`;if(r.id!==e||void 0!==t&&t!==n)return s(l,{protocolId:r.id,stageIndex:n}),d.setHangingProtocol({protocolId:e,stageIndex:t,reset:!0});{let e=o[l]||{protocolId:"default"};return d.setHangingProtocol(e)}},deltaStage:({direction:e})=>{let{protocolId:t,stageIndex:r}=i.getState(),{protocol:n}=i.getActiveProtocol();for(let a=r+e;a>=0&&a<n.stages.length;a+=e)if("disabled"!==n.stages[a].status)return d.setHangingProtocol({protocolId:t,stageIndex:a});o.show({title:"Change Stage",message:"The hanging protocol has no more applicable stages",type:"info",duration:3e3})},setViewportGridLayout:({numRows:e,numCols:r,isHangingProtocolLayout:n=!1})=>{let{protocol:a}=i.getActiveProtocol(),o=a.callbacks?.onLayoutChange;!1!==t.run(o,{numRows:e,numCols:r})&&(iw.getState().clearToggleOneUpViewportGridStore(),window.setTimeout(()=>{((e,{numRows:t,numCols:r})=>{let{viewports:n}=e,{setViewportsByPosition:a,addInitialInDisplay:i}=ib.getState(),o=[],s={};n.forEach(e=>{if(e.positionId){let t={...e,viewportOptions:{...e.viewportOptions}};s[e.positionId]=t,a(e.positionId,t)}});for(let e=0;e<t;e++)for(let t=0;t<r;t++){let r=s[`${t}-${e}`];r?.displaySetInstanceUIDs&&o.push(...r.displaySetInstanceUIDs)}o.forEach(e=>i(e))})(s.getState(),{numRows:e,numCols:r});let{viewportsByPosition:t,initialInDisplay:a}=ib.getState(),o=ix.bind(null,i,n,{...t,initialInDisplay:a});s.setLayout({numRows:e,numCols:r,findOrCreateViewport:o,isHangingProtocolLayout:n})},0))},toggleOneUp(){let e=s.getState(),{activeViewportId:r,viewports:n,layout:a,isHangingProtocolLayout:o}=e,{displaySetInstanceUIDs:l,displaySetOptions:u,viewportOptions:c}=n.get(r);if(1===a.numCols&&1===a.numRows){let{toggleOneUpViewportGridStore:e}=iw.getState();if(!e)return;let r=e.activeViewportId,n=l.length>1?[]:l.map(e=>i.getViewportsRequireUpdate(r,e,o)).flat(),a=s.getLayoutOptionsFromState(e);s.setLayout({numRows:e.layout.numRows,numCols:e.layout.numCols,activeViewportId:r,layoutOptions:a,findOrCreateViewport:(t,r)=>{let a=Array.from(e.viewports.values()).find(e=>e.positionId===r),i=n.find(e=>e.viewportId===a.viewportId);return i?{viewportOptions:c,displaySetOptions:u,...i}:a},isHangingProtocolLayout:!0}),iw.getState().clearToggleOneUpViewportGridStore(),setTimeout(()=>{t.runCommand("resetCrosshairs")},0)}else{let{setToggleOneUpViewportGridStore:t}=iw.getState();t(e),s.setLayout({numRows:1,numCols:1,findOrCreateViewport:()=>({displaySetInstanceUIDs:l,displaySetOptions:u,viewportOptions:c}),isHangingProtocolLayout:!0})}},navigateHistory(e){t1.history.navigate(e.to,e.options)},openDICOMTagViewer({displaySetInstanceUID:t}){let{activeViewportId:r,viewports:n}=s.getState(),{displaySetInstanceUIDs:a}=n.get(r),i=l.activeDisplaySets,{UIModalService:o}=e.services,u=t||a[0]||i[0]?.displaySetInstanceUID;o.show({content:ie,contentProps:{displaySets:i,displaySetInstanceUID:u},title:"DICOM Tag Browser",containerClassName:"max-w-3xl"})},toggleOverlays:()=>{let e=document.getElementsByClassName("viewport-overlay");for(let t=0;t<e.length;t++)e.item(t).classList.toggle("hidden")},scrollActiveThumbnailIntoView:()=>{let{activeViewportId:e,viewports:t}=s.getState(),r=t.get(e),n=r?.displaySetInstanceUIDs?.[0];if(!n||!document.querySelector("#ohif-thumbnail-list"))return;let a=document.querySelector(`#thumbnail-${n}`);a&&a.scrollIntoView({behavior:"smooth"})},updateViewportDisplaySet:({direction:e,excludeNonImageModalities:r})=>{let n,a=["SR","SEG","SM","RTSTRUCT","RTPLAN","RTDOSE"],u=[...l.activeDisplaySets],{activeViewportId:c,viewports:f,isHangingProtocolLayout:p}=s.getState(),{displaySetInstanceUIDs:h}=f.get(c);for(n=u.findIndex(e=>h.includes(e.displaySetInstanceUID))+e;n>-1&&n<u.length;n+=e){let e=u[n];if(!e.madeInClient&&(!r||!a.includes(e.Modality)))break}if(n<0||n>=u.length)return;let{displaySetInstanceUID:g}=u[n],m=[];try{m=i.getViewportsRequireUpdate(c,g,p)}catch(e){console.warn(e),o.show({title:"Navigate Viewport Display Set",message:"The requested display sets could not be added to the viewport due to a mismatch in the Hanging Protocol rules.",type:"info",duration:3e3})}t.run("setDisplaySetsForViewports",{viewportsToUpdate:m}),setTimeout(()=>d.scrollActiveThumbnailIntoView(),0)},createStoreFunction:({dataSource:e,defaultFileName:t,defaultContentType:n})=>{if("download"===e)return async e=>{let r=Array.isArray(e)?e:[e];if(aO(r),K.DicomMetadataStore.addInstances(r,!0),1!==r.length)throw Error("Download only supports a single DICOM instance");iC(eE(r[0]),{filename:t||"dicom.dcm"})};if("copyToClipboard"===e)return async e=>{let t=Array.isArray(e)?e:[e];if(aO(t),K.DicomMetadataStore.addInstances(t,!0),1!==t.length)throw Error("Copy to clipboard only supports a single DICOM instance");let r=eE(t[0]);await navigator.clipboard.write([new ClipboardItem({[n||"application/dicom"]:r})])};let a=r.getDataSources(e),i=a?.[0];return i?.store?.dicom?async(t,{dicomDict:r}={})=>{let n=Array.isArray(t)?t:[t];if(aO(n),"dicomlocal"!==e){let e=i.getConfig?.();e?.wadoRoot&&n.forEach(t=>{ek(t,"wadoRoot",e.wadoRoot)})}for(let e of((Array.isArray(n)?n:[n]).forEach(e=>(function(e,t){let r;if(!e)return;if(e.imageId)return e.imageId;try{r=t?.getImageIdsForInstance?.({instance:e})}catch(e){J().log.debug("Unable to derive the imageId of a stored instance",e)}if(!(r||=e.url)||"string"!=typeof r)return;ek(e,"imageId",r);let{StudyInstanceUID:n,SeriesInstanceUID:a}=e,i=e.SOPInstanceUID||e.SopInstanceUID;return n&&a&&i&&ak.addImageIdToUIDs(r,{StudyInstanceUID:n,SeriesInstanceUID:a,SOPInstanceUID:i}),r})(e,i)),K.DicomMetadataStore.addInstances(n,!0),n))await i.store.dicom(e,null,r);for(let e of new Set(n.map(e=>e.StudyInstanceUID).filter(Boolean)))i.deleteStudyMetadataPromise(e)}:null},launchDefaultMode:({study:e,workflows:t=[],defaultWorkflow:r,workflowId:n})=>{let a=n?t.find(e=>e.id===n):r??t[0];a?a.launchWithStudy(e):console.warn(n?`launchDefaultMode: workflow '${n}' is not applicable to the study`:"launchDefaultMode: no workflow is applicable to the study")}},f={multimonitor:d.multimonitor,promptSaveReport:d.promptSaveReport,loadStudy:d.loadStudy,showContextMenu:d.showContextMenu,closeContextMenu:d.closeContextMenu,clearMeasurements:d.clearMeasurements,displayNotification:d.displayNotification,setHangingProtocol:d.setHangingProtocol,toggleHangingProtocol:d.toggleHangingProtocol,navigateHistory:d.navigateHistory,nextStage:{commandFn:d.deltaStage,options:{direction:1}},previousStage:{commandFn:d.deltaStage,options:{direction:-1}},setViewportGridLayout:d.setViewportGridLayout,toggleOneUp:d.toggleOneUp,openDICOMTagViewer:d.openDICOMTagViewer,updateViewportDisplaySet:d.updateViewportDisplaySet,scrollActiveThumbnailIntoView:d.scrollActiveThumbnailIntoView,addDisplaySetAsLayer:d.addDisplaySetAsLayer,removeDisplaySetLayer:d.removeDisplaySetLayer,createStoreFunction:d.createStoreFunction,launchDefaultMode:{commandFn:d.launchDefaultMode,context:"WORKLIST"}};return{actions:d,definitions:f,defaultContext:"DEFAULT"}},getUtilityModule:({servicesManager:e})=>[{name:"common",exports:{getStudiesForPatientByMRN:na}}],getCustomizationModule:function({servicesManager:e,extensionManager:t}){return[{name:"helloPage",value:iQ},{name:"theme",value:sD},{name:"datasources",value:i1},{name:"multimonitor",value:i2},{name:"hideHeaderUndoRedo",value:s9},{name:"default",value:{...i3,...i5,...i6,...i9,...i7,...ot,...function({servicesManager:e,extensionManager:t}){return{"ohif.dataSourceConfigurationComponent":oo.bind(null,{servicesManager:e,extensionManager:t}),"ohif.dataSourceConfigurationAPI.google":r=>new oc(r,e,t)}}({servicesManager:e,extensionManager:t}),...od,...oh,...iZ,...og,...om,...oy,...ov,...ob,...oe,...oj,...s_,...sM,...sW,...s$,...sG,...sq,...{"workList.variant":"default","workList.previewSeriesView":"all","workList.columns":tl.StudyList.defaultColumns,"workList.renderPreviewContent":void 0,"workList.onStudyDoubleClick":{commandName:"launchDefaultMode"},"workList.settingsMenuItems":e=>e},...s6}}]}}})(),D})());
|