!function(e){"use strict";function t(e){return Array.isArray(e)&&"string"==typeof e[0]}function n(e){if(!t(e))return null;let n=e.slice();for(n.length<11&&1===Number(n[8])&&1!==Number(n[9])&&(n[9]=1);n.length<11;)n.push(-1);return n}function r(e,t){if(!t||"object"!=typeof t)return e;for(let[r,i]of Object.entries(t)){let t=n(i);t&&(e[String(r)]=t)}return e}function i(e){let t={};if(!e||"object"!=typeof e)return t;for(let n of Object.keys(e))t[String(n)]=!0;return t}function u(e,t){return null!=t&&""!==t&&!(!e?.bundleIds||!e.bundleIds[String(t)])}function l(e,n,r,i){if(!e?.bundleIds||!e?.items)return null;let u=String(n??"").trim();if(u&&e.bundleIds[u])return u;let l=new Set;for(let e of[i,r]){let t=o(e);t&&l.add(t)}if(!l.size)return null;for(let n of Object.keys(e.bundleIds)){let r=e.items[n];if(!t(r))continue;let i=o(r[0]),u=o(r[1]);if(l.has(i)||l.has(u))return n}return null}function o(e){return String(e||"").replace(/\s*#\d+\s*$/g,"").toLowerCase().replace(/[#,()\-:'`"]/g,"").replace(/\s+/g," ").trim()}e.RolimonsItemDetails={ROLIMONS_ITEM_DETAILS_URL:"https://api.rolimons.com/items/v3/itemdetails",ROW_DEMAND:5,ROW_VALUE:3,ROW_RAP:2,ROW_RARE:9,normalize_rolimons_item_details_payload:function(e){if(!e||"object"!=typeof e)return null;if(e.items&&"object"==typeof e.items){let t={};if(r(t,e.items),!Object.keys(t).length)return null;let n=e.bundleIds&&"object"==typeof e.bundleIds?e.bundleIds:{};return{success:!1!==e.success,item_count:Object.keys(t).length,items:t,bundleIds:n}}let t=e.assets,n=e.bundles;if(!("object"==typeof t&&t||"object"==typeof n&&n))return null;let u={};return r(u,t),r(u,n),Object.keys(u).length?{success:!1!==e.success,item_count:Object.keys(u).length,asset_count:"object"==typeof t&&t?Object.keys(t).length:0,bundle_count:"object"==typeof n&&n?Object.keys(n).length:0,items:u,bundleIds:i(n)}:null},normalize_item_row:n,normalize_item_name:o,get_item_demand:function(e){if(!t(e))return-1;let n=Number(e[5]);return Number.isFinite(n)?n:-1},get_item_value:function(e){if(!t(e))return 0;let n=Number(e[3]);if(Number.isFinite(n)&&n>=0)return n;let r=Number(e[4]);return Number.isFinite(r)&&r>=0?r:0},is_item_rare:function(e){return!!t(e)&&(1===Number(e[9])||(1===Number(e[8])&&e.length<11||1===Number(e[8])&&-1===Number(e[9])&&-1===Number(e[10])))},is_item_hyped:function(e){return!(!t(e)||e.length<11)&&(1===Number(e[8])&&1!==Number(e[9]))},find_item_row:function(e,n){let r=e?.items;if(!r||"object"!=typeof r)return null;let i=n?.rolimonsId,u=n?.robloxId,l=n?.name,s=!0===n?.isBundle;if(null!=i&&""!==i){let e=r[String(i)];if(e)return e}if(!s&&null!=u&&""!==u){let e=r[String(u)];if(e)return e}let f=o(l);if(!f)return null;for(let e of Object.values(r))if(t(e)&&o(e[0])===f)return e;return null},is_bundle_id:u,find_bundle_item_id:l,resolve_item_id:function(e,n,r,i){let u=l(e,n,r,i?.acronym);if(u)return u;let s=String(n??"").trim();if(!i?.isBundle&&s&&e?.items?.[s])return s;let f=o(r);if(!f||!e?.items)return null;for(let[n,r]of Object.entries(e.items))if(t(r)){if(o(r[0])===f)return n;if(o(r[1])===f)return n}return null},profile_url:function(e,t,n){let r=String(e??"").trim();return r?`https://www.rolimons.com/${!0===n?.isBundle||u(t,r)?"bundle":"item"}/${encodeURIComponent(r)}`:"https://www.rolimons.com/"}}}("undefined"!=typeof globalThis?globalThis:self);